Changed names of clean function and tested inertia.h

This commit is contained in:
Paolo Cignoni 2005-12-12 12:09:08 +00:00
parent b6f13e7eb1
commit 7032bf3d73
1 changed files with 12 additions and 3 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.15 2005/12/12 11:29:21 corsini
Minor changes
Revision 1.14 2005/12/12 10:48:16 corsini Revision 1.14 2005/12/12 10:48:16 corsini
Fix indentation Fix indentation
@ -113,6 +116,7 @@ using namespace std;
#include <vcg/simplex/faceplus/base.h> #include <vcg/simplex/faceplus/base.h>
#include <vcg/simplex/faceplus/component.h> #include <vcg/simplex/faceplus/component.h>
#include <vcg/simplex/face/pos.h> #include <vcg/simplex/face/pos.h>
#include <vcg/complex/trimesh/inertia.h>
#include "XMLTree.h" #include "XMLTree.h"
@ -126,7 +130,7 @@ using namespace vcg;
class CFace; class CFace;
class CEdge; class CEdge;
class CVertex : public VertexSimp2< CVertex, CEdge, CFace, vert::Coord3f, vert::BitFlags, vert::Normal3f >{}; class CVertex : public VertexSimp2< CVertex, CEdge, CFace, vert::Coord3f, vert::BitFlags, vert::Normal3f >{};
class CFace : public FaceSimp2< CVertex, CEdge, CFace, face::FFAdj, face::VertexRef, face::BitFlags > {}; class CFace : public FaceSimp2< CVertex, CEdge, CFace, face::FFAdj, face::VertexRef, face::Normal3f, face::BitFlags, face::Mark > {};
class CMesh : public vcg::tri::TriMesh< vector<CVertex>, vector<CFace> > {}; class CMesh : public vcg::tri::TriMesh< vector<CVertex>, vector<CFace> > {};
typedef CMesh::VertexPointer VertexPointer; typedef CMesh::VertexPointer VertexPointer;
@ -363,12 +367,12 @@ int main(int argc, char ** argv)
mi.fn=m.fn; mi.fn=m.fn;
// DEGENERATED FACES // DEGENERATED FACES
//mi.count_fd = tri::Clean<CMesh>::DegeneratedFaces(m); mi.count_fd = tri::Clean<CMesh>::RemoveZeroAreaFace(m);
vcg::tri::UpdateTopology<CMesh>::FaceFace(m); vcg::tri::UpdateTopology<CMesh>::FaceFace(m);
// UNREFERENCED VERTEX // UNREFERENCED VERTEX
mi.count_uv = tri::Clean<CMesh>::DetectUnreferencedVertex(m); mi.count_uv = tri::Clean<CMesh>::RemoveUnreferencedVertex(m);
tri::UpdateFlags<CMesh>::Clear(m); tri::UpdateFlags<CMesh>::Clear(m);
@ -407,6 +411,11 @@ int main(int argc, char ** argv)
// SELF INTERSECTION // SELF INTERSECTION
mi.SelfIntersect = tri::Clean<CMesh>::SelfIntersections(m); mi.SelfIntersect = tri::Clean<CMesh>::SelfIntersections(m);
tri::Inertia<CMesh> mm;
mm.Compute(m);
printf("Volume of mesh %f\n",mm.Mass());
if (saveFlag) if (saveFlag)
tri::io::Exporter<CMesh>::Save(m, SaveName.c_str()); tri::io::Exporter<CMesh>::Save(m, SaveName.c_str());