]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp
Salome HOME
7f9ce37ac77b4a27d79d5d42dd71133c9edc666f
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Boolean.cpp
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include "FeaturesPlugin_Boolean.h"
21
22 #include <ModelAPI_Data.h>
23 #include <ModelAPI_Document.h>
24 #include <ModelAPI_AttributeReference.h>
25 #include <ModelAPI_AttributeInteger.h>
26 #include <ModelAPI_ResultBody.h>
27 #include <ModelAPI_AttributeSelectionList.h>
28 #include <ModelAPI_Session.h>
29 #include <ModelAPI_Validator.h>
30 #include <ModelAPI_Tools.h>
31
32 #include <GeomAlgoAPI_Boolean.h>
33 #include <GeomAlgoAPI_CompoundBuilder.h>
34 #include <GeomAlgoAPI_MakeShapeCustom.h>
35 #include <GeomAlgoAPI_MakeShapeList.h>
36 #include <GeomAlgoAPI_Partition.h>
37 #include <GeomAlgoAPI_PaveFiller.h>
38 #include <GeomAlgoAPI_ShapeTools.h>
39 #include <GeomAlgoAPI_Tools.h>
40 #include <GeomAPI_Face.h>
41 #include <GeomAPI_ShapeExplorer.h>
42 #include <GeomAPI_ShapeIterator.h>
43
44 #include <algorithm>
45 #include <map>
46
47 //=================================================================================================
48 FeaturesPlugin_Boolean::FeaturesPlugin_Boolean(const OperationType theOperationType)
49 : myOperationType(theOperationType)
50 {
51 }
52
53 //=================================================================================================
54 void FeaturesPlugin_Boolean::initAttributes()
55 {
56   AttributeSelectionListPtr aSelection =
57     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(data()->addAttribute(
58     FeaturesPlugin_Boolean::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
59
60   aSelection = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(data()->addAttribute(
61     FeaturesPlugin_Boolean::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
62
63   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), OBJECT_LIST_ID());
64   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), TOOL_LIST_ID());
65 }
66
67 //=================================================================================================
68 FeaturesPlugin_Boolean::OperationType FeaturesPlugin_Boolean::operationType()
69 {
70   return myOperationType;
71 }
72
73 //=================================================================================================
74 void FeaturesPlugin_Boolean::parentForShape(const GeomShapePtr& theShape,
75                                             const ResultPtr& theContext,
76                                             ObjectHierarchy& theShapesHierarchy)
77 {
78   ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(theContext);
79   if (aResCompSolidPtr.get()) {
80     std::shared_ptr<GeomAPI_Shape> aContextShape = aResCompSolidPtr->shape();
81     if (aContextShape->shapeType() <= GeomAPI_Shape::COMPSOLID) {
82       theShapesHierarchy.AddParent(theShape, aContextShape);
83       parentForShape(aContextShape, aResCompSolidPtr, theShapesHierarchy);
84     }
85   }
86 }
87
88 bool FeaturesPlugin_Boolean::processAttribute(const std::string& theAttributeName,
89                                               ObjectHierarchy& theObjects,
90                                               ListOfShape& thePlanesList)
91 {
92   AttributeSelectionListPtr anObjectsSelList = selectionList(theAttributeName);
93   for (int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
94     AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex);
95     GeomShapePtr anObject = anObjectAttr->value();
96     if (!anObject.get()) {
97       // It could be a construction plane.
98       ResultPtr aContext = anObjectAttr->context();
99       anObject = anObjectAttr->context()->shape();
100       if (anObject.get()) {
101         thePlanesList.push_back(anObject);
102         continue;
103       } else
104         return false;
105     }
106
107     theObjects.AddObject(anObject);
108
109     ResultPtr aContext = anObjectAttr->context();
110     parentForShape(anObject, aContext, theObjects);
111   }
112   return true;
113 }
114
115 //=================================================================================================
116 void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
117                                           const std::shared_ptr<GeomAPI_Shape> theBaseShape,
118                                           const ListOfShape& theTools,
119                                           const std::shared_ptr<GeomAPI_Shape> theResultShape,
120                                           const GeomMakeShapePtr& theMakeShape)
121 {
122   //load result
123   if(theBaseShape->isEqual(theResultShape)) {
124     theResultBody->store(theResultShape, false);
125     return;
126   }
127
128   theResultBody->storeModified(theBaseShape, theResultShape);
129
130   theResultBody->loadModifiedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::EDGE);
131   theResultBody->loadModifiedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::FACE);
132
133   theResultBody->loadDeletedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::FACE);
134
135   for (ListOfShape::const_iterator anIter = theTools.begin();
136        anIter != theTools.end();
137        ++anIter)
138   {
139     GeomAPI_Shape::ShapeType aShapeType =
140       (*anIter)->shapeType() <= GeomAPI_Shape::FACE ? GeomAPI_Shape::FACE
141                                                     : GeomAPI_Shape::EDGE;
142     theResultBody->loadModifiedShapes(theMakeShape, *anIter, aShapeType);
143
144     theResultBody->loadDeletedShapes(theMakeShape, *anIter, GeomAPI_Shape::FACE);
145   }
146 }
147
148 //=================================================================================================
149 bool FeaturesPlugin_Boolean::processObject(
150     const GeomAlgoAPI_Tools::BOPType theBooleanType,
151     const GeomShapePtr& theObject,
152     const ListOfShape& theTools,
153     const ListOfShape& thePlanes,
154     int& theResultIndex,
155     std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
156     ListOfShape& theResultShapesList)
157 {
158   ListOfShape aListWithObject;
159   aListWithObject.push_back(theObject);
160   std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
161   std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
162   GeomShapePtr aResShape;
163
164   std::list<std::shared_ptr<GeomAPI_Pnt> > aBoundingPoints =
165       GeomAlgoAPI_ShapeTools::getBoundingBox(aListWithObject, 1.0);
166
167   // Resize planes.
168   ListOfShape aToolsWithPlanes = theTools;
169   for (ListOfShape::const_iterator anIt = thePlanes.begin(); anIt != thePlanes.end(); ++anIt) {
170     GeomShapePtr aPlane = *anIt;
171     GeomShapePtr aTool = GeomAlgoAPI_ShapeTools::fitPlaneToBox(aPlane, aBoundingPoints);
172     std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aMkShCustom(
173         new GeomAlgoAPI_MakeShapeCustom);
174     aMkShCustom->addModified(aPlane, aTool);
175     aMakeShapeList->appendAlgo(aMkShCustom);
176     aToolsWithPlanes.push_back(aTool);
177   }
178
179   if (theBooleanType == GeomAlgoAPI_Tools::BOOL_PARTITION)
180     aBoolAlgo.reset(new GeomAlgoAPI_Partition(aListWithObject, aToolsWithPlanes));
181   else
182     aBoolAlgo.reset(new GeomAlgoAPI_Boolean(aListWithObject,
183                                             aToolsWithPlanes,
184                                             theBooleanType));
185
186   // Checking that the algorithm worked properly.
187   std::string anError;
188   if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aBoolAlgo, getKind(), anError)) {
189     setError(anError);
190     return false;
191   }
192
193   aResShape = aBoolAlgo->shape();
194   if (aResShape.get() && aResShape->shapeType() == GeomAPI_Shape::COMPOUND) {
195     int aSubResultsNb = 0;
196     GeomAPI_ShapeIterator anIt(aResShape);
197     for (; anIt.more(); anIt.next())
198       ++aSubResultsNb;
199
200     if (aSubResultsNb == 1) {
201       anIt.init(aResShape);
202       if (anIt.more())
203         aResShape = anIt.current();
204     }
205   }
206
207   aMakeShapeList->appendAlgo(aBoolAlgo);
208
209   GeomAPI_ShapeIterator aShapeIt(aResShape);
210   if (aShapeIt.more() || aResShape->shapeType() == GeomAPI_Shape::VERTEX) {
211     std::shared_ptr<ModelAPI_ResultBody> aResultBody =
212         document()->createBody(data(), theResultIndex);
213
214     // tools should be added to the list to fulfill the correct history of modification
215     aListWithObject.insert(aListWithObject.end(), theTools.begin(), theTools.end());
216
217     ListOfShape aUsedTools = theTools;
218     aUsedTools.insert(aUsedTools.end(), thePlanes.begin(), thePlanes.end());
219
220     FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
221                                              aListWithObject,
222                                              aUsedTools,
223                                              aMakeShapeList,
224                                              aResShape);
225     setResult(aResultBody, theResultIndex);
226     ++theResultIndex;
227
228     FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
229     aRBA.resultBody = aResultBody;
230     aRBA.baseShape = theObject;
231     aRBA.makeShape = aMakeShapeList;
232     theResultBaseAlgoList.push_back(aRBA);
233     theResultShapesList.push_back(aResShape);
234   }
235   return true;
236 }
237
238 //=================================================================================================
239 bool FeaturesPlugin_Boolean::processCompsolid(
240     const GeomAlgoAPI_Tools::BOPType theBooleanType,
241     const ObjectHierarchy& theCompsolidHierarchy,
242     const GeomShapePtr& theCompsolid,
243     const ListOfShape& theTools,
244     const ListOfShape& thePlanes,
245     int& theResultIndex,
246     std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
247     ListOfShape& theResultShapesList)
248 {
249   ListOfShape aUsedInOperationSolids;
250   ListOfShape aNotUsedSolids;
251   theCompsolidHierarchy.SplitCompound(theCompsolid, aUsedInOperationSolids, aNotUsedSolids);
252
253   std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
254
255   std::list<std::shared_ptr<GeomAPI_Pnt> > aBoundingPoints =
256       GeomAlgoAPI_ShapeTools::getBoundingBox(aUsedInOperationSolids, 1.0);
257
258   // Resize planes.
259   ListOfShape aToolsWithPlanes = theTools;
260   for (ListOfShape::const_iterator anIt = thePlanes.begin(); anIt != thePlanes.end(); ++anIt)
261   {
262     GeomShapePtr aPlane = *anIt;
263     GeomShapePtr aTool = GeomAlgoAPI_ShapeTools::fitPlaneToBox(aPlane, aBoundingPoints);
264     std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aMkShCustom(
265       new GeomAlgoAPI_MakeShapeCustom);
266     aMkShCustom->addModified(aPlane, aTool);
267     aMakeShapeList->appendAlgo(aMkShCustom);
268     aToolsWithPlanes.push_back(aTool);
269   }
270
271   std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
272   if (theBooleanType == GeomAlgoAPI_Tools::BOOL_PARTITION)
273     aBoolAlgo.reset(new GeomAlgoAPI_Partition(aUsedInOperationSolids, aToolsWithPlanes));
274   else
275     aBoolAlgo.reset(new GeomAlgoAPI_Boolean(aUsedInOperationSolids,
276                                             aToolsWithPlanes,
277                                             theBooleanType));
278
279   // Checking that the algorithm worked properly.
280   std::string anError;
281   if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aBoolAlgo, getKind(), anError)) {
282     setError(anError);
283     return false;
284   }
285
286   aMakeShapeList->appendAlgo(aBoolAlgo);
287   GeomShapePtr aResultShape = aBoolAlgo->shape();
288
289   // Add result to not used solids from compsolid.
290   if (!aNotUsedSolids.empty()) {
291     ListOfShape aShapesToAdd = aNotUsedSolids;
292     aShapesToAdd.push_back(aBoolAlgo->shape());
293     std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
294         new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
295     if (!aFillerAlgo->isDone()) {
296       std::string aFeatureError = "Error: PaveFiller algorithm failed.";
297       setError(aFeatureError);
298       return false;
299     }
300
301     aMakeShapeList->appendAlgo(aFillerAlgo);
302     aResultShape = aFillerAlgo->shape();
303   }
304
305   GeomAPI_ShapeIterator aShapeIt(aResultShape);
306   if (aShapeIt.more() || aResultShape->shapeType() == GeomAPI_Shape::VERTEX)
307   {
308     std::shared_ptr<ModelAPI_ResultBody> aResultBody =
309         document()->createBody(data(), theResultIndex);
310
311     ListOfShape aCompSolidList;
312     aCompSolidList.push_back(theCompsolid);
313     // tools should be added to the list to fulfill the correct history of modification
314     aCompSolidList.insert(aCompSolidList.end(), theTools.begin(), theTools.end());
315
316     ListOfShape aUsedTools = theTools;
317     aUsedTools.insert(aUsedTools.end(), thePlanes.begin(), thePlanes.end());
318
319     FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
320                                              aCompSolidList,
321                                              aUsedTools,
322                                              aMakeShapeList,
323                                              aResultShape);
324     setResult(aResultBody, theResultIndex);
325     ++theResultIndex;
326
327     FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
328     aRBA.resultBody = aResultBody;
329     aRBA.baseShape = theCompsolid;
330     aRBA.makeShape = aMakeShapeList;
331     theResultBaseAlgoList.push_back(aRBA);
332     theResultShapesList.push_back(aResultShape);
333   }
334   return true;
335 }
336
337 //=================================================================================================
338 bool FeaturesPlugin_Boolean::processCompound(
339     const GeomAlgoAPI_Tools::BOPType theBooleanType,
340     const ObjectHierarchy& theCompoundHierarchy,
341     const GeomShapePtr& theCompound,
342     const ListOfShape& theTools,
343     int& theResultIndex,
344     std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
345     ListOfShape& theResultShapesList)
346 {
347   ListOfShape aUsedInOperationShapes;
348   ListOfShape aNotUsedShapes;
349   theCompoundHierarchy.SplitCompound(theCompound, aUsedInOperationShapes, aNotUsedShapes);
350
351   std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
352   std::shared_ptr<GeomAlgoAPI_Boolean> aBoolAlgo(
353       new GeomAlgoAPI_Boolean(aUsedInOperationShapes,
354                               theTools,
355                               theBooleanType));
356
357   // Checking that the algorithm worked properly.
358   std::string anError;
359   if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aBoolAlgo, getKind(), anError)) {
360     setError(anError);
361     return false;
362   }
363
364   aMakeShapeList->appendAlgo(aBoolAlgo);
365   GeomShapePtr aResultShape = aBoolAlgo->shape();
366
367   // Add result to not used shape from compound.
368   if (!aNotUsedShapes.empty()) {
369     ListOfShape aShapesForResult = aNotUsedShapes;
370     if (aResultShape->shapeType() == GeomAPI_Shape::COMPOUND) {
371       for (GeomAPI_ShapeIterator aResultIt(aResultShape); aResultIt.more(); aResultIt.next()) {
372         aShapesForResult.push_back(aResultIt.current());
373       }
374     }
375     else {
376       aShapesForResult.push_back(aResultShape);
377     }
378
379     if (aShapesForResult.size() == 1) {
380       aResultShape = aShapesForResult.front();
381     }
382     else {
383       aResultShape = GeomAlgoAPI_CompoundBuilder::compound(aShapesForResult);
384     }
385   }
386
387   GeomAPI_ShapeIterator aShapeIt(aResultShape);
388   if (aShapeIt.more() || aResultShape->shapeType() == GeomAPI_Shape::VERTEX) {
389     std::shared_ptr<ModelAPI_ResultBody> aResultBody =
390         document()->createBody(data(), theResultIndex);
391
392     ListOfShape aCompoundList;
393     aCompoundList.push_back(theCompound);
394     FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
395                                              aCompoundList,
396                                              theTools,
397                                              aMakeShapeList,
398                                              aResultShape);
399     setResult(aResultBody, theResultIndex);
400     ++theResultIndex;
401
402     FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
403     aRBA.resultBody = aResultBody;
404     aRBA.baseShape = theCompound;
405     aRBA.makeShape = aMakeShapeList;
406     theResultBaseAlgoList.push_back(aRBA);
407     theResultShapesList.push_back(aResultShape);
408   }
409   return true;
410 }
411
412 //=================================================================================================
413
414 void FeaturesPlugin_Boolean::ObjectHierarchy::AddObject(const GeomShapePtr& theObject)
415 {
416   myObjects.push_back(theObject);
417 }
418
419 void FeaturesPlugin_Boolean::ObjectHierarchy::AddParent(const GeomShapePtr& theShape,
420                                                         const GeomShapePtr& theParent)
421 {
422   myParent[theShape] = theParent;
423   mySubshapes[theParent].push_back(theShape);
424 }
425
426 GeomShapePtr FeaturesPlugin_Boolean::ObjectHierarchy::Parent(const GeomShapePtr& theShape,
427                                                              bool theMarkProcessed)
428 {
429   MapShapeToParent::const_iterator aFound = myParent.find(theShape);
430   GeomShapePtr aParent;
431   if (aFound != myParent.end()) {
432     aParent = aFound->second;
433     if (theMarkProcessed) {
434       // mark the parent and all its subs as processed by Boolean algorithm
435       myProcessedObjects.insert(aParent);
436       const ListOfShape& aSubs = mySubshapes[aParent];
437       for (ListOfShape::const_iterator anIt = aSubs.begin(); anIt != aSubs.end(); ++anIt)
438         myProcessedObjects.insert(*anIt);
439     }
440   }
441   return aParent;
442 }
443
444 void FeaturesPlugin_Boolean::ObjectHierarchy::ObjectsByType(
445     ListOfShape& theShapesByType,
446     ListOfShape& theOtherShapes,
447     const GeomAPI_Shape::ShapeType theMinType,
448     const GeomAPI_Shape::ShapeType theMaxType) const
449 {
450   if (theMinType > theMaxType)
451     return ObjectsByType(theShapesByType, theOtherShapes, theMaxType, theMinType);
452
453   // no need to select objects if whole range is specified
454   if (theMinType == GeomAPI_Shape::COMPOUND && theMaxType == GeomAPI_Shape::SHAPE) {
455     theShapesByType.insert(theShapesByType.end(), myObjects.begin(), myObjects.end());
456     return;
457   }
458
459   for (ListOfShape::const_iterator anIt = myObjects.begin(); anIt != myObjects.end(); ++anIt) {
460     GeomAPI_Shape::ShapeType aType = (*anIt)->shapeType();
461     if (aType >= theMinType && aType <= theMaxType)
462       theShapesByType.push_back(*anIt);
463     else
464       theOtherShapes.push_back(*anIt);
465   }
466 }
467
468
469 void FeaturesPlugin_Boolean::ObjectHierarchy::SplitCompound(const GeomShapePtr& theCompShape,
470                                                             ListOfShape& theUsed,
471                                                             ListOfShape& theNotUsed) const
472 {
473   theUsed.clear();
474   theNotUsed.clear();
475
476   const ListOfShape& aSubs = mySubshapes.find(theCompShape)->second;
477   SetOfShape aSubsSet;
478   aSubsSet.insert(aSubs.begin(), aSubs.end());
479
480   for (GeomAPI_ShapeExplorer anExp(theCompShape, GeomAPI_Shape::SOLID);
481        anExp.more(); anExp.next()) {
482     GeomShapePtr aCurrent = anExp.current();
483     if (aSubsSet.find(aCurrent) == aSubsSet.end())
484       theNotUsed.push_back(aCurrent);
485     else
486       theUsed.push_back(aCurrent);
487   }
488 }
489
490 bool FeaturesPlugin_Boolean::ObjectHierarchy::IsEmpty() const
491 {
492   return myObjects.empty();
493 }
494
495 FeaturesPlugin_Boolean::ObjectHierarchy::Iterator FeaturesPlugin_Boolean::ObjectHierarchy::Begin()
496 {
497   return Iterator(this);
498 }
499
500 FeaturesPlugin_Boolean::ObjectHierarchy::Iterator FeaturesPlugin_Boolean::ObjectHierarchy::End()
501 {
502   return Iterator(this, false);
503 }
504
505 FeaturesPlugin_Boolean::ObjectHierarchy::Iterator::Iterator(
506     FeaturesPlugin_Boolean::ObjectHierarchy* theHierarchy, bool isBegin)
507   : myHierarchy(theHierarchy)
508 {
509   if (isBegin) {
510     myObject = myHierarchy->myObjects.begin();
511     SkipAlreadyProcessed();
512   } else
513     myObject = myHierarchy->myObjects.end();
514 }
515
516 void FeaturesPlugin_Boolean::ObjectHierarchy::Iterator::SkipAlreadyProcessed()
517 {
518   while (myObject != myHierarchy->myObjects.end() &&
519          myHierarchy->myProcessedObjects.find(*myObject) != myHierarchy->myProcessedObjects.end())
520     ++myObject;
521 }
522
523 bool FeaturesPlugin_Boolean::ObjectHierarchy::Iterator::operator==(const Iterator& theOther) const
524 {
525   return myObject == theOther.myObject;
526 }
527
528 bool FeaturesPlugin_Boolean::ObjectHierarchy::Iterator::operator!=(const Iterator& theOther) const
529 {
530   return !operator==(theOther);
531 }
532
533 FeaturesPlugin_Boolean::ObjectHierarchy::Iterator&
534 FeaturesPlugin_Boolean::ObjectHierarchy::Iterator::operator++()
535 {
536   ++myObject;
537   SkipAlreadyProcessed();
538   return *this;
539 }
540
541 FeaturesPlugin_Boolean::ObjectHierarchy::Iterator
542 FeaturesPlugin_Boolean::ObjectHierarchy::Iterator::operator++(int)
543 {
544   Iterator aCurrent;
545   aCurrent.myHierarchy = myHierarchy;
546   aCurrent.myObject = myObject;
547
548   // increase iterator
549   operator++();
550
551   return aCurrent;
552 }
553
554 GeomShapePtr FeaturesPlugin_Boolean::ObjectHierarchy::Iterator::operator*() const
555 {
556   myHierarchy->myProcessedObjects.insert(*myObject);
557   return *myObject;
558 }