X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_RevolutionBoolean.h;h=72463a955974ae85f25fc50b06e2b48c195ec105;hb=4289f04d4dcda1de53b4d33f63bc13e24a0fb650;hp=ce01edd8078b0a25f2c27c7e48b989c924cd67e2;hpb=606daaeec8fffdf1592853893aa6f8fc9919e451;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h index ce01edd80..72463a955 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h @@ -1,87 +1,49 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: FeaturesPlugin_RevolutionBoolean.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_RevolutionBoolean_H_ #define FeaturesPlugin_RevolutionBoolean_H_ -#include +#include "FeaturesPlugin_Revolution.h" +#include "FeaturesPlugin_CompositeBoolean.h" -/** \class FeaturesPlugin_RevolutionBoolean - * \ingroup Plugins - */ -class FeaturesPlugin_RevolutionBoolean : public FeaturesPlugin_CompositeBoolean +/// \class FeaturesPlugin_RevolutionBoolean +/// \ingroup Plugins +/// \brief Interface for the composite revolution feature. +class FeaturesPlugin_RevolutionBoolean : public FeaturesPlugin_Revolution, + public FeaturesPlugin_CompositeBoolean { public: - /// Attribute name of an revolution axis. - inline static const std::string& AXIS_OBJECT_ID() - { - static const std::string MY_AXIS_ID("axis_object"); - return MY_AXIS_ID; - } - - /// 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 revolution to angle. - inline static const std::string& TO_ANGLE_ID() - { - static const std::string MY_TO_ANGLE_ID("to_angle"); - return MY_TO_ANGLE_ID; - } - - /// Attribute name of revolution from angle. - inline static const std::string& FROM_ANGLE_ID() - { - static const std::string MY_FROM_ANGLE_ID("from_angle"); - return MY_FROM_ANGLE_ID; - } - - /// Attribute name of an object to which the revolution 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 revolution 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; - } + /// Request for initialization of data model of the feature: adding all attributes. + FEATURESPLUGIN_EXPORT virtual void initAttributes(); protected: - /// Init attributes for revolution. - virtual void initMakeSolidsAttributes(); + FeaturesPlugin_RevolutionBoolean(){}; - /// Create solids from faces with revolution. - virtual void makeSolids(const ListOfShape& theFaces, - ListOfShape& theResults, - std::list>& theAlgos); + // Creates revolutions. + bool makeGeneration(ListOfShape& theBaseShapes, + ListOfMakeShape& theMakeShapes); -protected: - FeaturesPlugin_RevolutionBoolean(){}; + /// Stores generation history. + void storeGenerationHistory(ResultBodyPtr theResultBody, + const GeomShapePtr theBaseShape, + const std::shared_ptr theMakeShape); }; #endif