Add template based SelectionSingleton::countObjectsOfType
Also convert code to use this new method
This commit is contained in:
@@ -173,11 +173,7 @@ void CmdMeshPartTrimByPlane::activated(int)
|
||||
bool CmdMeshPartTrimByPlane::isActive()
|
||||
{
|
||||
// Check for the selected mesh feature (all Mesh types)
|
||||
if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) != 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return getSelection().countObjectsOfType<Mesh::Feature>() == 1;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -262,11 +258,7 @@ void CmdMeshPartSection::activated(int)
|
||||
bool CmdMeshPartSection::isActive()
|
||||
{
|
||||
// Check for the selected mesh feature (all Mesh types)
|
||||
if (getSelection().countObjectsOfType(Mesh::Feature::getClassTypeId()) != 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return getSelection().countObjectsOfType<Mesh::Feature>() == 1;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -304,7 +296,7 @@ void CmdMeshPartCrossSections::activated(int iMsg)
|
||||
|
||||
bool CmdMeshPartCrossSections::isActive()
|
||||
{
|
||||
return (Gui::Selection().countObjectsOfType(Mesh::Feature::getClassTypeId()) > 0
|
||||
return (Gui::Selection().countObjectsOfType<Mesh::Feature>() > 0
|
||||
&& !Gui::Control().activeDialog());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user