Salome HOME
97fa7a9fdd795f27fd0e09d3323f7bce50bebffe
[modules/shaper.git] / src / ParametersPlugin / ParametersPlugin_Plugin.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #include <ParametersPlugin_Plugin.h>
4 #include <ParametersPlugin_Parameter.h>
5 #include <ParametersPlugin_Validators.h>
6
7 #include <ModelAPI_Session.h>
8 #include <ModelAPI_Validator.h>
9
10 #include <memory>
11
12 // the only created instance of this plugin
13 static ParametersPlugin_Plugin* MY_PARAMETERSPLUGIN_INSTANCE = new ParametersPlugin_Plugin();
14
15 ParametersPlugin_Plugin::ParametersPlugin_Plugin()
16 {
17   // register this plugin
18   SessionPtr aSession = ModelAPI_Session::get();
19   aSession->registerPlugin(this);
20
21   ModelAPI_ValidatorsFactory* aFactory = aSession->validators();
22   aFactory->registerValidator("Parameters_VariableValidator",
23                               new ParametersPlugin_VariableValidator);
24   aFactory->registerValidator("Parameters_ExpressionValidator",
25                               new ParametersPlugin_ExpressionValidator);
26 }
27
28 FeaturePtr ParametersPlugin_Plugin::createFeature(std::string theFeatureID)
29 {
30   // TODO: register some features
31   if (theFeatureID == ParametersPlugin_Parameter::ID()) {
32     return FeaturePtr(new ParametersPlugin_Parameter);
33   }
34   return FeaturePtr();
35 }
36