Added UpdateSelection::VertexFromEdgeLoose
added parameter for preserving the old selection to the UpdateSelection::VertexFromFaceLoose
This commit is contained in:
parent
34cb93552c
commit
412ef1aa65
|
|
@ -229,12 +229,12 @@ static size_t VertexInvert(MeshType &m)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Select all the vertices that are touched by at least a single selected faces
|
/// \brief Select all the vertices that are touched by at least a single selected faces
|
||||||
static size_t VertexFromFaceLoose(MeshType &m)
|
static size_t VertexFromFaceLoose(MeshType &m, bool preserveSelection=false)
|
||||||
{
|
{
|
||||||
size_t selCnt=0;
|
size_t selCnt=0;
|
||||||
VertexClear(m);
|
|
||||||
FaceIterator fi;
|
if(!preserveSelection) VertexClear(m);
|
||||||
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
|
for(FaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||||
if( !(*fi).IsD() && (*fi).IsS())
|
if( !(*fi).IsD() && (*fi).IsS())
|
||||||
{
|
{
|
||||||
if( !(*fi).V(0)->IsS()) { (*fi).V(0)->SetS(); ++selCnt; }
|
if( !(*fi).V(0)->IsS()) { (*fi).V(0)->SetS(); ++selCnt; }
|
||||||
|
|
@ -244,6 +244,21 @@ static size_t VertexFromFaceLoose(MeshType &m)
|
||||||
return selCnt;
|
return selCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// \brief Select all the vertices that are touched by at least a single selected edge
|
||||||
|
static size_t VertexFromEdgeLoose(MeshType &m, bool preserveSelection=false)
|
||||||
|
{
|
||||||
|
size_t selCnt=0;
|
||||||
|
|
||||||
|
if(!preserveSelection) VertexClear(m);
|
||||||
|
for(EdgeIterator ei = m.edge.begin(); ei != m.edge.end(); ++ei)
|
||||||
|
if( !(*ei).IsD() && (*ei).IsS())
|
||||||
|
{
|
||||||
|
if( !(*ei).V(0)->IsS()) { (*ei).V(0)->SetS(); ++selCnt; }
|
||||||
|
if( !(*ei).V(1)->IsS()) { (*ei).V(1)->SetS(); ++selCnt; }
|
||||||
|
}
|
||||||
|
return selCnt;
|
||||||
|
}
|
||||||
|
|
||||||
/// \brief Select ONLY the vertices that are touched ONLY by selected faces
|
/// \brief Select ONLY the vertices that are touched ONLY by selected faces
|
||||||
/** In other words all the vertices having all the faces incident on them selected.
|
/** In other words all the vertices having all the faces incident on them selected.
|
||||||
\warning Isolated vertices will not selected.
|
\warning Isolated vertices will not selected.
|
||||||
|
|
@ -259,7 +274,7 @@ static size_t VertexFromFaceStrict(MeshType &m)
|
||||||
(*fi).V(1)->ClearS();
|
(*fi).V(1)->ClearS();
|
||||||
(*fi).V(2)->ClearS();
|
(*fi).V(2)->ClearS();
|
||||||
}
|
}
|
||||||
return CountVertex(m);
|
return VertexCount(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Select ONLY the faces with ALL the vertices selected
|
/// \brief Select ONLY the faces with ALL the vertices selected
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue