diff --git a/apps/sample/trimesh_hole/trimesh_hole.cpp b/apps/sample/trimesh_hole/trimesh_hole.cpp index d01a1119..15820854 100644 --- a/apps/sample/trimesh_hole/trimesh_hole.cpp +++ b/apps/sample/trimesh_hole/trimesh_hole.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -13,13 +14,16 @@ // half edge iterators #include +#include + // input output #include #include -#include + using namespace vcg; +using namespace std; class MyEdge; // dummy prototype never used class MyFace; @@ -28,7 +32,13 @@ class MyVertex; class MyVertex : public VertexSimp2< MyVertex, MyEdge, MyFace, vert::Coord3f, vert::BitFlags, vert::Normal3f >{}; class MyFace : public FaceSimp2 < MyVertex, MyEdge, MyFace, face::VertexRef,face::FFAdj, face::Mark, face::BitFlags, face::Normal3f > {}; -class MyMesh : public tri::TriMesh< std::vector, std::vector >{}; +class MyMesh : public tri::TriMesh< vector, vector >{}; + + +bool callback(int percent, const char *str) { + cout << "str: " << str << " " << percent << "%\n"; + return true; +} int main(int argc,char ** argv){ @@ -56,7 +66,7 @@ int main(int argc,char ** argv){ MyMesh m; - if(vcg::tri::io::ImporterPLY::Open(m,argv[2])!=0) + if(tri::io::ImporterPLY::Open(m,argv[2])!=0) { printf("Error reading file %s\n",argv[2]); exit(0); @@ -64,8 +74,8 @@ int main(int argc,char ** argv){ //update the face-face topology - vcg::tri::UpdateTopology::FaceFace(m); - vcg::tri::UpdateNormals::PerVertex(m); + tri::UpdateTopology::FaceFace(m); + tri::UpdateNormals::PerVertex(m); tri::UpdateFlags::FaceBorderFromFF(m); vcg::tri::Hole holeFiller; @@ -77,7 +87,9 @@ vcg::tri::Hole holeFiller; holeFiller.EarCuttingFill >(m,50,false); break; case 2: - holeFiller.EarCuttingFill >(m,500,false); + assert(tri::Clean::IsFFAdjacencyConsistent(m)); + holeFiller.EarCuttingFill >(m,10,false,callback); + assert(tri::Clean::IsFFAdjacencyConsistent(m)); break; case 3: holeFiller.EarCuttingIntersectionFill >(m,500,false); @@ -87,7 +99,7 @@ vcg::tri::Hole holeFiller; break; } - vcg::tri::io::ExporterPLY::Save(m,argv[3],false); + tri::io::ExporterPLY::Save(m,argv[3],false); return 0; }