|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jcae.mesh.amibe.ds.Triangle org.jcae.mesh.amibe.ds.TriangleVH
public class TriangleVH
A triangular element of the mesh. Instances of this class carry up
all topological information required for adjacency relations. Their
vertices are contained in a Vertex
array, and by convention
the local number of an edge is the index of its opposite vertex. A
TriangleVH
instance has a pointer to its three neighbours
through its edges, and knows the local number of opposite edges in
their respective triangles. It also stores as a byte array attributes
of its three edges.
As local numbers are integers between 0 and 2, a packed representation
is wanted to save space. They can be stored within 6 bits, edge 0
is stored in the two least significant bits, edge 1 in next two and edge
2 in next two, so adjPos=(localNumberSymEdge0<<0)+(localNumberSymEdge1<<2)+(localNumberSymEdge2<<4)
.
Vertices data are colored in black, edges in red and triangles in blue.
Triangle a
contains these members:
a.vertex = { A, B, C }
a.adjacentTriangles = { c, d, b }
a.adjPos = (0 << 0) + (1 << 2) + (0 << 0) = 2
There are two special cases:
AbstractHalfEdge.OUTER
attribute, and boundary edges have a AbstractHalfEdge.BOUNDARY
attribute.AbstractHalfEdge.OUTER
attribute, non-manifold edge and its symmetric edge
have a AbstractHalfEdge.NONMANIFOLD
attribute, and other two edges are used
to build a circular doubly-linked list of all symmetric edges.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jcae.mesh.amibe.ds.Triangle |
---|
Triangle.List |
Field Summary |
---|
Fields inherited from class org.jcae.mesh.amibe.ds.Triangle |
---|
readable, traits, traitsBuilder, vertex, writable |
Constructor Summary | |
---|---|
TriangleVH(TriangleTraitsBuilder ttb)
Constructor. |
Method Summary | |
---|---|
void |
clearAttributes(int attr)
Resets attributes for all edges of this triangle. |
void |
copy(Triangle that)
|
VirtualHalfEdge |
getAbstractHalfEdge()
Gets a VirtualHalfEdge instance bound to this triangle. |
VirtualHalfEdge |
getAbstractHalfEdge(AbstractHalfEdge that)
Gets a VirtualHalfEdge instance bound to this triangle. |
TriangleVH |
getAdj(int num)
Returns the adjacent TriangleVH through an edge. |
int |
getAdjLocalNumber(int num)
Gets local number of a symmetric edge. |
int |
getEdgeAttributes(int num)
Gets attributes of edge num . |
boolean |
hasAttributes(int attr)
Checks if some attributes of this triangle are set. |
void |
setAdj(int num,
TriangleVH link)
Sets TriangleVH adjacent to an edge. |
void |
setAdjLocalNumber(int num,
int pos)
Sets local number of a symmetric edge. |
void |
setAttributes(int attr)
Sets attributes for all edges of this triangle. |
void |
setEdgeAttributes(int num,
int attr)
Sets attributes of edge num . |
java.lang.String |
toString()
|
Methods inherited from class org.jcae.mesh.amibe.ds.Triangle |
---|
getGroupId, isReadable, isWritable, setGroupId, setReadable, setWritable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TriangleVH(TriangleTraitsBuilder ttb)
Method Detail |
---|
public final void copy(Triangle that)
copy
in class Triangle
public VirtualHalfEdge getAbstractHalfEdge()
VirtualHalfEdge
instance bound to this triangle.
This method allocates a new VirtualHalfEdge
instance and binds
it to this triangle.
getAbstractHalfEdge
in class Triangle
VirtualHalfEdge
instance bound to this trianglepublic VirtualHalfEdge getAbstractHalfEdge(AbstractHalfEdge that)
VirtualHalfEdge
instance bound to this triangle.
If argument is null, this method behaves as if no argument was passed.
Otherwise, argument is an existing VirtualHalfEdge
instance
which is bound to this triangle and returned.
getAbstractHalfEdge
in class Triangle
that
- either null
or an existing VirtualHalfEdge
instance which is modified
VirtualHalfEdge
instance bound to this trianglepublic TriangleVH getAdj(int num)
num
- the local number of this edge.
public void setAdj(int num, TriangleVH link)
num
- the local number of this edgelink
- adjacent TriangleVHpublic int getAdjLocalNumber(int num)
num
- edge local number
public void setAdjLocalNumber(int num, int pos)
num
- edge local numberpos
- local number of symmetric edgepublic int getEdgeAttributes(int num)
num
.
num
- local edge number
public void setEdgeAttributes(int num, int attr)
num
.
num
- local edge numberattr
- attributes to set on this edgepublic void setAttributes(int attr)
setAttributes
in class Triangle
attr
- attributes to set on edgespublic void clearAttributes(int attr)
clearAttributes
in class Triangle
attr
- attributes to reset on edgespublic boolean hasAttributes(int attr)
hasAttributes
in class Triangle
attr
- attributes to check
true
if any edge of this triangle has
one of these attributes set, false
otherwisepublic java.lang.String toString()
toString
in class Triangle
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |