Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Scale.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef FEATURESAPI_SCALE_H_
22 #define FEATURESAPI_SCALE_H_
23
24 #include "FeaturesAPI.h"
25
26 #include <FeaturesPlugin_Scale.h>
27
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Dumper;
33 class ModelHighAPI_Selection;
34
35 /// \class FeaturesAPI_Scale
36 /// \ingroup CPPHighAPI
37 /// \brief Interface for Scale feature.
38 class FeaturesAPI_Scale: public ModelHighAPI_Interface
39 {
40 public:
41   /// Constructor without values.
42   FEATURESAPI_EXPORT
43   explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44
45   /// Constructor with values.
46   FEATURESAPI_EXPORT
47   explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48                              const std::list<ModelHighAPI_Selection>& theMainObjects,
49                              const ModelHighAPI_Selection& theCenterPoint,
50                              const ModelHighAPI_Double& theScaleFactor);
51
52   /// Constructor with values.
53   FEATURESAPI_EXPORT
54   explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55                              const std::list<ModelHighAPI_Selection>& theMainObjects,
56                              const ModelHighAPI_Selection& theCenterPoint,
57                              const ModelHighAPI_Double& theScaleFactorX,
58                              const ModelHighAPI_Double& theScaleFactorY,
59                              const ModelHighAPI_Double& theScaleFactorZ);
60
61   /// Destructor.
62   FEATURESAPI_EXPORT
63   virtual ~FeaturesAPI_Scale();
64
65   INTERFACE_7(FeaturesPlugin_Scale::ID(),
66               creationMethod, FeaturesPlugin_Scale::CREATION_METHOD(),
67               ModelAPI_AttributeString, /** Creation method */,
68               mainObjects, FeaturesPlugin_Scale::OBJECTS_LIST_ID(),
69               ModelAPI_AttributeSelectionList, /** Main objects */,
70               centerPoint, FeaturesPlugin_Scale::CENTER_POINT_ID(),
71               ModelAPI_AttributeSelection, /** Center point */,
72               scaleFactor, FeaturesPlugin_Scale::SCALE_FACTOR_ID(),
73               ModelAPI_AttributeDouble, /** Scale factor */,
74               scaleFactorX, FeaturesPlugin_Scale::SCALE_FACTOR_X_ID(),
75               ModelAPI_AttributeDouble, /** Scale factor in X */,
76               scaleFactorY, FeaturesPlugin_Scale::SCALE_FACTOR_Y_ID(),
77               ModelAPI_AttributeDouble, /** Scale factor in Y */,
78               scaleFactorZ, FeaturesPlugin_Scale::SCALE_FACTOR_Z_ID(),
79               ModelAPI_AttributeDouble, /** Scale factor in Z */)
80
81   /// Set main objects.
82   FEATURESAPI_EXPORT
83   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
84
85   /// Modify center_point attribute of the feature.
86   FEATURESAPI_EXPORT
87   void setCenterPoint(const ModelHighAPI_Selection& theCenterPoint);
88
89   /// Modify Creation Method and scale_factor attribute of the feature.
90   FEATURESAPI_EXPORT
91   void setScaleFactor(const ModelHighAPI_Double& theScaleFactor);
92
93   /// Modify Creation Method and scale_factor_x, scale_factor_y and scale_factor_z
94   /// attributes of the feature.
95   FEATURESAPI_EXPORT
96   void setDimensions(const ModelHighAPI_Double& theScaleFactorX,
97                      const ModelHighAPI_Double& theScaleFactorY,
98                      const ModelHighAPI_Double& theScaleFactorZ);
99
100   /// Dump wrapped feature
101   FEATURESAPI_EXPORT
102   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
103 };
104
105 /// Pointer on Scale object.
106 typedef std::shared_ptr<FeaturesAPI_Scale> ScalePtr;
107
108 /// \ingroup CPPHighAPI
109 /// \brief Create Scale feature.
110 FEATURESAPI_EXPORT
111 ScalePtr addScale(const std::shared_ptr<ModelAPI_Document>& thePart,
112                   const std::list<ModelHighAPI_Selection>& theMainObjects,
113                   const ModelHighAPI_Selection& theCenterPoint,
114                   const ModelHighAPI_Double& theScaleFactor);
115
116 /// \ingroup CPPHighAPI
117 /// \brief Create Scale feature.
118 FEATURESAPI_EXPORT
119 ScalePtr addScale(const std::shared_ptr<ModelAPI_Document>& thePart,
120                   const std::list<ModelHighAPI_Selection>& theMainObjects,
121                   const ModelHighAPI_Selection& theCenterPoint,
122                   const ModelHighAPI_Double& theScaleFactorX,
123                   const ModelHighAPI_Double& theScaleFactorY,
124                   const ModelHighAPI_Double& theScaleFactorZ);
125
126 #endif // FEATURESAPI_SCALE_H_