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>
52 #include <BOPCol_NCVector.hxx>
53 #include <BOPCol_TBB.hxx>
55 #include <BOPInt_Context.hxx>
57 #include <BOPDS_DS.hxx>
58 #include <BOPDS_ShapeInfo.hxx>
60 #include <BOPTools.hxx>
61 #include <BOPTools_AlgoTools.hxx>
62 #include <BOPTools_MapOfSet.hxx>
63 #include <BOPTools_Set.hxx>
65 #include <BOPAlgo_BuilderSolid.hxx>
69 void OwnInternalShapes(const TopoDS_Shape& ,
70 BOPCol_IndexedMapOfShape& );
73 void TreatCompound(const TopoDS_Shape& theS,
74 BOPCol_MapOfShape& aMFence,
75 BOPCol_ListOfShape& theLS);
77 //=======================================================================
78 // BOPAlgo_BuilderSolid
80 typedef BOPCol_NCVector
81 <BOPAlgo_BuilderSolid> BOPAlgo_VectorOfBuilderSolid;
83 typedef BOPCol_TBBFunctor
84 <BOPAlgo_BuilderSolid,
85 BOPAlgo_VectorOfBuilderSolid> BOPAlgo_BuilderSolidFunctor;
88 <BOPAlgo_BuilderSolidFunctor,
89 BOPAlgo_VectorOfBuilderSolid> BOPAlgo_BuilderSolidCnt;
91 //=======================================================================
92 //class : BOPAlgo_ShapeBox
93 //purpose : Auxiliary class
94 //=======================================================================
95 class BOPAlgo_ShapeBox {
100 ~BOPAlgo_ShapeBox() {
103 void SetShape(const TopoDS_Shape& aS) {
107 const TopoDS_Shape& Shape()const {
111 void SetBox(const Bnd_Box& aBox) {
115 const Bnd_Box& Box()const {
120 TopoDS_Shape myShape;
124 typedef NCollection_DataMap\
125 <Standard_Integer, BOPAlgo_ShapeBox, TColStd_MapIntegerHasher> \
126 BOPAlgo_DataMapOfIntegerShapeBox;
128 typedef BOPAlgo_DataMapOfIntegerShapeBox::Iterator \
129 BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox;
132 //=======================================================================
133 //function : FillImagesSolids
135 //=======================================================================
136 void BOPAlgo_Builder::FillImagesSolids()
138 Standard_Boolean bHasSolids;
139 Standard_Integer i, aNbS;
143 bHasSolids=Standard_False;
144 aNbS=myDS->NbSourceShapes();
145 for (i=0; i<aNbS; ++i) {
146 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
147 if (aSI.ShapeType()==TopAbs_SOLID) {
148 bHasSolids=!bHasSolids;
157 Handle(NCollection_IncAllocator) aAlr;
159 aAlr=new NCollection_IncAllocator();
160 BOPCol_DataMapOfShapeListOfShape theInParts(100, aAlr);
161 BOPCol_DataMapOfShapeShape theDraftSolids(100, aAlr);
163 FillIn3DParts(theInParts, theDraftSolids, aAlr);
164 BuildSplitSolids(theInParts, theDraftSolids, aAlr);
165 FillInternalShapes();
168 theDraftSolids.Clear();
170 //=======================================================================
171 //function : FillIn3DParts
173 //=======================================================================
174 void BOPAlgo_Builder::FillIn3DParts
175 (BOPCol_DataMapOfShapeListOfShape& theInParts,
176 BOPCol_DataMapOfShapeShape& theDraftSolids,
177 const BOPCol_BaseAllocator& )
179 Standard_Boolean bHasImage;
180 Standard_Integer i, k, aNbS, aNbLIF, nFP, aNbFP, aNbFIN, iIsIN;
184 BOPCol_ListIteratorOfListOfInteger aItLI, aItLI1;
185 BOPCol_ListIteratorOfListOfShape aItLS;
186 BOPAlgo_ShapeBox aSB;
187 Handle(NCollection_IncAllocator) aAlr0;
189 aAlr0=new NCollection_IncAllocator();
190 BOPAlgo_DataMapOfIntegerShapeBox aDMISB(100, aAlr0);
191 BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox aItDMISB;
194 theDraftSolids.Clear();
196 // 1. aDMISB map Index/FaceBox
198 aNbS=myDS->NbSourceShapes();
199 for (i=0; i<aNbS; ++i) {
200 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
201 if (aSI.ShapeType()!=TopAbs_FACE) {
205 const TopoDS_Shape& aS=aSI.Shape();
207 if (myImages.IsBound(aS)) {
208 const BOPCol_ListOfShape& aLS=myImages.Find(aS);
209 aItLS.Initialize(aLS);
210 for (; aItLS.More(); aItLS.Next()) {
211 const TopoDS_Shape& aSx=aItLS.Value();
214 BRepBndLib::Add(aSx, aBox);
224 const Bnd_Box& aBox=aSI.Box();
232 }//for (i=0; i<aNbS; ++i) {
234 // 1.2. Prepare TreeFiller
235 BOPCol_BoxBndTree aBBTree;
236 NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
238 aItDMISB.Initialize(aDMISB);
239 for (; aItDMISB.More(); aItDMISB.Next()) {
241 const BOPAlgo_ShapeBox& aSBk=aItDMISB.Value();
242 const Bnd_Box& aBk=aSBk.Box();
244 aTreeFiller.Add(k, aBk);
247 // 1.3. Shake TreeFiller
250 //---------------------------------------------
252 for (i=0; i<aNbS; ++i) {
253 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
254 if (aSI.ShapeType()!=TopAbs_SOLID) {
258 //---------------------------------------------
259 Handle(NCollection_IncAllocator) aAlr1;
261 aAlr1=new NCollection_IncAllocator();
263 BOPCol_ListOfShape aLFIN(aAlr1);
264 BOPCol_ListOfShape aLIF(aAlr1);
265 BOPCol_IndexedMapOfShape aMF(100, aAlr1);
266 BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, aAlr1);
267 BOPCol_BoxBndTreeSelector aSelector;
270 const TopoDS_Shape& aS=aSI.Shape();
271 const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aS));
273 // 2.0 Flag bHasImage
274 bHasImage=Standard_False;
276 for (; aIt.More(); aIt.Next()) {
277 const TopoDS_Shape& aShell=aIt.Value();
278 bHasImage=myImages.IsBound(aShell);
284 // 2.1 Bounding box for the solid aS [ aBoxS ]
288 // 2.2 Build Draft Solid [aSD]
291 BuildDraftSolid(aSolid, aSD, aLIF);
292 aNbLIF=aLIF.Extent();
294 BOPTools::MapShapesAndAncestors(aSD, TopAbs_EDGE, TopAbs_FACE, aMEF);
296 // 2.3 Faces from aSD and own internal faces => aMF
297 BOPTools::MapShapes(aSD, TopAbs_FACE, aMF);
299 aItLS.Initialize(aLIF);
300 for (; aItLS.More(); aItLS.Next()) {
301 const TopoDS_Shape& aFI=aItLS.Value();
305 // 2.4. Select boxes of faces that are not out of aBoxS
307 aSelector.SetBox(aBoxS);
309 aNbFP=aBBTree.Select(aSelector);
311 const BOPCol_ListOfInteger& aLIFP=aSelector.Indices();
313 // 2.5. Collect faces that are IN aSolid [ aLFIN ]
314 BOPCol_ListOfShape aLFP(aAlr1);
315 BOPCol_ListOfShape aLCBF(aAlr1);
316 BOPCol_MapOfShape aMFDone(100, aAlr1);
317 BOPCol_IndexedMapOfShape aME(100, aAlr1);
319 BOPTools::MapShapes(aSD, TopAbs_EDGE, aME);
321 aItLI.Initialize(aLIFP);
322 for (; aItLI.More(); aItLI.Next()) {
324 const BOPAlgo_ShapeBox& aSBF=aDMISB.Find(nFP);
325 const TopoDS_Face& aFP=(*(TopoDS_Face*)&aSBF.Shape());
326 if (aMF.Contains(aFP)) {
329 if (aMFDone.Contains(aFP)) {
335 iIsIN=BOPTools_AlgoTools::IsInternalFace(aFP, aSD, aMEF, 1.e-14, myContext);
340 aItLI1.Initialize(aLIFP);
341 for (; aItLI1.More(); aItLI1.Next()) {
342 const TopoDS_Shape& aFx=aDMISB.Find(aItLI1.Value()).Shape();
343 if (!aMFDone.Contains(aFx)) {
349 //----------------------------------------
351 Handle(NCollection_IncAllocator) aAlr2;
352 aAlr2=new NCollection_IncAllocator();
354 BOPTools_AlgoTools::MakeConnexityBlock(aLFP, aME, aLCBF, aAlr2);
356 //----------------------------------------
357 aItLS.Initialize(aLCBF);
358 for (; aItLS.More(); aItLS.Next()) {
359 const TopoDS_Shape& aFx=aItLS.Value();
365 }// for (; aItLI.More(); aItLI.Next()) {
367 // 2.6. Store the results in theInParts, theDraftSolids
368 aNbFIN=aLFIN.Extent();
369 if (aNbFIN || aNbLIF) {
370 aItLS.Initialize(aLIF);
371 for (; aItLS.More(); aItLS.Next()) {
372 const TopoDS_Shape& aFI=aItLS.Value();
375 theInParts.Bind(aSolid, aLFIN);
378 if (aNbFIN || bHasImage) {
379 theDraftSolids.Bind(aSolid, aSD);
381 //---------------------------------------------
382 }// for (i=0; i<aNbS; ++i) {
384 //=======================================================================
385 //function : BuildDraftSolid
387 //=======================================================================
388 void BOPAlgo_Builder::BuildDraftSolid(const TopoDS_Shape& theSolid,
389 TopoDS_Shape& theDraftSolid,
390 BOPCol_ListOfShape& theLIF)
394 Standard_Boolean bToReverse;
395 Standard_Integer iFlag;
396 TopAbs_Orientation aOrF, aOrSh, aOrSd;
397 TopoDS_Iterator aIt1, aIt2;
399 TopoDS_Shape aFSDx, aFx;
401 BOPCol_ListIteratorOfListOfShape aItS;
403 aOrSd=theSolid.Orientation();
404 theDraftSolid.Orientation(aOrSd);
406 aIt1.Initialize(theSolid);
407 for (; aIt1.More(); aIt1.Next()) {
408 const TopoDS_Shape& aSh=aIt1.Value();
409 if(aSh.ShapeType()!=TopAbs_SHELL) {
410 continue; // mb internal edges,vertices
413 aOrSh=aSh.Orientation();
415 aShD.Orientation(aOrSh);
418 aIt2.Initialize(aSh);
419 for (; aIt2.More(); aIt2.Next()) {
420 const TopoDS_Shape& aF=aIt2.Value();
421 aOrF=aF.Orientation();
423 if (myImages.IsBound(aF)) {
424 const BOPCol_ListOfShape& aLSp=myImages.Find(aF);
425 aItS.Initialize(aLSp);
426 for (; aItS.More(); aItS.Next()) {
429 if (myShapesSD.IsBound(aFx)) {
430 aFSDx=myShapesSD.Find(aFx);
432 if (aOrF==TopAbs_INTERNAL) {
433 aFSDx.Orientation(aOrF);
434 theLIF.Append(aFSDx);
437 bToReverse=BOPTools_AlgoTools::IsSplitToReverse(aFSDx,
445 aBB.Add(aShD, aFSDx);
447 }//if (myShapesSD.IsBound(aFx)) {
449 aFx.Orientation(aOrF);
450 if (aOrF==TopAbs_INTERNAL) {
459 } // if (myImages.IsBound(aF)) {
462 if (aOrF==TopAbs_INTERNAL) {
470 } //for (; aIt2.More(); aIt2.Next()) {
473 aBB.Add(theDraftSolid, aShD);
475 } //for (; aIt1.More(); aIt1.Next()) {
477 //=======================================================================
478 //function : BuildSplitSolids
480 //=======================================================================
481 void BOPAlgo_Builder::BuildSplitSolids
482 (BOPCol_DataMapOfShapeListOfShape& theInParts,
483 BOPCol_DataMapOfShapeShape& theDraftSolids,
484 const BOPCol_BaseAllocator& )
488 Standard_Boolean bFlagSD;
489 Standard_Integer i, aNbS;
490 TopExp_Explorer aExp;
491 BOPCol_ListIteratorOfListOfShape aIt;
492 BOPCol_DataMapIteratorOfDataMapOfShapeShape aIt1;
494 Handle(NCollection_IncAllocator) aAlr0;
495 aAlr0=new NCollection_IncAllocator();
497 BOPCol_ListOfShape aSFS(aAlr0), aLSEmpty(aAlr0);
498 BOPCol_MapOfShape aMFence(100, aAlr0);
499 BOPTools_MapOfSet aMST(100, aAlr0);
500 BOPAlgo_VectorOfBuilderSolid aVBS;
502 // 0. Find same domain solids for non-interferred solids
503 aNbS=myDS->NbSourceShapes();
504 for (i=0; i<aNbS; ++i) {
505 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
507 if (aSI.ShapeType()!=TopAbs_SOLID) {
511 const TopoDS_Shape& aS=aSI.Shape();
512 if (!aMFence.Add(aS)) {
515 if(theDraftSolids.IsBound(aS)) {
521 aST.Add(aS, TopAbs_FACE);
524 } //for (i=1; i<=aNbS; ++i)
526 // 1. Build solids for interferred source solids
527 for (i=0; i<aNbS; ++i) {
528 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
530 if (aSI.ShapeType()!=TopAbs_SOLID) {
534 const TopoDS_Shape& aS=aSI.Shape();
535 const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aS));
536 if(!theDraftSolids.IsBound(aS)) {
539 const TopoDS_Shape& aSD=theDraftSolids.Find(aS);
540 const BOPCol_ListOfShape& aLFIN=
541 (theInParts.IsBound(aS)) ? theInParts.Find(aS) : aLSEmpty;
543 // 1.1 Fill Shell Faces Set
545 aExp.Init(aSD, TopAbs_FACE);
546 for (; aExp.More(); aExp.Next()) {
547 const TopoDS_Shape& aF=aExp.Current();
551 aIt.Initialize(aLFIN);
552 for (; aIt.More(); aIt.Next()) {
553 TopoDS_Shape aF=aIt.Value();
555 aF.Orientation(TopAbs_FORWARD);
557 aF.Orientation(TopAbs_REVERSED);
561 // 1.3 Build new solids
562 Handle(NCollection_IncAllocator) aAlr1;
563 aAlr1=new NCollection_IncAllocator();
565 BOPAlgo_BuilderSolid& aBS=aVBS.Append1();
566 aBS.SetSolid(aSolid);
568 }//for (i=0; i<aNbS; ++i) {
570 Standard_Integer k, aNbBS;
574 //===================================================
575 BOPAlgo_BuilderSolidCnt::Perform(myRunParallel, aVBS);
576 //===================================================
578 for (k=0; k<aNbBS; ++k) {
579 BOPAlgo_BuilderSolid& aBS=aVBS(k);
580 const TopoDS_Solid& aS=aBS.Solid();
581 const BOPCol_ListOfShape& aLSR=aBS.Areas();
583 if (!myImages.IsBound(aS)) {
584 BOPCol_ListOfShape aLSx;
586 myImages.Bind(aS, aLSx);
587 BOPCol_ListOfShape& aLSIm=myImages.ChangeFind(aS);
589 aIt.Initialize(aLSR);
590 for (; aIt.More(); aIt.Next()) {
593 const TopoDS_Shape& aSR=aIt.Value();
594 aST.Add(aSR, TopAbs_FACE);
596 bFlagSD=aMST.Contains(aST);
598 const BOPTools_Set& aSTx=aMST.Added(aST);
599 const TopoDS_Shape& aSx=aSTx.Shape();
603 myShapesSD.Bind(aSR, aSx);
609 //=======================================================================
610 //function :FillInternalShapes
612 //=======================================================================
613 void BOPAlgo_Builder::FillInternalShapes()
617 Standard_Integer i, j, aNbS, aNbSI, aNbSx;
618 TopAbs_ShapeEnum aType;
620 TopoDS_Iterator aItS;
622 BOPCol_MapIteratorOfMapOfShape aItM;
623 BOPCol_ListIteratorOfListOfShape aIt, aIt1;
625 Handle(NCollection_IncAllocator) aAllocator;
626 //-----------------------------------------------------scope f
627 aAllocator=new NCollection_IncAllocator();
629 BOPCol_IndexedDataMapOfShapeListOfShape aMSx(100, aAllocator);
630 BOPCol_IndexedMapOfShape aMx(100, aAllocator);
631 BOPCol_MapOfShape aMSI(100, aAllocator);
632 BOPCol_MapOfShape aMFence(100, aAllocator);
633 BOPCol_MapOfShape aMSOr(100, aAllocator);
634 BOPCol_ListOfShape aLSd(aAllocator);
635 BOPCol_ListOfShape aLArgs(aAllocator);
636 BOPCol_ListOfShape aLSC(aAllocator);
638 // 1. Shapes to process
640 // 1.1 Shapes from pure arguments aMSI
641 // 1.1.1 vertex, edge, wire
643 aIt.Initialize(myArguments);
644 for (; aIt.More(); aIt.Next()) {
645 const TopoDS_Shape& aS=aIt.Value();
646 TreatCompound(aS, aMFence, aLSC);
648 aIt.Initialize(aLSC);
649 for (; aIt.More(); aIt.Next()) {
650 const TopoDS_Shape& aS=aIt.Value();
651 aType=aS.ShapeType();
652 if (aType==TopAbs_WIRE) {
654 for(; aItS.More(); aItS.Next()) {
655 const TopoDS_Shape& aE=aItS.Value();
656 if (aMFence.Add(aE)) {
661 else if (aType==TopAbs_VERTEX || aType==TopAbs_EDGE){
667 aIt.Initialize(aLArgs);
668 for (; aIt.More(); aIt.Next()) {
669 const TopoDS_Shape& aS=aIt.Value();
670 aType=aS.ShapeType();
671 if (aType==TopAbs_VERTEX ||
672 aType==TopAbs_EDGE ||
673 aType==TopAbs_WIRE) {
674 if (aMFence.Add(aS)) {
675 if (myImages.IsBound(aS)) {
676 const BOPCol_ListOfShape &aLSp=myImages.Find(aS);
677 aIt1.Initialize(aLSp);
678 for (; aIt1.More(); aIt1.Next()) {
679 const TopoDS_Shape& aSp=aIt1.Value();
692 // 2. Internal vertices, edges from source solids
696 aNbS=myDS->NbSourceShapes();
697 for (i=0; i<aNbS; ++i) {
698 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
700 if (aSI.ShapeType()!=TopAbs_SOLID) {
704 const TopoDS_Shape& aS=aSI.Shape();
707 OwnInternalShapes(aS, aMx);
710 for (j=1; j<=aNbSx; ++j) {
711 const TopoDS_Shape& aSi=aMx(j);
712 if (myImages.IsBound(aSi)) {
713 const BOPCol_ListOfShape &aLSp=myImages.Find(aSi);
714 aIt1.Initialize(aLSp);
715 for (; aIt1.More(); aIt1.Next()) {
716 const TopoDS_Shape& aSp=aIt1.Value();
725 // build aux map from splits of solids
726 if (myImages.IsBound(aS)) {
727 const BOPCol_ListOfShape &aLSp=myImages.Find(aS);
728 aIt.Initialize(aLSp);
729 for (; aIt.More(); aIt.Next()) {
730 const TopoDS_Shape& aSp=aIt.Value();
731 if (aMFence.Add(aSp)) {
732 BOPTools::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
733 BOPTools::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_FACE, aMSx);
734 BOPTools::MapShapesAndAncestors(aSp, TopAbs_EDGE , TopAbs_FACE, aMSx);
740 if (aMFence.Add(aS)) {
741 BOPTools::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
742 BOPTools::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_FACE, aMSx);
743 BOPTools::MapShapesAndAncestors(aS, TopAbs_EDGE , TopAbs_FACE, aMSx);
748 }// for (i=0; i<aNbS; ++i) {
750 // 3. Some shapes of aMSI can be already tied with faces of
752 aItM.Initialize(aMSI);
753 for (; aItM.More(); aItM.Next()) {
754 const TopoDS_Shape& aSI=aItM.Key();
755 if (aMSx.Contains(aSI)) {
756 const BOPCol_ListOfShape &aLSx=aMSx.FindFromKey(aSI);
770 // 5 Settle internal vertices and edges into solids
772 aIt.Initialize(aLSd);
773 for (; aIt.More(); aIt.Next()) {
774 TopoDS_Solid aSd=TopoDS::Solid(aIt.Value());
776 aItM.Initialize(aMSI);
777 for (; aItM.More(); aItM.Next()) {
778 TopoDS_Shape aSI=aItM.Key();
779 aSI.Orientation(TopAbs_INTERNAL);
781 aState=BOPTools_AlgoTools::ComputeStateByOnePoint(aSI, aSd, 1.e-11, myContext);
782 if (aState==TopAbs_IN) {
784 if(aMSOr.Contains(aSd)) {
789 aItS.Initialize(aSd);
790 for (; aItS.More(); aItS.Next()) {
791 const TopoDS_Shape& aSh=aItS.Value();
797 if (myImages.IsBound(aSdx)) {
798 BOPCol_ListOfShape& aLS=myImages.ChangeFind(aSdx);
802 BOPCol_ListOfShape aLS;
804 myImages.Bind(aSd, aLS);
815 } //if (aState==TopAbs_IN) {
816 }// for (; aItM.More(); aItM.Next()) {
817 }//for (; aIt1.More(); aIt1.Next()) {
819 //-----------------------------------------------------scope t
828 //=======================================================================
829 //function : OwnInternalShapes
831 //=======================================================================
832 void OwnInternalShapes(const TopoDS_Shape& theS,
833 BOPCol_IndexedMapOfShape& theMx)
837 aIt.Initialize(theS);
838 for (; aIt.More(); aIt.Next()) {
839 const TopoDS_Shape& aSx=aIt.Value();
840 if (aSx.ShapeType()!=TopAbs_SHELL) {
845 //=======================================================================
846 //function : TreatCompound
848 //=======================================================================
849 void TreatCompound(const TopoDS_Shape& theS,
850 BOPCol_MapOfShape& aMFence,
851 BOPCol_ListOfShape& theLS)
853 TopAbs_ShapeEnum aType;
855 aType = theS.ShapeType();
856 if (aType != TopAbs_COMPOUND) {
857 if (aMFence.Add(theS)) {
865 aIt.Initialize(theS);
866 for (; aIt.More(); aIt.Next()) {
867 const TopoDS_Shape& aS = aIt.Value();
868 TreatCompound(aS, aMFence, theLS);
874 // 30 - SolidBuilder failed