Salome HOME
Issue #1648: Dump Python in the High Level Parameterized Geometry API
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_RevolutionBoolean.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_RevolutionBoolean.h
4 // Created:     09 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesAPI_RevolutionBoolean_H_
8 #define FeaturesAPI_RevolutionBoolean_H_
9
10 #include "FeaturesAPI.h"
11
12 #include <FeaturesPlugin_CompositeBoolean.h>
13 #include <FeaturesPlugin_RevolutionCut.h>
14 #include <FeaturesPlugin_RevolutionFuse.h>
15
16 #include <ModelHighAPI_Interface.h>
17 #include <ModelHighAPI_Macro.h>
18
19 class ModelHighAPI_Double;
20 class ModelHighAPI_Dumper;
21 class ModelHighAPI_Reference;
22 class ModelHighAPI_Selection;
23
24 /// \class FeaturesAPI_RevolutionBoolean
25 /// \ingroup CPPHighAPI
26 /// \brief Interface for RevolutionBoolean feature.
27 class FeaturesAPI_RevolutionBoolean: public ModelHighAPI_Interface
28 {
29 public:
30   /// Destructor.
31   FEATURESAPI_EXPORT
32   virtual ~FeaturesAPI_RevolutionBoolean();
33
34   INTERFACE_11("",
35                sketch, FeaturesPlugin_Revolution::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
36                baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
37                axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis */,
38                creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
39                toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(), ModelAPI_AttributeDouble, /** To angle */,
40                fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(), ModelAPI_AttributeDouble, /** From angle */,
41                toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
42                toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
43                fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
44                fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
45                booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Boolean objects */)
46
47   /// Modify base attribute of the feature.
48   FEATURESAPI_EXPORT
49   void setNestedSketch(const ModelHighAPI_Reference& theSketch);
50
51   /// Modify base attribute of the feature.
52   FEATURESAPI_EXPORT
53   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
54
55   /// Modify axis_object attribute of the feature.
56   FEATURESAPI_EXPORT
57   void setAxis(const ModelHighAPI_Selection& theAxis);
58
59   /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
60   FEATURESAPI_EXPORT
61   void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
62
63   /// Modify creation_method, to_angle, from_angle attributes of the feature.
64   FEATURESAPI_EXPORT
65   void setAngle(const ModelHighAPI_Double& theAngle);
66
67   /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
68   FEATURESAPI_EXPORT
69   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
70                            const ModelHighAPI_Double& theToOffset,
71                            const ModelHighAPI_Selection& theFromObject,
72                            const ModelHighAPI_Double& theFromOffset);
73
74   /// Modiyfy main_objects attribute of the feature.
75   FEATURESAPI_EXPORT
76   void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
77
78   /// Dump wrapped feature
79   FEATURESAPI_EXPORT
80   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
81
82 protected:
83   /// Constructor without values.
84   FEATURESAPI_EXPORT
85   explicit FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
86
87 private:
88   void execIfBaseNotEmpty();
89 };
90
91 class FeaturesAPI_RevolutionCut: public FeaturesAPI_RevolutionBoolean
92 {
93 public:
94
95   static std::string ID() { return FeaturesPlugin_RevolutionCut::ID(); }
96   virtual std::string getID() { return ID(); }
97
98   /// Constructor without values.
99   FEATURESAPI_EXPORT
100   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
101
102   /// Constructor with values.
103   FEATURESAPI_EXPORT
104   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
105                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
106                                      const ModelHighAPI_Selection& theAxis,
107                                      const ModelHighAPI_Double& theAngle,
108                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
109
110   /// Constructor with values.
111   FEATURESAPI_EXPORT
112   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
113                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
114                                      const ModelHighAPI_Selection& theAxis,
115                                      const ModelHighAPI_Double& theToAngle,
116                                      const ModelHighAPI_Double& theFromAngle,
117                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
118
119   /// Constructor with values.
120   FEATURESAPI_EXPORT
121   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
122                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
123                                      const ModelHighAPI_Selection& theAxis,
124                                      const ModelHighAPI_Selection& theToObject,
125                                      const ModelHighAPI_Double& theToOffset,
126                                      const ModelHighAPI_Selection& theFromObject,
127                                      const ModelHighAPI_Double& theFromOffset,
128                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
129 };
130
131 /// Pointer on RevolutionCut object.
132 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
133
134 /// \ingroup CPPHighAPI
135 /// \brief Create RevolutionCut feature.
136 FEATURESAPI_EXPORT
137 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
138                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
139                                   const ModelHighAPI_Selection& theAxis,
140                                   const ModelHighAPI_Double& theAngle,
141                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
142
143 /// \ingroup CPPHighAPI
144 /// \brief Create RevolutionCut feature.
145 FEATURESAPI_EXPORT
146 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
147                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
148                                   const ModelHighAPI_Selection& theAxis,
149                                   const ModelHighAPI_Double& theToAngle,
150                                   const ModelHighAPI_Double& theFromAngle,
151                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
152
153 /// \ingroup CPPHighAPI
154 /// \brief Create RevolutionCut feature.
155 FEATURESAPI_EXPORT
156 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
157                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
158                                   const ModelHighAPI_Selection& theAxis,
159                                   const ModelHighAPI_Selection& theToObject,
160                                   const ModelHighAPI_Double& theToOffset,
161                                   const ModelHighAPI_Selection& theFromObject,
162                                   const ModelHighAPI_Double& theFromOffset,
163                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
164
165 class FeaturesAPI_RevolutionFuse: public FeaturesAPI_RevolutionBoolean
166 {
167 public:
168
169   static std::string ID() { return FeaturesPlugin_RevolutionFuse::ID(); }
170   virtual std::string getID() { return ID(); }
171
172   /// Constructor without values.
173   FEATURESAPI_EXPORT
174   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
175
176   /// Constructor with values.
177   FEATURESAPI_EXPORT
178   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
179                                       const std::list<ModelHighAPI_Selection>& theBaseObjects,
180                                       const ModelHighAPI_Selection& theAxis,
181                                       const ModelHighAPI_Double& theAngle,
182                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects);
183
184   /// Constructor with values.
185   FEATURESAPI_EXPORT
186   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
187                                       const std::list<ModelHighAPI_Selection>& theBaseObjects,
188                                       const ModelHighAPI_Selection& theAxis,
189                                       const ModelHighAPI_Double& theToAngle,
190                                       const ModelHighAPI_Double& theFromAngle,
191                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects);
192
193   /// Constructor with values.
194   FEATURESAPI_EXPORT
195   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
196                                       const std::list<ModelHighAPI_Selection>& theBaseObjects,
197                                       const ModelHighAPI_Selection& theAxis,
198                                       const ModelHighAPI_Selection& theToObject,
199                                       const ModelHighAPI_Double& theToOffset,
200                                       const ModelHighAPI_Selection& theFromObject,
201                                       const ModelHighAPI_Double& theFromOffset,
202                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects);
203 };
204
205 /// Pointer on RevolutionFuse object.
206 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
207
208 /// \ingroup CPPHighAPI
209 /// \brief Create RevolutionFuse feature.
210 FEATURESAPI_EXPORT
211 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
212                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
213                                     const ModelHighAPI_Selection& theAxis,
214                                     const ModelHighAPI_Double& theAngle,
215                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
216
217 /// \ingroup CPPHighAPI
218 /// \brief Create RevolutionFuse feature.
219 FEATURESAPI_EXPORT
220 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
221                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
222                                     const ModelHighAPI_Selection& theAxis,
223                                     const ModelHighAPI_Double& theToAngle,
224                                     const ModelHighAPI_Double& theFromAngle,
225                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
226
227 /// \ingroup CPPHighAPI
228 /// \brief Create RevolutionFuse feature.
229 FEATURESAPI_EXPORT
230 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
231                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
232                                     const ModelHighAPI_Selection& theAxis,
233                                     const ModelHighAPI_Selection& theToObject,
234                                     const ModelHighAPI_Double& theToOffset,
235                                     const ModelHighAPI_Selection& theFromObject,
236                                     const ModelHighAPI_Double& theFromOffset,
237                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
238
239 #endif // FeaturesAPI_RevolutionBoolean_H_