Public Member Functions | Public Attributes

AdjEdgeList Class Reference

This reference page is linked to from the following overview topics: Mesh Related Classes.


Search for all occurrences

Detailed 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.

#include <meshadj.h>

Inheritance diagram for AdjEdgeList:
Inheritance graph
[legend]

List of all members.

Public Member Functions

DllExport  AdjEdgeList (Mesh &amesh)
DllExport  ~AdjEdgeList ()
DllExport void  AddEdge (DWORD fi, DWORD v1, DWORD v2)
DWORDTab operator[] (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

DWORDTab list
Tab< MEdge edges
int  nverts

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.
DllExport ~AdjEdgeList ( )
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.
{ return list[i]; }
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.
{ list[v].Append (1, &e); }

Member Data Documentation

int nverts

AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList
AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList AdjEdgeList