-// Copyright (C) 2014-2021 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
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);
aDesktop);
addAction("WIREFRAME_CMD", anAction);
+ anAction = ModuleBase_Tools::createAction(QIcon(":pictures/edges_dir.png"), tr("Show edges direction"),
+ aDesktop);
+ anAction->setCheckable(true);
+ addAction("SHOW_EDGES_DIRECTION_CMD", anAction);
+
anAction = ModuleBase_Tools::createAction(QIcon(":pictures/iso_lines.png"), tr("Define Isos..."),
aDesktop);
addAction("ISOLINES_CMD", anAction);
action("WIREFRAME_CMD")->setEnabled(true);
action("SHADING_CMD")->setEnabled(true);
}
+ action("SHOW_EDGES_DIRECTION_CMD")->setEnabled(true);
+ action("SHOW_EDGES_DIRECTION_CMD")->setChecked(ModelAPI_Tools::isShowEdgesDirection(aResult));
+
action("SHOW_ISOLINES_CMD")->setEnabled(true);
action("SHOW_ISOLINES_CMD")->setChecked(ModelAPI_Tools::isShownIsoLines(aResult));
action("ISOLINES_CMD")->setEnabled(true);
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() )
{
action("SHOW_ONLY_CMD")->setEnabled(true);
action("SHADING_CMD")->setEnabled(true);
action("WIREFRAME_CMD")->setEnabled(true);
+ action("SHOW_EDGES_DIRECTION_CMD")->setEnabled(true);
action("SHOW_ISOLINES_CMD")->setEnabled(true);
action("ISOLINES_CMD")->setEnabled(true);
}
if (aResult.get()) {
action("SHOW_ISOLINES_CMD")->setEnabled(true);
action("SHOW_ISOLINES_CMD")->setChecked(ModelAPI_Tools::isShownIsoLines(aResult));
+
+ action("SHOW_EDGES_DIRECTION_CMD")->setEnabled(true);
+ action("SHOW_EDGES_DIRECTION_CMD")->setChecked(
+ ModelAPI_Tools::isShowEdgesDirection(aResult));
}
}
}
aList.clear();
aList.append(action("WIREFRAME_CMD"));
aList.append(action("SHADING_CMD"));
+ aList.append(action("SHOW_EDGES_DIRECTION_CMD"));
aList.append(mySeparator1); // this separator is not shown as this action is added after show only
// qt list container contains only one instance of the same action
aList.append(action("SHOW_CMD"));
aList.clear();
aList.append(action("WIREFRAME_CMD"));
aList.append(action("SHADING_CMD"));
+ aList.append(action("SHOW_EDGES_DIRECTION_CMD"));
aList.append(mySeparator1); // this separator is not shown as this action is added after show only
// qt list container contains only one instance of the same action
aList.append(action("SHOW_CMD"));
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"));
aList.clear();
aList.append(action("WIREFRAME_CMD"));
aList.append(action("SHADING_CMD"));
+ aList.append(action("SHOW_EDGES_DIRECTION_CMD"));
aList.append(mySeparator2);
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
} else if (aSelected > 1) {
anActions.append(action("WIREFRAME_CMD"));
anActions.append(action("SHADING_CMD"));
+ anActions.append(action("SHOW_EDGES_DIRECTION_CMD"));
anActions.append(mySeparator1);
anActions.append(action("SHOW_CMD"));
anActions.append(action("HIDE_CMD"));