1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_RevolutionBoolean.cpp
4 // Created: 09 June 2016
5 // Author: Dmitry Bobylev
7 #include "FeaturesAPI_RevolutionBoolean.h"
9 #include <ModelHighAPI_Double.h>
10 #include <ModelHighAPI_Tools.h>
12 //==================================================================================================
13 FeaturesAPI_RevolutionBoolean::FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature)
14 : ModelHighAPI_Interface(theFeature)
18 //==================================================================================================
19 FeaturesAPI_RevolutionBoolean::~FeaturesAPI_RevolutionBoolean()
23 //==================================================================================================
24 void FeaturesAPI_RevolutionBoolean::setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects)
26 fillAttribute(theBaseObjects, mybaseObjects);
31 //==================================================================================================
32 void FeaturesAPI_RevolutionBoolean::setAxis(const ModelHighAPI_Selection& theAxis)
34 fillAttribute(theAxis, myaxis);
39 //==================================================================================================
40 void FeaturesAPI_RevolutionBoolean::setAngles(const ModelHighAPI_Double& theToAngle,
41 const ModelHighAPI_Double& theFromAngle)
43 fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES(), mycreationMethod);
44 fillAttribute(theToAngle, mytoAngle);
45 fillAttribute(theFromAngle, myfromAngle);
50 //==================================================================================================
51 void FeaturesAPI_RevolutionBoolean::setAngle(const ModelHighAPI_Double& theAngle)
53 fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES(), mycreationMethod);
54 fillAttribute(theAngle, mytoAngle);
55 fillAttribute(ModelHighAPI_Double(), myfromAngle);
60 //==================================================================================================
61 void FeaturesAPI_RevolutionBoolean::setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
62 const ModelHighAPI_Double& theToOffset,
63 const ModelHighAPI_Selection& theFromObject,
64 const ModelHighAPI_Double& theFromOffset)
66 fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_PLANES(), mycreationMethod);
67 fillAttribute(theToObject, mytoObject);
68 fillAttribute(theToOffset, mytoOffset);
69 fillAttribute(theFromObject, myfromObject);
70 fillAttribute(theFromOffset, myfromOffset);
75 //==================================================================================================
76 void FeaturesAPI_RevolutionBoolean::setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects)
78 fillAttribute(theBooleanObjects, mybooleanObjects);
83 //==================================================================================================
84 FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature)
85 : FeaturesAPI_RevolutionBoolean(theFeature)
90 //==================================================================================================
91 FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
92 const std::list<ModelHighAPI_Selection>& theBaseObjects,
93 const ModelHighAPI_Selection& theAxis,
94 const ModelHighAPI_Double& theSize,
95 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
96 : FeaturesAPI_RevolutionBoolean(theFeature)
99 fillAttribute(theBaseObjects, mybaseObjects);
100 fillAttribute(theAxis, myaxis);
101 fillAttribute(theSize, mytoAngle);
102 fillAttribute(ModelHighAPI_Double(), myfromAngle);
103 setBooleanObjects(theBooleanObjects);
107 //==================================================================================================
108 FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
109 const std::list<ModelHighAPI_Selection>& theBaseObjects,
110 const ModelHighAPI_Selection& theAxis,
111 const ModelHighAPI_Double& theToAngle,
112 const ModelHighAPI_Double& theFromAngle,
113 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
114 : FeaturesAPI_RevolutionBoolean(theFeature)
117 fillAttribute(theBaseObjects, mybaseObjects);
118 fillAttribute(theAxis, myaxis);
119 fillAttribute(theToAngle, mytoAngle);
120 fillAttribute(theFromAngle, myfromAngle);
121 setBooleanObjects(theBooleanObjects);
125 //==================================================================================================
126 FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
127 const std::list<ModelHighAPI_Selection>& theBaseObjects,
128 const ModelHighAPI_Selection& theAxis,
129 const ModelHighAPI_Selection& theToObject,
130 const ModelHighAPI_Double& theToOffset,
131 const ModelHighAPI_Selection& theFromObject,
132 const ModelHighAPI_Double& theFromOffset,
133 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
134 : FeaturesAPI_RevolutionBoolean(theFeature)
137 fillAttribute(theBaseObjects, mybaseObjects);
138 fillAttribute(theAxis, myaxis);
139 fillAttribute(theToObject, mytoObject);
140 fillAttribute(theToOffset, mytoOffset);
141 fillAttribute(theFromObject, myfromObject);
142 fillAttribute(theFromOffset, myfromOffset);
143 setBooleanObjects(theBooleanObjects);
147 //==================================================================================================
148 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
149 const std::list<ModelHighAPI_Selection>& theBaseObjects,
150 const ModelHighAPI_Selection& theAxis,
151 const ModelHighAPI_Double& theSize,
152 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
154 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
155 return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects));
158 //==================================================================================================
159 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
160 const std::list<ModelHighAPI_Selection>& theBaseObjects,
161 const ModelHighAPI_Selection& theAxis,
162 const ModelHighAPI_Double& theToAngle,
163 const ModelHighAPI_Double& theFromAngle,
164 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
166 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
167 return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature,
175 //==================================================================================================
176 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
177 const std::list<ModelHighAPI_Selection>& theBaseObjects,
178 const ModelHighAPI_Selection& theAxis,
179 const ModelHighAPI_Selection& theToObject,
180 const ModelHighAPI_Double& theToOffset,
181 const ModelHighAPI_Selection& theFromObject,
182 const ModelHighAPI_Double& theFromOffset,
183 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
185 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
186 return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature,
197 //==================================================================================================
198 FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature)
199 : FeaturesAPI_RevolutionBoolean(theFeature)
204 //==================================================================================================
205 FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
206 const std::list<ModelHighAPI_Selection>& theBaseObjects,
207 const ModelHighAPI_Selection& theAxis,
208 const ModelHighAPI_Double& theSize,
209 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
210 : FeaturesAPI_RevolutionBoolean(theFeature)
213 fillAttribute(theBaseObjects, mybaseObjects);
214 fillAttribute(theAxis, myaxis);
215 fillAttribute(theSize, mytoAngle);
216 fillAttribute(ModelHighAPI_Double(), myfromAngle);
217 setBooleanObjects(theBooleanObjects);
221 //==================================================================================================
222 FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
223 const std::list<ModelHighAPI_Selection>& theBaseObjects,
224 const ModelHighAPI_Selection& theAxis,
225 const ModelHighAPI_Double& theToAngle,
226 const ModelHighAPI_Double& theFromAngle,
227 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
228 : FeaturesAPI_RevolutionBoolean(theFeature)
231 fillAttribute(theBaseObjects, mybaseObjects);
232 fillAttribute(theAxis, myaxis);
233 fillAttribute(theToAngle, mytoAngle);
234 fillAttribute(theFromAngle, myfromAngle);
235 setBooleanObjects(theBooleanObjects);
239 //==================================================================================================
240 FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
241 const std::list<ModelHighAPI_Selection>& theBaseObjects,
242 const ModelHighAPI_Selection& theAxis,
243 const ModelHighAPI_Selection& theToObject,
244 const ModelHighAPI_Double& theToOffset,
245 const ModelHighAPI_Selection& theFromObject,
246 const ModelHighAPI_Double& theFromOffset,
247 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
248 : FeaturesAPI_RevolutionBoolean(theFeature)
251 fillAttribute(theBaseObjects, mybaseObjects);
252 fillAttribute(theAxis, myaxis);
253 fillAttribute(theToObject, mytoObject);
254 fillAttribute(theToOffset, mytoOffset);
255 fillAttribute(theFromObject, myfromObject);
256 fillAttribute(theFromOffset, myfromOffset);
257 setBooleanObjects(theBooleanObjects);
261 //==================================================================================================
262 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
263 const std::list<ModelHighAPI_Selection>& theBaseObjects,
264 const ModelHighAPI_Selection& theAxis,
265 const ModelHighAPI_Double& theSize,
266 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
268 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
269 return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects));
272 //==================================================================================================
273 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
274 const std::list<ModelHighAPI_Selection>& theBaseObjects,
275 const ModelHighAPI_Selection& theAxis,
276 const ModelHighAPI_Double& theToAngle,
277 const ModelHighAPI_Double& theFromAngle,
278 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
280 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
281 return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature,
289 //==================================================================================================
290 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
291 const std::list<ModelHighAPI_Selection>& theBaseObjects,
292 const ModelHighAPI_Selection& theAxis,
293 const ModelHighAPI_Selection& theToObject,
294 const ModelHighAPI_Double& theToOffset,
295 const ModelHighAPI_Selection& theFromObject,
296 const ModelHighAPI_Double& theFromOffset,
297 const std::list<ModelHighAPI_Selection>& theBooleanObjects)
299 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
300 return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature,