X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Plugin.cpp;h=4f5d35f36dc2ec2f95526741b5ad2acab4c56a7d;hb=97917d3698f5a2f7fc9596e7c755ff8f6751e373;hp=cd1ceb219dfc21f945721fab15a78315432c88c3;hpb=bf566e76aee5667a819b613e625c18fb61a576f4;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp index cd1ceb219..4f5d35f36 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp @@ -1,9 +1,53 @@ +// Copyright (C) 2014-2019 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 +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include @@ -11,28 +55,124 @@ #include -using namespace std; - // the only created instance of this plugin static FeaturesPlugin_Plugin* MY_FEATURES_INSTANCE = new FeaturesPlugin_Plugin(); FeaturesPlugin_Plugin::FeaturesPlugin_Plugin() { + SessionPtr aMgr = ModelAPI_Session::get(); + ModelAPI_ValidatorsFactory* aFactory = aMgr->validators(); + aFactory->registerValidator("FeaturesPlugin_ValidatorTransform", + new FeaturesPlugin_ValidatorTransform); + aFactory->registerValidator("FeaturesPlugin_ValidatorCompositeLauncher", + new FeaturesPlugin_ValidatorCompositeLauncher); + aFactory->registerValidator("FeaturesPlugin_ValidatorBaseForGeneration", + new FeaturesPlugin_ValidatorBaseForGeneration); + aFactory->registerValidator("FeaturesPlugin_ValidatorBaseForGenerationSketchOrSketchObjects", + new FeaturesPlugin_ValidatorBaseForGenerationSketchOrSketchObjects); + aFactory->registerValidator("FeaturesPlugin_ValidatorPipeLocations", + new FeaturesPlugin_ValidatorPipeLocations); + aFactory->registerValidator("FeaturesPlugin_ValidatorPipeLocationsNumber", + new FeaturesPlugin_ValidatorPipeLocationsNumber); + aFactory->registerValidator("FeaturesPlugin_ValidatorExtrusionDir", + new FeaturesPlugin_ValidatorExtrusionDir); + aFactory->registerValidator("FeaturesPlugin_ValidatorBooleanSelection", + new FeaturesPlugin_ValidatorBooleanSelection); + aFactory->registerValidator("FeaturesPlugin_ValidatorPartitionSelection", + new FeaturesPlugin_ValidatorPartitionSelection); + aFactory->registerValidator("FeaturesPlugin_ValidatorRemoveSubShapesSelection", + new FeaturesPlugin_ValidatorRemoveSubShapesSelection); + aFactory->registerValidator("FeaturesPlugin_ValidatorRemoveSubShapesResult", + new FeaturesPlugin_ValidatorRemoveSubShapesResult); + aFactory->registerValidator("FeaturesPlugin_ValidatorPipePath", + new FeaturesPlugin_ValidatorPipePath); + aFactory->registerValidator("FeaturesPlugin_ValidatorUnionSelection", + new FeaturesPlugin_ValidatorUnionSelection); + aFactory->registerValidator("FeaturesPlugin_ValidatorUnionArguments", + new FeaturesPlugin_ValidatorUnionArguments); + aFactory->registerValidator("FeaturesPlugin_ValidatorConcealedResult", + new FeaturesPlugin_ValidatorConcealedResult); + aFactory->registerValidator("FeaturesPlugin_ValidatorFilletSelection", + new FeaturesPlugin_ValidatorFilletSelection); + aFactory->registerValidator("FeaturesPlugin_ValidatorCircular", + new FeaturesPlugin_ValidatorCircular); + aFactory->registerValidator("FeaturesPlugin_ValidatorBooleanArguments", + new FeaturesPlugin_ValidatorBooleanArguments); + aFactory->registerValidator("FeaturesPlugin_ValidatorBooleanSmashSelection", + new FeaturesPlugin_ValidatorBooleanSmashSelection); + aFactory->registerValidator("FeaturesPlugin_IntersectionSelection", + new FeaturesPlugin_IntersectionSelection); + aFactory->registerValidator("FeaturesPlugin_ValidatorBooleanFuseSelection", + new FeaturesPlugin_ValidatorBooleanFuseSelection); + aFactory->registerValidator("FeaturesPlugin_ValidatorBooleanFuseArguments", + new FeaturesPlugin_ValidatorBooleanFuseArguments); + aFactory->registerValidator("FeaturesPlugin_ValidatorBooleanCommonSelection", + new FeaturesPlugin_ValidatorBooleanCommonSelection); + aFactory->registerValidator("FeaturesPlugin_ValidatorBooleanCommonArguments", + new FeaturesPlugin_ValidatorBooleanCommonArguments); + // register this plugin ModelAPI_Session::get()->registerPlugin(this); } -FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID) +FeaturePtr FeaturesPlugin_Plugin::createFeature(std::string theFeatureID) { if (theFeatureID == FeaturesPlugin_Extrusion::ID()) { return FeaturePtr(new FeaturesPlugin_Extrusion); - } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) { - return FeaturePtr(new FeaturesPlugin_Boolean); - } else if (theFeatureID == FeaturesPlugin_Group::ID()) { - return FeaturePtr(new FeaturesPlugin_Group); + } else if (theFeatureID == FeaturesPlugin_Revolution::ID()) { + return FeaturePtr(new FeaturesPlugin_Revolution); + } else if (theFeatureID == FeaturesPlugin_Rotation::ID()) { + return FeaturePtr(new FeaturesPlugin_Rotation); + } else if (theFeatureID == FeaturesPlugin_Translation::ID()) { + return FeaturePtr(new FeaturesPlugin_Translation); + } else if (theFeatureID == FeaturesPlugin_BooleanCut::ID()) { + return FeaturePtr(new FeaturesPlugin_BooleanCut); + } else if (theFeatureID == FeaturesPlugin_BooleanFuse::ID()) { + return FeaturePtr(new FeaturesPlugin_BooleanFuse); + } else if (theFeatureID == FeaturesPlugin_BooleanCommon::ID()) { + return FeaturePtr(new FeaturesPlugin_BooleanCommon); + } else if (theFeatureID == FeaturesPlugin_BooleanSmash::ID()) { + return FeaturePtr(new FeaturesPlugin_BooleanSmash); + } else if (theFeatureID == FeaturesPlugin_BooleanFill::ID()) { + return FeaturePtr(new FeaturesPlugin_BooleanFill); + } else if (theFeatureID == FeaturesPlugin_Intersection::ID()) { + return FeaturePtr(new FeaturesPlugin_Intersection); + } else if (theFeatureID == FeaturesPlugin_Partition::ID()) { + return FeaturePtr(new FeaturesPlugin_Partition); + } else if (theFeatureID == FeaturesPlugin_Pipe::ID()) { + return FeaturePtr(new FeaturesPlugin_Pipe); } else if (theFeatureID == FeaturesPlugin_Placement::ID()) { return FeaturePtr(new FeaturesPlugin_Placement); + } else if (theFeatureID == FeaturesPlugin_Recover::ID()) { + return FeaturePtr(new FeaturesPlugin_Recover); + } else if (theFeatureID == FeaturesPlugin_ExtrusionCut::ID()) { + return FeaturePtr(new FeaturesPlugin_ExtrusionCut); + } else if (theFeatureID == FeaturesPlugin_ExtrusionFuse::ID()) { + return FeaturePtr(new FeaturesPlugin_ExtrusionFuse); + } else if (theFeatureID == FeaturesPlugin_RevolutionCut::ID()) { + return FeaturePtr(new FeaturesPlugin_RevolutionCut); + } else if (theFeatureID == FeaturesPlugin_RevolutionFuse::ID()) { + return FeaturePtr(new FeaturesPlugin_RevolutionFuse); + } else if (theFeatureID == FeaturesPlugin_RemoveSubShapes::ID()) { + return FeaturePtr(new FeaturesPlugin_RemoveSubShapes); + } else if (theFeatureID == FeaturesPlugin_Union::ID()) { + return FeaturePtr(new FeaturesPlugin_Union); + } else if (theFeatureID == FeaturesPlugin_FusionFaces::ID()) { + return FeaturePtr(new FeaturesPlugin_FusionFaces); + } else if (theFeatureID == FeaturesPlugin_Symmetry::ID()) { + return FeaturePtr(new FeaturesPlugin_Symmetry); + } else if (theFeatureID == FeaturesPlugin_Scale::ID()) { + return FeaturePtr(new FeaturesPlugin_Scale); + } else if (theFeatureID == FeaturesPlugin_MultiTranslation::ID()) { + return FeaturePtr(new FeaturesPlugin_MultiTranslation); + } else if (theFeatureID == FeaturesPlugin_MultiRotation::ID()) { + return FeaturePtr(new FeaturesPlugin_MultiRotation); + } else if (theFeatureID == FeaturesPlugin_Fillet::ID()) { + return FeaturePtr(new FeaturesPlugin_Fillet); + } else if (theFeatureID == FeaturesPlugin_Measurement::ID()) { + return FeaturePtr(new FeaturesPlugin_Measurement); } + // feature of such kind is not found return FeaturePtr(); }