TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
G3D::MeshAlg::Edge Class Reference

#include <MeshAlg.h>

Public Member Functions

 Edge ()
 
bool containsVertex (int v) const
 
bool inFace (int f) const
 
bool boundary () const
 
Edge reverse () const
 

Public Attributes

int vertexIndex [2]
 
int faceIndex [2]
 

Detailed Description

Oriented, indexed edge

Constructor & Destructor Documentation

G3D::MeshAlg::Edge::Edge ( )
108  {
109  for (int i = 0; i < 2; ++i) {
110  vertexIndex[i] = 0;
111  // Negative face indices are faces that don't exist
112  faceIndex[i] = -1;
113  }
114 }
int vertexIndex[2]
Definition: MeshAlg.h:164
int faceIndex[2]
Definition: MeshAlg.h:175

Member Function Documentation

bool G3D::MeshAlg::Edge::boundary ( ) const
inline

Returns true if either faceIndex is NONE.

186  {
187  return (faceIndex[0] == Face::NONE) ||
188  (faceIndex[1] == Face::NONE);
189  }
static const int NONE
Definition: MeshAlg.h:103
int faceIndex[2]
Definition: MeshAlg.h:175

+ Here is the caller graph for this function:

bool G3D::MeshAlg::Edge::containsVertex ( int  v) const
inline
166  {
167  return contains(vertexIndex, 2, v);
168  }
int vertexIndex[2]
Definition: MeshAlg.h:164
bool contains(const T *array, int len, const T &e)
Definition: Array.h:1451

+ Here is the call graph for this function:

bool G3D::MeshAlg::Edge::inFace ( int  f) const
inline

Returns true if f is contained in the faceIndex array in either slot. To see if it is forward in that face, just check edge.faceIndex[0] == f.

179  {
180  return contains(faceIndex, 2, f);
181  }
int faceIndex[2]
Definition: MeshAlg.h:175
bool contains(const T *array, int len, const T &e)
Definition: Array.h:1451

+ Here is the call graph for this function:

Edge G3D::MeshAlg::Edge::reverse ( ) const
inline

Returns the reversed edge.

194  {
195  Edge e;
196  e.vertexIndex[0] = vertexIndex[1];
197  e.vertexIndex[1] = vertexIndex[0];
198  e.faceIndex[0] = faceIndex[1];
199  e.faceIndex[1] = faceIndex[0];
200  return e;
201  }
int vertexIndex[2]
Definition: MeshAlg.h:164
int faceIndex[2]
Definition: MeshAlg.h:175
Edge()
Definition: MeshAlg.cpp:108

Member Data Documentation

int G3D::MeshAlg::Edge::faceIndex[2]

The edge is directed forward in face 0 backward in face 1. Face index of MeshAlg::Face::NONE indicates a boundary (a.k.a. crack, broken) edge.

int G3D::MeshAlg::Edge::vertexIndex[2]

Degenerate edges may include the same vertex times.


The documentation for this class was generated from the following files: