From 7c6956fd4d35244cc04a03faf01fe824f430f2a3 Mon Sep 17 00:00:00 2001 From: cignoni Date: Mon, 17 Oct 2011 23:35:30 +0000 Subject: [PATCH] Corrected some gcc compilation errors, Changed the IsFeasible function (now it tests that there is exactly one hole... --- .../parametrization/poisson_solver.h | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/vcg/complex/algorithms/parametrization/poisson_solver.h b/vcg/complex/algorithms/parametrization/poisson_solver.h index 97f67540..093dfde8 100644 --- a/vcg/complex/algorithms/parametrization/poisson_solver.h +++ b/vcg/complex/algorithms/parametrization/poisson_solver.h @@ -24,17 +24,18 @@ #ifndef VCG_POISSON_SOLVER #define VCG_POISSON_SOLVER +#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET +#include +#include +#include +#include + #include -//#include #include #include #include +#include -#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET -#include -#include -#include -#include namespace vcg { namespace tri{ @@ -44,10 +45,9 @@ class PoissonSolver typedef typename MeshType::ScalarType ScalarType; typedef typename MeshType::FaceType FaceType; - typedef typename MeshType::FaceType FaceType; typedef typename MeshType::VertexType VertexType; typedef typename MeshType::CoordType CoordType; - typedef typename MeshType::PerFaceAttributeHandle PerFaceAttributeHandle; + typedef typename MeshType:: template PerFaceAttributeHandle PerFaceCoordHandle; ///the mesh itself MeshType &mesh; @@ -77,18 +77,18 @@ class PoissonSolver ///size of the scalar field ScalarType fieldScale; ///handle per direction field - PerFaceAttributeHandle Fh0,Fh1; + PerFaceCoordHandle Fh0,Fh1; int VertexIndex(VertexType* v) { - std::map::iterator iteMap=VertexToInd.find(v); + typename std::map::iterator iteMap=VertexToInd.find(v); assert(iteMap!=VertexToInd.end()); return ((*iteMap).second); } VertexType* IndexVertex(int index) { - std::map::iterator iteMap=IndToVertex.find(index); + typename std::map::iterator iteMap=IndToVertex.find(index); assert(iteMap!=IndToVertex.end()); return ((*iteMap).second); } @@ -113,7 +113,7 @@ class PoissonSolver void FindFarestVert(VertexType* &v0, VertexType* &v1) { - vcg::tri::UpdateBounding::Box(mesh); + UpdateBounding::Box(mesh); ScalarType d0=mesh.bbox.Diag(); ScalarType d1=d0; v0=NULL; @@ -307,7 +307,7 @@ class PoissonSolver neg_t[2] = fNorm ^ (p[1] - p[0]); CoordType K1,K2; - /*MyMesh::PerFaceAttributeHandle Fh = vcg::tri::Allocator::AddPerVertexAttribute (m,std::string("Irradiance")); + /*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"); assert(CrossDir0); @@ -562,21 +562,21 @@ public: if (NNmanifoldV!=0)return false; int G=vcg::tri::Clean::MeshGenus(mesh); int numholes=vcg::tri::Clean::CountHoles(mesh); - if (numholes==0)return false; + if (numholes!=1) return false; return (G==0); } ///set the border as fixed void SetBorderAsFixed() { - for (int i=0;iIsD())continue; if(v->IsB())to_fix.push_back(v); } std::sort(to_fix.begin(),to_fix.end()); - std::vector::iterator new_end=std::unique(to_fix.begin(),to_fix.end()); + typename std::vector::iterator new_end=std::unique(to_fix.begin(),to_fix.end()); int dist=distance(to_fix.begin(),new_end); to_fix.resize(dist); } @@ -591,7 +591,7 @@ public: if(v->IsS())to_fix.push_back(v); } std::sort(to_fix.begin(),to_fix.end()); - std::vector::iterator new_end=std::unique(to_fix.begin(),to_fix.end()); + typename std::vector::iterator new_end=std::unique(to_fix.begin(),to_fix.end()); int dist=distance(to_fix.begin(),new_end); to_fix.resize(dist); } @@ -642,8 +642,8 @@ public: bool CrossDir1 = vcg::tri::HasPerFaceAttribute(mesh,"CrossDir1"); assert(CrossDir0); assert(CrossDir1); - Fh0= vcg::tri::Allocator::GetPerFaceAttribute(mesh,std::string("CrossDir0")); - Fh1= vcg::tri::Allocator::GetPerFaceAttribute(mesh,std::string("CrossDir1")); + Fh0= vcg::tri::Allocator :: template GetPerFaceAttribute(mesh,std::string("CrossDir0")); + Fh1= vcg::tri::Allocator :: template GetPerFaceAttribute(mesh,std::string("CrossDir1")); } correct_fixed=_correct_fixed; fieldScale=_fieldScale; @@ -732,4 +732,4 @@ public: }; // end class } //End Namespace Tri } // End Namespace vcg -#endif \ No newline at end of file +#endif