1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_ExtrusionBoolean.h
4 // Created: 09 June 2016
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesAPI_ExtrusionBoolean_H_
8 #define FeaturesAPI_ExtrusionBoolean_H_
10 #include "FeaturesAPI.h"
12 #include <FeaturesPlugin_ExtrusionCut.h>
13 #include <FeaturesPlugin_ExtrusionFuse.h>
15 #include <ModelHighAPI_Interface.h>
16 #include <ModelHighAPI_Macro.h>
18 class ModelHighAPI_Double;
19 class ModelHighAPI_Reference;
20 class ModelHighAPI_Selection;
22 /// \class FeaturesAPI_ExtrusionBoolean
23 /// \ingroup CPPHighAPI
24 /// \brief Interface for ExtrusionBoolean feature.
25 class FeaturesAPI_ExtrusionBoolean: public ModelHighAPI_Interface
30 virtual ~FeaturesAPI_ExtrusionBoolean();
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 */)
56 /// Modify base attribute of the feature.
58 void setNestedSketch(const ModelHighAPI_Reference& theSketch);
60 /// Modify base attribute of the feature.
62 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
64 /// Modify direction_object attribute of the feature.
66 void setDirection(const ModelHighAPI_Selection& theDirection);
68 /// Modify CreationMethod, to_size, from_size attributes of the feature.
70 void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize);
72 /// Modify creation_method, to_size, from_size attributes of the feature.
74 void setSize(const ModelHighAPI_Double& theSize);
76 /// Modify creation_method, to_object, to_offset, from_object,
77 /// from_offset attributes of the feature.
79 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
80 const ModelHighAPI_Double& theToOffset,
81 const ModelHighAPI_Selection& theFromObject,
82 const ModelHighAPI_Double& theFromOffset);
84 /// Modiyfy main_objects attribute of the feature.
86 void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
88 /// Dump wrapped feature
90 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
93 /// Constructor without values.
95 explicit FeaturesAPI_ExtrusionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
98 void execIfBaseNotEmpty();
101 /// \class FeaturesAPI_ExtrusionCut
102 /// \ingroup CPPHighAPI
103 /// \brief Interface for ExtrusionCut feature.
104 class FeaturesAPI_ExtrusionCut: public FeaturesAPI_ExtrusionBoolean
108 static std::string ID() { return FeaturesPlugin_ExtrusionCut::ID(); }
109 virtual std::string getID() { return ID(); }
112 //virtual std::string getID() {
113 // return FeaturesPlugin_ExtrusionCut::ID();
116 /// Constructor without values.
118 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
120 /// Constructor with values.
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);
127 /// Constructor with values.
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);
135 /// Constructor with values.
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);
143 /// Constructor with values.
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);
152 /// Constructor with values.
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);
162 /// Constructor with values.
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);
174 /// Pointer on ExtrusionCut object.
175 typedef std::shared_ptr<FeaturesAPI_ExtrusionCut> ExtrusionCutPtr;
177 /// \ingroup CPPHighAPI
178 /// \brief Create ExtrusionCut feature.
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);
185 /// \ingroup CPPHighAPI
186 /// \brief Create ExtrusionCut feature.
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);
194 /// \ingroup CPPHighAPI
195 /// \brief Create ExtrusionCut feature.
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);
203 /// \ingroup CPPHighAPI
204 /// \brief Create ExtrusionCut feature.
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);
213 /// \ingroup CPPHighAPI
214 /// \brief Create ExtrusionCut feature.
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);
224 /// \ingroup CPPHighAPI
225 /// \brief Create ExtrusionCut feature.
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);
236 /// \class FeaturesAPI_ExtrusionFuse
237 /// \ingroup CPPHighAPI
238 /// \brief Interface for ExtrusionFuse feature.
239 class FeaturesAPI_ExtrusionFuse: public FeaturesAPI_ExtrusionBoolean
242 static std::string ID() { return FeaturesPlugin_ExtrusionFuse::ID(); }
243 virtual std::string getID() { return ID(); }
245 /// Constructor without values.
247 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
249 /// Constructor with values.
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);
256 /// Constructor with values.
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);
264 /// Constructor with values.
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);
272 /// Constructor with values.
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);
281 /// Constructor with values.
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);
291 /// Constructor with values.
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);
303 /// Pointer on ExtrusionFuse object.
304 typedef std::shared_ptr<FeaturesAPI_ExtrusionFuse> ExtrusionFusePtr;
306 /// \ingroup CPPHighAPI
307 /// \brief Create ExtrusionFuse feature.
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);
314 /// \ingroup CPPHighAPI
315 /// \brief Create ExtrusionFuse feature.
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);
323 /// \ingroup CPPHighAPI
324 /// \brief Create ExtrusionFuse feature.
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);
332 /// \ingroup CPPHighAPI
333 /// \brief Create ExtrusionFuse feature.
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);
342 /// \ingroup CPPHighAPI
343 /// \brief Create ExtrusionFuse feature.
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);
353 /// \ingroup CPPHighAPI
354 /// \brief Create ExtrusionFuse feature.
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);
365 #endif // FeaturesAPI_ExtrusionBoolean_H_