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 <Precision.hxx>
21 #include <Bnd_Box.hxx>
22 #include <BOPAlgo_PaveFiller.hxx>
23 #include <BOPAlgo_SectionAttribute.hxx>
24 #include <BOPAlgo_Tools.hxx>
25 #include <BOPCol_MapOfInteger.hxx>
26 #include <BOPCol_NCVector.hxx>
27 #include <BOPCol_Parallel.hxx>
28 #include <BOPCol_DataMapOfShapeReal.hxx>
29 #include <BOPDS_CommonBlock.hxx>
30 #include <BOPDS_CoupleOfPaveBlocks.hxx>
31 #include <BOPDS_Curve.hxx>
32 #include <BOPDS_DataMapOfPaveBlockListOfInteger.hxx>
33 #include <BOPDS_DS.hxx>
34 #include <BOPDS_Interf.hxx>
35 #include <BOPDS_Iterator.hxx>
36 #include <BOPDS_MapOfPaveBlock.hxx>
37 #include <BOPDS_Pave.hxx>
38 #include <BOPDS_PaveBlock.hxx>
39 #include <BOPTools_AlgoTools.hxx>
40 #include <BRep_Builder.hxx>
41 #include <BRep_Tool.hxx>
42 #include <BRepAdaptor_Curve.hxx>
43 #include <BRepBndLib.hxx>
44 #include <GeomAPI_ProjectPointOnSurf.hxx>
46 #include <IntTools_CommonPrt.hxx>
47 #include <IntTools_Context.hxx>
48 #include <IntTools_EdgeFace.hxx>
49 #include <IntTools_Range.hxx>
50 #include <IntTools_SequenceOfCommonPrts.hxx>
51 #include <IntTools_Tools.hxx>
53 #include <TopoDS_Edge.hxx>
54 #include <TopoDS_Face.hxx>
55 #include <TopoDS_Vertex.hxx>
57 //=======================================================================
58 //class : BOPAlgo_EdgeFace
60 //=======================================================================
61 class BOPAlgo_EdgeFace :
62 public IntTools_EdgeFace,
74 virtual ~BOPAlgo_EdgeFace(){
77 void SetIndices(const Standard_Integer nE,
78 const Standard_Integer nF) {
83 void Indices(Standard_Integer& nE,
84 Standard_Integer& nF) {
89 void SetNewSR(const IntTools_Range& aR){
93 IntTools_Range& NewSR(){
97 void SetPaveBlock(const Handle(BOPDS_PaveBlock)& aPB) {
101 Handle(BOPDS_PaveBlock)& PaveBlock() {
105 virtual void Perform() {
106 BOPAlgo_Algo::UserBreak();
107 IntTools_EdgeFace::Perform();
111 Standard_Integer myIE;
112 Standard_Integer myIF;
113 IntTools_Range myNewSR;
114 Handle(BOPDS_PaveBlock) myPB;
117 //=======================================================================
118 typedef BOPCol_NCVector<BOPAlgo_EdgeFace> BOPAlgo_VectorOfEdgeFace;
120 typedef BOPCol_ContextFunctor
122 BOPAlgo_VectorOfEdgeFace,
123 Handle(IntTools_Context),
124 IntTools_Context> BOPAlgo_EdgeFaceFunctor;
126 typedef BOPCol_ContextCnt
127 <BOPAlgo_EdgeFaceFunctor,
128 BOPAlgo_VectorOfEdgeFace,
129 Handle(IntTools_Context)> BOPAlgo_EdgeFaceCnt;
131 //=======================================================================
132 //function : PerformEF
134 //=======================================================================
135 void BOPAlgo_PaveFiller::PerformEF()
137 Standard_Integer iSize;
141 FillShrunkData(TopAbs_EDGE, TopAbs_FACE);
143 myIterator->Initialize(TopAbs_EDGE, TopAbs_FACE);
144 iSize=myIterator->ExpectedLength();
149 Standard_Boolean bJustAdd, bV[2];
150 Standard_Boolean bV1, bV2, bExpressCompute;
151 Standard_Integer nV1, nV2;
152 Standard_Integer nE, nF, aDiscretize, i, aNbCPrts, iX, nV[2];
153 Standard_Integer aNbEdgeFace, k;
154 Standard_Real aTolE, aTolF, aTS1, aTS2, aT1, aT2, aDeflection;
155 Handle(NCollection_BaseAllocator) aAllocator;
156 TopAbs_ShapeEnum aType;
157 BOPDS_ListIteratorOfListOfPaveBlock aIt;
158 BOPAlgo_VectorOfEdgeFace aVEdgeFace;
159 //-----------------------------------------------------scope f
161 aAllocator=NCollection_BaseAllocator::CommonBaseAllocator();
163 BOPCol_MapOfInteger aMIEFC(100, aAllocator);
164 BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator);
165 BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, aAllocator);
170 BOPDS_VectorOfInterfEF& aEFs=myDS->InterfEF();
171 aEFs.SetIncrement(iSize);
173 for (; myIterator->More(); myIterator->Next()) {
174 myIterator->Value(nE, nF, bJustAdd);
179 const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
180 if (aSIE.HasFlag()){//degenerated
184 const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aSIE.Shape()));
185 const TopoDS_Face& aF=(*(TopoDS_Face *)(&myDS->Shape(nF)));
186 const Bnd_Box& aBBF=myDS->ShapeInfo(nF).Box();
188 BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
189 const BOPDS_IndexedMapOfPaveBlock& aMPBF=aFI.PaveBlocksOn();
191 const BOPCol_MapOfInteger& aMVIn=aFI.VerticesIn();
192 const BOPCol_MapOfInteger& aMVOn=aFI.VerticesOn();
194 aTolE=BRep_Tool::Tolerance(aE);
195 aTolF=BRep_Tool::Tolerance(aF);
197 BOPDS_ListOfPaveBlock& aLPB=myDS->ChangePaveBlocks(nE);
198 aIt.Initialize(aLPB);
199 for (; aIt.More(); aIt.Next()) {
200 Handle(BOPDS_PaveBlock)& aPB=aIt.ChangeValue();
202 const Handle(BOPDS_PaveBlock) aPBR=myDS->RealPaveBlock(aPB);
203 if (aMPBF.Contains(aPBR)) {
207 if (!aPB->HasShrunkData()) {
212 aPB->ShrunkData(aTS1, aTS2, aBBE);
214 if (aBBF.IsOut (aBBE)) {
218 aPBR->Indices(nV1, nV2);
219 bV1=aMVIn.Contains(nV1) || aMVOn.Contains(nV1);
220 bV2=aMVIn.Contains(nV2) || aMVOn.Contains(nV2);
221 bExpressCompute=bV1 && bV2;
223 BOPAlgo_EdgeFace& aEdgeFace=aVEdgeFace.Append1();
225 aEdgeFace.SetIndices(nE, nF);
226 aEdgeFace.SetPaveBlock(aPB);
228 aEdgeFace.SetEdge (aE);
229 aEdgeFace.SetFace (aF);
230 aEdgeFace.SetTolE (aTolE);
231 aEdgeFace.SetTolF (aTolF);
232 aEdgeFace.SetDiscretize (aDiscretize);
233 aEdgeFace.SetDeflection (aDeflection);
234 aEdgeFace.UseQuickCoincidenceCheck(bExpressCompute);
236 IntTools_Range aSR(aTS1, aTS2);
237 IntTools_Range anewSR=aSR;
238 BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, anewSR);
239 aEdgeFace.SetNewSR(anewSR);
241 aPB->Range(aT1, aT2);
242 IntTools_Range aPBRange(aT1, aT2);
244 BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange);
245 aEdgeFace.SetRange (aPBRange);
246 aEdgeFace.SetProgressIndicator(myProgressIndicator);
248 }//for (; aIt.More(); aIt.Next()) {
249 }//for (; myIterator->More(); myIterator->Next()) {
251 aNbEdgeFace=aVEdgeFace.Extent();
252 //=================================================================
253 BOPAlgo_EdgeFaceCnt::Perform(myRunParallel, aVEdgeFace, myContext);
254 //=================================================================
256 for (k=0; k < aNbEdgeFace; ++k) {
257 BOPAlgo_EdgeFace& aEdgeFace=aVEdgeFace(k);
258 if (!aEdgeFace.IsDone()) {
262 aEdgeFace.Indices(nE, nF);
264 const TopoDS_Edge& aE=aEdgeFace.Edge();
265 const TopoDS_Face& aF=aEdgeFace.Face();
267 aTolE=aEdgeFace.TolE();
268 aTolF=aEdgeFace.TolF();
269 const IntTools_Range& anewSR=aEdgeFace.NewSR();
270 Handle(BOPDS_PaveBlock)& aPB=aEdgeFace.PaveBlock();
272 aPB->Range(aT1, aT2);
273 aPB->Indices(nV[0], nV[1]);
275 BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
276 const BOPCol_MapOfInteger& aMIFOn=aFI.VerticesOn();
277 const BOPCol_MapOfInteger& aMIFIn=aFI.VerticesIn();
279 const IntTools_SequenceOfCommonPrts& aCPrts=aEdgeFace.CommonParts();
280 aNbCPrts = aCPrts.Length();
282 Standard_Boolean bLinePlane = Standard_False;
284 BRepAdaptor_Curve aBAC(aE);
285 BRepAdaptor_Surface aBAS(aF, Standard_False);
287 bLinePlane = (aBAC.GetType() == GeomAbs_Line &&
288 aBAS.GetType() == GeomAbs_Plane);
291 for (i=1; i<=aNbCPrts; ++i) {
292 const IntTools_CommonPrt& aCPart=aCPrts(i);
295 case TopAbs_VERTEX: {
296 Standard_Boolean bIsOnPave[2];
298 Standard_Real aT, aTolToDecide;
301 IntTools_Tools::VertexParameter(aCPart, aT);
302 BOPTools_AlgoTools::MakeNewVertex(aE, aT, aF, aVnew);
304 const IntTools_Range& aR=aCPart.Range1();
307 IntTools_Range aR1(aT1,anewSR.First()),aR2(anewSR.Last(), aT2);
309 bIsOnPave[0]=IntTools_Tools::IsInRange(aR1, aR, aTolToDecide);
310 bIsOnPave[1]=IntTools_Tools::IsInRange(aR2, aR, aTolToDecide);
312 if ((bIsOnPave[0] && bIsOnPave[1]) ||
313 (bLinePlane && (bIsOnPave[0] || bIsOnPave[1]))) {
314 bV[0]=CheckFacePaves(nV[0], aMIFOn, aMIFIn);
315 bV[1]=CheckFacePaves(nV[1], aMIFOn, aMIFIn);
316 if (bV[0] && bV[1]) {
317 IntTools_CommonPrt aCP = aCPart;
318 aCP.SetType(TopAbs_EDGE);
319 BOPDS_InterfEF& aEF=aEFs.Append1();
321 aEF.SetIndices(nE, nF);
322 aEF.SetCommonPart(aCP);
323 myDS->AddInterf(nE, nF);
327 BOPAlgo_Tools::FillMap(aPB, nF, aMPBLI, aAllocator);
331 for (j=0; j<2; ++j) {
333 bV[j]=CheckFacePaves(nV[j], aMIFOn, aMIFIn);
335 const TopoDS_Vertex& aV=
336 (*(TopoDS_Vertex *)(&myDS->Shape(nV[j])));
338 Standard_Real f, l, aTolVnew, aDistPP, aTolPC, aTolV;
340 const Handle(Geom_Curve)& aCur = BRep_Tool::Curve(aE, f, l);
342 gp_Pnt aP1 = BRep_Tool::Pnt(aV);
343 gp_Pnt aP2 = aCur->Value(aT);
346 aDistPP=aP1.Distance(aP2);
348 aTolPC=Precision::PConfusion();
349 aTolV=BRep_Tool::Tolerance(aV);
350 if (aDistPP > (aTolV+aTolPC)) {
351 aTolVnew=Max(aTolE, aDistPP);
352 UpdateVertex(nV[j], aTolVnew);
356 bIsOnPave[j] = ForceInterfVF(nV[j], nF);
361 if (!bIsOnPave[0] && !bIsOnPave[1]) {
362 if (CheckFacePaves(aVnew, aMIFOn)) {
366 Standard_Real aTolVnew = BRep_Tool::Tolerance(aVnew);
367 aTolVnew = Max(aTolVnew, Max(aTolE, aTolF));
368 BRep_Builder().UpdateVertex(aVnew, aTolVnew);
370 // increase tolerance for Line/Plane intersection, but do not update
371 // the vertex till its intersection with some other shape
372 IntTools_Range aCR = aCPart.Range1();
373 aTolVnew = Max(aTolVnew, (aCR.Last() - aCR.First()) / 2.);
376 const gp_Pnt& aPnew = BRep_Tool::Pnt(aVnew);
378 if (!myContext->IsPointInFace(aPnew, aF, aTolVnew)) {
384 BOPDS_InterfEF& aEF=aEFs.Append1();
386 aEF.SetIndices(nE, nF);
387 aEF.SetCommonPart(aCPart);
389 myDS->AddInterf(nE, nF);
391 BOPDS_CoupleOfPaveBlocks aCPB;
393 aCPB.SetPaveBlocks(aPB, aPB);
394 aCPB.SetIndexInterf(iX);
395 aCPB.SetTolerance(aTolVnew);
396 aMVCPB.Add(aVnew, aCPB);
404 BOPDS_InterfEF& aEF=aEFs.Append1();
406 aEF.SetIndices(nE, nF);
408 bV[0]=CheckFacePaves(nV[0], aMIFOn, aMIFIn);
409 bV[1]=CheckFacePaves(nV[1], aMIFOn, aMIFIn);
410 if (!bV[0] || !bV[1]) {
411 myDS->AddInterf(nE, nF);
414 aEF.SetCommonPart(aCPart);
416 myDS->AddInterf(nE, nF);
418 BOPAlgo_Tools::FillMap(aPB, nF, aMPBLI, aAllocator);
425 }//for (i=1; i<=aNbCPrts; ++i) {
426 }// for (k=0; k < aNbEdgeEdge; ++k) {
428 //=========================================
430 //=========================================
431 BOPAlgo_Tools::PerformCommonBlocks(aMPBLI, aAllocator, myDS);
432 PerformVerticesEF(aMVCPB, aAllocator);
434 // Update FaceInfoIn for all faces having EF common parts
435 BOPCol_MapIteratorOfMapOfInteger aItMI;
436 aItMI.Initialize(aMIEFC);
437 for (; aItMI.More(); aItMI.Next()) {
439 myDS->UpdateFaceInfoIn(nF);
441 // Refine FaceInfoOn to remove all formal pave blocks
442 // made during EF processing
443 //myDS->RefineFaceInfoOn();
444 //-----------------------------------------------------scope t
448 ////aAllocator.Nullify();
450 //=======================================================================
451 //function : PerformVerticesEF
453 //=======================================================================
454 Standard_Integer BOPAlgo_PaveFiller::PerformVerticesEF
455 (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
456 const Handle(NCollection_BaseAllocator)& theAllocator)
458 Standard_Integer aNbV, iRet;
461 aNbV=theMVCPB.Extent();
466 Standard_Integer nVx, nVSD, iV, iErr, nE, iFlag, iX, i, aNbPBLI;
467 Standard_Real aT, dummy;
468 BOPCol_ListIteratorOfListOfShape aItLS;
469 BOPCol_ListIteratorOfListOfInteger aItLI;
474 BOPCol_ListOfShape aLS(theAllocator);
475 BOPCol_DataMapOfShapeInteger aMVI(100, theAllocator);
476 BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator);
477 BOPAlgo_PaveFiller aPF(theAllocator);
478 BOPCol_DataMapOfShapeReal aMVIniTol;
480 aSI.SetShapeType(TopAbs_VERTEX);
481 BOPDS_VectorOfInterfEF& aEFs=myDS->InterfEF();
483 // 1 prepare arguments
484 for (i=1; i<=aNbV; ++i) {
485 const TopoDS_Vertex& aV = TopoDS::Vertex(theMVCPB.FindKey(i));
487 // if an enlarged tolerance is associated with the vertex then update it
488 // remembering its initial tolerance
489 Standard_Real aTolEnlarged = theMVCPB.FindFromIndex(i).Tolerance();
490 Standard_Real aIniTol = BRep_Tool::Tolerance(aV);
491 if (aTolEnlarged > aIniTol) {
492 aMVIniTol.Bind(aV, aIniTol);
493 BRep_Builder().UpdateVertex(aV, aTolEnlarged);
498 aPF.SetIsPrimary(Standard_False);
499 aPF.SetNonDestructive(myNonDestructive);
500 aPF.SetArguments(aLS);
502 iErr=aPF.ErrorStatus();
509 // Recompute common vertex for each SD group containing enlarged vertex;
510 // for that first fill in the map of SD vertex -> its counterparts
511 BOPCol_IndexedDataMapOfShapeListOfShape aImages;
512 aItLS.Initialize(aLS);
513 for (; aItLS.More(); aItLS.Next()) {
514 const TopoDS_Shape& aVx = aItLS.Value();
515 nVx = aPDS->Index(aVx);
517 const TopoDS_Shape& aV = (aPDS->HasShapeSD(nVx, nVSD) ? aPDS->Shape(nVSD) : aVx);
518 BOPCol_ListOfShape* pLst = aImages.ChangeSeek(aV);
520 pLst = &aImages.ChangeFromIndex(aImages.Add(aV, BOPCol_ListOfShape()));
524 // 3 Add new vertices to theDS;
525 for (i = 1; i <= aImages.Extent(); i++) {
526 TopoDS_Vertex aV = TopoDS::Vertex(aImages.FindKey(i));
527 const BOPCol_ListOfShape& aLVSD = aImages.FindFromIndex(i);
528 Standard_Boolean isReset = Standard_False;
529 BOPCol_ListIteratorOfListOfShape it(aLVSD);
530 for (; it.More(); it.Next()) {
531 const TopoDS_Vertex& aVx = TopoDS::Vertex(it.Value());
532 const Standard_Real* pTolIni = aMVIniTol.Seek(aVx);
534 // reset enlarged vertex tolerance to the initial value
535 reinterpret_cast<BRep_TVertex*>(aVx.TShape().operator->())->Tolerance(*pTolIni);
536 isReset = Standard_True;
539 TopoDS_Vertex aVnew = aV;
540 if (isReset && aLVSD.Extent() > 1) {
541 // make new vertex again
542 BOPTools_AlgoTools::MakeVertex(aLVSD, aVnew);
544 // index of new vertex in theDS -> iV
546 iV = myDS->Append(aSI);
548 BOPDS_ShapeInfo& aSIDS = myDS->ChangeShapeInfo(iV);
549 Bnd_Box& aBox = aSIDS.ChangeBox();
550 BRepBndLib::Add(aVnew, aBox);
551 aBox.SetGap(aBox.GetGap() + Precision::Confusion());
556 // 4 Map PaveBlock/ListOfVertices to add to this PaveBlock ->aMPBLI
557 aItLS.Initialize(aLS);
558 for (; aItLS.More(); aItLS.Next()) {
559 const TopoDS_Shape& aVx=aItLS.Value();
560 nVx=aPDS->Index(aVx);
562 const TopoDS_Shape& aV = (aPDS->HasShapeSD(nVx, nVSD) ? aPDS->Shape(nVSD) : aVx);
565 BOPDS_CoupleOfPaveBlocks &aCPB=theMVCPB.ChangeFromKey(aVx);
567 // update EF interference
568 iX=aCPB.IndexInterf();
569 BOPDS_InterfEF& aEF=aEFs(iX);
572 const Handle(BOPDS_PaveBlock)& aPB=aCPB.PaveBlock1();
573 if (aMPBLI.Contains(aPB)) {
574 BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFromKey(aPB);
578 BOPCol_ListOfInteger aLI(theAllocator);
580 aMPBLI.Add(aPB, aLI);
585 // 5.1 Compute Extra Paves and
586 // 5.2. Add Extra Paves to the PaveBlocks
587 aNbPBLI=aMPBLI.Extent();
588 for (i=1; i<=aNbPBLI; ++i) {
589 Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i);
590 const BOPCol_ListOfInteger& aLI=aMPBLI.FindFromIndex(i);
591 nE=aPB->OriginalEdge();
592 const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
594 aItLI.Initialize(aLI);
595 for (; aItLI.More(); aItLI.Next()) {
597 const TopoDS_Vertex& aVx=(*(TopoDS_Vertex *)(&myDS->Shape(nVx)));
599 iFlag=myContext->ComputeVE (aVx, aE, aT, dummy);
602 aPave.SetParameter(aT);
603 aPB->AppendExtPave(aPave);
607 // 6 Split PaveBlocks
608 for (i=1; i<=aNbPBLI; ++i) {
609 Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i);
610 nE=aPB->OriginalEdge();
612 if (!myDS->IsCommonBlock(aPB)) {
613 myDS->UpdatePaveBlock(aPB);
616 const Handle(BOPDS_CommonBlock)& aCB=myDS->CommonBlock(aPB);
617 myDS->UpdateCommonBlock(aCB);
619 }//for (; aItMPBLI.More(); aItMPBLI.Next()) {
623 //=======================================================================
624 // function: CheckFacePaves
626 //=======================================================================
627 Standard_Boolean BOPAlgo_PaveFiller::CheckFacePaves
628 (const Standard_Integer nVx,
629 const BOPCol_MapOfInteger& aMIFOn,
630 const BOPCol_MapOfInteger& aMIFIn)
632 Standard_Boolean bRet;
634 BOPCol_MapIteratorOfMapOfInteger aIt;
638 aIt.Initialize(aMIFOn);
639 for (; aIt.More(); aIt.Next()) {
646 aIt.Initialize(aMIFIn);
647 for (; aIt.More(); aIt.Next()) {
657 //=======================================================================
658 // function: CheckFacePaves
660 //=======================================================================
661 Standard_Boolean BOPAlgo_PaveFiller::CheckFacePaves
662 (const TopoDS_Vertex& aVnew,
663 const BOPCol_MapOfInteger& aMIF)
665 Standard_Boolean bRet;
666 Standard_Integer nV, iFlag;
667 BOPCol_MapIteratorOfMapOfInteger aIt;
671 aIt.Initialize(aMIF);
672 for (; aIt.More(); aIt.Next()) {
674 const TopoDS_Vertex& aV=(*(TopoDS_Vertex *)(&myDS->Shape(nV)));
675 iFlag=BOPTools_AlgoTools::ComputeVV(aVnew, aV);
683 //=======================================================================
684 //function : ForceInterfVF
686 //=======================================================================
687 Standard_Boolean BOPAlgo_PaveFiller::ForceInterfVF
688 (const Standard_Integer nV,
689 const Standard_Integer nF)
691 Standard_Boolean bRet;
692 Standard_Integer iFlag, nVx;
693 Standard_Real U, V, aTolVNew;
695 bRet = Standard_False;
696 const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&myDS->Shape(nV);
697 const TopoDS_Face& aF = *(TopoDS_Face*) &myDS->Shape(nF);
699 iFlag = myContext->ComputeVF(aV, aF, U, V, aTolVNew);
700 if (iFlag == 0 || iFlag == -2) {
703 BOPDS_VectorOfInterfVF& aVFs=myDS->InterfVF();
704 aVFs.SetIncrement(10);
706 BOPDS_InterfVF& aVF=aVFs.Append1();
708 aVF.SetIndices(nV, nF);
711 myDS->AddInterf(nV, nF);
713 // 3 update vertex V/F if necessary
714 nVx=UpdateVertex(nV, aTolVNew);
716 if (myDS->IsNewShape(nVx)) {
717 aVF.SetIndexNew(nVx);
720 BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
721 BOPCol_MapOfInteger& aMVIn=aFI.ChangeVerticesIn();