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 7a5a3d1ffc
commit 08c9a191e2
22 changed files with 148 additions and 165 deletions

View File

@@ -132,11 +132,11 @@ void Workbench::setupContextMenu(const char* recipient, Gui::MenuItem* item) con
}
}
if (Gui::Selection().countObjectsOfType(PartDesign::Transformed::getClassTypeId()) -
Gui::Selection().countObjectsOfType(PartDesign::MultiTransform::getClassTypeId()) == 1 )
if (Gui::Selection().countObjectsOfType<PartDesign::Transformed>() -
Gui::Selection().countObjectsOfType<PartDesign::MultiTransform>() == 1 )
*item << "PartDesign_MultiTransform";
if (Gui::Selection().countObjectsOfType(App::DocumentObject::getClassTypeId()) > 0) {
if (Gui::Selection().countObjectsOfType<App::DocumentObject>() > 0) {
*item << "Std_Placement"
<< "Std_ToggleVisibility"
<< "Std_ShowSelection"