Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_Plugin.cpp
index b3256862a1c9e1c726bae79e19fec8e41d6477fc..6386d8a2a98b9562032cfcfb9bb60e1af6587e3b 100644 (file)
@@ -1,23 +1,31 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 /*
  *
  */
 
 #include <ExchangePlugin_Plugin.h>
 #include <ExchangePlugin_ImportFeature.h>
+#include <ExchangePlugin_Validators.h>
 
 #include <ModelAPI_Session.h>
+#include <ModelAPI_Validator.h>
 
-#include <boost/smart_ptr/shared_ptr.hpp>
+#include <memory>
 
 using namespace std;
 
 // the only created instance of this plugin
-static ExchangePlugin_Plugin* MY_INSTANCE = new ExchangePlugin_Plugin();
+static ExchangePlugin_Plugin* MY_EXCHANGE_INSTANCE = new ExchangePlugin_Plugin();
 
 ExchangePlugin_Plugin::ExchangePlugin_Plugin()
 {
   // register this plugin
-  ModelAPI_Session::get()->registerPlugin(this);
+  SessionPtr aSession = ModelAPI_Session::get();
+  aSession->registerPlugin(this);
+  ModelAPI_ValidatorsFactory* aFactory = aSession->validators();
+  aFactory->registerValidator("ExchangePlugin_ImportFormat",
+                              new ExchangePlugin_ImportFormatValidator);
 }
 
 FeaturePtr ExchangePlugin_Plugin::createFeature(string theFeatureID)