1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
7 #include <ExchangePlugin_Plugin.h>
8 #include <ExchangePlugin_ImportFeature.h>
9 #include <ExchangePlugin_ExportFeature.h>
10 #include <ExchangePlugin_Validators.h>
12 #include <Config_PropManager.h>
14 #include <ModelAPI_Session.h>
15 #include <ModelAPI_Validator.h>
21 // the only created instance of this plugin
22 static ExchangePlugin_Plugin* MY_EXCHANGE_INSTANCE = new ExchangePlugin_Plugin();
24 ExchangePlugin_Plugin::ExchangePlugin_Plugin()
26 // register this plugin
27 SessionPtr aSession = ModelAPI_Session::get();
28 aSession->registerPlugin(this);
29 ModelAPI_ValidatorsFactory* aFactory = aSession->validators();
30 aFactory->registerValidator("ExchangePlugin_ImportFormat",
31 new ExchangePlugin_ImportFormatValidator);
32 aFactory->registerValidator("ExchangePlugin_ExportFormat",
33 new ExchangePlugin_ExportFormatValidator);
35 // register construction properties
36 //Config_PropManager::registerProp("Visualization", "import_feature_color", "Imported feature color",
37 // Config_Prop::Color, ExchangePlugin_ImportFeature::DEFAULT_COLOR());
40 FeaturePtr ExchangePlugin_Plugin::createFeature(string theFeatureID)
42 if (theFeatureID == ExchangePlugin_ImportFeature::ID()) {
43 return FeaturePtr(new ExchangePlugin_ImportFeature);
45 if (theFeatureID == ExchangePlugin_ExportFeature::ID()) {
46 return FeaturePtr(new ExchangePlugin_ExportFeature);
48 // feature of such kind is not found