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 <ModelAPI_Session.h>
12 #include <ModelAPI_Validator.h>
18 // the only created instance of this plugin
19 static ExchangePlugin_Plugin* MY_EXCHANGE_INSTANCE = new ExchangePlugin_Plugin();
21 ExchangePlugin_Plugin::ExchangePlugin_Plugin()
23 // register this plugin
24 SessionPtr aSession = ModelAPI_Session::get();
25 aSession->registerPlugin(this);
26 ModelAPI_ValidatorsFactory* aFactory = aSession->validators();
27 aFactory->registerValidator("ExchangePlugin_ImportFormat",
28 new ExchangePlugin_ImportFormatValidator);
31 FeaturePtr ExchangePlugin_Plugin::createFeature(string theFeatureID)
33 if (theFeatureID == ExchangePlugin_ImportFeature::ID()) {
34 return FeaturePtr(new ExchangePlugin_ImportFeature);
36 // feature of such kind is not found