return TopAbs_SHAPE;
}
-void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFeature, bool& hasParameter, bool& hasSubFeature)
+void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFeature,
+ bool& hasParameter, bool& hasCompositeOwner)
{
hasResult = false;
hasFeature = false;
hasParameter = false;
- hasSubFeature = false;
+ hasCompositeOwner = false;
foreach(ObjectPtr aObj, theObjects) {
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
hasFeature |= (aFeature.get() != NULL);
hasParameter |= (aConstruction.get() != NULL);
if (hasFeature)
- hasSubFeature |= (ModelAPI_Tools::compositeOwner(aFeature) != NULL);
- if (hasFeature && hasResult && hasParameter && hasSubFeature)
+ hasCompositeOwner |= (ModelAPI_Tools::compositeOwner(aFeature) != NULL);
+ if (hasFeature && hasResult && hasParameter && hasCompositeOwner)
break;
}
}
\param hasResult will be set to true if list contains Result objects
\param hasFeature will be set to true if list contains Feature objects
\param hasParameter will be set to true if list contains Parameter objects
-\param hasSubFeature will be set to true if list contains Sub-Feature objects
+\param hasCompositeOwner will be set to true if list contains Sub-Feature objects
*/
MODULEBASE_EXPORT void checkObjects(const QObjectPtrList& theObjects, bool& hasResult,
- bool& hasFeature, bool& hasParameter, bool& hasSubFeature);
+ bool& hasFeature, bool& hasParameter, bool& hasCompositeOwner);
/*! Sets the default coeffient into the driver calculated accordingly the shape type.
It provides 1.e-4 for a shape withe Edge shape type
bool hasResult = false;
bool hasFeature = false;
bool hasParameter = false;
- bool hasSubFeature = false;
- ModuleBase_Tools::checkObjects(aObjects, hasResult, hasFeature, hasParameter, hasSubFeature);
-
+ bool hasCompositeOwner = false;
+ ModuleBase_Tools::checkObjects(aObjects, hasResult, hasFeature, hasParameter,
+ hasCompositeOwner);
ObjectPtr aObject = aObjects.first();
if (aObject) {
ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aObject);
bool hasResult = false;
bool hasFeature = false;
bool hasParameter = false;
- bool hasSubFeature = false;
- ModuleBase_Tools::checkObjects(aObjects, hasResult, hasFeature, hasParameter, hasSubFeature);
-
+ bool hasCompositeOwner = false;
+ ModuleBase_Tools::checkObjects(aObjects, hasResult, hasFeature, hasParameter,
+ hasCompositeOwner);
//Process Feature
if (aSelected == 1) {
ObjectPtr aObject = aObjects.first();
else if (hasFeature && myWorkshop->canMoveFeature())
action("MOVE_CMD")->setEnabled(true);
- else if (hasFeature || hasParameter)
- action("CLEAN_HISTORY_CMD")->setEnabled(!hasSubFeature);
-
if( aMgr->activeDocument() == aObject->document() )
{
action("RENAME_CMD")->setEnabled(true);
- action("DELETE_CMD")->setEnabled(!hasSubFeature);
+ action("DELETE_CMD")->setEnabled(!hasCompositeOwner);
+ action("CLEAN_HISTORY_CMD")->setEnabled(!hasCompositeOwner &&
+ (hasFeature || hasParameter));
}
}
} else {
allActive = false;
break;
}
- if (!hasSubFeature && allActive ) {
+ if (!hasCompositeOwner && allActive ) {
if (hasFeature || hasParameter)
action("DELETE_CMD")->setEnabled(true);
}
- if (!hasSubFeature && allActive && (hasFeature|| hasParameter))
+ if (!hasCompositeOwner && allActive && (hasFeature|| hasParameter))
action("CLEAN_HISTORY_CMD")->setEnabled(true);
action("SHOW_RESULTS_CMD")->setEnabled(hasFeature);
bool hasResult = false;
bool hasFeature = false;
bool hasParameter = false;
- bool hasSubFeature = false;
- ModuleBase_Tools::checkObjects(anObjects, hasResult, hasFeature, hasParameter, hasSubFeature);
+ bool hasCompositeOwner = false;
+ ModuleBase_Tools::checkObjects(anObjects, hasResult, hasFeature, hasParameter, hasCompositeOwner);
if (!(hasFeature || hasParameter))
return;