From ad562ed9f167c70cda6c12a249ca94fb25817389 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 17 Nov 2021 17:48:00 +0100 Subject: [PATCH] fix samples after removing using namespace in header files --- .../trimesh_attribute_saving.cpp | 2 +- apps/sample/trimesh_hole/trimesh_hole.cpp | 2 +- .../trimesh_intersection_mesh.cpp | 6 +++--- apps/sample/trimesh_remeshing/trimesh_remeshing.cpp | 6 +++--- .../trimesh_texture_clean/trimesh_texture_clean.cpp | 4 ++-- vcg/complex/algorithms/curve_on_manifold.h | 10 +++++----- vcg/complex/algorithms/implicit_smooth.h | 4 ++-- vcg/complex/algorithms/update/halfedge_indexed.h | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/apps/sample/trimesh_attribute_saving/trimesh_attribute_saving.cpp b/apps/sample/trimesh_attribute_saving/trimesh_attribute_saving.cpp index 7afe64ee..400a9da4 100644 --- a/apps/sample/trimesh_attribute_saving/trimesh_attribute_saving.cpp +++ b/apps/sample/trimesh_attribute_saving/trimesh_attribute_saving.cpp @@ -45,7 +45,7 @@ class MyMesh : public vcg::tri::TriMesh< std::vector, std::vector(m, 3.0f, 1.0f); + vcg::tri::Torus(m, 3.0f, 1.0f); //! [Adding a few attributes] // add a per-vertex attribute with type float named "GaussianCurvature" MyMesh::PerVertexAttributeHandle diff --git a/apps/sample/trimesh_hole/trimesh_hole.cpp b/apps/sample/trimesh_hole/trimesh_hole.cpp index 814e6ff2..5ca6937a 100644 --- a/apps/sample/trimesh_hole/trimesh_hole.cpp +++ b/apps/sample/trimesh_hole/trimesh_hole.cpp @@ -229,7 +229,7 @@ int main(int argc,char ** argv){ { f1=f2; f2++; - TriSplit >::Apply(vf[i],&(*f1),&(*f2),&(*vertp),CenterPointBarycenter() ); + vcg::tri::TriSplit >::Apply(vf[i],&(*f1),&(*f2),&(*vertp),vcg::tri::CenterPointBarycenter() ); f1->SetS(); f2->SetS(); for(int itr=0;itr<3;itr++) diff --git a/apps/sample/trimesh_intersection_mesh/trimesh_intersection_mesh.cpp b/apps/sample/trimesh_intersection_mesh/trimesh_intersection_mesh.cpp index e60e7f10..55797140 100644 --- a/apps/sample/trimesh_intersection_mesh/trimesh_intersection_mesh.cpp +++ b/apps/sample/trimesh_intersection_mesh/trimesh_intersection_mesh.cpp @@ -70,7 +70,7 @@ int main(int ,char **) tri::UpdateSelection::FaceDilate(m1); tri::Clean::SelectIntersectingFaces(m2,m1); tri::UpdateSelection::FaceDilate(m2); - IsotropicRemeshing::Params params; + vcg::tri::IsotropicRemeshing::Params params; float len = (tri::Stat::ComputeFaceEdgeLengthAverage(m1,true) + tri::Stat::ComputeFaceEdgeLengthAverage(m1,true)); params.SetTargetLen(len*0.8f); @@ -78,8 +78,8 @@ int main(int ,char **) params.iter=1; // just one iteration to avoid overtessellating. params.selectedOnly=true; printf(" Input mesh %8i v %8i f\n",m1.VN(),m1.FN()); - IsotropicRemeshing::Do(m1, params); - IsotropicRemeshing::Do(m2, params); + vcg::tri::IsotropicRemeshing::Do(m1, params); + vcg::tri::IsotropicRemeshing::Do(m2, params); printf(" Input mesh %8i v %8i f\n",m1.VN(),m1.FN()); } tri::Clean::SelectIntersectingFaces(m1,m2); diff --git a/apps/sample/trimesh_remeshing/trimesh_remeshing.cpp b/apps/sample/trimesh_remeshing/trimesh_remeshing.cpp index 895e83f5..8eb20cf2 100644 --- a/apps/sample/trimesh_remeshing/trimesh_remeshing.cpp +++ b/apps/sample/trimesh_remeshing/trimesh_remeshing.cpp @@ -75,7 +75,7 @@ int main( int argc, char **argv ) // Mesh cleaning tri::Clean::RemoveUnreferencedVertex(original); - Allocator::CompactEveryVector(original); + vcg::tri::Allocator::CompactEveryVector(original); tri::UpdateNormal::PerVertexNormalizedPerFaceNormalized(original); @@ -90,7 +90,7 @@ int main( int argc, char **argv ) float maxSurfDist = maxSurfDistPerc*(original.bbox.Diag()/100.f); printf("Length Thr: %8.3f ~ %4.2f %% on %5.3f\n",lengthThr,targetLenPerc,original.bbox.Diag()); - IsotropicRemeshing::Params params; + vcg::tri::IsotropicRemeshing::Params params; params.SetTargetLen(lengthThr); params.SetFeatureAngleDeg(creaseAngle); params.iter=iterNum; @@ -111,7 +111,7 @@ int main( int argc, char **argv ) printf(" Input mesh %8i v %8i f\n",toremesh.VN(),toremesh.FN()); - IsotropicRemeshing::Do(toremesh, original, params); + vcg::tri::IsotropicRemeshing::Do(toremesh, original, params); vcg::tri::io::ExporterPLY::Save(toremesh, "remesh.ply"); printf("Output mesh %8i v %8i f\n",toremesh.VN(),toremesh.FN()); diff --git a/apps/sample/trimesh_texture_clean/trimesh_texture_clean.cpp b/apps/sample/trimesh_texture_clean/trimesh_texture_clean.cpp index e6e5029e..830d6b33 100644 --- a/apps/sample/trimesh_texture_clean/trimesh_texture_clean.cpp +++ b/apps/sample/trimesh_texture_clean/trimesh_texture_clean.cpp @@ -52,8 +52,8 @@ int main(int ,char ** ) // generate a simple 2D grid Grid(m,20,20,1,1); - // assign it a simple planar parametrization - tri:UpdateTexture::WedgeTexFromPlane(m,Point3f(1.0f,0,0),Point3f(0,1.0f,0),true); + // assign it a simple planar parametrization + tri::UpdateTexture::WedgeTexFromPlane(m,Point3f(1.0f,0,0),Point3f(0,1.0f,0),true); tri::io::ExporterOBJ::Save(m,"grid_0.obj",mask); // randomly perturb a few coord textures introducing fake seams diff --git a/vcg/complex/algorithms/curve_on_manifold.h b/vcg/complex/algorithms/curve_on_manifold.h index e03e1f5f..1921548c 100644 --- a/vcg/complex/algorithms/curve_on_manifold.h +++ b/vcg/complex/algorithms/curve_on_manifold.h @@ -474,9 +474,9 @@ bool TagFaceEdgeSelWithPolyLine(MeshType &poly,bool markFlag=true) { CoordType p0=f->P0(i); CoordType p1=f->P1(i); - if (p0>p1) std::swap(p0,p1); - if(edgeToPolyVertMap[make_pair(p0,p1)]) printf("Found an already used Edge %lu - %lu %lu!!!\n", tri::Index(base,f->V0(i)),tri::Index(base,f->V1(i)),tri::Index(poly,&*vi)); - edgeToPolyVertMap[make_pair(p0,p1)]=&*vi; + if (p0>p1) std::swap(p0,p1); + if(edgeToPolyVertMap[std::make_pair(p0,p1)]) printf("Found an already used Edge %lu - %lu %lu!!!\n", tri::Index(base,f->V0(i)),tri::Index(base,f->V1(i)),tri::Index(poly,&*vi)); + edgeToPolyVertMap[std::make_pair(p0,p1)]=&*vi; } } } @@ -1136,7 +1136,7 @@ public: CoordType p0 = ep.V()->P(); CoordType p1 = ep.VFlip()->P(); if (p0>p1) std::swap(p0,p1); - VertexPointer vp=edgeToPolyVertMap[make_pair(p0,p1)]; + VertexPointer vp=edgeToPolyVertMap[std::make_pair(p0,p1)]; return vp!=0; } }; @@ -1152,7 +1152,7 @@ public: CoordType p0 = ep.V()->P(); CoordType p1 = ep.VFlip()->P(); if (p0>p1) std::swap(p0,p1); - VertexPointer vp=edgeToPolyVertMap[make_pair(p0,p1)]; + VertexPointer vp=edgeToPolyVertMap[std::make_pair(p0,p1)]; assert(vp); nv.P()=vp->P(); return; diff --git a/vcg/complex/algorithms/implicit_smooth.h b/vcg/complex/algorithms/implicit_smooth.h index 1d0e3f47..a304bf8e 100644 --- a/vcg/complex/algorithms/implicit_smooth.h +++ b/vcg/complex/algorithms/implicit_smooth.h @@ -260,7 +260,7 @@ public: //add the entries for mass matrix if (SParam.useMassMatrix) - MeshToMatrix::MassMatrixEntry(mesh,IndexM,ValuesM,!SParam.SmoothQ); + vcg::tri::MeshToMatrix::MassMatrixEntry(mesh,IndexM,ValuesM,!SParam.SmoothQ); //then add entries for lagrange mult due to barycentric constraints for (size_t i=0;i > IndexL; std::vector ValuesL; - MeshToMatrix::GetLaplacianMatrix(mesh,IndexL,ValuesL,SParam.useCotWeight,SParam.lapWeight,!SParam.SmoothQ); + vcg::tri::MeshToMatrix::GetLaplacianMatrix(mesh,IndexL,ValuesL,SParam.useCotWeight,SParam.lapWeight,!SParam.SmoothQ); //initialize sparse laplacian matrix if (!SParam.SmoothQ) diff --git a/vcg/complex/algorithms/update/halfedge_indexed.h b/vcg/complex/algorithms/update/halfedge_indexed.h index 054215ef..c8ebda00 100644 --- a/vcg/complex/algorithms/update/halfedge_indexed.h +++ b/vcg/complex/algorithms/update/halfedge_indexed.h @@ -214,9 +214,9 @@ namespace vcg for(typename MeshType::EdgeIterator ei1 = m.edge.begin(); ei1 != m.edge.end(); ++ei1 ) { - vector hedges = HalfEdgeTopology::get_incident_hedges((*ei1).V(0)); + std::vector hedges = HalfEdgeTopology::get_incident_hedges((*ei1).V(0)); - for(typename vector::iterator hi = hedges.begin(); hi != hedges.end(); ++hi) + for(typename std::vector::iterator hi = hedges.begin(); hi != hedges.end(); ++hi) { if((*hi)->HOp()->HVp() == (*ei1).V(1)) {