X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FExchangePlugin%2FExchangePlugin_Plugin.cpp;h=53f17692eeeb868c405ef8a4a9d6ba1e9931654b;hb=fec33ea37fbbd369bda3da328abf6171d08a6c42;hp=b3256862a1c9e1c726bae79e19fec8e41d6477fc;hpb=489132d99e1d417d5c7ce93fed8fb8ee138befbc;p=modules%2Fshaper.git diff --git a/src/ExchangePlugin/ExchangePlugin_Plugin.cpp b/src/ExchangePlugin/ExchangePlugin_Plugin.cpp index b3256862a..53f17692e 100644 --- a/src/ExchangePlugin/ExchangePlugin_Plugin.cpp +++ b/src/ExchangePlugin/ExchangePlugin_Plugin.cpp @@ -1,29 +1,61 @@ -/* - * - */ +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #include +#include #include +#include +#include -#include +#include -#include +#include +#include -using namespace std; +#include // 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) +FeaturePtr ExchangePlugin_Plugin::createFeature(std::string theFeatureID) { if (theFeatureID == ExchangePlugin_ImportFeature::ID()) { return FeaturePtr(new ExchangePlugin_ImportFeature); + } else + if (theFeatureID == ExchangePlugin_ExportFeature::ID()) { + return FeaturePtr(new ExchangePlugin_ExportFeature); + } else + if (theFeatureID == ExchangePlugin_Dump::ID()) { + return FeaturePtr(new ExchangePlugin_Dump); } // feature of such kind is not found return FeaturePtr();