AdjEdgeList Class Reference

#include <meshadj.h>

Class Description

See also
Class DWORDTab, Template Class Tab, Class MEdge, Class Mesh.

Description:
This class represents an edge adjacency list for meshes. For any given vertex in a mesh this class has a table of DWORDs. These DWORDs are indices into the edge table (Tab<MEdge> edge). The edges table stores the edges adjacent to the vertex. So, each vertex has a list of indices into the edge list that give it the list of edges adjacent to the vertex. All methods of the class are implemented by the system.
Data Members:
DWORDTab *list;

This is an array of DWORDTabs, one per vertex. The Tab is a list of indices into the edge list, one for each edge adjacent to the vertex.

Tab<MEdge> edges;

The table of edges.

int nverts;

The size of list.
+ Inheritance diagram for AdjEdgeList:

Public Member Functions

DllExport AdjEdgeList (Mesh &amesh)
 
DllExport ~AdjEdgeList ()
 
DllExport void AddEdge (DWORD fi, DWORD v1, DWORD v2)
 
DWORDTaboperator[] (int i)
 
DllExport int FindEdge (DWORD v0, DWORD v1)
 
DllExport int FindEdge (DWORDTab &vmap, DWORD v0, DWORD v1)
 
DllExport void TransferEdges (DWORD from, DWORD to, DWORD except1, DWORD except2, DWORD del)
 
DllExport void RemoveEdge (DWORD from, DWORD e)
 
DllExport void OrderAllEdges (Face *faces)
 
DllExport void OrderVertEdges (DWORD v, Face *faces, Tab< DWORD > *flist=NULL)
 
DllExport void GetFaceList (DWORD v, Tab< DWORD > &flist)
 
DllExport void MyDebugPrint ()
 
void AddEdgeToVertex (DWORD v, DWORD e)
 

Public Attributes

DWORDTablist
 
Tab< MEdgeedges
 
int nverts
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Constructor & Destructor Documentation

DllExport AdjEdgeList ( Mesh amesh)
Remarks
Constructor. Builds an adjacency list from the specified mesh. This class require the mesh to be constructed so that each edge has exactly one or two faces.
Parameters:
Mesh& amesh

The mesh to build the adjacency list from.
Remarks
Destructor. Deletes the list.

Member Function Documentation

DllExport void AddEdge ( DWORD  fi,
DWORD  v1,
DWORD  v2 
)
Remarks
This is used internally.
Operators:
DWORDTab& operator[] ( int  i)
inline
Remarks
Array access operator. Returns the 'i-th' list element.
174 { return list[i]; }
DWORDTab * list
Definition: meshadj.h:155
DllExport int FindEdge ( DWORD  v0,
DWORD  v1 
)
Remarks
Finds the edge in the edge table that has the two specified vertices.
Parameters:
DWORD v0, DWORD v1

The vertices.
Returns
The index into the edge table.
DllExport int FindEdge ( DWORDTab vmap,
DWORD  v0,
DWORD  v1 
)
Remarks
This method is used internally as part of the Optimize modifier.
DllExport void TransferEdges ( DWORD  from,
DWORD  to,
DWORD  except1,
DWORD  except2,
DWORD  del 
)
Remarks
This method is used internally as part of the Optimize modifier.
DllExport void RemoveEdge ( DWORD  from,
DWORD  e 
)
Remarks
This method is used internally as part of the Optimize modifier.
DllExport void OrderAllEdges ( Face faces)
Remarks
This method simply calls OrderVertEdges() on all the vertices.
Parameters:
Face *faces

A pointer to the faces for this mesh.
DllExport void OrderVertEdges ( DWORD  v,
Face faces,
Tab< DWORD > *  flist = NULL 
)
Remarks
Each vertex has a list of edges in the data member AdjEdgeList::list. This method reorders the elements of that list so that the edges are in order going around the vertex. The direction should be counterclockwise as seen from outside the mesh surface, though this necessarily breaks down with some rats' nest situations.
Parameters:
DWORD v

The vertex whose edges should be ordered.

Face *faces

A pointer to the faces for this mesh.

Tab<DWORD> *flist=NULL

If non-NULL, this points to an array where the faces using this vertex should be stored (in order).
DllExport void GetFaceList ( DWORD  v,
Tab< DWORD > &  flist 
)
Remarks
This places a list of all faces using this vertex in flist. The faces are in no particular order.
Parameters:
DWORD v

The vertex to check.

Tab<DWORD> & flist

The table of faces.
DllExport void MyDebugPrint ( )
void AddEdgeToVertex ( DWORD  v,
DWORD  e 
)
inline
Remarks
Appends the specified edge to the specified vertex.
Parameters:
DWORD v

The vertex the edge is added to.

DWORD e

The edge to add.
227 { list[v].Append (1, &e); }
int Append(int num, T *el, int allocExtra=0)
Appends items at the end of the Tab.
Definition: tab.h:281
DWORDTab * list
Definition: meshadj.h:155

Member Data Documentation

DWORDTab* list
Tab<MEdge> edges
int nverts