diff --git a/vcg/complex/algorithms/curve_on_manifold.h b/vcg/complex/algorithms/curve_on_manifold.h index 2be2707e..497c2c0d 100644 --- a/vcg/complex/algorithms/curve_on_manifold.h +++ b/vcg/complex/algorithms/curve_on_manifold.h @@ -115,24 +115,7 @@ public: //******** CUT TREE GENERATION - int countNonVisitedEdges(VertexType * vp, EdgeType * &ep) - { - std::vector starVec; - edge::VEStarVE(&*vp,starVec); - - int cnt =0; - for(size_t i=0;iIsV()) - { - cnt++; - ep = starVec[i]; - } - } - - return cnt; - } - + // Given two points return true if on the base mesh there exist an edge with that two coords // if return true the pos indicate the found edge. bool ExistEdge(KdTree &kdtree, CoordType &p0, CoordType &p1, PosType &fpos) @@ -192,6 +175,20 @@ public: return (t.en < t.edge.size()); } + int findNonVisitedEdgesDuringRetract(VertexType * vp, EdgeType * &ep) + { + std::vector starVec; + edge::VEStarVE(&*vp,starVec); + int cnt =0; + for(size_t i=0;iIsV()) { + cnt++; + ep = starVec[i]; + } + } + return cnt; + } + void Retract(MeshType &t) { tri::Clean::RemoveDuplicateVertex(t); @@ -219,8 +216,7 @@ public: vertStack.pop(); vp->C()=Color4b::Blue; EdgeType *ep=0; - - int eCnt = countNonVisitedEdges(vp,ep); + int eCnt = findNonVisitedEdgesDuringRetract(vp,ep); if(eCnt==1) // We have only one non visited edge over vp { assert(!ep->IsV()); @@ -239,7 +235,6 @@ public: assert(t.en >0); tri::Clean::RemoveUnreferencedVertex(t); tri::Allocator::CompactEveryVector(t); - } void CleanSpuriousDanglingEdges(MeshType &poly)