Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Rotation.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_Rotation.h
4 // Created:     07 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesAPI_Rotation_H_
8 #define FeaturesAPI_Rotation_H_
9
10 #include "FeaturesAPI.h"
11
12 #include <FeaturesPlugin_Rotation.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_Rotation
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Rotation feature.
24 class FeaturesAPI_Rotation: public ModelHighAPI_Interface
25 {
26 public:
27   /// Constructor without values.
28   FEATURESAPI_EXPORT
29   explicit FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30
31   /// Constructor with values.
32   FEATURESAPI_EXPORT
33   FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
34                        const std::list<ModelHighAPI_Selection>& theMainObjects,
35                        const ModelHighAPI_Selection& theAxisObject,
36                        const ModelHighAPI_Double& theAngle);
37
38   /// Destructor.
39   FEATURESAPI_EXPORT
40   virtual ~FeaturesAPI_Rotation();
41
42   INTERFACE_3(FeaturesPlugin_Rotation::ID(),
43               mainObjects, FeaturesPlugin_Rotation::OBJECTS_LIST_ID(),
44               ModelAPI_AttributeSelectionList, /** Main objects */,
45               axisObject, FeaturesPlugin_Rotation::AXIS_OBJECT_ID(),
46               ModelAPI_AttributeSelection, /** Axis object */,
47               angle, FeaturesPlugin_Rotation::ANGLE_ID(),
48               ModelAPI_AttributeDouble, /** Angle */)
49
50   /// Set main objects.
51   FEATURESAPI_EXPORT
52   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
53
54   /// Set axis object.
55   FEATURESAPI_EXPORT
56   void setAxisObject(const ModelHighAPI_Selection& theAxisObject);
57
58   /// Set angle.
59   FEATURESAPI_EXPORT
60   void setAngle(const ModelHighAPI_Double& theAngle);
61
62   /// Dump wrapped feature
63   FEATURESAPI_EXPORT
64   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
65 };
66
67 /// Pointer on Rotation object.
68 typedef std::shared_ptr<FeaturesAPI_Rotation> RotationPtr;
69
70 /// \ingroup CPPHighAPI
71 /// \brief Create Rotation feature.
72 FEATURESAPI_EXPORT
73 RotationPtr addRotation(const std::shared_ptr<ModelAPI_Document>& thePart,
74                         const std::list<ModelHighAPI_Selection>& theMainObjects,
75                         const ModelHighAPI_Selection& theAxisObject,
76                         const ModelHighAPI_Double& theAngle);
77
78 #endif // FeaturesAPI_Rotation_H_