-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+// Copyright (C) 2014-2017 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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
#include "XGUI_ContextMenuMgr.h"
#include "XGUI_Workshop.h"
aAction = ModuleBase_Tools::createAction(QIcon(""), tr("Deflection..."), aDesktop);
addAction("DEFLECTION_CMD", aAction);
+#ifdef USE_TRANSPARENCY
+ aAction = ModuleBase_Tools::createAction(QIcon(":pictures/transparency.png"),
+ tr("Transparency..."), aDesktop);
+ addAction("TRANSPARENCY_CMD", aAction);
+#endif
+
aAction = ModuleBase_Tools::createAction(QIcon(":pictures/eye_pencil.png"), tr("Show"), aDesktop);
addAction("SHOW_CMD", aAction);
bool hasFeature = false;
bool hasParameter = false;
bool hasCompositeOwner = false;
+ bool hasResultInHistory = false;
ModuleBase_Tools::checkObjects(aObjects, hasResult, hasFeature, hasParameter,
- hasCompositeOwner);
+ hasCompositeOwner, hasResultInHistory);
//Process Feature
if (aSelected == 1) {
ObjectPtr aObject = aObjects.first();
action("CLEAN_HISTORY_CMD")->setEnabled(true);
action("SHOW_RESULTS_CMD")->setEnabled(hasFeature);
- action("SHOW_FEATURE_CMD")->setEnabled(hasResult);
+ action("SHOW_FEATURE_CMD")->setEnabled(hasResult && hasResultInHistory);
}
// Show/Hide command has to be disabled for objects from non active document
action("SHOW_ONLY_CMD")->setEnabled(false);
}
- if (myWorkshop->canChangeColor())
- action("COLOR_CMD")->setEnabled(true);
-
- if (myWorkshop->canChangeDeflection())
- action("DEFLECTION_CMD")->setEnabled(true);
-
+ action("COLOR_CMD")->setEnabled(myWorkshop->canChangeProperty("COLOR_CMD"));
+ action("DEFLECTION_CMD")->setEnabled(myWorkshop->canChangeProperty("DEFLECTION_CMD"));
+#ifdef USE_TRANSPARENCY
+ action("TRANSPARENCY_CMD")->setEnabled(myWorkshop->canChangeProperty("TRANSPARENCY_CMD"));
+#endif
#ifdef _DEBUG
#ifdef TINSPECTOR
action("TINSPECTOR_VIEW")->setEnabled(true);
} else
action("SHOW_CMD")->setEnabled(true);
}
+ //issue #2159 Hide all incomplete behavior
+#ifdef HAVE_SALOME
+ action("HIDEALL_CMD")->setEnabled(true);
+#else
if (myWorkshop->displayer()->objectsCount() > 0)
action("HIDEALL_CMD")->setEnabled(true);
+#endif
// Update selection menu
QIntList aModes = aDisplayer->activeSelectionModes();
if (aModule)
aModule->updateViewerMenu(myActions);
- if (myWorkshop->canChangeColor())
+ if (myWorkshop->canChangeProperty("COLOR_CMD"))
action("COLOR_CMD")->setEnabled(true);
- if (myWorkshop->canChangeDeflection())
+ if (myWorkshop->canChangeProperty("DEFLECTION_CMD"))
action("DEFLECTION_CMD")->setEnabled(true);
+#ifdef USE_TRANSPARENCY
+ if (myWorkshop->canChangeProperty("TRANSPARENCY_CMD"))
+ action("TRANSPARENCY_CMD")->setEnabled(true);
+#endif
+
action("DELETE_CMD")->setEnabled(true);
}
aList.append(action("RENAME_CMD"));
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
+#ifdef USE_TRANSPARENCY
+ aList.append(action("TRANSPARENCY_CMD"));
+#endif
aList.append(action("SHOW_FEATURE_CMD"));
myObjBrowserMenus[ModelAPI_ResultConstruction::group()] = aList;
aList.append(action("RENAME_CMD"));
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
+#ifdef USE_TRANSPARENCY
+ aList.append(action("TRANSPARENCY_CMD"));
+#endif
aList.append(action("SHOW_FEATURE_CMD"));
myObjBrowserMenus[ModelAPI_ResultBody::group()] = aList;
// Group menu
aList.append(mySeparator);
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
+#ifdef USE_TRANSPARENCY
+ aList.append(action("TRANSPARENCY_CMD"));
+#endif
myViewerMenu[ModelAPI_ResultConstruction::group()] = aList;
// Result part menu
myViewerMenu[ModelAPI_ResultPart::group()] = aList;
aList.append(mySeparator);
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
+#ifdef USE_TRANSPARENCY
+ aList.append(action("TRANSPARENCY_CMD"));
+#endif
myViewerMenu[ModelAPI_ResultBody::group()] = aList;
// Group menu
myViewerMenu[ModelAPI_ResultGroup::group()] = aList;
//aActions.append(action("MOVE_CMD"));
aActions.append(action("COLOR_CMD"));
aActions.append(action("DEFLECTION_CMD"));
-
+#ifdef USE_TRANSPARENCY
+ aActions.append(action("TRANSPARENCY_CMD"));
+#endif
aActions.append(action("CLEAN_HISTORY_CMD"));
aActions.append(action("DELETE_CMD"));
}
aActions.append(action("HIDEALL_CMD"));
aActions.append(action("COLOR_CMD"));
aActions.append(action("DEFLECTION_CMD"));
-
+#ifdef USE_TRANSPARENCY
+ aActions.append(action("TRANSPARENCY_CMD"));
+#endif
theMenu->addActions(aActions);
QMap<int, QAction*> aMenuActions;
bool aIsRoot = false;
foreach(QModelIndex aIdx, aSelectedIndexes) {
// Process only first column
- if (aIdx.column() == 0) {
+ if (aIdx.column() == 1) {
aIsRoot = !aIdx.parent().isValid();
// Exit if the selected index belongs to non active document
if (aIsRoot && (aActiveDoc != aMgr->moduleDocument()))