1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
7 #include <ExchangePlugin_Plugin.h>
8 #include <ExchangePlugin_ImportFeature.h>
9 #include <ExchangePlugin_Validators.h>
11 #include <Config_PropManager.h>
13 #include <ModelAPI_Session.h>
14 #include <ModelAPI_Validator.h>
20 // the only created instance of this plugin
21 static ExchangePlugin_Plugin* MY_EXCHANGE_INSTANCE = new ExchangePlugin_Plugin();
23 ExchangePlugin_Plugin::ExchangePlugin_Plugin()
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);
32 // register construction properties
33 Config_PropManager::registerProp("Visualization", "import_feature_color", "Imported feature color",
34 Config_Prop::Color, IMPORTED_FEATURE_COLOR);
36 // register random result color properties
37 Config_PropManager::registerProp("Visualization", "random_result_color", "Use random color for results",
38 Config_Prop::Bool, "true");
41 FeaturePtr ExchangePlugin_Plugin::createFeature(string theFeatureID)
43 if (theFeatureID == ExchangePlugin_ImportFeature::ID()) {
44 return FeaturePtr(new ExchangePlugin_ImportFeature);
46 // feature of such kind is not found