To recover in the active part:
#. select in the Main Menu *Features - > Recover* item or
-#. click |recover.icon| **Recover** button in the toolbar
+#. click |recover.icon| **Recover** button in the toolbar or
+#. click |recover.icon| **Recover** command in the context menu if one feature is selected in the Object Browser
The feature has the following options:
addAction("MOVE_SPLIT_CMD", anAction);
#endif
+ anAction = ModuleBase_Tools::createAction(QIcon(":pictures/recover.png"),
+ tr("Recover"), this);
+ addAction("RECOVER_CMD", anAction);
+
anAction = ModuleBase_Tools::createAction(QIcon(":pictures/clean_history.png"),
tr("Clean history"), aDesktop);
addAction("CLEAN_HISTORY_CMD", anAction);
action("MOVE_SPLIT_CMD")->setEnabled(true);
}
#endif
+ if (hasFeature && aObject->document() != aMgr->moduleDocument() &&
+ aObject->document() == aMgr->activeDocument())
+ {
+ XGUI_OperationMgr* anOperationMgr = myWorkshop->operationMgr();
+ if (!anOperationMgr->hasOperation()) {
+ FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObject);
+ std::list<std::shared_ptr<ModelAPI_Result> > aResults;
+ ModelAPI_Tools::getConcealedResults(aFeature, aResults);
+ if (!aResults.empty()) // check the feature conceals at least one result
+ action("RECOVER_CMD")->setEnabled(true);
+ }
+ }
if( aMgr->activeDocument() == aObject->document() )
{
aList.append(action("SHOW_RESULTS_CMD"));
aList.append(action("MOVE_CMD"));
aList.append(action("MOVE_SPLIT_CMD"));
+ aList.append(action("RECOVER_CMD"));
aList.append(mySeparator1);
aList.append(action("INSERT_FOLDER_CMD"));
aList.append(action("ADD_TO_FOLDER_BEFORE_CMD"));
cleanHistory();
else if (theId == "MOVE_CMD" || theId == "MOVE_SPLIT_CMD")
moveObjects(theId == "MOVE_SPLIT_CMD");
+ else if (theId == "RECOVER_CMD")
+ recoverFeature();
else if (theId == "COLOR_CMD")
changeColor(anObjects);
else if (theId == "AUTOCOLOR_CMD")
myViewerProxy->update();
}
+void XGUI_Workshop::recoverFeature()
+{
+ if (!abortAllOperations())
+ return;
+
+ static const QString RECOVER_OP_NAME = "Recover";
+ module()->launchOperation(RECOVER_OP_NAME, false);
+}
+
//**************************************************************
bool XGUI_Workshop::deleteFeatures(const QObjectPtrList& theObjects)
{
/// Move selected features to be after the current feature
void moveObjects(const bool theSplit);
+ /// Start a "Recover" feature on the selected one
+ void recoverFeature();
+
/// Returns true if the object can be shaded. If the object is a compsolid result, the method
/// checks subobjects of the result
/// \return boolean value
<source>Show Isos</source>
<translation>Show Isos</translation>
</message>
+ <message>
+ <source>Recover</source>
+ <translation>Récupérer</translation>
+ </message>
</context>
<context>
<name>XGUI_DataTree</name>
<file>pictures/insert_folder_before.png</file>
<file>pictures/move_out_after.png</file>
<file>pictures/move_out_before.png</file>
+ <file>pictures/recover.png</file>
<file>pictures/selection.png</file>
<file>pictures/autoapply_start.png</file>
<file>pictures/autoapply_stop.png</file>