Added UpdateSelection::VertexFromEdgeLoose
added parameter for preserving the old selection to the UpdateSelection::VertexFromFaceLoose
This commit is contained in:
parent
34cb93552c
commit
412ef1aa65
|
@ -229,13 +229,13 @@ static size_t VertexInvert(MeshType &m)
|
|||
}
|
||||
|
||||
/// \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;
|
||||
VertexClear(m);
|
||||
FaceIterator fi;
|
||||
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||
if( !(*fi).IsD() && (*fi).IsS())
|
||||
|
||||
if(!preserveSelection) VertexClear(m);
|
||||
for(FaceIterator fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||
if( !(*fi).IsD() && (*fi).IsS())
|
||||
{
|
||||
if( !(*fi).V(0)->IsS()) { (*fi).V(0)->SetS(); ++selCnt; }
|
||||
if( !(*fi).V(1)->IsS()) { (*fi).V(1)->SetS(); ++selCnt; }
|
||||
|
@ -244,22 +244,37 @@ static size_t VertexFromFaceLoose(MeshType &m)
|
|||
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
|
||||
/** In other words all the vertices having all the faces incident on them selected.
|
||||
\warning Isolated vertices will not selected.
|
||||
*/
|
||||
static size_t VertexFromFaceStrict(MeshType &m)
|
||||
{
|
||||
VertexFromFaceLoose(m);
|
||||
VertexFromFaceLoose(m);
|
||||
FaceIterator fi;
|
||||
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||
if( !(*fi).IsD() && !(*fi).IsS())
|
||||
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||
if( !(*fi).IsD() && !(*fi).IsS())
|
||||
{
|
||||
(*fi).V(0)->ClearS();
|
||||
(*fi).V(1)->ClearS();
|
||||
(*fi).V(2)->ClearS();
|
||||
(*fi).V(0)->ClearS();
|
||||
(*fi).V(1)->ClearS();
|
||||
(*fi).V(2)->ClearS();
|
||||
}
|
||||
return CountVertex(m);
|
||||
return VertexCount(m);
|
||||
}
|
||||
|
||||
/// \brief Select ONLY the faces with ALL the vertices selected
|
||||
|
|
Loading…
Reference in New Issue