#include "XGUI_ViewerProxy.h"
#include "XGUI_Selection.h"
#include "XGUI_SalomeConnector.h"
+#include "XGUI_Tools.h"
#include <AppElements_MainWindow.h>
return 0;
}
+QAction* XGUI_ContextMenuMgr::actionByName(const QString& theName) const
+{
+ foreach(QAction* eachAction, myActions) {
+ if (eachAction->text() == theName) {
+ return eachAction;
+ }
+ }
+ return NULL;
+}
+
QStringList XGUI_ContextMenuMgr::actionIds() const
{
return myActions.keys();
bool hasResult = false;
bool hasFeature = false;
bool hasParameter = false;
- foreach(ObjectPtr aObj, aObjects)
- {
- FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
- ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
- ResultParameterPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aResult);
-
- hasResult = (aResult.get() != NULL);
- hasFeature = (aFeature.get() != NULL);
- hasParameter = (aConstruction.get() != NULL);
- if (hasFeature && hasResult && hasParameter)
- break;
- }
+ XGUI_Tools::checkObjects(aObjects, hasResult, hasFeature, hasParameter);
+
//Process Feature
if (aSelected == 1) {
ObjectPtr aObject = aObjects.first();