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(), 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 */)
45 /// Modify base attribute of the feature.
47 void setNestedSketch(const ModelHighAPI_Reference& theSketch);
49 /// Modify base attribute of the feature.
51 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
53 /// Modify direction_object attribute of the feature.
55 void setDirection(const ModelHighAPI_Selection& theDirection);
57 /// Modify CreationMethod, to_size, from_size attributes of the feature.
59 void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize);
61 /// Modify creation_method, to_size, from_size attributes of the feature.
63 void setSize(const ModelHighAPI_Double& theSize);
65 /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
67 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
68 const ModelHighAPI_Double& theToOffset,
69 const ModelHighAPI_Selection& theFromObject,
70 const ModelHighAPI_Double& theFromOffset);
72 /// Modiyfy main_objects attribute of the feature.
74 void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
76 /// Dump wrapped feature
78 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
81 /// Constructor without values.
83 explicit FeaturesAPI_ExtrusionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
86 void execIfBaseNotEmpty();
89 class FeaturesAPI_ExtrusionCut: public FeaturesAPI_ExtrusionBoolean
93 static std::string ID() { return FeaturesPlugin_ExtrusionCut::ID(); }
94 virtual std::string getID() { return ID(); }
97 //virtual std::string getID() {
98 // return FeaturesPlugin_ExtrusionCut::ID();
101 /// Constructor without values.
103 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
105 /// Constructor with values.
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);
112 /// Constructor with values.
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);
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& theToSize,
125 const ModelHighAPI_Double& theFromSize,
126 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
128 /// Constructor with values.
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);
137 /// Constructor with values.
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);
147 /// Constructor with values.
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);
159 /// Pointer on ExtrusionCut object.
160 typedef std::shared_ptr<FeaturesAPI_ExtrusionCut> ExtrusionCutPtr;
162 /// \ingroup CPPHighAPI
163 /// \brief Create ExtrusionCut feature.
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);
170 /// \ingroup CPPHighAPI
171 /// \brief Create ExtrusionCut feature.
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);
179 /// \ingroup CPPHighAPI
180 /// \brief Create ExtrusionCut feature.
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);
188 /// \ingroup CPPHighAPI
189 /// \brief Create ExtrusionCut feature.
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);
198 /// \ingroup CPPHighAPI
199 /// \brief Create ExtrusionCut feature.
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);
209 /// \ingroup CPPHighAPI
210 /// \brief Create ExtrusionCut feature.
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);
221 class FeaturesAPI_ExtrusionFuse: public FeaturesAPI_ExtrusionBoolean
224 static std::string ID() { return FeaturesPlugin_ExtrusionFuse::ID(); }
225 virtual std::string getID() { return ID(); }
227 /// Constructor without values.
229 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
231 /// Constructor with values.
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);
238 /// Constructor with values.
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);
246 /// Constructor with values.
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);
254 /// Constructor with values.
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);
263 /// Constructor with values.
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);
273 /// Constructor with values.
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);
285 /// Pointer on ExtrusionFuse object.
286 typedef std::shared_ptr<FeaturesAPI_ExtrusionFuse> ExtrusionFusePtr;
288 /// \ingroup CPPHighAPI
289 /// \brief Create ExtrusionFuse feature.
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);
296 /// \ingroup CPPHighAPI
297 /// \brief Create ExtrusionFuse feature.
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);
305 /// \ingroup CPPHighAPI
306 /// \brief Create ExtrusionFuse feature.
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);
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& theToSize,
321 const ModelHighAPI_Double& theFromSize,
322 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
324 /// \ingroup CPPHighAPI
325 /// \brief Create ExtrusionFuse feature.
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);
335 /// \ingroup CPPHighAPI
336 /// \brief Create ExtrusionFuse feature.
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);
347 #endif // FeaturesAPI_ExtrusionBoolean_H_