VCG Library
Static Public Member Functions | Static Protected Member Functions | List of all members
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, HEdgePointer hp, VertexPointer vp)
 
static VertexPointer diagonal_collapse_quad (MeshType &m, FacePointer fp, VertexPointer vp)
 
static FacePointer doublet_remove_quad (MeshType &m, VertexPointer vp)
 
static HEdgePointer singlet_remove_quad (MeshType &m, FacePointer fp)
 
static HEdgePointer edge_rotate_quad (HEdgePointer hp, bool cw)
 
static VertexPointer vertex_rotate_quad (VertexPointer vp)
 
static VertexPointer edge_collapse (MeshType &m, HEdgePointer hp, VertexPointer vp)
 
static FacePointer add_face (MeshType &m, vector< VertexPointer > &vps)
 
static bool remove_face (MeshType &m, FacePointer fp)
 
static bool can_remove_face (FacePointer fp)
 
static bool check_diagonal_collapse_quad (HEdgePointer hp)
 
static bool is_nonManifold_vertex (MeshType &m, VertexPointer vp)
 
static bool is_nonManifold_vertex (VertexPointer vp)
 
static VertexPointer opp_vert (HEdgePointer hp)
 
static vector< VertexPointer > getVertices (VertexPointer vp)
 
static set< FacePointer > getFaces (VertexPointer vp)
 
