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
90 /// \ingroup CPPHighAPI
91 /// \brief Interface for ExtrusionCut feature.
92 class FeaturesAPI_ExtrusionCut: public FeaturesAPI_ExtrusionBoolean
96 static std::string ID() { return FeaturesPlugin_ExtrusionCut::ID(); }
97 virtual std::string getID() { return ID(); }
100 //virtual std::string getID() {
101 // return FeaturesPlugin_ExtrusionCut::ID();
104 /// Constructor without values.
106 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
108 /// Constructor with values.
110 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
111 const std::list<ModelHighAPI_Selection>& theBaseObjects,
112 const ModelHighAPI_Double& theSize,
113 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
115 /// Constructor with values.
117 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
118 const std::list<ModelHighAPI_Selection>& theBaseObjects,
119 const ModelHighAPI_Selection& theDirection,
120 const ModelHighAPI_Double& theSize,
121 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
123 /// Constructor with values.
125 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
126 const std::list<ModelHighAPI_Selection>& theBaseObjects,
127 const ModelHighAPI_Double& theToSize,
128 const ModelHighAPI_Double& theFromSize,
129 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
131 /// Constructor with values.
133 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
134 const std::list<ModelHighAPI_Selection>& theBaseObjects,
135 const ModelHighAPI_Selection& theDirection,
136 const ModelHighAPI_Double& theToSize,
137 const ModelHighAPI_Double& theFromSize,
138 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
140 /// Constructor with values.
142 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
143 const std::list<ModelHighAPI_Selection>& theBaseObjects,
144 const ModelHighAPI_Selection& theToObject,
145 const ModelHighAPI_Double& theToOffset,
146 const ModelHighAPI_Selection& theFromObject,
147 const ModelHighAPI_Double& theFromOffset,
148 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
150 /// Constructor with values.
152 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
153 const std::list<ModelHighAPI_Selection>& theBaseObjects,
154 const ModelHighAPI_Selection& theDirection,
155 const ModelHighAPI_Selection& theToObject,
156 const ModelHighAPI_Double& theToOffset,
157 const ModelHighAPI_Selection& theFromObject,
158 const ModelHighAPI_Double& theFromOffset,
159 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
162 /// Pointer on ExtrusionCut object.
163 typedef std::shared_ptr<FeaturesAPI_ExtrusionCut> ExtrusionCutPtr;
165 /// \ingroup CPPHighAPI
166 /// \brief Create ExtrusionCut feature.
168 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
169 const std::list<ModelHighAPI_Selection>& theBaseObjects,
170 const ModelHighAPI_Double& theSize,
171 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
173 /// \ingroup CPPHighAPI
174 /// \brief Create ExtrusionCut feature.
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& theSize,
180 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
182 /// \ingroup CPPHighAPI
183 /// \brief Create ExtrusionCut feature.
185 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
186 const std::list<ModelHighAPI_Selection>& theBaseObjects,
187 const ModelHighAPI_Double& theToSize,
188 const ModelHighAPI_Double& theFromSize,
189 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
191 /// \ingroup CPPHighAPI
192 /// \brief Create ExtrusionCut feature.
194 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
195 const std::list<ModelHighAPI_Selection>& theBaseObjects,
196 const ModelHighAPI_Selection& theDirection,
197 const ModelHighAPI_Double& theToSize,
198 const ModelHighAPI_Double& theFromSize,
199 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
201 /// \ingroup CPPHighAPI
202 /// \brief Create ExtrusionCut feature.
204 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
205 const std::list<ModelHighAPI_Selection>& theBaseObjects,
206 const ModelHighAPI_Selection& theToObject,
207 const ModelHighAPI_Double& theToOffset,
208 const ModelHighAPI_Selection& theFromObject,
209 const ModelHighAPI_Double& theFromOffset,
210 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
212 /// \ingroup CPPHighAPI
213 /// \brief Create ExtrusionCut feature.
215 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
216 const std::list<ModelHighAPI_Selection>& theBaseObjects,
217 const ModelHighAPI_Selection& theDirection,
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 /// \class FeaturesAPI_ExtrusionFuse
225 /// \ingroup CPPHighAPI
226 /// \brief Interface for ExtrusionFuse feature.
227 class FeaturesAPI_ExtrusionFuse: public FeaturesAPI_ExtrusionBoolean
230 static std::string ID() { return FeaturesPlugin_ExtrusionFuse::ID(); }
231 virtual std::string getID() { return ID(); }
233 /// Constructor without values.
235 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
237 /// Constructor with values.
239 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
240 const std::list<ModelHighAPI_Selection>& theBaseObjects,
241 const ModelHighAPI_Double& theSize,
242 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
244 /// Constructor with values.
246 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
247 const std::list<ModelHighAPI_Selection>& theBaseObjects,
248 const ModelHighAPI_Selection& theDirection,
249 const ModelHighAPI_Double& theSize,
250 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
252 /// Constructor with values.
254 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
255 const std::list<ModelHighAPI_Selection>& theBaseObjects,
256 const ModelHighAPI_Double& theToSize,
257 const ModelHighAPI_Double& theFromSize,
258 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
260 /// Constructor with values.
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_Double& theToSize,
266 const ModelHighAPI_Double& theFromSize,
267 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
269 /// Constructor with values.
271 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
272 const std::list<ModelHighAPI_Selection>& theBaseObjects,
273 const ModelHighAPI_Selection& theToObject,
274 const ModelHighAPI_Double& theToOffset,
275 const ModelHighAPI_Selection& theFromObject,
276 const ModelHighAPI_Double& theFromOffset,
277 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
279 /// Constructor with values.
281 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
282 const std::list<ModelHighAPI_Selection>& theBaseObjects,
283 const ModelHighAPI_Selection& theDirection,
284 const ModelHighAPI_Selection& theToObject,
285 const ModelHighAPI_Double& theToOffset,
286 const ModelHighAPI_Selection& theFromObject,
287 const ModelHighAPI_Double& theFromOffset,
288 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
291 /// Pointer on ExtrusionFuse object.
292 typedef std::shared_ptr<FeaturesAPI_ExtrusionFuse> ExtrusionFusePtr;
294 /// \ingroup CPPHighAPI
295 /// \brief Create ExtrusionFuse feature.
297 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
298 const std::list<ModelHighAPI_Selection>& theBaseObjects,
299 const ModelHighAPI_Double& theSize,
300 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
302 /// \ingroup CPPHighAPI
303 /// \brief Create ExtrusionFuse feature.
305 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
306 const std::list<ModelHighAPI_Selection>& theBaseObjects,
307 const ModelHighAPI_Selection& theDirection,
308 const ModelHighAPI_Double& theSize,
309 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
311 /// \ingroup CPPHighAPI
312 /// \brief Create ExtrusionFuse feature.
314 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
315 const std::list<ModelHighAPI_Selection>& theBaseObjects,
316 const ModelHighAPI_Double& theToSize,
317 const ModelHighAPI_Double& theFromSize,
318 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
320 /// \ingroup CPPHighAPI
321 /// \brief Create ExtrusionFuse feature.
323 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
324 const std::list<ModelHighAPI_Selection>& theBaseObjects,
325 const ModelHighAPI_Selection& theDirection,
326 const ModelHighAPI_Double& theToSize,
327 const ModelHighAPI_Double& theFromSize,
328 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
330 /// \ingroup CPPHighAPI
331 /// \brief Create ExtrusionFuse feature.
333 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
334 const std::list<ModelHighAPI_Selection>& theBaseObjects,
335 const ModelHighAPI_Selection& theToObject,
336 const ModelHighAPI_Double& theToOffset,
337 const ModelHighAPI_Selection& theFromObject,
338 const ModelHighAPI_Double& theFromOffset,
339 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
341 /// \ingroup CPPHighAPI
342 /// \brief Create ExtrusionFuse feature.
344 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
345 const std::list<ModelHighAPI_Selection>& theBaseObjects,
346 const ModelHighAPI_Selection& theDirection,
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 #endif // FeaturesAPI_ExtrusionBoolean_H_