Splitted IsComplexManifold in IsTwoManifoldFace and IsTwoManifoldVertex

This commit is contained in:
Paolo Cignoni 2005-12-29 12:27:37 +00:00
parent 6de3303285
commit ac8493bbad
2 changed files with 22 additions and 12 deletions

View File

@ -24,6 +24,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.28 2005/12/21 14:11:59 corsini
Out the number of self intersection
Revision 1.27 2005/12/21 13:26:58 corsini
Re-add save xml feature
@ -617,7 +620,7 @@ int main(int argc, char ** argv)
tri::UpdateTopology<CMesh>::VertexFace(m);
// IS MANIFOLD?
mi.Manifold = tri::Clean<CMesh>::IsComplexManifold(m);
mi.Manifold = tri::Clean<CMesh>::IsTwoManifoldFace(m) && tri::Clean<CMesh>::IsTwoManifoldVertex(m);
// COUNT EDGES
tri::Clean<CMesh>::CountEdges(m, mi.count_e, mi.boundary_e);

View File

@ -24,6 +24,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.26 2005/12/21 14:15:03 corsini
Remove printf
Revision 1.25 2005/12/21 13:09:03 corsini
Modify genus computation
@ -281,11 +284,10 @@ namespace vcg {
* number of face found have to be the same of the number of
* face found with the VF walk trough.
*/
static bool IsComplexManifold( MeshType & m )
static bool IsTwoManifoldFace( MeshType & m )
{
bool flagManifold = true;
VertexIterator vi;
FaceIterator fi;
// First Test
@ -303,11 +305,14 @@ namespace vcg {
}
}
}
return flagManifold;
}
// Second Test
if (flagManifold)
{
assert(m.HasVFTopology());
static bool IsTwoManifoldVertex( MeshType & m )
{
VertexIterator vi;
bool flagManifold = true;
assert(m.HasVFTopology());
face::VFIterator<FaceType> vfi;
int starSizeFF;
@ -335,7 +340,6 @@ namespace vcg {
}
}
}
}
return flagManifold;
}
@ -616,6 +620,7 @@ namespace vcg {
static void IsOrientedMesh(MeshType &m, bool &Oriented, bool &Orientable)
{
assert(&Oriented != &Orientable);
// This algorithms requires FF topology
assert(m.HasFFTopology());
@ -654,11 +659,11 @@ namespace vcg {
fpaux = fp->FFp(j);
iaux = fp->FFi(j);
if (!fpaux->IsD() && fpaux != fp)
if (!fpaux->IsD() && fpaux != fp && face::IsManifold<FaceType>(*fp, j))
{
if (!CheckOrientation(*fpaux, iaux))
{
Oriented = false;
Oriented = false;
if (!fpaux->IsS())
{
@ -666,7 +671,10 @@ namespace vcg {
assert(CheckOrientation(*fpaux, iaux));
}
else
{
Orientable = false;
break;
}
}
// put the oriented face into the stack
@ -681,8 +689,7 @@ namespace vcg {
}
}
if (!Orientable)
break;
if (!Orientable) break;
}
}