From 884795203c85209e99bc5fe1481f46a18de63828 Mon Sep 17 00:00:00 2001 From: cignoni Date: Wed, 12 Nov 2014 00:08:59 +0000 Subject: [PATCH] Added VertexBorderFromFaceAdj function (needed for managing polymesh that do not have per face border bit) --- vcg/complex/algorithms/update/flag.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/vcg/complex/algorithms/update/flag.h b/vcg/complex/algorithms/update/flag.h index fe1e24b6..3c6b15c1 100644 --- a/vcg/complex/algorithms/update/flag.h +++ b/vcg/complex/algorithms/update/flag.h @@ -340,13 +340,31 @@ public: } /// Compute the PerVertex Border flag deriving it from the border flag of faces - static void VertexBorderFromFace(MeshType &m) + static void VertexBorderFromFaceAdj(MeshType &m) +{ + RequirePerFaceFlags(m); + RequirePerVertexFlags(m); + RequirePerFaceAdjacency(m); +// tri::MeshAssert::FFAdjacencyIsInitialized(m); + VertexClearB(m); + for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi) + if(!(*fi).IsD()) + { + + for(int z=0;z<(*fi).VN();++z) + if( face::IsBorder(*fi,z)) + { + (*fi).V0(z)->SetB(); + (*fi).V1(z)->SetB(); + } + } + } + + /// Compute the PerVertex Border flag deriving it from the border flag of faces + static void VertexBorderFromFaceBorder(MeshType &m) { RequirePerFaceFlags(m); RequirePerVertexFlags(m); - for(VertexIterator vi=m.vert.begin();vi!=m.vert.end();++vi) - (*vi).ClearB(); - for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi) if(!(*fi).IsD()) {