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);
40 virtual ~FeaturesAPI_Scale();
42 INTERFACE_3(FeaturesPlugin_Scale::ID(),
43 mainObjects, FeaturesPlugin_Scale::OBJECTS_LIST_ID(),
44 ModelAPI_AttributeSelectionList, /** Main objects */,
45 centerPoint, FeaturesPlugin_Scale::CENTER_POINT_ID(),
46 ModelAPI_AttributeSelection, /** Center point */,
47 scaleFactor, FeaturesPlugin_Scale::SCALE_FACTOR_ID(),
48 ModelAPI_AttributeDouble, /** Scale factor */)
52 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
54 /// Modify center_point attribute of the feature.
56 void setCenterPoint(const ModelHighAPI_Selection& theCenterPoint);
58 /// Modify Creation Method and scale_factor attribute of the feature.
60 void setScaleFactor(const ModelHighAPI_Double& theScaleFactor);
62 /// Dump wrapped feature
64 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
67 /// Pointer on Scale object.
68 typedef std::shared_ptr<FeaturesAPI_Scale> ScalePtr;
70 /// \ingroup CPPHighAPI
71 /// \brief Create Scale feature.
73 ScalePtr addScale(const std::shared_ptr<ModelAPI_Document>& thePart,
74 const std::list<ModelHighAPI_Selection>& theMainObjects,
75 const ModelHighAPI_Selection& theCenterPoint,
76 const ModelHighAPI_Double& theScaleFactor);
78 #endif // FEATURESAPI_SCALE_H_