1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
5 #include <ParametersPlugin_Plugin.h>
6 #include <ParametersPlugin_Parameter.h>
7 #include <ParametersPlugin_ParametersMgr.h>
8 #include <ParametersPlugin_Validators.h>
9 #include <ParametersPlugin_WidgetCreator.h>
11 #include <ModuleBase_WidgetCreatorFactory.h>
13 #include <ModelAPI_Session.h>
14 #include <ModelAPI_Validator.h>
18 // the only created instance of this plugin
19 static ParametersPlugin_Plugin* MY_PARAMETERSPLUGIN_INSTANCE = new ParametersPlugin_Plugin();
21 ParametersPlugin_Plugin::ParametersPlugin_Plugin()
23 // register this plugin
24 WidgetCreatorFactoryPtr aWidgetCreatorFactory = ModuleBase_WidgetCreatorFactory::get();
25 aWidgetCreatorFactory->registerCreator(
26 std::shared_ptr<ParametersPlugin_WidgetCreator>(new ParametersPlugin_WidgetCreator()));
28 SessionPtr aSession = ModelAPI_Session::get();
29 aSession->registerPlugin(this);
31 ModelAPI_ValidatorsFactory* aFactory = aSession->validators();
32 aFactory->registerValidator("Parameters_VariableValidator",
33 new ParametersPlugin_VariableValidator);
34 aFactory->registerValidator("Parameters_ExpressionValidator",
35 new ParametersPlugin_ExpressionValidator);
38 std::shared_ptr<ParametersPlugin_EvalListener>(new ParametersPlugin_EvalListener());
41 FeaturePtr ParametersPlugin_Plugin::createFeature(std::string theFeatureID)
43 // TODO: register some features
44 if (theFeatureID == ParametersPlugin_Parameter::ID()) {
45 return FeaturePtr(new ParametersPlugin_Parameter);
47 if (theFeatureID == ParametersPlugin_ParametersMgr::ID()) {
48 return FeaturePtr(new ParametersPlugin_ParametersMgr);