1 // Copyright (C) 2014-2021 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef FEATURESAPI_SCALE_H_
21 #define FEATURESAPI_SCALE_H_
23 #include "FeaturesAPI.h"
25 #include <FeaturesPlugin_Scale.h>
27 #include <ModelHighAPI_Double.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Dumper;
32 class ModelHighAPI_Selection;
34 /// \class FeaturesAPI_Scale
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Scale feature.
37 class FeaturesAPI_Scale: public ModelHighAPI_Interface
40 /// Constructor without values.
42 explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44 /// Constructor with values.
46 explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47 const std::list<ModelHighAPI_Selection>& theMainObjects,
48 const ModelHighAPI_Selection& theCenterPoint,
49 const ModelHighAPI_Double& theScaleFactor);
51 /// Constructor with values.
53 explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54 const std::list<ModelHighAPI_Selection>& theMainObjects,
55 const ModelHighAPI_Selection& theCenterPoint,
56 const ModelHighAPI_Double& theScaleFactorX,
57 const ModelHighAPI_Double& theScaleFactorY,
58 const ModelHighAPI_Double& theScaleFactorZ);
62 virtual ~FeaturesAPI_Scale();
64 INTERFACE_7(FeaturesPlugin_Scale::ID(),
65 creationMethod, FeaturesPlugin_Scale::CREATION_METHOD(),
66 ModelAPI_AttributeString, /** Creation method */,
67 mainObjects, FeaturesPlugin_Scale::OBJECTS_LIST_ID(),
68 ModelAPI_AttributeSelectionList, /** Main objects */,
69 centerPoint, FeaturesPlugin_Scale::CENTER_POINT_ID(),
70 ModelAPI_AttributeSelection, /** Center point */,
71 scaleFactor, FeaturesPlugin_Scale::SCALE_FACTOR_ID(),
72 ModelAPI_AttributeDouble, /** Scale factor */,
73 scaleFactorX, FeaturesPlugin_Scale::SCALE_FACTOR_X_ID(),
74 ModelAPI_AttributeDouble, /** Scale factor in X */,
75 scaleFactorY, FeaturesPlugin_Scale::SCALE_FACTOR_Y_ID(),
76 ModelAPI_AttributeDouble, /** Scale factor in Y */,
77 scaleFactorZ, FeaturesPlugin_Scale::SCALE_FACTOR_Z_ID(),
78 ModelAPI_AttributeDouble, /** Scale factor in Z */)
82 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
84 /// Modify center_point attribute of the feature.
86 void setCenterPoint(const ModelHighAPI_Selection& theCenterPoint);
88 /// Modify Creation Method and scale_factor attribute of the feature.
90 void setScaleFactor(const ModelHighAPI_Double& theScaleFactor);
92 /// Modify Creation Method and scale_factor_x, scale_factor_y and scale_factor_z
93 /// attributes of the feature.
95 void setDimensions(const ModelHighAPI_Double& theScaleFactorX,
96 const ModelHighAPI_Double& theScaleFactorY,
97 const ModelHighAPI_Double& theScaleFactorZ);
99 /// Dump wrapped feature
101 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
104 /// Pointer on Scale object.
105 typedef std::shared_ptr<FeaturesAPI_Scale> ScalePtr;
107 /// \ingroup CPPHighAPI
108 /// \brief Create Scale feature.
110 ScalePtr addScale(const std::shared_ptr<ModelAPI_Document>& thePart,
111 const std::list<ModelHighAPI_Selection>& theMainObjects,
112 const ModelHighAPI_Selection& theCenterPoint,
113 const ModelHighAPI_Double& theScaleFactorX,
114 const ModelHighAPI_Double& theScaleFactorY = ModelHighAPI_Double(0.0),
115 const ModelHighAPI_Double& theScaleFactorZ = ModelHighAPI_Double(0.0),
116 const bool keepSubResults = false);
118 #endif // FEATURESAPI_SCALE_H_