QEM::Edge Class Reference

This represents the adjacency of two connected vertices in a mesh, and is only to be used with the ProgMesh class. More...

#include <QEM_Edge.h>

List of all members.

Public Methods

 Edge (int FaceIndex1, int whichEdge, int VertexIndex1, int VertexIndex2)
void assertValid ()
void printDebugString ()
int edgeIndexFirst () const
 If we're adjacent to a first face, we actually know not only the index of the face, but also which of its 3 iterators points to us. More...

int edgeIndexSecond () const
int faceIndexFirst () const
int faceIndexSecond () const
bool hasFirstNeighbor () const
bool hasSecondNeighbor () const
bool hasFace (int faceIndex) const
bool isBorder () const
bool hasVertex (int vertexIndex) const
int getV1 () const
int getV2 () const
bool operator< (const Edge &e) const
 Edges are compared primarily by their Quadric Error Metric. More...

bool operator== (const Edge &e) const
bool operator!= (const Edge &e) const
mfloat getCachedCost () const
void setFace1 (int faceIndex, int whichEdge)
void setFace2 (int faceIndex, int whichEdge)
void removeFace1 ()
void removeFace2 ()
void setCachedCost (mfloat cost)
bool swapVertexIndex (int from1, int from2, int to)
 Every edge has two vertices. More...


Static Public Attributes

VertexArray * varray
 the "Edge" class has a static vertex array in it, which serves to help comparison of edge lengths, in "operator<()". More...


Detailed Description

This represents the adjacency of two connected vertices in a mesh, and is only to be used with the ProgMesh class.

Definition at line 25 of file QEM_Edge.h.


Member Function Documentation

int Edge::edgeIndexFirst   const
 

If we're adjacent to a first face, we actually know not only the index of the face, but also which of its 3 iterators points to us.

Member variables "face1" and "face2" are actually the (face-index * 3) + edge-index-in-face.

If our first face had index 5, and it's second (out of 3) edge iterator pointed to us, then we'd return (5*3) + 2.

So faceIndexFirst() returns a subset of the information returned by this method.

Definition at line 132 of file QEM_Edge.cpp.

int Edge::edgeIndexSecond   const
 

See also:
Edge::edgeIndexFirst()

Definition at line 145 of file QEM_Edge.cpp.

bool Edge::operator< const Edge &    e const
 

Edges are compared primarily by their Quadric Error Metric.

If those are equal, then they're compared by length.

Definition at line 38 of file QEM_Edge.cpp.

bool Edge::swapVertexIndex int    from1,
int    from2,
int    to
 

Every edge has two vertices.

If one of the vertices matches the "from", parameter, we replace it.

Note:
this method will not allow creation of degenerate edges, and it cannot be called on degenerate edges.

Definition at line 61 of file QEM_Edge.cpp.


Member Data Documentation

VertexArray * Edge::varray [static]
 

the "Edge" class has a static vertex array in it, which serves to help comparison of edge lengths, in "operator<()".

Todo:
Find a way to not have this be static. It's not thread safe, etc.

Definition at line 32 of file QEM_Edge.cpp.

Referenced by operator<(), and swapVertexIndex().


The documentation for this class was generated from the following files:
Generated on Tue May 21 03:35:16 2002 for Archimedes by doxygen1.2.15