Salome HOME
Added unit test for the issue #1806
[modules/shaper.git] / src / ParametersPlugin / ParametersPlugin_Plugin.cpp
index 9affdd7a1297dd255121805386702dd92ca4f40e..364e189c6f7896d6967eea347abcb3abd0122ccd 100644 (file)
@@ -1,9 +1,17 @@
 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 
+#include <pyconfig.h>
+
 #include <ParametersPlugin_Plugin.h>
 #include <ParametersPlugin_Parameter.h>
+#include <ParametersPlugin_ParametersMgr.h>
+#include <ParametersPlugin_Validators.h>
+#include <ParametersPlugin_WidgetCreator.h>
+
+#include <ModuleBase_WidgetCreatorFactory.h>
 
 #include <ModelAPI_Session.h>
+#include <ModelAPI_Validator.h>
 
 #include <memory>
 
@@ -13,8 +21,21 @@ static ParametersPlugin_Plugin* MY_PARAMETERSPLUGIN_INSTANCE = new ParametersPlu
 ParametersPlugin_Plugin::ParametersPlugin_Plugin()
 {
   // register this plugin
+  WidgetCreatorFactoryPtr aWidgetCreatorFactory = ModuleBase_WidgetCreatorFactory::get();
+  aWidgetCreatorFactory->registerCreator(
+   std::shared_ptr<ParametersPlugin_WidgetCreator>(new ParametersPlugin_WidgetCreator()));
+
   SessionPtr aSession = ModelAPI_Session::get();
   aSession->registerPlugin(this);
+
+  ModelAPI_ValidatorsFactory* aFactory = aSession->validators();
+  aFactory->registerValidator("Parameters_VariableValidator",
+                              new ParametersPlugin_VariableValidator);
+  aFactory->registerValidator("Parameters_ExpressionValidator",
+                              new ParametersPlugin_ExpressionValidator);
+
+  myEvalListener =
+    std::shared_ptr<ParametersPlugin_EvalListener>(new ParametersPlugin_EvalListener());
 }
 
 FeaturePtr ParametersPlugin_Plugin::createFeature(std::string theFeatureID)
@@ -23,6 +44,9 @@ FeaturePtr ParametersPlugin_Plugin::createFeature(std::string theFeatureID)
   if (theFeatureID == ParametersPlugin_Parameter::ID()) {
     return FeaturePtr(new ParametersPlugin_Parameter);
   }
+  if (theFeatureID == ParametersPlugin_ParametersMgr::ID()) {
+    return FeaturePtr(new ParametersPlugin_ParametersMgr);
+  }
   return FeaturePtr();
 }