| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jcae.mesh.amibe.ds.AbstractHalfEdge
org.jcae.mesh.amibe.ds.VirtualHalfEdge
public class VirtualHalfEdge
A handle to abstract half-edge instances.  When triangles are instances of
 TriangleVH class, adjacency relations are contained within
 triangles.  This VirtualHalfEdge class is a handle to an edge,
 it has a link to a triangle and contains a local number.  When a
 VirtualHalfEdge instance is traversing the mesh, its reference
 is not modified, but its instance variables are updated.  In order to
 prevent object allocations, we try to reuse VirtualHalfEdge
 objects as much as we can.
| Field Summary | |
|---|---|
| protected  int | attributesAttributes of this edge. | 
| protected  int | localNumberLocal number of this edge in this triangle. | 
| protected  TriangleVH | triTriangle connected to this edge. | 
| Fields inherited from class org.jcae.mesh.amibe.ds.AbstractHalfEdge | 
|---|
| BOUNDARY, int3, MARKED, NONMANIFOLD, OUTER, QUAD, SWAPPED, traits, traitsBuilder | 
| Constructor Summary | |
|---|---|
| VirtualHalfEdge()Sole constructor. | |
| VirtualHalfEdge(Triangle t,
                int o)Creates an object to handle data about a triangle. | |
| Method Summary | |
|---|---|
|  Vertex | apex()Returns apex of this edge. | 
|  double | area()Returns the area of triangle bound to this edge. | 
|  void | bind(TriangleVH t)Sets triangle tied to this object, and resets localNumber. | 
|  void | bind(TriangleVH t,
     int l)Sets the triangle tied to this object, and the localNumber. | 
| protected  boolean | canCollapse(Vertex n)Checks whether an edge can be contracted. | 
|  boolean | checkNewRingNormals(double[] newpt)Checks that triangles are not inverted if origin vertex is moved. | 
|  double | checkSwap3D(double minCos)Checks the dihedral angle of an edge. | 
|  double | checkSwap3D(double minCos,
            double maxLength) | 
|  void | clearAttributes(int attr)Resets attributes of this edge. | 
| protected  VirtualHalfEdge | collapse(Mesh m,
         Vertex v)Contracts an edge. | 
|  double | computeNormal3D()Computes the normal of this triangle. | 
|  double | computeNormal3DT()Computes the normal of an edge, in the triangle plane. | 
| protected static void | copyOTri(VirtualHalfEdge src,
         VirtualHalfEdge dest)Copies a VirtualHalfEdgeinstance into anotherVirtualHalfEdgeinstance. | 
|  Vertex | destination()Returns end vertex of this edge. | 
|  java.util.Iterator<AbstractHalfEdge> | fanIterator()Returns an iterator over triangle fans connected to this edge. | 
|  int | getLocalNumber()Returns edge local number. | 
|  double[] | getTempVector()Returns the temporary array TempD. | 
|  Triangle | getTri()Returns triangle tied to this edge. | 
|  void | glue(AbstractHalfEdge sym)Sets adjacency relations between two triangles. | 
|  boolean | hasAttributes(int attr)Checks if some attributes of this edge are set. | 
|  boolean | hasSymmetricEdge()Tells whether edge is connected to a symmetric edge. | 
|  boolean | isMutable()Checks whether an edge can be modified. | 
|  VirtualHalfEdge | next()Moves counterclockwise to following edge. | 
|  VirtualHalfEdge | next(AbstractHalfEdge that)Moves counterclockwise to following edge. | 
|  VirtualHalfEdge | nextOrigin()Moves counterclockwise to the following edge which has the same origin. | 
|  VirtualHalfEdge | nextOrigin(AbstractHalfEdge that)Moves counterclockwise to the following edge which has the same origin. | 
|  VirtualHalfEdge | nextOriginLoop()Moves counterclockwise to the following edge which has the same origin. | 
| protected static void | nextOTri(VirtualHalfEdge o,
         VirtualHalfEdge that)Copies a VirtualHalfEdgeinstance and move it counterclockwise to
 following edge. | 
