1 // Created by: Peter KURNEV
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
16 #include <BOPAlgo_BOP.hxx>
17 #include <BOPAlgo_BuilderSolid.hxx>
18 #include <BOPAlgo_PaveFiller.hxx>
19 #include <BOPCol_DataMapOfShapeShape.hxx>
20 #include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
21 #include <BOPCol_IndexedMapOfShape.hxx>
22 #include <BOPCol_ListOfShape.hxx>
23 #include <BOPCol_MapOfShape.hxx>
24 #include <BOPDS_DS.hxx>
25 #include <BOPTools.hxx>
26 #include <BOPTools_AlgoTools.hxx>
27 #include <BOPTools_AlgoTools3D.hxx>
28 #include <BOPTools_Set.hxx>
29 #include <BOPTools_SetMapHasher.hxx>
30 #include <BRep_Builder.hxx>
31 #include <BRep_Tool.hxx>
32 #include <NCollection_DataMap.hxx>
33 #include <TopAbs_ShapeEnum.hxx>
34 #include <TopExp_Explorer.hxx>
35 #include <TopoDS_Compound.hxx>
36 #include <TopoDS_Edge.hxx>
37 #include <TopoDS_Iterator.hxx>
38 #include <TopoDS_Shape.hxx>
39 #include <TopTools_ListIteratorOfListOfShape.hxx>
41 typedef NCollection_IndexedDataMap
44 BOPTools_SetMapHasher> BOPTools_IndexedDataMapOfSetShape;
47 TopAbs_ShapeEnum TypeToExplore(const Standard_Integer theDim);
50 void CollectContainers(const TopoDS_Shape& theS,
51 BOPCol_ListOfShape& theLSC);
54 //=======================================================================
57 //=======================================================================
58 BOPAlgo_BOP::BOPAlgo_BOP()
62 myMapTools(100, myAllocator)
66 //=======================================================================
69 //=======================================================================
70 BOPAlgo_BOP::BOPAlgo_BOP
71 (const Handle(NCollection_BaseAllocator)& theAllocator)
73 BOPAlgo_Builder(theAllocator),
75 myMapTools(100, myAllocator)
79 //=======================================================================
82 //=======================================================================
83 BOPAlgo_BOP::~BOPAlgo_BOP()
86 //=======================================================================
89 //=======================================================================
90 void BOPAlgo_BOP::Clear()
92 myOperation=BOPAlgo_UNKNOWN;
98 BOPAlgo_Builder::Clear();
100 //=======================================================================
101 //function : SetOperation
103 //=======================================================================
104 void BOPAlgo_BOP::SetOperation(const BOPAlgo_Operation theOperation)
106 myOperation=theOperation;
108 //=======================================================================
109 //function : Operation
111 //=======================================================================
112 BOPAlgo_Operation BOPAlgo_BOP::Operation()const
116 //=======================================================================
119 //=======================================================================
120 void BOPAlgo_BOP::AddTool(const TopoDS_Shape& theShape)
122 if (myMapTools.Add(theShape)) {
123 myTools.Append(theShape);
126 //=======================================================================
127 //function : SetTools
129 //=======================================================================
130 void BOPAlgo_BOP::SetTools(const BOPCol_ListOfShape& theShapes)
132 BOPCol_ListIteratorOfListOfShape aIt;
135 aIt.Initialize(theShapes);
136 for (; aIt.More(); aIt.Next()) {
137 const TopoDS_Shape& aS = aIt.Value();
141 //=======================================================================
142 //function : CheckData
144 //=======================================================================
145 void BOPAlgo_BOP::CheckData()
147 Standard_Integer i, j, iDim, aNbArgs, aNbTools;
148 Standard_Boolean bFlag, bFuse;
149 BOPCol_ListIteratorOfListOfShape aItLS;
153 if (!(myOperation==BOPAlgo_COMMON ||
154 myOperation==BOPAlgo_FUSE ||
155 myOperation==BOPAlgo_CUT||
156 myOperation==BOPAlgo_CUT21)) {
157 // non-licit operation
162 aNbArgs=myArguments.Extent();
164 // invalid number of Arguments
169 aNbTools=myTools.Extent();
171 // invalid number of Tools
181 myErrorStatus=myPaveFiller->ErrorStatus();
186 bFuse = (myOperation == BOPAlgo_FUSE);
188 // The rules for different types of operations are the following:
189 // 1. FUSE: All arguments and tools should have the same dimension;
190 // 2. CUT: The MAXIMAL dimension of the ARGUMENTS should be less
191 // or equal to the MINIMAL dimension of the TOOLS;
192 // 3. CUT21: The MINIMAL dimension of ARGUMENTS should be grater
193 // or equal to the MAXIMAL dimension of the TOOLS;
194 // 4. COMMON: The arguments and tools could have any dimensions.
196 Standard_Integer iDimMin[2], iDimMax[2];
198 for (i=0; i<2; ++i) {
199 const BOPCol_ListOfShape& aLS=(!i)? myArguments : myTools;
200 aItLS.Initialize(aLS);
201 for (j=0; aItLS.More(); aItLS.Next(), ++j) {
202 const TopoDS_Shape& aS=aItLS.Value();
203 bFlag=BOPTools_AlgoTools3D::IsEmptyShape(aS);
208 iDim=BOPTools_AlgoTools::Dimension(aS);
210 // non-homogenious argument
221 if (iDim < iDimMin[i]) {
224 else if (iDim > iDimMax[i]) {
228 if (bFuse && (iDimMin[i] != iDimMax[i])) {
229 // non-homogenious argument
236 if (((myOperation == BOPAlgo_FUSE) && (iDimMax[0] != iDimMax[1])) ||
237 ((myOperation == BOPAlgo_CUT) && (iDimMax[0] > iDimMin[1])) ||
238 ((myOperation == BOPAlgo_CUT21) && (iDimMin[0] < iDimMax[1])) ) {
239 // non-licit operation for the arguments
244 myDims[0] = iDimMin[0];
245 myDims[1] = iDimMin[1];
247 //=======================================================================
250 //=======================================================================
251 void BOPAlgo_BOP::Prepare()
254 BOPAlgo_Builder::Prepare();
256 if(myWarningStatus == 2) {
259 BOPCol_ListIteratorOfListOfShape aItLS;
261 switch(myOperation) {
263 for (i=0; i<2; ++i) {
264 const BOPCol_ListOfShape& aLS=(!i)? myArguments : myTools;
265 aItLS.Initialize(aLS);
266 for (; aItLS.More(); aItLS.Next()) {
267 const TopoDS_Shape& aS=aItLS.Value();
268 aBB.Add(myShape, aS);
275 aItLS.Initialize(myArguments);
276 for (; aItLS.More(); aItLS.Next()) {
277 const TopoDS_Shape& aS=aItLS.Value();
278 if(!BOPTools_AlgoTools3D::IsEmptyShape(aS)) {
279 aBB.Add(myShape, aS);
285 case BOPAlgo_CUT21: {
286 aItLS.Initialize(myTools);
287 for (; aItLS.More(); aItLS.Next()) {
288 const TopoDS_Shape& aS=aItLS.Value();
289 if(!BOPTools_AlgoTools3D::IsEmptyShape(aS)) {
290 aBB.Add(myShape, aS);
301 //=======================================================================
302 //function : BuildResult
304 //=======================================================================
305 void BOPAlgo_BOP::BuildResult(const TopAbs_ShapeEnum theType)
307 TopAbs_ShapeEnum aType;
309 BOPCol_MapOfShape aM;
310 BOPCol_ListIteratorOfListOfShape aIt, aItIm;
314 const BOPCol_ListOfShape& aLA=myDS->Arguments();
316 for (; aIt.More(); aIt.Next()) {
317 const TopoDS_Shape& aS=aIt.Value();
318 aType=aS.ShapeType();
319 if (aType==theType) {
320 if (myImages.IsBound(aS)){
321 const BOPCol_ListOfShape& aLSIm=myImages.Find(aS);
322 aItIm.Initialize(aLSIm);
323 for (; aItIm.More(); aItIm.Next()) {
324 const TopoDS_Shape& aSIm=aItIm.Value();
326 aBB.Add(myShape, aSIm);
332 aBB.Add(myShape, aS);
338 //=======================================================================
341 //=======================================================================
342 void BOPAlgo_BOP::Perform()
344 Handle(NCollection_BaseAllocator) aAllocator;
345 BOPAlgo_PaveFiller* pPF;
346 BOPCol_ListIteratorOfListOfShape aItLS;
350 if (myEntryPoint==1) {
358 NCollection_BaseAllocator::CommonBaseAllocator();
359 BOPCol_ListOfShape aLS(aAllocator);
361 aItLS.Initialize(myArguments);
362 for (; aItLS.More(); aItLS.Next()) {
363 const TopoDS_Shape& aS=aItLS.Value();
367 aItLS.Initialize(myTools);
368 for (; aItLS.More(); aItLS.Next()) {
369 const TopoDS_Shape& aS=aItLS.Value();
373 pPF=new BOPAlgo_PaveFiller(aAllocator);
374 pPF->SetArguments(aLS);
375 pPF->SetRunParallel(myRunParallel);
376 pPF->SetProgressIndicator(myProgressIndicator);
377 pPF->SetFuzzyValue(myFuzzyValue);
378 pPF->SetNonDestructive(myNonDestructive);
383 PerformInternal(*pPF);
385 //=======================================================================
386 //function : PerformInternal1
388 //=======================================================================
389 void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
394 myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
395 myDS=myPaveFiller->PDS();
396 myContext=myPaveFiller->Context();
400 if (myErrorStatus && !myWarningStatus) {
410 if(myWarningStatus == 2) {
415 FillImagesVertices();
420 BuildResult(TopAbs_VERTEX);
430 BuildResult(TopAbs_EDGE);
436 FillImagesContainers(TopAbs_WIRE);
441 BuildResult(TopAbs_WIRE);
452 BuildResult(TopAbs_FACE);
458 FillImagesContainers(TopAbs_SHELL);
463 BuildResult(TopAbs_SHELL);
474 BuildResult(TopAbs_SOLID);
480 FillImagesContainers(TopAbs_COMPSOLID);
485 BuildResult(TopAbs_COMPSOLID);
491 FillImagesCompounds();
496 BuildResult(TopAbs_COMPOUND);
513 //=======================================================================
516 //=======================================================================
517 void BOPAlgo_BOP::BuildRC()
519 TopAbs_ShapeEnum aType;
525 aBB.MakeCompound(aC);
528 if (myOperation == BOPAlgo_FUSE) {
529 BOPCol_MapOfShape aMFence;
530 aType = TypeToExplore(myDims[0]);
531 TopExp_Explorer aExp(myShape, aType);
532 for (; aExp.More(); aExp.Next()) {
533 const TopoDS_Shape& aS = aExp.Current();
534 if (aMFence.Add(aS)) {
542 // B. Common, Cut, Cut21
544 Standard_Integer i, j, aNb, iDim;
545 Standard_Boolean bCheckEdges, bContains, bCut21, bCommon;
546 BOPCol_IndexedMapOfShape aMArgs, aMTools;
547 BOPCol_IndexedMapOfShape aMArgsIm, aMToolsIm;
548 BOPCol_ListIteratorOfListOfShape aItLS;
550 for (i = 0; i < 2; ++i) {
551 const BOPCol_ListOfShape& aLS = !i ? myArguments : myTools;
552 BOPCol_IndexedMapOfShape& aMS = !i ? aMArgs : aMTools;
553 aItLS.Initialize(aLS);
554 for (; aItLS.More(); aItLS.Next()) {
555 const TopoDS_Shape& aS = aItLS.Value();
556 iDim = BOPTools_AlgoTools::Dimension(aS);
557 aType = TypeToExplore(iDim);
558 BOPTools::MapShapes(aS, aType, aMS);
562 bCheckEdges = Standard_False;
564 for (i = 0; i < 2; ++i) {
565 const BOPCol_IndexedMapOfShape& aMS = !i ? aMArgs : aMTools;
566 BOPCol_IndexedMapOfShape& aMSIm = !i ? aMArgsIm : aMToolsIm;
569 for (j = 1; j <= aNb; ++j) {
570 const TopoDS_Shape& aS = aMS(j);
571 aType = aS.ShapeType();
572 if (aType == TopAbs_EDGE) {
573 const TopoDS_Edge& aE = *(TopoDS_Edge*)&aS;
574 bCheckEdges = Standard_True;
575 if (BRep_Tool::Degenerated(aE)) {
580 if (myImages.IsBound(aS)) {
581 const BOPCol_ListOfShape& aLSIm = myImages.Find(aS);
582 aItLS.Initialize(aLSIm);
583 for (; aItLS.More(); aItLS.Next()) {
584 const TopoDS_Shape& aSIm = aItLS.Value();
594 // compare the maps and make the result
596 Standard_Integer iDimMin, iDimMax;
598 iDimMin = Min(myDims[0], myDims[1]);
599 bCommon = (myOperation == BOPAlgo_COMMON);
600 bCut21 = (myOperation == BOPAlgo_CUT21);
602 const BOPCol_IndexedMapOfShape& aMIt = bCut21 ? aMToolsIm : aMArgsIm;
603 const BOPCol_IndexedMapOfShape& aMCheck = bCut21 ? aMArgsIm : aMToolsIm;
605 BOPCol_IndexedMapOfShape aMCheckExp, aMItExp;
609 for (i = 1; i <= aNb; ++i) {
610 const TopoDS_Shape& aS = aMIt(i);
611 iDimMax = BOPTools_AlgoTools::Dimension(aS);
612 for (iDim = iDimMin; iDim < iDimMax; ++iDim) {
613 aType = TypeToExplore(iDim);
614 BOPTools::MapShapes(aS, aType, aMItExp);
623 aNb = aMCheck.Extent();
624 for (i = 1; i <= aNb; ++i) {
625 const TopoDS_Shape& aS = aMCheck(i);
626 iDimMax = BOPTools_AlgoTools::Dimension(aS);
627 for (iDim = iDimMin; iDim < iDimMax; ++iDim) {
628 aType = TypeToExplore(iDim);
629 BOPTools::MapShapes(aS, aType, aMCheckExp);
634 aNb = aMItExp.Extent();
635 for (i = 1; i <= aNb; ++i) {
636 const TopoDS_Shape& aS = aMItExp(i);
638 bContains = aMCheckExp.Contains(aS);
651 // filter result for COMMON operation
653 BOPCol_MapOfShape aMFence;
654 TopExp_Explorer aExp;
656 aBB.MakeCompound(aCx);
658 for (iDim = 3; iDim >= iDimMin; --iDim) {
659 aType = TypeToExplore(iDim);
660 aExp.Init(aC, aType);
661 for (; aExp.More(); aExp.Next()) {
662 const TopoDS_Shape& aS = aExp.Current();
663 if (aMFence.Add(aS)) {
665 BOPTools::MapShapes(aS, aMFence);
677 // The squats around degenerated edges
678 Standard_Integer nVD;
679 BOPCol_IndexedMapOfShape aMVC;
682 BOPTools::MapShapes(aC, TopAbs_VERTEX, aMVC);
685 aNb = myDS->NbSourceShapes();
686 for (i = 0; i < aNb; ++i) {
687 const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
688 aType = aSI.ShapeType();
689 if (aType != TopAbs_EDGE) {
693 const TopoDS_Edge& aE = *((TopoDS_Edge*)&aSI.Shape());
694 if (!BRep_Tool::Degenerated(aE)) {
698 nVD = aSI.SubShapes().First();
699 const TopoDS_Shape& aVD = myDS->Shape(nVD);
701 if (!aMVC.Contains(aVD)) {
705 if (myDS->IsNewShape(nVD)) {
709 if (myDS->HasInterf(nVD)) {
718 //=======================================================================
719 //function : BuildShape
721 //=======================================================================
722 void BOPAlgo_BOP::BuildShape()
726 if ((myOperation == BOPAlgo_FUSE) && (myDims[0] == 3)) {
732 TopAbs_ShapeEnum aType, aT1, aT2;
733 TopTools_ListOfShape aLSC, aLCB;
734 BOPCol_ListIteratorOfListOfShape aItLS, aItLSIm, aItLCB;
737 TopoDS_Shape aRC, aRCB;
739 TopoDS_Compound aResult;
740 aBB.MakeCompound(aResult);
742 BOPCol_MapOfShape aMSRC;
743 BOPTools::MapShapes(myRC, aMSRC);
745 // collect images of containers
746 for (i = 0; i < 2; ++i) {
747 const BOPCol_ListOfShape& aLS = !i ? myArguments : myTools;
749 aItLS.Initialize(aLS);
750 for (; aItLS.More(); aItLS.Next()) {
751 const TopoDS_Shape& aS = aItLS.Value();
753 CollectContainers(aS, aLSC);
757 aItLS.Initialize(aLSC);
758 for (; aItLS.More(); aItLS.Next()) {
759 const TopoDS_Shape& aSC = aItLS.Value();
761 BOPTools_AlgoTools::MakeContainer(TopAbs_COMPOUND, aRC);
764 for (; aIt.More(); aIt.Next()) {
765 const TopoDS_Shape& aS = aIt.Value();
766 if (myImages.IsBound(aS)) {
767 const TopTools_ListOfShape& aLSIm = myImages.Find(aS);
769 aItLSIm.Initialize(aLSIm);
770 for (; aItLSIm.More(); aItLSIm.Next()) {
771 const TopoDS_Shape& aSIm = aItLSIm.Value();
772 if (aMSRC.Contains(aSIm)) {
777 else if (aMSRC.Contains(aS)) {
782 aType = aSC.ShapeType();
801 BOPTools_AlgoTools::MakeConnexityBlocks(aRC, aT1, aT2, aLCB);
802 if (aLCB.IsEmpty()) {
806 aItLCB.Initialize(aLCB);
807 for (; aItLCB.More(); aItLCB.Next()) {
808 BOPTools_AlgoTools::MakeContainer(aType, aRCB);
810 const TopoDS_Shape& aCB = aItLCB.Value();
812 for (; aIt.More(); aIt.Next()) {
813 const TopoDS_Shape& aCBS = aIt.Value();
817 if (aType == TopAbs_SHELL) {
818 BOPTools_AlgoTools::OrientFacesOnShell(aRCB);
821 aBB.Add(aResult, aRCB);
825 // add the rest of the shapes into result
826 BOPCol_MapOfShape aMSResult;
827 BOPTools::MapShapes(aResult, aMSResult);
829 aIt.Initialize(myRC);
830 for (; aIt.More(); aIt.Next()) {
831 const TopoDS_Shape& aS = aIt.Value();
832 if (!aMSResult.Contains(aS)) {
833 aBB.Add(aResult, aS);
839 //=======================================================================
840 //function : BuildSolid
842 //=======================================================================
843 void BOPAlgo_BOP::BuildSolid()
845 Standard_Boolean bHasInterf, bHasSharedFaces;
846 Standard_Integer i, aNbF, aNbSx, iX, iErr, aNbZ;
847 TopAbs_Orientation aOr, aOr1;
851 TopExp_Explorer aExp;
852 BOPCol_IndexedMapOfShape aMFI;
853 BOPCol_IndexedDataMapOfShapeListOfShape aMFS, aMEF;
854 BOPCol_ListIteratorOfListOfShape aItLS;
855 BOPCol_ListOfShape aSFS;
856 BOPAlgo_BuilderSolid aSB;
857 BOPCol_MapOfShape aMSA, aMZ;
858 BOPTools_IndexedDataMapOfSetShape aDMSTS;
862 // Map of of Solids of Arguments
863 for (i=0; i<2; ++i) {
864 const BOPCol_ListOfShape& aLSA=(i) ? myArguments : myTools;
865 aItLS.Initialize(aLSA);
866 for (; aItLS.More(); aItLS.Next()) {
867 const TopoDS_Shape& aSA=aItLS.Value();
868 aExp.Init(aSA, TopAbs_SOLID);
869 for (; aExp.More(); aExp.Next()) {
870 const TopoDS_Shape& aZA=aExp.Current();
873 BOPTools::MapShapesAndAncestors(aZA,
882 for (i=1; i<aNbF; ++i) {
883 //const TopoDS_Shape& aFA=aMFZA.FindKey(i);
884 const BOPCol_ListOfShape& aLZA=aMFS(i);
887 aItLS.Initialize(aLZA);
888 for(; aItLS.More(); aItLS.Next()) {
889 const TopoDS_Shape& aZA=aItLS.Value();
897 aIt.Initialize(myRC);
898 for (; aIt.More(); aIt.Next()) {
899 const TopoDS_Shape& aSx=aIt.Value();
900 if (aMSA.Contains(aSx)) {
902 bHasInterf=myDS->HasInterf(iX);
903 bHasSharedFaces=aMZ.Contains(aSx);
905 if (!bHasInterf && !bHasSharedFaces) {
906 // It means that the solid aSx will be added
907 // to the result as is.
908 // The solid aSx will not participate
909 // in creation of a new solid(s).
912 aST.Add(aSx, TopAbs_FACE);
914 if (!aDMSTS.Contains(aST)) {
915 aDMSTS.Add(aST, aSx);
922 aExp.Init(aSx, TopAbs_FACE);
923 for (; aExp.More(); aExp.Next()) {
924 const TopoDS_Shape& aFx=aExp.Current();
926 aOr=aFx.Orientation();
927 if (aOr==TopAbs_INTERNAL) {
932 if (!aMFS.Contains(aFx)) {
933 BOPCol_ListOfShape aLSx;
939 iX=aMFS.FindIndex(aFx);
940 const TopoDS_Shape& aFx1=aMFS.FindKey(iX);
941 aOr1=aFx1.Orientation();
943 BOPCol_ListOfShape& aLSx=aMFS.ChangeFromKey(aFx);
949 } // for (; aIt.More(); aIt.Next()) {
950 //faces that will be added in the end;
951 BOPCol_ListOfShape aLF, aLFx;
954 for (i=1; i<=aNbF; ++i) {
955 const TopoDS_Shape& aFx=aMFS.FindKey(i);
956 const BOPCol_ListOfShape& aLSx=aMFS(i);
959 BOPTools::MapShapesAndAncestors
960 (aFx,TopAbs_EDGE, TopAbs_FACE, aMEF);
961 if (IsBoundSplits(aFx, aMEF)){
969 aItLS.Initialize(aLF);
970 for(; aItLS.More(); aItLS.Next()) {
971 const TopoDS_Shape& aFx=aItLS.Value();
974 // add faces from aLFx to aSFS;
975 aItLS.Initialize(aLFx);
976 for (; aItLS.More(); aItLS.Next()) {
977 const TopoDS_Shape& aFx=aItLS.Value();
982 for (i=1; i<=aNbF; ++i) {
986 aFx.Orientation(TopAbs_FORWARD);
988 aFx.Orientation(TopAbs_REVERSED);
993 BOPTools_AlgoTools::MakeContainer(TopAbs_COMPOUND, aRC);
995 aSB.SetContext(myContext);
998 iErr=aSB.ErrorStatus();
1000 myErrorStatus=30; // SolidBuilder failed
1004 const BOPCol_ListOfShape& aLSR=aSB.Areas();
1006 aItLS.Initialize(aLSR);
1007 for (; aItLS.More(); aItLS.Next()) {
1008 const TopoDS_Shape& aSR=aItLS.Value();
1012 aNbSx = aDMSTS.Extent();
1013 for (i = 1; i <= aNbSx; ++i) {
1014 const TopoDS_Shape& aSx = aDMSTS(i);
1020 //=======================================================================
1021 //function : IsBoundSplits
1023 //=======================================================================
1024 Standard_Boolean BOPAlgo_BOP::IsBoundSplits
1025 (const TopoDS_Shape& aS,
1026 BOPCol_IndexedDataMapOfShapeListOfShape& aMEF)
1028 Standard_Boolean bRet = Standard_False;
1029 if (mySplits.IsBound(aS) || myOrigins.IsBound(aS)) {
1033 BOPCol_ListIteratorOfListOfShape aIt;
1034 Standard_Integer aNbLS;
1035 TopAbs_Orientation anOr;
1037 //check face aF may be connected to face from mySplits
1038 TopExp_Explorer aExp(aS, TopAbs_EDGE);
1039 for (; aExp.More(); aExp.Next()) {
1040 const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current()));
1042 anOr = aE.Orientation();
1043 if (anOr==TopAbs_INTERNAL) {
1047 if (BRep_Tool::Degenerated(aE)) {
1051 const BOPCol_ListOfShape& aLS=aMEF.FindFromKey(aE);
1052 aNbLS = aLS.Extent();
1057 aIt.Initialize(aLS);
1058 for (; aIt.More(); aIt.Next()) {
1059 const TopoDS_Shape& aSx = aIt.Value();
1060 if (mySplits.IsBound(aSx) || myOrigins.IsBound(aS)) {
1068 //=======================================================================
1069 //function : TypeToExplore
1071 //=======================================================================
1072 TopAbs_ShapeEnum TypeToExplore(const Standard_Integer theDim)
1074 TopAbs_ShapeEnum aRet;
1095 //=======================================================================
1096 //function : CollectContainers
1098 //=======================================================================
1099 void CollectContainers(const TopoDS_Shape& theS,
1100 BOPCol_ListOfShape& theLSC)
1102 TopAbs_ShapeEnum aType = theS.ShapeType();
1103 if (aType == TopAbs_WIRE ||
1104 aType == TopAbs_SHELL ||
1105 aType == TopAbs_COMPSOLID) {
1106 theLSC.Append(theS);
1110 if (aType != TopAbs_COMPOUND) {
1114 TopoDS_Iterator aIt(theS);
1115 for (; aIt.More(); aIt.Next()) {
1116 const TopoDS_Shape& aS = aIt.Value();
1117 CollectContainers(aS, theLSC);