public class SOT extends java.lang.Object implements CornerTableInterface
Modifier and Type | Field and Description |
---|---|
int[] |
O
vertex table of size 3*F: store for each corner its incident vertex
|
Constructor and Description |
---|
SOT(int n,
int[] O,
float[] coordF)
Create a Sorted Opposite Table (SOT) representation of a (closed) triangle mesh.
|
Modifier and Type | Method and Description |
---|---|
boolean |
adjacent(int v,
int w)
Check whether two vertices 'v' and 'w' are adjacent.
|
boolean |
b(int c)
Check whether 'c' is a border corner
|
boolean |
checkValidity()
Check the combinatorial validity of the data structure
|
int |
getCorner(int v)
Return a corner incident to vertex 'v'.
|
int |
getCornerInFace(int f,
int index)
Return the i-th corner in a face 'f'
|
java.lang.String |
getMemoryCost()
Get the total memory cost for storing the combinatorial structure
|
float[] |
getNormalFloat(int v)
Return the normal to a vertex in the mesh (simple float precision)
|
float[] |
getPoint(int v)
Return the geometric coordinates of vertex v (simple float precision)
|
float |
getX(int v)
Return the x-coordinate of vertex v
|
float |
getY(int v)
Return the y-coordinate of vertex v
|
float |
getZ(int v)
Return the z-coordinate of vertex v
|
int |
l(int c)
"Tip on left": return the corner opposite to n(c) in the triangle at the left
|
int[] |
listing(int v)
Return an array storing all neighbors of vertex 'v'.
|
int |
n(int c)
Return the next corner in the triangle containing 'c'
|
java.lang.String |
name()
Return the name of the data structure
|
int |
o(int c)
Return the opposite corner of a corner 'c'
|
int |
p(int c)
Return the previous corner of a corner 'c'
|
void |
print()
Print some info (for debugging)
|
static void |
printTable(int[] t) |
int |
r(int c)
"Tip on right": return the corner opposite to n(c) in the triangle at the right
|
void |
setCorner(int v,
int c)
Set an incident corner for 'v'
|
void |
setOpposite(int c,
int o)
Set the opposite corner of a given corner 'c'
|
void |
setPoint(int v,
float x,
float y,
float z)
Set the geometric coordinates of vertex v
|
void |
setVertex(int c,
int vertex)
Set the incidence between a corner and a vertex
|
int |
sizeOfFaces() |
int |
sizeOfVertices() |
int |
sl(int c)
"Swing on left": return the previous corner around the vertex 'v' incident to 'c'
|
int |
sr(int c)
"Swing on right": return the corner following 'c' around its incident vertex
|
int |
t(int c)
Return the triangle containing corner 'c'
|
java.lang.String |
toString()
Return a String describing the data structure references
|
int |
v(int c)
Return the vertex incident to a corner 'c'
|
java.lang.String |
vectorToString(float[] u) |
int |
vertexDegree(int v)
Compute the degree of a vertex: it traverse all corners incident to 'v'.
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
vectorToString
public SOT(int n, int[] O, float[] coordF)
n
- number of verticesO
- opposite table (an array of size 3*F)coordF
- an array of size 3*n storing the geometric coordinates of the 'n' verticespublic void setVertex(int c, int vertex)
setVertex
in interface CornerTableInterface
c
- cornervertex
- vertex index to the corner 'c'public void setOpposite(int c, int o)
setOpposite
in interface CornerTableInterface
c
- cornero
- opposite cornerpublic void setCorner(int v, int c)
setCorner
in interface CornerTableInterface
v
- a vertexc
- a corner incident to 'v'public void setPoint(int v, float x, float y, float z)
setPoint
in interface CornerTableInterface
v
- the index of the vertexpublic int t(int c)
t
in interface CornerTableInterface
public int v(int c)
v
in interface CornerTableInterface
public int o(int c)
o
in interface CornerTableInterface
public boolean b(int c)
b
in interface CornerTableInterface
public int n(int c)
n
in interface CornerTableInterface
public int p(int c)
p
in interface CornerTableInterface
public int l(int c)
l
in interface CornerTableInterface
public int r(int c)
r
in interface CornerTableInterface
public int sr(int c)
sr
in interface CornerTableInterface
public int sl(int c)
sl
in interface CornerTableInterface
public int getCorner(int v)
getCorner
in interface CornerTableInterface
v
- a vertexpublic int getCornerInFace(int f, int index)
getCornerInFace
in interface CornerTableInterface
f
- a faceindex
- an index in [0, 1, 2]public float[] getPoint(int v)
getPoint
in interface CornerTableInterface
v
- the index of the vertexpublic float getX(int v)
getX
in interface CornerTableInterface
public float getY(int v)
getY
in interface CornerTableInterface
public float getZ(int v)
getZ
in interface CornerTableInterface
public int sizeOfVertices()
sizeOfVertices
in interface Jcg.mesh.arraybased.NavigationInterface
sizeOfVertices
in interface CornerTableInterface
public int sizeOfFaces()
sizeOfFaces
in interface CornerTableInterface
public int vertexDegree(int v)
vertexDegree
in interface Jcg.mesh.arraybased.NavigationInterface
vertexDegree
in interface CornerTableInterface
v
- vertex (an index between [0..n-1])public float[] getNormalFloat(int v)
getNormalFloat
in interface Jcg.mesh.arraybased.NavigationInterface
getNormalFloat
in interface CornerTableInterface
public boolean adjacent(int v, int w)
adjacent
in interface Jcg.mesh.arraybased.NavigationInterface
adjacent
in interface CornerTableInterface
public int[] listing(int v)
listing
in interface Jcg.mesh.arraybased.NavigationInterface
listing
in interface CornerTableInterface
v
- index of a vertexpublic java.lang.String toString()
toString
in interface CornerTableInterface
toString
in class java.lang.Object
public boolean checkValidity()
checkValidity
in interface CornerTableInterface
public java.lang.String name()
name
in interface Jcg.mesh.arraybased.NavigationInterface
name
in interface CornerTableInterface
public void print()
print
in interface CornerTableInterface
public java.lang.String getMemoryCost()
getMemoryCost
in interface CornerTableInterface
public java.lang.String vectorToString(float[] u)
public static void printTable(int[] t)