public class MeshEncoder
extends java.lang.Object
The triangulation is encoded with a bit string of size 4n:
-) the red tree is traversed in a Depth First manner: its edges are encoded with a balanced parenthesis word, of size 2(n-1) (the vertex v0 is not encoded)
-) the remaining bits represent the in-degree of black edges: number of black edges oriented toward a given vertex.
Modifier and Type | Field and Description |
---|---|
StringEncoderTwoWords |
encoding
encoding of the mesh (based on two binary strings): it provides methods for scanning (for reading and writing) the string encoding the mesh
|
Constructor and Description |
---|
MeshEncoder(PlanarTriSchnyderWood cut)
Initialize the encoder
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkOrientation()
Check the edge orientations and vertex labels
|
void |
encode()
Perform the encoding of the triangulation into a binary string
|
java.lang.String |
printEdge(Halfedge e)
Print the orientation and coloring of all vertices
|
java.lang.String |
printOrientation()
Print the orientation and coloring of all vertices
|
void |
writeToBinaryFile(java.lang.String output)
Write the encoding of the triangulation to a binary file
|
void |
writeToFile(java.lang.String output)
Write the encoding of the triangulation to a file (in text format)
|
public StringEncoderTwoWords encoding
public MeshEncoder(PlanarTriSchnyderWood cut)
cut
- the planar triangulation endowed with a Schnyder woodpublic void encode()
public boolean checkOrientation()
public java.lang.String printOrientation()
public void writeToFile(java.lang.String output)
public void writeToBinaryFile(java.lang.String output)
Warning: it works only for 3d triangle meshes of genus 0 (without boundaries). Vertices must have 3d coordinates
public java.lang.String printEdge(Halfedge e)