1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_Scale.h
4 // Created: 24 Jan 2017
5 // Author: Clarisse Genrault (CEA)
7 #ifndef FEATURESAPI_SCALE_H_
8 #define FEATURESAPI_SCALE_H_
10 #include "FeaturesAPI.h"
12 #include <FeaturesPlugin_Scale.h>
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Dumper;
19 class ModelHighAPI_Selection;
21 /// \class FeaturesAPI_Scale
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Scale feature.
24 class FeaturesAPI_Scale: public ModelHighAPI_Interface
27 /// Constructor without values.
29 explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature);
31 /// Constructor with values.
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);
38 /// Constructor with values.
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);
49 virtual ~FeaturesAPI_Scale();
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 */)
69 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
71 /// Modify center_point attribute of the feature.
73 void setCenterPoint(const ModelHighAPI_Selection& theCenterPoint);
75 /// Modify Creation Method and scale_factor attribute of the feature.
77 void setScaleFactor(const ModelHighAPI_Double& theScaleFactor);
79 /// Modify Creation Method and scale_factor_x, scale_factor_y and scale_factor_z
80 /// attributes of the feature.
82 void setDimensions(const ModelHighAPI_Double& theScaleFactorX,
83 const ModelHighAPI_Double& theScaleFactorY,
84 const ModelHighAPI_Double& theScaleFactorZ);
86 /// Dump wrapped feature
88 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
91 /// Pointer on Scale object.
92 typedef std::shared_ptr<FeaturesAPI_Scale> ScalePtr;
94 /// \ingroup CPPHighAPI
95 /// \brief Create Scale feature.
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);
102 /// \ingroup CPPHighAPI
103 /// \brief Create Scale feature.
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);
112 #endif // FEATURESAPI_SCALE_H_