Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ShUtil::ShMesh< M > Class Template Reference

ShMesh class stores a mesh using a half-edge data structure. More...

#include <ShMesh.hpp>

Inheritance diagram for ShUtil::ShMesh< M >:

Inheritance graph
[legend]
List of all members.

Public Types

typedef M MeshType
typedef M::Vertex Vertex
typedef M::Edge Edge
typedef M::Face Face
typedef std::set< Vertex * > VertexSet
typedef std::set< Edge * > EdgeSet
typedef std::set< Face * > FaceSet
typedef std::list< Vertex * > VertexList

Public Member Functions

 ShMesh ()
 Empty mesh constructor.
 ShMesh (const ShMesh< M > &other)
 Copy constructor Makes copies of vertices, edges, and faces and builds a mesh isomorphic other.
 ~ShMesh ()
 ShMesh destructor.
ShMesh< M > & operator= (const ShMesh< M > &other)
 Assignment Operator.
void clear ()
 removes all verts, edges, and faces in this mesh & deletes them
Face * addFace (const VertexList &vl)
 Adds a face to the mesh. The face contains the given vertices in order (do not repeat first vertex). Adds required edges and faces. The edge corresponding to vl(0) -> vl(1) is set to result->edge.
void removeFace (Face *f)
 Removes a face from the mesh. Deletes edges involed in the face, but not the vertices.
template<typename VertLess>
void mergeVertices ()
 Vertex merging function. Merges any vertices that are "equal" according to the StrictWeakOrdering functor VertLess.
void mergeEdges ()
 Edge merging function. Pairs up half-edges that match each other (i.e. e1.start = e2.end, e1.end = e2.start).
bool earTriangulate ()
 Triangulates by ear. returnst true if any triangles removed.

Public Attributes

VertexSet verts
EdgeSet edges
FaceSet faces

Protected Types

typedef std::map< Vertex *,
Vertex * > 
VertexMap
typedef std::map< Edge *,
Edge * > 
EdgeMap
typedef std::map< Face *,
Face * > 
FaceMap
typedef std::multimap< Vertex *,
Edge * > 
IncidenceMap
typedef IncidenceMap::value_type Incidence
typedef IncidenceMap::iterator IncidenceIterator
typedef std::pair< typename
IncidenceMap::iterator, typename
IncidenceMap::iterator > 
IncidenceRange

Protected Member Functions

void removeHalfEdge (Edge *e)
 Removes a half-edge from the mesh. If e->start->edge == this, then e->start->edge is set to a different element in the m_startMap;.
void insertHalfEdge (Edge *e)
 Adds e to the edges set and m_incidenceEdges incidence map.

Protected Attributes

IncidenceMap m_incidences

Detailed Description

template<typename M>
class ShUtil::ShMesh< M >

ShMesh class stores a mesh using a half-edge data structure.

Definition at line 138 of file ShMesh.hpp.


Member Function Documentation

template<typename M>
void ShUtil::ShMesh< M >::mergeEdges  ) 
 

Edge merging function. Pairs up half-edges that match each other (i.e. e1.start = e2.end, e1.end = e2.start).

Note that if there are multiple edges between start->end that match up with an edge, e, from end->start, one of them will be set to e->sym. Which one gets matched is undefined.

Definition at line 280 of file ShMeshImpl.hpp.

template<typename M>
void ShUtil::ShMesh< M >::removeHalfEdge Edge *  e  )  [protected]
 

Removes a half-edge from the mesh. If e->start->edge == this, then e->start->edge is set to a different element in the m_startMap;.

This is a private utility function that does not update e->face if e->face->edge == e.

Definition at line 341 of file ShMeshImpl.hpp.

Referenced by ShUtil::ShMesh< M >::removeFace().


The documentation for this class was generated from the following files:
Generated on Mon Jan 24 18:38:28 2005 for Sh by  doxygen 1.4.1