X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Scale.h;h=40ac886882b5e5970a51ea1c220004c597c1bfb2;hb=a930200bbf92c778fc684a3db477064f85f9cafe;hp=9c01fb67066e21274303407d2cdb88909b6cc832;hpb=9552f8739e93d153cde510b2cbaeddbfe68d3ee3;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Scale.h b/src/FeaturesPlugin/FeaturesPlugin_Scale.h index 9c01fb670..40ac88688 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Scale.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Scale.h @@ -1,8 +1,21 @@ -// Copyright (C) 2014-201x CEA/DEN, EDF R&D - -// File: FeaturesPlugin_Scale.h -// Created: 13 Jan 2017 -// Author: Clarisse Genrault (CEA) +// Copyright (C) 2014-2022 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_SCALE_H_ #define FEATURESPLUGIN_SCALE_H_ @@ -11,8 +24,6 @@ #include -#include - /** \class FeaturesPlugin_Scale * \ingroup Plugins * \brief Feature for changing the scale of an object. @@ -27,6 +38,27 @@ class FeaturesPlugin_Scale : public ModelAPI_Feature return MY_SCALE_ID; } + /// Attribute name for creation method. + inline static const std::string& CREATION_METHOD() + { + static const std::string MY_CREATION_METHOD_ID("CreationMethod"); + return MY_CREATION_METHOD_ID; + } + + /// Attribute name for creation method "ByFactor". + inline static const std::string& CREATION_METHOD_BY_FACTOR() + { + static const std::string MY_CREATION_METHOD_ID("ByFactor"); + return MY_CREATION_METHOD_ID; + } + + /// Attribute name for creation method "ByFactor". + inline static const std::string& CREATION_METHOD_BY_DIMENSIONS() + { + static const std::string MY_CREATION_METHOD_ID("ByDimensions"); + return MY_CREATION_METHOD_ID; + } + /// Attribute name of referenced objects. inline static const std::string& OBJECTS_LIST_ID() { @@ -48,6 +80,27 @@ class FeaturesPlugin_Scale : public ModelAPI_Feature return MY_SCALE_FACTOR_ID; } + /// Attribute name of scale factor in X. + inline static const std::string& SCALE_FACTOR_X_ID() + { + static const std::string MY_SCALE_FACTOR_X_ID("scale_factor_x"); + return MY_SCALE_FACTOR_X_ID; + } + + /// Attribute name of scale factor in Y. + inline static const std::string& SCALE_FACTOR_Y_ID() + { + static const std::string MY_SCALE_FACTOR_Y_ID("scale_factor_y"); + return MY_SCALE_FACTOR_Y_ID; + } + + /// Attribute name of scale factor in Z. + inline static const std::string& SCALE_FACTOR_Z_ID() + { + static const std::string MY_SCALE_FACTOR_Z_ID("scale_factor_z"); + return MY_SCALE_FACTOR_Z_ID; + } + /// \return the kind of a feature. FEATURESPLUGIN_EXPORT virtual const std::string& getKind() { @@ -55,7 +108,7 @@ class FeaturesPlugin_Scale : public ModelAPI_Feature return MY_KIND; } - /// Creates a new part document if needed. + /// Performs the algorithm and stores results it in the data structure. FEATURESPLUGIN_EXPORT virtual void execute(); /// Request for initialization of data model of the feature: adding all attributes. @@ -65,10 +118,11 @@ class FeaturesPlugin_Scale : public ModelAPI_Feature FeaturesPlugin_Scale(); private: - /// Perform the naming - void loadNamingDS(GeomAlgoAPI_Scale& theScaleAlgo, - std::shared_ptr theResultBody, - std::shared_ptr theBaseShape); + /// Perform scale using a central point and a value of the scale. + void performScaleByFactor(); + + /// Perform scale using a central point and three dimensions + void performScaleByDimensions(); }; #endif // FEATURESPLUGIN_SCALE_H_ \ No newline at end of file