Classes | Public Types | Static Public Member Functions
vcg::tri::PolychordCollapse< PolyMeshType > Class Template Reference

The PolychordCollapse class provides methods to semplify a quad mesh, by collapsing the polychords. More...

#include <polygon_polychord_collapse.h>

List of all members.

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.

Detailed Description

template<typename PolyMeshType>
class vcg::tri::PolychordCollapse< PolyMeshType >

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.


Member Typedef Documentation

template<typename PolyMeshType >
typedef PolyMeshType::CoordType vcg::tri::PolychordCollapse< PolyMeshType >::CoordType

Definition at line 59 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
typedef PolyMeshType::FaceIterator vcg::tri::PolychordCollapse< PolyMeshType >::FaceIterator

Definition at line 65 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
typedef PolyMeshType::FacePointer vcg::tri::PolychordCollapse< PolyMeshType >::FacePointer

Definition at line 64 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
typedef PolyMeshType::FaceType vcg::tri::PolychordCollapse< PolyMeshType >::FaceType

Definition at line 63 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
typedef PolyMeshType::VertexIterator vcg::tri::PolychordCollapse< PolyMeshType >::VertexIterator

Definition at line 62 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
typedef PolyMeshType::VertexPointer vcg::tri::PolychordCollapse< PolyMeshType >::VertexPointer

Definition at line 61 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
typedef PolyMeshType::VertexType vcg::tri::PolychordCollapse< PolyMeshType >::VertexType

Definition at line 60 of file polygon_polychord_collapse.h.


Member Enumeration Documentation

template<typename PolyMeshType >
enum vcg::tri::PolychordCollapse::PC_ResultCode

The PC_ResultCode enum codifies the result type of a polychord collapse operation.

Enumerator:
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.


Member Function Documentation

template<typename PolyMeshType >
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.

Parameters:
posInput The starting position.
startPosOutput the new starting position (in case of borders).
checkSingtrue if singularities on both sides are not allowed.
Returns:
PC_SUCCESS if it's a collapsable polychord, otherwise the code for the cause (startPos is on it).

Definition at line 1581 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
static void vcg::tri::PolychordCollapse< PolyMeshType >::CollapseAllPolychords ( PolyMeshType &  mesh,
const bool  checkSing = true 
) [inline, static]

CollapseAllPolychords finds and collapses all the polychords.

Parameters:
meshThe input polygonal mesh (it SHOULD have the vcg::face::PolyInfo component).
checkSingtrue if singularities on both sides of a polychord are not allowed.

Definition at line 860 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
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.

Warning:
This function deletes faces and vertices by calling vcg::tri::Allocator<PolyMeshType>::DeleteFace() and vcg::tri::Allocator<PolyMeshType>::DeleteVertex(). The object PC_Chords chords is used to track the polychords, and it has got a size proportional to that of the mesh face container. If you actually delete faces and vertices by calling vcg::tri::Allocator<PolyMeshType>::CompactFaceVector() and vcg::tri::Allocator<PolyMeshType>::CompactVertexVector() after this function, object PC_Chords chords then is not valid any more, so you MUST rearrange it by calling PC_Chords.Reset(). For the same reason, you MUST rearrange LinkConditions linkConditions by calling LinkConditions.Resize(). However, for efficiency, you SHOULD compact vertex and face containers at the end of all your polychord collapsing operations, without having to rearrange chords and linkConditions. The function CollapseAllPolychords() does this for you.
Note:
Vertex flags, face flags, FF adjacency and FV adjacency are required. Not anything else. Such components are automatically updated here. If the mesh has other components that may be affected by this editing, you should update them later by yourself.
Parameters:
meshThe polygonal mesh used for getting the face index and deleting the faces (it SHOULD have the vcg::face::PolyInfo component).
posPosition of the polychord.
markMark for the current polychord.
chordsVector of chords.
linkConditionsLink conditions checker.
checkSingtrue if singularities on both sides are not allowed.
Returns:
A PC_ResultCode resulting from checks or PC_SUCCESS if the collapse has been performed.

Definition at line 638 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
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.

Parameters:
meshThe input mesh.
polychordsThe container of results.
loopsOnlytrue if closed polychords only must be listed, false for all polychords.

Definition at line 903 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
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.

Warning:
Don't call this function without being sure that it's a polychord (i.e. call CheckPolychordFindStartPoint() before calling IsPolychordSelfIntersecting().
Parameters:
meshThe mesh used for getting the face index.
startPosThe starting position.
chordsThe vector of chords.
markThe current mark, used to identify quads already visited.
Returns:
true if it intersects itself, false otherwise.

Definition at line 1777 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
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.

Parameters:
posThe starting position.
Returns:
true if adjacent to non-manifold edges, false otherwise.

Definition at line 1754 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
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.

Parameters:
mesh
Returns:
MarkPolychords marks the chords of the polychord starting at startPos.
Parameters:
meshThe input mesh.
startPosThe starting position.
chordsThe vector of chords.
markThe current mark, used to identify quads already visited.

Definition at line 590 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
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.

Parameters:
meshis the input polygonal mesh.
posis a position into the polychord (not necessarily the starting border). It will be updated with changes.
nis the number of polychords to replace the input one.
facesToUpdateis a vector of face pointers to be updated after re-allocation.
verticesToUpdateis a vector of vertex pointers to be updated after re-allocation.

Definition at line 979 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
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.

Parameters:
meshis the input polygonal mesh.
posis a position into the polychord (not necessarily the starting border). It will be updated with changes.
nis the number of polychords to replace the input one.

Definition at line 1568 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
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.

Parameters:
meshThe mesh used for getting the face index.
startPosThe starting position.
chordsThe vector of chords.
markThe mark.
qThe visiting type.

Definition at line 1701 of file polygon_polychord_collapse.h.

template<typename PolyMeshType >
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.

Note:
VisitPolychord() should be called before this method.
Parameters:
meshThe input mesh.
startPosThe starting Pos.
chordsThe vector of chords.
markThe current mark, used to identify quads already visited.
Returns:
true if manifoldness remains, false otherwise.

Definition at line 1841 of file polygon_polychord_collapse.h.


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


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:43:01