]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesAPI/FeaturesAPI_Scale.h
Salome HOME
Adding Scale feature.
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Scale.h
1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_Scale.h
4 // Created:     24 Jan 2017
5 // Author:      Clarisse Genrault (CEA)
6
7 #ifndef FEATURESAPI_SCALE_H_
8 #define FEATURESAPI_SCALE_H_
9
10 #include "FeaturesAPI.h"
11
12 #include <FeaturesPlugin_Scale.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Dumper;
19 class ModelHighAPI_Selection;
20
21 /// \class FeaturesAPI_Scale
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Scale feature.
24 class FeaturesAPI_Scale: public ModelHighAPI_Interface
25 {
26 public:
27   /// Constructor without values.
28   FEATURESAPI_EXPORT
29   explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30
31   /// Constructor with values.
32   FEATURESAPI_EXPORT
33   explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature,
34                              const std::list<ModelHighAPI_Selection>& theMainObjects,
35                              const ModelHighAPI_Selection& theCenterPoint,
36                              const ModelHighAPI_Double& theScaleFactor);
37
38   /// Constructor with values.
39   FEATURESAPI_EXPORT
40   explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature,
41                              const std::list<ModelHighAPI_Selection>& theMainObjects,
42                              const ModelHighAPI_Selection& theCenterPoint,
43                              const ModelHighAPI_Double& theScaleFactorX,
44                              const ModelHighAPI_Double& theScaleFactorY,
45                              const ModelHighAPI_Double& theScaleFactorZ);
46
47   /// Destructor.
48   FEATURESAPI_EXPORT
49   virtual ~FeaturesAPI_Scale();
50
51   INTERFACE_7(FeaturesPlugin_Scale::ID(),
52               creationMethod, FeaturesPlugin_Scale::CREATION_METHOD(),
53               ModelAPI_AttributeString, /** Creation method */,
54               mainObjects, FeaturesPlugin_Scale::OBJECTS_LIST_ID(),
55               ModelAPI_AttributeSelectionList, /** Main objects */,
56               centerPoint, FeaturesPlugin_Scale::CENTER_POINT_ID(),
57               ModelAPI_AttributeSelection, /** Center point */,
58               scaleFactor, FeaturesPlugin_Scale::SCALE_FACTOR_ID(),
59               ModelAPI_AttributeDouble, /** Scale factor */,
60               scaleFactorX, FeaturesPlugin_Scale::SCALE_FACTOR_X_ID(),
61               ModelAPI_AttributeDouble, /** Scale factor in X */,
62               scaleFactorY, FeaturesPlugin_Scale::SCALE_FACTOR_Y_ID(),
63               ModelAPI_AttributeDouble, /** Scale factor in Y */,
64               scaleFactorZ, FeaturesPlugin_Scale::SCALE_FACTOR_Z_ID(),
65               ModelAPI_AttributeDouble, /** Scale factor in Z */)
66
67   /// Set main objects.
68   FEATURESAPI_EXPORT
69   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
70
71   /// Modify center_point attribute of the feature.
72   FEATURESAPI_EXPORT
73   void setCenterPoint(const ModelHighAPI_Selection& theCenterPoint);
74
75   /// Modify Creation Method and scale_factor attribute of the feature.
76   FEATURESAPI_EXPORT
77   void setScaleFactor(const ModelHighAPI_Double& theScaleFactor);
78
79   /// Modify Creation Method and scale_factor_x, scale_factor_y and scale_factor_z
80   /// attributes of the feature.
81   FEATURESAPI_EXPORT
82   void setDimensions(const ModelHighAPI_Double& theScaleFactorX,
83                      const ModelHighAPI_Double& theScaleFactorY,
84                      const ModelHighAPI_Double& theScaleFactorZ);
85
86   /// Dump wrapped feature
87   FEATURESAPI_EXPORT
88   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
89 };
90
91 /// Pointer on Scale object.
92 typedef std::shared_ptr<FeaturesAPI_Scale> ScalePtr;
93
94 /// \ingroup CPPHighAPI
95 /// \brief Create Scale feature.
96 FEATURESAPI_EXPORT
97 ScalePtr addScale(const std::shared_ptr<ModelAPI_Document>& thePart,
98                   const std::list<ModelHighAPI_Selection>& theMainObjects,
99                   const ModelHighAPI_Selection& theCenterPoint,
100                   const ModelHighAPI_Double& theScaleFactor);
101
102 /// \ingroup CPPHighAPI
103 /// \brief Create Scale feature.
104 FEATURESAPI_EXPORT
105 ScalePtr addScale(const std::shared_ptr<ModelAPI_Document>& thePart,
106                   const std::list<ModelHighAPI_Selection>& theMainObjects,
107                   const ModelHighAPI_Selection& theCenterPoint,
108                   const ModelHighAPI_Double& theScaleFactorX,
109                   const ModelHighAPI_Double& theScaleFactorY,
110                   const ModelHighAPI_Double& theScaleFactorZ);
111
112 #endif // FEATURESAPI_SCALE_H_