diff --git a/vcg/complex/algorithms/parametrization/poisson_solver.h b/vcg/complex/algorithms/parametrization/poisson_solver.h index 377888a7..7c3b002d 100644 --- a/vcg/complex/algorithms/parametrization/poisson_solver.h +++ b/vcg/complex/algorithms/parametrization/poisson_solver.h @@ -35,7 +35,7 @@ #include #include #include -#include +#include namespace vcg { namespace tri{ @@ -144,9 +144,9 @@ class PoissonSolver { UpdateBounding::Box(mesh); - vcg::tri::UpdateTopology::FaceFace(mesh); - vcg::tri::UpdateFlags::FaceBorderFromFF(mesh); - vcg::tri::UpdateFlags::VertexBorderFromFace(mesh); + tri::UpdateTopology::FaceFace(mesh); + tri::UpdateFlags::FaceBorderFromFF(mesh); + tri::UpdateFlags::VertexBorderFromFace(mesh); ScalarType dmax=0; v0=NULL; @@ -337,9 +337,9 @@ class PoissonSolver neg_t[2] = fNorm ^ (p[1] - p[0]); CoordType K1,K2; - /*MyMesh::PerFaceCoordHandle Fh = vcg::tri::Allocator::AddPerVertexAttribute (m,std::string("Irradiance")); - bool CrossDir0 = vcg::tri::HasPerVertexAttribute(mesh,"CrossDir0"); - bool CrossDir1 = vcg::tri::HasPerVertexAttribute(mesh,"CrossDir1"); + /*MyMesh::PerFaceCoordHandle Fh = tri::Allocator::AddPerVertexAttribute (m,std::string("Irradiance")); + bool CrossDir0 = tri::HasPerVertexAttribute(mesh,"CrossDir0"); + bool CrossDir1 = tri::HasPerVertexAttribute(mesh,"CrossDir1"); assert(CrossDir0); assert(CrossDir1);*/ @@ -529,19 +529,19 @@ class PoissonSolver { ///clear Visited Flag if (correct_fixed) - vcg::tri::UpdateFlags::VertexClearV(mesh); + tri::UpdateFlags::VertexClearV(mesh); //set fixed to V for (size_t i=0;iSetV(); - vcg::Box2 bbox; + Box2 bbox; if (normalize) { for (size_t i=0;i(U,V)); + bbox.Add(Point2(U,V)); } } @@ -552,9 +552,9 @@ class PoissonSolver //take U and V ScalarType U=x[i*2]; ScalarType V=x[(i*2)+1]; - vcg::Point2 p; + Point2 p; if (!v->IsV()) - p=vcg::Point2(U,V); + p=Point2(U,V); else p=v->T().P(); //p/=fieldScale; @@ -574,7 +574,7 @@ class PoissonSolver for (int j=0;j<3;j++) { VertexType* v=f->V(j); - vcg::Point2 p=v->T().P(); + Point2 p=v->T().P(); f->WT(j).P()=p; } } @@ -585,13 +585,13 @@ public: ///return true if is possible to bool IsFeaseable() { - vcg::tri::UpdateTopology::FaceFace(mesh); - int NNmanifoldE=vcg::tri::Clean::CountNonManifoldEdgeFF(mesh); + tri::UpdateTopology::FaceFace(mesh); + int NNmanifoldE=tri::Clean::CountNonManifoldEdgeFF(mesh); if (NNmanifoldE!=0)return false; - /*int NNmanifoldV=vcg::tri::Clean::CountNonManifoldVertexFF(mesh); + /*int NNmanifoldV=tri::Clean::CountNonManifoldVertexFF(mesh); if (NNmanifoldV!=0)return false;*/ - int G=vcg::tri::Clean::MeshGenus(mesh); - int numholes=vcg::tri::Clean::CountHoles(mesh); + int G=tri::Clean::MeshGenus(mesh); + int numholes=tri::Clean::CountHoles(mesh); if (numholes==0) return false; return (G==0); } @@ -639,7 +639,7 @@ public: for (size_t i=0;i(0,0); + mesh.vert[i].T().P()=Point2(0,0); to_fix.push_back(&mesh.vert[i]); return; } @@ -652,11 +652,11 @@ public: FindFarestVert(v0,v1); if (v0==v1) { - vcg::tri::io::ExporterPLY::Save(mesh,"./parametrized.ply"); + tri::io::ExporterPLY::Save(mesh,"./parametrized.ply"); assert(0); } - v0->T().P()=vcg::Point2(0,0); - v1->T().P()=vcg::Point2(1,0); + v0->T().P()=Point2(0,0); + v1->T().P()=Point2(1,0); to_fix.push_back(v0); to_fix.push_back(v1); return; @@ -676,7 +676,7 @@ public: for (size_t i=0;i(0,0); + mesh.vert[i].T().P()=Point2(0,0); to_fix.push_back(&mesh.vert[i]); return; } @@ -689,11 +689,11 @@ public: FindFarestVert(v0,v1); if (v0==v1) { - vcg::tri::io::ExporterPLY::Save(mesh,"./parametrized.ply"); +// tri::io::ExporterPLY::Save(mesh,"./parametrized.ply"); assert(0); } - v0->T().P()=vcg::Point2(0,0); - v1->T().P()=vcg::Point2(1,0); + v0->T().P()=Point2(0,0); + v1->T().P()=Point2(1,0); to_fix.push_back(v0); to_fix.push_back(v1); return; @@ -708,12 +708,12 @@ public: //query if an attribute is present or not if (use_direction_field) { - bool CrossDir0 = vcg::tri::HasPerFaceAttribute(mesh,"CrossDir0"); - bool CrossDir1 = vcg::tri::HasPerFaceAttribute(mesh,"CrossDir1"); + bool CrossDir0 = tri::HasPerFaceAttribute(mesh,"CrossDir0"); + bool CrossDir1 = tri::HasPerFaceAttribute(mesh,"CrossDir1"); assert(CrossDir0); assert(CrossDir1); - Fh0= vcg::tri::Allocator :: template GetPerFaceAttribute(mesh,std::string("CrossDir0")); - Fh1= vcg::tri::Allocator :: template GetPerFaceAttribute(mesh,std::string("CrossDir1")); + Fh0= tri::Allocator :: template GetPerFaceAttribute(mesh,std::string("CrossDir0")); + Fh1= tri::Allocator :: template GetPerFaceAttribute(mesh,std::string("CrossDir1")); } correct_fixed=_correct_fixed; fieldScale=_fieldScale; @@ -756,8 +756,8 @@ public: if (use_direction_field) { - bool CrossDir0 = vcg::tri::HasPerFaceAttribute(mesh,"CrossDir0"); - bool CrossDir1 = vcg::tri::HasPerFaceAttribute(mesh,"CrossDir1"); + bool CrossDir0 = tri::HasPerFaceAttribute(mesh,"CrossDir0"); + bool CrossDir1 = tri::HasPerFaceAttribute(mesh,"CrossDir1"); assert(CrossDir0); assert(CrossDir1); } @@ -797,10 +797,10 @@ public: ///then check if majority of faces are folded if (!solve_global_fold)return true; - if (vcg::tri::Distorsion::GloballyUnFolded(mesh)) + if (tri::Distortion::GloballyUnFolded(mesh)) { - vcg::tri::UV_Utils::GloballyMirrorX(mesh); - assert(!vcg::tri::Distorsion::GloballyUnFolded(mesh)); + tri::UV_Utils::GloballyMirrorX(mesh); + assert(!tri::Distortion::GloballyUnFolded(mesh)); } return true; }