+ add convenience methods to query/alter selection of mesh object

This commit is contained in:
wmayer
2016-02-24 21:31:12 +01:00
parent 660a30ce01
commit 63e09bcbc2
4 changed files with 41 additions and 4 deletions

View File

@@ -592,16 +592,24 @@ void MeshObject::getPointsFromSelection(std::vector<unsigned long>& inds) const
MeshCore::MeshAlgorithm(this->_kernel).GetPointsFlag(inds, MeshCore::MeshPoint::SELECTED);
}
unsigned long MeshObject::countSelectedFacets() const
{
return MeshCore::MeshAlgorithm(this->_kernel).CountFacetFlag(MeshCore::MeshFacet::SELECTED);
}
bool MeshObject::hasSelectedFacets() const
{
unsigned long ct = MeshCore::MeshAlgorithm(this->_kernel).CountFacetFlag(MeshCore::MeshFacet::SELECTED);
return ct > 0;
return (countSelectedFacets() > 0);
}
unsigned long MeshObject::countSelectedPoints() const
{
return MeshCore::MeshAlgorithm(this->_kernel).CountPointFlag(MeshCore::MeshPoint::SELECTED);
}
bool MeshObject::hasSelectedPoints() const
{
unsigned long ct = MeshCore::MeshAlgorithm(this->_kernel).CountPointFlag(MeshCore::MeshPoint::SELECTED);
return ct > 0;
return (countSelectedPoints() > 0);
}
std::vector<unsigned long> MeshObject::getPointsFromFacets(const std::vector<unsigned long>& facets) const