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.
19 #include <Bnd_Box.hxx>
20 #include <BOPAlgo_PaveFiller.hxx>
21 #include <BOPAlgo_Tools.hxx>
22 #include <BOPCol_NCVector.hxx>
23 #include <BOPCol_Parallel.hxx>
24 #include <BOPDS_CommonBlock.hxx>
25 #include <BOPDS_CoupleOfPaveBlocks.hxx>
26 #include <BOPDS_DS.hxx>
27 #include <BOPDS_Interf.hxx>
28 #include <BOPDS_Iterator.hxx>
29 #include <BOPDS_MapOfPaveBlock.hxx>
30 #include <BOPDS_Pave.hxx>
31 #include <BOPDS_PaveBlock.hxx>
32 #include <BOPDS_VectorOfInterfEE.hxx>
33 #include <BOPTools_AlgoTools.hxx>
34 #include <BndLib_Add3dCurve.hxx>
35 #include <BRep_Tool.hxx>
36 #include <BRepAdaptor_Curve.hxx>
38 #include <IntTools_CommonPrt.hxx>
39 #include <IntTools_Context.hxx>
40 #include <IntTools_EdgeEdge.hxx>
41 #include <IntTools_Range.hxx>
42 #include <IntTools_SequenceOfCommonPrts.hxx>
43 #include <IntTools_SequenceOfRanges.hxx>
44 #include <IntTools_ShrunkRange.hxx>
45 #include <IntTools_Tools.hxx>
46 #include <Precision.hxx>
48 #include <TopoDS_Edge.hxx>
49 #include <TopoDS_Vertex.hxx>
51 /////////////////////////////////////////////////////////////////////////
52 //=======================================================================
53 //class : BOPAlgo_EdgeEdge
55 //=======================================================================
56 class BOPAlgo_EdgeEdge :
57 public IntTools_EdgeEdge,
69 virtual ~BOPAlgo_EdgeEdge(){
72 void SetPaveBlock1(const Handle(BOPDS_PaveBlock)& aPB) {
76 Handle(BOPDS_PaveBlock)& PaveBlock1() {
80 void SetPaveBlock2(const Handle(BOPDS_PaveBlock)& aPB) {
84 Handle(BOPDS_PaveBlock)& PaveBlock2() {
88 void SetFuzzyValue(const Standard_Real theFuzz) {
89 IntTools_EdgeEdge::SetFuzzyValue(theFuzz);
92 virtual void Perform() {
93 BOPAlgo_Algo::UserBreak();
94 IntTools_EdgeEdge::Perform();
98 Handle(BOPDS_PaveBlock) myPB1;
99 Handle(BOPDS_PaveBlock) myPB2;
102 //=======================================================================
103 typedef BOPCol_NCVector
104 <BOPAlgo_EdgeEdge> BOPAlgo_VectorOfEdgeEdge;
106 typedef BOPCol_Functor
108 BOPAlgo_VectorOfEdgeEdge> BOPAlgo_EdgeEdgeFunctor;
111 <BOPAlgo_EdgeEdgeFunctor,
112 BOPAlgo_VectorOfEdgeEdge> BOPAlgo_EdgeEdgeCnt;
114 /////////////////////////////////////////////////////////////////////////
115 //=======================================================================
116 // function: PerformEE
118 //=======================================================================
119 void BOPAlgo_PaveFiller::PerformEE()
121 Standard_Integer iSize;
125 FillShrunkData(TopAbs_EDGE, TopAbs_EDGE);
127 myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE);
128 iSize=myIterator->ExpectedLength();
133 Standard_Boolean bExpressCompute, bIsPBSplittable1, bIsPBSplittable2;
134 Standard_Integer i, iX, nE1, nE2, aNbCPrts, k, aNbEdgeEdge;
135 Standard_Integer nV11, nV12, nV21, nV22;
136 Standard_Real aTS11, aTS12, aTS21, aTS22, aT11, aT12, aT21, aT22;
137 TopAbs_ShapeEnum aType;
138 BOPDS_ListIteratorOfListOfPaveBlock aIt1, aIt2;
139 Handle(NCollection_BaseAllocator) aAllocator;
140 BOPAlgo_VectorOfEdgeEdge aVEdgeEdge;
141 BOPDS_MapIteratorOfMapOfPaveBlock aItPB;
142 // keep modified edges for further update
143 BOPCol_MapOfInteger aMEdges;
145 aAllocator=NCollection_BaseAllocator::CommonBaseAllocator();
146 //-----------------------------------------------------scope f
147 BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock aMPBLPB(100, aAllocator);
148 BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator);
149 BOPAlgo_DataMapOfPaveBlockBndBox aDMPBBox(100, aAllocator);
151 BOPDS_VectorOfInterfEE& aEEs=myDS->InterfEE();
152 aEEs.SetIncrement(iSize);
154 for (; myIterator->More(); myIterator->Next()) {
155 myIterator->Value(nE1, nE2);
157 const BOPDS_ShapeInfo& aSIE1=myDS->ShapeInfo(nE1);
158 if (aSIE1.HasFlag()){
161 const BOPDS_ShapeInfo& aSIE2=myDS->ShapeInfo(nE2);
162 if (aSIE2.HasFlag()){
166 BOPDS_ListOfPaveBlock& aLPB1 = myDS->ChangePaveBlocks(nE1);
167 if (aLPB1.IsEmpty()) {
171 BOPDS_ListOfPaveBlock& aLPB2 = myDS->ChangePaveBlocks(nE2);
172 if (aLPB2.IsEmpty()) {
176 const TopoDS_Edge& aE1=(*(TopoDS_Edge *)(&aSIE1.Shape()));
177 const TopoDS_Edge& aE2=(*(TopoDS_Edge *)(&aSIE2.Shape()));
179 aIt1.Initialize(aLPB1);
180 for (; aIt1.More(); aIt1.Next()) {
183 Handle(BOPDS_PaveBlock)& aPB1=aIt1.ChangeValue();
185 if (!GetPBBox(aE1, aPB1, aDMPBBox, aT11, aT12, aTS11, aTS12, aBB1)) {
189 aPB1->Indices(nV11, nV12);
191 aIt2.Initialize(aLPB2);
192 for (; aIt2.More(); aIt2.Next()) {
195 Handle(BOPDS_PaveBlock)& aPB2=aIt2.ChangeValue();
197 if (!GetPBBox(aE2, aPB2, aDMPBBox, aT21, aT22, aTS21, aTS22, aBB2)) {
201 if (aBB1.IsOut(aBB2)) {
205 aPB2->Indices(nV21, nV22);
207 bExpressCompute=((nV11==nV21 && nV12==nV22) ||
208 (nV12==nV21 && nV11==nV22));
210 BOPAlgo_EdgeEdge& anEdgeEdge=aVEdgeEdge.Append1();
212 anEdgeEdge.UseQuickCoincidenceCheck(bExpressCompute);
214 anEdgeEdge.SetPaveBlock1(aPB1);
215 anEdgeEdge.SetPaveBlock2(aPB2);
217 anEdgeEdge.SetEdge1(aE1, aT11, aT12);
218 anEdgeEdge.SetEdge2(aE2, aT21, aT22);
219 anEdgeEdge.SetFuzzyValue(myFuzzyValue);
220 anEdgeEdge.SetProgressIndicator(myProgressIndicator);
221 }//for (; aIt2.More(); aIt2.Next()) {
222 }//for (; aIt1.More(); aIt1.Next()) {
223 }//for (; myIterator->More(); myIterator->Next()) {
225 aNbEdgeEdge=aVEdgeEdge.Extent();
226 //======================================================
227 BOPAlgo_EdgeEdgeCnt::Perform(myRunParallel, aVEdgeEdge);
228 //======================================================
230 for (k = 0; k < aNbEdgeEdge; ++k) {
233 BOPAlgo_EdgeEdge& anEdgeEdge=aVEdgeEdge(k);
234 if (!anEdgeEdge.IsDone()) {
238 const IntTools_SequenceOfCommonPrts& aCPrts = anEdgeEdge.CommonParts();
239 aNbCPrts = aCPrts.Length();
243 //--------------------------------------------
244 Handle(BOPDS_PaveBlock)& aPB1=anEdgeEdge.PaveBlock1();
245 nE1=aPB1->OriginalEdge();
246 aPB1->Range(aT11, aT12);
247 if (!aPB1->HasShrunkData()) {
250 bIsPBSplittable1 = Standard_False;
253 aPB1->ShrunkData(aTS11, aTS12, aBB1, bIsPBSplittable1);
256 Handle(BOPDS_PaveBlock)& aPB2=anEdgeEdge.PaveBlock2();
257 nE2=aPB2->OriginalEdge();
258 aPB2->Range(aT21, aT22);
259 if (!aPB2->HasShrunkData()) {
262 bIsPBSplittable2 = Standard_False;
265 aPB2->ShrunkData(aTS21, aTS22, aBB2, bIsPBSplittable2);
268 //--------------------------------------------
269 IntTools_Range aR11(aT11, aTS11), aR12(aTS12, aT12),
270 aR21(aT21, aTS21), aR22(aTS22, aT22);
272 Standard_Boolean bAnalytical = Standard_False;
274 const TopoDS_Edge& aOE1 = *(TopoDS_Edge*)&myDS->Shape(nE1);
275 const TopoDS_Edge& aOE2 = *(TopoDS_Edge*)&myDS->Shape(nE2);
277 BRepAdaptor_Curve aBAC1(aOE1), aBAC2(aOE2);
279 GeomAbs_CurveType aType1 = aBAC1.GetType();
280 GeomAbs_CurveType aType2 = aBAC2.GetType();
282 bAnalytical = (((aType1 == GeomAbs_Line) &&
283 (aType2 == GeomAbs_Line ||
284 aType2 == GeomAbs_Circle)) ||
285 ((aType2 == GeomAbs_Line) &&
286 (aType1 == GeomAbs_Line ||
287 aType1 == GeomAbs_Circle)));
290 for (i=1; i<=aNbCPrts; ++i) {
291 const IntTools_CommonPrt& aCPart=aCPrts(i);
293 const TopoDS_Edge& aE1=aCPart.Edge1();
294 const TopoDS_Edge& aE2=aCPart.Edge2();
298 case TopAbs_VERTEX: {
299 if (!bIsPBSplittable1 || !bIsPBSplittable2) {
303 Standard_Boolean bIsOnPave[4], bFlag;
304 Standard_Integer nV[4], j;
305 Standard_Real aT1, aT2, aTol;
307 IntTools_Range aCR1, aCR2;
309 IntTools_Tools::VertexParameters(aCPart, aT1, aT2);
310 aTol = Precision::Confusion();
311 aCR1 = aCPart.Range1();
312 aCR2 = aCPart.Ranges2()(1);
314 //decide to keep the pave or not
315 bIsOnPave[0] = IntTools_Tools::IsOnPave1(aT1, aR11, aTol) ||
316 IntTools_Tools::IsOnPave1(aR11.First(), aCR1, aTol);
317 bIsOnPave[1] = IntTools_Tools::IsOnPave1(aT1, aR12, aTol) ||
318 IntTools_Tools::IsOnPave1(aR12.Last(), aCR1, aTol);
319 bIsOnPave[2] = IntTools_Tools::IsOnPave1(aT2, aR21, aTol) ||
320 IntTools_Tools::IsOnPave1(aR21.First(), aCR2, aTol);
321 bIsOnPave[3] = IntTools_Tools::IsOnPave1(aT2, aR22, aTol) ||
322 IntTools_Tools::IsOnPave1(aR22.Last(), aCR2, aTol);
324 aPB1->Indices(nV[0], nV[1]);
325 aPB2->Indices(nV[2], nV[3]);
327 if((bIsOnPave[0] && bIsOnPave[2]) ||
328 (bIsOnPave[0] && bIsOnPave[3]) ||
329 (bIsOnPave[1] && bIsOnPave[2]) ||
330 (bIsOnPave[1] && bIsOnPave[3])) {
334 bFlag = Standard_False;
335 for (j = 0; j < 4; ++j) {
337 //add interf VE(nV[j], nE)
338 Handle(BOPDS_PaveBlock)& aPB = (j < 2) ? aPB2 : aPB1;
339 ForceInterfVE(nV[j], aPB, aMEdges);
340 bFlag = Standard_True;
345 BOPDS_InterfEE& aEE = aEEs.Append1();
346 aEE.SetIndices(nE1, nE2);
347 aEE.SetCommonPart(aCPart);
351 BOPTools_AlgoTools::MakeNewVertex(aE1, aT1, aE2, aT2, aVnew);
352 Standard_Real aTolVnew = BRep_Tool::Tolerance(aVnew);
354 // increase tolerance for Line/Line intersection, but do not update
355 // the vertex till its intersection with some other shape
356 Standard_Real aTolMin = (BRepAdaptor_Curve(aE1).GetType() == GeomAbs_Line) ?
357 (aCR1.Last() - aCR1.First()) / 2. : (aCR2.Last() - aCR2.First()) / 2.;
358 if (aTolMin > aTolVnew) {
364 Standard_Integer nVS[2], iFound;
365 Standard_Real aTolVx, aD2, aDT2;
366 BOPCol_MapOfInteger aMV;
374 if (aMV.Contains(nV[2])) {
378 if (aMV.Contains(nV[3])) {
383 aPnew=BRep_Tool::Pnt(aVnew);
385 for (Standard_Integer k1=0; k1<=j; ++k1) {
386 const TopoDS_Vertex& aVx= *(TopoDS_Vertex*)&(myDS->Shape(nVS[k1]));
387 aTolVx=BRep_Tool::Tolerance(aVx);
388 aPx=BRep_Tool::Pnt(aVx);
389 aD2=aPnew.SquareDistance(aPx);
391 aDT2=100.*(aTolVnew+aTolVx)*(aTolVnew+aTolVx);
405 BOPDS_InterfEE& aEE=aEEs.Append1();
407 aEE.SetIndices(nE1, nE2);
408 aEE.SetCommonPart(aCPart);
410 myDS->AddInterf(nE1, nE2);
412 BOPDS_CoupleOfPaveBlocks aCPB;
414 aCPB.SetPaveBlocks(aPB1, aPB2);
415 aCPB.SetIndexInterf(iX);
416 aCPB.SetTolerance(aTolVnew);
417 aMVCPB.Add(aVnew, aCPB);
418 }//case TopAbs_VERTEX:
426 Standard_Boolean bHasSameBounds;
427 bHasSameBounds=aPB1->HasSameBounds(aPB2);
428 if (!bHasSameBounds) {
432 BOPDS_InterfEE& aEE=aEEs.Append1();
434 aEE.SetIndices(nE1, nE2);
435 aEE.SetCommonPart(aCPart);
437 myDS->AddInterf(nE1, nE2);
439 BOPAlgo_Tools::FillMap<Handle(BOPDS_PaveBlock), TColStd_MapTransientHasher>(aPB1, aPB2, aMPBLPB, aAllocator);
445 }//for (i=1; i<=aNbCPrts; i++) {
446 }//for (k=0; k < aNbFdgeEdge; ++k) {
448 //=========================================
450 //=========================================
451 BOPAlgo_Tools::PerformCommonBlocks(aMPBLPB, aAllocator, myDS);
452 PerformNewVertices(aMVCPB, aAllocator);
454 if (aMEdges.Extent()) {
455 Standard_Integer aNbV = aMVCPB.Extent();
456 for (i = 1; i <= aNbV; ++i) {
457 Handle(BOPDS_PaveBlock) aPB1, aPB2;
458 const BOPDS_CoupleOfPaveBlocks& aCPB = aMVCPB.FindFromIndex(i);
459 aCPB.PaveBlocks(aPB1, aPB2);
461 aMEdges.Remove(aPB1->OriginalEdge());
462 aMEdges.Remove(aPB2->OriginalEdge());
465 SplitPaveBlocks(aMEdges, Standard_False);
468 //-----------------------------------------------------scope t
472 //=======================================================================
473 //function : PerformVerticesEE
475 //=======================================================================
476 void BOPAlgo_PaveFiller::PerformNewVertices
477 (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
478 const Handle(NCollection_BaseAllocator)& theAllocator,
479 const Standard_Boolean bIsEEIntersection)
481 Standard_Integer aNbV = theMVCPB.Extent();
486 Standard_Real aTolAdd = myFuzzyValue / 2.;
488 // 1. Fuse the new vertices
489 BOPCol_IndexedDataMapOfShapeListOfShape aImages;
490 TreatNewVertices(theMVCPB, aImages);
492 // 2. Add new vertices to myDS and connect indices to CPB structure
493 BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE();
494 BOPDS_VectorOfInterfEF& aEFs = myDS->InterfEF();
496 Standard_Integer i, aNb = aImages.Extent();
497 for (i = 1; i <= aNb; ++i) {
498 const TopoDS_Vertex& aV = TopoDS::Vertex(aImages.FindKey(i));
499 const BOPCol_ListOfShape& aLVSD = aImages.FindFromIndex(i);
502 aSI.SetShapeType(TopAbs_VERTEX);
504 Standard_Integer iV = myDS->Append(aSI);
506 BOPDS_ShapeInfo& aSIDS = myDS->ChangeShapeInfo(iV);
507 Bnd_Box& aBox = aSIDS.ChangeBox();
508 aBox.Add(BRep_Tool::Pnt(aV));
509 aBox.SetGap(BRep_Tool::Tolerance(aV) + aTolAdd);
511 BOPCol_ListIteratorOfListOfShape aItLS(aLVSD);
512 for (; aItLS.More(); aItLS.Next()) {
513 const TopoDS_Shape& aVx = aItLS.Value();
514 BOPDS_CoupleOfPaveBlocks &aCPB = theMVCPB.ChangeFromKey(aVx);
516 // update interference
517 Standard_Integer iX = aCPB.IndexInterf();
518 BOPDS_Interf *aInt = bIsEEIntersection ? (BOPDS_Interf*)(&aEEs(iX)) : (BOPDS_Interf*) (&aEFs(iX));
519 aInt->SetIndexNew(iV);
523 // 3. Map PaveBlock/ListOfVertices to add to this PaveBlock ->aMPBLI
524 BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator);
525 for (i = 1; i <= aNbV; ++i) {
526 const BOPDS_CoupleOfPaveBlocks& aCPB = theMVCPB.FindFromIndex(i);
527 Standard_Integer iV = aCPB.Index();
529 Handle(BOPDS_PaveBlock) aPB[2];
530 aCPB.PaveBlocks(aPB[0], aPB[1]);
531 for (Standard_Integer j = 0; j < 2; ++j) {
532 BOPCol_ListOfInteger *pLI = aMPBLI.ChangeSeek(aPB[j]);
534 pLI = &aMPBLI(aMPBLI.Add(aPB[j], BOPCol_ListOfInteger(theAllocator)));
538 if (aPB[0] == aPB[1]) {
544 // 4. Compute Extra Paves and split Pave blocks by the Extra paves
545 IntersectVE(aMPBLI, Standard_False);
547 //=======================================================================
548 //function : TreatNewVertices
550 //=======================================================================
551 void BOPAlgo_PaveFiller::TreatNewVertices
552 (const BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
553 BOPCol_IndexedDataMapOfShapeListOfShape& myImages)
556 // Prepare for intersection
557 BOPCol_IndexedDataMapOfShapeReal aVerts;
558 Standard_Integer i, aNbV = theMVCPB.Extent();
559 for (i = 1; i <= aNbV; ++i) {
560 const TopoDS_Shape& aV = theMVCPB.FindKey(i);
561 Standard_Real aTol = theMVCPB.FindFromIndex(i).Tolerance();
562 aVerts.Add(aV, aTol);
565 // Perform intersection
566 BOPCol_ListOfListOfShape aChains;
567 BOPAlgo_Tools::IntersectVertices(aVerts, myRunParallel, myFuzzyValue, aChains);
569 // Treat the results - make new vertices for each chain
570 BOPCol_ListOfListOfShape::Iterator aItC(aChains);
571 for (; aItC.More(); aItC.Next()) {
572 const BOPCol_ListOfShape& aLVSD = aItC.Value();
575 BOPTools_AlgoTools::MakeVertex(aLVSD, aVNew);
576 myImages.Add(aVNew, aLVSD);
579 //=======================================================================
580 //function : FillShrunkData
582 //=======================================================================
583 void BOPAlgo_PaveFiller::FillShrunkData(Handle(BOPDS_PaveBlock)& thePB)
585 Standard_Integer nE, nV1, nV2;
586 Standard_Real aT1, aT2, aTS1, aTS2;
587 IntTools_ShrunkRange aSR;
592 const BOPDS_Pave& aPave1=thePB->Pave1();
594 aT1=aPave1.Parameter();
595 const TopoDS_Vertex& aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1)));
597 const BOPDS_Pave& aPave2=thePB->Pave2();
599 aT2=aPave2.Parameter();
600 const TopoDS_Vertex& aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2)));
602 nE=thePB->OriginalEdge();
603 const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
605 aSR.SetContext(myContext);
606 aSR.SetData(aE, aT1, aT2, aV1, aV2);
614 aSR.ShrunkRange(aTS1, aTS2);
615 const Bnd_Box& aBox=aSR.BndBox();
616 Standard_Boolean bIsSplittable = aSR.IsSplittable();
618 thePB->SetShrunkData(aTS1, aTS2, aBox, bIsSplittable);
620 //=======================================================================
621 //function : ForceInterfVE
623 //=======================================================================
624 void BOPAlgo_PaveFiller::ForceInterfVE(const Standard_Integer nV,
625 Handle(BOPDS_PaveBlock)& aPB,
626 BOPCol_MapOfInteger& theMEdges)
628 Standard_Integer nE, nVx, nVSD, iFlag;
629 Standard_Real aT, aTolVNew;
631 nE = aPB->OriginalEdge();
633 const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
634 if (aSIE.HasSubShape(nV)) {
638 if (myDS->HasInterf(nV, nE)) {
642 if (myDS->HasInterfShapeSubShapes(nV, nE)) {
646 if (aPB->Pave1().Index() == nV ||
647 aPB->Pave2().Index() == nV) {
652 if (myDS->HasShapeSD(nV, nVSD)) {
656 const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&myDS->Shape(nVx);
657 const TopoDS_Edge& aE = *(TopoDS_Edge*) &myDS->Shape(nE);
659 iFlag = myContext->ComputeVE(aV, aE, aT, aTolVNew, myFuzzyValue);
660 if (iFlag == 0 || iFlag == -4) {
664 BOPDS_VectorOfInterfVE& aVEs=myDS->InterfVE();
665 aVEs.SetIncrement(10);
667 BOPDS_InterfVE& aVE=aVEs.Append1();
668 aVE.SetIndices(nV, nE);
669 aVE.SetParameter(aT);
671 myDS->AddInterf(nV, nE);
673 // 3 update vertex V/E if necessary
674 nVx=UpdateVertex(nV, aTolVNew);
676 if (myDS->IsNewShape(nVx)) {
677 aVE.SetIndexNew(nVx);
679 // 5 append ext pave to pave block
681 aPave.SetParameter(aT);
682 aPB->AppendExtPave(aPave);
688 //=======================================================================
689 //function : GetPBBox
691 //=======================================================================
692 Standard_Boolean BOPAlgo_PaveFiller::GetPBBox(const TopoDS_Edge& theE,
693 const Handle(BOPDS_PaveBlock)& thePB,
694 BOPAlgo_DataMapOfPaveBlockBndBox& thePBBox,
695 Standard_Real& theFirst,
696 Standard_Real& theLast,
697 Standard_Real& theSFirst,
698 Standard_Real& theSLast,
701 thePB->Range(theFirst, theLast);
702 // check the validity of PB's range
703 Standard_Boolean bValid = theLast - theFirst > Precision::PConfusion();
709 if (thePB->HasShrunkData()) {
710 Standard_Boolean bIsSplittable;
711 thePB->ShrunkData(theSFirst, theSLast, theBox, bIsSplittable);
715 theSFirst = theFirst;
718 if (thePBBox.IsBound(thePB)) {
719 theBox = thePBBox.Find(thePB);
722 // build bounding box
723 BRepAdaptor_Curve aBAC(theE);
724 Standard_Real aTol = BRep_Tool::Tolerance(theE) + Precision::Confusion();
725 BndLib_Add3dCurve::Add(aBAC, theSFirst, theSLast, aTol, theBox);
726 thePBBox.Bind(thePB, theBox);