X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FExchangePlugin%2FExchangePlugin_Plugin.cpp;h=e731309c3896018630dde2abe962449582cdc9e5;hb=eef14b29d313b9dd16453d12f20aa02383ee139c;hp=b3256862a1c9e1c726bae79e19fec8e41d6477fc;hpb=d77708ba98445935aae7a0d93b5506e1f16018de;p=modules%2Fshaper.git diff --git a/src/ExchangePlugin/ExchangePlugin_Plugin.cpp b/src/ExchangePlugin/ExchangePlugin_Plugin.cpp index b3256862a..e731309c3 100644 --- a/src/ExchangePlugin/ExchangePlugin_Plugin.cpp +++ b/src/ExchangePlugin/ExchangePlugin_Plugin.cpp @@ -1,29 +1,45 @@ -/* - * - */ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +// File: ExchangePlugin_Plugin.cpp +// Created: Aug 28, 2014 +// Author: Sergey BELASH #include #include +#include +#include + +#include #include +#include -#include +#include 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); + aFactory->registerValidator("ExchangePlugin_ExportFormat", + new ExchangePlugin_ExportFormatValidator); } FeaturePtr ExchangePlugin_Plugin::createFeature(string theFeatureID) { if (theFeatureID == ExchangePlugin_ImportFeature::ID()) { return FeaturePtr(new ExchangePlugin_ImportFeature); + } else + if (theFeatureID == ExchangePlugin_ExportFeature::ID()) { + return FeaturePtr(new ExchangePlugin_ExportFeature); } // feature of such kind is not found return FeaturePtr();