Main Page   Class Hierarchy   Compound List   File List   Compound Members  

GeMeshWingedEdge Class Reference

Add-on for GeMesh class to store winged-edge data structure. More...

#include <freecloth/geom/geMeshWingedEdge.h>

Inheritance diagram for GeMeshWingedEdge:

Inheritance graph
[legend]
Collaboration diagram for GeMeshWingedEdge:

Collaboration graph
[legend]
List of all members.

Public Types

typedef EdgeIteratorBase<
true > 
HalfEdgeIterator
 Half edge iterator class.

typedef EdgeIteratorBase<
false > 
EdgeIterator
 Edge iterator class.

typedef VertexEdgeIteratorBase<
true > 
VertexHalfEdgeIterator
 Iterator for halfedges incident on vertex.

typedef VertexEdgeIteratorBase<
false > 
VertexEdgeIterator
 Iterator for edges incident on vertex.

typedef UInt32 HalfEdgeId
 Half edge index.

typedef HalfEdgeWrapper HalfEdgeType
 Half edge facade class.


Public Member Functions

 GeMeshWingedEdge (const RCShdPtr< GeMesh > &)
UInt32 getNbHalfEdges () const
HalfEdgeType getHalfEdge (HalfEdgeId) const
HalfEdgeIterator beginHalfEdge () const
HalfEdgeIterator endHalfEdge () const
EdgeIterator beginEdge () const
EdgeIterator endEdge () const
VertexHalfEdgeIterator beginVertexHalfEdge (VertexId) const
VertexHalfEdgeIterator endVertexHalfEdge (VertexId) const
VertexEdgeIterator beginVertexEdge (VertexId) const
 ! Iterate over all edges that touch vertexId. This will only iterate once

VertexEdgeIterator endVertexEdge (VertexId) const
VertexFaceIterator beginVertexFace (VertexId) const
VertexFaceIterator endVertexFace (VertexId) const
HalfEdgeId getHalfEdgeFromFaceId (FaceId) const
const RCShdPtr< GeMesh > & getMeshPtr () const
const GeMeshgetMesh () const

Private Types

typedef std::vector< HalfEdgeHalfEdgeContainer

Private Member Functions

void build (const GeMesh &)
 Construction-time function to fill data members.


Private Attributes

RCShdPtr< GeMesh_mesh
HalfEdgeContainer _halfEdges
std::vector< HalfEdgeId_vertexHalfEdgeIds
 Array containing the index of one half-edge for each vertex.

std::vector< HalfEdgeId_faceHalfEdgeIds
 Array containing the index of one half-edge for each face.


Friends

class HalfEdgeWrapper
class VertexEdgeIteratorBase< false >
class VertexEdgeIteratorBase< true >
class VertexFaceIterator

Detailed Description

Add-on for GeMesh class to store winged-edge data structure.

Allows more general traversal of a mesh. The winged-edge representation focuses on an entity known as the "half edge," where each edge separating two faces of the mesh is represented by two independent twinned half-edges, one associated with each face. Each half edge points from an "origin" vertex to a "tip" vertex, in a counter-clockwise direction within the face.

In computational geometry, the "planar subdivision" data structure operates in a similar manner in two dimensions, but adds a special face for the outside world beyond the mesh. We do not have any such outside face, and there may yet be some bugs in the code due to this limitation.

This approach can only handle a limited set of topologies. Disc and sphere topology should be fine. Only one component is allowed, and faces must all point in the same direction. There aren't much of any assertions to enforce this.

Using the winged-edge data structure, we can easily

We allow iteration over both half-edges and "edges". Edge iteration still iterates over half-edge objects; it just changes the iteration metaphor to only include one of each pair of twinned half-edges.

The winged edge data structure extends the standard mesh data structure, and we hence keep a pointer to the source mesh. The winged edge data is only dependent upon the mesh topology, which is immutable after construction.

Wrapper/ConstIterator classes are direct rips of GeMesh::FaceWrapper / ConstIterator. Some day, I should try to make a general-purpose class to do this stuff...

Definition at line 90 of file geMeshWingedEdge.h.


Member Function Documentation

GeMeshWingedEdge::VertexHalfEdgeIterator GeMeshWingedEdge::beginVertexHalfEdge VertexId    const [inline]
 

Iterate over half-edges whose origin is vertexId. Note that this may not include all edges - any vertex that lies on the boundary will have two edges w/o twins, and one of these will not be included.

Definition at line 78 of file geMeshWingedEdge.inline.h.


The documentation for this class was generated from the following files:
Generated on Wed Apr 23 15:58:54 2003 for Freecloth by doxygen1.3-rc3