Salome HOME
Issue #1834: Fix length of lines
[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(),
34                ModelAPI_AttributeReference, /** Sketch launcher */,
35                baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(),
36                ModelAPI_AttributeSelectionList, /** Base objects */,
37                direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(),
38                ModelAPI_AttributeSelection, /** Direction */,
39                creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(),
40                ModelAPI_AttributeString, /** Creation method */,
41                toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(),
42                ModelAPI_AttributeDouble, /** To size */,
43                fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(),
44                ModelAPI_AttributeDouble, /** From size */,
45                toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(),
46                ModelAPI_AttributeSelection, /** To object */,
47                toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(),
48                ModelAPI_AttributeDouble, /** To offset */,
49                fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(),
50                ModelAPI_AttributeSelection, /** From object */,
51                fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(),
52                ModelAPI_AttributeDouble, /** From offset */,
53                booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(),
54                ModelAPI_AttributeSelectionList, /** Boolean objects */)
55
56   /// Modify base attribute of the feature.
57   FEATURESAPI_EXPORT
58   void setNestedSketch(const ModelHighAPI_Reference& theSketch);
59
60   /// Modify base attribute of the feature.
61   FEATURESAPI_EXPORT
62   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
63
64   /// Modify direction_object attribute of the feature.
65   FEATURESAPI_EXPORT
66   void setDirection(const ModelHighAPI_Selection& theDirection);
67
68   /// Modify CreationMethod, to_size, from_size attributes of the feature.
69   FEATURESAPI_EXPORT
70   void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize);
71
72   /// Modify creation_method, to_size, from_size attributes of the feature.
73   FEATURESAPI_EXPORT
74   void setSize(const ModelHighAPI_Double& theSize);
75
76   /// Modify creation_method, to_object, to_offset, from_object,
77   /// from_offset attributes of the feature.
78   FEATURESAPI_EXPORT
79   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
80                            const ModelHighAPI_Double& theToOffset,
81                            const ModelHighAPI_Selection& theFromObject,
82                            const ModelHighAPI_Double& theFromOffset);
83
84   /// Modiyfy main_objects attribute of the feature.
85   FEATURESAPI_EXPORT
86   void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
87
88   /// Dump wrapped feature
89   FEATURESAPI_EXPORT
90   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
91
92 protected:
93   /// Constructor without values.
94   FEATURESAPI_EXPORT
95   explicit FeaturesAPI_ExtrusionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
96
97 private:
98   void execIfBaseNotEmpty();
99 };
100
101 /// \class FeaturesAPI_ExtrusionCut
102 /// \ingroup CPPHighAPI
103 /// \brief Interface for ExtrusionCut feature.
104 class FeaturesAPI_ExtrusionCut: public FeaturesAPI_ExtrusionBoolean
105 {
106 public:
107
108   static std::string ID() { return FeaturesPlugin_ExtrusionCut::ID(); }
109   virtual std::string getID() { return ID(); }
110
111   //FEATURESAPI_EXPORT
112   //virtual std::string getID() {
113   //  return FeaturesPlugin_ExtrusionCut::ID();
114   //}
115
116   /// Constructor without values.
117   FEATURESAPI_EXPORT
118   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
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& theSize,
125                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
126
127   /// Constructor with values.
128   FEATURESAPI_EXPORT
129   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
130                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
131                                     const ModelHighAPI_Selection& theDirection,
132                                     const ModelHighAPI_Double& theSize,
133                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
134
135   /// Constructor with values.
136   FEATURESAPI_EXPORT
137   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
138                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
139                                     const ModelHighAPI_Double& theToSize,
140                                     const ModelHighAPI_Double& theFromSize,
141                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
142
143   /// Constructor with values.
144   FEATURESAPI_EXPORT
145   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
146                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
147                                     const ModelHighAPI_Selection& theDirection,
148                                     const ModelHighAPI_Double& theToSize,
149                                     const ModelHighAPI_Double& theFromSize,
150                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
151
152   /// Constructor with values.
153   FEATURESAPI_EXPORT
154   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
155                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
156                                     const ModelHighAPI_Selection& theToObject,
157                                     const ModelHighAPI_Double& theToOffset,
158                                     const ModelHighAPI_Selection& theFromObject,
159                                     const ModelHighAPI_Double& theFromOffset,
160                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
161
162   /// Constructor with values.
163   FEATURESAPI_EXPORT
164   explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
165                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
166                                     const ModelHighAPI_Selection& theDirection,
167                                     const ModelHighAPI_Selection& theToObject,
168                                     const ModelHighAPI_Double& theToOffset,
169                                     const ModelHighAPI_Selection& theFromObject,
170                                     const ModelHighAPI_Double& theFromOffset,
171                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
172 };
173
174 /// Pointer on ExtrusionCut object.
175 typedef std::shared_ptr<FeaturesAPI_ExtrusionCut> ExtrusionCutPtr;
176
177 /// \ingroup CPPHighAPI
178 /// \brief Create ExtrusionCut feature.
179 FEATURESAPI_EXPORT
180 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
181                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
182                                 const ModelHighAPI_Double& theSize,
183                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
184
185 /// \ingroup CPPHighAPI
186 /// \brief Create ExtrusionCut feature.
187 FEATURESAPI_EXPORT
188 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
189                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
190                                 const ModelHighAPI_Selection& theDirection,
191                                 const ModelHighAPI_Double& theSize,
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_Double& theToSize,
200                                 const ModelHighAPI_Double& theFromSize,
201                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
202
203 /// \ingroup CPPHighAPI
204 /// \brief Create ExtrusionCut feature.
205 FEATURESAPI_EXPORT
206 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
207                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
208                                 const ModelHighAPI_Selection& theDirection,
209                                 const ModelHighAPI_Double& theToSize,
210                                 const ModelHighAPI_Double& theFromSize,
211                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
212
213 /// \ingroup CPPHighAPI
214 /// \brief Create ExtrusionCut feature.
215 FEATURESAPI_EXPORT
216 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
217                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
218                                 const ModelHighAPI_Selection& theToObject,
219                                 const ModelHighAPI_Double& theToOffset,
220                                 const ModelHighAPI_Selection& theFromObject,
221                                 const ModelHighAPI_Double& theFromOffset,
222                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
223
224 /// \ingroup CPPHighAPI
225 /// \brief Create ExtrusionCut feature.
226 FEATURESAPI_EXPORT
227 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
228                                 const std::list<ModelHighAPI_Selection>& theBaseObjects,
229                                 const ModelHighAPI_Selection& theDirection,
230                                 const ModelHighAPI_Selection& theToObject,
231                                 const ModelHighAPI_Double& theToOffset,
232                                 const ModelHighAPI_Selection& theFromObject,
233                                 const ModelHighAPI_Double& theFromOffset,
234                                 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
235
236 /// \class FeaturesAPI_ExtrusionFuse
237 /// \ingroup CPPHighAPI
238 /// \brief Interface for ExtrusionFuse feature.
239 class FeaturesAPI_ExtrusionFuse: public FeaturesAPI_ExtrusionBoolean
240 {
241 public:
242   static std::string ID() { return FeaturesPlugin_ExtrusionFuse::ID(); }
243   virtual std::string getID() { return ID(); }
244
245   /// Constructor without values.
246   FEATURESAPI_EXPORT
247   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
248
249   /// Constructor with values.
250   FEATURESAPI_EXPORT
251   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
252                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
253                                      const ModelHighAPI_Double& theSize,
254                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
255
256   /// Constructor with values.
257   FEATURESAPI_EXPORT
258   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
259                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
260                                      const ModelHighAPI_Selection& theDirection,
261                                      const ModelHighAPI_Double& theSize,
262                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
263
264   /// Constructor with values.
265   FEATURESAPI_EXPORT
266   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
267                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
268                                      const ModelHighAPI_Double& theToSize,
269                                      const ModelHighAPI_Double& theFromSize,
270                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
271
272   /// Constructor with values.
273   FEATURESAPI_EXPORT
274   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
275                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
276                                      const ModelHighAPI_Selection& theDirection,
277                                      const ModelHighAPI_Double& theToSize,
278                                      const ModelHighAPI_Double& theFromSize,
279                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
280
281   /// Constructor with values.
282   FEATURESAPI_EXPORT
283   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
284                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
285                                      const ModelHighAPI_Selection& theToObject,
286                                      const ModelHighAPI_Double& theToOffset,
287                                      const ModelHighAPI_Selection& theFromObject,
288                                      const ModelHighAPI_Double& theFromOffset,
289                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
290
291   /// Constructor with values.
292   FEATURESAPI_EXPORT
293   explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
294                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
295                                      const ModelHighAPI_Selection& theDirection,
296                                      const ModelHighAPI_Selection& theToObject,
297                                      const ModelHighAPI_Double& theToOffset,
298                                      const ModelHighAPI_Selection& theFromObject,
299                                      const ModelHighAPI_Double& theFromOffset,
300                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
301 };
302
303 /// Pointer on ExtrusionFuse object.
304 typedef std::shared_ptr<FeaturesAPI_ExtrusionFuse> ExtrusionFusePtr;
305
306 /// \ingroup CPPHighAPI
307 /// \brief Create ExtrusionFuse feature.
308 FEATURESAPI_EXPORT
309 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
310                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
311                                   const ModelHighAPI_Double& theSize,
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& theSize,
321                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
322
323 /// \ingroup CPPHighAPI
324 /// \brief Create ExtrusionFuse feature.
325 FEATURESAPI_EXPORT
326 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
327                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
328                                   const ModelHighAPI_Double& theToSize,
329                                   const ModelHighAPI_Double& theFromSize,
330                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
331
332 /// \ingroup CPPHighAPI
333 /// \brief Create ExtrusionFuse feature.
334 FEATURESAPI_EXPORT
335 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
336                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
337                                   const ModelHighAPI_Selection& theDirection,
338                                   const ModelHighAPI_Double& theToSize,
339                                   const ModelHighAPI_Double& theFromSize,
340                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
341
342 /// \ingroup CPPHighAPI
343 /// \brief Create ExtrusionFuse feature.
344 FEATURESAPI_EXPORT
345 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
346                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
347                                   const ModelHighAPI_Selection& theToObject,
348                                   const ModelHighAPI_Double& theToOffset,
349                                   const ModelHighAPI_Selection& theFromObject,
350                                   const ModelHighAPI_Double& theFromOffset,
351                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
352
353 /// \ingroup CPPHighAPI
354 /// \brief Create ExtrusionFuse feature.
355 FEATURESAPI_EXPORT
356 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
357                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
358                                   const ModelHighAPI_Selection& theDirection,
359                                   const ModelHighAPI_Selection& theToObject,
360                                   const ModelHighAPI_Double& theToOffset,
361                                   const ModelHighAPI_Selection& theFromObject,
362                                   const ModelHighAPI_Double& theFromOffset,
363                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
364
365 #endif // FeaturesAPI_ExtrusionBoolean_H_