//Config_PropManager::registerProp("Visualization", "object_default_color", "Object color",
// Config_Prop::Color, "225,225,225");
- Config_PropManager::registerProp("Visualization", "result_body_color", "Body color",
+ Config_PropManager::registerProp("Visualization", "result_body_color", "Result color",
Config_Prop::Color, ModelAPI_ResultBody::DEFAULT_COLOR());
Config_PropManager::registerProp("Visualization", "result_group_color", "Group color",
Config_Prop::Color, ModelAPI_ResultGroup::DEFAULT_COLOR());
QObjectPtrList anObjects = mySelector->selection()->selectedObjects();
if (!abortAllOperations())
return;
- // check whether the object can be deleted. There should not be parts which are not loaded
- if (!XGUI_Tools::canRemoveOrRename(desktop(), anObjects))
- return;
bool hasResult = false;
bool hasFeature = false;
// moving and negative consequences connected with processing of already moved items
mySelector->clearSelection();
// check whether the object can be moved. There should not be parts which are not loaded
- if (!XGUI_Tools::canRemoveOrRename(desktop(), anObjects))
+ std::set<FeaturePtr> aFeatures;
+ ModuleBase_Tools::convertToFeatures(anObjects, aFeatures);
+ if (!XGUI_Tools::canRemoveOrRename(desktop(), aFeatures))
return;
DocumentPtr anActiveDocument = aMgr->activeDocument();
FeaturePtr aCurrentFeature = anActiveDocument->currentFeature(true);
- foreach (ObjectPtr aObject, anObjects) {
- if (!myModule->canApplyAction(aObject, anActionId))
+ std::set<FeaturePtr>::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end();
+ for (; anIt != aLast; anIt++) {
+ FeaturePtr aFeature = *anIt;
+ if (!aFeature.get() || !myModule->canApplyAction(aFeature, anActionId))
continue;
- FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObject);
- if (aFeature.get()) {
- anActiveDocument->moveFeature(aFeature, aCurrentFeature);
- aCurrentFeature = anActiveDocument->currentFeature(true);
- }
+ anActiveDocument->moveFeature(aFeature, aCurrentFeature);
+ aCurrentFeature = anActiveDocument->currentFeature(true);
}
aMgr->finishOperation();
}