Add template based SelectionSingleton::countObjectsOfType

Also convert code to use this new method
This commit is contained in:
Benjamin Nauck
2025-01-10 19:09:50 +01:00
parent 460da406f8
commit 74f3aee9a7
22 changed files with 148 additions and 165 deletions

View File

@@ -119,8 +119,7 @@ void CmdPartShapeFromMesh::activated(int iMsg)
bool CmdPartShapeFromMesh::isActive()
{
Base::Type meshid = Base::Type::fromName("Mesh::Feature");
return Gui::Selection().countObjectsOfType(meshid) > 0;
return Gui::Selection().countObjectsOfType("Mesh::Feature") > 0;
}
//===========================================================================
// Part_PointsFromMesh
@@ -205,8 +204,7 @@ void CmdPartPointsFromMesh::activated(int iMsg)
bool CmdPartPointsFromMesh::isActive()
{
Base::Type meshid = Base::Type::fromName("App::GeoFeature");
return Gui::Selection().countObjectsOfType(meshid) > 0;
return Gui::Selection().countObjectsOfType<App::GeoFeature>() > 0;
}
//===========================================================================