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_CompositeBoolean.h>
13 #include <FeaturesPlugin_ExtrusionCut.h>
14 #include <FeaturesPlugin_ExtrusionFuse.h>
16 #include <ModelHighAPI_Interface.h>
17 #include <ModelHighAPI_Macro.h>
19 class ModelHighAPI_Double;
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 sketchLauncher, 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 setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
49 /// Modify direction_object attribute of the feature.
51 void setDirection(const ModelHighAPI_Selection& theDirection);
53 /// Modify CreationMethod, to_size, from_size attributes of the feature.
55 void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize);
57 /// Modify creation_method, to_size, from_size attributes of the feature.
59 void setSize(const ModelHighAPI_Double& theSize);
61 /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
63 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
64 const ModelHighAPI_Double& theToOffset,
65 const ModelHighAPI_Selection& theFromObject,
66 const ModelHighAPI_Double& theFromOffset);
68 /// Modiyfy main_objects attribute of the feature.
70 void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
73 /// Constructor without values.
75 explicit FeaturesAPI_ExtrusionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
78 class FeaturesAPI_ExtrusionCut: public FeaturesAPI_ExtrusionBoolean
82 virtual std::string getID() {
83 return FeaturesPlugin_ExtrusionCut::ID();
86 /// Constructor without values.
88 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
90 /// Constructor with values.
92 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
93 const std::list<ModelHighAPI_Selection>& theBaseObjects,
94 const ModelHighAPI_Double& theSize,
95 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
97 /// Constructor with values.
99 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
100 const std::list<ModelHighAPI_Selection>& theBaseObjects,
101 const ModelHighAPI_Selection& theDirection,
102 const ModelHighAPI_Double& theSize,
103 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
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& theToSize,
110 const ModelHighAPI_Double& theFromSize,
111 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
113 /// Constructor with values.
115 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
116 const std::list<ModelHighAPI_Selection>& theBaseObjects,
117 const ModelHighAPI_Selection& theDirection,
118 const ModelHighAPI_Double& theToSize,
119 const ModelHighAPI_Double& theFromSize,
120 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
122 /// Constructor with values.
124 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
125 const std::list<ModelHighAPI_Selection>& theBaseObjects,
126 const ModelHighAPI_Selection& theToObject,
127 const ModelHighAPI_Double& theToOffset,
128 const ModelHighAPI_Selection& theFromObject,
129 const ModelHighAPI_Double& theFromOffset,
130 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
132 /// Constructor with values.
134 explicit FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
135 const std::list<ModelHighAPI_Selection>& theBaseObjects,
136 const ModelHighAPI_Selection& theDirection,
137 const ModelHighAPI_Selection& theToObject,
138 const ModelHighAPI_Double& theToOffset,
139 const ModelHighAPI_Selection& theFromObject,
140 const ModelHighAPI_Double& theFromOffset,
141 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
144 /// Pointer on ExtrusionCut object.
145 typedef std::shared_ptr<FeaturesAPI_ExtrusionCut> ExtrusionCutPtr;
147 /// \ingroup CPPHighAPI
148 /// \brief Create ExtrusionCut feature.
150 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
151 const std::list<ModelHighAPI_Selection>& theBaseObjects,
152 const ModelHighAPI_Double& theSize,
153 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
155 /// \ingroup CPPHighAPI
156 /// \brief Create ExtrusionCut feature.
158 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
159 const std::list<ModelHighAPI_Selection>& theBaseObjects,
160 const ModelHighAPI_Selection& theDirection,
161 const ModelHighAPI_Double& theSize,
162 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
164 /// \ingroup CPPHighAPI
165 /// \brief Create ExtrusionCut feature.
167 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
168 const std::list<ModelHighAPI_Selection>& theBaseObjects,
169 const ModelHighAPI_Double& theToSize,
170 const ModelHighAPI_Double& theFromSize,
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& theToSize,
180 const ModelHighAPI_Double& theFromSize,
181 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
183 /// \ingroup CPPHighAPI
184 /// \brief Create ExtrusionCut feature.
186 ExtrusionCutPtr addExtrusionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
187 const std::list<ModelHighAPI_Selection>& theBaseObjects,
188 const ModelHighAPI_Selection& theToObject,
189 const ModelHighAPI_Double& theToOffset,
190 const ModelHighAPI_Selection& theFromObject,
191 const ModelHighAPI_Double& theFromOffset,
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_Selection& theDirection,
200 const ModelHighAPI_Selection& theToObject,
201 const ModelHighAPI_Double& theToOffset,
202 const ModelHighAPI_Selection& theFromObject,
203 const ModelHighAPI_Double& theFromOffset,
204 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
206 class FeaturesAPI_ExtrusionFuse: public FeaturesAPI_ExtrusionBoolean
210 virtual std::string getID() {
211 return FeaturesPlugin_ExtrusionFuse::ID();
214 /// Constructor without values.
216 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
218 /// Constructor with values.
220 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
221 const std::list<ModelHighAPI_Selection>& theBaseObjects,
222 const ModelHighAPI_Double& theSize,
223 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
225 /// Constructor with values.
227 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
228 const std::list<ModelHighAPI_Selection>& theBaseObjects,
229 const ModelHighAPI_Selection& theDirection,
230 const ModelHighAPI_Double& theSize,
231 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
233 /// Constructor with values.
235 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
236 const std::list<ModelHighAPI_Selection>& theBaseObjects,
237 const ModelHighAPI_Double& theToSize,
238 const ModelHighAPI_Double& theFromSize,
239 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
241 /// Constructor with values.
243 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
244 const std::list<ModelHighAPI_Selection>& theBaseObjects,
245 const ModelHighAPI_Selection& theDirection,
246 const ModelHighAPI_Double& theToSize,
247 const ModelHighAPI_Double& theFromSize,
248 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
250 /// Constructor with values.
252 explicit FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
253 const std::list<ModelHighAPI_Selection>& theBaseObjects,
254 const ModelHighAPI_Selection& theToObject,
255 const ModelHighAPI_Double& theToOffset,
256 const ModelHighAPI_Selection& theFromObject,
257 const ModelHighAPI_Double& theFromOffset,
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_Selection& theToObject,
266 const ModelHighAPI_Double& theToOffset,
267 const ModelHighAPI_Selection& theFromObject,
268 const ModelHighAPI_Double& theFromOffset,
269 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
272 /// Pointer on ExtrusionFuse object.
273 typedef std::shared_ptr<FeaturesAPI_ExtrusionFuse> ExtrusionFusePtr;
275 /// \ingroup CPPHighAPI
276 /// \brief Create ExtrusionFuse feature.
278 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
279 const std::list<ModelHighAPI_Selection>& theBaseObjects,
280 const ModelHighAPI_Double& theSize,
281 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
283 /// \ingroup CPPHighAPI
284 /// \brief Create ExtrusionFuse feature.
286 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
287 const std::list<ModelHighAPI_Selection>& theBaseObjects,
288 const ModelHighAPI_Selection& theDirection,
289 const ModelHighAPI_Double& theSize,
290 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
292 /// \ingroup CPPHighAPI
293 /// \brief Create ExtrusionFuse feature.
295 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
296 const std::list<ModelHighAPI_Selection>& theBaseObjects,
297 const ModelHighAPI_Double& theToSize,
298 const ModelHighAPI_Double& theFromSize,
299 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
301 /// \ingroup CPPHighAPI
302 /// \brief Create ExtrusionFuse feature.
304 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
305 const std::list<ModelHighAPI_Selection>& theBaseObjects,
306 const ModelHighAPI_Selection& theDirection,
307 const ModelHighAPI_Double& theToSize,
308 const ModelHighAPI_Double& theFromSize,
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_Selection& theToObject,
317 const ModelHighAPI_Double& theToOffset,
318 const ModelHighAPI_Selection& theFromObject,
319 const ModelHighAPI_Double& theFromOffset,
320 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
322 /// \ingroup CPPHighAPI
323 /// \brief Create ExtrusionFuse feature.
325 ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
326 const std::list<ModelHighAPI_Selection>& theBaseObjects,
327 const ModelHighAPI_Selection& theDirection,
328 const ModelHighAPI_Selection& theToObject,
329 const ModelHighAPI_Double& theToOffset,
330 const ModelHighAPI_Selection& theFromObject,
331 const ModelHighAPI_Double& theFromOffset,
332 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
334 #endif // FeaturesAPI_ExtrusionBoolean_H_