Salome HOME
Dump Python in the High Level Parameterized Geometry API (issue #1648)
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Revolution.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_Revolution.h
4 // Created:     09 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesAPI_Revolution_H_
8 #define FeaturesAPI_Revolution_H_
9
10 #include "FeaturesAPI.h"
11
12 #include <FeaturesPlugin_Revolution.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Reference;
19 class ModelHighAPI_Selection;
20
21 /// \class FeaturesAPI_Revolution
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Revolution feature.
24 class FeaturesAPI_Revolution: public ModelHighAPI_Interface
25 {
26 public:
27   /// Constructor without values.
28   FEATURESAPI_EXPORT
29   explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30
31   /// Constructor with values.
32   FEATURESAPI_EXPORT
33   explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
34                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
35                                   const ModelHighAPI_Selection& theAxis,
36                                   const ModelHighAPI_Double& theAngle);
37
38   /// Constructor with values.
39   FEATURESAPI_EXPORT
40   explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
41                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
42                                   const ModelHighAPI_Selection& theAxis,
43                                   const ModelHighAPI_Double& theToAngle,
44                                   const ModelHighAPI_Double& theFromAngle);
45
46   /// Constructor with values.
47   FEATURESAPI_EXPORT
48   explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
49                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
50                                   const ModelHighAPI_Selection& theAxis,
51                                   const ModelHighAPI_Selection& theToObject,
52                                   const ModelHighAPI_Double& theToOffset,
53                                   const ModelHighAPI_Selection& theFromObject,
54                                   const ModelHighAPI_Double& theFromOffset);
55
56   /// Destructor.
57   FEATURESAPI_EXPORT
58   virtual ~FeaturesAPI_Revolution();
59
60   INTERFACE_10(FeaturesPlugin_Revolution::ID(),
61                sketch, FeaturesPlugin_Revolution::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
62                baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
63                axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis */,
64                creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
65                toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(), ModelAPI_AttributeDouble, /** To angle */,
66                fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(), ModelAPI_AttributeDouble, /** From angle */,
67                toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
68                toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
69                fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
70                fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */)
71
72   /// Modify base attribute of the feature.
73   FEATURESAPI_EXPORT
74   void setNestedSketch(const ModelHighAPI_Reference& theSketch);
75
76   /// Modify base attribute of the feature.
77   FEATURESAPI_EXPORT
78   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
79
80   /// Modify axis_object attribute of the feature.
81   FEATURESAPI_EXPORT
82   void setAxis(const ModelHighAPI_Selection& theAxis);
83
84   /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
85   FEATURESAPI_EXPORT
86   void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
87
88   /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
89   FEATURESAPI_EXPORT
90   void setAngle(const ModelHighAPI_Double& theAngle);
91
92   /// Modify CreationMethod, to_object, to_offset, from_object, from_offset attributes of the feature.
93   FEATURESAPI_EXPORT
94   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
95                            const ModelHighAPI_Double& theToOffset,
96                            const ModelHighAPI_Selection& theFromObject,
97                            const ModelHighAPI_Double& theFromOffset);
98
99   /// Dump wrapped feature
100   FEATURESAPI_EXPORT
101   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
102
103 private:
104   void execIfBaseNotEmpty();
105 };
106
107 /// Pointer on Revolution object.
108 typedef std::shared_ptr<FeaturesAPI_Revolution> RevolutionPtr;
109
110 /// \ingroup CPPHighAPI
111 /// \brief Create Revolution feature.
112 FEATURESAPI_EXPORT
113 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
114                             const std::list<ModelHighAPI_Selection>& theBaseObjects,
115                             const ModelHighAPI_Selection& theAxis,
116                             const ModelHighAPI_Double& theAngle);
117
118 /// \ingroup CPPHighAPI
119 /// \brief Create Revolution feature.
120 FEATURESAPI_EXPORT
121 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
122                             const std::list<ModelHighAPI_Selection>& theBaseObjects,
123                             const ModelHighAPI_Selection& theAxis,
124                             const ModelHighAPI_Double& theToAngle,
125                             const ModelHighAPI_Double& theFromAngle);
126
127 /// \ingroup CPPHighAPI
128 /// \brief Create Revolution feature.
129 FEATURESAPI_EXPORT
130 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
131                             const std::list<ModelHighAPI_Selection>& theBaseObjects,
132                             const ModelHighAPI_Selection& theAxis,
133                             const ModelHighAPI_Selection& theToObject,
134                             const ModelHighAPI_Double& theToOffset,
135                             const ModelHighAPI_Selection& theFromObject,
136                             const ModelHighAPI_Double& theFromOffset);
137
138 #endif // FeaturesAPI_Revolution_H_