The PolychordCollapse class provides methods to semplify a quad mesh, by collapsing the polychords. More...
#include <polygon_polychord_collapse.h>
Classes | |
class | LinkConditions |
The LinkCondition class provides a tool to check if a polychord satisfies the link conditions. More... | |
struct | PC_Chord |
The PC_Chord struct identifies a coord of a polychord passing through a quad. More... | |
class | PC_Chords |
The PC_Chords class gives efficient access to each coord (relative to a face). More... | |
Public Types | |
typedef PolyMeshType::CoordType | CoordType |
typedef PolyMeshType::FaceIterator | FaceIterator |
typedef PolyMeshType::FacePointer | FacePointer |
typedef PolyMeshType::FaceType | FaceType |
enum | PC_ResultCode { PC_SUCCESS = 0x000, PC_NOTMANIF = 0x001, PC_NOTQUAD = 0x002, PC_NOLINKCOND = 0x004, PC_SINGSIDEA = 0x008, PC_SINGSIDEB = 0x010, PC_SINGBOTH = 0x020, PC_SELFINTERSECT = 0x040, PC_NOMOREMANIF = 0x080, PC_VOID = 0x100, PC_OTHER = 0x100 } |
The PC_ResultCode enum codifies the result type of a polychord collapse operation. More... | |
typedef PolyMeshType::VertexIterator | VertexIterator |
typedef PolyMeshType::VertexPointer | VertexPointer |
typedef PolyMeshType::VertexType | VertexType |
Static Public Member Functions | |
static PC_ResultCode | CheckPolychordFindStartPosition (const vcg::face::Pos< FaceType > &pos, vcg::face::Pos< FaceType > &startPos, const bool checkSing=true) |
CheckPolychordFindStartPosition checks if it's a collapsable polychord. | |
static void | CollapseAllPolychords (PolyMeshType &mesh, const bool checkSing=true) |
CollapseAllPolychords finds and collapses all the polychords. | |
static PC_ResultCode | CollapsePolychord (PolyMeshType &mesh, const vcg::face::Pos< FaceType > &pos, const unsigned long mark, PC_Chords &chords, LinkConditions &linkConditions, const bool checkSing=true) |
CollapsePolychord performs all checks and then collapses the polychord. | |
static void | FindPolychords (PolyMeshType &mesh, std::deque< vcg::face::Pos< FaceType > > &polychords, const bool loopsOnly=false) |
FindPolychords lists all the valid polychords starting position of a mesh. | |
static bool | IsPolychordSelfIntersecting (const PolyMeshType &mesh, const vcg::face::Pos< FaceType > &startPos, const PC_Chords &chords, const unsigned long mark) |
IsPolychordSelfIntersecting checks if the input polychord intersects itself. | |
static bool | IsVertexAdjacentToAnyNonManifoldEdge (const vcg::face::Pos< FaceType > &pos) |
IsVertexAdjacentToAnyNonManifoldEdge checks if a vertex is adjacent to any non-manifold edge. | |
static void | MarkPolychords (const PolyMeshType &mesh, const vcg::face::Pos< FaceType > &startPos, PC_Chords &chords, const unsigned long mark) |
CheckConsistent checks for consistency. ONLY FOR DEBUG. | |
static void | SplitPolychord (PolyMeshType &mesh, vcg::face::Pos< FaceType > &pos, const size_t n, std::vector< FacePointer * > &facesToUpdate, std::vector< VertexPointer * > &verticesToUpdate) |
SplitPolychord splits a polychord into n polychords by inserting all the needed faces. | |
static void | SplitPolychord (PolyMeshType &mesh, vcg::face::Pos< FaceType > &pos, const size_t n) |
SplitPolychord splits a polychord into n polychords by inserting all the needed faces. | |
static void | VisitPolychord (const PolyMeshType &mesh, const vcg::face::Pos< FaceType > &startPos, PC_Chords &chords, const unsigned long mark, const PC_ResultCode q) |
VisitPolychord updates the information of a polychord. | |
static bool | WillPolychordBeManifold (const PolyMeshType &mesh, const vcg::face::Pos< FaceType > &startPos, PC_Chords &chords, const unsigned long mark) |
WillPolychordBeManifold checks whether a polychord starting at startPos would cause non-manifoldness if it was collapsed. |
The PolychordCollapse class provides methods to semplify a quad mesh, by collapsing the polychords.
This class is an implementation of a method very similar to that for mesh semplification proposed by Daniels et al. in "Quadrilateral mesh simplification", see http://www.cs.utah.edu/~jdaniels/research/asia2008_qms.htm The main function is PolychordCollapse::CollapsePolychord() which deletes all the quadrilateral faces in a polychord. The polychords that can be collapsed in this case are those forming a closed loop (a ring) or that start and end to mesh borders. A way to preserve the structure of the singularities is also provided. The convenient method PolychordCollapse::CollapseAllPolychords() finds and collapses all the polychords on a mesh. The input mesh should be polygonal, i.e. it should have the vcg::face::PolyInfo component. Even though a generic triangle mesh can be given, actually the class does not perform any collapsing operation since it sees only triangles, in fact it does not consider faux edges.
Definition at line 57 of file polygon_polychord_collapse.h.
typedef PolyMeshType::CoordType vcg::tri::PolychordCollapse< PolyMeshType >::CoordType |
Definition at line 59 of file polygon_polychord_collapse.h.
typedef PolyMeshType::FaceIterator vcg::tri::PolychordCollapse< PolyMeshType >::FaceIterator |
Definition at line 65 of file polygon_polychord_collapse.h.
typedef PolyMeshType::FacePointer vcg::tri::PolychordCollapse< PolyMeshType >::FacePointer |
Definition at line 64 of file polygon_polychord_collapse.h.
typedef PolyMeshType::FaceType vcg::tri::PolychordCollapse< PolyMeshType >::FaceType |
Definition at line 63 of file polygon_polychord_collapse.h.
typedef PolyMeshType::VertexIterator vcg::tri::PolychordCollapse< PolyMeshType >::VertexIterator |
Definition at line 62 of file polygon_polychord_collapse.h.
typedef PolyMeshType::VertexPointer vcg::tri::PolychordCollapse< PolyMeshType >::VertexPointer |
Definition at line 61 of file polygon_polychord_collapse.h.
typedef PolyMeshType::VertexType vcg::tri::PolychordCollapse< PolyMeshType >::VertexType |
Definition at line 60 of file polygon_polychord_collapse.h.
enum vcg::tri::PolychordCollapse::PC_ResultCode |
The PC_ResultCode enum codifies the result type of a polychord collapse operation.
PC_SUCCESS | |
PC_NOTMANIF | |
PC_NOTQUAD | |
PC_NOLINKCOND | |
PC_SINGSIDEA | |
PC_SINGSIDEB | |
PC_SINGBOTH | |
PC_SELFINTERSECT | |
PC_NOMOREMANIF | |
PC_VOID | |
PC_OTHER |
Definition at line 70 of file polygon_polychord_collapse.h.
static PC_ResultCode vcg::tri::PolychordCollapse< PolyMeshType >::CheckPolychordFindStartPosition | ( | const vcg::face::Pos< FaceType > & | pos, |
vcg::face::Pos< FaceType > & | startPos, | ||
const bool | checkSing = true |
||
) | [inline, static] |
CheckPolychordFindStartPosition checks if it's a collapsable polychord.
pos | Input The starting position. |
startPos | Output the new starting position (in case of borders). |
checkSing | true if singularities on both sides are not allowed. |
Definition at line 1581 of file polygon_polychord_collapse.h.
static void vcg::tri::PolychordCollapse< PolyMeshType >::CollapseAllPolychords | ( | PolyMeshType & | mesh, |
const bool | checkSing = true |
||
) | [inline, static] |
CollapseAllPolychords finds and collapses all the polychords.
mesh | The input polygonal mesh (it SHOULD have the vcg::face::PolyInfo component). |
checkSing | true if singularities on both sides of a polychord are not allowed. |
Definition at line 860 of file polygon_polychord_collapse.h.
static PC_ResultCode vcg::tri::PolychordCollapse< PolyMeshType >::CollapsePolychord | ( | PolyMeshType & | mesh, |
const vcg::face::Pos< FaceType > & | pos, | ||
const unsigned long | mark, | ||
PC_Chords & | chords, | ||
LinkConditions & | linkConditions, | ||
const bool | checkSing = true |
||
) | [inline, static] |
CollapsePolychord performs all checks and then collapses the polychord.
mesh | The polygonal mesh used for getting the face index and deleting the faces (it SHOULD have the vcg::face::PolyInfo component). |
pos | Position of the polychord. |
mark | Mark for the current polychord. |
chords | Vector of chords. |
linkConditions | Link conditions checker. |
checkSing | true if singularities on both sides are not allowed. |
Definition at line 638 of file polygon_polychord_collapse.h.
static void vcg::tri::PolychordCollapse< PolyMeshType >::FindPolychords | ( | PolyMeshType & | mesh, |
std::deque< vcg::face::Pos< FaceType > > & | polychords, | ||
const bool | loopsOnly = false |
||
) | [inline, static] |
FindPolychords lists all the valid polychords starting position of a mesh.
mesh | The input mesh. |
polychords | The container of results. |
loopsOnly | true if closed polychords only must be listed, false for all polychords. |
Definition at line 903 of file polygon_polychord_collapse.h.
static bool vcg::tri::PolychordCollapse< PolyMeshType >::IsPolychordSelfIntersecting | ( | const PolyMeshType & | mesh, |
const vcg::face::Pos< FaceType > & | startPos, | ||
const PC_Chords & | chords, | ||
const unsigned long | mark | ||
) | [inline, static] |
IsPolychordSelfIntersecting checks if the input polychord intersects itself.
mesh | The mesh used for getting the face index. |
startPos | The starting position. |
chords | The vector of chords. |
mark | The current mark, used to identify quads already visited. |
Definition at line 1777 of file polygon_polychord_collapse.h.
static bool vcg::tri::PolychordCollapse< PolyMeshType >::IsVertexAdjacentToAnyNonManifoldEdge | ( | const vcg::face::Pos< FaceType > & | pos | ) | [inline, static] |
IsVertexAdjacentToAnyNonManifoldEdge checks if a vertex is adjacent to any non-manifold edge.
pos | The starting position. |
Definition at line 1754 of file polygon_polychord_collapse.h.
static void vcg::tri::PolychordCollapse< PolyMeshType >::MarkPolychords | ( | const PolyMeshType & | mesh, |
const vcg::face::Pos< FaceType > & | startPos, | ||
PC_Chords & | chords, | ||
const unsigned long | mark | ||
) | [inline, static] |
CheckConsistent checks for consistency. ONLY FOR DEBUG.
mesh |
mesh | The input mesh. |
startPos | The starting position. |
chords | The vector of chords. |
mark | The current mark, used to identify quads already visited. |
Definition at line 590 of file polygon_polychord_collapse.h.
static void vcg::tri::PolychordCollapse< PolyMeshType >::SplitPolychord | ( | PolyMeshType & | mesh, |
vcg::face::Pos< FaceType > & | pos, | ||
const size_t | n, | ||
std::vector< FacePointer * > & | facesToUpdate, | ||
std::vector< VertexPointer * > & | verticesToUpdate | ||
) | [inline, static] |
SplitPolychord splits a polychord into n polychords by inserting all the needed faces.
mesh | is the input polygonal mesh. |
pos | is a position into the polychord (not necessarily the starting border). It will be updated with changes. |
n | is the number of polychords to replace the input one. |
facesToUpdate | is a vector of face pointers to be updated after re-allocation. |
verticesToUpdate | is a vector of vertex pointers to be updated after re-allocation. |
Definition at line 979 of file polygon_polychord_collapse.h.
static void vcg::tri::PolychordCollapse< PolyMeshType >::SplitPolychord | ( | PolyMeshType & | mesh, |
vcg::face::Pos< FaceType > & | pos, | ||
const size_t | n | ||
) | [inline, static] |
SplitPolychord splits a polychord into n polychords by inserting all the needed faces.
mesh | is the input polygonal mesh. |
pos | is a position into the polychord (not necessarily the starting border). It will be updated with changes. |
n | is the number of polychords to replace the input one. |
Definition at line 1568 of file polygon_polychord_collapse.h.
static void vcg::tri::PolychordCollapse< PolyMeshType >::VisitPolychord | ( | const PolyMeshType & | mesh, |
const vcg::face::Pos< FaceType > & | startPos, | ||
PC_Chords & | chords, | ||
const unsigned long | mark, | ||
const PC_ResultCode | q | ||
) | [inline, static] |
VisitPolychord updates the information of a polychord.
mesh | The mesh used for getting the face index. |
startPos | The starting position. |
chords | The vector of chords. |
mark | The mark. |
q | The visiting type. |
Definition at line 1701 of file polygon_polychord_collapse.h.
static bool vcg::tri::PolychordCollapse< PolyMeshType >::WillPolychordBeManifold | ( | const PolyMeshType & | mesh, |
const vcg::face::Pos< FaceType > & | startPos, | ||
PC_Chords & | chords, | ||
const unsigned long | mark | ||
) | [inline, static] |
WillPolychordBeManifold checks whether a polychord starting at startPos would cause non-manifoldness if it was collapsed.
mesh | The input mesh. |
startPos | The starting Pos. |
chords | The vector of chords. |
mark | The current mark, used to identify quads already visited. |
Definition at line 1841 of file polygon_polychord_collapse.h.