VCG Library 0.1
vcg::tri::HalfEdgeTopology< MeshType > Class Template Reference

Class containing functions to modify the topology of a halfedge based mesh. More...

#include <halfedge_topology.h>

Static Public Member Functions

static VertexPointer edge_collapse_quad (MeshType &m, EdgePointer ep, VertexPointer vp)
 
static VertexPointer diagonal_collapse (MeshType &m, FacePointer fp, VertexPointer vp)
 
static FacePointer doublet_remove (MeshType &m, VertexPointer vp)
 
static EdgePointer singlet_remove (MeshType &m, FacePointer fp)
 
static EdgePointer edge_rotate (MeshType &m, EdgePointer ep, bool cw)
 
static VertexPointer vertex_rotate (VertexPointer vp)
 
static VertexPointer edge_collapse (MeshType &m, EdgePointer ep, VertexPointer vp)
 
static FacePointer add_face (MeshType &m, vector< VertexPointer > &vps, GarbagePointer gp=NULL)
 
static bool remove_face (MeshType &m, FacePointer fp, GarbagePointer gp=NULL)
 
static bool can_remove_face (FacePointer fp)
 
static vector< VertexPointer > getVertices (FacePointer fp, HEdgePointer starting_he=NULL)
 
static vector< FacePointer > get_incident_faces (VertexPointer vp, HEdgePointer starting_he=NULL)
 

Static Protected Member Functions

static FacePointer add_face_unsafe (MeshType &m, vector< VertexPointer > &vps, GarbagePointer gp=NULL)
 
static FacePointer add_face_unsafe (MeshType &m, vector< VertexPointer > &vps, vector< HEdgePointer > &hps, vector< bool > &non_manifold_vertices, GarbagePointer gp)
 
static void remove_face_unsafe (MeshType &m, FacePointer fp, GarbagePointer gp=NULL)
 
static bool can_add_hedge (vector< VertexPointer > &vps, vector< HEdgePointer > &hps)
 
static vector< HEdgePointer > getHEdges (FacePointer fp, HEdgePointer starting_he=NULL)
 
static void change_vertex (VertexPointer old_vp, VertexPointer new_vp)
 

Detailed Description

template<class MeshType>
class vcg::tri::HalfEdgeTopology< MeshType >

Class containing functions to modify the topology of a halfedge based mesh.

Member Function Documentation

◆ add_face()

template<class MeshType >
static FacePointer vcg::tri::HalfEdgeTopology< MeshType >::add_face ( MeshType & m,
vector< VertexPointer > & vps,
GarbagePointer gp = NULL )
inlinestatic

Adds a face in a mesh, checking if the operation is possible.

Parameters
mMesh
vpsVector of vertices (in ccw order) that will belong to the new face
Returns
Pointer to the new face if it has been inserted, NULL otherwise

◆ add_face_unsafe() [1/2]

template<class MeshType >
static FacePointer vcg::tri::HalfEdgeTopology< MeshType >::add_face_unsafe ( MeshType & m,
vector< VertexPointer > & vps,
GarbagePointer gp = NULL )
inlinestaticprotected

Adds a face in a mesh without any check

Parameters
mMesh
vpsVector of vertices (in ccw order) that will belong to the new face
Returns
Pointer to the new face

◆ add_face_unsafe() [2/2]

template<class MeshType >
static FacePointer vcg::tri::HalfEdgeTopology< MeshType >::add_face_unsafe ( MeshType & m,
vector< VertexPointer > & vps,
vector< HEdgePointer > & hps,
vector< bool > & non_manifold_vertices,
GarbagePointer gp )
inlinestaticprotected

Adds a face in a mesh without any check

Parameters
mMesh
vpsVector of vertices (in ccw order) that will belong to the new face
non_manifold_verticesVector of booleans denoting on the i-th position if the i-th vertex is non-manifold
Returns
Pointer to the new face

◆ can_add_hedge()

template<class MeshType >
static bool vcg::tri::HalfEdgeTopology< MeshType >::can_add_hedge ( vector< VertexPointer > & vps,
vector< HEdgePointer > & hps )
inlinestaticprotected

Checks if the next hedge can be inserted into hps. If true, inserts the hedge into hps. If false, inserts NULL.

Parameters
vpsVector of vertices (in ccw order) that will belong to the new face
hpsVector of hedges already checked
Return values
trueif hedge can be inserted
falseotherwise

◆ can_remove_face()

template<class MeshType >
static bool vcg::tri::HalfEdgeTopology< MeshType >::can_remove_face ( FacePointer fp)
inlinestatic

Checks if a face can be removed

Parameters
fpFace to check
Return values
trueif the face can be removed
falseotherwise

◆ change_vertex()

template<class MeshType >
static void vcg::tri::HalfEdgeTopology< MeshType >::change_vertex ( VertexPointer old_vp,
VertexPointer new_vp )
inlinestaticprotected