static bool is_singlet_quad (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 vector< HEdgePointer > get_incident_hedges (VertexPointer vp, HEdgePointer starting_he=NULL)
 
static bool has_doublet_quad (FacePointer fp)
 
static vector< HEdgePointer > find_doublet_hedges_quad (FacePointer fp)
 
static bool isBorderVertex (VertexPointer vp)
 
static int vertex_valence (VertexPointer vp)
 

Static Protected Member Functions

static FacePointer add_face_unsafe (MeshType &m, vector< VertexPointer > &vps)
 
static FacePointer add_face_unsafe (MeshType &m, vector< VertexPointer > &vps, vector< HEdgePointer > &hps, vector< bool > &non_manifold_vertices)
 
static void remove_face_unsafe (MeshType &m, FacePointer fp)
 
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.

Definition at line 41 of file halfedge_topology.h.

Member Function Documentation

template<class MeshType >
static FacePointer vcg::tri::HalfEdgeTopology< MeshType >::add_face ( MeshType &  m,
vector< VertexPointer > &  vps 
)
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

Definition at line 641 of file halfedge_topology.h.

template<class MeshType >
static FacePointer vcg::tri::HalfEdgeTopology< MeshType >::add_face_unsafe ( MeshType &  m,
vector< VertexPointer > &  vps 
)
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

Definition at line 710 of file halfedge_topology.h.

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 
)
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
hpsVector of hedges (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

Definition at line 739 of file halfedge_topology.h.

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

Definition at line 1068 of file halfedge_topology.h.

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

Definition at line 1152 of file halfedge_topology.h.

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

Definition at line 1748 of file halfedge_topology.h.

template<class MeshType >
static bool vcg::tri::HalfEdgeTopology< MeshType >::check_diagonal_collapse_quad ( HEdgePointer  hp)
inlinestatic

Checks if a diagonal can be collapsed

Parameters
hpHedge whose vertex is one of the two vertices of the diagonal
Return values
trueif diagonal can be collapsed
falseif diagonal cannot be collapsed

Definition at line 1192 of file halfedge_topology.h.

template<class MeshType >
static VertexPointer vcg::tri::HalfEdgeTopology< MeshType >::diagonal_collapse_quad ( 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

Definition at line 103 of file halfedge_topology.h.

template<class MeshType >
static FacePointer vcg::tri::HalfEdgeTopology< MeshType >::doublet_remove_quad ( 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

Definition at line 245 of file halfedge_topology.h.

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

Collapses a generic edge

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

Definition at line 573 of file halfedge_topology.h.

template<class MeshType >
static VertexPointer vcg::tri::HalfEdgeTopology< MeshType >::edge_collapse_quad ( MeshType &  m,
HEdgePointer  hp,
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
hphegde to be collapsed
vpVertex that will be rotated
Returns
Pointer to the new vertex

Definition at line 66 of file halfedge_topology.h.

template<class MeshType >
static HEdgePointer vcg::tri::HalfEdgeTopology< MeshType >::edge_rotate_quad ( HEdgePointer  hp,
bool  cw 
)
inlinestatic

Rotates a non-border edge shared by two quads

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

Definition at line 413 of file halfedge_topology.h.

template<class MeshType >
static vector<HEdgePointer> vcg::tri::HalfEdgeTopology< MeshType >::find_doublet_hedges_quad ( FacePointer  fp)
inlinestatic

Gets all hedges whose vertex is into a doublet

Parameters
fpFace to check
Returns
Vector containing the hedges

Definition at line 1650 of file halfedge_topology.h.

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
vpVertex
starting_heA hedge from which to start
Returns
Vector containing the incident faces

Definition at line 1533 of file halfedge_topology.h.

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

Gets all hedges incident to a vertex

Parameters
vpVertex
starting_heA hedge from which to start navigation
Returns
Vector containing the incident hedges

Definition at line 1597 of file halfedge_topology.h.

template<class MeshType >
static set<FacePointer> vcg::tri::HalfEdgeTopology< MeshType >::getFaces ( VertexPointer  vp)
inlinestatic

Gets faces on the 1-ring of a vertex

Parameters
vpVertex
Returns
Set containing faces

Definition at line 1395 of file halfedge_topology.h.

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

Gets all hedges incident to a face

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

Definition at line 1494 of file halfedge_topology.h.

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

Gets vertices on the 1-ring of a vertex

Parameters
vpVertex. It must be a non-border vertex.
Returns
Vector containing vertices

Definition at line 1353 of file halfedge_topology.h.

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

Definition at line 1453 of file halfedge_topology.h.

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

Checks if a face has doublets

Parameters
fpFace to check
Return values
trueif face has at least a doublet
falseif face hasn't any doublet

Definition at line 1638 of file halfedge_topology.h.

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

Checks if a vertex is non-manifold, comparing local and global information (slow)

Parameters
mMesh
vpVertex to check
Return values
trueif vertex is non-manifold
falseif verex is manifold

Definition at line 1276 of file halfedge_topology.h.

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

Checks if a vertex is non-manifold, based only on local informations

Parameters
vpVertex to check
Return values
trueif vertex is non-manifold
falseif verex is manifold

Definition at line 1306 of file halfedge_topology.h.

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

Checks if a face is a singlet

Parameters
fpFace to check
Return values
trueif face is a singlet
falseif face isn't a singlet

Definition at line 1423 of file halfedge_topology.h.

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

Checks if a vertex is a border vertex

Parameters
vpVertex to check
Return values
trueif vertex is a border vertex
falseif vertex isn't a border vertex

Definition at line 1685 of file halfedge_topology.h.

template<class MeshType >
static VertexPointer vcg::tri::HalfEdgeTopology< MeshType >::opp_vert ( HEdgePointer  hp)
inlinestatic

Shortcut to get the second vertex of an edge

Parameters
hpHedge
Returns
Opposite vertex

Definition at line 1341 of file halfedge_topology.h.

template<class MeshType >
static bool vcg::tri::HalfEdgeTopology< MeshType >::remove_face ( MeshType &  m,
FacePointer  fp 
)
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

Definition at line 681 of file halfedge_topology.h.

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

Removes a face in a mesh, without any check

Parameters
mMesh
fpFace to be removed

Definition at line 965 of file halfedge_topology.h.

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

Removes a singlet replacing it with an edge

Parameters
mMesh
fpFace that should be a singlet quad
Returns
Pointer to an halfdedge representing the new edge

Definition at line 318 of file halfedge_topology.h.

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

Rotates a non-border vertex shared by only quads

Parameters
vpVertex to be rotated
Returns
Pointer to the rotated vertex

Definition at line 507 of file halfedge_topology.h.

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

Computes valence of a vertex

Parameters
vpVertex
Returns
Vertex valence

Definition at line 1715 of file halfedge_topology.h.


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