1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: NMTTools_PaveFiller_4.cxx
21 // Created: Mon Dec 8 17:08:58 2003
22 // Author: Peter KURNEV
26 #include <NMTTools_PaveFiller.ixx>
29 #include <Precision.hxx>
33 #include <Bnd_Box.hxx>
35 #include <TColStd_MapOfInteger.hxx>
36 #include <TColStd_IndexedMapOfInteger.hxx>
37 #include <TColStd_ListIteratorOfListOfInteger.hxx>
38 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
41 #include <TopoDS_Edge.hxx>
42 #include <TopoDS_Vertex.hxx>
43 #include <TopoDS_Compound.hxx>
45 #include <TopTools_IndexedMapOfShape.hxx>
46 #include <TopTools_ListIteratorOfListOfShape.hxx>
47 #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
48 #include <TopTools_DataMapOfShapeListOfShape.hxx>
49 #include <TopTools_ListOfShape.hxx>
50 #include <TopTools_DataMapOfShapeShape.hxx>
52 #include <BRep_Tool.hxx>
53 #include <BRep_Builder.hxx>
54 #include <BRepBndLib.hxx>
56 #include <BOPTColStd_Dump.hxx>
57 #include <BOPTColStd_Failure.hxx>
59 #include <IntTools_ShrunkRange.hxx>
60 #include <IntTools_Range.hxx>
61 #include <IntTools_CommonPrt.hxx>
62 #include <IntTools_SequenceOfRanges.hxx>
63 #include <IntTools_EdgeEdge.hxx>
64 #include <IntTools_SequenceOfCommonPrts.hxx>
66 #include <BOPTools_Pave.hxx>
67 #include <BOPTools_PaveSet.hxx>
68 #include <BOPTools_PaveBlockIterator.hxx>
69 #include <BOPTools_PaveBlock.hxx>
70 #include <BOPTools_CArray1OfEEInterference.hxx>
71 #include <BOPTools_EEInterference.hxx>
72 #include <BOPTools_ListOfPaveBlock.hxx>
73 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
74 #include <BOPTools_CArray1OfVVInterference.hxx>
75 #include <BOPTools_VVInterference.hxx>
76 #include <BOPTools_CArray1OfEEInterference.hxx>
77 #include <BOPTools_Tools.hxx>
78 #include <BOPTools_IDMapOfPaveBlockIMapOfPaveBlock.hxx>
79 #include <BOPTools_IMapOfPaveBlock.hxx>
80 #include <BOPTools_ListIteratorOfListOfPave.hxx>
81 #include <BOPTools_SequenceOfPaveBlock.hxx>
83 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
84 #include <BooleanOperations_IndexedDataMapOfShapeInteger.hxx>
85 #include <BooleanOperations_KindOfInterference.hxx>
87 #include <NMTDS_Iterator.hxx>
88 #include <NMTDS_ShapesDataStructure.hxx>
89 #include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
90 #include <NMTDS_IndexedDataMapOfShapeBox.hxx>
91 #include <NMTDS_BoxBndTree.hxx>
92 #include <NCollection_UBTreeFiller.hxx>
93 #include <NMTDS_InterfPool.hxx>
95 #include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
96 #include <NMTTools_ListOfCommonBlock.hxx>
97 #include <NMTTools_CommonBlock.hxx>
98 #include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
100 // Modified Thu Sep 14 14:35:18 2006
101 // Contribution of Samtech www.samcef.com BEGIN
102 #include <TColStd_ListOfInteger.hxx>
103 #include <TColStd_ListIteratorOfListOfInteger.hxx>
104 #include <BRepBndLib.hxx>
105 #include <BOPTools_CArray1OfVSInterference.hxx>
106 #include <BOPTools_VSInterference.hxx>
107 // Contribution of Samtech www.samcef.com END
113 void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI,
114 TopTools_DataMapOfShapeListOfShape& myImages,
115 TopTools_DataMapOfShapeShape& myOrigins);
118 void MakeNewVertex(const TopTools_ListOfShape& aLV,
119 TopoDS_Vertex& aNewVertex);
123 void VertexParameters(const IntTools_CommonPrt& aCPart,
127 Standard_Boolean IsOnPave(const Standard_Real& aT1,
128 const IntTools_Range& aRange,
129 const Standard_Real& aTolerance);
131 void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB);
134 void ProcessBlock(const BOPTools_PaveBlock& aPB,
135 const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB,
136 BOPTools_IMapOfPaveBlock& aProcessedBlocks,
137 BOPTools_IMapOfPaveBlock& aChain);
139 void FindChains(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB,
140 NMTTools_ListOfCommonBlock& aLCB);
142 //=======================================================================
143 // function: PerformEE
145 //=======================================================================
146 void NMTTools_PaveFiller::PerformEE()
148 myIsDone=Standard_False;
150 Standard_Boolean bJustAdd;
151 Standard_Integer n1, n2, anIndexIn, nE1, nE2, aNbVEs, aBlockLength;
152 Standard_Integer aTmp, aWhat, aWith, i, aNbCPrts, aDiscretize=30;
153 Standard_Integer aNbLPB1, aNbLPB2;
154 Standard_Real aTolE1, aTolE2, aDeflection=0.01;
155 BOPTools_ListIteratorOfListOfPaveBlock anIt1, anIt2;
156 TopoDS_Edge aEWhat, aEWith;
157 TopoDS_Vertex aNewVertex;
158 BooleanOperations_IndexedDataMapOfShapeInteger aMapVI;
159 BOPTools_IDMapOfPaveBlockIMapOfPaveBlock aMapCB;
161 BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
163 myDSIt->Initialize(TopAbs_EDGE, TopAbs_EDGE);
165 // BlockLength correction
166 aNbVEs=myDSIt->BlockLength();
167 aBlockLength=aEEs.BlockLength();
168 if (aNbVEs > aBlockLength) {
169 aEEs.SetBlockLength(aNbVEs);
172 for (; myDSIt->More(); myDSIt->Next()) {
173 myDSIt->Current(n1, n2, bJustAdd);
176 //if (myIntrPool->IsComputed(n1, n2)) {
184 //myIntrPool->AddInterference (nE1, nE2, BooleanOperations_EdgeEdge, anIndexIn);
188 const TopoDS_Edge aE1=TopoDS::Edge(myDS->Shape(nE1));//mpv
189 const TopoDS_Edge aE2=TopoDS::Edge(myDS->Shape(nE2));//mpv
192 if (BRep_Tool::Degenerated(aE1) || BRep_Tool::Degenerated(aE2)){
196 aTolE1=BRep_Tool::Tolerance(aE1);
197 aTolE2=BRep_Tool::Tolerance(aE2);
199 BOPTools_ListOfPaveBlock& aLPB1=mySplitShapesPool(myDS->RefEdge(nE1));
200 BOPTools_ListOfPaveBlock& aLPB2=mySplitShapesPool(myDS->RefEdge(nE2));
202 // Modified Thu Sep 14 14:35:18 2006
203 // Contribution of Samtech www.samcef.com BEGIN
204 aNbLPB1=aLPB1.Extent();
205 aNbLPB2=aLPB2.Extent();
207 //if (aE1.IsSame(aE2) && aNbLPB1==1 && aNbLPB2==1) {
210 // Contribution of Samtech www.samcef.com END
212 for (anIt1.Initialize(aLPB1); anIt1.More(); anIt1.Next()) {
213 BOPTools_PaveBlock& aPB1=anIt1.Value();
214 const IntTools_ShrunkRange& aShrunkRange1=aPB1.ShrunkRange();
216 const IntTools_Range& aSR1=aShrunkRange1.ShrunkRange();
217 const Bnd_Box& aBB1=aShrunkRange1.BndBox();
219 for (anIt2.Initialize(aLPB2); anIt2.More(); anIt2.Next()) {
220 BOPTools_PaveBlock& aPB2=anIt2.Value();
221 const IntTools_ShrunkRange& aShrunkRange2=aPB2.ShrunkRange();
223 const IntTools_Range& aSR2=aShrunkRange2.ShrunkRange();
224 const Bnd_Box& aBB2=aShrunkRange2.BndBox();
226 if (aBB1.IsOut (aBB2)) {
231 IntTools_EdgeEdge aEE;
234 aEE.SetTolerance1 (aTolE1);
235 aEE.SetTolerance2 (aTolE2);
236 aEE.SetDiscretize (aDiscretize);
237 aEE.SetDeflection (aDeflection);
239 IntTools_Range anewSR1 = aSR1;
240 IntTools_Range anewSR2 = aSR2;
242 BOPTools_Tools::CorrectRange (aE1, aE2, aSR1, anewSR1);
243 BOPTools_Tools::CorrectRange (aE2, aE1, aSR2, anewSR2);
245 aEE.SetRange1(anewSR1);
246 aEE.SetRange2(anewSR2);
253 // reverse order if it is necessary
266 const IntTools_SequenceOfCommonPrts& aCPrts=aEE.CommonParts();
267 aNbCPrts=aCPrts.Length();
268 for (i=1; i<=aNbCPrts; i++) {
269 const IntTools_CommonPrt& aCPart=aCPrts(i);
270 const IntTools_SequenceOfRanges& aRanges2=aCPart.Ranges2();
274 TopAbs_ShapeEnum aType=aCPart.Type();
276 case TopAbs_VERTEX: {
277 Standard_Real aT1, aT2, aTol=Precision::PConfusion();
278 Standard_Boolean bIsOnPave1, bIsOnPave2;
279 IntTools_Range aR1, aR2;
281 VertexParameters(aCPart, aT1, aT2);
283 //decide to keep the pave or not
284 aR1 = (aEE.Order()) ? anewSR2 : anewSR1;
285 aR2 = (aEE.Order()) ? anewSR1 : anewSR2;
287 bIsOnPave1=IsOnPave(aT1, aR1, aTol);
288 bIsOnPave2=IsOnPave(aT2, aR2, aTol);
290 if(bIsOnPave1 || bIsOnPave2) {
294 BOPTools_Tools::MakeNewVertex(aEWhat, aT1, aEWith, aT2, aNewVertex);
296 //modified by NIZNHY-PKV Mon Jun 19 11:40:09 2007f
298 Standard_Integer nV11, nV12, nV21, nV22, nVS[2], k, j, iFound;
299 Standard_Real aTolVx, aTolVnew, aD2, aDT2;
300 TColStd_MapOfInteger aMV;
305 nV11=aPB1.Pave1().Index();
306 nV12=aPB1.Pave2().Index();
307 nV21=aPB2.Pave1().Index();
308 nV22=aPB2.Pave2().Index();
312 if (aMV.Contains(nV21)) {
316 if (aMV.Contains(nV22)) {
321 aTolVnew=BRep_Tool::Tolerance(aNewVertex);
322 aPnew=BRep_Tool::Pnt(aNewVertex);
324 for (k=0; k<=j; ++k) {
325 const TopoDS_Vertex& aVx=TopoDS::Vertex(myDS->Shape(nVS[k]));
326 aTolVx=BRep_Tool::Tolerance(aVx);
327 aPx=BRep_Tool::Pnt(aVx);
328 aD2=aPnew.SquareDistance(aPx);
330 aDT2=100.*(aTolVnew+aTolVx)*(aTolVnew+aTolVx);
342 //modified by NIZNHY-PKV Mon Jun 19 11:40:16 2007t
344 // Add Interference to the Pool
345 BOPTools_EEInterference anInterf (aWhat, aWith, aCPart);
347 anIndexIn=aEEs.Append(anInterf);
350 myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
355 aMapVI.Add(aNewVertex, anIndexIn);
360 Standard_Integer aNbComPrt2;
361 Standard_Boolean aCoinsideFlag;
363 aNbComPrt2=aRanges2.Length();
364 aCoinsideFlag=IsBlocksCoinside(aPB1, aPB2);
366 if (aNbComPrt2>1 || !aCoinsideFlag) {
367 //myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
372 if (aMapCB.Contains(aPB1)) {
373 BOPTools_IMapOfPaveBlock& aMapPB=aMapCB.ChangeFromKey(aPB1);
378 BOPTools_IMapOfPaveBlock aMapPB;
381 aMapCB.Add(aPB1, aMapPB);
384 if (aMapCB.Contains(aPB2)) {
385 BOPTools_IMapOfPaveBlock& aMapPB=aMapCB.ChangeFromKey(aPB2);
390 BOPTools_IMapOfPaveBlock aMapPB;
393 aMapCB.Add(aPB2, aMapPB);
397 myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
405 } // for (i=1; i<=aNbCPrts; i++)
406 }// if (aEE.IsDone())
407 } // for (; anIt2.More(); anIt2.Next())
408 } // for (; anIt1.More(); anIt1.Next())
409 }// for (; myDSIt.More(); myDSIt.Next())
411 EENewVertices (aMapVI);
412 EECommonBlocks(aMapCB);
413 // Modified to invoke new nethod Thu Sep 14 14:35:18 2006
414 // Contribution of Samtech www.samcef.com BEGIN
416 // Contribution of Samtech www.samcef.com BEGIN
417 myIsDone=Standard_True;
419 //=======================================================================
420 // function:EECommonBlocks
422 //=======================================================================
423 void NMTTools_PaveFiller::EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB)
425 NMTTools_ListOfCommonBlock aLCB;
427 FindChains(aMapCB, aLCB);
428 ReplaceCommonBlocks(aLCB);
430 //=======================================================================
431 // function:EENewVertices
433 //=======================================================================
434 void NMTTools_PaveFiller::EENewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
436 Standard_Integer aNb, aNbVSD, nVnew, nIEE, nE[2], j, iFlag;
439 TopTools_DataMapOfShapeListOfShape myImages;
440 TopTools_DataMapOfShapeShape myOrigins;
441 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
442 TopTools_ListIteratorOfListOfShape aIt;
443 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
444 TColStd_MapOfInteger aMFence;
447 BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
450 if (!aNb) { // no new vertices, no new problems
456 TopoDS_Vertex aV1=TopoDS::Vertex(aMapVI.FindKey(1));
457 EENewVertices(aV1, aMapVI);
462 TreatNewVertices(aMapVI, myImages, myOrigins);
464 aItIm.Initialize(myImages);
465 for (; aItIm.More(); aItIm.Next()) {
466 const TopoDS_Vertex& aVnew=TopoDS::Vertex(aItIm.Key());
467 const TopTools_ListOfShape& aLVSD=aItIm.Value();
469 aNbVSD=aLVSD.Extent();
470 if (aNbVSD==1) {// simple case aVnew=aVold
471 EENewVertices(aVnew, aMapVI);
476 myDS->InsertShapeAndAncestorsSuccessors(aVnew, anASSeq);
477 nVnew=myDS->NumberOfInsertedShapes();
478 myDS->SetState(nVnew, BooleanOperations_ON);
481 aIt.Initialize(aLVSD);
482 for (; aIt.More(); aIt.Next()) {
483 const TopoDS_Vertex& aVold=TopoDS::Vertex(aIt.Value());
484 nIEE=aMapVI.FindFromKey(aVold);
485 BOPTools_EEInterference& aEE=aEEs(nIEE);
486 aEE.Indices(nE[0], nE[1]);
487 aEE.SetNewShape(nVnew);
489 for (j=0; j<2; ++j) {
490 if (aMFence.Add(nE[j])) {
491 aE=TopoDS::Edge(myDS->Shape(nE[j]));
492 iFlag=myContext.ComputeVE (aVnew, aE, aT);
494 aPave.SetInterference(-1);
495 aPave.SetType (BooleanOperations_EdgeEdge);
496 aPave.SetIndex(nVnew);
499 BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE[j]));
500 aPaveSet.Append(aPave);
502 }// if (aMFence.Add(nE[j])) {
503 }// for (j=0; j<2; ++j) {
504 }//for (; aIt.More(); aIt.Next()) {
505 }// for (; aItIm.More(); aItIm.Next())
509 // completely rewritten
510 //=======================================================================
511 //function : TreatNewVertices
513 //=======================================================================
514 void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI,
515 TopTools_DataMapOfShapeListOfShape& myImages,
516 TopTools_DataMapOfShapeShape& myOrigins)
518 Standard_Integer j, i, aNbV, aNbVSD;
520 TColStd_ListIteratorOfListOfInteger aIt;
521 TopoDS_Shape aSTmp, aVF;
523 TopTools_IndexedMapOfShape aMV, aMVProcessed;
524 TopTools_ListIteratorOfListOfShape aItS;
525 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
526 TopTools_DataMapOfShapeListOfShape aMVV;
527 NMTDS_IndexedDataMapOfIntegerShape aMIS;
528 NMTDS_IndexedDataMapOfShapeBox aMSB;
530 NMTDS_BoxBndTreeSelector aSelector;
531 NMTDS_BoxBndTree aBBTree;
532 NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
537 aNbV=aMapVI.Extent();
538 for (i=1; i<=aNbV; ++i) {
539 const TopoDS_Shape& aV=aMapVI.FindKey(i);
543 for (i=1; i<=aNbV; ++i) {
544 const TopoDS_Shape& aV=aMV(i);
547 aTol=BRep_Tool::Tolerance(TopoDS::Vertex(aV));
549 BRepBndLib::Add(aV, aBox);
551 aTreeFiller.Add(i, aBox);
560 for (i=1; i<=aNbV; ++i) {
561 const TopoDS_Shape& aV=aMV(i);
563 if (aMVProcessed.Contains(aV)) {
567 Standard_Integer aNbIP, aIP, aNbIP1, aIP1;
568 TopTools_ListOfShape aLVSD;
569 TColStd_MapOfInteger aMIP, aMIP1, aMIPC;
570 TColStd_MapIteratorOfMapOfInteger aIt1;
575 aIt1.Initialize(aMIP);
576 for(; aIt1.More(); aIt1.Next()) {
578 if (aMIPC.Contains(aIP)) {
582 const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
583 const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
586 aSelector.SetBox(aBoxVP);
588 aNbVSD=aBBTree.Select(aSelector);
590 continue; // it must not be
593 const TColStd_ListOfInteger& aLI=aSelector.Indices();
595 for (; aIt.More(); aIt.Next()) {
597 if (aMIP.Contains(aIP1)) {
601 } //for (; aIt.More(); aIt.Next()) {
602 }//for(; aIt1.More(); aIt1.Next()) {
604 aNbIP1=aMIP1.Extent();
606 break; // from while(1)
609 aIt1.Initialize(aMIP);
610 for(; aIt1.More(); aIt1.Next()) {
616 aIt1.Initialize(aMIP1);
617 for(; aIt1.More(); aIt1.Next()) {
624 aNbIP=aMIPC.Extent();
629 aIt1.Initialize(aMIPC);
630 for(j=0; aIt1.More(); aIt1.Next(), ++j) {
632 const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
637 aMVProcessed.Add(aVP);
639 myImages.Bind(aVF, aLVSD);
640 }// for (i=1; i<=aNbV; ++i) {
641 //------------------------------
645 aItIm.Initialize(myImages);
646 for (; aItIm.More(); aItIm.Next()) {
647 const TopoDS_Shape& aV=aItIm.Key();
648 const TopTools_ListOfShape& aLVSD=aItIm.Value();
649 aNbVSD=aLVSD.Extent();
652 MakeNewVertex(aLVSD, aVnew);
653 aMVV.Bind(aVnew, aLVSD);
657 // UnBind old vertices
659 for (i=1; i<=aNbV; ++i) {
660 const TopoDS_Shape& aV=aMV(i);
665 aItIm.Initialize(aMVV);
666 for (; aItIm.More(); aItIm.Next()) {
667 const TopoDS_Shape& aV=aItIm.Key();
668 const TopTools_ListOfShape& aLVSD=aItIm.Value();
669 myImages.Bind(aV, aLVSD);
673 aItIm.Initialize(myImages);
674 for (; aItIm.More(); aItIm.Next()) {
675 const TopoDS_Shape& aV=aItIm.Key();
676 const TopTools_ListOfShape& aLVSD=aItIm.Value();
678 aItS.Initialize(aLVSD);
679 for (; aItS.More(); aItS.Next()) {
680 const TopoDS_Shape& aVSD=aItS.Value();
681 if (!myOrigins.IsBound(aVSD)) {
682 myOrigins.Bind(aVSD, aV);
688 //=======================================================================
689 //function : MakeNewVertex
691 //=======================================================================
692 void MakeNewVertex(const TopTools_ListOfShape& aLV,
693 TopoDS_Vertex& aNewVertex)
695 Standard_Integer aNbV;
696 Standard_Real aTolV, aD, aDmax;
701 TopTools_ListIteratorOfListOfShape aIt;
709 aGC.SetCoord(0.,0.,0.);
711 for (; aIt.More(); aIt.Next()) {
712 aVx=TopoDS::Vertex(aIt.Value());
713 aP3D=BRep_Tool::Pnt(aVx);
716 aGC/=(Standard_Real)aNbV;
722 for (; aIt.More(); aIt.Next()) {
723 aVx=TopoDS::Vertex(aIt.Value());
724 aP3D=BRep_Tool::Pnt(aVx);
725 aTolV=BRep_Tool::Tolerance(aVx);
726 aD=aPGC.Distance(aP3D)+aTolV;
732 aBB.MakeVertex (aNewVertex, aPGC, aDmax);
734 //=======================================================================
735 // function:EENewVertices
737 //=======================================================================
738 void NMTTools_PaveFiller::EENewVertices (const TopoDS_Vertex& aNewVertex,
739 const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
741 Standard_Integer i, aNewShape, nE1, nE2;
742 Standard_Real aT1, aT2;
743 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
746 BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
748 // one new vertex case is treated in usual way
750 // Insert New Vertex in DS;
751 myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
752 aNewShape=myDS->NumberOfInsertedShapes();
753 myDS->SetState (aNewShape, BooleanOperations_ON);
754 // Insert New Vertex in EE Interference
755 i=aMapVI.FindFromKey(aNewVertex);
756 BOPTools_EEInterference& aEEInterf= aEEs(i);
757 aEEInterf.SetNewShape(aNewShape);
758 // Extact interference info
759 aEEInterf.Indices(nE1, nE2);
760 const IntTools_CommonPrt& aCPart=aEEInterf.CommonPrt();
761 VertexParameters(aCPart, aT1, aT2);
763 // Add Paves to the myPavePoolNew
764 aPave.SetInterference(i);
765 aPave.SetType (BooleanOperations_EdgeEdge);
766 aPave.SetIndex(aNewShape);
769 BOPTools_PaveSet& aPaveSet1=myPavePoolNew(myDS->RefEdge(nE1));
770 aPaveSet1.Append(aPave);
773 BOPTools_PaveSet& aPaveSet2=myPavePoolNew(myDS->RefEdge(nE2));
774 aPaveSet2.Append(aPave);
776 //=======================================================================
777 // function: RefinePavePool
779 //=======================================================================
780 void NMTTools_PaveFiller::RefinePavePool()
782 Standard_Integer i, aNbNew;
784 for (i=1; i<=myNbSources; i++) {
786 if ((myDS->GetShape(i)).ShapeType()==TopAbs_EDGE) {
787 BOPTools_PaveSet& aPS= myPavePool(myDS->RefEdge(i));
789 BOPTools_PaveSet& aNewPS= myPavePoolNew(myDS->RefEdge(i));
790 BOPTools_ListOfPave& aNewLP=aNewPS.ChangeSet();
792 aNbNew=aNewLP.Extent();
794 BOPTools_ListIteratorOfListOfPave anIt(aNewLP);
795 for (; anIt.More(); anIt.Next()) {
796 const BOPTools_Pave& aPave=anIt.Value();
799 // Clear the ListOfPaveBlock
800 BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(i));
802 // Prepare the paveBlocks for that egde again
803 PreparePaveBlocks(i);
809 //=======================================================================
810 // function: PreparePaveBlocks
812 //=======================================================================
813 void NMTTools_PaveFiller::PreparePaveBlocks(const TopAbs_ShapeEnum aType1,
814 const TopAbs_ShapeEnum aType2)
816 myIsDone=Standard_False;
818 Standard_Boolean bOk1, bOk2, bOk3, bFlag;
819 Standard_Integer i, aNb, nE[2], n1, n2, aNbSplits;
820 TColStd_MapOfInteger aMap;
822 bOk1= (aType1==TopAbs_VERTEX) && (aType2==TopAbs_EDGE) ;
823 bOk2= (aType1==TopAbs_EDGE) && (aType2==TopAbs_EDGE) ;
824 bOk3= (aType1==TopAbs_EDGE) && (aType2==TopAbs_FACE) ;
825 if (!bOk1 && !bOk2 && !bOk3) {// error: Type mismatch
831 myDSIt->Initialize(aType1, aType2);
832 for (; myDSIt->More(); myDSIt->Next()) {
833 myDSIt->Current(n1, n2, bFlag);
837 if (myDS->GetShapeType(n1)!=TopAbs_EDGE) {
842 for (i=0; i<aNb; ++i) {
843 BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE[i]));
844 aNbSplits=aLPB.Extent();
846 if (aMap.Add(nE[i])) {
847 PreparePaveBlocks(nE[i]);
854 }// for (; myDSIt.More(); myDSIt.Next())
855 myIsDone=Standard_True;
857 //=======================================================================
858 // function: PreparePaveBlocks
860 //=======================================================================
861 void NMTTools_PaveFiller::PreparePaveBlocks(const Standard_Integer nE)
863 myIsDone=Standard_False;
866 Standard_Integer nV1, nV2, iErr;
868 TopoDS_Vertex aV1, aV2;
870 BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
872 aE=TopoDS::Edge(myDS->Shape(nE));
873 if (BRep_Tool::Degenerated(aE)) {
874 myIsDone=Standard_True;
878 BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
880 BOPTools_PaveBlockIterator aPBIt(nE, aPS);
881 for (; aPBIt.More(); aPBIt.Next()) {
882 BOPTools_PaveBlock& aPB=aPBIt.Value();
883 const IntTools_Range& aRange=aPB.Range();
885 const BOPTools_Pave& aPave1=aPB.Pave1();
887 aV1=TopoDS::Vertex(myDS->GetShape(nV1));
889 const BOPTools_Pave& aPave2=aPB.Pave2();
891 aV2=TopoDS::Vertex(myDS->GetShape(nV2));
894 IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
895 iErr=aSR.ErrorStatus();
897 sprintf (buf, "Can not obtain ShrunkRange for Edge %d\n", nE);
898 BOPTColStd_Dump::PrintMessage(buf);
899 sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
901 BOPTColStd_Failure(buf) ;
906 "Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
907 BOPTColStd_Dump::PrintMessage(buf);
910 // Check left paves and correct ShrunkRange if it is necessary
911 CorrectShrunkRanges (0, aPave1, aSR);
912 CorrectShrunkRanges (1, aPave2, aSR);
915 aPB.SetShrunkRange(aSR);
917 } //for (; aPBIt.More(); aPBIt.Next())
918 myIsDone=Standard_True;
920 //=======================================================================
921 // function: CorrectShrunkRanges
923 //=======================================================================
924 void NMTTools_PaveFiller::CorrectShrunkRanges(const Standard_Integer aSide,
925 const BOPTools_Pave& aPave,
926 IntTools_ShrunkRange& aShrunkRange)
928 BooleanOperations_KindOfInterference aType;
929 Standard_Integer anIndexInterf ;
932 if (aType!=BooleanOperations_EdgeEdge) {
936 anIndexInterf=aPave.Interference();
937 if (anIndexInterf<0) {
938 // it can be EE interf between E and (e1,e2,..en) -> vertex
939 // so we can't decide which aEE.CommonPrt() we should take.
943 BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
944 const BOPTools_EEInterference& aEE=aEEs(anIndexInterf);
945 const IntTools_CommonPrt& aCP=aEE.CommonPrt();
946 const TopoDS_Edge& aE1=aCP.Edge1();
947 const TopoDS_Edge& aE2=aCP.Edge2();
949 const IntTools_Range& aSR=aShrunkRange.ShrunkRange();
950 const TopoDS_Edge& aE=aShrunkRange.Edge();
952 IntTools_Range aNewRange;
953 IntTools_Range aCPRange;
955 if (aE1.IsSame(aE)) {
956 const IntTools_Range& aR1=aCP.Range1();
959 if (aE2.IsSame(aE)) {
960 const IntTools_SequenceOfRanges& aSeqR=aCP.Ranges2();
961 const IntTools_Range& aR2=aSeqR(1);
965 Standard_Real aCoeff=1.05, tV, tNV;
967 if (aSide==0) { // Left
968 if (aCPRange.Last() > aSR.First()) {
970 tNV=tV+aCoeff*(tNV-tV);
971 aNewRange.SetFirst(tNV);
972 aNewRange.SetLast (aSR.Last());
973 //modified by NIZNHY-PKV Tue Jan 23 14:07:55 2007f
974 //if(aNewRange.First() > aNewRange.Last()) {
975 if(aNewRange.First() < aNewRange.Last()) {
976 //modified by NIZNHY-PKV Tue Jan 23 14:08:02 2007t
977 aShrunkRange.SetShrunkRange(aNewRange);
982 if (aCPRange.First() < aSR.Last()) {
983 tNV=aCPRange.First();
984 tNV=tV-aCoeff*(tV-tNV);
985 aNewRange.SetFirst(aSR.First());
986 aNewRange.SetLast (tNV);
988 if(aNewRange.First() < aNewRange.Last()) {
989 aShrunkRange.SetShrunkRange(aNewRange);
994 //=======================================================================
995 // function: IsBlocksCoinside
997 //=======================================================================
999 NMTTools_PaveFiller::IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,
1000 const BOPTools_PaveBlock& aPB2) const
1002 Standard_Boolean bRetFlag=Standard_True;
1003 Standard_Real aTolV11, aTolV12, aTolV21, aTolV22;
1004 Standard_Real d1121, d1122, d1222, d1221, aTolSum, aCoeff=1.05;
1005 gp_Pnt aP11, aP12, aP21, aP22;
1007 const TopoDS_Vertex aV11=TopoDS::Vertex(myDS->Shape(aPB1.Pave1().Index()));//mpv
1008 const TopoDS_Vertex aV12=TopoDS::Vertex(myDS->Shape(aPB1.Pave2().Index()));//mpv
1009 const TopoDS_Vertex aV21=TopoDS::Vertex(myDS->Shape(aPB2.Pave1().Index()));//mpv
1010 const TopoDS_Vertex aV22=TopoDS::Vertex(myDS->Shape(aPB2.Pave2().Index()));//mpv
1012 aTolV11=BRep_Tool::Tolerance(aV11);
1013 aTolV12=BRep_Tool::Tolerance(aV12);
1014 aTolV21=BRep_Tool::Tolerance(aV21);
1015 aTolV22=BRep_Tool::Tolerance(aV22);
1017 aP11=BRep_Tool::Pnt(aV11);
1018 aP12=BRep_Tool::Pnt(aV12);
1019 aP21=BRep_Tool::Pnt(aV21);
1020 aP22=BRep_Tool::Pnt(aV22);
1022 d1121=aP11.Distance(aP21);
1023 aTolSum=aCoeff*(aTolV11+aTolV21);
1024 if (d1121<aTolSum) {
1025 d1222=aP12.Distance(aP22);
1026 aTolSum=aCoeff*(aTolV12+aTolV22);
1027 if (d1222<aTolSum) {
1032 d1122=aP11.Distance(aP22);
1033 aTolSum=aCoeff*(aTolV11+aTolV22);
1034 if (d1122<aTolSum) {
1035 d1221=aP12.Distance(aP21);
1036 aTolSum=aCoeff*(aTolV12+aTolV21);
1037 if (d1221<aTolSum) {
1043 //=======================================================================
1044 // function: ReplaceCommonBlocks
1046 //=======================================================================
1047 void NMTTools_PaveFiller::ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB)
1049 RemoveCommonBlocks(aLCB);
1050 SplitCommonBlocks(aLCB);
1052 //=======================================================================
1053 // function: SplitCommonBlocks
1055 //=======================================================================
1056 void NMTTools_PaveFiller::SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB)
1058 Standard_Integer nE;
1059 NMTTools_ListOfCommonBlock aLCBx;
1060 NMTTools_ListIteratorOfListOfCommonBlock anIt, anItCBx;
1061 BOPTools_ListIteratorOfListOfPaveBlock anItLPE;
1063 anIt.Initialize(aLCB);
1064 for (; anIt.More(); anIt.Next()) {
1065 const NMTTools_CommonBlock& aCB=anIt.Value();
1070 SplitCommonBlock(aCB, aLCBx);
1072 anItCBx.Initialize(aLCBx);
1073 for (; anItCBx.More(); anItCBx.Next()) {
1074 const NMTTools_CommonBlock& aCBx=anItCBx.Value();
1075 const BOPTools_ListOfPaveBlock& aLPBx=aCBx.PaveBlocks();
1077 anItLPE.Initialize(aLPBx);
1078 for (; anItLPE.More(); anItLPE.Next()) {
1079 const BOPTools_PaveBlock& aPBx=anItLPE.Value();
1080 nE=aPBx.OriginalEdge();
1081 NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
1086 // Modified to provide the order of edges
1087 // in common block where the edge with max
1088 // tolerance value will be the first
1089 // Thu Sep 14 14:35:18 2006
1090 // Contribution of Samtech www.samcef.com BEGIN
1091 Standard_Integer i, iMax, aNb, aNbCB, nSp;
1092 Standard_Real aTolSp, aTolMax;
1093 BOPTools_ListOfPaveBlock *pLPBE;
1095 aNb=myDS->NumberOfShapesOfTheObject();
1096 for (nE=1; nE<=aNb; ++nE) {
1097 const TopoDS_Shape& aE=myDS->Shape(nE);
1098 if (aE.ShapeType()!=TopAbs_EDGE) {
1102 NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
1103 aNbCB=aLCBE.Extent();
1108 anIt.Initialize(aLCBE);
1109 for (; anIt.More(); anIt.Next()) {
1110 NMTTools_CommonBlock& aCBE=anIt.Value();
1111 const BOPTools_ListOfPaveBlock& aLPBE=aCBE.PaveBlocks();
1114 anItLPE.Initialize(aLPBE);
1115 for (i=0; anItLPE.More(); anItLPE.Next(), ++i) {
1116 const BOPTools_PaveBlock& aPB=anItLPE.Value();
1117 nSp=aPB.OriginalEdge();
1118 const TopoDS_Edge& aSp=TopoDS::Edge(myDS->Shape(nSp));
1119 aTolSp=BRep_Tool::Tolerance(aSp);
1120 if (aTolSp>aTolMax) {
1126 BOPTools_ListOfPaveBlock aLPBx;
1128 anItLPE.Initialize(aLPBE);
1129 for (i=0; anItLPE.More(); anItLPE.Next(), ++i) {
1130 const BOPTools_PaveBlock& aPB=anItLPE.Value();
1139 pLPBE=(BOPTools_ListOfPaveBlock *)&aLPBE;
1141 pLPBE->Append(aLPBx);
1142 }//for (; anIt.More(); anIt.Next()) {
1143 }//for (nE=1; nE<=aNb; ++nE) {
1144 // Contribution of Samtech www.samcef.com END
1146 //=======================================================================
1147 // function: RemoveCommonBlocks
1149 //=======================================================================
1150 void NMTTools_PaveFiller::RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB)
1152 Standard_Integer nE;
1153 NMTTools_ListOfCommonBlock aLCBx;
1154 NMTTools_ListIteratorOfListOfCommonBlock anItCB, anItCBE;
1155 BOPTools_ListIteratorOfListOfPaveBlock anItLPB;
1157 anItCB.Initialize(aLCB);
1158 for (; anItCB.More(); anItCB.Next()) {
1159 const NMTTools_CommonBlock& aCB=anItCB.Value();
1160 const BOPTools_ListOfPaveBlock& aLPB=aCB.PaveBlocks();
1162 // Remove aCB from each edge
1163 anItLPB.Initialize(aLPB);
1164 for (; anItLPB.More(); anItLPB.Next()) {
1165 const BOPTools_PaveBlock& aPB=anItLPB.Value();
1166 nE=aPB.OriginalEdge();
1168 NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
1169 anItCBE.Initialize(aLCBE);
1170 for (; anItCBE.More(); anItCBE.Next()) {
1171 const NMTTools_CommonBlock& aCBE=anItCBE.Value();
1172 if (aCBE.IsEqual(aCB)) {
1173 aLCBE.Remove(anItCBE);
1180 //=======================================================================
1181 // function: SplitCommonBlock
1183 //=======================================================================
1184 void NMTTools_PaveFiller::SplitCommonBlock(const NMTTools_CommonBlock& aCB,
1185 NMTTools_ListOfCommonBlock& aLCBx)
1187 Standard_Integer i, j, k, nE, aNbE, aNbSPBx, aNbPB;
1188 BOPTools_SequenceOfPaveBlock aSPBx;
1189 BOPTools_ListIteratorOfListOfPaveBlock anItLPB;
1190 BOPTools_ListIteratorOfListOfPave anIt;
1192 BOPTools_PaveBlockIterator anPBIt;
1194 const BOPTools_ListOfPaveBlock& aLPB=aCB.PaveBlocks();
1197 // 1. Whether we realy need to split the common block ?
1198 anItLPB.Initialize(aLPB);
1199 for (; anItLPB.More(); anItLPB.Next()) {
1200 const BOPTools_PaveBlock& aPB=anItLPB.Value();
1201 nE=aPB.OriginalEdge();
1202 BOPTools_PaveSet& aPSE=myPavePoolNew(myDS->RefEdge(nE));
1205 BOPTools_PaveSet aPSx;
1207 const BOPTools_ListOfPave& aLPE=aPSE.Set();
1208 anIt.Initialize(aLPE);
1209 for (; anIt.More(); anIt.Next()) {
1210 const BOPTools_Pave& aPx=anIt.Value();
1211 if (aPB.IsInBlock(aPx)) {
1215 aNbPB=aPSx.Set().Extent();
1220 // we need not split it
1225 // 2. Get sequence of pave Blocks containing all new pave blocks
1226 // for each edges's source pave Block
1227 anItLPB.Initialize(aLPB);
1228 for (; anItLPB.More(); anItLPB.Next()) {
1229 const BOPTools_PaveBlock& aPB=anItLPB.Value();
1230 const BOPTools_Pave& aPave1=aPB.Pave1();
1231 const BOPTools_Pave& aPave2=aPB.Pave2();
1232 nE=aPB.OriginalEdge();
1234 BOPTools_PaveSet aPSx;
1236 // the set aPsx will contain bounadry paves aPave1, aPave2 and
1237 // all paves of the edge nE that are inside block aPB
1238 aPSx.Append(aPave1);
1239 aPSx.Append(aPave2);
1241 BOPTools_PaveSet& aPSE=myPavePoolNew(myDS->RefEdge(nE));
1244 const BOPTools_ListOfPave& aLPE=aPSE.Set();
1245 anIt.Initialize(aLPE);
1246 for (; anIt.More(); anIt.Next()) {
1247 const BOPTools_Pave& aPx=anIt.Value();
1248 if (aPB.IsInBlock(aPx)) {
1253 // Form pave blocks from aPSx and collect them in aSPBx
1254 anPBIt.Initialize(nE, aPSx);
1255 for (; anPBIt.More(); anPBIt.Next()) {
1256 const BOPTools_PaveBlock& aPBx=anPBIt.Value();
1261 // 3. Do new common blocks
1263 const TColStd_ListOfInteger& aLF=aCB.Faces();
1264 aNbSPBx=aSPBx.Length();
1267 for (i=1; i<=aNbPB; ++i) {
1268 NMTTools_CommonBlock aCBx;
1272 for (j=1; j<=aNbE; ++j) {
1274 const BOPTools_PaveBlock& aPB=aSPBx(k);
1275 aCBx.AddPaveBlock(aPB);
1281 //=======================================================================
1282 // function: VertexParameters
1284 //=======================================================================
1285 void VertexParameters(const IntTools_CommonPrt& aCPart,
1289 const IntTools_Range& aR1=aCPart.Range1();
1290 aT1=0.5*(aR1.First()+aR1.Last());
1292 if((aCPart.VertexParameter1() >= aR1.First()) &&
1293 (aCPart.VertexParameter1() <= aR1.Last())) {
1294 aT1 = aCPart.VertexParameter1();
1297 const IntTools_SequenceOfRanges& aRanges2=aCPart.Ranges2();
1298 const IntTools_Range& aR2=aRanges2(1);
1299 aT2=0.5*(aR2.First()+aR2.Last());
1301 if((aCPart.VertexParameter2() >= aR2.First()) &&
1302 (aCPart.VertexParameter2() <= aR2.Last())) {
1303 aT2 = aCPart.VertexParameter2();
1306 //=======================================================================
1307 // function: KeepPave
1309 //=======================================================================
1310 Standard_Boolean IsOnPave(const Standard_Real& aT1,
1311 const IntTools_Range& aRange,
1312 const Standard_Real& aTolerance)
1314 Standard_Boolean firstisonpave1, firstisonpave2, bIsOnPave;
1316 firstisonpave1 = (Abs(aRange.First() - aT1) < aTolerance);
1317 firstisonpave2 = (Abs(aRange.Last() - aT1) < aTolerance);
1318 bIsOnPave=(firstisonpave1 || firstisonpave2);
1322 //=======================================================================
1323 // function:FindChains
1325 //=======================================================================
1326 void FindChains(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB,
1327 NMTTools_ListOfCommonBlock& aLCB)
1329 Standard_Integer i, j, aNbCB, aNbPB;
1330 BOPTools_IMapOfPaveBlock aProcessedBlocks, aChain;
1332 aNbCB=aMapCB.Extent();
1333 for (i=1; i<=aNbCB; ++i) {
1334 const BOPTools_PaveBlock& aPB=aMapCB.FindKey(i);
1335 if (aProcessedBlocks.Contains(aPB)) {
1339 aProcessedBlocks.Add(aPB);
1342 const BOPTools_IMapOfPaveBlock& aMapPB=aMapCB(i);
1343 aNbPB=aMapPB.Extent();
1344 for (j=1; j<=aNbPB; ++j) {
1345 const BOPTools_PaveBlock& aPBx=aMapPB(j);
1346 ProcessBlock(aPBx, aMapCB, aProcessedBlocks, aChain);
1349 NMTTools_CommonBlock aCB;
1351 aNbPB=aChain.Extent();
1352 for (j=1; j<=aNbPB; ++j) {
1353 const BOPTools_PaveBlock& aPBx=aChain(j);
1354 aCB.AddPaveBlock(aPBx);
1360 //=======================================================================
1361 // function:ProcessBlock
1363 //=======================================================================
1364 void ProcessBlock(const BOPTools_PaveBlock& aPB,
1365 const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB,
1366 BOPTools_IMapOfPaveBlock& aProcessedBlocks,
1367 BOPTools_IMapOfPaveBlock& aChain)
1369 Standard_Integer j, aNbPB;
1371 if (aProcessedBlocks.Contains(aPB)) {
1374 aProcessedBlocks.Add(aPB);
1377 const BOPTools_IMapOfPaveBlock& aMapPB=aMapCB.FindFromKey(aPB);
1378 aNbPB=aMapPB.Extent();
1379 for (j=1; j<=aNbPB; ++j) {
1380 const BOPTools_PaveBlock& aPBx=aMapPB(j);
1381 ProcessBlock(aPBx, aMapCB, aProcessedBlocks, aChain);
1384 // Modified to provide VS interference between
1385 // vertex as result of EE and a Face of argument
1386 // Thu Sep 14 14:35:18 2006
1387 // Contribution of Samtech www.samcef.com BEGIN
1388 //=======================================================================
1389 // function: PerformVF1
1391 //=======================================================================
1392 void NMTTools_PaveFiller::PerformVF1()
1394 Standard_Integer i, aNbEE, n1, n2, nNewShape, aNbS, nF;
1395 Standard_Integer anIndexIn, aFlag;
1396 Standard_Real aU, aV;
1397 TColStd_ListOfInteger aLFI;
1398 TColStd_ListIteratorOfListOfInteger aItLFI;
1400 BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
1401 BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
1403 aNbS=myDS->NumberOfShapesOfTheObject();
1404 for (i=1; i<=aNbS; ++i) {
1405 const TopoDS_Shape& aF=myDS->Shape(i);
1406 if (aF.ShapeType()==TopAbs_FACE) {
1410 if (!aLFI.Extent()) {
1414 aNbEE=aEEs.Extent();
1415 for (i=1; i<=aNbEE; ++i) {
1416 BOPTools_EEInterference& aEE=aEEs(i);
1417 aEE.Indices(n1, n2);
1418 nNewShape=aEE.NewShape();
1423 const TopoDS_Shape& aSnew=myDS->Shape(nNewShape);
1424 if (aSnew.ShapeType()!=TopAbs_VERTEX) {
1428 const TopoDS_Vertex& aVnew=TopoDS::Vertex(aSnew);
1432 BRepBndLib::Add(aVnew, aBV);
1434 aItLFI.Initialize(aLFI);
1435 for (; aItLFI.More(); aItLFI.Next()) {
1438 const TopoDS_Face& aF=TopoDS::Face(myDS->Shape(nF));
1439 const Bnd_Box& aBF=myDS->GetBoundingBox(nF);
1440 if (aBF.IsOut(aBV)) {
1445 aFlag=myContext.ComputeVS (aVnew, aF, aU, aV);
1447 BOPTools_VSInterference anInterf (nNewShape, nF, aU, aV);
1449 anIndexIn=aVSs.Append(anInterf);
1450 BOPTools_VSInterference& aVS=aVSs(anIndexIn);
1451 aVS.SetNewShape(nNewShape);//->
1456 // Contribution of Samtech www.samcef.com END