Connects to a new vertex all hedges incident to a vertex

Parameters
old_vpthe old vertex to be disconnected
new_vpthe new vertex to be connected

◆ diagonal_collapse()

template<class MeshType >
static VertexPointer vcg::tri::HalfEdgeTopology< MeshType >::diagonal_collapse ( MeshType & m,
FacePointer fp,
VertexPointer vp )
inlinestatic

Collpases a diagonal in a quad.

Parameters
mMesh
fpFace where diagonal resides
vpOne of the two vertices of the diagonal
Returns
Pointer to the new vertex

◆ doublet_remove()

template<class MeshType >
static FacePointer vcg::tri::HalfEdgeTopology< MeshType >::doublet_remove ( MeshType & m,
VertexPointer vp )
inlinestatic

Removes a doublet merging the two quads in one

Parameters
mMesh
vpVertex shared by the two consecutive edges of the doublet
Returns
Pointer to the new face

◆ edge_collapse()

template<class MeshType >
static VertexPointer vcg::tri::HalfEdgeTopology< MeshType >::edge_collapse ( MeshType & m,
EdgePointer ep,
VertexPointer vp )
inlinestatic

Collapses a generic edge

Parameters
mMesh
epEdge to be collapsed
vpVertex to be deleted
Returns
Pointer to the other vertex belonging to the collapsed edge

◆ edge_collapse_quad()

template<class MeshType >
static VertexPointer vcg::tri::HalfEdgeTopology< MeshType >::edge_collapse_quad ( MeshType & m,
EdgePointer ep,
VertexPointer vp )
inlinestatic

Collpases an edge shared by two quads, generating only quads. Made by a series of a vertex rotation and a diagonal collapse.

Parameters
mMesh
epEdge to be collapsed
vpVertex that will be rotated
Returns
Pointer to the new vertex

◆ edge_rotate()

template<class MeshType >
static EdgePointer vcg::tri::HalfEdgeTopology< MeshType >::edge_rotate ( MeshType & m,
EdgePointer ep,
bool cw )
inlinestatic

Rotates a non-border edge shared by two quads

Parameters
mMesh
epEdge to be rotated
cwflag denoting a clockwise or counter-clockwise rotation
Returns
Pointer to the rotated edge

◆ get_incident_faces()

template<class MeshType >
static vector< FacePointer > vcg::tri::HalfEdgeTopology< MeshType >::get_incident_faces ( VertexPointer vp,
HEdgePointer starting_he = NULL )
inlinestatic

Gets all faces incident to a vertex

Parameters
fpVertex
starting_heA hedge from which to start
Returns
Vector containing the incident faces

◆ getHEdges()

template<class MeshType >
static vector< HEdgePointer > vcg::tri::HalfEdgeTopology< MeshType >::getHEdges ( FacePointer fp,
HEdgePointer starting_he = NULL )
inlinestaticprotected

Gets all edges incident to a face

Parameters
fpFace
starting_heA hedge in the face from which to start
Returns
Vector containing the incident edges

◆ getVertices()

template<class MeshType >
static vector< VertexPointer > vcg::tri::HalfEdgeTopology< MeshType >::getVertices ( FacePointer fp,
HEdgePointer starting_he = NULL )
inlinestatic

Gets all vertices incident to a face

Parameters
fpFace
starting_heA hedge in the face from which to start
Returns
Vector containing the incident vertices

◆ remove_face()

template<class MeshType >
static bool vcg::tri::HalfEdgeTopology< MeshType >::remove_face ( MeshType & m,
FacePointer fp,
GarbagePointer gp = NULL )
inlinestatic

Removes a face in a mesh, checking if the operation is possible

Parameters
mMesh
fpface to be removed
Return values
trueif face has been removed
falseotherwise

◆ remove_face_unsafe()

template<class MeshType >
static void vcg::tri::HalfEdgeTopology< MeshType >::remove_face_unsafe ( MeshType & m,
FacePointer fp,
GarbagePointer gp = NULL )
inlinestaticprotected

Removes a face in a mesh, without any check

Parameters
mMesh
fpFace to be removed

◆ singlet_remove()

template<class MeshType >
static EdgePointer vcg::tri::HalfEdgeTopology< MeshType >::singlet_remove ( MeshType & m,
FacePointer fp )
inlinestatic

Removes a singlet replacing it with an edge

Parameters
mMesh
vpVertex shared by the two consecutive edges inside the singlet
Returns
Pointer to the new edge

◆ vertex_rotate()

template<class MeshType >
static VertexPointer vcg::tri::HalfEdgeTopology< MeshType >::vertex_rotate ( VertexPointer vp)
inlinestatic

Rotates a non-border vertex shared by only quads

Parameters
mMesh
vpVertex to be rotated
Returns
Pointer to the rotated vertex

The documentation for this class was generated from the following file:

Generated on Mon Sep 27 08:13:16 2004 for VCG Library by doxygen 1.3.7