|  Vertex | origin()Returns start vertex of this edge. | 
|  VirtualHalfEdge | prev()Moves counterclockwise to previous edge. | 
|  VirtualHalfEdge | prev(AbstractHalfEdge that)Moves counterclockwise to previous edge. | 
| protected static void | prevOTri(VirtualHalfEdge o,
         VirtualHalfEdge that)Copies a VirtualHalfEdgeinstance and move it counterclockwise to
 previous edge. | 
| protected  void | pullAttributes() | 
| protected  void | pushAttributes() | 
|  void | setApex(Vertex v)Sets apex of this edge. | 
|  void | setAttributes(int attr)Sets attributes of this edge. | 
|  void | setDestination(Vertex v)Sets end vertex of this edge. | 
|  void | setOrigin(Vertex v)Sets start vertex of this edge. | 
| protected  VirtualHalfEdge | split(Mesh m,
      Vertex v)Splits an edge. | 
| protected  VirtualHalfEdge | swap()Swaps an edge. | 
|  VirtualHalfEdge | sym()Moves to symmetric edge. | 
|  VirtualHalfEdge | sym(AbstractHalfEdge that)Moves to symmetric edge. | 
| protected static void | symOTri(VirtualHalfEdge o,
        VirtualHalfEdge that)Copies a VirtualHalfEdgeinstance and move to its symmetric edge. | 
|  java.lang.String | toString() | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
protected TriangleVH tri
protected int localNumber
protected int attributes
| Constructor Detail | 
|---|
public VirtualHalfEdge()
public VirtualHalfEdge(Triangle t,
                       int o)
t - geometrical triangleo - a number between 0 and 2 determining an edge| Method Detail | 
|---|
public final Triangle getTri()
getTri in class AbstractHalfEdgepublic final int getLocalNumber()
getLocalNumber in class AbstractHalfEdgepublic final void bind(TriangleVH t)
t - triangle tied to this object
public final void bind(TriangleVH t,
                       int l)
t - triangle tied to this objectl - local numberpublic final boolean hasAttributes(int attr)
hasAttributes in class AbstractHalfEdgeattr - attributes to check
true if this VirtualHalfEdge has one of
 these attributes set, false otherwisepublic final void setAttributes(int attr)
setAttributes in class AbstractHalfEdgeattr - attributes of this edgepublic final void clearAttributes(int attr)
clearAttributes in class AbstractHalfEdgeattr - attributes of this edge to clear outprotected final void pushAttributes()
protected final void pullAttributes()
public final boolean isMutable()
false if edge is a boundary or outside the mesh,
 true otherwise.public final VirtualHalfEdge sym()
sym in class AbstractHalfEdgepublic final VirtualHalfEdge sym(AbstractHalfEdge that)
that instance be a copy of current
 instance, move it to its symmetric edge and return
 this instance.  Current instance is not modified.
sym in class AbstractHalfEdgethat - instance where transformed edge is stored
public final VirtualHalfEdge next()
next in class AbstractHalfEdgepublic final VirtualHalfEdge next(AbstractHalfEdge that)
that instance be a copy of current
 instance, move it counterclockwise to next edge and
 return this instance.  Current instance is not modified.
next in class AbstractHalfEdgethat - instance where transformed edge is stored
public final VirtualHalfEdge prev()
prev in class AbstractHalfEdgepublic final VirtualHalfEdge prev(AbstractHalfEdge that)
that instance be a copy of current
 instance, move it counterclockwise to previous edge and
 return this instance.  Current instance is not modified.
prev in class AbstractHalfEdgethat - instance where transformed edge is stored
public final VirtualHalfEdge nextOrigin()
nextOrigin in class AbstractHalfEdgepublic final VirtualHalfEdge nextOrigin(AbstractHalfEdge that)
that instance be a copy of current
 instance, move it counterclockwise to the following edge which
 has the same origin and return this instance.  Current instance is
 not modified.
