adapted some functions to polygonal meshes

This commit is contained in:
Luigi Malomo 2017-04-04 15:06:39 +02:00
parent 49251952c1
commit f2b92b6484
1 changed files with 47 additions and 43 deletions

View File

@ -520,7 +520,7 @@ public:
UpdateFlags<MeshType>::VertexClearV(m);
for (FaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi) if (!fi->IsD())
{
for(int i=0;i<3;i++)
for (int i=0; i<fi->VN(); i++)
if ((*fi).V(i)->IsS() && !(*fi).V(i)->IsV())
{
(*fi).V(i)->SetV();
@ -922,9 +922,10 @@ public:
FaceIterator fi;
for (fi = m.face.begin(); fi != m.face.end(); ++fi) if (!fi->IsD())
{
TD[(*fi).V(0)]++;
TD[(*fi).V(1)]++;
TD[(*fi).V(2)]++;
for (int k=0; k<fi->VN(); k++)
{
TD[(*fi).V(k)]++;
}
}
tri::UpdateFlags<MeshType>::VertexClearV(m);
@ -932,8 +933,9 @@ public:
// mark out of the game the vertexes that are incident on non manifold edges.
for (fi = m.face.begin(); fi != m.face.end(); ++fi) if (!fi->IsD())
{
for(int i=0;i<3;++i)
if (!IsManifold(*fi,i)) {
for(int i=0; i<fi->VN(); ++i)
if (!IsManifold(*fi,i))
{
(*fi).V0(i)->SetV();
(*fi).V1(i)->SetV();
}
@ -942,7 +944,8 @@ public:
// from it and using FF is the same of the previously counted.
for (fi = m.face.begin(); fi != m.face.end(); ++fi) if (!fi->IsD())
{
for(int i=0;i<3;i++) if(!(*fi).V(i)->IsV()){
for(int i=0; i<fi->VN(); i++) if (!(*fi).V(i)->IsV())
{
(*fi).V(i)->SetV();
face::Pos<FaceType> pos(&(*fi),i);
@ -950,7 +953,8 @@ public:
if (starSizeFF != TD[(*fi).V(i)])
{
if(selectVert) (*fi).V(i)->SetS();
if (selectVert)
(*fi).V(i)->SetS();
nonManifoldCnt++;
}
}