#include <ModuleBase_IModule.h>
#include <ModuleBase_Tools.h>
-#include <ModuleBase_OperationAction.h>
+#include <ModuleBase_Operation.h>
#include <ModuleBase_ViewerPrs.h>
#include <QAction>
aDesktop, this, SLOT(onRename()));
addAction("RENAME_CMD", aAction);
- aAction = ModuleBase_Tools::createAction(QIcon(":pictures/move.png"),
+ aAction = ModuleBase_Tools::createAction(QIcon(":pictures/move_to_end.png"),
XGUI_Workshop::MOVE_TO_END_COMMAND, this);
addAction("MOVE_CMD", aAction);
+ aAction = ModuleBase_Tools::createAction(QIcon(":pictures/move_to_end_split.png"),
+ XGUI_Workshop::MOVE_TO_END_SPLIT_COMMAND, this);
+ addAction("MOVE_SPLIT_CMD", aAction);
+
aAction = ModuleBase_Tools::createAction(QIcon(":pictures/clean_history.png"),
tr("Clean history"), aDesktop);
addAction("CLEAN_HISTORY_CMD", aAction);
aDesktop);
addAction("WIREFRAME_CMD", aAction);
+ aAction = ModuleBase_Tools::createAction(QIcon(":pictures/iso_lines.png"), tr("Iso-lines..."),
+ aDesktop);
+ addAction("ISOLINES_CMD", aAction);
+
mySeparator1 = ModuleBase_Tools::createAction(QIcon(), "", aDesktop);
mySeparator1->setSeparator(true);
bool hasCompositeOwner = false;
bool hasResultInHistory = false;
bool hasFolder = false;
- bool canBeDeleted = true;
ModuleBase_Tools::checkObjects(aObjects, hasResult, hasFeature, hasParameter,
hasCompositeOwner, hasResultInHistory, hasFolder);
//Process Feature
if (aMode != XGUI_Displayer::NoMode) {
action("WIREFRAME_CMD")->setEnabled(aMode == XGUI_Displayer::Shading);
action("SHADING_CMD")->setEnabled(aMode == XGUI_Displayer::Wireframe);
+ action("ISOLINES_CMD")->setEnabled(true);
} else {
action("WIREFRAME_CMD")->setEnabled(true);
action("SHADING_CMD")->setEnabled(true);
+ action("ISOLINES_CMD")->setEnabled(true);
}
}
if (!hasFeature) {
if (!(hasParameter || hasFeature))
action("SHOW_ONLY_CMD")->setEnabled(true);
}
- else if (hasFeature && myWorkshop->canMoveFeature())
+ else if (hasFeature && myWorkshop->canMoveFeature()) {
action("MOVE_CMD")->setEnabled(true);
+ action("MOVE_SPLIT_CMD")->setEnabled(true);
+ }
if( aMgr->activeDocument() == aObject->document() )
{
action("RENAME_CMD")->setEnabled(true);
- if (aObject->groupName() == ModelAPI_ResultConstruction::group()) {
- ResultConstructionPtr aConstr = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aObject);
- FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
- canBeDeleted = !(!(aFeature->isInHistory()) && aConstr->isInfinite());
- action("DELETE_CMD")->setEnabled(canBeDeleted);
- }
- else
- action("DELETE_CMD")->setEnabled(!hasCompositeOwner);
+ action("DELETE_CMD")->setEnabled(!hasCompositeOwner);
action("CLEAN_HISTORY_CMD")->setEnabled(!hasCompositeOwner &&
(hasFeature || hasParameter));
}
action("SHOW_ONLY_CMD")->setEnabled(true);
action("SHADING_CMD")->setEnabled(true);
action("WIREFRAME_CMD")->setEnabled(true);
-
- foreach(ObjectPtr aObj, aObjects) {
- FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
- if (!aFeature->isInHistory()) {
- canBeDeleted = false;
- break;
- }
- }
- action("DELETE_CMD")->setEnabled(canBeDeleted);
+ action("ISOLINES_CMD")->setEnabled(true);
}
- if (hasFeature && myWorkshop->canMoveFeature())
+ if (hasFeature && myWorkshop->canMoveFeature()) {
action("MOVE_CMD")->setEnabled(true);
+ action("MOVE_SPLIT_CMD")->setEnabled(true);
+ }
} // end multi-selection
// Check folder management commands state if only features are selected
break;
}
if (!hasCompositeOwner && allActive ) {
- if (hasResult || hasFeature || hasParameter) // #2924 results can be erased
- action("DELETE_CMD")->setEnabled(canBeDeleted);
+ if (hasResult || hasFeature || hasParameter) // #2924 results can be erased
+ action("DELETE_CMD")->setEnabled(true);
}
if (!hasCompositeOwner && allActive && (hasFeature|| hasParameter))
action("CLEAN_HISTORY_CMD")->setEnabled(true);
if (aMode != XGUI_Displayer::NoMode) {
action("WIREFRAME_CMD")->setEnabled(aMode == XGUI_Displayer::Shading);
action("SHADING_CMD")->setEnabled(aMode == XGUI_Displayer::Wireframe);
+ action("ISOLINES_CMD")->setEnabled(true);
} else {
action("WIREFRAME_CMD")->setEnabled(true);
action("SHADING_CMD")->setEnabled(true);
+ action("ISOLINES_CMD")->setEnabled(true);
}
}
action("SHOW_ONLY_CMD")->setEnabled(true);
}
}
+ ModuleBase_IModule* aModule = myWorkshop->module();
+ if (aModule)
+ aModule->updateViewerMenu(myActions);
+
if (myWorkshop->canChangeProperty("COLOR_CMD"))
action("COLOR_CMD")->setEnabled(true);
if (myWorkshop->canChangeProperty("TRANSPARENCY_CMD"))
action("TRANSPARENCY_CMD")->setEnabled(true);
- ModuleBase_IModule* aModule = myWorkshop->module();
- if (aModule)
- aModule->updateViewerMenu(myActions);
+ action("DELETE_CMD")->setEnabled(true);
}
void XGUI_ContextMenuMgr::connectObjectBrowser()
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
aList.append(action("TRANSPARENCY_CMD"));
+ aList.append(action("ISOLINES_CMD"));
aList.append(action("SHOW_FEATURE_CMD"));
aList.append(mySeparator3);
aList.append(action("DELETE_CMD"));
aList.append(action("RENAME_CMD"));
aList.append(action("SHOW_RESULTS_CMD"));
aList.append(action("MOVE_CMD"));
+ aList.append(action("MOVE_SPLIT_CMD"));
aList.append(mySeparator1);
aList.append(action("INSERT_FOLDER_CMD"));
aList.append(action("ADD_TO_FOLDER_BEFORE_CMD"));
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
aList.append(action("TRANSPARENCY_CMD"));
+ aList.append(action("ISOLINES_CMD"));
aList.append(mySeparator3);
aList.append(action("SET_VIEW_NORMAL_CMD"));
aList.append(action("SET_VIEW_INVERTEDNORMAL_CMD"));
aActions.append(action("ADD_OUT_FOLDER_AFTER_CMD"));
aActions.append(mySeparator3);
aActions.append(action("MOVE_CMD"));
+ aActions.append(action("MOVE_SPLIT_CMD"));
aActions.append(action("COLOR_CMD"));
aActions.append(action("DEFLECTION_CMD"));
aActions.append(action("TRANSPARENCY_CMD"));
+ aActions.append(action("ISOLINES_CMD"));
aActions.append(action("CLEAN_HISTORY_CMD"));
aActions.append(action("DELETE_CMD"));
}