Salome HOME
Added CPP High API for FeaturesPlugin_ExtrusionCut, FeaturesPlugin_ExtrusionFuse
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_ExtrusionBoolean.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_ExtrusionBoolean.h
4 // Created:     09 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesAPI_ExtrusionBoolean_H_
8 #define FeaturesAPI_ExtrusionBoolean_H_
9
10 #include "FeaturesAPI.h"
11
12 #include <FeaturesPlugin_CompositeBoolean.h>
13 #include <FeaturesPlugin_ExtrusionCut.h>
14 #include <FeaturesPlugin_ExtrusionFuse.h>
15
16 #include <ModelHighAPI_Interface.h>
17 #include <ModelHighAPI_Macro.h>
18
19 class ModelHighAPI_Double;
20 class ModelHighAPI_Selection;
21
22 /// \class FeaturesAPI_ExtrusionBoolean
23 /// \ingroup CPPHighAPI
24 /// \brief Interface for ExtrusionBoolean feature.
25 class FeaturesAPI_ExtrusionBoolean: public ModelHighAPI_Interface
26 {
27 public:
28   /// Destructor.
29   FEATURESAPI_EXPORT
30   virtual ~FeaturesAPI_ExtrusionBoolean();
31
32   INTERFACE_11("",
33                sketchLauncher, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
34                baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
35                direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */,
36                creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
37                toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble, /** To size */,
38                fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble, /** From size */,
39                toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
40                toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
41                fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
42                fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
43                booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Boolean objects */)
44
45   /// Modify base attribute of the feature.
46   FEATURESAPI_EXPORT
47   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
48
49   /// Modify direction_object attribute of the feature.
50   FEATURESAPI_EXPORT
51   void setDirection(const ModelHighAPI_Selection& theDirection);
52
53   /// Modify CreationMethod, to_size, from_size attributes of the feature.
54   FEATURESAPI_EXPORT
55   void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize);
56
57   /// Modify creation_method, to_size, from_size attributes of the feature.
58   FEATURESAPI_EXPORT
59   void setSize(const ModelHighAPI_Double& theSize);
60
61   /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
62   FEATURESAPI_EXPORT
63   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
64                            const ModelHighAPI_Double& theToOffset,
65                            const ModelHighAPI_Selection& theFromObject,
66                            const ModelHighAPI_Double& theFromOffset);
67
68   /// Modiyfy main_objects attribute of the feature.
69   FEATURESAPI_EXPORT
70   void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
71
72 protected:
73   /// Constructor without values.
74   FEATURESAPI_EXPORT
75   explicit FeaturesAPI_ExtrusionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
76 };
77
78 class FeaturesAPI_ExtrusionCut: public FeaturesAPI_ExtrusionBoolean
79 {
80 public:
81   FEATURESAPI_EXPORT
82   virtual std::string getID() {
83     return FeaturesPlugin_ExtrusionCut::ID();
84   }
85
86   /// Constructor without values.
87   FEATURESAPI_EXPORT
88   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
89
90   /// Constructor with values.
91   FEATURESAPI_EXPORT
92   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
93                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
94                                     const ModelHighAPI_Double& theSize,
95                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
96
97   /// Constructor with values.
98   FEATURESAPI_EXPORT
99   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
100                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
101                                     const ModelHighAPI_Selection& theDirection,
102                                     const ModelHighAPI_Double& theSize,
103                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
104
105   /// Constructor with values.
106   FEATURESAPI_EXPORT
107   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
108                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
109                                     const ModelHighAPI_Double& theToSize,
110                                     const ModelHighAPI_Double& theFromSize,
111                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
112
113   /// Constructor with values.
114   FEATURESAPI_EXPORT
115   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
116                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
117                                     const ModelHighAPI_Selection& theDirection,
118                                     const ModelHighAPI_Double& theToSize,
119                                     const ModelHighAPI_Double& theFromSize,
120                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
121
122   /// Constructor with values.
123   FEATURESAPI_EXPORT
124   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
125                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
126                                     const ModelHighAPI_Selection& theToObject,
127                                     const ModelHighAPI_Double& theToOffset,
128                                     const ModelHighAPI_Selection& theFromObject,
129                                     const ModelHighAPI_Double& theFromOffset,
130                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
131
132   /// Constructor with values.
133   FEATURESAPI_EXPORT
134   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
135                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
136                                     const ModelHighAPI_Selection& theDirection,
137                                     const ModelHighAPI_Selection& theToObject,
138                                     const ModelHighAPI_Double& theToOffset,
139                                     const ModelHighAPI_Selection& theFromObject,
140                                     const ModelHighAPI_Double& theFromOffset,
141                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
142 };
143
144 /// Pointer on ExtrusionCut object.
145 typedef std::shared_ptr<FeaturesAPI_ExtrusionCut> ExtrusionCutPtr;
146
147 /// \ingroup CPPHighAPI
148 /// \brief Create ExtrusionCut feature.
149 FEATURESAPI_EXPORT
150 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
151                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
152                                 const ModelHighAPI_Double& theSize,
153                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
154
155 /// \ingroup CPPHighAPI
156 /// \brief Create ExtrusionCut feature.
157 FEATURESAPI_EXPORT
158 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
159                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
160                                 const ModelHighAPI_Selection& theDirection,
161                                 const ModelHighAPI_Double& theSize,
162                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
163
164 /// \ingroup CPPHighAPI
165 /// \brief Create ExtrusionCut feature.
166 FEATURESAPI_EXPORT
167 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
168                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
169                                 const ModelHighAPI_Double& theToSize,
170                                 const ModelHighAPI_Double& theFromSize,
171                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
172
173 /// \ingroup CPPHighAPI
174 /// \brief Create ExtrusionCut feature.
175 FEATURESAPI_EXPORT
176 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
177                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
178                                 const ModelHighAPI_Selection& theDirection,
179                                 const ModelHighAPI_Double& theToSize,
180                                 const ModelHighAPI_Double& theFromSize,
181                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
182
183 /// \ingroup CPPHighAPI
184 /// \brief Create ExtrusionCut feature.
185 FEATURESAPI_EXPORT
186 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
187                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
188                                 const ModelHighAPI_Selection& theToObject,
189                                 const ModelHighAPI_Double& theToOffset,
190                                 const ModelHighAPI_Selection& theFromObject,
191                                 const ModelHighAPI_Double& theFromOffset,
192                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
193
194 /// \ingroup CPPHighAPI
195 /// \brief Create ExtrusionCut feature.
196 FEATURESAPI_EXPORT
197 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
198                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
199                                 const ModelHighAPI_Selection& theDirection,
200                                 const ModelHighAPI_Selection& theToObject,
201                                 const ModelHighAPI_Double& theToOffset,
202                                 const ModelHighAPI_Selection& theFromObject,
203                                 const ModelHighAPI_Double& theFromOffset,
204                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
205
206 class FeaturesAPI_ExtrusionFuse: public FeaturesAPI_ExtrusionBoolean
207 {
208 public:
209   FEATURESAPI_EXPORT
210   virtual std::string getID() {
211     return FeaturesPlugin_ExtrusionFuse::ID();
212   }
213
214   /// Constructor without values.
215   FEATURESAPI_EXPORT
216   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
217
218   /// Constructor with values.
219   FEATURESAPI_EXPORT
220   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
221                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
222                                      const ModelHighAPI_Double& theSize,
223                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
224
225   /// Constructor with values.
226   FEATURESAPI_EXPORT
227   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
228                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
229                                      const ModelHighAPI_Selection& theDirection,
230                                      const ModelHighAPI_Double& theSize,
231                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
232
233   /// Constructor with values.
234   FEATURESAPI_EXPORT
235   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
236                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
237                                      const ModelHighAPI_Double& theToSize,
238                                      const ModelHighAPI_Double& theFromSize,
239                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
240
241   /// Constructor with values.
242   FEATURESAPI_EXPORT
243   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
244                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
245                                      const ModelHighAPI_Selection& theDirection,
246                                      const ModelHighAPI_Double& theToSize,
247                                      const ModelHighAPI_Double& theFromSize,
248                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
249
250   /// Constructor with values.
251   FEATURESAPI_EXPORT
252   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
253                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
254                                      const ModelHighAPI_Selection& theToObject,
255                                      const ModelHighAPI_Double& theToOffset,
256                                      const ModelHighAPI_Selection& theFromObject,
257                                      const ModelHighAPI_Double& theFromOffset,
258                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
259
260   /// Constructor with values.
261   FEATURESAPI_EXPORT
262   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
263                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
264                                      const ModelHighAPI_Selection& theDirection,
265                                      const ModelHighAPI_Selection& theToObject,
266                                      const ModelHighAPI_Double& theToOffset,
267                                      const ModelHighAPI_Selection& theFromObject,
268                                      const ModelHighAPI_Double& theFromOffset,
269                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
270 };
271
272 /// Pointer on ExtrusionFuse object.
273 typedef std::shared_ptr<FeaturesAPI_ExtrusionFuse> ExtrusionFusePtr;
274
275 /// \ingroup CPPHighAPI
276 /// \brief Create ExtrusionFuse feature.
277 FEATURESAPI_EXPORT
278 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
279                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
280                                   const ModelHighAPI_Double& theSize,
281                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
282
283 /// \ingroup CPPHighAPI
284 /// \brief Create ExtrusionFuse feature.
285 FEATURESAPI_EXPORT
286 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
287                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
288                                   const ModelHighAPI_Selection& theDirection,
289                                   const ModelHighAPI_Double& theSize,
290                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
291
292 /// \ingroup CPPHighAPI
293 /// \brief Create ExtrusionFuse feature.
294 FEATURESAPI_EXPORT
295 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
296                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
297                                   const ModelHighAPI_Double& theToSize,
298                                   const ModelHighAPI_Double& theFromSize,
299                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
300
301 /// \ingroup CPPHighAPI
302 /// \brief Create ExtrusionFuse feature.
303 FEATURESAPI_EXPORT
304 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
305                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
306                                   const ModelHighAPI_Selection& theDirection,
307                                   const ModelHighAPI_Double& theToSize,
308                                   const ModelHighAPI_Double& theFromSize,
309                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
310
311 /// \ingroup CPPHighAPI
312 /// \brief Create ExtrusionFuse feature.
313 FEATURESAPI_EXPORT
314 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
315                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
316                                   const ModelHighAPI_Selection& theToObject,
317                                   const ModelHighAPI_Double& theToOffset,
318                                   const ModelHighAPI_Selection& theFromObject,
319                                   const ModelHighAPI_Double& theFromOffset,
320                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
321
322 /// \ingroup CPPHighAPI
323 /// \brief Create ExtrusionFuse feature.
324 FEATURESAPI_EXPORT
325 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
326                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
327                                   const ModelHighAPI_Selection& theDirection,
328                                   const ModelHighAPI_Selection& theToObject,
329                                   const ModelHighAPI_Double& theToOffset,
330                                   const ModelHighAPI_Selection& theFromObject,
331                                   const ModelHighAPI_Double& theFromOffset,
332                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
333
334 #endif // FeaturesAPI_ExtrusionBoolean_H_