2 // IMPROVED by NIZNHY-PKV Thu Oct 12 16:03:33 2006
4 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 2.1 of the License.
12 // This library is distributed in the hope that it will be useful
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Lesser General Public License for more details.
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File: NMTTools_PaveFiller_6.cxx
24 // Created: Fri Dec 19 10:27:31 2003
25 // Author: Peter KURNEV
28 #include <NMTTools_PaveFiller.ixx>
30 #include <Precision.hxx>
32 #include <TColStd_IndexedMapOfInteger.hxx>
33 #include <TColStd_MapOfInteger.hxx>
34 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
35 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
36 #include <TColStd_ListOfInteger.hxx>
37 #include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
38 #include <TColStd_ListIteratorOfListOfInteger.hxx>
40 #include <Geom_TrimmedCurve.hxx>
41 #include <Geom2d_TrimmedCurve.hxx>
42 #include <Geom2d_Curve.hxx>
43 #include <GeomAdaptor_Curve.hxx>
45 #include <BndLib_Add3dCurve.hxx>
47 #include <TopoDS_Face.hxx>
49 #include <TopoDS_Compound.hxx>
50 #include <TopoDS_Vertex.hxx>
51 #include <TopoDS_Edge.hxx>
55 #include <BRepLib.hxx>
56 #include <BRep_Builder.hxx>
57 #include <BRep_Tool.hxx>
58 #include <BRepBndLib.hxx>
60 #include <TopTools_IndexedMapOfShape.hxx>
61 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
62 #include <TopTools_ListOfShape.hxx>
63 #include <TopTools_ListIteratorOfListOfShape.hxx>
65 #include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
66 #include <BOPTColStd_IndexedDataMapOfIntegerInteger.hxx>
68 #include <BooleanOperations_IndexedDataMapOfShapeInteger.hxx>
69 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
70 #include <BooleanOperations_OnceExplorer.hxx>
71 #include <BooleanOperations_ShapesDataStructure.hxx>
73 #include <IntTools_SequenceOfPntOn2Faces.hxx>
74 #include <IntTools_SequenceOfCurves.hxx>
75 #include <IntTools_FaceFace.hxx>
76 #include <IntTools_Tools.hxx>
77 #include <IntTools_ShrunkRange.hxx>
79 #include <BOPTools_CArray1OfSSInterference.hxx>
80 //#include <BOPTools_ListIteratorOfListOfInterference.hxx>
81 //#include <BOPTools_CArray1OfInterferenceLine.hxx>
82 //#include <BOPTools_InterferenceLine.hxx>
83 //#include <BOPTools_ListOfInterference.hxx>
84 //#include <BOPTools_Interference.hxx>
86 #include <BOPTools_SSInterference.hxx>
87 #include <BOPTools_ListOfPaveBlock.hxx>
88 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
89 #include <BOPTools_PaveBlock.hxx>
90 #include <BOPTools_ListIteratorOfListOfPave.hxx>
91 #include <BOPTools_Tools.hxx>
92 #include <BOPTools_PaveBlockIterator.hxx>
93 #include <BOPTools_Tools2D.hxx>
95 #include <NMTDS_Iterator.hxx>
96 #include <NMTDS_ShapesDataStructure.hxx>
97 #include <NMTDS_InterfPool.hxx>
99 #include <NMTTools_Tools.hxx>
100 #include <NMTTools_IndexedDataMapOfShapePaveBlock.hxx>
101 #include <NMTTools_CommonBlockAPI.hxx>
102 #include <NMTTools_DataMapOfIntegerListOfPaveBlock.hxx>
103 #include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
105 #include <NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock.hxx>
106 #include <NMTTools_MapOfPaveBlock.hxx>
108 // Modified Thu Sep 14 14:35:18 2006
109 // Contribution of Samtech www.samcef.com BEGIN
111 void SharedEdges1(const TopoDS_Face& aF1,
112 const TopoDS_Face& aF2,
113 TopTools_ListOfShape& aLS);
114 // Contribution of Samtech www.samcef.com END
116 //modified by NIZNHY-PKV Mon Dec 4 12:56:04 2006f
118 Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
119 IntTools_Context& aCtx);
120 //modified by NIZNHY-PKV Mon Dec 4 12:56:08 2006t
122 //=======================================================================
123 // function: PerformFF
125 //=======================================================================
126 void NMTTools_PaveFiller::PerformFF()
128 myIsDone=Standard_False;
130 Standard_Boolean bJustAdd;//, bIsComputed, bIsFound;
131 Standard_Integer n1, n2, anIndexIn, nF1, nF2, aBlockLength, aNbFFs;
132 Standard_Boolean bToApproxC3d, bToApproxC2dOnS1, bToApproxC2dOnS2, bIsDone;
133 Standard_Integer aNbCurves, aNbPoints;
134 Standard_Real anApproxTol, aTolR3D, aTolR2D;
135 BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger aMapWhat, aMapWith;
136 IntTools_SequenceOfPntOn2Faces aPnts;
137 IntTools_SequenceOfCurves aCvs;
138 BooleanOperations_KindOfInterference aTypeFF=BooleanOperations_SurfaceSurface;
140 BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
142 // F/F Interferences [BooleanOperations_SurfaceSurface]
143 myDSIt->Initialize(TopAbs_FACE, TopAbs_FACE);
145 // BlockLength correction
146 aNbFFs=myDSIt->BlockLength();
147 aBlockLength=aFFs.BlockLength();
148 if (aNbFFs > aBlockLength) {
149 aFFs.SetBlockLength(aNbFFs);
152 for (; myDSIt->More(); myDSIt->Next()) {
153 myDSIt->Current(n1, n2, bJustAdd);
155 //bIsComputed=myIntrPool->IsComputed(n1, n2);
171 bIsFound=IsPairFound(nF1, nF2, myIntrPool, aMapWhat, aMapWith);
174 myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
177 BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
178 anIndexIn=aFFs.Append(anInterf);
179 myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
185 const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
186 const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
189 bToApproxC3d = mySectionAttribute.Approximation();
190 bToApproxC2dOnS1 = mySectionAttribute.PCurveOnS1();
191 bToApproxC2dOnS2 = mySectionAttribute.PCurveOnS2();
195 IntTools_FaceFace aFF;
197 aFF.SetParameters (bToApproxC3d, bToApproxC2dOnS1,
198 bToApproxC2dOnS2, anApproxTol);
200 aFF.Perform(aF1, aF2);
202 bIsDone=aFF.IsDone();
208 myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
211 BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
212 anIndexIn=aFFs.Append(anInterf);
213 myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
219 aTolR3D=aFF.TolReached3d();
220 aTolR2D=aFF.TolReached2d();
221 if (aTolR3D < 1.e-7){
225 aFF.PrepareLines3D();
227 const IntTools_SequenceOfCurves& aCvsX=aFF.Lines();
228 const IntTools_SequenceOfPntOn2Faces& aPntsX=aFF.Points();
230 aNbCurves=aCvsX.Length();
231 aNbPoints=aPntsX.Length();
233 if (!aNbCurves && !aNbPoints) {
234 BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
235 anIndexIn=aFFs.Append(anInterf);
236 //myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
241 BOPTools_SSInterference anInterf (nF1, nF2, aTolR3D, aTolR2D, aCvsX, aPntsX);
242 anIndexIn=aFFs.Append(anInterf);
243 //myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
246 }// for (; myDSIt.More(); myDSIt.Next())
248 myIsDone=Standard_True;
250 //=======================================================================
251 // function: MakeBlocks
253 //=======================================================================
254 void NMTTools_PaveFiller::MakeBlocks()
256 myIsDone=Standard_False;
258 // Modified Thu Sep 14 14:35:18 2006
259 // Contribution of Samtech www.samcef.com BEGIN
260 Standard_Boolean bIsExistingPaveBlock, bIsValidIn2D, bIsCoincided;
261 // Contribution of Samtech www.samcef.com END
263 Standard_Boolean bIsMicroEdge, bHasES;
264 Standard_Integer i, aNbFFs, nF1, nF2, aBid=0;
265 Standard_Integer nV1, nV2, j, aNbCurves;
266 Standard_Real aTolR3D, aTol2D, aT1, aT2, aTolPPC=Precision::PConfusion();
267 NMTTools_IndexedDataMapOfShapePaveBlock aMEPB;
268 BooleanOperations_IndexedDataMapOfShapeInteger aMapEI;
269 BOPTools_ListIteratorOfListOfPaveBlock anIt;
271 BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
273 aNbFFs=aFFs.Extent();
275 NMTTools_DataMapOfIntegerListOfPaveBlock aMFInOn;
276 NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock aItMF;
279 Standard_Integer aNbS, aNbF, nF, aNbOn, nSp;
280 TopAbs_ShapeEnum aType;
281 BOPTools_ListIteratorOfListOfPaveBlock anItPB;
282 NMTTools_ListIteratorOfListOfCommonBlock aItCB;
283 TColStd_ListIteratorOfListOfInteger aItF;
285 aNbS=myDS->NumberOfShapesOfTheObject();
286 for (i=1; i<=aNbS; ++i) {
287 const TopoDS_Shape& aS=myDS->Shape(i);
288 aType=aS.ShapeType();
290 if (aType==TopAbs_EDGE) {
291 const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(i));
292 aItCB.Initialize(aLCB);
293 for (; aItCB.More(); aItCB.Next()) {
294 const NMTTools_CommonBlock& aCB=aItCB.Value();
295 const BOPTools_PaveBlock &aPB1=aCB.PaveBlock1();
297 const TColStd_ListOfInteger& aLF=aCB.Faces();
300 aItF.Initialize(aLF);
301 for (; aItF.More(); aItF.Next()) {
303 if (aMFInOn.IsBound(nF)) {
304 BOPTools_ListOfPaveBlock& aLPB=aMFInOn.ChangeFind(nF);
308 BOPTools_ListOfPaveBlock aLPB;
310 aMFInOn.Bind(nF, aLPB);
314 } // for (; aItCB.More(); aItCB.Next()) {
315 }//if (aS.ShapeType()==TopAbs_EDGE) {
317 else if (aType==TopAbs_FACE) {
318 BOPTools_ListOfPaveBlock aLPBOn;
321 RealSplitsFace(nF, aLPBOn);
323 aNbOn=aLPBOn.Extent();
325 if (aMFInOn.IsBound(nF)) {
326 BOPTools_ListOfPaveBlock& aLPB=aMFInOn.ChangeFind(nF);
330 aMFInOn.Bind(nF, aLPBOn);
334 } // for (i=1; i<=aNbS; ++i) {
336 // Refine ListOfPaveBlocks
337 aItMF.Initialize(aMFInOn);
338 for(; aItMF.More(); aItMF.Next()) {
339 TColStd_MapOfInteger aMTmp;
340 BOPTools_ListOfPaveBlock aLPBX;
343 BOPTools_ListOfPaveBlock& aLPB=aMFInOn.ChangeFind(nF);
344 anItPB.Initialize(aLPB);
345 for (; anItPB.More(); anItPB.Next()) {
346 const BOPTools_PaveBlock& aPB=anItPB.Value();
348 if (aMTmp.Add(nSp)) {
358 // 1. Produce Section Edges from intersection curves
359 // between each pair of faces
360 aNbFFs=aFFs.Extent();
362 for (i=1; i<=aNbFFs; ++i) {
363 BOPTools_SSInterference& aFFi=aFFs(i);
366 aFFi.Indices(nF1, nF2);
367 const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
368 const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
370 BOPTools_ListOfPaveBlock aLPB;
374 BOPTools_ListIteratorOfListOfPaveBlock anItPB;
375 NMTTools_MapOfPaveBlock aMPB;
377 if (aMFInOn.IsBound(nF1)) {
378 const BOPTools_ListOfPaveBlock& aLPBF1=aMFInOn.Find(nF1);
379 anItPB.Initialize(aLPBF1);
380 for (; anItPB.More(); anItPB.Next()) {
381 const BOPTools_PaveBlock& aPB=anItPB.Value();
387 if (aMFInOn.IsBound(nF2)) {
388 const BOPTools_ListOfPaveBlock& aLPBF2=aMFInOn.Find(nF2);
389 anItPB.Initialize(aLPBF2);
390 for (; anItPB.More(); anItPB.Next()) {
391 const BOPTools_PaveBlock& aPB=anItPB.Value();
392 if (aMPB.Contains(aPB)) {
393 aFFi.AppendBlock(aPB);
403 TopTools_ListOfShape aLSE;
404 TColStd_ListOfInteger aLNE;
405 SharedEdges(nF1, nF2, aLNE, aLSE);
406 aFFi.SetSharedEdges(aLNE);
408 BOPTools_SequenceOfCurves& aSCvs=aFFi.Curves();
409 aNbCurves=aSCvs.Length();
414 // Contribution of Samtech www.samcef.com END
415 aTolR3D=aFFi.TolR3D();
416 aTol2D=(aTolR3D < 1.e-3) ? 1.e-3 : aTolR3D;
418 BOPTools_PaveSet aPSF;
420 PrepareSetForFace (nF1, nF2, aLPB, aPSF);
422 // Put Paves On Curves
423 for (j=1; j<=aNbCurves; ++j) {
424 BOPTools_Curve& aBC=aSCvs(j);
426 const IntTools_Curve& aC=aBC.Curve();
427 Handle (Geom_Curve) aC3D= aC.Curve();
429 PutPaveOnCurve (aPSF, aTolR3D, aBC);
432 // Put bounding paves on curves
433 for (j=1; j<=aNbCurves; ++j) {
434 BOPTools_Curve& aBC=aSCvs(j);
435 PutBoundPaveOnCurve (aBC, aFFi);
438 // Pave Blocks on Curves
439 bHasES=Standard_False;
440 for (j=1; j<=aNbCurves; ++j) {
441 BOPTools_Curve& aBC=aSCvs(j);
442 const IntTools_Curve& aIC= aBC.Curve();
443 BOPTools_PaveSet& aPaveSet=aBC.Set();
445 BOPTools_PaveBlockIterator aPBIter(0, aPaveSet);
446 for (; aPBIter.More(); aPBIter.Next()) {
447 BOPTools_PaveBlock& aPBNew=aPBIter.Value();
448 aPBNew.SetCurve(aIC);
449 aPBNew.SetFace1(nF1);
450 aPBNew.SetFace2(nF2);
452 nV1=aPBNew.Pave1().Index();
453 nV2=aPBNew.Pave2().Index();
454 aT1=aPBNew.Pave1().Param();
455 aT2=aPBNew.Pave2().Param();
457 if((nV1==nV2) && (Abs(aT2 - aT1) < aTolPPC)) {
458 continue;// mkk ft ???
462 bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLPB, aTolR3D);
463 if (bIsExistingPaveBlock) {
467 bIsCoincided=CheckCoincidence(aPBNew, aLPB);
473 // to provide checking whether aPBNew already exists in list
474 // of section edges aLSE
475 // Thu Sep 14 14:35:18 2006
476 // Contribution of Samtech www.samcef.com BEGIN
478 bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLSE, aTolR3D);
479 if (bIsExistingPaveBlock) {
482 // Contribution of Samtech www.samcef.com END
484 // Checking of validity in 2D
486 bIsValidIn2D=myContext.IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTol2D);
495 const TopoDS_Vertex aV1=TopoDS::Vertex(myDS->Shape(nV1));//mpv
496 const TopoDS_Vertex aV2=TopoDS::Vertex(myDS->Shape(nV2));//mpv
498 BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
500 NMTTools_Tools::UpdateEdge (aES, aTolR3D);
501 bIsMicroEdge=IsMicroEdge(aES, myContext);
508 Handle(Geom2d_Curve) aC2D1, aC2D2;
510 aC2D1=aIC.FirstCurve2d();
511 aC2D2=aIC.SecondCurve2d();
513 NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
514 NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
517 aMEPB.Add(aES, aPBNew);
520 bHasES=Standard_True;
521 }// for (; aPBIter.More(); aPBIter.Next())
522 } // end of for (j=1; j<=aNbCurves; ++j)
525 myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
528 }// for (i=1; i<=aNbFFs; ++i)
529 //=============================================================
531 // II. Post treatment
533 // Input data: aMEPB, aMapEI
534 // Result : section edges in myDS
536 Standard_Integer aNbSE;
538 aNbSE=aMEPB.Extent();
540 // there is nothing to do here
545 TopoDS_Compound aCompound;
547 // 1. Make compound from SE
548 aBB.MakeCompound(aCompound);
549 for (i=1; i<=aNbSE; ++i) {
550 const TopoDS_Shape& aSE=aMEPB.FindKey(i);
551 aBB.Add(aCompound, aSE);
555 // 2. Intersect SE using auxiliary Filler
556 NMTTools_PaveFiller tPF;
558 tPF.SetCompositeShape(aCompound);
563 //tPF.PerformNewVertices(); qq
566 tPF.myPavePool.Resize (tPF.myNbEdges);
574 tPF.myCommonBlockPool.Resize (tPF.myNbEdges);
575 tPF.mySplitShapesPool.Resize (tPF.myNbEdges);
576 tPF.myPavePoolNew .Resize (tPF.myNbEdges);
578 tPF.PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
579 tPF.PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
583 tPF.RefinePavePool ();
585 tPF.myPavePoolNew.Destroy();
587 tPF.MakeSplitEdges();
588 tPF.UpdateCommonBlocks();
590 // 3. Treatment of the result of intersection
592 Standard_Integer aNbOld, aNbLines, aNbPB, mV1, mV2, nE, mE, iFF;
593 TopAbs_ShapeEnum aType;
594 BOPTools_ListIteratorOfListOfPaveBlock aIt;
595 BOPTColStd_IndexedDataMapOfIntegerInteger aMNewOld;
597 const NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
598 const BOPTools_SplitShapesPool& aSSP=tPF.mySplitShapesPool;
599 const NMTTools_CommonBlockPool& aCBP=tPF.myCommonBlockPool;
601 aNbLines=tDS.NumberOfInsertedShapes();
602 aNbOld=tDS.NumberOfShapesOfTheObject();
604 // 3.1 Links between indices in tDS and DS (kept in aMNewOld)
606 // 3.1.1.Old vertices [ links ]
607 for (i=1; i<=aNbOld; ++i) {
608 const TopoDS_Shape& aV=tDS.Shape(i);
609 aType=aV.ShapeType();
610 if (aType!=TopAbs_VERTEX) {
614 for (j=1; j<=aNbSE; ++j) {
615 const BOPTools_PaveBlock& aPBSE=aMEPB(j);
616 nV1=aPBSE.Pave1().Index();
617 const TopoDS_Shape aV1=myDS->Shape(nV1);//mpv
618 if (aV1.IsSame(aV)) {
619 aMNewOld.Add(i, nV1);
622 nV2=aPBSE.Pave2().Index();
623 const TopoDS_Shape aV2=myDS->Shape(nV2);//mpv
624 if (aV2.IsSame(aV)) {
625 aMNewOld.Add(i, nV2);
631 // 3.1.2. New vertices [ links ]
632 i=tDS.NumberOfSourceShapes()+1;
633 for (; i<=aNbLines; ++i) {
634 const TopoDS_Shape& aV=tDS.Shape(i);
635 aType=aV.ShapeType();
636 if (aType!=TopAbs_VERTEX) {
640 // Insert new vertex in myDS
641 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
642 myDS->InsertShapeAndAncestorsSuccessors(aV, anASSeq);
643 nV1=myDS->NumberOfInsertedShapes();
645 aMNewOld.Add(i, nV1);
648 // 3.2. Treatment of section edges (SE)
649 for (i=1; i<=aNbOld; ++i) {
650 const TopoDS_Shape& aE=tDS.Shape(i);
651 aType=aE.ShapeType();
652 if (aType!=TopAbs_EDGE) {
656 // block of section edge that we already have for this SE
657 BOPTools_PaveBlock& aPBSE=aMEPB.ChangeFromKey(aE);
659 // Corresponding FF-interference
660 iFF=aMapEI.FindFromKey(aE);
661 BOPTools_SSInterference& aFFi=aFFs(iFF);
662 BOPTools_SequenceOfCurves& aSCvs=aFFi.Curves();
664 BOPTools_Curve& aBC=aSCvs(1);
666 const BOPTools_ListOfPaveBlock& aLPB=aSSP(tDS.RefEdge(i));
670 // no pave blocks -> use aPBSE and whole edge aE
671 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
673 nV1=aPBSE.Pave1().Index();
674 const TopoDS_Shape aV1=myDS->Shape(nV1);//mpv
675 nV2=aPBSE.Pave2().Index();
676 const TopoDS_Shape aV2=myDS->Shape(nV2);//mpv
678 anASSeq.SetNewSuccessor(nV1);
679 anASSeq.SetNewOrientation(aV1.Orientation());
680 anASSeq.SetNewSuccessor(nV2);
681 anASSeq.SetNewOrientation(aV2.Orientation());
683 myDS->InsertShapeAndAncestorsSuccessors(aE, anASSeq);
684 nE=myDS->NumberOfInsertedShapes();
687 aBC.AppendNewBlock(aPBSE);
695 const NMTTools_ListOfCommonBlock& aLCB=aCBP(tDS.RefEdge(i));
696 NMTTools_CommonBlockAPI aCBAPI(aLCB);
698 aIt.Initialize(aLPB);
699 for (; aIt.More(); aIt.Next()) {
700 BOPTools_PaveBlock aPB=aIt.Value();
702 const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));
703 const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));
705 if (aCBAPI.IsCommonBlock(aPB)) {
706 // it can be Common Block
707 Standard_Real aTolEx;
708 Handle(Geom2d_Curve) aC2D1, aC2D2;
709 TopoDS_Face aF1FWD, aF2FWD;
711 NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
712 const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
714 aPB=aCB.PaveBlock1();
715 mE=aPB.Edge(); // index of edge in tDS
716 const TopoDS_Edge& aEx=TopoDS::Edge(tDS.Shape(mE));
717 aTolEx=BRep_Tool::Tolerance(aEx);
720 aF1FWD.Orientation(TopAbs_FORWARD);
722 aF2FWD.Orientation(TopAbs_FORWARD);
724 NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1);
725 NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2);
726 NMTTools_Tools::UpdateEdge (aEx, aTolEx);
727 } //if (aCBAPI.IsCommonBlock(aPB))
730 mE=aPB.Edge(); // index of edge in tDS
731 const TopoDS_Shape& aSp=tDS.Shape(mE);
733 const BOPTools_Pave& aPave1=aPB.Pave1();
735 mV1=aPave1.Index(); // index in tDS
736 nV1=aMNewOld.FindFromKey(mV1); // index in myDS
737 const TopoDS_Shape aV1=myDS->Shape(nV1);//mpv
739 const BOPTools_Pave& aPave2=aPB.Pave2();
742 nV2=aMNewOld.FindFromKey(mV2);
743 const TopoDS_Shape aV2=myDS->Shape(nV2);//mpv
745 if (!aMNewOld.Contains(mE)) {
746 // add new SE to the myDS
747 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
749 anASSeq.SetNewSuccessor(nV1);
750 anASSeq.SetNewOrientation(aV1.Orientation());
752 anASSeq.SetNewSuccessor(nV2);
753 anASSeq.SetNewOrientation(aV2.Orientation());
755 myDS->InsertShapeAndAncestorsSuccessors(aSp, anASSeq);
756 nE=myDS->NumberOfInsertedShapes();
758 aMNewOld.Add(mE, nE);
761 nE=aMNewOld.FindFromKey(mE);
764 BOPTools_PaveBlock aPBx;
765 BOPTools_Pave aP1, aP2;
781 aBC.AppendNewBlock(aPBx);
782 }// for (; aIt.More(); aIt.Next())
783 }// for (i=1; i<=aNbOld; ++i)
785 myIsDone=Standard_True;
787 //=======================================================================
788 // function: MakePCurves
790 //=======================================================================
791 void NMTTools_PaveFiller::MakePCurves()
793 Standard_Integer i, aNb, nF1, nF2, nE;
794 Standard_Integer aNbCB, aNbF, nSp, nF;
795 TopAbs_ShapeEnum aType;
796 TopoDS_Face aF1FWD, aF2FWD;
797 TColStd_ListIteratorOfListOfInteger aItF;
798 BOPTools_ListIteratorOfListOfPaveBlock anIt;
799 NMTTools_ListIteratorOfListOfCommonBlock aItCB;
801 BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
804 for (i=1; i<=aNb; i++) {
805 BOPTools_SSInterference& aFF=aFFs(i);
806 aFF.Indices(nF1, nF2);
808 const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
809 const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
812 aF1FWD.Orientation(TopAbs_FORWARD);
814 aF2FWD.Orientation(TopAbs_FORWARD);
816 // In, On parts processing
817 const BOPTools_ListOfPaveBlock& aLPBInOn=aFF.PaveBlocks();
819 anIt.Initialize(aLPBInOn);
820 for (; anIt.More(); anIt.Next()) {
821 const BOPTools_PaveBlock& aPB=anIt.Value();
823 const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv
825 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD);
826 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD);
830 //modified by NIZNHY-PKV Fri Mar 23 10:35:02 2007f
831 // Check common blocks between edges and faces
832 // Build P-Curves if they were not built in previos block.
834 // The main case is :arguments for e.g aEdge, aFace -> no FFs,
835 // but p-curves are needed.
837 aNb=myDS->NumberOfShapesOfTheObject();
838 for (i=1; i<=aNb; ++i) {
839 const TopoDS_Shape& aS=myDS->Shape(i);
840 aType=aS.ShapeType();
842 if (aType!=TopAbs_EDGE) {
845 const TopoDS_Edge& aE=TopoDS::Edge(aS);
847 if (BRep_Tool::Degenerated(aE)) {
851 const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(i));
857 aItCB.Initialize(aLCB);
858 for (; aItCB.More(); aItCB.Next()) {
859 const NMTTools_CommonBlock& aCB=aItCB.Value();
860 const BOPTools_PaveBlock &aPB1=aCB.PaveBlock1();
862 const TColStd_ListOfInteger& aLF=aCB.Faces();
869 const TopoDS_Edge aSp=TopoDS::Edge(myDS->Shape(nSp));//mpv
871 aItF.Initialize(aLF);
872 for (; aItF.More(); aItF.Next()) {
874 aF1FWD=TopoDS::Face(myDS->Shape(nF));
875 aF1FWD.Orientation(TopAbs_FORWARD);
877 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aSp, aF1FWD);
878 } // for (; aItCB.More(); aItCB.Next()) {
879 }//if (aS.ShapeType()==TopAbs_EDGE) {
881 //modified by NIZNHY-PKV Fri Mar 23 10:35:13 2007t
883 //=======================================================================
884 // function: IsExistingPaveBlock
886 //=======================================================================
887 Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
888 const BOPTools_ListOfPaveBlock& aLPBR,
889 const Standard_Real aTolR3D)
891 Standard_Boolean bFlag;
892 Standard_Integer nVNew1, nVNew2, nV1, nV2, iC;
893 BOPTools_ListIteratorOfListOfPaveBlock anIt;
895 bFlag=Standard_False;
896 nVNew1=aPBNew.Pave1().Index();
897 nVNew2=aPBNew.Pave2().Index();
899 anIt.Initialize(aLPBR);
900 for (; anIt.More(); anIt.Next()) {
901 const BOPTools_PaveBlock& aPBR=anIt.Value();
902 nV1=aPBR.Pave1().Index();
903 nV2=aPBR.Pave2().Index();
904 if (nVNew1==nV1 || nVNew1==nV2 || nVNew2==nV1 || nVNew2==nV2) {
906 iC=CheckIntermediatePoint(aPBNew, aPBR, aTolR3D);
914 //=======================================================================
915 // function: IsExistingPaveBlock
917 //=======================================================================
918 Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
919 const TopTools_ListOfShape& aLSE,
920 const Standard_Real aTolR3D)
922 Standard_Boolean bFlag;
923 Standard_Integer aNbSE, iC;
924 TopTools_ListIteratorOfListOfShape anIt;
926 bFlag=Standard_False;
933 anIt.Initialize(aLSE);
934 for (; anIt.More(); anIt.Next()) {
935 const TopoDS_Edge& aE=TopoDS::Edge(anIt.Value());
936 iC=CheckIntermediatePoint(aPBNew, aE, aTolR3D);
943 //=======================================================================
944 // function: CheckIntermediatePoint
946 //=======================================================================
947 Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
948 const BOPTools_PaveBlock& aPBR,
949 const Standard_Real aTolC)
952 Standard_Integer iVM, nE2;
955 const TopoDS_Edge aE2=TopoDS::Edge(myDS->Shape(nE2));//mpv
956 iVM=CheckIntermediatePoint(aPB, aE2, aTolC);
960 //=======================================================================
961 // function: CheckIntermediatePoint
963 //=======================================================================
964 Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
965 const TopoDS_Edge& aE2,
966 const Standard_Real aTolC)
968 Standard_Real aT11, aT12, aTM, aTmp;
969 Standard_Integer iVM;
975 const BOPTools_Pave& aPave11=aPB.Pave1();
976 aT11=aPave11.Param();
978 const BOPTools_Pave& aPave12=aPB.Pave2();
979 aT12=aPave12.Param();
981 aTM=IntTools_Tools::IntermediatePoint (aT11, aT12);
983 const IntTools_Curve& aIC=aPB.Curve();
986 aBB.MakeVertex (aVM, aPM, aTolC);
988 iVM=myContext.ComputeVE(aVM, aE2, aTmp);
992 //=======================================================================
993 // function: PutBoundPaveOnCurve
995 //=======================================================================
996 void NMTTools_PaveFiller::PutBoundPaveOnCurve(BOPTools_Curve& aBC,
997 BOPTools_SSInterference& aFFi)
999 Standard_Boolean bHasBounds, bVF;
1000 Standard_Integer nF1, nF2;
1001 Standard_Real aT1, aT2, aTolR3D;
1004 const IntTools_Curve& aIC=aBC.Curve();
1005 bHasBounds=aIC.HasBounds ();
1011 aIC.Bounds (aT1, aT2, aP1, aP2);
1014 aFFi.Indices(nF1, nF2);
1015 aTolR3D=aFFi.TolR3D();
1017 const TopoDS_Face aF1=TopoDS::Face(myDS->GetShape(nF1));//mpv
1018 const TopoDS_Face aF2=TopoDS::Face(myDS->GetShape(nF2));//mpv
1020 bVF=myContext.IsValidPointForFaces (aP1, aF1, aF2, aTolR3D);
1022 PutBoundPaveOnCurve (aP1, aT1, aBC, aFFi);
1025 bVF=myContext.IsValidPointForFaces (aP2, aF1, aF2, aTolR3D);
1027 PutBoundPaveOnCurve (aP2, aT2, aBC, aFFi);
1030 //=======================================================================
1031 // function: PutBoundPaveOnCurve
1033 //=======================================================================
1034 void NMTTools_PaveFiller::PutBoundPaveOnCurve(const gp_Pnt& aP,
1035 const Standard_Real aT,
1036 BOPTools_Curve& aBC,
1037 BOPTools_SSInterference& aFFi)
1039 Standard_Boolean bFound1, bFound2;
1040 Standard_Integer nV;
1041 Standard_Real aTolV=aFFi.TolR3D();
1043 BOPTools_Pave aPave1, aPave2, aPave;
1044 BOPTools_PaveSet& aCPS=aBC.Set();
1045 BOPTools_PaveSet& aFFiPS=aFFi.NewPaveSet();
1046 const IntTools_Curve& aIC=aBC.Curve();
1048 bFound1=FindPave(aP, aTolV, aCPS , aPave1);
1049 bFound2=FindPave(aP, aTolV, aFFiPS, aPave2);
1051 if (!bFound1 && !bFound2) {
1052 TopoDS_Vertex aNewVertex;
1053 BOPTools_Tools::MakeNewVertex(aP, aTolV, aNewVertex);
1055 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
1056 myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
1057 nV=myDS->NumberOfInsertedShapes();
1062 aFFiPS.Append(aPave);
1064 // Append Techno Vertex to the Curve
1065 TColStd_ListOfInteger& aTVs=aBC.TechnoVertices();
1068 if (bFound1 && !bFound2) {
1072 aFFiPS.Append(aPave);
1074 const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));//mpv
1075 BOPTools_Tools::UpdateVertex (aIC, aT, aV);
1078 if (!bFound1 && bFound2) {
1084 const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));//mpv
1085 BOPTools_Tools::UpdateVertex (aIC, aT, aV);
1088 //=======================================================================
1089 // function: FindPave
1091 //=======================================================================
1092 Standard_Boolean NMTTools_PaveFiller::FindPave(const gp_Pnt& aP,
1093 const Standard_Real aTolPV,
1094 const BOPTools_PaveSet& aPS,
1095 BOPTools_Pave& aPave)
1097 Standard_Integer nV;
1098 Standard_Boolean bIsVertex=Standard_False;
1100 const BOPTools_ListOfPave& aLP=aPS.Set();
1101 BOPTools_ListIteratorOfListOfPave anIt(aLP);
1102 for (; anIt.More(); anIt.Next()) {
1103 const BOPTools_Pave& aPC=anIt.Value();
1105 const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));//mpv
1106 bIsVertex=IntTools_Tools::IsVertex (aP, aTolPV, aV);
1114 //=======================================================================
1115 // function: PrepareSetForFace
1117 //=======================================================================
1118 void NMTTools_PaveFiller::PrepareSetForFace(const Standard_Integer ,//nF1,
1119 const Standard_Integer ,//nF2,
1120 const BOPTools_ListOfPaveBlock& aLPBC,
1121 BOPTools_PaveSet& aPSF)
1123 Standard_Integer nV1, nV2;
1124 TColStd_MapOfInteger aMap;
1125 BOPTools_ListIteratorOfListOfPaveBlock anIt;
1127 anIt.Initialize(aLPBC);
1128 for (; anIt.More(); anIt.Next()) {
1129 const BOPTools_PaveBlock& aPB=anIt.Value();
1130 const BOPTools_Pave& aPave1=aPB.Pave1();
1132 if (!aMap.Contains(nV1)) {
1134 aPSF.Append(aPave1);
1136 const BOPTools_Pave& aPave2=aPB.Pave2();
1138 if (!aMap.Contains(nV2)) {
1140 aPSF.Append(aPave2);
1144 //=======================================================================
1145 // function: PutPaveOnCurve
1147 //=======================================================================
1148 void NMTTools_PaveFiller::PutPaveOnCurve(const BOPTools_PaveSet& aPaveSet,
1149 const Standard_Real aTolR3D,
1150 BOPTools_Curve& aBC)
1152 Standard_Integer nV;
1153 Standard_Boolean bIsVertexOnLine;
1155 BOPTools_ListIteratorOfListOfPave anIt;
1157 GeomAdaptor_Curve aGAC;
1159 const IntTools_Curve& aC=aBC.Curve();
1160 Handle (Geom_Curve) aC3D= aC.Curve();
1162 BndLib_Add3dCurve::Add(aGAC, aTolR3D, aBBC);
1164 const BOPTools_ListOfPave& aLP=aPaveSet.Set();
1165 anIt.Initialize(aLP);
1166 for (; anIt.More(); anIt.Next()) {
1167 const BOPTools_Pave& aPave=anIt.Value();
1170 const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));//mpv
1173 BRepBndLib::Add(aV, aBBV);
1174 if (aBBC.IsOut(aBBV)){
1178 bIsVertexOnLine=myContext.IsVertexOnLine(aV, aC, aTolR3D, aT);
1180 if (bIsVertexOnLine) {
1181 BOPTools_Pave aPaveNew(nV, aT, BooleanOperations_SurfaceSurface);
1182 BOPTools_PaveSet& aPS=aBC.Set();
1183 aPS.Append(aPaveNew);
1185 BOPTools_Tools::UpdateVertex (aC, aT, aV);
1192 // Modified Thu Sep 14 14:35:18 2006
1193 // Contribution of Samtech www.samcef.com BEGIN
1194 //=======================================================================
1195 //function : SharedEdges1
1197 //=======================================================================
1198 void SharedEdges1(const TopoDS_Face& aF1,
1199 const TopoDS_Face& aF2,
1200 TopTools_ListOfShape& aLS)
1202 Standard_Integer i, aNbE, aNbF;;
1203 TopTools_IndexedDataMapOfShapeListOfShape aMEF;
1205 TopExp::MapShapesAndAncestors(aF1, TopAbs_EDGE, TopAbs_FACE, aMEF);
1206 TopExp::MapShapesAndAncestors(aF2, TopAbs_EDGE, TopAbs_FACE, aMEF);
1209 for (i=1; i<=aNbE; ++i) {
1210 const TopTools_ListOfShape& aLF=aMEF.FindFromIndex(i);
1214 const TopoDS_Shape& aF1x=aLF.First();
1215 const TopoDS_Shape& aF2x=aLF.Last();
1216 if (aF1x.IsSame(aF2x)) {
1220 const TopoDS_Shape& aE=aMEF.FindKey(i);
1226 //=======================================================================
1227 // function: CheckCoincidence
1229 //=======================================================================
1230 Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock& aPBNew,
1231 const BOPTools_ListOfPaveBlock& aLPBFF)
1234 Standard_Boolean bRet;
1236 Standard_Integer nV11, nV12, nV21, nV22, iVV, iVE, nE2;
1237 Standard_Integer iV, iCount, iCountExt;
1238 BOPTools_ListIteratorOfListOfPaveBlock anIt;
1240 const BOPTools_Pave& aPave11=aPBNew.Pave1();
1241 nV11=aPave11.Index();
1242 const TopoDS_Vertex& aV11=TopoDS::Vertex(myDS->Shape(nV11));
1245 const BOPTools_Pave& aPave12=aPBNew.Pave2();
1246 nV12=aPave12.Index();
1247 const TopoDS_Vertex& aV12=TopoDS::Vertex(myDS->Shape(nV12));
1251 anIt.Initialize(aLPBFF);
1252 for (; anIt.More(); anIt.Next()) {
1255 const BOPTools_PaveBlock& aPBR=anIt.Value();
1257 const BOPTools_Pave& aPave21=aPBR.Pave1();
1258 nV21=aPave21.Index();
1261 const BOPTools_Pave& aPave22=aPBR.Pave2();
1262 nV22=aPave22.Index();
1264 if (nV11==nV21 || nV11==nV22 || nV12==nV21 || nV12==nV22) {
1271 const TopoDS_Vertex& aV21=TopoDS::Vertex(myDS->Shape(nV21));
1272 const TopoDS_Vertex& aV22=TopoDS::Vertex(myDS->Shape(nV22));
1273 const TopoDS_Edge& aE2=TopoDS::Edge(myDS->Shape(nE2));
1277 iVV=IntTools_Tools::ComputeVV (aV11, aV21);
1281 if (iCount>iCountExt) {
1286 iVV=IntTools_Tools::ComputeVV (aV11, aV22);
1290 if (iCount>iCountExt) {
1296 iVE=myContext.ComputeVE (aV11, aE2, aTE);
1299 if (iCount>iCountExt) {
1306 iVV=IntTools_Tools::ComputeVV (aV12, aV21);
1310 if (iCount>iCountExt) {
1315 iVV=IntTools_Tools::ComputeVV (aV12, aV22);
1319 if (iCount>iCountExt) {
1325 iVE=myContext.ComputeVE (aV12, aE2, aTE);
1328 if (iCount>iCountExt) {
1334 bRet=(Standard_Boolean)(iCount>iCountExt);
1338 // Contribution of Samtech www.samcef.com END
1340 //modified by NIZNHY-PKV Mon Dec 4 12:30:38 2006f use_01
1341 //=======================================================================
1342 //function : IsMicroEdge
1344 //=======================================================================
1345 Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
1346 IntTools_Context& aCtx)
1348 Standard_Boolean bRet;
1349 Standard_Integer iErr;
1350 Standard_Real aT1, aT2, aTmp;
1351 Handle(Geom_Curve) aC3D;
1352 TopoDS_Vertex aV1, aV2;
1355 bRet=(BRep_Tool::Degenerated(aE) ||
1356 !BRep_Tool::IsGeometric(aE));
1361 aC3D=BRep_Tool::Curve(aE, aT1, aT2);
1362 TopExp::Vertices(aE, aV1, aV2);
1363 aT1=BRep_Tool::Parameter(aV1, aE);
1364 aT2=BRep_Tool::Parameter(aV2, aE);
1373 IntTools_ShrunkRange aSR (aE, aV1, aV2, aR, aCtx);
1374 iErr=aSR.ErrorStatus();
1379 //modified by NIZNHY-PKV Mon Dec 4 12:55:50 2006t
1382 Standard_Boolean IsPairFound(const Standard_Integer nF1,
1383 const Standard_Integer nF2,
1384 BOPTools_InterferencePool* myIntrPool,
1385 BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
1386 BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith);
1389 void FMapWhat(const Standard_Integer nF,
1390 BOPTools_InterferencePool* myIntrPool,
1391 TColStd_IndexedMapOfInteger& aMapWhat);
1393 void FMapWith(const Standard_Integer nF,
1394 BOPTools_InterferencePool* myIntrPool,
1395 TColStd_IndexedMapOfInteger& aMapWith);
1397 Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
1398 const TColStd_IndexedMapOfInteger& aMapWith);
1400 //=======================================================================
1401 // function: IsPairFound
1403 //=======================================================================
1404 Standard_Boolean IsPairFound(const Standard_Integer nF1,
1405 const Standard_Integer nF2,
1406 BOPTools_InterferencePool* myIntrPool,
1407 BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
1408 BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith)
1410 Standard_Boolean bIsFound;
1412 if (!aMapWhat.Contains(nF1)) {
1413 TColStd_IndexedMapOfInteger aMWhat;
1414 FMapWhat(nF1, myIntrPool, aMWhat);
1415 aMapWhat.Add(nF1, aMWhat);
1418 if (!aMapWith.Contains(nF2)) {
1419 TColStd_IndexedMapOfInteger aMWith;
1420 FMapWith(nF2, myIntrPool, aMWith);
1421 aMapWith.Add(nF2, aMWith);
1424 const TColStd_IndexedMapOfInteger& aMWht=aMapWhat.FindFromKey(nF1);
1425 const TColStd_IndexedMapOfInteger& aMWit=aMapWith.FindFromKey(nF2);
1427 bIsFound=IsFound(aMWht, aMWit);
1431 //=======================================================================
1432 // function: FMapWhat
1434 //=======================================================================
1435 void FMapWhat(const Standard_Integer nF,
1436 BOPTools_InterferencePool* myIntrPool,
1437 TColStd_IndexedMapOfInteger& aMapWhat)
1440 Standard_Integer nE, nV;
1442 BooleanOperations_ShapesDataStructure* myDS=myIntrPool->DS();
1443 BooleanOperations_OnceExplorer aExp(*myDS);
1447 aExp.Init(nF, TopAbs_VERTEX);
1448 for (; aExp.More(); aExp.Next()) {
1453 aExp.Init(nF, TopAbs_EDGE);
1454 for (; aExp.More(); aExp.Next()) {
1459 //=======================================================================
1460 // function: FMapWith
1462 //=======================================================================
1463 void FMapWith(const Standard_Integer nF,
1464 BOPTools_InterferencePool* myIntrPool,
1465 TColStd_IndexedMapOfInteger& aMapWith)
1467 TColStd_IndexedMapOfInteger aMapWhat;
1469 FMapWhat(nF, myIntrPool, aMapWhat);
1472 Standard_Integer i, aNb, anIndex, aWhat, aWith;
1473 BOPTools_ListIteratorOfListOfInterference anIt;
1475 const BOPTools_CArray1OfInterferenceLine& anArrIL= myIntrPool->InterferenceTable();
1477 aNb=aMapWhat.Extent();
1478 for (i=1; i<=aNb; i++) {
1481 const BOPTools_InterferenceLine& aWithLine=anArrIL(aWhat);
1483 const BOPTools_ListOfInterference& aLI=aWithLine.List();
1484 anIt.Initialize(aLI);
1485 for (; anIt.More(); anIt.Next()) {
1486 const BOPTools_Interference& anIntf=anIt.Value();
1487 anIndex=anIntf.Index();
1489 aWith=anIntf.With();
1490 aMapWith.Add(aWith);
1495 //=======================================================================
1496 // function: IsFound
1498 //=======================================================================
1499 Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
1500 const TColStd_IndexedMapOfInteger& aMapWith)
1502 Standard_Boolean bFlag=Standard_False;
1503 Standard_Integer i, aNb, aWhat;
1505 aNb=aMapWhat.Extent();
1506 for (i=1; i<=aNb; i++) {
1508 if (aMapWith.Contains(aWhat)) {