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/create/platonic.h b/vcg/complex/algorithms/create/platonic.h index 386bcff1..6d1573db 100644 --- a/vcg/complex/algorithms/create/platonic.h +++ b/vcg/complex/algorithms/create/platonic.h @@ -1125,7 +1125,7 @@ struct _SphUsedTypes : public UsedTypes< Use<_SphVertex> ::AsVertexType, class _SphVertex : public Vertex<_SphUsedTypes, vertex::Coord3f, vertex::Normal3f, vertex::BitFlags >{}; class _SphFace : public Face< _SphUsedTypes, face::VertexRef, face::Normal3f, face::BitFlags, face::FFAdj > {}; -class _SphMesh : public tri::TriMesh< vector<_SphVertex>, vector<_SphFace> > {}; +class _SphMesh : public tri::TriMesh< std::vector<_SphVertex>, std::vector<_SphFace> > {}; template diff --git a/vcg/complex/algorithms/create/plymc/simplemeshprovider.h b/vcg/complex/algorithms/create/plymc/simplemeshprovider.h index 87d20baf..180e4fa5 100644 --- a/vcg/complex/algorithms/create/plymc/simplemeshprovider.h +++ b/vcg/complex/algorithms/create/plymc/simplemeshprovider.h @@ -147,7 +147,7 @@ public: bool openALN (const char* alnName) { - vector rmaps; + std::vector rmaps; ALNParser::ParseALN(rmaps, alnName); for(size_t i=0; iP0(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/isotropic_remeshing.h b/vcg/complex/algorithms/isotropic_remeshing.h index 5b7ac9ec..5359a3b1 100644 --- a/vcg/complex/algorithms/isotropic_remeshing.h +++ b/vcg/complex/algorithms/isotropic_remeshing.h @@ -429,7 +429,7 @@ private: for(auto vi=m.vert.begin(); vi!=m.vert.end(); ++vi) if(!(*vi).IsD()) { - vector ff; + std::vector ff; face::VFExtendedStarVF(&*vi, 2, ff); ScalarType tot = 0.f; @@ -906,8 +906,8 @@ private: p1.FlipV(); - vector vi0, vi1; - vector ff0, ff1; + std::vector vi0, vi1; + std::vector ff0, ff1; face::VFStarVF(p0.V(), ff0, vi0); face::VFStarVF(p1.V(), ff1, vi1); @@ -956,7 +956,7 @@ private: Point3 collapseNV, collapsedNV0, collapsedNV1; collapseNV = (p.V()->P() - p.VFlip()->P()).normalized(); - vector vv; + std::vector vv; face::VVStarVF(p.V(), vv); for(VertexType *v: vv) @@ -1052,9 +1052,9 @@ private: * \ | / \|/ +0 \ / -1 * v3 v3 v3 */ - static bool chooseBestCrossCollapse(PosType &p, VertexPair& bp, vector &ff) + static bool chooseBestCrossCollapse(PosType &p, VertexPair& bp, std::vector &ff) { - vector vv0, vv1, vv2, vv3; + std::vector vv0, vv1, vv2, vv3; VertexType *v0, *v1, *v2, *v3; v0 = p.F()->V1(p.VInd()); @@ -1175,8 +1175,8 @@ private: PosType pi(&*fi, i); if(!pi.V()->IsB()) { - vector ff; - vector vi; + std::vector ff; + std::vector vi; face::VFStarVF(pi.V(), ff, vi); //if cross need to check what creases you have and decide where to collapse accordingly diff --git a/vcg/complex/algorithms/overlap_estimation.h b/vcg/complex/algorithms/overlap_estimation.h index 1f75d786..9efc88a4 100644 --- a/vcg/complex/algorithms/overlap_estimation.h +++ b/vcg/complex/algorithms/overlap_estimation.h @@ -32,9 +32,6 @@ #include -using namespace std; -using namespace vcg; - /** \brief This class provides a strategy to estimate the overlap percentage of two range maps/point clouds. * * This class can be used, for exemple, into an automatic alignment process to check the quality of the @@ -56,9 +53,9 @@ template class OverlapEstimation typedef typename MeshType::FaceType FaceType; typedef typename MeshType::VertexPointer VertexPointer; typedef typename MeshType::VertexIterator VertexIterator; - typedef typename vector::iterator VertexPointerIterator; - typedef GridStaticPtr MeshGrid; - typedef tri::EmptyTMark MarkerVertex; + typedef typename std::vector::iterator VertexPointerIterator; + typedef vcg::GridStaticPtr MeshGrid; + typedef vcg::tri::EmptyTMark MarkerVertex; private: /** Private simple class needed to perform sampling of pointers to vertexes. */ @@ -70,7 +67,7 @@ template class OverlapEstimation VertexPointerSampler(){ m = new MeshType(); m->Tr.SetIdentity(); m->sfn=0; } ~VertexPointerSampler(){ if(m) delete m; } - vector sampleVec; + std::vector sampleVec; void AddVert(VertexType &p){ sampleVec.push_back(&p); } //this function is the only we really need void AddFace(const FaceType &f, const CoordType &p){} @@ -110,7 +107,7 @@ template class OverlapEstimation private: MeshType* mFix; /** Pointer to mesh \c mFix. */ MeshType* mMov; /** Pointer to mesh \c mMov. */ - vector >* normBuckets; //structure to hold normals bucketing. Needed for normal equalized sampling during consensus + std::vector >* normBuckets; //structure to hold normals bucketing. Needed for normal equalized sampling during consensus MeshGrid* gridFix; //variable to manage uniform grid MarkerVertex markerFunctorFix; //variable to manage uniform grid @@ -182,7 +179,7 @@ template class OverlapEstimation //if no buckets are provided get a vector of vertex pointers sampled uniformly //else, get a vector of vertex pointers sampled in a normal equalized manner; used as query points - vector queryVert; + std::vector queryVert; if(param.normalEqualization){ assert(normBuckets); for(unsigned int i=0; ivert.size(); i++) queryVert.push_back(&(mMov->vert[i]));//do a copy of pointers to vertexes @@ -249,7 +246,7 @@ template class OverlapEstimation * @param vert Destination vector. * @param sampleNum Requested number of vertexes. */ - void SampleVertUniform(MESH_TYPE& m, vector& vert, int sampleNum) + void SampleVertUniform(MESH_TYPE& m, std::vector& vert, int sampleNum) { VertexPointerSampler sampler; tri::SurfaceSampling::VertexUniform(m, sampler, sampleNum); @@ -258,12 +255,12 @@ template class OverlapEstimation /** Buckets normals of the vertexes contained in \c vert . * \return A vector of vectors containing indexes to \c vert . */ - vector >* BucketVertexNormal(typename MESH_TYPE::VertContainer& vert, int bucketDim = 30) + std::vector >* BucketVertexNormal(typename MESH_TYPE::VertContainer& vert, int bucketDim = 30) { static vector NV; if(NV.size()==0) GenNormal::Uniform(bucketDim,NV); - vector >* BKT = new vector >(NV.size()); //NV size is greater then bucketDim, so don't change this! + std::vector >* BKT = new std::vector >(NV.size()); //NV size is greater then bucketDim, so don't change this! int ind; for(int i=0;i class OverlapEstimation { assert(normBuckets); // vettore di contatori per sapere quanti punti ho gia' preso per ogni bucket - vector BKTpos(normBuckets->size(),0); + std::vector BKTpos(normBuckets->size(),0); if(SampleNum >= int(vert.size())) SampleNum= int(vert.size()-1); @@ -289,7 +286,7 @@ template class OverlapEstimation for(int i=0;isize()); // Scelgo un Bucket int &CURpos = BKTpos[ind]; - vector &CUR = (*normBuckets)[ind]; + std::vector &CUR = (*normBuckets)[ind]; if(CURpos::PriorityQueue nq; for (VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi) { diff --git a/vcg/complex/algorithms/smooth.h b/vcg/complex/algorithms/smooth.h index d2e4dbdf..7b568135 100644 --- a/vcg/complex/algorithms/smooth.h +++ b/vcg/complex/algorithms/smooth.h @@ -1417,7 +1417,7 @@ A(...) (2-2nm) = // move vertex vp->P() = ct; - vector faces2 = HalfEdgeTopology::get_incident_faces(vp); + std::vector faces2 = HalfEdgeTopology::get_incident_faces(vp); // estimate normal typename MeshType::CoordType avgn(0, 0, 0); @@ -1425,7 +1425,7 @@ A(...) (2-2nm) = for (unsigned int i = 0; i < faces2.size(); i++) if (faces2[i]) { - vector vertices = HalfEdgeTopology::getVertices(faces2[i]); + std::vector vertices = HalfEdgeTopology::getVertices(faces2[i]); assert(vertices.size() == 4); @@ -1444,9 +1444,9 @@ A(...) (2-2nm) = typename MeshTypeTri::FaceType *f = 0; typename MeshTypeTri::FaceType *fr = 0; - vector closests; - vector minDists; - vector faces; + std::vector closests; + std::vector minDists; + std::vector faces; ray.SetDirection(-raydir); f = vcg::tri::DoRay(gridmesh, grid, ray, diag / 4.0, t); diff --git a/vcg/complex/algorithms/update/fitmaps.h b/vcg/complex/algorithms/update/fitmaps.h index d1598640..917e2e57 100644 --- a/vcg/complex/algorithms/update/fitmaps.h +++ b/vcg/complex/algorithms/update/fitmaps.h @@ -42,9 +42,6 @@ #include - -using namespace Eigen; - namespace vcg { namespace tri { template 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)) { diff --git a/vcg/complex/algorithms/update/halfedge_topology.h b/vcg/complex/algorithms/update/halfedge_topology.h index 09138600..25dc9787 100644 --- a/vcg/complex/algorithms/update/halfedge_topology.h +++ b/vcg/complex/algorithms/update/halfedge_topology.h @@ -25,10 +25,6 @@ #include -using namespace std; -using namespace vcg::hedge; -using namespace vcg::tri; - namespace vcg { namespace tri @@ -123,7 +119,7 @@ namespace vcg HEdgePointer hp; - vector vps = getVertices(fp); + std::vector vps = getVertices(fp); assert(vps.size()==4); @@ -138,7 +134,7 @@ namespace vcg while(hp->HVp() != vp) hp= hp->HNp(); - vector hps = getHEdges(fp,hp); + std::vector hps = getHEdges(fp,hp); assert(vp == hps[0]->HVp()); @@ -195,10 +191,10 @@ namespace vcg if(b[j]) { if(HasHE) - Allocator::DeleteEdge(m, *(hps[i]->HEp()) ); + vcg::tri::Allocator::DeleteEdge(m, *(hps[i]->HEp()) ); - Allocator::DeleteHEdge(m, *(hps[i]->HOp()) ); - Allocator::DeleteHEdge(m, *(hps[i+1]->HOp()) ); + vcg::tri::Allocator::DeleteHEdge(m, *(hps[i]->HOp()) ); + vcg::tri::Allocator::DeleteHEdge(m, *(hps[i+1]->HOp()) ); hps[i+1]->HVp()->VHp() = NULL; @@ -218,17 +214,17 @@ namespace vcg } - Allocator::DeleteFace(m, *(fp) ); - Allocator::DeleteVertex(m, *(opposite_vertex) ); + vcg::tri::Allocator::DeleteFace(m, *(fp) ); + vcg::tri::Allocator::DeleteVertex(m, *(opposite_vertex) ); if(HasHE) { - Allocator::DeleteEdge(m, *(hps[1]->HEp()) ); - Allocator::DeleteEdge(m, *(hps[3]->HEp()) ); + vcg::tri::Allocator::DeleteEdge(m, *(hps[1]->HEp()) ); + vcg::tri::Allocator::DeleteEdge(m, *(hps[3]->HEp()) ); } - Allocator::DeleteHEdge(m, *(hps[0]) ); - Allocator::DeleteHEdge(m, *(hps[1]) ); - Allocator::DeleteHEdge(m, *(hps[2]) ); - Allocator::DeleteHEdge(m, *(hps[3]) ); + vcg::tri::Allocator::DeleteHEdge(m, *(hps[0]) ); + vcg::tri::Allocator::DeleteHEdge(m, *(hps[1]) ); + vcg::tri::Allocator::DeleteHEdge(m, *(hps[2]) ); + vcg::tri::Allocator::DeleteHEdge(m, *(hps[3]) ); return vp; @@ -288,17 +284,17 @@ namespace vcg fp1->FHp() = hp->HNp(); - Allocator::DeleteVertex(m, *vp); + vcg::tri::Allocator::DeleteVertex(m, *vp); if(MeshType::HEdgeType::HasHEAdjacency()) { - Allocator::DeleteEdge(m, *(hp->HEp()) ); - Allocator::DeleteEdge(m, *(hp->HPp()->HEp()) ); + vcg::tri::Allocator::DeleteEdge(m, *(hp->HEp()) ); + vcg::tri::Allocator::DeleteEdge(m, *(hp->HPp()->HEp()) ); } - Allocator::DeleteHEdge(m, *hp ); - Allocator::DeleteHEdge(m, *(hp->HOp()) ); - Allocator::DeleteHEdge(m, *(hp->HPp()) ); - Allocator::DeleteHEdge(m, *(hp->HPp()->HOp()) ); - Allocator::DeleteFace(m, *fp2 ); + vcg::tri::Allocator::DeleteHEdge(m, *hp ); + vcg::tri::Allocator::DeleteHEdge(m, *(hp->HOp()) ); + vcg::tri::Allocator::DeleteHEdge(m, *(hp->HPp()) ); + vcg::tri::Allocator::DeleteHEdge(m, *(hp->HPp()->HOp()) ); + vcg::tri::Allocator::DeleteFace(m, *fp2 ); return fp1; @@ -335,13 +331,13 @@ namespace vcg bool HasHE = MeshType::HEdgeType::HasHEAdjacency(); bool HasEH = MeshType::EdgeType::HasEHAdjacency(); - vector ext_hedges; + std::vector ext_hedges; - vector int_hedges = getHEdges(fp); + std::vector int_hedges = getHEdges(fp); - Allocator::DeleteFace( m, *(fp) ); + vcg::tri::Allocator::DeleteFace( m, *(fp) ); - for(typename vector::iterator hi = int_hedges.begin(); hi != int_hedges.end();++hi) + for(typename std::vector::iterator hi = int_hedges.begin(); hi != int_hedges.end();++hi) { if((*hi)->HOp()->HFp() != fp) @@ -349,15 +345,15 @@ namespace vcg else if(vertex_valence((*hi)->HVp()) == 1) { - Allocator::DeleteVertex( m, *((*hi)->HVp()) ); + vcg::tri::Allocator::DeleteVertex( m, *((*hi)->HVp()) ); if(HasHE) - Allocator::DeleteEdge( m, *((*hi)->HEp()) ); + vcg::tri::Allocator::DeleteEdge( m, *((*hi)->HEp()) ); } } - for(typename vector::iterator hi = int_hedges.begin(); hi != int_hedges.end();++hi) - Allocator::DeleteHEdge( m, *(*hi) ); + for(typename std::vector::iterator hi = int_hedges.begin(); hi != int_hedges.end();++hi) + vcg::tri::Allocator::DeleteHEdge( m, *(*hi) ); assert(ext_hedges.size() == 2); @@ -369,7 +365,7 @@ namespace vcg if(HasHE) { - Allocator::DeleteEdge( m, *(ext_hedges[1]->HEp()) ); + vcg::tri::Allocator::DeleteEdge( m, *(ext_hedges[1]->HEp()) ); ext_hedges[1]->HEp() = ext_hedges[0]->HEp(); @@ -390,11 +386,11 @@ namespace vcg if(HasHE) { - Allocator::DeleteEdge( m, *( ext_hedges[0]->HEp()) ); - Allocator::DeleteEdge( m, *( ext_hedges[1]->HEp()) ); + vcg::tri::Allocator::DeleteEdge( m, *( ext_hedges[0]->HEp()) ); + vcg::tri::Allocator::DeleteEdge( m, *( ext_hedges[1]->HEp()) ); } - Allocator::DeleteHEdge( m, *( ext_hedges[0]) ); - Allocator::DeleteHEdge( m, *( ext_hedges[1]) ); + vcg::tri::Allocator::DeleteHEdge( m, *( ext_hedges[0]) ); + vcg::tri::Allocator::DeleteHEdge( m, *( ext_hedges[1]) ); return NULL; } @@ -434,9 +430,9 @@ namespace vcg assert(!has_doublet_quad(fp1)); assert(!has_doublet_quad(fp2)); - vector fps; - typedef vector hedge_vect; - vector hps; + std::vector fps; + typedef std::vector hedge_vect; + std::vector hps; fps.push_back(fp1); fps.push_back(fp2); @@ -510,12 +506,12 @@ namespace vcg assert(MeshType::VertexType::HasVHAdjacency()); assert( vp->VHp() ); - Pos p(vp->VHp(), true); + vcg::hedge::Pos p(vp->VHp(), true); HEdgePointer hep = p.HE(); - typedef vector hedge_vect; - vector hedges; + typedef std::vector hedge_vect; + std::vector hedges; do { @@ -621,10 +617,10 @@ namespace vcg vp1->VHp() = hopp->HNp(); if(HasHEAdjacency(m)) - Allocator::DeleteEdge(m,*(hp->HEp())); - Allocator::DeleteHEdge(m,*hp); - Allocator::DeleteHEdge(m,*hopp); - Allocator::DeleteVertex(m,*vp); + vcg::tri::Allocator::DeleteEdge(m,*(hp->HEp())); + vcg::tri::Allocator::DeleteHEdge(m,*hp); + vcg::tri::Allocator::DeleteHEdge(m,*hopp); + vcg::tri::Allocator::DeleteVertex(m,*vp); return vp1; @@ -638,7 +634,7 @@ namespace vcg * * \return Pointer to the new face if it has been inserted, NULL otherwise */ - static FacePointer add_face(MeshType &m, vector &vps) + static FacePointer add_face(MeshType &m, std::vector &vps) { assert(MeshType::VertexType::HasVHAdjacency()); @@ -657,13 +653,13 @@ namespace vcg assert( count(vps.begin(), vps.end(), vps[i]) == 1 ); } - vector hps; + std::vector hps; while(hps.size() < size) if( !can_add_hedge(vps, hps) ) return NULL; - vector non_manifold_vertices(size, false); + std::vector non_manifold_vertices(size, false); return add_face_unsafe( m,vps, hps, non_manifold_vertices); @@ -707,12 +703,12 @@ namespace vcg * * \return Pointer to the new face */ - static FacePointer add_face_unsafe(MeshType &m, vector &vps) + static FacePointer add_face_unsafe(MeshType &m, std::vector &vps) { unsigned int size = vps.size(); - vector hps; - vector non_manifold_vertices; + std::vector hps; + std::vector non_manifold_vertices; while(hps.size() < size) { @@ -736,7 +732,7 @@ namespace vcg * * \return Pointer to the new face */ - static FacePointer add_face_unsafe(MeshType &m, vector &vps, vector &hps, vector &non_manifold_vertices) + static FacePointer add_face_unsafe(MeshType &m, std::vector &vps, std::vector &hps, std::vector &non_manifold_vertices) { assert(MeshType::VertexType::HasVHAdjacency()); @@ -767,7 +763,7 @@ namespace vcg FacePointer fp; - FaceIterator fi = Allocator::AddFaces(m,1); + FaceIterator fi = vcg::tri::Allocator::AddFaces(m,1); (*fi).Alloc( size ); fp = &(*fi); @@ -780,12 +776,12 @@ namespace vcg if(HasEH || HasHE) { - ei = Allocator::AddEdges(m,edge_n); + ei = vcg::tri::Allocator::AddEdges(m,edge_n); for(EdgeIterator ei1 = ei; ei1 != m.edge.end(); ++ei1) (*ei1).SetD(); } - typename Allocator::template PointerUpdater pu; + typename vcg::tri::Allocator::template PointerUpdater pu; if(m.hedge.empty()) pu.oldBase = 0; @@ -795,7 +791,7 @@ namespace vcg pu.oldEnd = &m.hedge.back()+1; } - hi = Allocator::AddHEdges(m,2*edge_n); + hi = vcg::tri::Allocator::AddHEdges(m,2*edge_n); pu.newBase = &*(m.hedge.begin()); pu.newEnd = &m.hedge.back()+1; @@ -809,7 +805,7 @@ namespace vcg // update hedge pointers (if needed) if( pu.NeedUpdate() ) - for(typename vector::iterator hpsi = hps.begin(); hpsi != hps.end(); ++hpsi) + for(typename std::vector::iterator hpsi = hps.begin(); hpsi != hps.end(); ++hpsi) { if((*hpsi)) pu.Update(*hpsi); @@ -848,7 +844,7 @@ namespace vcg } } - vector hps1; + std::vector hps1; for(unsigned int i = 0; i < size; i++) { @@ -911,7 +907,7 @@ namespace vcg // after face insertion vertex will become non-manifold if(non_manifold_vertices[next]) { - Pos p(vps[next]->VHp(), true); + vcg::hedge::Pos p(vps[next]->VHp(), true); while(p.F()) { @@ -965,7 +961,7 @@ namespace vcg static void remove_face_unsafe (MeshType &m, FacePointer fp) { - vector hps = getHEdges(fp); + std::vector hps = getHEdges(fp); int size = hps.size(); @@ -991,11 +987,11 @@ namespace vcg } else { - Allocator::DeleteHEdge( m, *hps[i] ); - Allocator::DeleteHEdge( m, *(hps[i]->HOp()) ); + vcg::tri::Allocator::DeleteHEdge( m, *hps[i] ); + vcg::tri::Allocator::DeleteHEdge( m, *(hps[i]->HOp()) ); if(MeshType::HEdgeType::HasHEAdjacency()) - Allocator::DeleteEdge( m, *(hps[i]->HEp()) ); + vcg::tri::Allocator::DeleteEdge( m, *(hps[i]->HEp()) ); if( !hps[(i+size-1)%size]->HOp()->HFp() ) { @@ -1021,7 +1017,7 @@ namespace vcg { bool manifold = true; - Pos p(hps[i]->HVp()->VHp(), true); + vcg::hedge::Pos p(hps[i]->HVp()->VHp(), true); p.HE()->SetV(); @@ -1051,7 +1047,7 @@ namespace vcg } - Allocator::DeleteFace(m,*fp); + vcg::tri::Allocator::DeleteFace(m,*fp); } @@ -1065,7 +1061,7 @@ namespace vcg * \retval true if hedge can be inserted * \retval false otherwise */ - static bool can_add_hedge( vector &vps, vector &hps ) + static bool can_add_hedge( std::vector &vps, std::vector &hps ) { unsigned int i = hps.size(); @@ -1087,7 +1083,7 @@ namespace vcg unsigned int size = vps.size(); - Pos p(he, false); + vcg::hedge::Pos p(he, false); he->SetV(); @@ -1155,11 +1151,11 @@ namespace vcg assert(fp); assert(!fp->IsD()); - Pos p(fp->FHp(), true); + vcg::hedge::Pos p(fp->FHp(), true); do { - vector incident_faces = get_incident_faces( p.V() ); + std::vector incident_faces = get_incident_faces( p.V() ); unsigned int size = incident_faces.size(); @@ -1197,11 +1193,11 @@ namespace vcg assert(hp->HFp()->VN() == 4); assert(!hp->IsD()); - vector faces; + std::vector faces; HEdgePointer hopp = hp->HNp()->HNp(); - vector faces1 = get_incident_faces(hp->HVp(), hp); - vector faces2 = get_incident_faces(hp->HNp()->HNp()->HVp(), hopp); + std::vector faces1 = get_incident_faces(hp->HVp(), hp); + std::vector faces2 = get_incident_faces(hp->HNp()->HNp()->HVp(), hopp); faces.assign(faces1.begin()+1, faces1.end()); faces.assign(faces2.begin()+1, faces2.end()); @@ -1236,11 +1232,11 @@ namespace vcg // Second check - set set1; - set set2; + std::set set1; + std::set set2; - vector vect1 = getVertices(hp->HVp()); - vector vect2 = getVertices(hp->HNp()->HNp()->HVp()); + std::vector vect1 = getVertices(hp->HVp()); + std::vector vect2 = getVertices(hp->HNp()->HNp()->HVp()); set1.insert(vect1.begin(), vect1.end()); set2.insert(vect2.begin(), vect2.end()); @@ -1249,9 +1245,9 @@ namespace vcg if(vect2.size() < size) size = vect2.size(); - vector intersection(size); + std::vector intersection(size); - typename vector::iterator it; + typename std::vector::iterator it; it = set_intersection(set1.begin(), set1.end(), set2.begin(), set2.end(), intersection.begin()); size = it- intersection.begin(); @@ -1278,7 +1274,7 @@ namespace vcg assert(vp); assert(!vp->IsD()); - set set1; + std::set set1; for(HEdgeIterator hi = m.hedge.begin(); hi != m.hedge.end(); ++hi) { if(!(*hi).IsD() && (*hi).HVp() == vp) @@ -1286,9 +1282,9 @@ namespace vcg } - vector vect2 = get_incident_hedges(vp); + std::vector vect2 = get_incident_hedges(vp); - set set2; + std::set set2; set2.insert(vect2.begin(), vect2.end()); return !equal(set1.begin(), set1.end(), set2.begin()); @@ -1308,7 +1304,7 @@ namespace vcg assert(vp); assert(!vp->IsD()); - vector faces = get_incident_faces(vp); + std::vector faces = get_incident_faces(vp); unsigned int size = faces.size(); int null_count = 0; @@ -1350,19 +1346,19 @@ namespace vcg * * \return Vector containing vertices */ - static vector getVertices(VertexPointer vp) + static std::vector getVertices(VertexPointer vp) { assert(vp); assert(!vp->IsD()); HEdgePointer hp = vp->VHp(); - vector ret; + std::vector ret; if( !hp ) return ret; - Pos p(hp); + vcg::hedge::Pos p(hp); do { @@ -1392,18 +1388,18 @@ namespace vcg * * \return Set containing faces */ - static set getFaces(VertexPointer vp) + static std::set getFaces(VertexPointer vp) { assert(vp); assert(!vp->IsD()); - set ret; + std::set ret; - vector vertices = getVertices(vp); + std::vector vertices = getVertices(vp); - for(typename vector::iterator vi = vertices.begin(); vi!= vertices.end(); ++vi) + for(typename std::vector::iterator vi = vertices.begin(); vi!= vertices.end(); ++vi) { - vector incident_faces = get_incident_faces(*vi); + std::vector incident_faces = get_incident_faces(*vi); ret.insert(incident_faces.begin(), incident_faces.end()); } @@ -1426,7 +1422,7 @@ namespace vcg assert(fp->FHp()); assert(!fp->IsD()); - Pos p( fp->FHp() ); + vcg::hedge::Pos p( fp->FHp() ); do { @@ -1450,7 +1446,7 @@ namespace vcg * * \return Vector containing the incident vertices */ - static vector getVertices(FacePointer fp, HEdgePointer starting_he = NULL) + static std::vector getVertices(FacePointer fp, HEdgePointer starting_he = NULL) { assert(fp); assert(!fp->IsD()); @@ -1460,9 +1456,9 @@ namespace vcg assert( starting_he->HFp() == fp ); - Pos p( starting_he, true ); + vcg::hedge::Pos p( starting_he, true ); - vector ret; + std::vector ret; do @@ -1491,7 +1487,7 @@ namespace vcg * * \return Vector containing the incident hedges */ - static vector getHEdges(FacePointer fp, HEdgePointer starting_he = NULL) + static std::vector getHEdges(FacePointer fp, HEdgePointer starting_he = NULL) { assert(fp); assert(!fp->IsD()); @@ -1501,9 +1497,9 @@ namespace vcg else starting_he = fp->FHp(); - Pos p( starting_he, true ); + vcg::hedge::Pos p( starting_he, true ); - vector ret; + std::vector ret; do { @@ -1530,7 +1526,7 @@ namespace vcg * * \return Vector containing the incident faces */ - static vector get_incident_faces(VertexPointer vp, HEdgePointer starting_he = NULL) + static std::vector get_incident_faces(VertexPointer vp, HEdgePointer starting_he = NULL) { assert(vp); assert(!vp->IsD()); @@ -1540,12 +1536,12 @@ namespace vcg else starting_he = vp->VHp(); - vector ret; + std::vector ret; if(!starting_he) return ret; - Pos p( starting_he, true ); + vcg::hedge::Pos p( starting_he, true ); do { @@ -1561,14 +1557,14 @@ namespace vcg } - static vector get_adjacent_faces(FacePointer fp) + static std::vector get_adjacent_faces(FacePointer fp) { assert(fp); assert(!fp->IsD()); - vector ret; + std::vector ret; - Pos p( fp->FHp() ); + vcg::hedge::Pos p( fp->FHp() ); assert(p.F() == fp); do @@ -1594,7 +1590,7 @@ namespace vcg * * \return Vector containing the incident hedges */ - static vector get_incident_hedges(VertexPointer vp, HEdgePointer starting_he = NULL) + static std::vector get_incident_hedges(VertexPointer vp, HEdgePointer starting_he = NULL) { assert(vp); assert(!vp->IsD()); @@ -1604,12 +1600,12 @@ namespace vcg else starting_he = vp->VHp(); - vector ret; + std::vector ret; if(!starting_he) return ret; - Pos p( starting_he, true ); + vcg::hedge::Pos p( starting_he, true ); do { @@ -1647,15 +1643,15 @@ namespace vcg * * \return Vector containing the hedges */ - static vector find_doublet_hedges_quad(FacePointer fp) + static std::vector find_doublet_hedges_quad(FacePointer fp) { assert(fp); assert(fp->FHp()); assert(!fp->IsD()); - vector ret; + std::vector ret; - Pos p( fp->FHp(), true ); + vcg::hedge::Pos p( fp->FHp(), true ); do { @@ -1690,7 +1686,7 @@ namespace vcg if( !(vp->VHp()) ) return true; - Pos p( vp->VHp() ); + vcg::hedge::Pos p( vp->VHp() ); do { @@ -1722,7 +1718,7 @@ namespace vcg int ret = 0; - Pos p( vp->VHp() ); + vcg::hedge::Pos p( vp->VHp() ); do { @@ -1752,7 +1748,7 @@ namespace vcg assert(old_vp != new_vp); assert(!old_vp->IsD()); - Pos p(old_vp->VHp(),true); + vcg::hedge::Pos p(old_vp->VHp(),true); p.HE()->SetV(); diff --git a/vcg/complex/algorithms/voronoi_processing.h b/vcg/complex/algorithms/voronoi_processing.h index e3cf60ca..7bd437cd 100644 --- a/vcg/complex/algorithms/voronoi_processing.h +++ b/vcg/complex/algorithms/voronoi_processing.h @@ -432,7 +432,7 @@ static void ConvertVoronoiDiagramToMesh(MeshType &m, for(size_t i=0;i pt; + std::vector pt; for(size_t j=0;jV(qq)] == curSeed) @@ -457,12 +457,12 @@ static void ConvertVoronoiDiagramToMesh(MeshType &m, CoordType nZ = pl.Direction(); CoordType nX = (pt[0]-curSeed->P()).Normalize(); CoordType nY = (nX^nZ).Normalize(); - vector > angleVec(pt.size()); + std::vector > angleVec(pt.size()); for(size_t j=0;jP()).Normalize(); float angle = 180.0f+math::ToDeg(atan2(p*nY,p*nX)); - angleVec[j] = make_pair(angle,j); + angleVec[j] = std::make_pair(angle,j); } std::sort(angleVec.begin(),angleVec.end()); // Now build another piece of mesh. @@ -1230,8 +1230,8 @@ static int RestrictedVoronoiRelaxing(MeshType &m, std::vector &seedPo sumVec[seedInd].second+=vi->cP()*area[vi]; } - vector newseedVec; - vector newfixedVec; + std::vector newseedVec; + std::vector newfixedVec; for(size_t i=0;i ordered_pair(const genericType &a, co /// /// static void GenerateMidPointMap(MeshType &m, - map, VertexPointer > &midMap) + std::map, VertexPointer > &midMap) { PerVertexPointerHandle sources = tri::Allocator:: template GetPerVertexAttribute (m,"sources"); @@ -1601,10 +1601,10 @@ static void ConvertDelaunayTriangulationToMesh(MeshType &m, for(size_t i=0;i::AddVertex(outMesh, seedVec[i]->P(),Color4b::White); - map, int > midMapInd; + std::map, int > midMapInd; // Given a pair of sources gives the index of the mid vertex - map, VertexPointer > midMapPt; + std::map, VertexPointer > midMapPt; if(refineFlag) { GenerateMidPointMap(m, midMapPt); @@ -1658,7 +1658,7 @@ static void PreprocessForVoronoi(MeshType &m, ScalarType radius, for(int i=0;i(m,mid,min(edgeLen*2.0f,radius/vpp.refinementRatio)); + bool ret = tri::Refine(m,mid,std::min(edgeLen*2.0f,radius/vpp.refinementRatio)); if(!ret) break; } tri::Allocator::CompactEveryVector(m); @@ -1715,7 +1715,7 @@ static void RelaxRefineTriangulationSpring(MeshType &m, MeshType &delaMesh, int std::vector avgLenVec(delaMesh.vn,0); for(int i=0;i starVec; + std::vector starVec; face::VVStarVF(&delaMesh.vert[i],starVec); for(size_t j=0;jcheck_queue.open(); //we signal ourselves to check again - cout << "loaded or unloaded\n"; + std::cout << "loaded or unloaded\n"; } input->check_queue.leave(); } @@ -212,7 +212,7 @@ protected: } else { //last item is locked need to reorder stack remove = this->heap.popMin(); this->heap.push(remove); - cout << "Reordering stack something (what?)\n"; + std::cout << "Reordering stack something (what?)\n"; return true; } } diff --git a/wrap/gcache/controller.h b/wrap/gcache/controller.h index 7c974887..ffe54903 100644 --- a/wrap/gcache/controller.h +++ b/wrap/gcache/controller.h @@ -140,7 +140,7 @@ class Controller { void resume() { assert(!stopped); assert(paused); - cout << "Resume" << endl; + std::cout << "Resume" << std::endl; //unlock and open all doors for(unsigned int i = 0; i < caches.size(); i++) { diff --git a/wrap/gui/frustum.h b/wrap/gui/frustum.h index 49a3f6af..8f6108ca 100644 --- a/wrap/gui/frustum.h +++ b/wrap/gui/frustum.h @@ -59,7 +59,7 @@ Adding copyright. #include #include -using namespace std; +//using namespace std; namespace vcg { diff --git a/wrap/gui/trackmode.cpp b/wrap/gui/trackmode.cpp index 7365c764..5c2d29f5 100644 --- a/wrap/gui/trackmode.cpp +++ b/wrap/gui/trackmode.cpp @@ -82,7 +82,7 @@ void SphereMode::Apply (Trackball * tb, Point3f new_point) // Figure out how much to rotate around that axis. // float phi = Distance (hitNew, hitOld) / tb->radius; // float phi = vcg::Angle(hitNew - center,hitOld - center)*(Distance(hitNew,center)/tb->radius); - float phi = max(vcg::Angle(hitNew - center,hitOld - center),(Distance(hitNew,hitOld)/tb->radius)) ; + float phi = std::max(vcg::Angle(hitNew - center,hitOld - center),(Distance(hitNew,hitOld)/tb->radius)) ; tb->track.rot = Quaternionf (-phi, axis) * tb->last_track.rot; } @@ -128,12 +128,12 @@ void ZMode::Draw(Trackball * tb){ // Scale mode implementation. void ScaleMode::Apply (Trackball * tb, float WheelNotch) { - tb->track.sca *= pow (1.2f, -WheelNotch); + tb->track.sca *= std::pow (1.2f, -WheelNotch); } void ScaleMode::Apply (Trackball * tb, Point3f new_point) { - tb->track.sca = tb->last_track.sca * pow (3.0f, -(getDeltaY(tb,new_point))); + tb->track.sca = tb->last_track.sca * std::pow (3.0f, -(getDeltaY(tb,new_point))); } void ScaleMode::Draw(Trackball * tb){ @@ -787,7 +787,7 @@ void NavigatorWasdMode::Animate(unsigned int msec, Trackball * tb){ float vel = current_speed_h.Norm(); if (veltrack.tra[1]+=step_last; diff --git a/wrap/gui/trackutils.h b/wrap/gui/trackutils.h index 4e3d1ede..6df38318 100644 --- a/wrap/gui/trackutils.h +++ b/wrap/gui/trackutils.h @@ -35,7 +35,7 @@ #include #include #include -using namespace std; +//using namespace std; namespace vcg {