diff --git a/vcg/complex/algorithms/point_sampling.h b/vcg/complex/algorithms/point_sampling.h index 5bb2cf30..8d95d1b5 100644 --- a/vcg/complex/algorithms/point_sampling.h +++ b/vcg/complex/algorithms/point_sampling.h @@ -61,8 +61,7 @@ namespace tri For example if you just want to get a vector with positions over the surface You have just to write vector myVec; - TrivialSampler ts(myVec); - SurfaceSampling >::Montecarlo(M, ts, SampleNum); + SurfaceSampling >::Montecarlo(M, TrivialSampler(myVec), SampleNum); **/ @@ -843,35 +842,13 @@ static void EdgeMeshUniform(MeshType &m, VertexSampler &ps, float radius, bool c /// /// It assumes that the border flag have been set over the mesh both for vertex and for faces. /// All the vertices on the border where the edges of the boundary of the surface forms an angle smaller than the given threshold are sampled. -/// +/// It assumes that the Per-Vertex border Flag has been set. static void VertexBorderCorner(MeshType & m, VertexSampler &ps, ScalarType angleRad) { -// typename MeshType::template PerVertexAttributeHandle angleSumH = tri::Allocator:: template GetPerVertexAttribute (m); - -// for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi) -// angleSumH[vi]=0; - -// for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi) -// { -// for(int i=0;i<3;++i) -// { -// angleSumH[fi->V(i)] += vcg::Angle(fi->P2(i) - fi->P0(i),fi->P1(i) - fi->P0(i)); -// } -// } - -// for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi) -// { -// if((angleSumH[vi]IsB())|| -// (angleSumH[vi]>(360-angleRad) && vi->IsB())) -// ps.AddVert(*vi); -// } - -// tri::Allocator:: template DeletePerVertexAttribute (m,angleSumH); - vcg::tri::UpdateFlags::FaceClearS(m); - vcg::tri::UpdateFlags::SelectVertexCornerBorder(m,angleRad); + vcg::tri::UpdateSelection::VertexCornerBorder(m,angleRad); for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi) { - if(vi->IsS())ps.AddVert(*vi); + if(vi->IsS()) ps.AddVert(*vi); } } diff --git a/vcg/complex/algorithms/update/selection.h b/vcg/complex/algorithms/update/selection.h index 7f6b4e81..0fd1b74a 100644 --- a/vcg/complex/algorithms/update/selection.h +++ b/vcg/complex/algorithms/update/selection.h @@ -538,6 +538,7 @@ static size_t VertexInBox( MeshType & m, const Box3Type &bb, bool preserveSelect /// \brief Select the border vertices that form a corner along the border /// with an angle that is below a certain threshold (e.g. with 90 will select all the acute angles) +/// It assumes that the Per-Vertex border Flag has been set. static size_t VertexCornerBorder(MeshType &m, ScalarType angleRad, bool preserveSelection=false) { if(!preserveSelection) VertexClear(m);