The Parametric Pseudo-Manifold (PPS) Library 1.0
|
The Mesh
object is assumed to have twenty six methods, which form the generic mesh API. These methods are accessed by the PPS
code through the pointer pps::PPS::_mesh
. As we mentioned before, the mesh data structure is also assumed to have the elements Face
, Vertex
, Edge
, and Halfedge
. So, in the beginning of the definition of class PPS
, we define those types as:
typedef typename Mesh::Vertex Vertex ; typedef typename Mesh::Halfedge Halfedge ; typedef typename Mesh::Edge Edge ; typedef typename Mesh::Face Face ;
So, the user must make sure that her/his mesh data structure defines those elements as well.
We also define iterators for faces, edges, and vertices of the mesh inside class PPS:
typedef typename Mesh::VertexIterator VertexIterator ; typedef typename Mesh::EdgeIterator EdgeIterator ; typedef typename Mesh::FaceIterator FaceIterator ;
Here, we list and discuss all pure virtual methods of the PPS library, which must be implemented by the user. There are exactly 26 methods related to the generic mesh API:
virtual bool mesh_has_boundary() const = 0 ;
determines if the mesh given to the PPS
class constructor has an empty boundary, which must always be the case. So, the method is used by the PPS
class constructor to assert a pre-condition.
virtual bool mesh_is_simplicial() const = 0 ;
determines if the mesh given to the PPS
class constructor is indeed a triangle mesh boundary, which must always be the case. So, the method is used by the PPS
class constructor to verify a pre-condition.
virtual Vertex* get_org( Halfedge* h ) const = 0 ;
returns the origin vertex of a given half-edge of the input triangle mesh.
virtual Vertex* get_dst( Halfedge* h ) const = 0 ;
returns the destination vertex of a given half-edge of the input triangle mesh.
virtual Edge* get_edge( Halfedge* h ) const = 0 ;
returns the edge a given half-edge of the input triangle mesh belongs to.
virtual Face* get_face( Halfedge* h ) const = 0 ;
returns the face a given half-edge of the input triangle mesh belongs to.
virtual Halfedge* get_prev( Halfedge* h ) const = 0 ;
returns the half-edge that precedes a given input triangle mesh half-edge in the face cycle of half-edges that contains both half-edges.
virtual Halfedge* get_next( Halfedge* h ) const = 0 ;
returns the half-edge that succeeds a given input triangle mesh half-edge in the face cycle of half-edges that contains both half-edges.
virtual Halfedge* get_mate( Halfedge* h ) const = 0 ;
returns the mate of a given half-edge of the input triangle mesh.
virtual Halfedge* get_halfedge( Face* face ) const = 0 ;
returns the first half-edge of the cycle of half-edges of a given face of the input triangle mesh.
virtual Halfedge* get_halfedge( Vertex* vertex ) const = 0 ;
returns one half-edge with origin at a given vertex of the input triangle mesh. It is assumed that this method will always return the same half-edge (as more than one half-edge may have the same origin vertex).
virtual unsigned int get_degree( Vertex* vertex ) const = 0 ;
returns the degree of a given vertex of the input triangle mesh. The degree of a vertex is the number of edges incident to the vertex.
virtual Bezier* get_shape_function( Vertex* vertex ) const = 0 ;
returns the shape function associated with a given vertex of the triangle mesh. The shape function is a rectangular Bézier patch. Note that this shape function is not given as input, but calculated by the PPS
class constructor for each vertex of the input triangle mesh. However, the user data structure must provide a vertex attribute that is a pointer to a Bézier patch, so that the PPS
class constructor can store the Bézier patch along with the vertex.
virtual void set_shape_function( Vertex* vertex, Bezier* patch ) = 0 ;
assigns a shape function to a given vertex of the input triangle mesh.
virtual VertexIterator vertices_begin() const = 0 ;
creates a sequence of vertices of the input triangle mesh and then returns a vertex iterator to the first vertex of this sequence.
virtual bool is_done( const VertexIterator& iterator ) const = 0 ;
returns a logic value true if a given vertex iterator has reached the end of its associated vertex sequence; otherwise, it returns the logic value false.
virtual void move_forward( VertexIterator& iterator ) const = 0 ;
makes a vertex iterator point to the vertex succeeding its currently pointed vertex in its associated input triangle mesh vertex sequence.
virtual Vertex* get_vertex( const VertexIterator& iterator ) const = 0 ;
returns the current input triangle mesh vertex of the sequence associated with a given vertex iterator.
virtual EdgeIterator edges_begin() const = 0 ;
creates a sequence of edges of the input triangle mesh and then returns an edge iterator pointing to the first edge of this sequence.
virtual bool is_done( const EdgeIterator& iterator ) const = 0 ;
returns a logic value true if a given edge iterator has reached the end of its associated edge sequence; otherwise, it returns the logic value false.
virtual void move_forward( EdgeIterator& iterator ) const = 0 ;
makes an edge iterator point to the edge succeeding its currently pointed edge in its associated input triangle mesh edge sequence.
virtual Edge* get_edge( const EdgeIterator& iterator ) const = 0 ;
returns the current input triangle mesh edge of the sequence associated with a given edge iterator.
virtual FaceIterator faces_begin() const = 0 ;
creates a sequence of faces of the input triangle mesh and then returns a face iterator pointing to the first face of this sequence.
virtual bool is_done( const FaceIterator& iterator ) const = 0 ;
returns a logic value true if a given face iterator has reached the end of its associated face sequence; otherwise, it returns the logic value false.
virtual void move_forward( FaceIterator& iterator ) const = 0 ;
makes a face iterator point to the face succeeding its currently pointed face in its associated input triangle mesh face sequence.
virtual Face* get_face( const FaceIterator& iterator ) const = 0 ;
returns the current input triangle mesh face of the sequence associated with a given face iterator.