aCalculatedValue[1]);
}
}
+
+void InitializationPlugin_EvalListener::initDataModel()
+{
+ myInterp->runString("salome_iapp.load_module(\"Shaper\")");
+}
INITIALIZATIONPLUGIN_EXPORT
virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
+ // performs the python call to initialize high level data model on internal data model creation
+ void initDataModel();
+
protected:
/// Evaluates theExpression and returns its value.
double evaluate(std::shared_ptr<ModelAPI_Feature> theParameter,
if (aDoc != ModelAPI_Session::get()->moduleDocument())
return;
+ myEvalListener->initDataModel();
+
std::list<FeaturePtr> aFeatures;
// the viewer update should be blocked in order to avoid the features blinking before they are
Py_XDECREF(_local_context);
PyInterp_Interp::closeContext();
}
+
+bool InitializationPlugin_PyInterp::runString(std::string theString)
+{
+ PyLockWrapper lck; // Acquire GIL until the end of the method
+ return PyRun_SimpleString(theString.c_str());
+}
/// Evaluates theExpression and returns its value.
double evaluate(const std::string& theExpression, std::string& theError);
+ /// Runs the string command in the python interpreter. Returns true if no error is in result.
+ bool runString(std::string theString);
+
protected:
/// Returns error message.
std::string errorMessage();
}
}
}
+ SHAPERGUI_DataModel* aDataModel = dynamic_cast<SHAPERGUI_DataModel*>(dataModel());
+ aDataModel->initRootObject();
}
//******************************************************
bool isDone = LightApp_Module::activateModule(theStudy);
loadToolbarsConfig();
- SHAPERGUI_DataModel* aDataModel = dynamic_cast<SHAPERGUI_DataModel*>(dataModel());
- aDataModel->initRootObject();
-
if (isDone) {
setMenuShown(true);
setToolShown(true);