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

Classes

class  Edge
 
class  Iterator
 

Public Types

typedef SmallArray< int, 2 > FaceIndexArray
 
typedef SmallArray< Edge, 6 > EdgeArray
 
typedef Array< EdgeArray > ET
 

Public Member Functions

 MeshEdgeTable ()
 
void clear ()
 
void resize (int maxV)
 
void insert (int v0, int v1, int faceIndex)
 
Iterator begin ()
 

Private Attributes

ET table
 

Detailed Description

Two-level table mapping index 0 -> index 1 -> list of face indices

Member Typedef Documentation

We expect at most 6 edges per vertex; that matches a typical regular grid mesh

We expect 2 faces per edge.

Constructor & Destructor Documentation

G3D::MeshEdgeTable::MeshEdgeTable ( )
inline
47  {
50  }
static MemoryManager::Ref create()
Definition: MemoryManager.cpp:35
shared_ptr< AreaMemoryManager > Ref
Definition: AreaMemoryManager.h:60
void clearAndSetMemoryManager(const MemoryManager::Ref &m)
Definition: Array.h:411
ET table
Definition: MeshAlgAdjacency.cpp:43

+ Here is the call graph for this function:

Member Function Documentation

Iterator G3D::MeshEdgeTable::begin ( )
inline
145  {
146  return Iterator(table);
147  }
ET table
Definition: MeshAlgAdjacency.cpp:43

+ Here is the caller graph for this function:

void G3D::MeshEdgeTable::clear ( )
inline
52  {
53  table.clear();
54  }
void clear(bool shrink=true)
Definition: Array.h:407
ET table
Definition: MeshAlgAdjacency.cpp:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G3D::MeshEdgeTable::insert ( int  v0,
int  v1,
int  faceIndex 
)
inline

Inserts the faceIndex into the edge's face list. The index may be a negative number indicating a backface.

Parameters
v0Vertex index 0
v1Vertex index 1
67  {
68 
69  debugAssert(v0 <= v1);
70  EdgeArray& edgeArray = table[v0];
71  for (int i = 0; i < edgeArray.size(); ++i) {
72  if (edgeArray[i].i1 == v1) {
73  edgeArray[i].faceIndexArray.push(faceIndex);
74  return;
75  }
76  }
77 
78  Edge& p = edgeArray.next();
79  p.i1 = v1;
80  p.faceIndexArray.push(faceIndex);
81  }
void push(const T &value)
Definition: Array.h:770
#define debugAssert(exp)
Definition: debugAssert.h:160
ET table
Definition: MeshAlgAdjacency.cpp:43
SmallArray< Edge, 6 > EdgeArray
Definition: MeshAlgAdjacency.cpp:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G3D::MeshEdgeTable::resize ( int  maxV)
inline
56  {
57  table.resize(maxV);
58  }
void resize(size_t n, bool shrinkIfNecessary=true)
Definition: Array.h:490
ET table
Definition: MeshAlgAdjacency.cpp:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

ET G3D::MeshEdgeTable::table
private

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