Salome HOME
Change color for construction/body/group.
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_Plugin.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  *
5  */
6
7 #include <ExchangePlugin_Plugin.h>
8 #include <ExchangePlugin_ImportFeature.h>
9 #include <ExchangePlugin_Validators.h>
10
11 #include <Config_PropManager.h>
12
13 #include <ModelAPI_Session.h>
14 #include <ModelAPI_Validator.h>
15
16 #include <memory>
17
18 using namespace std;
19
20 // the only created instance of this plugin
21 static ExchangePlugin_Plugin* MY_EXCHANGE_INSTANCE = new ExchangePlugin_Plugin();
22
23 ExchangePlugin_Plugin::ExchangePlugin_Plugin()
24 {
25   // register this plugin
26   SessionPtr aSession = ModelAPI_Session::get();
27   aSession->registerPlugin(this);
28   ModelAPI_ValidatorsFactory* aFactory = aSession->validators();
29   aFactory->registerValidator("ExchangePlugin_ImportFormat",
30                               new ExchangePlugin_ImportFormatValidator);
31
32   // register construction properties
33   //Config_PropManager::registerProp("Visualization", "import_feature_color", "Imported feature color",
34   //                                 Config_Prop::Color, ExchangePlugin_ImportFeature::DEFAULT_COLOR());
35 }
36
37 FeaturePtr ExchangePlugin_Plugin::createFeature(string theFeatureID)
38 {
39   if (theFeatureID == ExchangePlugin_ImportFeature::ID()) {
40     return FeaturePtr(new ExchangePlugin_ImportFeature);
41   }
42   // feature of such kind is not found
43   return FeaturePtr();
44 }