Refactored selection face from vertices algorithms and added requiremnts for triangular mesh for the algorithm selecting vertices starting from face border flag
This commit is contained in:
parent
85c5274965
commit
18c0ac1681
|
@ -303,16 +303,15 @@ static size_t VertexFromFaceStrict(MeshType &m)
|
||||||
static size_t FaceFromVertexStrict(MeshType &m)
|
static size_t FaceFromVertexStrict(MeshType &m)
|
||||||
{
|
{
|
||||||
size_t selCnt=0;
|
size_t selCnt=0;
|
||||||
int i=0;
|
|
||||||
FaceClear(m);
|
FaceClear(m);
|
||||||
FaceIterator fi;
|
for(FaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||||
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
|
|
||||||
if( !(*fi).IsD())
|
if( !(*fi).IsD())
|
||||||
{
|
{
|
||||||
for(i = 0; i < (*fi).VN(); ++i)
|
bool selFlag=true;
|
||||||
|
for(int i = 0; i < (*fi).VN(); ++i)
|
||||||
if(!(*fi).V(i)->IsS())
|
if(!(*fi).V(i)->IsS())
|
||||||
break;
|
selFlag =false;
|
||||||
if(i == (*fi).VN())
|
if(selFlag)
|
||||||
{
|
{
|
||||||
(*fi).SetS();
|
(*fi).SetS();
|
||||||
++selCnt;
|
++selCnt;
|
||||||
|
@ -325,17 +324,15 @@ static size_t FaceFromVertexStrict(MeshType &m)
|
||||||
static size_t FaceFromVertexLoose(MeshType &m)
|
static size_t FaceFromVertexLoose(MeshType &m)
|
||||||
{
|
{
|
||||||
size_t selCnt=0;
|
size_t selCnt=0;
|
||||||
int i=0;
|
|
||||||
FaceClear(m);
|
FaceClear(m);
|
||||||
FaceIterator fi;
|
for(FaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||||
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
|
if( !(*fi).IsD())
|
||||||
if( !(*fi).IsD() && !(*fi).IsS())
|
|
||||||
{
|
{
|
||||||
|
bool selVert=false;
|
||||||
for(int i = 0; i < (*fi).VN(); ++i)
|
for(int i = 0; i < (*fi).VN(); ++i)
|
||||||
if((*fi).V(i)->IsS())
|
if((*fi).V(i)->IsS()) selVert=true;
|
||||||
break;
|
|
||||||
if(i < (*fi).VN())
|
if(selVert) {
|
||||||
{
|
|
||||||
(*fi).SetS();
|
(*fi).SetS();
|
||||||
++selCnt;
|
++selCnt;
|
||||||
}
|
}
|
||||||
|
@ -363,17 +360,16 @@ static size_t VertexFromBorderFlag(MeshType &m)
|
||||||
|
|
||||||
static size_t FaceFromBorderFlag(MeshType &m)
|
static size_t FaceFromBorderFlag(MeshType &m)
|
||||||
{
|
{
|
||||||
|
tri::RequireTriangularMesh(m);
|
||||||
size_t selCnt=0;
|
size_t selCnt=0;
|
||||||
int i=0;
|
|
||||||
FaceClear(m);
|
FaceClear(m);
|
||||||
FaceIterator fi;
|
for(FaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||||
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
|
|
||||||
if( !(*fi).IsD() )
|
if( !(*fi).IsD() )
|
||||||
{
|
{
|
||||||
for(int i = 0; i < (*fi).VN(); ++i)
|
bool bordFlag=false;
|
||||||
if((*fi).IsB(i))
|
for(int i = 0; i < 3; ++i)
|
||||||
break;
|
if((*fi).IsB(i)) bordFlag=true;
|
||||||
if(i < (*fi).VN())
|
if(bordFlag)
|
||||||
{
|
{
|
||||||
(*fi).SetS();
|
(*fi).SetS();
|
||||||
++selCnt;
|
++selCnt;
|
||||||
|
|
Loading…
Reference in New Issue