Class of static functions to clean/correct/restore meshs. More...
#include <clean.h>
Classes | |
class | RemoveDuplicateVert_Compare |
class | SortedTriple |
Public Types | |
typedef vcg::Box3< ScalarType > | Box3Type |
typedef MeshType::ConstFaceIterator | ConstFaceIterator |
typedef MeshType::ConstVertexIterator | ConstVertexIterator |
typedef MeshType::FaceContainer | FaceContainer |
typedef MeshType::FaceIterator | FaceIterator |
typedef MeshType::FacePointer | FacePointer |
typedef MeshType::FaceType | FaceType |
typedef CleanMeshType | MeshType |
typedef Point3< ScalarType > | Point3x |
typedef MeshType::ScalarType | ScalarType |
typedef GridStaticPtr < FaceType, ScalarType > | TriMeshGrid |
typedef MeshType::VertexIterator | VertexIterator |
typedef MeshType::VertexPointer | VertexPointer |
typedef MeshType::VertexType | VertexType |
Static Public Member Functions | |
static int | ConnectedComponents (MeshType &m, std::vector< std::pair< int, FacePointer > > &CCV) |
static int | CountBitLargePolygons (MeshType &m) |
static int | CountBitPolygons (const MeshType &m) |
static int | CountBitQuads (const MeshType &m) |
static int | CountBitTris (const MeshType &m) |
static int | CountConnectedComponents (MeshType &m) |
static void | CountEdges (MeshType &m, int &count_e, int &boundary_e) |
static int | CountHoles (MeshType &m) |
static int | CountNonManifoldEdgeFF (MeshType &m, bool SelectFlag=false) |
static int | CountNonManifoldVertexFF (MeshType &m, bool selectVert=true) |
static void | FlipMesh (MeshType &m, bool selected=false) |
Flip the orientation of the whole mesh flipping all the faces (by swapping the first two vertices). | |
static bool | HasConsistentEdges (const MeshType &m) |
static bool | HasConsistentPerFaceFauxFlag (const MeshType &m) |
static bool | HasConsistentPerWedgeTexCoord (MeshType &m) |
static bool | HasZeroTexCoordFace (MeshType &m) |
static bool | IsBitPolygonal (const MeshType &m) |
static bool | IsBitQuadOnly (const MeshType &m) |
static bool | IsBitTriOnly (const MeshType &m) |
static bool | IsBitTriQuadOnly (const MeshType &m) |
static bool | IsFFAdjacencyConsistent (MeshType &m) |
static void | IsOrientedMesh (MeshType &m, bool &Oriented, bool &Orientable) |
static void | IsRegularMesh (MeshType &m, bool &Regular, bool &Semiregular) |
static bool | IsSizeConsistent (MeshType &m) |
static int | MergeCloseVertex (MeshType &m, const ScalarType radius) |
static int | MeshGenus (MeshType &m, int numholes, int numcomponents, int count_e) |
static int | RemoveDegenerateFace (MeshType &m) |
static int | RemoveDegenerateVertex (MeshType &m) |
static int | RemoveDuplicateFace (MeshType &m) |
static int | RemoveDuplicateVertex (MeshType &m, bool RemoveDegenerateFlag=true) |
static int | RemoveFaceFoldByFlip (MeshType &m, float normalThresholdDeg=175, bool repeat=true) |
static int | RemoveFaceOutOfRangeArea (MeshType &m, ScalarType MinAreaThr=0, ScalarType MaxAreaThr=(std::numeric_limits< ScalarType >::max)()) |
template<bool Selected> | |
static int | RemoveFaceOutOfRangeAreaSel (MeshType &m, ScalarType MinAreaThr=0, ScalarType MaxAreaThr=(std::numeric_limits< ScalarType >::max)()) |
static int | RemoveNonManifoldFace (MeshType &m) |
static int | RemoveNonManifoldVertex (MeshType &m) |
static std::pair< int, int > | RemoveSmallConnectedComponentsDiameter (MeshType &m, ScalarType maxDiameter) |
Remove the connected components smaller than a given diameter. | |
static std::pair< int, int > | RemoveSmallConnectedComponentsSize (MeshType &m, int maxCCSize) |
static int | RemoveTVertexByCollapse (MeshType &m, float threshold=40, bool repeat=true) |
static int | RemoveTVertexByFlip (MeshType &m, float threshold=40, bool repeat=true) |
static int | RemoveUnreferencedVertex (MeshType &m, bool DeleteVertexFlag=true) |
static int | RemoveZeroAreaFace (MeshType &m) |
static bool | SelfIntersections (MeshType &m, std::vector< FaceType * > &ret) |
static bool | TestIntersection (FaceType *f0, FaceType *f1) |
Class of static functions to clean/correct/restore meshs.
Definition at line 111 of file clean.h.
typedef vcg::Box3<ScalarType> vcg::tri::Clean< CleanMeshType >::Box3Type |
typedef MeshType::ConstFaceIterator vcg::tri::Clean< CleanMeshType >::ConstFaceIterator |
typedef MeshType::ConstVertexIterator vcg::tri::Clean< CleanMeshType >::ConstVertexIterator |
typedef MeshType::FaceContainer vcg::tri::Clean< CleanMeshType >::FaceContainer |
typedef MeshType::FaceIterator vcg::tri::Clean< CleanMeshType >::FaceIterator |
typedef MeshType::FacePointer vcg::tri::Clean< CleanMeshType >::FacePointer |
typedef MeshType::FaceType vcg::tri::Clean< CleanMeshType >::FaceType |
typedef CleanMeshType vcg::tri::Clean< CleanMeshType >::MeshType |
typedef Point3<ScalarType> vcg::tri::Clean< CleanMeshType >::Point3x |
typedef MeshType::ScalarType vcg::tri::Clean< CleanMeshType >::ScalarType |
typedef GridStaticPtr<FaceType, ScalarType > vcg::tri::Clean< CleanMeshType >::TriMeshGrid |
typedef MeshType::VertexIterator vcg::tri::Clean< CleanMeshType >::VertexIterator |
typedef MeshType::VertexPointer vcg::tri::Clean< CleanMeshType >::VertexPointer |
typedef MeshType::VertexType vcg::tri::Clean< CleanMeshType >::VertexType |
static int vcg::tri::Clean< CleanMeshType >::ConnectedComponents | ( | MeshType & | m, | |
std::vector< std::pair< int, FacePointer > > & | CCV | |||
) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::CountBitLargePolygons | ( | MeshType & | m | ) | [inline, static] |
The number of polygonal faces is FN - EN_f (each faux edge hides exactly one triangular face or in other words a polygon of n edges has n-3 faux edges.) In the general case where a The number of polygonal faces is FN - EN_f + VN_f where: EN_f is the number of faux edges. VN_f is the number of faux vertices (e.g vertices completely surrounded by faux edges) as a intuitive proof think to a internal vertex that is collapsed onto a border of a polygon: it deletes 2 faces, 1 faux edges and 1 vertex so to keep the balance you have to add back the removed vertex.
static int vcg::tri::Clean< CleanMeshType >::CountBitPolygons | ( | const MeshType & | m | ) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::CountBitQuads | ( | const MeshType & | m | ) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::CountBitTris | ( | const MeshType & | m | ) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::CountConnectedComponents | ( | MeshType & | m | ) | [inline, static] |
static void vcg::tri::Clean< CleanMeshType >::CountEdges | ( | MeshType & | m, | |
int & | count_e, | |||
int & | boundary_e | |||
) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::CountHoles | ( | MeshType & | m | ) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::CountNonManifoldEdgeFF | ( | MeshType & | m, | |
bool | SelectFlag = false | |||
) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::CountNonManifoldVertexFF | ( | MeshType & | m, | |
bool | selectVert = true | |||
) | [inline, static] |
static void vcg::tri::Clean< CleanMeshType >::FlipMesh | ( | MeshType & | m, | |
bool | selected = false | |||
) | [inline, static] |
static bool vcg::tri::Clean< CleanMeshType >::HasConsistentEdges | ( | const MeshType & | m | ) | [inline, static] |
static bool vcg::tri::Clean< CleanMeshType >::HasConsistentPerFaceFauxFlag | ( | const MeshType & | m | ) | [inline, static] |
static bool vcg::tri::Clean< CleanMeshType >::HasConsistentPerWedgeTexCoord | ( | MeshType & | m | ) | [inline, static] |
static bool vcg::tri::Clean< CleanMeshType >::HasZeroTexCoordFace | ( | MeshType & | m | ) | [inline, static] |
static bool vcg::tri::Clean< CleanMeshType >::IsBitPolygonal | ( | const MeshType & | m | ) | [inline, static] |
static bool vcg::tri::Clean< CleanMeshType >::IsBitQuadOnly | ( | const MeshType & | m | ) | [inline, static] |
static bool vcg::tri::Clean< CleanMeshType >::IsBitTriOnly | ( | const MeshType & | m | ) | [inline, static] |
static bool vcg::tri::Clean< CleanMeshType >::IsBitTriQuadOnly | ( | const MeshType & | m | ) | [inline, static] |
static bool vcg::tri::Clean< CleanMeshType >::IsFFAdjacencyConsistent | ( | MeshType & | m | ) | [inline, static] |
static void vcg::tri::Clean< CleanMeshType >::IsOrientedMesh | ( | MeshType & | m, | |
bool & | Oriented, | |||
bool & | Orientable | |||
) | [inline, static] |
static void vcg::tri::Clean< CleanMeshType >::IsRegularMesh | ( | MeshType & | m, | |
bool & | Regular, | |||
bool & | Semiregular | |||
) | [inline, static] |
Check if the given mesh is regular, semi-regular or irregular.
Each vertex of a regular mesh has valence 6 except for border vertices which have valence 4.
A semi-regular mesh is derived from an irregular one applying 1-to-4 subdivision recursively. (not checked for now)
All other meshes are irregular.
static bool vcg::tri::Clean< CleanMeshType >::IsSizeConsistent | ( | MeshType & | m | ) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::MergeCloseVertex | ( | MeshType & | m, | |
const ScalarType | radius | |||
) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::MeshGenus | ( | MeshType & | m, | |
int | numholes, | |||
int | numcomponents, | |||
int | count_e | |||
) | [inline, static] |
GENUS.
A topologically invariant property of a surface defined as the largest number of non-intersecting simple closed curves that can be drawn on the surface without separating it.
Roughly speaking, it is the number of holes in a surface. The genus g of a closed surface, also called the geometric genus, is related to the Euler characteristic by the relation $chi$ by $chi==2-2g$.
The genus of a connected, orientable surface is an integer representing the maximum number of cuttings along closed simple curves without rendering the resultant manifold disconnected. It is equal to the number of handles on it.
For general polyhedra the Euler Formula is:
V + F - E = 2 - 2G - B
where V is the number of vertices, F is the number of faces, E is the number of edges, G is the genus and B is the number of boundary polygons.
The above formula is valid for a mesh with one single connected component. By considering multiple connected components the formula becomes:
V + F - E = 2C - 2Gs - B
where C is the number of connected components and Gs is the sum of the genus of all connected components.
static int vcg::tri::Clean< CleanMeshType >::RemoveDegenerateFace | ( | MeshType & | m | ) | [inline, static] |
Degenerate faces are faces that are Topologically degenerate, i.e. have two or more vertex reference that link the same vertex (and not only two vertexes with the same coordinates). All Degenerate faces are zero area faces BUT not all zero area faces are degenerate. We do not take care of topology because when we have degenerate faces the topology calculation functions crash.
static int vcg::tri::Clean< CleanMeshType >::RemoveDegenerateVertex | ( | MeshType & | m | ) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::RemoveDuplicateFace | ( | MeshType & | m | ) | [inline, static] |
This function removes all duplicate faces of the mesh by looking only at their vertex reference. So it should be called after unification of vertices. Note that it does not update any topology relation that could be affected by this like the VT or TT relation. the reason this function is usually performed BEFORE building any topology information.
static int vcg::tri::Clean< CleanMeshType >::RemoveDuplicateVertex | ( | MeshType & | m, | |
bool | RemoveDegenerateFlag = true | |||
) | [inline, static] |
This function removes all duplicate vertices of the mesh by looking only at their spatial positions. Note that it does not update any topology relation that could be affected by this like the VT or TT relation. the reason this function is usually performed BEFORE building any topology information.
static int vcg::tri::Clean< CleanMeshType >::RemoveFaceFoldByFlip | ( | MeshType & | m, | |
float | normalThresholdDeg = 175 , |
|||
bool | repeat = true | |||
) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::RemoveFaceOutOfRangeArea | ( | MeshType & | m, | |
ScalarType | MinAreaThr = 0 , |
|||
ScalarType | MaxAreaThr = (std::numeric_limits<ScalarType>::max)() | |||
) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::RemoveFaceOutOfRangeAreaSel | ( | MeshType & | m, | |
ScalarType | MinAreaThr = 0 , |
|||
ScalarType | MaxAreaThr = (std::numeric_limits<ScalarType>::max)() | |||
) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::RemoveNonManifoldFace | ( | MeshType & | m | ) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::RemoveNonManifoldVertex | ( | MeshType & | m | ) | [inline, static] |
static std::pair<int,int> vcg::tri::Clean< CleanMeshType >::RemoveSmallConnectedComponentsDiameter | ( | MeshType & | m, | |
ScalarType | maxDiameter | |||
) | [inline, static] |
static std::pair<int,int> vcg::tri::Clean< CleanMeshType >::RemoveSmallConnectedComponentsSize | ( | MeshType & | m, | |
int | maxCCSize | |||
) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::RemoveTVertexByCollapse | ( | MeshType & | m, | |
float | threshold = 40 , |
|||
bool | repeat = true | |||
) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::RemoveTVertexByFlip | ( | MeshType & | m, | |
float | threshold = 40 , |
|||
bool | repeat = true | |||
) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::RemoveUnreferencedVertex | ( | MeshType & | m, | |
bool | DeleteVertexFlag = true | |||
) | [inline, static] |
static int vcg::tri::Clean< CleanMeshType >::RemoveZeroAreaFace | ( | MeshType & | m | ) | [inline, static] |
static bool vcg::tri::Clean< CleanMeshType >::SelfIntersections | ( | MeshType & | m, | |
std::vector< FaceType * > & | ret | |||
) | [inline, static] |
static bool vcg::tri::Clean< CleanMeshType >::TestIntersection | ( | FaceType * | f0, | |
FaceType * | f1 | |||
) | [inline, static] |