1 // Created by: Peter KURNEV
2 // Copyright (c) 2010-2014 OPEN CASCADE SAS
3 // Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 // Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
5 // EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 // This file is part of Open CASCADE Technology software library.
9 // This library is free software; you can redistribute it and / or modify it
10 // under the terms of the GNU Lesser General Public version 2.1 as published
11 // by the Free Software Foundation, with special exception defined in the file
12 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
13 // distribution for complete text of the license and disclaimer of any warranty.
15 // Alternatively, this file may be used under the terms of Open CASCADE
16 // commercial license or contractual agreement.
18 #include <BOPAlgo_Builder.hxx>
20 #include <NCollection_IncAllocator.hxx>
22 #include <TopAbs_State.hxx>
25 #include <TopoDS_Iterator.hxx>
26 #include <TopoDS_Solid.hxx>
27 #include <TopoDS_Shape.hxx>
28 #include <TopoDS_Face.hxx>
29 #include <TopoDS_Edge.hxx>
30 #include <TopoDS_Solid.hxx>
31 #include <TopoDS_Iterator.hxx>
32 #include <TopoDS_Shell.hxx>
33 #include <TopoDS_Compound.hxx>
36 #include <TopExp_Explorer.hxx>
38 #include <BRep_Builder.hxx>
39 #include <BRepTools.hxx>
40 #include <BRepClass3d_SolidClassifier.hxx>
42 #include <BOPCol_IndexedMapOfShape.hxx>
43 #include <BOPCol_MapOfShape.hxx>
44 #include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
45 #include <BOPCol_ListOfShape.hxx>
47 #include <BOPDS_DS.hxx>
48 #include <BOPDS_ShapeInfo.hxx>
50 #include <BOPTools.hxx>
51 #include <BOPTools_AlgoTools.hxx>
53 #include <BOPTools_MapOfSet.hxx>
54 #include <BOPTools_Set.hxx>
56 #include <BOPAlgo_BuilderSolid.hxx>
58 #include <BOPCol_DataMapOfIntegerShape.hxx>
59 #include <Bnd_Box.hxx>
60 #include <BRepBndLib.hxx>
62 #include <NCollection_UBTreeFiller.hxx>
63 #include <BOPDS_BoxBndTree.hxx>
64 #include <BOPCol_ListOfInteger.hxx>
65 #include <BOPInt_Context.hxx>
66 #include <BOPAlgo_Builder_2Cnt.hxx>
70 void OwnInternalShapes(const TopoDS_Shape& ,
71 BOPCol_IndexedMapOfShape& );
74 void TreatCompound(const TopoDS_Shape& theS,
75 BOPCol_MapOfShape& aMFence,
76 BOPCol_ListOfShape& theLS);
78 //=======================================================================
79 //class : BOPAlgo_ShapeBox
80 //purpose : Auxiliary class
81 //=======================================================================
82 class BOPAlgo_ShapeBox {
90 void SetShape(const TopoDS_Shape& aS) {
94 const TopoDS_Shape& Shape()const {
98 void SetBox(const Bnd_Box& aBox) {
102 const Bnd_Box& Box()const {
107 TopoDS_Shape myShape;
111 typedef NCollection_DataMap\
112 <Standard_Integer, BOPAlgo_ShapeBox, TColStd_MapIntegerHasher> \
113 BOPAlgo_DataMapOfIntegerShapeBox;
115 typedef BOPAlgo_DataMapOfIntegerShapeBox::Iterator \
116 BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox;
119 //=======================================================================
120 //function : FillImagesSolids
122 //=======================================================================
123 void BOPAlgo_Builder::FillImagesSolids()
125 Standard_Boolean bHasSolids;
126 Standard_Integer i, aNbS;
130 bHasSolids=Standard_False;
131 aNbS=myDS->NbSourceShapes();
132 for (i=0; i<aNbS; ++i) {
133 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
134 if (aSI.ShapeType()==TopAbs_SOLID) {
135 bHasSolids=!bHasSolids;
144 Handle(NCollection_IncAllocator) aAlr;
146 aAlr=new NCollection_IncAllocator();
147 BOPCol_DataMapOfShapeListOfShape theInParts(100, aAlr);
148 BOPCol_DataMapOfShapeShape theDraftSolids(100, aAlr);
150 FillIn3DParts(theInParts, theDraftSolids, aAlr);
151 BuildSplitSolids(theInParts, theDraftSolids, aAlr);
152 FillInternalShapes();
155 theDraftSolids.Clear();
157 //=======================================================================
158 //function : FillIn3DParts
160 //=======================================================================
161 void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts,
162 BOPCol_DataMapOfShapeShape& theDraftSolids,
163 const BOPCol_BaseAllocator& )
165 Standard_Boolean bHasImage;
166 Standard_Integer i, k, aNbS, aNbLIF, nFP, aNbFP, aNbFIN, iIsIN;
170 BOPCol_ListIteratorOfListOfInteger aItLI, aItLI1;
171 BOPCol_ListIteratorOfListOfShape aItLS;
172 BOPAlgo_ShapeBox aSB;
173 Handle(NCollection_IncAllocator) aAlr0;
175 aAlr0=new NCollection_IncAllocator();
176 BOPAlgo_DataMapOfIntegerShapeBox aDMISB(100, aAlr0);
177 BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox aItDMISB;
180 theDraftSolids.Clear();
182 // 1. aDMISB map Index/FaceBox
184 aNbS=myDS->NbSourceShapes();
185 for (i=0; i<aNbS; ++i) {
186 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
187 if (aSI.ShapeType()!=TopAbs_FACE) {
191 const TopoDS_Shape& aS=aSI.Shape();
193 if (myImages.IsBound(aS)) {
194 const BOPCol_ListOfShape& aLS=myImages.Find(aS);
195 aItLS.Initialize(aLS);
196 for (; aItLS.More(); aItLS.Next()) {
197 const TopoDS_Shape& aSx=aItLS.Value();
200 BRepBndLib::Add(aSx, aBox);
210 const Bnd_Box& aBox=aSI.Box();
218 }//for (i=0; i<aNbS; ++i) {
220 // 1.2. Prepare TreeFiller
221 BOPDS_BoxBndTree aBBTree;
222 NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
224 aItDMISB.Initialize(aDMISB);
225 for (; aItDMISB.More(); aItDMISB.Next()) {
227 const BOPAlgo_ShapeBox& aSBk=aItDMISB.Value();
228 const Bnd_Box& aBk=aSBk.Box();
230 aTreeFiller.Add(k, aBk);
233 // 1.3. Shake TreeFiller
236 //---------------------------------------------
238 for (i=0; i<aNbS; ++i) {
239 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
240 if (aSI.ShapeType()!=TopAbs_SOLID) {
244 //---------------------------------------------
245 Handle(NCollection_IncAllocator) aAlr1;
247 aAlr1=new NCollection_IncAllocator();
249 BOPCol_ListOfShape aLFIN(aAlr1);
250 BOPCol_ListOfShape aLIF(aAlr1);
251 BOPCol_IndexedMapOfShape aMF(100, aAlr1);
252 BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, aAlr1);
253 BOPDS_BoxBndTreeSelector aSelector;
256 const TopoDS_Shape& aS=aSI.Shape();
257 const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aS));
259 // 2.0 Flag bHasImage
260 bHasImage=Standard_False;
262 for (; aIt.More(); aIt.Next()) {
263 const TopoDS_Shape& aShell=aIt.Value();
264 bHasImage=myImages.IsBound(aShell);
270 // 2.1 Bounding box for the solid aS [ aBoxS ]
274 // 2.2 Build Draft Solid [aSD]
277 BuildDraftSolid(aSolid, aSD, aLIF);
278 aNbLIF=aLIF.Extent();
280 BOPTools::MapShapesAndAncestors(aSD, TopAbs_EDGE, TopAbs_FACE, aMEF);
282 // 2.3 Faces from aSD and own internal faces => aMF
283 BOPTools::MapShapes(aSD, TopAbs_FACE, aMF);
285 aItLS.Initialize(aLIF);
286 for (; aItLS.More(); aItLS.Next()) {
287 const TopoDS_Shape& aFI=aItLS.Value();
291 // 2.4. Select boxes of faces that are not out of aBoxS
293 aSelector.SetBox(aBoxS);
295 aNbFP=aBBTree.Select(aSelector);
297 const BOPCol_ListOfInteger& aLIFP=aSelector.Indices();
299 // 2.5. Collect faces that are IN aSolid [ aLFIN ]
300 BOPCol_ListOfShape aLFP(aAlr1);
301 BOPCol_ListOfShape aLCBF(aAlr1);
302 BOPCol_MapOfShape aMFDone(100, aAlr1);
303 BOPCol_IndexedMapOfShape aME(100, aAlr1);
305 BOPTools::MapShapes(aSD, TopAbs_EDGE, aME);
307 aItLI.Initialize(aLIFP);
308 for (; aItLI.More(); aItLI.Next()) {
310 const BOPAlgo_ShapeBox& aSBF=aDMISB.Find(nFP);
311 const TopoDS_Face& aFP=(*(TopoDS_Face*)&aSBF.Shape());
312 if (aMF.Contains(aFP)) {
315 if (aMFDone.Contains(aFP)) {
321 iIsIN=BOPTools_AlgoTools::IsInternalFace(aFP, aSD, aMEF, 1.e-14, myContext);
326 aItLI1.Initialize(aLIFP);
327 for (; aItLI1.More(); aItLI1.Next()) {
328 const TopoDS_Shape& aFx=aDMISB.Find(aItLI1.Value()).Shape();
329 if (!aMFDone.Contains(aFx)) {
335 //----------------------------------------
337 Handle(NCollection_IncAllocator) aAlr2;
338 aAlr2=new NCollection_IncAllocator();
340 BOPTools_AlgoTools::MakeConnexityBlock(aLFP, aME, aLCBF, aAlr2);
342 //----------------------------------------
343 aItLS.Initialize(aLCBF);
344 for (; aItLS.More(); aItLS.Next()) {
345 const TopoDS_Shape& aFx=aItLS.Value();
351 }// for (; aItLI.More(); aItLI.Next()) {
353 // 2.6. Store the results in theInParts, theDraftSolids
354 aNbFIN=aLFIN.Extent();
355 if (aNbFIN || aNbLIF) {
356 aItLS.Initialize(aLIF);
357 for (; aItLS.More(); aItLS.Next()) {
358 const TopoDS_Shape& aFI=aItLS.Value();
361 theInParts.Bind(aSolid, aLFIN);
364 if (aNbFIN || bHasImage) {
365 theDraftSolids.Bind(aSolid, aSD);
367 //---------------------------------------------
368 }// for (i=0; i<aNbS; ++i) {
371 //=======================================================================
372 //function : BuildDraftSolid
374 //=======================================================================
375 void BOPAlgo_Builder::BuildDraftSolid(const TopoDS_Shape& theSolid,
376 TopoDS_Shape& theDraftSolid,
377 BOPCol_ListOfShape& theLIF)
381 Standard_Boolean bToReverse;
382 Standard_Integer iFlag;
383 TopAbs_Orientation aOrF, aOrSh, aOrSd;
384 TopoDS_Iterator aIt1, aIt2;
386 TopoDS_Shape aFSDx, aFx;
388 BOPCol_ListIteratorOfListOfShape aItS;
390 aOrSd=theSolid.Orientation();
391 theDraftSolid.Orientation(aOrSd);
393 aIt1.Initialize(theSolid);
394 for (; aIt1.More(); aIt1.Next()) {
395 const TopoDS_Shape& aSh=aIt1.Value();
396 if(aSh.ShapeType()!=TopAbs_SHELL) {
397 continue; // mb internal edges,vertices
400 aOrSh=aSh.Orientation();
402 aShD.Orientation(aOrSh);
405 aIt2.Initialize(aSh);
406 for (; aIt2.More(); aIt2.Next()) {
407 const TopoDS_Shape& aF=aIt2.Value();
408 aOrF=aF.Orientation();
410 if (myImages.IsBound(aF)) {
411 const BOPCol_ListOfShape& aLSp=myImages.Find(aF);
412 aItS.Initialize(aLSp);
413 for (; aItS.More(); aItS.Next()) {
416 if (myShapesSD.IsBound(aFx)) {
417 aFSDx=myShapesSD.Find(aFx);
419 if (aOrF==TopAbs_INTERNAL) {
420 aFSDx.Orientation(aOrF);
421 theLIF.Append(aFSDx);
424 bToReverse=BOPTools_AlgoTools::IsSplitToReverse(aFSDx, aF, myContext);
430 aBB.Add(aShD, aFSDx);
432 }//if (myShapesSD.IsBound(aFx)) {
434 aFx.Orientation(aOrF);
435 if (aOrF==TopAbs_INTERNAL) {
444 } // if (myImages.IsBound(aF)) {
447 if (aOrF==TopAbs_INTERNAL) {
455 } //for (; aIt2.More(); aIt2.Next()) {
458 aBB.Add(theDraftSolid, aShD);
460 } //for (; aIt1.More(); aIt1.Next()) {
462 //=======================================================================
463 //function : BuildSplitSolids
465 //=======================================================================
466 void BOPAlgo_Builder::BuildSplitSolids(BOPCol_DataMapOfShapeListOfShape& theInParts,
467 BOPCol_DataMapOfShapeShape& theDraftSolids,
468 const BOPCol_BaseAllocator& )
472 Standard_Boolean bFlagSD;
473 Standard_Integer i, aNbS;
474 TopExp_Explorer aExp;
475 BOPCol_ListIteratorOfListOfShape aIt;
476 BOPCol_DataMapIteratorOfDataMapOfShapeShape aIt1;
478 Handle(NCollection_IncAllocator) aAlr0;
479 aAlr0=new NCollection_IncAllocator();
481 BOPCol_ListOfShape aSFS(aAlr0), aLSEmpty(aAlr0);
482 BOPCol_MapOfShape aMFence(100, aAlr0);
483 BOPTools_MapOfSet aMST(100, aAlr0);
484 BOPAlgo_VectorOfBuilderSolid aVBS;
486 // 0. Find same domain solids for non-interferred solids
487 aNbS=myDS->NbSourceShapes();
488 for (i=0; i<aNbS; ++i) {
489 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
491 if (aSI.ShapeType()!=TopAbs_SOLID) {
495 const TopoDS_Shape& aS=aSI.Shape();
496 if (!aMFence.Add(aS)) {
499 if(theDraftSolids.IsBound(aS)) {
505 aST.Add(aS, TopAbs_FACE);
508 } //for (i=1; i<=aNbS; ++i)
510 // 1. Build solids for interferred source solids
511 for (i=0; i<aNbS; ++i) {
512 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
514 if (aSI.ShapeType()!=TopAbs_SOLID) {
518 const TopoDS_Shape& aS=aSI.Shape();
519 const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aS));
520 if(!theDraftSolids.IsBound(aS)) {
523 const TopoDS_Shape& aSD=theDraftSolids.Find(aS);
524 const BOPCol_ListOfShape& aLFIN=
525 (theInParts.IsBound(aS)) ? theInParts.Find(aS) : aLSEmpty;
527 // 1.1 Fill Shell Faces Set
529 aExp.Init(aSD, TopAbs_FACE);
530 for (; aExp.More(); aExp.Next()) {
531 const TopoDS_Shape& aF=aExp.Current();
535 aIt.Initialize(aLFIN);
536 for (; aIt.More(); aIt.Next()) {
537 TopoDS_Shape aF=aIt.Value();
539 aF.Orientation(TopAbs_FORWARD);
541 aF.Orientation(TopAbs_REVERSED);
545 // 1.3 Build new solids
546 Handle(NCollection_IncAllocator) aAlr1;
547 aAlr1=new NCollection_IncAllocator();
549 BOPAlgo_BuilderSolid& aBS=aVBS.Append1();
550 aBS.SetSolid(aSolid);
552 }//for (i=0; i<aNbS; ++i) {
554 Standard_Integer k, aNbBS;
558 //===================================================
559 BOPAlgo_BuilderSolidCnt::Perform(myRunParallel, aVBS);
560 //===================================================
562 for (k=0; k<aNbBS; ++k) {
563 BOPAlgo_BuilderSolid& aBS=aVBS(k);
564 const TopoDS_Solid& aS=aBS.Solid();
565 const BOPCol_ListOfShape& aLSR=aBS.Areas();
567 if (!myImages.IsBound(aS)) {
568 BOPCol_ListOfShape aLSx;
570 myImages.Bind(aS, aLSx);
571 BOPCol_ListOfShape& aLSIm=myImages.ChangeFind(aS);
573 aIt.Initialize(aLSR);
574 for (; aIt.More(); aIt.Next()) {
577 const TopoDS_Shape& aSR=aIt.Value();
578 aST.Add(aSR, TopAbs_FACE);
580 bFlagSD=aMST.Contains(aST);
582 const BOPTools_Set& aSTx=aMST.Added(aST);
583 const TopoDS_Shape& aSx=aSTx.Shape();
587 myShapesSD.Bind(aSR, aSx);
593 //=======================================================================
594 //function :FillInternalShapes
596 //=======================================================================
597 void BOPAlgo_Builder::FillInternalShapes()
601 Standard_Integer i, j, aNbS, aNbSI, aNbSx;
602 TopAbs_ShapeEnum aType;
604 TopoDS_Iterator aItS;
606 BOPCol_MapIteratorOfMapOfShape aItM;
607 BOPCol_ListIteratorOfListOfShape aIt, aIt1;
609 Handle(NCollection_IncAllocator) aAllocator;
610 //-----------------------------------------------------scope f
611 aAllocator=new NCollection_IncAllocator();
613 BOPCol_IndexedDataMapOfShapeListOfShape aMSx(100, aAllocator);
614 BOPCol_IndexedMapOfShape aMx(100, aAllocator);
615 BOPCol_MapOfShape aMSI(100, aAllocator);
616 BOPCol_MapOfShape aMFence(100, aAllocator);
617 BOPCol_MapOfShape aMSOr(100, aAllocator);
618 BOPCol_ListOfShape aLSd(aAllocator);
619 BOPCol_ListOfShape aLArgs(aAllocator);
620 BOPCol_ListOfShape aLSC(aAllocator);
622 // 1. Shapes to process
624 // 1.1 Shapes from pure arguments aMSI
625 // 1.1.1 vertex, edge, wire
627 aIt.Initialize(myArguments);
628 for (; aIt.More(); aIt.Next()) {
629 const TopoDS_Shape& aS=aIt.Value();
630 TreatCompound(aS, aMFence, aLSC);
632 aIt.Initialize(aLSC);
633 for (; aIt.More(); aIt.Next()) {
634 const TopoDS_Shape& aS=aIt.Value();
635 aType=aS.ShapeType();
636 if (aType==TopAbs_WIRE) {
638 for(; aItS.More(); aItS.Next()) {
639 const TopoDS_Shape& aE=aItS.Value();
640 if (aMFence.Add(aE)) {
645 else if (aType==TopAbs_VERTEX || aType==TopAbs_EDGE){
651 aIt.Initialize(aLArgs);
652 for (; aIt.More(); aIt.Next()) {
653 const TopoDS_Shape& aS=aIt.Value();
654 aType=aS.ShapeType();
655 if (aType==TopAbs_VERTEX || aType==TopAbs_EDGE ||aType==TopAbs_WIRE) {
656 if (aMFence.Add(aS)) {
657 if (myImages.IsBound(aS)) {
658 const BOPCol_ListOfShape &aLSp=myImages.Find(aS);
659 aIt1.Initialize(aLSp);
660 for (; aIt1.More(); aIt1.Next()) {
661 const TopoDS_Shape& aSp=aIt1.Value();
674 // 2. Internal vertices, edges from source solids
678 aNbS=myDS->NbSourceShapes();
679 for (i=0; i<aNbS; ++i) {
680 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
682 if (aSI.ShapeType()!=TopAbs_SOLID) {
686 const TopoDS_Shape& aS=aSI.Shape();
689 OwnInternalShapes(aS, aMx);
692 for (j=1; j<=aNbSx; ++j) {
693 const TopoDS_Shape& aSi=aMx(j);
694 if (myImages.IsBound(aSi)) {
695 const BOPCol_ListOfShape &aLSp=myImages.Find(aSi);
696 aIt1.Initialize(aLSp);
697 for (; aIt1.More(); aIt1.Next()) {
698 const TopoDS_Shape& aSp=aIt1.Value();
707 // build aux map from splits of solids
708 if (myImages.IsBound(aS)) {
709 const BOPCol_ListOfShape &aLSp=myImages.Find(aS);
710 aIt.Initialize(aLSp);
711 for (; aIt.More(); aIt.Next()) {
712 const TopoDS_Shape& aSp=aIt.Value();
713 if (aMFence.Add(aSp)) {
714 BOPTools::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
715 BOPTools::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_FACE, aMSx);
716 BOPTools::MapShapesAndAncestors(aSp, TopAbs_EDGE , TopAbs_FACE, aMSx);
722 if (aMFence.Add(aS)) {
723 BOPTools::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
724 BOPTools::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_FACE, aMSx);
725 BOPTools::MapShapesAndAncestors(aS, TopAbs_EDGE , TopAbs_FACE, aMSx);
730 }// for (i=0; i<aNbS; ++i) {
732 // 3. Some shapes of aMSI can be already tied with faces of
734 aItM.Initialize(aMSI);
735 for (; aItM.More(); aItM.Next()) {
736 const TopoDS_Shape& aSI=aItM.Key();
737 if (aMSx.Contains(aSI)) {
738 const BOPCol_ListOfShape &aLSx=aMSx.FindFromKey(aSI);
752 // 5 Settle internal vertices and edges into solids
754 aIt.Initialize(aLSd);
755 for (; aIt.More(); aIt.Next()) {
756 TopoDS_Solid aSd=TopoDS::Solid(aIt.Value());
758 aItM.Initialize(aMSI);
759 for (; aItM.More(); aItM.Next()) {
760 TopoDS_Shape aSI=aItM.Key();
761 aSI.Orientation(TopAbs_INTERNAL);
763 aState=BOPTools_AlgoTools::ComputeStateByOnePoint(aSI, aSd, 1.e-11, myContext);
764 if (aState==TopAbs_IN) {
766 if(aMSOr.Contains(aSd)) {
771 aItS.Initialize(aSd);
772 for (; aItS.More(); aItS.Next()) {
773 const TopoDS_Shape& aSh=aItS.Value();
779 if (myImages.IsBound(aSdx)) {
780 BOPCol_ListOfShape& aLS=myImages.ChangeFind(aSdx);
784 BOPCol_ListOfShape aLS;
786 myImages.Bind(aSd, aLS);
797 } //if (aState==TopAbs_IN) {
798 }// for (; aItM.More(); aItM.Next()) {
799 }//for (; aIt1.More(); aIt1.Next()) {
801 //-----------------------------------------------------scope t
810 //=======================================================================
811 //function : OwnInternalShapes
813 //=======================================================================
814 void OwnInternalShapes(const TopoDS_Shape& theS,
815 BOPCol_IndexedMapOfShape& theMx)
819 aIt.Initialize(theS);
820 for (; aIt.More(); aIt.Next()) {
821 const TopoDS_Shape& aSx=aIt.Value();
822 if (aSx.ShapeType()!=TopAbs_SHELL) {
827 //=======================================================================
828 //function : TreatCompound
830 //=======================================================================
831 void TreatCompound(const TopoDS_Shape& theS,
832 BOPCol_MapOfShape& aMFence,
833 BOPCol_ListOfShape& theLS)
835 TopAbs_ShapeEnum aType;
837 aType = theS.ShapeType();
838 if (aType != TopAbs_COMPOUND) {
839 if (aMFence.Add(theS)) {
847 aIt.Initialize(theS);
848 for (; aIt.More(); aIt.Next()) {
849 const TopoDS_Shape& aS = aIt.Value();
850 TreatCompound(aS, aMFence, theLS);
856 // 30 - SolidBuilder failed