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 under
10 // the terms of the GNU Lesser General Public License 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>
21 #include <NCollection_UBTreeFiller.hxx>
23 #include <Bnd_Box.hxx>
24 #include <TopAbs_State.hxx>
27 #include <TopoDS_Iterator.hxx>
28 #include <TopoDS_Solid.hxx>
29 #include <TopoDS_Shape.hxx>
30 #include <TopoDS_Face.hxx>
31 #include <TopoDS_Edge.hxx>
32 #include <TopoDS_Solid.hxx>
33 #include <TopoDS_Iterator.hxx>
34 #include <TopoDS_Shell.hxx>
35 #include <TopoDS_Compound.hxx>
38 #include <TopExp_Explorer.hxx>
40 #include <BRep_Builder.hxx>
41 #include <BRepTools.hxx>
42 #include <BRepClass3d_SolidClassifier.hxx>
43 #include <BRepBndLib.hxx>
45 #include <BOPCol_IndexedMapOfShape.hxx>
46 #include <BOPCol_MapOfShape.hxx>
47 #include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
48 #include <BOPCol_ListOfShape.hxx>
49 #include <BOPCol_BoxBndTree.hxx>
50 #include <BOPCol_ListOfInteger.hxx>
51 #include <BOPCol_DataMapOfIntegerShape.hxx>
53 #include <BOPInt_Context.hxx>
55 #include <BOPDS_DS.hxx>
56 #include <BOPDS_ShapeInfo.hxx>
58 #include <BOPTools.hxx>
59 #include <BOPTools_AlgoTools.hxx>
60 #include <BOPTools_MapOfSet.hxx>
61 #include <BOPTools_Set.hxx>
63 #include <BOPAlgo_BuilderSolid.hxx>
64 #include <BOPAlgo_Builder_2Cnt.hxx>
68 void OwnInternalShapes(const TopoDS_Shape& ,
69 BOPCol_IndexedMapOfShape& );
72 void TreatCompound(const TopoDS_Shape& theS,
73 BOPCol_MapOfShape& aMFence,
74 BOPCol_ListOfShape& theLS);
76 //=======================================================================
77 //class : BOPAlgo_ShapeBox
78 //purpose : Auxiliary class
79 //=======================================================================
80 class BOPAlgo_ShapeBox {
88 void SetShape(const TopoDS_Shape& aS) {
92 const TopoDS_Shape& Shape()const {
96 void SetBox(const Bnd_Box& aBox) {
100 const Bnd_Box& Box()const {
105 TopoDS_Shape myShape;
109 typedef NCollection_DataMap\
110 <Standard_Integer, BOPAlgo_ShapeBox, TColStd_MapIntegerHasher> \
111 BOPAlgo_DataMapOfIntegerShapeBox;
113 typedef BOPAlgo_DataMapOfIntegerShapeBox::Iterator \
114 BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox;
117 //=======================================================================
118 //function : FillImagesSolids
120 //=======================================================================
121 void BOPAlgo_Builder::FillImagesSolids()
123 Standard_Boolean bHasSolids;
124 Standard_Integer i, aNbS;
128 bHasSolids=Standard_False;
129 aNbS=myDS->NbSourceShapes();
130 for (i=0; i<aNbS; ++i) {
131 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
132 if (aSI.ShapeType()==TopAbs_SOLID) {
133 bHasSolids=!bHasSolids;
142 Handle(NCollection_IncAllocator) aAlr;
144 aAlr=new NCollection_IncAllocator();
145 BOPCol_DataMapOfShapeListOfShape theInParts(100, aAlr);
146 BOPCol_DataMapOfShapeShape theDraftSolids(100, aAlr);
148 FillIn3DParts(theInParts, theDraftSolids, aAlr);
149 BuildSplitSolids(theInParts, theDraftSolids, aAlr);
150 FillInternalShapes();
153 theDraftSolids.Clear();
155 //=======================================================================
156 //function : FillIn3DParts
158 //=======================================================================
159 void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts,
160 BOPCol_DataMapOfShapeShape& theDraftSolids,
161 const BOPCol_BaseAllocator& )
163 Standard_Boolean bHasImage;
164 Standard_Integer i, k, aNbS, aNbLIF, nFP, aNbFP, aNbFIN, iIsIN;
168 BOPCol_ListIteratorOfListOfInteger aItLI, aItLI1;
169 BOPCol_ListIteratorOfListOfShape aItLS;
170 BOPAlgo_ShapeBox aSB;
171 Handle(NCollection_IncAllocator) aAlr0;
173 aAlr0=new NCollection_IncAllocator();
174 BOPAlgo_DataMapOfIntegerShapeBox aDMISB(100, aAlr0);
175 BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox aItDMISB;
178 theDraftSolids.Clear();
180 // 1. aDMISB map Index/FaceBox
182 aNbS=myDS->NbSourceShapes();
183 for (i=0; i<aNbS; ++i) {
184 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
185 if (aSI.ShapeType()!=TopAbs_FACE) {
189 const TopoDS_Shape& aS=aSI.Shape();
191 if (myImages.IsBound(aS)) {
192 const BOPCol_ListOfShape& aLS=myImages.Find(aS);
193 aItLS.Initialize(aLS);
194 for (; aItLS.More(); aItLS.Next()) {
195 const TopoDS_Shape& aSx=aItLS.Value();
198 BRepBndLib::Add(aSx, aBox);
208 const Bnd_Box& aBox=aSI.Box();
216 }//for (i=0; i<aNbS; ++i) {
218 // 1.2. Prepare TreeFiller
219 BOPCol_BoxBndTree aBBTree;
220 NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
222 aItDMISB.Initialize(aDMISB);
223 for (; aItDMISB.More(); aItDMISB.Next()) {
225 const BOPAlgo_ShapeBox& aSBk=aItDMISB.Value();
226 const Bnd_Box& aBk=aSBk.Box();
228 aTreeFiller.Add(k, aBk);
231 // 1.3. Shake TreeFiller
234 //---------------------------------------------
236 for (i=0; i<aNbS; ++i) {
237 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
238 if (aSI.ShapeType()!=TopAbs_SOLID) {
242 //---------------------------------------------
243 Handle(NCollection_IncAllocator) aAlr1;
245 aAlr1=new NCollection_IncAllocator();
247 BOPCol_ListOfShape aLFIN(aAlr1);
248 BOPCol_ListOfShape aLIF(aAlr1);
249 BOPCol_IndexedMapOfShape aMF(100, aAlr1);
250 BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, aAlr1);
251 BOPCol_BoxBndTreeSelector aSelector;
254 const TopoDS_Shape& aS=aSI.Shape();
255 const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aS));
257 // 2.0 Flag bHasImage
258 bHasImage=Standard_False;
260 for (; aIt.More(); aIt.Next()) {
261 const TopoDS_Shape& aShell=aIt.Value();
262 bHasImage=myImages.IsBound(aShell);
268 // 2.1 Bounding box for the solid aS [ aBoxS ]
272 // 2.2 Build Draft Solid [aSD]
275 BuildDraftSolid(aSolid, aSD, aLIF);
276 aNbLIF=aLIF.Extent();
278 BOPTools::MapShapesAndAncestors(aSD, TopAbs_EDGE, TopAbs_FACE, aMEF);
280 // 2.3 Faces from aSD and own internal faces => aMF
281 BOPTools::MapShapes(aSD, TopAbs_FACE, aMF);
283 aItLS.Initialize(aLIF);
284 for (; aItLS.More(); aItLS.Next()) {
285 const TopoDS_Shape& aFI=aItLS.Value();
289 // 2.4. Select boxes of faces that are not out of aBoxS
291 aSelector.SetBox(aBoxS);
293 aNbFP=aBBTree.Select(aSelector);
295 const BOPCol_ListOfInteger& aLIFP=aSelector.Indices();
297 // 2.5. Collect faces that are IN aSolid [ aLFIN ]
298 BOPCol_ListOfShape aLFP(aAlr1);
299 BOPCol_ListOfShape aLCBF(aAlr1);
300 BOPCol_MapOfShape aMFDone(100, aAlr1);
301 BOPCol_IndexedMapOfShape aME(100, aAlr1);
303 BOPTools::MapShapes(aSD, TopAbs_EDGE, aME);
305 aItLI.Initialize(aLIFP);
306 for (; aItLI.More(); aItLI.Next()) {
308 const BOPAlgo_ShapeBox& aSBF=aDMISB.Find(nFP);
309 const TopoDS_Face& aFP=(*(TopoDS_Face*)&aSBF.Shape());
310 if (aMF.Contains(aFP)) {
313 if (aMFDone.Contains(aFP)) {
319 iIsIN=BOPTools_AlgoTools::IsInternalFace(aFP, aSD, aMEF, 1.e-14, myContext);
324 aItLI1.Initialize(aLIFP);
325 for (; aItLI1.More(); aItLI1.Next()) {
326 const TopoDS_Shape& aFx=aDMISB.Find(aItLI1.Value()).Shape();
327 if (!aMFDone.Contains(aFx)) {
333 //----------------------------------------
335 Handle(NCollection_IncAllocator) aAlr2;
336 aAlr2=new NCollection_IncAllocator();
338 BOPTools_AlgoTools::MakeConnexityBlock(aLFP, aME, aLCBF, aAlr2);
340 //----------------------------------------
341 aItLS.Initialize(aLCBF);
342 for (; aItLS.More(); aItLS.Next()) {
343 const TopoDS_Shape& aFx=aItLS.Value();
349 }// for (; aItLI.More(); aItLI.Next()) {
351 // 2.6. Store the results in theInParts, theDraftSolids
352 aNbFIN=aLFIN.Extent();
353 if (aNbFIN || aNbLIF) {
354 aItLS.Initialize(aLIF);
355 for (; aItLS.More(); aItLS.Next()) {
356 const TopoDS_Shape& aFI=aItLS.Value();
359 theInParts.Bind(aSolid, aLFIN);
362 if (aNbFIN || bHasImage) {
363 theDraftSolids.Bind(aSolid, aSD);
365 //---------------------------------------------
366 }// for (i=0; i<aNbS; ++i) {
369 //=======================================================================
370 //function : BuildDraftSolid
372 //=======================================================================
373 void BOPAlgo_Builder::BuildDraftSolid(const TopoDS_Shape& theSolid,
374 TopoDS_Shape& theDraftSolid,
375 BOPCol_ListOfShape& theLIF)
379 Standard_Boolean bToReverse;
380 Standard_Integer iFlag;
381 TopAbs_Orientation aOrF, aOrSh, aOrSd;
382 TopoDS_Iterator aIt1, aIt2;
384 TopoDS_Shape aFSDx, aFx;
386 BOPCol_ListIteratorOfListOfShape aItS;
388 aOrSd=theSolid.Orientation();
389 theDraftSolid.Orientation(aOrSd);
391 aIt1.Initialize(theSolid);
392 for (; aIt1.More(); aIt1.Next()) {
393 const TopoDS_Shape& aSh=aIt1.Value();
394 if(aSh.ShapeType()!=TopAbs_SHELL) {
395 continue; // mb internal edges,vertices
398 aOrSh=aSh.Orientation();
400 aShD.Orientation(aOrSh);
403 aIt2.Initialize(aSh);
404 for (; aIt2.More(); aIt2.Next()) {
405 const TopoDS_Shape& aF=aIt2.Value();
406 aOrF=aF.Orientation();
408 if (myImages.IsBound(aF)) {
409 const BOPCol_ListOfShape& aLSp=myImages.Find(aF);
410 aItS.Initialize(aLSp);
411 for (; aItS.More(); aItS.Next()) {
414 if (myShapesSD.IsBound(aFx)) {
415 aFSDx=myShapesSD.Find(aFx);
417 if (aOrF==TopAbs_INTERNAL) {
418 aFSDx.Orientation(aOrF);
419 theLIF.Append(aFSDx);
422 bToReverse=BOPTools_AlgoTools::IsSplitToReverse(aFSDx, aF, myContext);
428 aBB.Add(aShD, aFSDx);
430 }//if (myShapesSD.IsBound(aFx)) {
432 aFx.Orientation(aOrF);
433 if (aOrF==TopAbs_INTERNAL) {
442 } // if (myImages.IsBound(aF)) {
445 if (aOrF==TopAbs_INTERNAL) {
453 } //for (; aIt2.More(); aIt2.Next()) {
456 aBB.Add(theDraftSolid, aShD);
458 } //for (; aIt1.More(); aIt1.Next()) {
460 //=======================================================================
461 //function : BuildSplitSolids
463 //=======================================================================
464 void BOPAlgo_Builder::BuildSplitSolids(BOPCol_DataMapOfShapeListOfShape& theInParts,
465 BOPCol_DataMapOfShapeShape& theDraftSolids,
466 const BOPCol_BaseAllocator& )
470 Standard_Boolean bFlagSD;
471 Standard_Integer i, aNbS;
472 TopExp_Explorer aExp;
473 BOPCol_ListIteratorOfListOfShape aIt;
474 BOPCol_DataMapIteratorOfDataMapOfShapeShape aIt1;
476 Handle(NCollection_IncAllocator) aAlr0;
477 aAlr0=new NCollection_IncAllocator();
479 BOPCol_ListOfShape aSFS(aAlr0), aLSEmpty(aAlr0);
480 BOPCol_MapOfShape aMFence(100, aAlr0);
481 BOPTools_MapOfSet aMST(100, aAlr0);
482 BOPAlgo_VectorOfBuilderSolid aVBS;
484 // 0. Find same domain solids for non-interferred solids
485 aNbS=myDS->NbSourceShapes();
486 for (i=0; i<aNbS; ++i) {
487 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
489 if (aSI.ShapeType()!=TopAbs_SOLID) {
493 const TopoDS_Shape& aS=aSI.Shape();
494 if (!aMFence.Add(aS)) {
497 if(theDraftSolids.IsBound(aS)) {
503 aST.Add(aS, TopAbs_FACE);
506 } //for (i=1; i<=aNbS; ++i)
508 // 1. Build solids for interferred source solids
509 for (i=0; i<aNbS; ++i) {
510 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
512 if (aSI.ShapeType()!=TopAbs_SOLID) {
516 const TopoDS_Shape& aS=aSI.Shape();
517 const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aS));
518 if(!theDraftSolids.IsBound(aS)) {
521 const TopoDS_Shape& aSD=theDraftSolids.Find(aS);
522 const BOPCol_ListOfShape& aLFIN=
523 (theInParts.IsBound(aS)) ? theInParts.Find(aS) : aLSEmpty;
525 // 1.1 Fill Shell Faces Set
527 aExp.Init(aSD, TopAbs_FACE);
528 for (; aExp.More(); aExp.Next()) {
529 const TopoDS_Shape& aF=aExp.Current();
533 aIt.Initialize(aLFIN);
534 for (; aIt.More(); aIt.Next()) {
535 TopoDS_Shape aF=aIt.Value();
537 aF.Orientation(TopAbs_FORWARD);
539 aF.Orientation(TopAbs_REVERSED);
543 // 1.3 Build new solids
544 Handle(NCollection_IncAllocator) aAlr1;
545 aAlr1=new NCollection_IncAllocator();
547 BOPAlgo_BuilderSolid& aBS=aVBS.Append1();
548 aBS.SetSolid(aSolid);
550 }//for (i=0; i<aNbS; ++i) {
552 Standard_Integer k, aNbBS;
556 //===================================================
557 BOPAlgo_BuilderSolidCnt::Perform(myRunParallel, aVBS);
558 //===================================================
560 for (k=0; k<aNbBS; ++k) {
561 BOPAlgo_BuilderSolid& aBS=aVBS(k);
562 const TopoDS_Solid& aS=aBS.Solid();
563 const BOPCol_ListOfShape& aLSR=aBS.Areas();
565 if (!myImages.IsBound(aS)) {
566 BOPCol_ListOfShape aLSx;
568 myImages.Bind(aS, aLSx);
569 BOPCol_ListOfShape& aLSIm=myImages.ChangeFind(aS);
571 aIt.Initialize(aLSR);
572 for (; aIt.More(); aIt.Next()) {
575 const TopoDS_Shape& aSR=aIt.Value();
576 aST.Add(aSR, TopAbs_FACE);
578 bFlagSD=aMST.Contains(aST);
580 const BOPTools_Set& aSTx=aMST.Added(aST);
581 const TopoDS_Shape& aSx=aSTx.Shape();
585 myShapesSD.Bind(aSR, aSx);
591 //=======================================================================
592 //function :FillInternalShapes
594 //=======================================================================
595 void BOPAlgo_Builder::FillInternalShapes()
599 Standard_Integer i, j, aNbS, aNbSI, aNbSx;
600 TopAbs_ShapeEnum aType;
602 TopoDS_Iterator aItS;
604 BOPCol_MapIteratorOfMapOfShape aItM;
605 BOPCol_ListIteratorOfListOfShape aIt, aIt1;
607 Handle(NCollection_IncAllocator) aAllocator;
608 //-----------------------------------------------------scope f
609 aAllocator=new NCollection_IncAllocator();
611 BOPCol_IndexedDataMapOfShapeListOfShape aMSx(100, aAllocator);
612 BOPCol_IndexedMapOfShape aMx(100, aAllocator);
613 BOPCol_MapOfShape aMSI(100, aAllocator);
614 BOPCol_MapOfShape aMFence(100, aAllocator);
615 BOPCol_MapOfShape aMSOr(100, aAllocator);
616 BOPCol_ListOfShape aLSd(aAllocator);
617 BOPCol_ListOfShape aLArgs(aAllocator);
618 BOPCol_ListOfShape aLSC(aAllocator);
620 // 1. Shapes to process
622 // 1.1 Shapes from pure arguments aMSI
623 // 1.1.1 vertex, edge, wire
625 aIt.Initialize(myArguments);
626 for (; aIt.More(); aIt.Next()) {
627 const TopoDS_Shape& aS=aIt.Value();
628 TreatCompound(aS, aMFence, aLSC);
630 aIt.Initialize(aLSC);
631 for (; aIt.More(); aIt.Next()) {
632 const TopoDS_Shape& aS=aIt.Value();
633 aType=aS.ShapeType();
634 if (aType==TopAbs_WIRE) {
636 for(; aItS.More(); aItS.Next()) {
637 const TopoDS_Shape& aE=aItS.Value();
638 if (aMFence.Add(aE)) {
643 else if (aType==TopAbs_VERTEX || aType==TopAbs_EDGE){
649 aIt.Initialize(aLArgs);
650 for (; aIt.More(); aIt.Next()) {
651 const TopoDS_Shape& aS=aIt.Value();
652 aType=aS.ShapeType();
653 if (aType==TopAbs_VERTEX || aType==TopAbs_EDGE ||aType==TopAbs_WIRE) {
654 if (aMFence.Add(aS)) {
655 if (myImages.IsBound(aS)) {
656 const BOPCol_ListOfShape &aLSp=myImages.Find(aS);
657 aIt1.Initialize(aLSp);
658 for (; aIt1.More(); aIt1.Next()) {
659 const TopoDS_Shape& aSp=aIt1.Value();
672 // 2. Internal vertices, edges from source solids
676 aNbS=myDS->NbSourceShapes();
677 for (i=0; i<aNbS; ++i) {
678 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
680 if (aSI.ShapeType()!=TopAbs_SOLID) {
684 const TopoDS_Shape& aS=aSI.Shape();
687 OwnInternalShapes(aS, aMx);
690 for (j=1; j<=aNbSx; ++j) {
691 const TopoDS_Shape& aSi=aMx(j);
692 if (myImages.IsBound(aSi)) {
693 const BOPCol_ListOfShape &aLSp=myImages.Find(aSi);
694 aIt1.Initialize(aLSp);
695 for (; aIt1.More(); aIt1.Next()) {
696 const TopoDS_Shape& aSp=aIt1.Value();
705 // build aux map from splits of solids
706 if (myImages.IsBound(aS)) {
707 const BOPCol_ListOfShape &aLSp=myImages.Find(aS);
708 aIt.Initialize(aLSp);
709 for (; aIt.More(); aIt.Next()) {
710 const TopoDS_Shape& aSp=aIt.Value();
711 if (aMFence.Add(aSp)) {
712 BOPTools::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
713 BOPTools::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_FACE, aMSx);
714 BOPTools::MapShapesAndAncestors(aSp, TopAbs_EDGE , TopAbs_FACE, aMSx);
720 if (aMFence.Add(aS)) {
721 BOPTools::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
722 BOPTools::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_FACE, aMSx);
723 BOPTools::MapShapesAndAncestors(aS, TopAbs_EDGE , TopAbs_FACE, aMSx);
728 }// for (i=0; i<aNbS; ++i) {
730 // 3. Some shapes of aMSI can be already tied with faces of
732 aItM.Initialize(aMSI);
733 for (; aItM.More(); aItM.Next()) {
734 const TopoDS_Shape& aSI=aItM.Key();
735 if (aMSx.Contains(aSI)) {
736 const BOPCol_ListOfShape &aLSx=aMSx.FindFromKey(aSI);
750 // 5 Settle internal vertices and edges into solids
752 aIt.Initialize(aLSd);
753 for (; aIt.More(); aIt.Next()) {
754 TopoDS_Solid aSd=TopoDS::Solid(aIt.Value());
756 aItM.Initialize(aMSI);
757 for (; aItM.More(); aItM.Next()) {
758 TopoDS_Shape aSI=aItM.Key();
759 aSI.Orientation(TopAbs_INTERNAL);
761 aState=BOPTools_AlgoTools::ComputeStateByOnePoint(aSI, aSd, 1.e-11, myContext);
762 if (aState==TopAbs_IN) {
764 if(aMSOr.Contains(aSd)) {
769 aItS.Initialize(aSd);
770 for (; aItS.More(); aItS.Next()) {
771 const TopoDS_Shape& aSh=aItS.Value();
777 if (myImages.IsBound(aSdx)) {
778 BOPCol_ListOfShape& aLS=myImages.ChangeFind(aSdx);
782 BOPCol_ListOfShape aLS;
784 myImages.Bind(aSd, aLS);
795 } //if (aState==TopAbs_IN) {
796 }// for (; aItM.More(); aItM.Next()) {
797 }//for (; aIt1.More(); aIt1.Next()) {
799 //-----------------------------------------------------scope t
808 //=======================================================================
809 //function : OwnInternalShapes
811 //=======================================================================
812 void OwnInternalShapes(const TopoDS_Shape& theS,
813 BOPCol_IndexedMapOfShape& theMx)
817 aIt.Initialize(theS);
818 for (; aIt.More(); aIt.Next()) {
819 const TopoDS_Shape& aSx=aIt.Value();
820 if (aSx.ShapeType()!=TopAbs_SHELL) {
825 //=======================================================================
826 //function : TreatCompound
828 //=======================================================================
829 void TreatCompound(const TopoDS_Shape& theS,
830 BOPCol_MapOfShape& aMFence,
831 BOPCol_ListOfShape& theLS)
833 TopAbs_ShapeEnum aType;
835 aType = theS.ShapeType();
836 if (aType != TopAbs_COMPOUND) {
837 if (aMFence.Add(theS)) {
845 aIt.Initialize(theS);
846 for (; aIt.More(); aIt.Next()) {
847 const TopoDS_Shape& aS = aIt.Value();
848 TreatCompound(aS, aMFence, theLS);
854 // 30 - SolidBuilder failed