Salome HOME
Revert insufficient changes to avoid compilation error on Linux
[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_ExtrusionCut.h>
13 #include <FeaturesPlugin_ExtrusionFuse.h>
14
15 #include <ModelHighAPI_Interface.h>
16 #include <ModelHighAPI_Macro.h>
17
18 class ModelHighAPI_Double;
19 class ModelHighAPI_Reference;
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                sketch, 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 setNestedSketch(const ModelHighAPI_Reference& theSketch);
48
49   /// Modify base attribute of the feature.
50   FEATURESAPI_EXPORT
51   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
52
53   /// Modify direction_object attribute of the feature.
54   FEATURESAPI_EXPORT
55   void setDirection(const ModelHighAPI_Selection& theDirection);
56
57   /// Modify CreationMethod, to_size, from_size attributes of the feature.
58   FEATURESAPI_EXPORT
59   void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize);
60
61   /// Modify creation_method, to_size, from_size attributes of the feature.
62   FEATURESAPI_EXPORT
63   void setSize(const ModelHighAPI_Double& theSize);
64
65   /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
66   FEATURESAPI_EXPORT
67   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
68                            const ModelHighAPI_Double& theToOffset,
69                            const ModelHighAPI_Selection& theFromObject,
70                            const ModelHighAPI_Double& theFromOffset);
71
72   /// Modiyfy main_objects attribute of the feature.
73   FEATURESAPI_EXPORT
74   void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
75
76   /// Dump wrapped feature
77   FEATURESAPI_EXPORT
78   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
79
80 protected:
81   /// Constructor without values.
82   FEATURESAPI_EXPORT
83   explicit FeaturesAPI_ExtrusionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
84
85 private:
86   void execIfBaseNotEmpty();
87 };
88
89 class FeaturesAPI_ExtrusionCut: public FeaturesAPI_ExtrusionBoolean
90 {
91 public:
92
93   static std::string ID() { return FeaturesPlugin_ExtrusionCut::ID(); }
94   virtual std::string getID() { return ID(); }
95
96   //FEATURESAPI_EXPORT
97   //virtual std::string getID() {
98   //  return FeaturesPlugin_ExtrusionCut::ID();
99   //}
100
101   /// Constructor without values.
102   FEATURESAPI_EXPORT
103   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
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& theSize,
110                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
111
112   /// Constructor with values.
113   FEATURESAPI_EXPORT
114   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
115                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
116                                     const ModelHighAPI_Selection& theDirection,
117                                     const ModelHighAPI_Double& theSize,
118                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
119
120   /// Constructor with values.
121   FEATURESAPI_EXPORT
122   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
123                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
124                                     const ModelHighAPI_Double& theToSize,
125                                     const ModelHighAPI_Double& theFromSize,
126                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
127
128   /// Constructor with values.
129   FEATURESAPI_EXPORT
130   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
131                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
132                                     const ModelHighAPI_Selection& theDirection,
133                                     const ModelHighAPI_Double& theToSize,
134                                     const ModelHighAPI_Double& theFromSize,
135                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
136
137   /// Constructor with values.
138   FEATURESAPI_EXPORT
139   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
140                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
141                                     const ModelHighAPI_Selection& theToObject,
142                                     const ModelHighAPI_Double& theToOffset,
143                                     const ModelHighAPI_Selection& theFromObject,
144                                     const ModelHighAPI_Double& theFromOffset,
145                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
146
147   /// Constructor with values.
148   FEATURESAPI_EXPORT
149   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
150                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
151                                     const ModelHighAPI_Selection& theDirection,
152                                     const ModelHighAPI_Selection& theToObject,
153                                     const ModelHighAPI_Double& theToOffset,
154                                     const ModelHighAPI_Selection& theFromObject,
155                                     const ModelHighAPI_Double& theFromOffset,
156                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
157 };
158
159 /// Pointer on ExtrusionCut object.
160 typedef std::shared_ptr<FeaturesAPI_ExtrusionCut> ExtrusionCutPtr;
161
162 /// \ingroup CPPHighAPI
163 /// \brief Create ExtrusionCut feature.
164 FEATURESAPI_EXPORT
165 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
166                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
167                                 const ModelHighAPI_Double& theSize,
168                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
169
170 /// \ingroup CPPHighAPI
171 /// \brief Create ExtrusionCut feature.
172 FEATURESAPI_EXPORT
173 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
174                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
175                                 const ModelHighAPI_Selection& theDirection,
176                                 const ModelHighAPI_Double& theSize,
177                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
178
179 /// \ingroup CPPHighAPI
180 /// \brief Create ExtrusionCut feature.
181 FEATURESAPI_EXPORT
182 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
183                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
184                                 const ModelHighAPI_Double& theToSize,
185                                 const ModelHighAPI_Double& theFromSize,
186                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
187
188 /// \ingroup CPPHighAPI
189 /// \brief Create ExtrusionCut feature.
190 FEATURESAPI_EXPORT
191 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
192                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
193                                 const ModelHighAPI_Selection& theDirection,
194                                 const ModelHighAPI_Double& theToSize,
195                                 const ModelHighAPI_Double& theFromSize,
196                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
197
198 /// \ingroup CPPHighAPI
199 /// \brief Create ExtrusionCut feature.
200 FEATURESAPI_EXPORT
201 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
202                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
203                                 const ModelHighAPI_Selection& theToObject,
204                                 const ModelHighAPI_Double& theToOffset,
205                                 const ModelHighAPI_Selection& theFromObject,
206                                 const ModelHighAPI_Double& theFromOffset,
207                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
208
209 /// \ingroup CPPHighAPI
210 /// \brief Create ExtrusionCut feature.
211 FEATURESAPI_EXPORT
212 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
213                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
214                                 const ModelHighAPI_Selection& theDirection,
215                                 const ModelHighAPI_Selection& theToObject,
216                                 const ModelHighAPI_Double& theToOffset,
217                                 const ModelHighAPI_Selection& theFromObject,
218                                 const ModelHighAPI_Double& theFromOffset,
219                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
220
221 class FeaturesAPI_ExtrusionFuse: public FeaturesAPI_ExtrusionBoolean
222 {
223 public:
224   static std::string ID() { return FeaturesPlugin_ExtrusionFuse::ID(); }
225   virtual std::string getID() { return ID(); }
226
227   /// Constructor without values.
228   FEATURESAPI_EXPORT
229   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
230
231   /// Constructor with values.
232   FEATURESAPI_EXPORT
233   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
234                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
235                                      const ModelHighAPI_Double& theSize,
236                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
237
238   /// Constructor with values.
239   FEATURESAPI_EXPORT
240   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
241                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
242                                      const ModelHighAPI_Selection& theDirection,
243                                      const ModelHighAPI_Double& theSize,
244                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
245
246   /// Constructor with values.
247   FEATURESAPI_EXPORT
248   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
249                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
250                                      const ModelHighAPI_Double& theToSize,
251                                      const ModelHighAPI_Double& theFromSize,
252                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
253
254   /// Constructor with values.
255   FEATURESAPI_EXPORT
256   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
257                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
258                                      const ModelHighAPI_Selection& theDirection,
259                                      const ModelHighAPI_Double& theToSize,
260                                      const ModelHighAPI_Double& theFromSize,
261                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
262
263   /// Constructor with values.
264   FEATURESAPI_EXPORT
265   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
266                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
267                                      const ModelHighAPI_Selection& theToObject,
268                                      const ModelHighAPI_Double& theToOffset,
269                                      const ModelHighAPI_Selection& theFromObject,
270                                      const ModelHighAPI_Double& theFromOffset,
271                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
272
273   /// Constructor with values.
274   FEATURESAPI_EXPORT
275   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
276                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
277                                      const ModelHighAPI_Selection& theDirection,
278                                      const ModelHighAPI_Selection& theToObject,
279                                      const ModelHighAPI_Double& theToOffset,
280                                      const ModelHighAPI_Selection& theFromObject,
281                                      const ModelHighAPI_Double& theFromOffset,
282                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
283 };
284
285 /// Pointer on ExtrusionFuse object.
286 typedef std::shared_ptr<FeaturesAPI_ExtrusionFuse> ExtrusionFusePtr;
287
288 /// \ingroup CPPHighAPI
289 /// \brief Create ExtrusionFuse feature.
290 FEATURESAPI_EXPORT
291 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
292                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
293                                   const ModelHighAPI_Double& theSize,
294                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
295
296 /// \ingroup CPPHighAPI
297 /// \brief Create ExtrusionFuse feature.
298 FEATURESAPI_EXPORT
299 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
300                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
301                                   const ModelHighAPI_Selection& theDirection,
302                                   const ModelHighAPI_Double& theSize,
303                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
304
305 /// \ingroup CPPHighAPI
306 /// \brief Create ExtrusionFuse feature.
307 FEATURESAPI_EXPORT
308 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
309                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
310                                   const ModelHighAPI_Double& theToSize,
311                                   const ModelHighAPI_Double& theFromSize,
312                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
313
314 /// \ingroup CPPHighAPI
315 /// \brief Create ExtrusionFuse feature.
316 FEATURESAPI_EXPORT
317 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
318                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
319                                   const ModelHighAPI_Selection& theDirection,
320                                   const ModelHighAPI_Double& theToSize,
321                                   const ModelHighAPI_Double& theFromSize,
322                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
323
324 /// \ingroup CPPHighAPI
325 /// \brief Create ExtrusionFuse feature.
326 FEATURESAPI_EXPORT
327 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
328                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
329                                   const ModelHighAPI_Selection& theToObject,
330                                   const ModelHighAPI_Double& theToOffset,
331                                   const ModelHighAPI_Selection& theFromObject,
332                                   const ModelHighAPI_Double& theFromOffset,
333                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
334
335 /// \ingroup CPPHighAPI
336 /// \brief Create ExtrusionFuse feature.
337 FEATURESAPI_EXPORT
338 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
339                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
340                                   const ModelHighAPI_Selection& theDirection,
341                                   const ModelHighAPI_Selection& theToObject,
342                                   const ModelHighAPI_Double& theToOffset,
343                                   const ModelHighAPI_Selection& theFromObject,
344                                   const ModelHighAPI_Double& theFromOffset,
345                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
346
347 #endif // FeaturesAPI_ExtrusionBoolean_H_