|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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:
- Boundary edges; a virtual Triangle(outerVertex, v1, v2) is created,
and linked to this edge. This triangle has an
AbstractHalfEdge.OUTER
attribute, and boundary edges have a AbstractHalfEdge.BOUNDARY
attribute.
- Non-manifold edges; a virtual Triangle(outerVertex, v1, v2) is
also created, and linked to this edge. This triangle has an
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.
- See Also:
- Serialized Form
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
TriangleVH
public TriangleVH(TriangleTraitsBuilder ttb)
- Constructor.
Method Detail
copy
public final void copy(Triangle that)
- Overrides:
copy
in class Triangle
getAbstractHalfEdge
public VirtualHalfEdge getAbstractHalfEdge()
- Gets a
VirtualHalfEdge
instance bound to this triangle.
This method allocates a new VirtualHalfEdge
instance and binds
it to this triangle.
- Overrides:
getAbstractHalfEdge
in class Triangle
- Returns:
- a new
VirtualHalfEdge
instance bound to this triangle
getAbstractHalfEdge
public VirtualHalfEdge getAbstractHalfEdge(AbstractHalfEdge that)
- Gets a
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.
- Overrides:
getAbstractHalfEdge
in class Triangle
- Parameters:
that
- either null
or an existing VirtualHalfEdge
instance which is modified
- Returns:
- a
VirtualHalfEdge
instance bound to this triangle
getAdj
public TriangleVH getAdj(int num)
- Returns the adjacent TriangleVH through an edge.
- Parameters:
num
- the local number of this edge.
- Returns:
- the adjacent TriangleVH
setAdj
public void setAdj(int num,
TriangleVH link)
- Sets TriangleVH adjacent to an edge.
- Parameters:
num
- the local number of this edgelink
- adjacent TriangleVH
getAdjLocalNumber
public int getAdjLocalNumber(int num)
- Gets local number of a symmetric edge.
- Parameters:
num
- edge local number
- Returns:
- local number of this symmetric edge
setAdjLocalNumber
public void setAdjLocalNumber(int num,
int pos)
- Sets local number of a symmetric edge.
- Parameters:
num
- edge local numberpos
- local number of symmetric edge
getEdgeAttributes
public int getEdgeAttributes(int num)
- Gets attributes of edge
num
.
- Parameters:
num
- local edge number
- Returns:
- attributes of this edge
setEdgeAttributes
public void setEdgeAttributes(int num,
int attr)
- Sets attributes of edge
num
.
- Parameters:
num
- local edge numberattr
- attributes to set on this edge
setAttributes
public void setAttributes(int attr)
- Sets attributes for all edges of this triangle.
- Overrides:
setAttributes
in class Triangle
- Parameters:
attr
- attributes to set on edges
clearAttributes
public void clearAttributes(int attr)
- Resets attributes for all edges of this triangle.
- Overrides:
clearAttributes
in class Triangle
- Parameters:
attr
- attributes to reset on edges
hasAttributes
public boolean hasAttributes(int attr)
- Checks if some attributes of this triangle are set.
- Overrides:
hasAttributes
in class Triangle
- Parameters:
attr
- attributes to check
- Returns:
true
if any edge of this triangle has
one of these attributes set, false
otherwise
toString
public java.lang.String toString()
- Overrides:
toString
in class Triangle
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD