X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FExchangePlugin%2FExchangePlugin_Plugin.cpp;h=235ddd17fc9243ea24328b249d45e69ab568c535;hb=8f43b985d2f7170b8dfa06abd3edc7d6cb0c2e1f;hp=e2b1ee20f7f69c890a3d86d1e05f007ae3fa6f6a;hpb=31e91a8d11e03ddce87e8c2aa04695961a266a97;p=modules%2Fshaper.git diff --git a/src/ExchangePlugin/ExchangePlugin_Plugin.cpp b/src/ExchangePlugin/ExchangePlugin_Plugin.cpp index e2b1ee20f..235ddd17f 100644 --- a/src/ExchangePlugin/ExchangePlugin_Plugin.cpp +++ b/src/ExchangePlugin/ExchangePlugin_Plugin.cpp @@ -1,11 +1,29 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -/* - * - */ +// Copyright (C) 2014-2020 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 @@ -15,8 +33,6 @@ #include -using namespace std; - // the only created instance of this plugin static ExchangePlugin_Plugin* MY_EXCHANGE_INSTANCE = new ExchangePlugin_Plugin(); @@ -28,20 +44,31 @@ ExchangePlugin_Plugin::ExchangePlugin_Plugin() ModelAPI_ValidatorsFactory* aFactory = aSession->validators(); aFactory->registerValidator("ExchangePlugin_ImportFormat", new ExchangePlugin_ImportFormatValidator); - - // register construction properties - Config_PropManager::registerProp("Visualization", "import_feature_color", "Imported feature color", - Config_Prop::Color, IMPORTED_FEATURE_COLOR); - - // register random result color properties - Config_PropManager::registerProp("Visualization", "random_result_color", "Use random color for results", - Config_Prop::Bool, "true"); + aFactory->registerValidator("ExchangePlugin_ExportFormat", + new ExchangePlugin_ExportFormatValidator); + aFactory->registerValidator("ExchangePlugin_InHistory", + new ExchangePlugin_InHistoryValidator); } -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_ImportPart::ID()) { + return FeaturePtr(new ExchangePlugin_ImportPart); + } else + if (theFeatureID == ExchangePlugin_ExportPart::ID()) { + return FeaturePtr(new ExchangePlugin_ExportPart); + } else + if (theFeatureID == ExchangePlugin_Dump::ID()) { + return FeaturePtr(new ExchangePlugin_Dump); + } else + if (theFeatureID == ExchangePlugin_Import::ID()) { + return FeaturePtr(new ExchangePlugin_Import); } // feature of such kind is not found return FeaturePtr();