X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_ExtrusionBoolean.h;h=ee575471bf4ff6f92d3260e208671fa9e9938a82;hb=95375993f1f35e4716475c0b0c8e265c082c875d;hp=f83ec91474e3acf91e6ca45902eb3c5de8a91d2c;hpb=28d64622a1b933c484fa4a8df26302e1358ba5d0;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h index f83ec9147..ee575471b 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h @@ -1,79 +1,49 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: FeaturesPlugin_ExtrusionBoolean.h -// Created: 11 June 2015 -// Author: Dmitry Bobylev +// 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 +// #ifndef FeaturesPlugin_ExtrusionBoolean_H_ #define FeaturesPlugin_ExtrusionBoolean_H_ -#include +#include "FeaturesPlugin_Extrusion.h" +#include "FeaturesPlugin_CompositeBoolean.h" -/** \class FeaturesPlugin_ExtrusionBoolean - * \ingroup Plugins - */ -class FeaturesPlugin_ExtrusionBoolean : public FeaturesPlugin_CompositeBoolean +/// \class FeaturesPlugin_ExtrusionBoolean +/// \ingroup Plugins +/// \brief Interface for the composite extrusion feature. +class FeaturesPlugin_ExtrusionBoolean: public FeaturesPlugin_Extrusion, + public FeaturesPlugin_CompositeBoolean { - public: - - /// attribute name for creation method - inline static const std::string& CREATION_METHOD() - { - static const std::string METHOD_ATTR("CreationMethod"); - return METHOD_ATTR; - } - - /// attribute name of extrusion size - inline static const std::string& TO_SIZE_ID() - { - static const std::string MY_TO_SIZE_ID("to_size"); - return MY_TO_SIZE_ID; - } - - /// attribute name of extrusion size - inline static const std::string& FROM_SIZE_ID() - { - static const std::string MY_FROM_SIZE_ID("from_size"); - return MY_FROM_SIZE_ID; - } - - /// attribute name of an object to which the extrusion grows. - inline static const std::string& TO_OBJECT_ID() - { - static const std::string MY_TO_OBJECT_ID("to_object"); - return MY_TO_OBJECT_ID; - } - - /// attribute name of extrusion offset - inline static const std::string& TO_OFFSET_ID() - { - static const std::string MY_TO_OFFSET_ID("to_offset"); - return MY_TO_OFFSET_ID; - } - - /// Attribute name of an object from which the extrusion grows. - inline static const std::string& FROM_OBJECT_ID() - { - static const std::string MY_FROM_OBJECT_ID("from_object"); - return MY_FROM_OBJECT_ID; - } - - /// attribute name of extrusion offset - inline static const std::string& FROM_OFFSET_ID() - { - static const std::string MY_FROM_OFFSET_ID("from_offset"); - return MY_FROM_OFFSET_ID; - } +public: + /// Request for initialization of data model of the feature: adding all attributes. + FEATURESPLUGIN_EXPORT virtual void initAttributes(); protected: - /// Init attributes for extrusion. - virtual void initMakeSolidsAttributes(); + FeaturesPlugin_ExtrusionBoolean(){}; - /// Create solids from faces with extrusion. - virtual ListOfShape MakeSolids(const ListOfShape& theFaces); + // Creates extrusions. + bool makeGeneration(ListOfShape& theBaseShapes, + ListOfMakeShape& theMakeShapes); -protected: - FeaturesPlugin_ExtrusionBoolean(){}; + /// Stores generation history. + void storeGenerationHistory(ResultBodyPtr theResultBody, + const GeomShapePtr theBaseShape, + const std::shared_ptr theMakeShape); }; #endif