]> SALOME platform Git repositories - modules/shaper.git/blob - src/ExchangePlugin/ExchangePlugin_Plugin.cpp
Salome HOME
Issue #273: Add copyright string
[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 <ModelAPI_Session.h>
12 #include <ModelAPI_Validator.h>
13
14 #include <memory>
15
16 using namespace std;
17
18 // the only created instance of this plugin
19 static ExchangePlugin_Plugin* MY_EXCHANGE_INSTANCE = new ExchangePlugin_Plugin();
20
21 ExchangePlugin_Plugin::ExchangePlugin_Plugin()
22 {
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);
29 }
30
31 FeaturePtr ExchangePlugin_Plugin::createFeature(string theFeatureID)
32 {
33   if (theFeatureID == ExchangePlugin_ImportFeature::ID()) {
34     return FeaturePtr(new ExchangePlugin_ImportFeature);
35   }
36   // feature of such kind is not found
37   return FeaturePtr();
38 }