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 <Precision.hxx>
22 #include <NCollection_IncAllocator.hxx>
23 #include <NCollection_UBTreeFiller.hxx>
25 #include <Bnd_Box.hxx>
26 #include <TopAbs_State.hxx>
29 #include <TopoDS_Iterator.hxx>
30 #include <TopoDS_Solid.hxx>
31 #include <TopoDS_Shape.hxx>
32 #include <TopoDS_Face.hxx>
33 #include <TopoDS_Edge.hxx>
34 #include <TopoDS_Solid.hxx>
35 #include <TopoDS_Iterator.hxx>
36 #include <TopoDS_Shell.hxx>
37 #include <TopoDS_Compound.hxx>
40 #include <TopExp_Explorer.hxx>
42 #include <BRep_Builder.hxx>
43 #include <BRepTools.hxx>
44 #include <BRepClass3d_SolidClassifier.hxx>
45 #include <BRepBndLib.hxx>
47 #include <BOPCol_IndexedMapOfShape.hxx>
48 #include <BOPCol_MapOfShape.hxx>
49 #include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
50 #include <BOPCol_ListOfShape.hxx>
51 #include <BOPCol_BoxBndTree.hxx>
52 #include <BOPCol_ListOfInteger.hxx>
53 #include <BOPCol_DataMapOfIntegerShape.hxx>
54 #include <BOPCol_NCVector.hxx>
55 #include <BOPCol_TBB.hxx>
57 #include <IntTools_Context.hxx>
59 #include <BOPDS_DS.hxx>
60 #include <BOPDS_ShapeInfo.hxx>
62 #include <BOPTools.hxx>
63 #include <BOPTools_AlgoTools.hxx>
64 #include <BOPTools_MapOfSet.hxx>
65 #include <BOPTools_Set.hxx>
67 #include <BOPAlgo_BuilderSolid.hxx>
68 #include <NCollection_Array1.hxx>
72 void OwnInternalShapes(const TopoDS_Shape& ,
73 BOPCol_IndexedMapOfShape& );
76 void TreatCompound(const TopoDS_Shape& theS,
77 BOPCol_MapOfShape& aMFence,
78 BOPCol_ListOfShape& theLS);
80 //=======================================================================
81 // BOPAlgo_BuilderSolid
83 typedef BOPCol_NCVector
84 <BOPAlgo_BuilderSolid> BOPAlgo_VectorOfBuilderSolid;
86 typedef BOPCol_TBBFunctor
87 <BOPAlgo_BuilderSolid,
88 BOPAlgo_VectorOfBuilderSolid> BOPAlgo_BuilderSolidFunctor;
91 <BOPAlgo_BuilderSolidFunctor,
92 BOPAlgo_VectorOfBuilderSolid> BOPAlgo_BuilderSolidCnt;
94 //=======================================================================
95 //class : BOPAlgo_ShapeBox
96 //purpose : Auxiliary class
97 //=======================================================================
98 class BOPAlgo_ShapeBox {
103 ~BOPAlgo_ShapeBox() {
106 void SetShape(const TopoDS_Shape& aS) {
110 const TopoDS_Shape& Shape()const {
114 void SetBox(const Bnd_Box& aBox) {
118 const Bnd_Box& Box()const {
123 TopoDS_Shape myShape;
127 typedef NCollection_DataMap
130 TColStd_MapIntegerHasher> BOPAlgo_DataMapOfIntegerShapeBox;
132 typedef BOPAlgo_DataMapOfIntegerShapeBox::Iterator
133 BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox;
136 //=======================================================================
137 //function : FillImagesSolids
139 //=======================================================================
140 void BOPAlgo_Builder::FillImagesSolids()
142 Standard_Boolean bHasSolids;
143 Standard_Integer i, aNbS;
147 bHasSolids=Standard_False;
148 aNbS=myDS->NbSourceShapes();
149 for (i=0; i<aNbS; ++i) {
150 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
151 if (aSI.ShapeType()==TopAbs_SOLID) {
152 bHasSolids=!bHasSolids;
161 Handle(NCollection_IncAllocator) aAlr;
163 aAlr=new NCollection_IncAllocator();
164 BOPCol_DataMapOfShapeListOfShape theInParts(100, aAlr);
165 BOPCol_DataMapOfShapeShape theDraftSolids(100, aAlr);
167 FillIn3DParts(theInParts, theDraftSolids, aAlr);
168 BuildSplitSolids(theInParts, theDraftSolids, aAlr);
169 FillInternalShapes();
172 theDraftSolids.Clear();
174 //=======================================================================
175 //function : FillIn3DParts
177 //=======================================================================
178 void BOPAlgo_Builder::FillIn3DParts
179 (BOPCol_DataMapOfShapeListOfShape& theInParts,
180 BOPCol_DataMapOfShapeShape& theDraftSolids,
181 const BOPCol_BaseAllocator& )
183 Standard_Boolean bHasImage;
184 Standard_Integer i, k, aNbS, aNbLIF, nFP, aNbFP, aNbFIN, iIsIN;
188 BOPCol_ListIteratorOfListOfInteger aItLI, aItLI1;
189 BOPCol_ListIteratorOfListOfShape aItLS;
190 BOPAlgo_ShapeBox aSB;
191 Handle(NCollection_IncAllocator) aAlr0;
193 aAlr0=new NCollection_IncAllocator();
194 BOPAlgo_DataMapOfIntegerShapeBox aDMISB(100, aAlr0);
195 BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox aItDMISB;
198 theDraftSolids.Clear();
200 // 1. aDMISB map Index/FaceBox
202 aNbS=myDS->NbSourceShapes();
203 for (i=0; i<aNbS; ++i) {
204 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
205 if (aSI.ShapeType()!=TopAbs_FACE) {
209 const TopoDS_Shape& aS=aSI.Shape();
211 if (myImages.IsBound(aS)) {
212 const BOPCol_ListOfShape& aLS=myImages.Find(aS);
213 aItLS.Initialize(aLS);
214 for (; aItLS.More(); aItLS.Next()) {
215 const TopoDS_Shape& aSx=aItLS.Value();
218 BRepBndLib::Add(aSx, aBox);
228 const Bnd_Box& aBox=aSI.Box();
236 }//for (i=0; i<aNbS; ++i) {
238 // 1.2. Prepare TreeFiller
239 BOPCol_BoxBndTree aBBTree;
240 NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
242 aItDMISB.Initialize(aDMISB);
243 for (; aItDMISB.More(); aItDMISB.Next()) {
245 const BOPAlgo_ShapeBox& aSBk=aItDMISB.Value();
246 const Bnd_Box& aBk=aSBk.Box();
248 aTreeFiller.Add(k, aBk);
251 // 1.3. Shake TreeFiller
254 //---------------------------------------------
256 for (i=0; i<aNbS; ++i) {
257 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
258 if (aSI.ShapeType()!=TopAbs_SOLID) {
263 //---------------------------------------------
264 Handle(NCollection_IncAllocator) aAlr1;
266 aAlr1=new NCollection_IncAllocator();
268 BOPCol_ListOfShape aLFIN(aAlr1);
269 BOPCol_ListOfShape aLIF(aAlr1);
270 BOPCol_IndexedMapOfShape aMF(100, aAlr1);
271 BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, aAlr1);
272 BOPCol_BoxBndTreeSelector aSelector;
275 const TopoDS_Shape& aS=aSI.Shape();
276 const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aS));
278 // 2.0 Flag bHasImage
279 bHasImage=Standard_False;
281 for (; aIt.More(); aIt.Next()) {
282 const TopoDS_Shape& aShell=aIt.Value();
283 bHasImage=myImages.IsBound(aShell);
289 // 2.1 Bounding box for the solid aS [ aBoxS ]
293 // 2.2 Build Draft Solid [aSD]
296 BuildDraftSolid(aSolid, aSD, aLIF);
297 aNbLIF=aLIF.Extent();
299 BOPTools::MapShapesAndAncestors(aSD, TopAbs_EDGE, TopAbs_FACE, aMEF);
301 // 2.3 Faces from aSD and own internal faces => aMF
302 BOPTools::MapShapes(aSD, TopAbs_FACE, aMF);
304 aItLS.Initialize(aLIF);
305 for (; aItLS.More(); aItLS.Next()) {
306 const TopoDS_Shape& aFI=aItLS.Value();
310 // 2.4. Select boxes of faces that are not out of aBoxS
312 aSelector.SetBox(aBoxS);
314 aNbFP=aBBTree.Select(aSelector);
316 const BOPCol_ListOfInteger& aLIFP=aSelector.Indices();
318 NCollection_Array1<Standard_Integer> aIVec(1, aNbFP);
319 aItLI.Initialize(aLIFP);
320 for (k = 1; aItLI.More(); aItLI.Next(), ++k) {
324 std::sort(aIVec.begin(), aIVec.end());
326 // 2.5. Collect faces that are IN aSolid [ aLFIN ]
327 BOPCol_ListOfShape aLFP(aAlr1);
328 BOPCol_ListOfShape aLCBF(aAlr1);
329 BOPCol_MapOfShape aMFDone(100, aAlr1);
330 BOPCol_IndexedMapOfShape aME(100, aAlr1);
332 BOPTools::MapShapes(aSD, TopAbs_EDGE, aME);
334 for (k = 1; k <= aNbFP; ++k) {
336 const BOPAlgo_ShapeBox& aSBF=aDMISB.Find(nFP);
337 const TopoDS_Face& aFP=(*(TopoDS_Face*)&aSBF.Shape());
338 if (aMF.Contains(aFP)) {
341 if (aMFDone.Contains(aFP)) {
347 iIsIN=BOPTools_AlgoTools::IsInternalFace(aFP, aSD, aMEF,
348 Precision::Confusion(),
354 aItLI1.Initialize(aLIFP);
355 for (; aItLI1.More(); aItLI1.Next()) {
356 const TopoDS_Shape& aFx=aDMISB.Find(aItLI1.Value()).Shape();
357 if (!aMFDone.Contains(aFx)) {
363 //----------------------------------------
365 Handle(NCollection_IncAllocator) aAlr2;
366 aAlr2=new NCollection_IncAllocator();
368 BOPTools_AlgoTools::MakeConnexityBlock(aLFP, aME, aLCBF, aAlr2);
370 //----------------------------------------
371 aItLS.Initialize(aLCBF);
372 for (; aItLS.More(); aItLS.Next()) {
373 const TopoDS_Shape& aFx=aItLS.Value();
379 }// for (; aItLI.More(); aItLI.Next()) {
381 // 2.6. Store the results in theInParts, theDraftSolids
382 aNbFIN=aLFIN.Extent();
383 if (aNbFIN || aNbLIF) {
384 aItLS.Initialize(aLIF);
385 for (; aItLS.More(); aItLS.Next()) {
386 const TopoDS_Shape& aFI=aItLS.Value();
389 theInParts.Bind(aSolid, aLFIN);
392 if (aNbFIN || bHasImage) {
393 theDraftSolids.Bind(aSolid, aSD);
395 //---------------------------------------------
396 }// for (i=0; i<aNbS; ++i) {
398 //=======================================================================
399 //function : BuildDraftSolid
401 //=======================================================================
402 void BOPAlgo_Builder::BuildDraftSolid(const TopoDS_Shape& theSolid,
403 TopoDS_Shape& theDraftSolid,
404 BOPCol_ListOfShape& theLIF)
408 Standard_Boolean bToReverse;
409 Standard_Integer iFlag;
410 TopAbs_Orientation aOrF, aOrSh, aOrSd;
411 TopoDS_Iterator aIt1, aIt2;
413 TopoDS_Shape aFSDx, aFx;
415 BOPCol_ListIteratorOfListOfShape aItS;
417 aOrSd=theSolid.Orientation();
418 theDraftSolid.Orientation(aOrSd);
420 aIt1.Initialize(theSolid);
421 for (; aIt1.More(); aIt1.Next()) {
422 const TopoDS_Shape& aSh=aIt1.Value();
423 if(aSh.ShapeType()!=TopAbs_SHELL) {
424 continue; // mb internal edges,vertices
427 aOrSh=aSh.Orientation();
429 aShD.Orientation(aOrSh);
432 aIt2.Initialize(aSh);
433 for (; aIt2.More(); aIt2.Next()) {
434 const TopoDS_Shape& aF=aIt2.Value();
435 aOrF=aF.Orientation();
437 if (myImages.IsBound(aF)) {
438 const BOPCol_ListOfShape& aLSp=myImages.Find(aF);
439 aItS.Initialize(aLSp);
440 for (; aItS.More(); aItS.Next()) {
443 if (myShapesSD.IsBound(aFx)) {
444 aFSDx=myShapesSD.Find(aFx);
446 if (aOrF==TopAbs_INTERNAL) {
447 aFSDx.Orientation(aOrF);
448 theLIF.Append(aFSDx);
451 bToReverse=BOPTools_AlgoTools::IsSplitToReverse
452 (aFSDx, aF, myContext);
458 aBB.Add(aShD, aFSDx);
460 }//if (myShapesSD.IsBound(aFx)) {
462 aFx.Orientation(aOrF);
463 if (aOrF==TopAbs_INTERNAL) {
472 } // if (myImages.IsBound(aF)) {
475 if (aOrF==TopAbs_INTERNAL) {
483 } //for (; aIt2.More(); aIt2.Next()) {
486 aShD.Closed (BRep_Tool::IsClosed (aShD));
487 aBB.Add(theDraftSolid, aShD);
489 } //for (; aIt1.More(); aIt1.Next()) {
491 //=======================================================================
492 //function : BuildSplitSolids
494 //=======================================================================
495 void BOPAlgo_Builder::BuildSplitSolids
496 (BOPCol_DataMapOfShapeListOfShape& theInParts,
497 BOPCol_DataMapOfShapeShape& theDraftSolids,
498 const BOPCol_BaseAllocator& )
502 Standard_Boolean bFlagSD;
503 Standard_Integer i, aNbS;
504 TopExp_Explorer aExp;
505 BOPCol_ListIteratorOfListOfShape aIt;
506 BOPCol_DataMapIteratorOfDataMapOfShapeShape aIt1;
508 Handle(NCollection_IncAllocator) aAlr0;
509 aAlr0=new NCollection_IncAllocator();
511 BOPCol_ListOfShape aSFS(aAlr0), aLSEmpty(aAlr0);
512 BOPCol_MapOfShape aMFence(100, aAlr0);
513 BOPTools_MapOfSet aMST(100, aAlr0);
514 BOPAlgo_VectorOfBuilderSolid aVBS;
516 // 0. Find same domain solids for non-interferred solids
517 aNbS=myDS->NbSourceShapes();
518 for (i=0; i<aNbS; ++i) {
519 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
521 if (aSI.ShapeType()!=TopAbs_SOLID) {
525 const TopoDS_Shape& aS=aSI.Shape();
526 if (!aMFence.Add(aS)) {
529 if(theDraftSolids.IsBound(aS)) {
535 aST.Add(aS, TopAbs_FACE);
538 } //for (i=1; i<=aNbS; ++i)
540 // 1. Build solids for interferred source solids
541 for (i=0; i<aNbS; ++i) {
542 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
544 if (aSI.ShapeType()!=TopAbs_SOLID) {
548 const TopoDS_Shape& aS=aSI.Shape();
549 const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aS));
550 if(!theDraftSolids.IsBound(aS)) {
553 const TopoDS_Shape& aSD=theDraftSolids.Find(aS);
554 const BOPCol_ListOfShape& aLFIN=
555 (theInParts.IsBound(aS)) ? theInParts.Find(aS) : aLSEmpty;
557 // 1.1 Fill Shell Faces Set
559 aExp.Init(aSD, TopAbs_FACE);
560 for (; aExp.More(); aExp.Next()) {
561 const TopoDS_Shape& aF=aExp.Current();
565 aIt.Initialize(aLFIN);
566 for (; aIt.More(); aIt.Next()) {
567 TopoDS_Shape aF=aIt.Value();
569 aF.Orientation(TopAbs_FORWARD);
571 aF.Orientation(TopAbs_REVERSED);
575 // 1.3 Build new solids
576 Handle(NCollection_IncAllocator) aAlr1;
577 aAlr1=new NCollection_IncAllocator();
579 BOPAlgo_BuilderSolid& aBS=aVBS.Append1();
580 aBS.SetSolid(aSolid);
582 aBS.SetRunParallel(myRunParallel);
583 aBS.SetProgressIndicator(myProgressIndicator);
584 }//for (i=0; i<aNbS; ++i) {
586 Standard_Integer k, aNbBS;
590 //===================================================
591 BOPAlgo_BuilderSolidCnt::Perform(myRunParallel, aVBS);
592 //===================================================
594 for (k=0; k<aNbBS; ++k) {
595 BOPAlgo_BuilderSolid& aBS=aVBS(k);
596 const TopoDS_Solid& aS=aBS.Solid();
597 const BOPCol_ListOfShape& aLSR=aBS.Areas();
599 if (!myImages.IsBound(aS)) {
600 BOPCol_ListOfShape aLSx;
602 myImages.Bind(aS, aLSx);
603 BOPCol_ListOfShape& aLSIm=myImages.ChangeFind(aS);
605 aIt.Initialize(aLSR);
606 for (; aIt.More(); aIt.Next()) {
609 const TopoDS_Shape& aSR=aIt.Value();
610 aST.Add(aSR, TopAbs_FACE);
612 bFlagSD=aMST.Contains(aST);
614 const BOPTools_Set& aSTx=aMST.Added(aST);
615 const TopoDS_Shape& aSx=aSTx.Shape();
619 myShapesSD.Bind(aSR, aSx);
625 //=======================================================================
626 //function :FillInternalShapes
628 //=======================================================================
629 void BOPAlgo_Builder::FillInternalShapes()
633 Standard_Integer i, j, aNbS, aNbSI, aNbSx;
634 TopAbs_ShapeEnum aType;
636 TopoDS_Iterator aItS;
638 BOPCol_MapIteratorOfMapOfShape aItM;
639 BOPCol_ListIteratorOfListOfShape aIt, aIt1;
641 Handle(NCollection_IncAllocator) aAllocator;
642 //-----------------------------------------------------scope f
643 aAllocator=new NCollection_IncAllocator();
645 BOPCol_IndexedDataMapOfShapeListOfShape aMSx(100, aAllocator);
646 BOPCol_IndexedMapOfShape aMx(100, aAllocator);
647 BOPCol_MapOfShape aMSI(100, aAllocator);
648 BOPCol_MapOfShape aMFence(100, aAllocator);
649 BOPCol_MapOfShape aMSOr(100, aAllocator);
650 BOPCol_ListOfShape aLSd(aAllocator);
651 BOPCol_ListOfShape aLArgs(aAllocator);
652 BOPCol_ListOfShape aLSC(aAllocator);
654 // 1. Shapes to process
656 // 1.1 Shapes from pure arguments aMSI
657 // 1.1.1 vertex, edge, wire
659 const BOPCol_ListOfShape& aArguments=myDS->Arguments();
660 aIt.Initialize(aArguments);
661 for (; aIt.More(); aIt.Next()) {
662 const TopoDS_Shape& aS=aIt.Value();
663 TreatCompound(aS, aMFence, aLSC);
665 aIt.Initialize(aLSC);
666 for (; aIt.More(); aIt.Next()) {
667 const TopoDS_Shape& aS=aIt.Value();
668 aType=aS.ShapeType();
669 if (aType==TopAbs_WIRE) {
671 for(; aItS.More(); aItS.Next()) {
672 const TopoDS_Shape& aE=aItS.Value();
673 if (aMFence.Add(aE)) {
678 else if (aType==TopAbs_VERTEX || aType==TopAbs_EDGE){
684 aIt.Initialize(aLArgs);
685 for (; aIt.More(); aIt.Next()) {
686 const TopoDS_Shape& aS=aIt.Value();
687 aType=aS.ShapeType();
688 if (aType==TopAbs_VERTEX ||
689 aType==TopAbs_EDGE ||
690 aType==TopAbs_WIRE) {
691 if (aMFence.Add(aS)) {
692 if (myImages.IsBound(aS)) {
693 const BOPCol_ListOfShape &aLSp=myImages.Find(aS);
694 aIt1.Initialize(aLSp);
695 for (; aIt1.More(); aIt1.Next()) {
696 const TopoDS_Shape& aSp=aIt1.Value();
709 // 2. Internal vertices, edges from source solids
713 aNbS=myDS->NbSourceShapes();
714 for (i=0; i<aNbS; ++i) {
715 const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
717 if (aSI.ShapeType()!=TopAbs_SOLID) {
723 const TopoDS_Shape& aS=aSI.Shape();
726 OwnInternalShapes(aS, aMx);
729 for (j=1; j<=aNbSx; ++j) {
730 const TopoDS_Shape& aSi=aMx(j);
731 if (myImages.IsBound(aSi)) {
732 const BOPCol_ListOfShape &aLSp=myImages.Find(aSi);
733 aIt1.Initialize(aLSp);
734 for (; aIt1.More(); aIt1.Next()) {
735 const TopoDS_Shape& aSp=aIt1.Value();
744 // build aux map from splits of solids
745 if (myImages.IsBound(aS)) {
746 const BOPCol_ListOfShape &aLSp=myImages.Find(aS);
747 aIt.Initialize(aLSp);
748 for (; aIt.More(); aIt.Next()) {
749 const TopoDS_Shape& aSp=aIt.Value();
750 if (aMFence.Add(aSp)) {
751 BOPTools::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
752 BOPTools::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_FACE, aMSx);
753 BOPTools::MapShapesAndAncestors(aSp, TopAbs_EDGE , TopAbs_FACE, aMSx);
759 if (aMFence.Add(aS)) {
760 BOPTools::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
761 BOPTools::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_FACE, aMSx);
762 BOPTools::MapShapesAndAncestors(aS, TopAbs_EDGE , TopAbs_FACE, aMSx);
767 }// for (i=0; i<aNbS; ++i) {
769 // 3. Some shapes of aMSI can be already tied with faces of
771 aItM.Initialize(aMSI);
772 for (; aItM.More(); aItM.Next()) {
773 const TopoDS_Shape& aSI=aItM.Key();
774 if (aMSx.Contains(aSI)) {
775 const BOPCol_ListOfShape &aLSx=aMSx.FindFromKey(aSI);
789 // 5 Settle internal vertices and edges into solids
791 aIt.Initialize(aLSd);
792 for (; aIt.More(); aIt.Next()) {
793 TopoDS_Solid aSd=TopoDS::Solid(aIt.Value());
795 aItM.Initialize(aMSI);
796 for (; aItM.More(); aItM.Next()) {
797 TopoDS_Shape aSI=aItM.Key();
798 aSI.Orientation(TopAbs_INTERNAL);
800 aState=BOPTools_AlgoTools::ComputeStateByOnePoint(aSI, aSd, 1.e-11, myContext);
801 if (aState==TopAbs_IN) {
803 if(aMSOr.Contains(aSd)) {
808 aItS.Initialize(aSd);
809 for (; aItS.More(); aItS.Next()) {
810 const TopoDS_Shape& aSh=aItS.Value();
816 if (myImages.IsBound(aSdx)) {
817 BOPCol_ListOfShape& aLS=myImages.ChangeFind(aSdx);
821 BOPCol_ListOfShape aLS;
823 myImages.Bind(aSd, aLS);
834 } //if (aState==TopAbs_IN) {
835 }// for (; aItM.More(); aItM.Next()) {
836 }//for (; aIt1.More(); aIt1.Next()) {
838 //-----------------------------------------------------scope t
847 //=======================================================================
848 //function : OwnInternalShapes
850 //=======================================================================
851 void OwnInternalShapes(const TopoDS_Shape& theS,
852 BOPCol_IndexedMapOfShape& theMx)
856 aIt.Initialize(theS);
857 for (; aIt.More(); aIt.Next()) {
858 const TopoDS_Shape& aSx=aIt.Value();
859 if (aSx.ShapeType()!=TopAbs_SHELL) {
864 //=======================================================================
865 //function : TreatCompound
867 //=======================================================================
868 void TreatCompound(const TopoDS_Shape& theS,
869 BOPCol_MapOfShape& aMFence,
870 BOPCol_ListOfShape& theLS)
872 TopAbs_ShapeEnum aType;
874 aType = theS.ShapeType();
875 if (aType != TopAbs_COMPOUND) {
876 if (aMFence.Add(theS)) {
884 aIt.Initialize(theS);
885 for (; aIt.More(); aIt.Next()) {
886 const TopoDS_Shape& aS = aIt.Value();
887 TreatCompound(aS, aMFence, theLS);
893 // 30 - SolidBuilder failed