Salome HOME
CPP API for FeaturesPlugin_Group
[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_Selection;
19
20 /// \class FeaturesAPI_Rotation
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for Rotation feature.
23 class FeaturesAPI_Rotation: public ModelHighAPI_Interface
24 {
25 public:
26   /// Constructor without values.
27   FEATURESAPI_EXPORT
28   explicit FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   FEATURESAPI_EXPORT
32   FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33                        const std::list<ModelHighAPI_Selection>& theMainObjects,
34                        const ModelHighAPI_Selection& theAxisObject,
35                        const ModelHighAPI_Double& theAngle);
36
37   /// Destructor.
38   FEATURESAPI_EXPORT
39   virtual ~FeaturesAPI_Rotation();
40
41   INTERFACE_3(FeaturesPlugin_Rotation::ID(),
42               mainObjects, FeaturesPlugin_Rotation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */,
43               axisObject, FeaturesPlugin_Rotation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis object */,
44               angle, FeaturesPlugin_Rotation::ANGLE_ID(), ModelAPI_AttributeDouble, /** Angle */)
45
46   /// Set main objects.
47   FEATURESAPI_EXPORT
48   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
49
50   /// Set axis object.
51   FEATURESAPI_EXPORT
52   void setAxisObject(const ModelHighAPI_Selection& theAxisObject);
53
54   /// Set angle.
55   FEATURESAPI_EXPORT
56   void setAngle(const ModelHighAPI_Double& theAngle);
57 };
58
59 /// Pointer on Rotation object.
60 typedef std::shared_ptr<FeaturesAPI_Rotation> RotationPtr;
61
62 /// \ingroup CPPHighAPI
63 /// \brief Create Rotation feature.
64 FEATURESAPI_EXPORT
65 RotationPtr addRotation(const std::shared_ptr<ModelAPI_Document>& thePart,
66                         const std::list<ModelHighAPI_Selection>& theMainObjects,
67                         const ModelHighAPI_Selection& theAxisObject,
68                         const ModelHighAPI_Double& theDistance);
69
70 #endif // FeaturesAPI_Rotation_H_