TrinityCore
G3D::MeshAlg::Face Class Reference

`#include <MeshAlg.h>`

## Public Member Functions

Face ()

bool containsVertex (int v) const

bool containsEdge (int e) const

bool containsDirectedEdge (int e) const

## Public Attributes

int vertexIndex [3]

int edgeIndex [3]

## Static Public Attributes

static const int NONE = INT_MIN

## Detailed Description

Oriented, indexed triangle.

## Constructor & Destructor Documentation

 G3D::MeshAlg::Face::Face ( )
100  {
101  for (int i = 0; i < 3; ++i) {
102  edgeIndex[i] = 0;
103  vertexIndex[i] = 0;
104  }
105 }
int vertexIndex[3]
Definition: MeshAlg.h:110
int edgeIndex[3]
Definition: MeshAlg.h:141

## Member Function Documentation

 bool G3D::MeshAlg::Face::containsDirectedEdge ( int e ) const
inline

Contains the forward edge e if e >= 0 and the backward edge ~e otherwise.

152  {
153  return contains(edgeIndex, 3, e);
154  }
bool contains(const T *array, int len, const T &e)
Definition: Array.h:1451
int edgeIndex[3]
Definition: MeshAlg.h:141

Here is the call graph for this function:

 bool G3D::MeshAlg::Face::containsEdge ( int e ) const
inline
143  {
144  if (e < 0) {
145  e = ~e;
146  }
147  return contains(edgeIndex, 3, e) || contains(edgeIndex, 3, ~e);
148  }
bool contains(const T *array, int len, const T &e)
Definition: Array.h:1451
int edgeIndex[3]
Definition: MeshAlg.h:141

Here is the call graph for this function:

 bool G3D::MeshAlg::Face::containsVertex ( int v ) const
inline
112  {
113  return contains(vertexIndex, 3, v);
114  }
int vertexIndex[3]
Definition: MeshAlg.h:110
bool contains(const T *array, int len, const T &e)
Definition: Array.h:1451

Here is the call graph for this function:

## Member Data Documentation

 int G3D::MeshAlg::Face::edgeIndex[3]

Edge indices in counter-clockwise order. Edges are undirected, so it is important to know which way each edge is pointing in a face. This is encoded using negative indices.

If `edgeIndex[i] >= 0` then this face contains the directed edge between vertex indices `edgeArray[face.edgeIndex[i]].vertexIndex[0]` and `edgeArray[face.edgeIndex[i]].vertexIndex[1]`.

If `edgeIndex[i] < 0` then `~edgeIndex[i]` (i.e. the two's complement of) is used and this face contains the directed edge between vertex indices `edgeArray[~face.edgeIndex[i]].vertexIndex[0]` and `edgeArray[~face.edgeIndex[i]].vertexIndex[1]`.

Degenerate faces may include the same edge multiple times.

 const int G3D::MeshAlg::Face::NONE = INT_MIN
static

Used by Edge::faceIndex to indicate a missing face. This is a large negative value.

 int G3D::MeshAlg::Face::vertexIndex[3]

Vertices in the face in counter-clockwise order. Degenerate faces may include the same vertex multiple times.

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