1 // Created on: 2004-06-29
2 // Created by: Mikhail KLOKOV
3 // Copyright (c) 2004-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
22 #include <BOP_SolidSolid.ixx>
24 #include <TColStd_IndexedMapOfInteger.hxx>
25 #include <TColStd_MapOfInteger.hxx>
28 #include <TopoDS_Shape.hxx>
29 #include <TopoDS_Vertex.hxx>
30 #include <TopoDS_Edge.hxx>
31 #include <TopoDS_Face.hxx>
32 #include <TopoDS_Wire.hxx>
33 #include <TopoDS_Shell.hxx>
34 #include <TopoDS_Solid.hxx>
35 #include <TopoDS_Compound.hxx>
37 #include <BooleanOperations_ShapesDataStructure.hxx>
38 #include <BooleanOperations_StateOfShape.hxx>
39 #include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
41 #include <BOPTools_SSInterference.hxx>
42 #include <BOPTools_InterferencePool.hxx>
43 #include <BOPTools_CArray1OfSSInterference.hxx>
44 #include <BOPTools_PaveFiller.hxx>
45 #include <BOPTools_DSFiller.hxx>
46 #include <BOPTools_PaveBlock.hxx>
47 #include <BOPTools_CommonBlock.hxx>
48 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
49 #include <BOPTools_ListIteratorOfListOfCommonBlock.hxx>
50 #include <BOPTools_Curve.hxx>
52 #include <BOPTools_Tools3D.hxx>
54 #include <IntTools_Context.hxx>
56 #include <BOP_BuilderTools.hxx>
58 #include <TColStd_ListIteratorOfListOfInteger.hxx>
59 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
61 #include <TopTools_DataMapOfShapeInteger.hxx>
62 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
63 #include <BOPTools_StateFiller.hxx>
65 #include <BRep_Builder.hxx>
68 Standard_Integer GetIndex(const TopoDS_Shape& theShape,
69 const BooleanOperations_ShapesDataStructure& theDS);
72 void GetAttachedFaces(const Standard_Integer theEdgeIndex,
73 const Standard_Integer theFaceIndex,
74 const BOPTools_DSFiller& theDSFiller,
75 TColStd_ListOfInteger& theListOfFaces);
78 void GetStatesOfAdjacentFaces(const TColStd_ListOfInteger& theListOfFacesToCheck,
79 const BOPTools_DSFiller& theDSFiller,
80 TColStd_MapOfInteger& theMapOfUsedIndices,
81 Standard_Boolean& bFoundINOUT,
82 Standard_Boolean& bFoundININ,
83 Standard_Boolean& bFoundOUTOUT);
86 Standard_Boolean ComputeStateForAnalyticalSurfaces(const Standard_Integer theFaceIndex,
87 const Standard_Integer theBaseFaceIndex,
88 const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& theFFMap,
89 const BOPTools_DSFiller& theDSFiller,
90 TopAbs_State& theState);
93 Standard_Boolean IsEdgeValidForFace(const Standard_Integer theEdgeIndex,
94 const Standard_Integer theFaceIndex,
95 BOPTools_SSInterference& theFF,
96 const BOPTools_DSFiller& theDSFiller);
98 //=================================================================================
99 // function: PrepareFaceSplits
101 //=================================================================================
102 void BOP_SolidSolid::PrepareFaceSplits()
104 const BooleanOperations_ShapesDataStructure& aDS = myDSFiller->DS();
105 BooleanOperations_ShapesDataStructure* pDS = (BooleanOperations_ShapesDataStructure*)&aDS;
106 BOPTools_InterferencePool* pIntrPool = (BOPTools_InterferencePool*)&myDSFiller->InterfPool();
107 BOPTools_CArray1OfSSInterference& aFFs = pIntrPool->SSInterferences();
109 Standard_Integer i, aNb, nF1, iRank;
110 BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger aFFMap;
111 BOP_BuilderTools::DoMap(aFFs, aFFMap);
112 TopTools_ListOfShape aListOfNewFaces;
113 TopAbs_Orientation anOriF1 = TopAbs_FORWARD;
115 TColStd_DataMapOfIntegerListOfInteger& aMapOfFaceSplits = myDSFiller->ChangeSplitFacePool();
119 for (i=1; i<=aNb; i++) {
122 nF1 = aFFMap.FindKey(i);
123 TopoDS_Face aF1 = TopoDS::Face(aDS.Shape(nF1));
125 anOriF1 = aF1.Orientation();
126 iRank = aDS.Rank(nF1);
128 TopTools_DataMapOfShapeInteger aMapOfEdgeIndex;
129 TopTools_ListOfShape aListOfSplits;
131 if(SplitFace(nF1, aMapOfEdgeIndex, aListOfSplits)) {
133 DoInternalVertices(nF1, aListOfSplits);
135 TopTools_ListIteratorOfListOfShape aFaceIt(aListOfSplits);
137 for(; aFaceIt.More(); aFaceIt.Next()) {
138 TopoDS_Shape aShapeF = aFaceIt.Value();
139 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
140 pDS->InsertShapeAndAncestorsSuccessors(aShapeF, anASSeq);
142 Standard_Integer aNewFaceIndex = pDS->NumberOfInsertedShapes();
144 pDS->SetState(aNewFaceIndex, BooleanOperations_ON);
146 if(!aMapOfFaceSplits.IsBound(nF1)) {
147 TColStd_ListOfInteger thelist;
148 aMapOfFaceSplits.Bind(nF1, thelist);
150 aMapOfFaceSplits.ChangeFind(nF1).Append(aNewFaceIndex);
152 TopAbs_State aState = TopAbs_ON;
153 Standard_Boolean bFoundFaceState = Standard_False;
155 if(PropagateFaceStateByEdges(aShapeF, aMapOfEdgeIndex, aState)) {
157 if(aState != TopAbs_ON) { // can not determine correctly ON state
158 BooleanOperations_StateOfShape aConvertedState = BOPTools_StateFiller::ConvertState(aState);
160 pDS->SetState(aNewFaceIndex, aConvertedState);
162 bFoundFaceState = Standard_True;
166 if(!bFoundFaceState) {
168 if(ComputeStateByInsidePoints(aNewFaceIndex, nF1, iRank, aFFMap, aState)) {
170 if(aState != TopAbs_ON) {
171 BooleanOperations_StateOfShape aConvertedState = BOPTools_StateFiller::ConvertState(aState);
173 pDS->SetState(aNewFaceIndex, aConvertedState);
175 bFoundFaceState = Standard_True;
179 if(!bFoundFaceState) {
181 if(ComputeStateForAnalyticalSurfaces(aNewFaceIndex, nF1, aFFMap, *myDSFiller, aState)) {
182 if(aState != TopAbs_ON) {
183 BooleanOperations_StateOfShape aConvertedState = BOPTools_StateFiller::ConvertState(aState);
185 pDS->SetState(aNewFaceIndex, aConvertedState);
186 bFoundFaceState = Standard_True;
196 // =====================================================================================================================
197 // function: PropagateFaceStateByEdges
199 // =====================================================================================================================
200 Standard_Boolean BOP_SolidSolid::PropagateFaceStateByEdges(const TopoDS_Shape& theFace,
201 const TopTools_DataMapOfShapeInteger& theMapOfEdgeIndex,
202 TopAbs_State& theState)
204 TopAbs_State aState = TopAbs_UNKNOWN;
206 const BooleanOperations_ShapesDataStructure& aDS = myDSFiller->DS();
208 if(theFace.IsNull() || (theFace.ShapeType() != TopAbs_FACE))
209 return Standard_False;
210 TopoDS_Face aF1 = TopoDS::Face(theFace);
212 Standard_Boolean bFoundNotON = Standard_False;
213 BooleanOperations_StateOfShape aFoundState = BooleanOperations_ON;
214 Standard_Boolean bIsINOUT = Standard_False;
216 TopExp_Explorer anExpE(aF1, TopAbs_EDGE);
218 for(; anExpE.More(); anExpE.Next()) {
219 const TopoDS_Shape& anEdge = anExpE.Current();
221 Standard_Integer nE = 0;
223 if(theMapOfEdgeIndex.IsBound(anEdge)) {
224 nE = theMapOfEdgeIndex(anEdge);
227 nE = aDS.ShapeIndex(anEdge, 1);
228 nE = (nE == 0) ? aDS.ShapeIndex(anEdge, 2) : nE;
234 BooleanOperations_StateOfShape anEdgeState = aDS.GetState(nE);
236 if((anEdgeState == BooleanOperations_IN) ||
237 (anEdgeState == BooleanOperations_OUT)) {
240 bFoundNotON = Standard_True;
241 aFoundState = anEdgeState;
244 if(aFoundState != anEdgeState) {
245 bIsINOUT = Standard_True;
251 if(!bIsINOUT && bFoundNotON) {
252 if(aFoundState == BooleanOperations_IN)
254 else if(aFoundState == BooleanOperations_OUT)
258 if(aState == TopAbs_UNKNOWN)
259 return Standard_False;
263 return Standard_True;
266 // =====================================================================================================================
267 // function: ComputeStateByInsidePoints
269 // =====================================================================================================================
270 Standard_Boolean BOP_SolidSolid::ComputeStateByInsidePoints(const Standard_Integer theFaceIndex,
271 const Standard_Integer theBaseFaceIndex,
272 const Standard_Integer theFaceRank,
273 const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& theFFMap,
274 TopAbs_State& theState)
277 TopAbs_State aState = TopAbs_ON;
278 const BooleanOperations_ShapesDataStructure& aDS = myDSFiller->DS();
279 BOPTools_InterferencePool* pIntrPool=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
280 const BOPTools_PaveFiller& aPaveFiller = myDSFiller->PaveFiller();
281 BOPTools_PaveFiller* pPaveFiller = (BOPTools_PaveFiller*)&aPaveFiller;
282 BOPTools_CArray1OfSSInterference& aFFs=pIntrPool->SSInterferences();
284 if(theFaceIndex == 0)
285 return Standard_False;
287 const TopoDS_Shape& aS = aDS.Shape(theFaceIndex);
290 return Standard_False;
291 TopoDS_Face aFace = TopoDS::Face(aS);
294 Standard_Integer i = 0, j = 0, aNb = 0;
295 aNb = theFFMap.Extent();
297 for (i=1; i<=aNb; i++) {
299 Standard_Integer nF1 = theFFMap.FindKey(i);
301 if(nF1 != theBaseFaceIndex)
304 const TColStd_IndexedMapOfInteger& aFFIndicesMap=theFFMap.FindFromIndex(i);
305 Standard_Integer aNbj = aFFIndicesMap.Extent();
307 for (j=1; j<=aNbj; j++) {
308 Standard_Integer iFF = aFFIndicesMap(j);
309 BOPTools_SSInterference& aFF = aFFs(iFF);
310 Standard_Boolean bIsTouchCase = aFF.IsTangentFaces();
313 Standard_Integer nF2 = aFF.OppositeIndex(nF1);
314 const TopoDS_Face& aF2 = TopoDS::Face(aDS.Shape(nF2));
316 if(BOPTools_Tools3D::CheckSameDomainFaceInside(aFace, aF2, pPaveFiller->Context())) {
317 theState = TopAbs_ON;
318 return Standard_True;
323 const TopoDS_Shape& aTool = (theFaceRank == 1) ? aDS.Tool() : aDS.Object();
324 TopoDS_Solid aRefSolid;
326 if(aTool.ShapeType() == TopAbs_SOLID)
327 aRefSolid = TopoDS::Solid(aTool);
330 aBB.MakeSolid(aRefSolid);
332 TopExp_Explorer anExpSH(aTool, TopAbs_SHELL);
334 for(; anExpSH.More(); anExpSH.Next()) {
335 TopoDS_Shape aShell = anExpSH.Current();
336 aBB.Add(aShell, aRefSolid);
340 if(!BOPTools_Tools3D::ComputeFaceState(aFace, aRefSolid, pPaveFiller->Context(), aState)) {
341 return Standard_False;
345 return Standard_True;
348 // =====================================================================================================================
349 // function: TakeOnSplit
351 // =====================================================================================================================
352 Standard_Boolean BOP_SolidSolid::TakeOnSplit(const Standard_Integer theFaceIndex,
353 const Standard_Integer theBaseFaceIndex) const
355 Standard_Boolean bTake = Standard_False;
357 Standard_Boolean binout = Standard_False;
358 Standard_Boolean binin = Standard_False;
359 Standard_Boolean boutout = Standard_False;
361 TColStd_MapOfInteger aMapOfUsedIndices;
362 TColStd_ListOfInteger aListOfFacesToCheck;
363 aListOfFacesToCheck.Append(theFaceIndex);
365 GetStatesOfAdjacentFaces(aListOfFacesToCheck, *myDSFiller, aMapOfUsedIndices, binout, binin, boutout);
367 switch(myOperation) {
369 if(binout || (!binin && !boutout)) {
370 bTake = Standard_True;
375 if(binout || (!binin && !boutout)) {
376 bTake = Standard_True;
381 if((binin || boutout) && !binout) {
382 bTake = Standard_True;
387 if((binin || boutout) && !binout) {
388 bTake = Standard_True;
399 // ------------------------------------------------------------------------------------
400 // static function: GetIndex
402 // ------------------------------------------------------------------------------------
403 Standard_Integer GetIndex(const TopoDS_Shape& theShape,
404 const BooleanOperations_ShapesDataStructure& theDS)
406 Standard_Integer anIndex = 0, i = 0;
408 anIndex = theDS.ShapeIndex(theShape, 1);
409 anIndex = (anIndex == 0) ? theDS.ShapeIndex(theShape, 2) : anIndex;
413 for (i = theDS.NumberOfSourceShapes() + 1; i <= theDS.NumberOfInsertedShapes(); i++) {
414 if(theShape.IsSame(theDS.Shape(i))) {
424 // ------------------------------------------------------------------------------------
425 // static function: GetAttachedFaces
427 // ------------------------------------------------------------------------------------
428 void GetAttachedFaces(const Standard_Integer theEdgeIndex,
429 const Standard_Integer theFaceIndex,
430 const BOPTools_DSFiller& theDSFiller,
431 TColStd_ListOfInteger& theListOfFaces)
433 theListOfFaces.Clear();
434 const BooleanOperations_ShapesDataStructure& aDS = theDSFiller.DS();
435 const TColStd_DataMapOfIntegerListOfInteger& aMap = theDSFiller.SplitFacePool();
437 Standard_Integer i = 0;
439 for(i = 1; i <= aDS.NumberOfInsertedShapes(); i++) {
441 if(aDS.GetShapeType(i) == TopAbs_FACE) {
442 TColStd_ListOfInteger aListOfFaceIndex;
444 if(!aMap.IsBound(i)) {
445 if(theFaceIndex == i)
447 aListOfFaceIndex.Append(i);
450 TColStd_ListIteratorOfListOfInteger anIttmp(aMap.Find(i));
452 for(; anIttmp.More(); anIttmp.Next()) {
453 if(theFaceIndex == anIttmp.Value())
455 aListOfFaceIndex.Append(anIttmp.Value());
459 TColStd_ListIteratorOfListOfInteger anIt(aListOfFaceIndex);
461 for(; anIt.More(); anIt.Next()) {
462 if(anIt.Value() <= 0)
464 const TopoDS_Shape& aFace = aDS.Shape(anIt.Value());
465 TopExp_Explorer anExpE(aFace, TopAbs_EDGE);
467 for(; anExpE.More(); anExpE.Next()) {
468 const TopoDS_Shape& anEdge = anExpE.Current();
469 Standard_Integer nE = GetIndex(anEdge, aDS);
471 if(theEdgeIndex == nE) {
472 theListOfFaces.Append(anIt.Value());
481 // ------------------------------------------------------------------------------------
482 // static function: GetStatesOfAdjacentFaces
484 // ------------------------------------------------------------------------------------
485 void GetStatesOfAdjacentFaces(const TColStd_ListOfInteger& theListOfFacesToCheck,
486 const BOPTools_DSFiller& theDSFiller,
487 TColStd_MapOfInteger& theMapOfUsedIndices,
488 Standard_Boolean& bFoundINOUT,
489 Standard_Boolean& bFoundININ,
490 Standard_Boolean& bFoundOUTOUT)
493 const BooleanOperations_ShapesDataStructure& aDS = theDSFiller.DS();
494 TColStd_ListOfInteger aLisOfON;
495 TColStd_ListIteratorOfListOfInteger anItF(theListOfFacesToCheck);
497 for(; anItF.More(); anItF.Next()) {
498 Standard_Integer nF = anItF.Value();
500 if(theMapOfUsedIndices.Contains(nF)) {
503 theMapOfUsedIndices.Add(nF);
505 TopoDS_Shape aFace = aDS.Shape(nF);
507 TopExp_Explorer anExpE(aFace, TopAbs_EDGE);
509 for(; anExpE.More(); anExpE.Next()) {
510 const TopoDS_Shape& anEdge = anExpE.Current();
511 Standard_Integer nE = 0;
512 nE = GetIndex(anEdge, aDS);
517 if(theMapOfUsedIndices.Contains(nE))
519 theMapOfUsedIndices.Add(nE);
520 TColStd_ListOfInteger aListOfFaces, aListOfIN, aListOfOUT;
521 GetAttachedFaces(nE, nF, theDSFiller, aListOfFaces);
523 TColStd_ListIteratorOfListOfInteger anIt(aListOfFaces);
525 for(; anIt.More(); anIt.Next()) {
526 if(theMapOfUsedIndices.Contains(anIt.Value()))
529 // if((aDS.GetState(anIt.Value()) != BooleanOperations_IN) &&
530 // (aDS.GetState(anIt.Value()) != BooleanOperations_OUT))
531 if(aDS.GetState(anIt.Value()) == BooleanOperations_ON)
532 aLisOfON.Append(anIt.Value());
534 if(aDS.GetState(anIt.Value()) == BooleanOperations_IN)
535 aListOfIN.Append(anIt.Value());
536 else if(aDS.GetState(anIt.Value()) == BooleanOperations_OUT)
537 aListOfOUT.Append(anIt.Value());
539 bFoundINOUT = bFoundINOUT || (!aListOfIN.IsEmpty() && !aListOfOUT.IsEmpty());
540 bFoundININ = bFoundININ || (!aListOfIN.IsEmpty() && aListOfOUT.IsEmpty());
541 bFoundOUTOUT = bFoundOUTOUT || (aListOfIN.IsEmpty() && !aListOfOUT.IsEmpty());
545 if(!aLisOfON.IsEmpty() && (theMapOfUsedIndices.Extent() <= aDS.NumberOfInsertedShapes())) {
546 GetStatesOfAdjacentFaces(aLisOfON, theDSFiller, theMapOfUsedIndices, bFoundINOUT, bFoundININ, bFoundOUTOUT);
550 // ------------------------------------------------------------------------------------
551 // static function: ComputeStateForAnalyticalSurfaces
553 // ------------------------------------------------------------------------------------
554 Standard_Boolean ComputeStateForAnalyticalSurfaces(const Standard_Integer theFaceIndex,
555 const Standard_Integer theBaseFaceIndex,
556 const BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& theFFMap,
557 const BOPTools_DSFiller& theDSFiller,
558 TopAbs_State& theState)
560 TopAbs_State aState = TopAbs_ON;
561 const BooleanOperations_ShapesDataStructure& aDS = theDSFiller.DS();
562 BOPTools_InterferencePool* pIntrPool=(BOPTools_InterferencePool*)&theDSFiller.InterfPool();
563 const BOPTools_PaveFiller& aPaveFiller = theDSFiller.PaveFiller();
564 BOPTools_PaveFiller* pPaveFiller = (BOPTools_PaveFiller*)&aPaveFiller;
565 BOPTools_CArray1OfSSInterference& aFFs=pIntrPool->SSInterferences();
567 if(theFaceIndex == 0)
568 return Standard_False;
570 const TopoDS_Shape& aS = aDS.Shape(theFaceIndex);
573 return Standard_False;
574 TopoDS_Face aFace = TopoDS::Face(aS);
576 Standard_Integer j = 0;
577 Standard_Boolean bFound = Standard_False;
579 if (theFFMap.Contains(theBaseFaceIndex)) {
581 Standard_Integer nF1 = theBaseFaceIndex;
583 const TColStd_IndexedMapOfInteger& aFFIndicesMap=theFFMap.FindFromKey(theBaseFaceIndex);
584 Standard_Integer aNbj = aFFIndicesMap.Extent();
586 for (j=1; (!bFound) && (j<=aNbj); j++) {
587 Standard_Integer iFF = aFFIndicesMap(j);
588 BOPTools_SSInterference& aFF = aFFs(iFF);
589 Standard_Boolean bIsTouchCase = aFF.IsTangentFaces();
592 Standard_Integer nF2 = aFF.OppositeIndex(nF1);
593 const TopoDS_Face& aF2 = TopoDS::Face(aDS.Shape(nF2));
595 TopExp_Explorer anExpE(aFace, TopAbs_EDGE);
597 for(; anExpE.More(); anExpE.Next()) {
598 TopoDS_Edge aSp = TopoDS::Edge(anExpE.Current());
600 Standard_Boolean bTestEdge = Standard_False;
602 Standard_Integer nE = GetIndex(aSp, aDS);
603 bTestEdge = IsEdgeValidForFace(nE, nF2, aFF, theDSFiller);
606 TopAbs_State aStPF = TopAbs_ON;
608 Standard_Boolean bAnalytic = Standard_False;
609 Standard_Real aTolTangent, aTolR;
614 bAnalytic = BOPTools_Tools3D::TreatedAsAnalytic(aF2, aSp, aFace,
616 aStPF, pPaveFiller->Context());
619 bFound = Standard_True;
625 BOPTools_Tools3D::GetBiNormal (aSp, aFace, aDBF1);
626 BOPTools_Tools3D::GetNormalToFaceOnEdge (aSp, aF2, aDNF2);
628 Standard_Real aTolScPr, aScPr;
633 if (fabs(aScPr) > aTolScPr) {
640 bFound = Standard_True;
652 return Standard_False;
655 return Standard_True;
658 // ------------------------------------------------------------------------------------
659 // static function: IsEdgeValidForFace
661 // ------------------------------------------------------------------------------------
662 Standard_Boolean IsEdgeValidForFace(const Standard_Integer theEdgeIndex,
663 const Standard_Integer theFaceIndex,
664 BOPTools_SSInterference& theFF,
665 const BOPTools_DSFiller& theDSFiller)
668 const BOPTools_PaveFiller& aPaveFiller = theDSFiller.PaveFiller();
669 BOPTools_PaveFiller* pPaveFiller = (BOPTools_PaveFiller*)&aPaveFiller;
670 BOPTools_CommonBlockPool& aCBPool = pPaveFiller->ChangeCommonBlockPool();
672 BOPTools_SequenceOfCurves& aSCvs=theFF.Curves();
673 Standard_Integer aNbCurves=aSCvs.Length();
674 Standard_Integer i = 0;
676 for (i=1; i<=aNbCurves; i++) {
677 BOPTools_Curve& aBC=aSCvs(i);
678 const BOPTools_ListOfPaveBlock& aSectEdges=aBC.NewPaveBlocks();
680 BOPTools_ListIteratorOfListOfPaveBlock aPBIt(aSectEdges);
682 for (; aPBIt.More(); aPBIt.Next()) {
683 BOPTools_PaveBlock& aPB = aPBIt.Value();
685 if(theEdgeIndex == aPB.Edge())
686 return Standard_True;
691 for(i = 1; i <= aCBPool.Length(); i++) {
692 const BOPTools_ListOfCommonBlock& aCBList = aCBPool.Value(i);
693 BOPTools_ListIteratorOfListOfCommonBlock anItCB(aCBList);
695 for (; anItCB.More(); anItCB.Next()) {
696 BOPTools_CommonBlock& aCB=anItCB.Value();
697 Standard_Integer nFace = aCB.Face();
699 if(nFace == theFaceIndex) {
700 const BOPTools_PaveBlock& aPB1 = aCB.PaveBlock1();
701 const BOPTools_PaveBlock& aPB2 = aCB.PaveBlock2();
703 if((theEdgeIndex == aPB1.Edge()) ||
704 (theEdgeIndex == aPB2.Edge())) {
705 return Standard_True;
712 return Standard_False;