nextOrigin in class AbstractHalfEdgethat - instance where transformed edge is stored
public final VirtualHalfEdge nextOriginLoop()
nextOriginLoop in class AbstractHalfEdge
protected static final void copyOTri(VirtualHalfEdge src,
                                     VirtualHalfEdge dest)
VirtualHalfEdge instance into another VirtualHalfEdge
 instance.
src - VirtualHalfEdge being duplicateddest - already allocated VirtualHalfEdge where data are
              copied
protected static final void symOTri(VirtualHalfEdge o,
                                    VirtualHalfEdge that)
VirtualHalfEdge instance and move to its symmetric edge.
o - source VirtualHalfEdgethat - already allocated VirtualHalfEdge where data are
              copied
protected static final void nextOTri(VirtualHalfEdge o,
                                     VirtualHalfEdge that)
VirtualHalfEdge instance and move it counterclockwise to
 following edge.
o - source VirtualHalfEdgethat - already allocated VirtualHalfEdge where data are
              copied
protected static final void prevOTri(VirtualHalfEdge o,
                                     VirtualHalfEdge that)
VirtualHalfEdge instance and move it counterclockwise to
 previous edge.
o - source VirtualHalfEdgethat - already allocated VirtualHalfEdge where data are
              copiedpublic Vertex origin()
origin in class AbstractHalfEdgepublic Vertex destination()
destination in class AbstractHalfEdgepublic Vertex apex()
apex in class AbstractHalfEdgepublic final void setOrigin(Vertex v)
v - start vertex of this edgepublic final void setDestination(Vertex v)
v - end vertex of this edgepublic final void setApex(Vertex v)
v - apex of this edgepublic final void glue(AbstractHalfEdge sym)
glue in class AbstractHalfEdgesym - the edge tied to this objectpublic final boolean hasSymmetricEdge()
hasSymmetricEdge in class AbstractHalfEdgetrue if edge has a symmetric edge, false otherwise.public double computeNormal3DT()
getTempVector()public double computeNormal3D()
getTempVector()public double area()
area in class AbstractHalfEdgepublic double[] getTempVector()
public final double checkSwap3D(double minCos)
minCos - if the dot product of the normals to adjacent
    triangles is lower than monCos, then -1.0 is
    returned.
public final double checkSwap3D(double minCos,
                                double maxLength)
protected final VirtualHalfEdge swap()
swap in class AbstractHalfEdgejava.lang.IllegalArgumentException - if edge is on a boundary or belongs
 to an outer triangle.Mesh.edgeSwap(org.jcae.mesh.amibe.ds.AbstractHalfEdge)public final boolean checkNewRingNormals(double[] newpt)
checkNewRingNormals in class AbstractHalfEdgenewpt - the new position to be checked
false if the new position produces
    an inverted triangle, true otherwise.
 Warning: this method uses work[0] and work[1] temporary arrays.protected final boolean canCollapse(Vertex n)
canCollapse in class AbstractHalfEdgen - the resulting vertex
true if this edge can be contracted into the single vertex n, false otherwiseWarning: this method uses work[0], work[1] and work[2] temporary arrays.
protected final VirtualHalfEdge collapse(Mesh m,
                                         Vertex v)
collapse in class AbstractHalfEdgem - meshv - the resulting vertex
n and with the same apex
java.lang.IllegalArgumentException - if edge belongs to an outer triangle,
 because there would be no valid return value.  User must then run this
 method against symmetric edge, this is not done automatically.Mesh.edgeCollapse(org.jcae.mesh.amibe.ds.AbstractHalfEdge, org.jcae.mesh.amibe.ds.Vertex)
protected final VirtualHalfEdge split(Mesh m,
                                      Vertex v)
split in class AbstractHalfEdgem - meshv - vertex being inserted
nMesh.vertexSplit(org.jcae.mesh.amibe.ds.AbstractHalfEdge, org.jcae.mesh.amibe.ds.Vertex)public final java.util.Iterator<AbstractHalfEdge> fanIterator()
fanIterator in class AbstractHalfEdgepublic java.lang.String toString()
toString in class java.lang.Object| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||