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>
35 #include <Geom2d_Curve.hxx>
36 #include <Geom_TrimmedCurve.hxx>
38 #include <GeomAdaptor_Curve.hxx>
39 #include <BndLib_Add3dCurve.hxx>
41 #include <TopoDS_Face.hxx>
43 #include <TopoDS_Compound.hxx>
47 #include <BRep_Builder.hxx>
48 #include <BRep_Tool.hxx>
49 #include <BRepBndLib.hxx>
51 #include <TopTools_IndexedMapOfShape.hxx>
53 #include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
54 #include <BOPTColStd_IndexedDataMapOfIntegerInteger.hxx>
56 #include <BooleanOperations_IndexedDataMapOfShapeInteger.hxx>
57 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
58 #include <BooleanOperations_OnceExplorer.hxx>
59 #include <BooleanOperations_ShapesDataStructure.hxx>
61 #include <IntTools_SequenceOfPntOn2Faces.hxx>
62 #include <IntTools_SequenceOfCurves.hxx>
63 #include <IntTools_FaceFace.hxx>
64 #include <IntTools_Tools.hxx>
66 #include <BOPTools_CArray1OfSSInterference.hxx>
67 #include <BOPTools_ListIteratorOfListOfInterference.hxx>
68 #include <BOPTools_CArray1OfInterferenceLine.hxx>
69 #include <BOPTools_InterferenceLine.hxx>
70 #include <BOPTools_ListOfInterference.hxx>
71 #include <BOPTools_Interference.hxx>
72 #include <BOPTools_InterferencePool.hxx>
73 #include <BOPTools_SSInterference.hxx>
74 #include <BOPTools_ListOfPaveBlock.hxx>
75 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
76 #include <BOPTools_PaveBlock.hxx>
77 #include <BOPTools_ListIteratorOfListOfPave.hxx>
78 #include <BOPTools_Tools.hxx>
79 #include <BOPTools_PaveBlockIterator.hxx>
80 #include <BOPTools_Tools2D.hxx>
82 #include <NMTDS_ShapesDataStructure.hxx>
83 #include <NMTTools_IndexedDataMapOfShapePaveBlock.hxx>
84 #include <NMTTools_CommonBlockAPI.hxx>
85 #include <Geom2d_Curve.hxx>
86 #include <NMTTools_Tools.hxx>
87 #include <BRepLib.hxx>
88 #include <Geom2d_TrimmedCurve.hxx>
90 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
91 #include <TopTools_ListOfShape.hxx>
92 #include <TopTools_ListIteratorOfListOfShape.hxx>
93 #include <TopoDS_Vertex.hxx>
95 #include <TopoDS_Edge.hxx>
96 #include <TColStd_ListOfInteger.hxx>
98 #include <NMTTools_DataMapOfIntegerListOfPaveBlock.hxx>
99 #include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
100 #include <TColStd_ListIteratorOfListOfInteger.hxx>
101 #include <NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock.hxx>
102 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
103 #include <TColStd_MapOfInteger.hxx>
104 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
105 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
106 #include <TColStd_ListOfInteger.hxx>
107 #include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
108 #include <TColStd_ListIteratorOfListOfInteger.hxx>
109 #include <NMTTools_MapOfPaveBlock.hxx>
111 #include <IntTools_ShrunkRange.hxx>
114 Standard_Boolean IsPairFound(const Standard_Integer nF1,
115 const Standard_Integer nF2,
116 BOPTools_InterferencePool* myIntrPool,
117 BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
118 BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith);
121 void FMapWhat(const Standard_Integer nF,
122 BOPTools_InterferencePool* myIntrPool,
123 TColStd_IndexedMapOfInteger& aMapWhat);
125 void FMapWith(const Standard_Integer nF,
126 BOPTools_InterferencePool* myIntrPool,
127 TColStd_IndexedMapOfInteger& aMapWith);
129 Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
130 const TColStd_IndexedMapOfInteger& aMapWith);
132 // Modified Thu Sep 14 14:35:18 2006
133 // Contribution of Samtech www.samcef.com BEGIN
135 void SharedEdges1(const TopoDS_Face& aF1,
136 const TopoDS_Face& aF2,
137 TopTools_ListOfShape& aLS);
138 // Contribution of Samtech www.samcef.com END
141 Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
142 IntTools_Context& aCtx);
144 //=======================================================================
145 // function: PerformFF
147 //=======================================================================
148 void NMTTools_PaveFiller::PerformFF()
150 myIsDone=Standard_False;
152 Standard_Boolean bIsFound, bJustAdd, bIsComputed;
153 Standard_Integer n1, n2, anIndexIn, nF1, nF2, aBlockLength, aNbFFs;
154 Standard_Boolean bToApproxC3d, bToApproxC2dOnS1, bToApproxC2dOnS2, bIsDone;
155 Standard_Integer aNbCurves, aNbPoints;
156 Standard_Real anApproxTol, aTolR3D, aTolR2D;
157 BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger aMapWhat, aMapWith;
158 IntTools_SequenceOfPntOn2Faces aPnts;
159 IntTools_SequenceOfCurves aCvs;
160 BooleanOperations_KindOfInterference aTypeFF=BooleanOperations_SurfaceSurface;
162 BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
164 // F/F Interferences [BooleanOperations_SurfaceSurface]
165 myDSIt.Initialize(TopAbs_FACE, TopAbs_FACE);
167 // BlockLength correction
168 aNbFFs=ExpectedPoolLength();
169 aBlockLength=aFFs.BlockLength();
170 if (aNbFFs > aBlockLength) {
171 aFFs.SetBlockLength(aNbFFs);
174 for (; myDSIt.More(); myDSIt.Next()) {
175 myDSIt.Current(n1, n2, bJustAdd);
177 bIsComputed=myIntrPool->IsComputed(n1, n2);
192 bIsFound=IsPairFound(nF1, nF2, myIntrPool, aMapWhat, aMapWith);
196 myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
199 BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
200 anIndexIn=aFFs.Append(anInterf);
201 myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
206 const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
207 const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
210 bToApproxC3d = mySectionAttribute.Approximation();
211 bToApproxC2dOnS1 = mySectionAttribute.PCurveOnS1();
212 bToApproxC2dOnS2 = mySectionAttribute.PCurveOnS2();
216 IntTools_FaceFace aFF;
218 aFF.SetParameters (bToApproxC3d, bToApproxC2dOnS1,
219 bToApproxC2dOnS2, anApproxTol);
221 aFF.Perform(aF1, aF2);
223 bIsDone=aFF.IsDone();
227 myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
230 BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
231 anIndexIn=aFFs.Append(anInterf);
232 myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
237 aTolR3D=aFF.TolReached3d();
238 aTolR2D=aFF.TolReached2d();
239 if (aTolR3D < 1.e-7){
243 aFF.PrepareLines3D();
245 const IntTools_SequenceOfCurves& aCvsX=aFF.Lines();
246 const IntTools_SequenceOfPntOn2Faces& aPntsX=aFF.Points();
248 aNbCurves=aCvsX.Length();
249 aNbPoints=aPntsX.Length();
251 if (!aNbCurves && !aNbPoints) {
252 BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
253 anIndexIn=aFFs.Append(anInterf);
254 myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
259 BOPTools_SSInterference anInterf (nF1, nF2, aTolR3D, aTolR2D, aCvsX, aPntsX);
260 anIndexIn=aFFs.Append(anInterf);
261 myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
264 }// for (; myDSIt.More(); myDSIt.Next())
266 myIsDone=Standard_True;
268 //=======================================================================
269 // function: MakeBlocks
271 //=======================================================================
272 void NMTTools_PaveFiller::MakeBlocks()
274 myIsDone=Standard_False;
276 // Modified Thu Sep 14 14:35:18 2006
277 // Contribution of Samtech www.samcef.com BEGIN
278 Standard_Boolean bIsExistingPaveBlock, bIsValidIn2D, bIsCoincided;
279 // Contribution of Samtech www.samcef.com END
281 Standard_Boolean bIsMicroEdge;
282 Standard_Integer i, aNbFFs, nF1, nF2, aBid=0;
283 Standard_Integer nV1, nV2, j, aNbCurves;
284 Standard_Real aTolR3D, aTol2D, aT1, aT2, aTolPPC=Precision::PConfusion();
285 NMTTools_IndexedDataMapOfShapePaveBlock aMEPB;
286 BooleanOperations_IndexedDataMapOfShapeInteger aMapEI;
287 BOPTools_ListIteratorOfListOfPaveBlock anIt;
289 BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
291 aNbFFs=aFFs.Extent();
293 NMTTools_DataMapOfIntegerListOfPaveBlock aMFInOn;
294 NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock aItMF;
297 Standard_Integer aNbS, aNbF, nF, aNbOn, nSp;
298 TopAbs_ShapeEnum aType;
299 BOPTools_ListIteratorOfListOfPaveBlock anItPB;
300 NMTTools_ListIteratorOfListOfCommonBlock aItCB;
301 TColStd_ListIteratorOfListOfInteger aItF;
303 aNbS=myDS->NumberOfShapesOfTheObject();
304 for (i=1; i<=aNbS; ++i) {
305 const TopoDS_Shape& aS=myDS->Shape(i);
306 aType=aS.ShapeType();
308 if (aType==TopAbs_EDGE) {
309 const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(i));
310 aItCB.Initialize(aLCB);
311 for (; aItCB.More(); aItCB.Next()) {
312 const NMTTools_CommonBlock& aCB=aItCB.Value();
313 const BOPTools_PaveBlock &aPB1=aCB.PaveBlock1();
315 const TColStd_ListOfInteger& aLF=aCB.Faces();
318 aItF.Initialize(aLF);
319 for (; aItF.More(); aItF.Next()) {
321 if (aMFInOn.IsBound(nF)) {
322 BOPTools_ListOfPaveBlock& aLPB=aMFInOn.ChangeFind(nF);
326 BOPTools_ListOfPaveBlock aLPB;
328 aMFInOn.Bind(nF, aLPB);
332 } // for (; aItCB.More(); aItCB.Next()) {
333 }//if (aS.ShapeType()==TopAbs_EDGE) {
335 else if (aType==TopAbs_FACE) {
336 BOPTools_ListOfPaveBlock aLPBOn;
339 RealSplitsFace(nF, aLPBOn);
341 aNbOn=aLPBOn.Extent();
343 if (aMFInOn.IsBound(nF)) {
344 BOPTools_ListOfPaveBlock& aLPB=aMFInOn.ChangeFind(nF);
348 aMFInOn.Bind(nF, aLPBOn);
352 } // for (i=1; i<=aNbS; ++i) {
354 // Refine ListOfPaveBlocks
355 aItMF.Initialize(aMFInOn);
356 for(; aItMF.More(); aItMF.Next()) {
357 TColStd_MapOfInteger aMTmp;
358 BOPTools_ListOfPaveBlock aLPBX;
361 BOPTools_ListOfPaveBlock& aLPB=aMFInOn.ChangeFind(nF);
362 anItPB.Initialize(aLPB);
363 for (; anItPB.More(); anItPB.Next()) {
364 const BOPTools_PaveBlock& aPB=anItPB.Value();
366 if (aMTmp.Add(nSp)) {
376 // 1. Produce Section Edges from intersection curves
377 // between each pair of faces
379 aNbFFs=aFFs.Extent();
381 for (i=1; i<=aNbFFs; ++i) {
383 BOPTools_SSInterference& aFFi=aFFs(i);
386 aFFi.Indices(nF1, nF2);
387 const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
388 const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
390 BOPTools_ListOfPaveBlock aLPB;
394 BOPTools_ListIteratorOfListOfPaveBlock anItPB;
395 NMTTools_MapOfPaveBlock aMPB;
397 if (aMFInOn.IsBound(nF1)) {
398 const BOPTools_ListOfPaveBlock& aLPBF1=aMFInOn.Find(nF1);
399 anItPB.Initialize(aLPBF1);
400 for (; anItPB.More(); anItPB.Next()) {
401 const BOPTools_PaveBlock& aPB=anItPB.Value();
407 if (aMFInOn.IsBound(nF2)) {
408 const BOPTools_ListOfPaveBlock& aLPBF2=aMFInOn.Find(nF2);
409 anItPB.Initialize(aLPBF2);
410 for (; anItPB.More(); anItPB.Next()) {
411 const BOPTools_PaveBlock& aPB=anItPB.Value();
412 if (aMPB.Contains(aPB)) {
413 aFFi.AppendBlock(aPB);
423 TopTools_ListOfShape aLSE;
424 TColStd_ListOfInteger aLNE;
425 SharedEdges(nF1, nF2, aLNE, aLSE);
426 aFFi.SetSharedEdges(aLNE);
428 BOPTools_SequenceOfCurves& aSCvs=aFFi.Curves();
429 aNbCurves=aSCvs.Length();
434 // Contribution of Samtech www.samcef.com END
435 aTolR3D=aFFi.TolR3D();
436 aTol2D=(aTolR3D < 1.e-3) ? 1.e-3 : aTolR3D;
438 BOPTools_PaveSet aPSF;
440 PrepareSetForFace (nF1, nF2, aLPB, aPSF);
442 // Put Paves On Curves
443 for (j=1; j<=aNbCurves; ++j) {
444 BOPTools_Curve& aBC=aSCvs(j);
446 const IntTools_Curve& aC=aBC.Curve();
447 Handle (Geom_Curve) aC3D= aC.Curve();
449 PutPaveOnCurve (aPSF, aTolR3D, aBC);
452 // Put bounding paves on curves
453 for (j=1; j<=aNbCurves; ++j) {
454 BOPTools_Curve& aBC=aSCvs(j);
455 PutBoundPaveOnCurve (aBC, aFFi);
458 // Pave Blocks on Curves
459 for (j=1; j<=aNbCurves; ++j) {
460 BOPTools_Curve& aBC=aSCvs(j);
461 const IntTools_Curve& aIC= aBC.Curve();
462 BOPTools_PaveSet& aPaveSet=aBC.Set();
464 BOPTools_PaveBlockIterator aPBIter(0, aPaveSet);
465 for (; aPBIter.More(); aPBIter.Next()) {
466 BOPTools_PaveBlock& aPBNew=aPBIter.Value();
467 aPBNew.SetCurve(aIC);
468 aPBNew.SetFace1(nF1);
469 aPBNew.SetFace2(nF2);
471 nV1=aPBNew.Pave1().Index();
472 nV2=aPBNew.Pave2().Index();
473 aT1=aPBNew.Pave1().Param();
474 aT2=aPBNew.Pave2().Param();
476 if((nV1==nV2) && (Abs(aT2 - aT1) < aTolPPC)) {
482 bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLPB, aTolR3D);
483 if (bIsExistingPaveBlock) {
487 bIsCoincided=CheckCoincidence(aPBNew, aLPB);
493 // to provide checking whether aPBNew already exists in list
494 // of section edges aLSE
495 // Thu Sep 14 14:35:18 2006
496 // Contribution of Samtech www.samcef.com BEGIN
498 bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLSE, aTolR3D);
499 if (bIsExistingPaveBlock) {
502 // Contribution of Samtech www.samcef.com END
504 // Checking of validity in 2D
506 bIsValidIn2D=myContext.IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTol2D);
515 const TopoDS_Vertex aV1=TopoDS::Vertex(myDS->Shape(nV1));//mpv
516 const TopoDS_Vertex aV2=TopoDS::Vertex(myDS->Shape(nV2));//mpv
518 BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
522 NMTTools_Tools::UpdateEdge (aES, aTolR3D);
523 bIsMicroEdge=IsMicroEdge(aES, myContext);
532 Handle(Geom2d_Curve) aC2D1, aC2D2;
534 aC2D1=aIC.FirstCurve2d();
535 aC2D2=aIC.SecondCurve2d();
537 NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
538 NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
542 aMEPB.Add(aES, aPBNew);
546 } // end of for (j=1; j<=aNbCurves; ++j)
547 }// for (i=1; i<=aNbFFs; ++i)
548 //=============================================================
550 // II. Post treatment
552 // Input data: aMEPB, aMapEI
553 // Result : section edges in myDS
555 Standard_Integer aNbSE;
557 aNbSE=aMEPB.Extent();
559 // there is nothing to do here
564 TopoDS_Compound aCompound;
566 // 1. Make compound from SE
567 aBB.MakeCompound(aCompound);
568 for (i=1; i<=aNbSE; ++i) {
569 const TopoDS_Shape& aSE=aMEPB.FindKey(i);
570 aBB.Add(aCompound, aSE);
574 // 2. Intersect SE using auxiliary Filler
575 NMTDS_ShapesDataStructure tDS;
577 tDS.SetCompositeShape(aCompound);
580 BOPTools_InterferencePool tIP(tDS);
581 NMTTools_PaveFiller tPF(tIP);
586 tPF.PerformNewVertices();
589 tPF.myPavePool.Resize (tPF.myNbEdges);
597 tPF.myCommonBlockPool.Resize (tPF.myNbEdges);
598 tPF.mySplitShapesPool.Resize (tPF.myNbEdges);
599 tPF.myPavePoolNew .Resize (tPF.myNbEdges);
601 tPF.PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
602 tPF.PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
606 tPF.RefinePavePool ();
608 tPF.myPavePoolNew.Destroy();
610 tPF.MakeSplitEdges();
611 tPF.UpdateCommonBlocks();
613 // 3. Treatment of the result of intersection
615 Standard_Integer aNbOld, aNbLines, aNbPB, mV1, mV2, nE, mE, iFF;
616 TopAbs_ShapeEnum aType;
617 BOPTools_ListIteratorOfListOfPaveBlock aIt;
618 BOPTColStd_IndexedDataMapOfIntegerInteger aMNewOld;
620 const BOPTools_SplitShapesPool& aSSP=tPF.mySplitShapesPool;
621 const NMTTools_CommonBlockPool& aCBP=tPF.myCommonBlockPool;
623 aNbLines=tDS.NumberOfInsertedShapes();
624 aNbOld=tDS.NumberOfShapesOfTheObject();
626 // 3.1 Links between indices in tDS and DS (kept in aMNewOld)
628 // 3.1.1.Old vertices [ links ]
629 for (i=1; i<=aNbOld; ++i) {
630 const TopoDS_Shape& aV=tDS.Shape(i);
631 aType=aV.ShapeType();
632 if (aType!=TopAbs_VERTEX) {
636 for (j=1; j<=aNbSE; ++j) {
637 const BOPTools_PaveBlock& aPBSE=aMEPB(j);
638 nV1=aPBSE.Pave1().Index();
639 const TopoDS_Shape aV1=myDS->Shape(nV1);//mpv
640 if (aV1.IsSame(aV)) {
641 aMNewOld.Add(i, nV1);
644 nV2=aPBSE.Pave2().Index();
645 const TopoDS_Shape aV2=myDS->Shape(nV2);//mpv
646 if (aV2.IsSame(aV)) {
647 aMNewOld.Add(i, nV2);
653 // 3.1.2. New vertices [ links ]
654 i=tDS.NumberOfSourceShapes()+1;
655 for (; i<=aNbLines; ++i) {
656 const TopoDS_Shape& aV=tDS.Shape(i);
657 aType=aV.ShapeType();
658 if (aType!=TopAbs_VERTEX) {
662 // Insert new vertex in myDS
663 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
664 myDS->InsertShapeAndAncestorsSuccessors(aV, anASSeq);
665 nV1=myDS->NumberOfInsertedShapes();
667 aMNewOld.Add(i, nV1);
670 // 3.2. Treatment of section edges (SE)
671 for (i=1; i<=aNbOld; ++i) {
672 const TopoDS_Shape& aE=tDS.Shape(i);
673 aType=aE.ShapeType();
674 if (aType!=TopAbs_EDGE) {
678 // block of section edge that we already have for this SE
679 BOPTools_PaveBlock& aPBSE=aMEPB.ChangeFromKey(aE);
681 // Corresponding FF-interference
682 iFF=aMapEI.FindFromKey(aE);
683 BOPTools_SSInterference& aFFi=aFFs(iFF);
684 BOPTools_SequenceOfCurves& aSCvs=aFFi.Curves();
686 BOPTools_Curve& aBC=aSCvs(1);
688 const BOPTools_ListOfPaveBlock& aLPB=aSSP(tDS.RefEdge(i));
692 // no pave blocks -> use aPBSE and whole edge aE
693 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
695 nV1=aPBSE.Pave1().Index();
696 const TopoDS_Shape aV1=myDS->Shape(nV1);//mpv
697 nV2=aPBSE.Pave2().Index();
698 const TopoDS_Shape aV2=myDS->Shape(nV2);//mpv
700 anASSeq.SetNewSuccessor(nV1);
701 anASSeq.SetNewOrientation(aV1.Orientation());
702 anASSeq.SetNewSuccessor(nV2);
703 anASSeq.SetNewOrientation(aV2.Orientation());
705 myDS->InsertShapeAndAncestorsSuccessors(aE, anASSeq);
706 nE=myDS->NumberOfInsertedShapes();
709 aBC.AppendNewBlock(aPBSE);
717 const NMTTools_ListOfCommonBlock& aLCB=aCBP(tDS.RefEdge(i));
718 NMTTools_CommonBlockAPI aCBAPI(aLCB);
720 aIt.Initialize(aLPB);
721 for (; aIt.More(); aIt.Next()) {
722 BOPTools_PaveBlock aPB=aIt.Value();
724 const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));
725 const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));
727 if (aCBAPI.IsCommonBlock(aPB)) {
728 // it can be Common Block
729 Standard_Real aTolEx;
730 Handle(Geom2d_Curve) aC2D1, aC2D2;
731 TopoDS_Face aF1FWD, aF2FWD;
733 NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
734 const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
736 aPB=aCB.PaveBlock1();
737 mE=aPB.Edge(); // index of edge in tDS
738 const TopoDS_Edge& aEx=TopoDS::Edge(tDS.Shape(mE));
739 aTolEx=BRep_Tool::Tolerance(aEx);
742 aF1FWD.Orientation(TopAbs_FORWARD);
744 aF2FWD.Orientation(TopAbs_FORWARD);
747 NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1);
748 NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2);
749 NMTTools_Tools::UpdateEdge (aEx, aTolEx);
751 } //if (aCBAPI.IsCommonBlock(aPB))
754 mE=aPB.Edge(); // index of edge in tDS
755 const TopoDS_Shape& aSp=tDS.Shape(mE);
757 const BOPTools_Pave& aPave1=aPB.Pave1();
759 mV1=aPave1.Index(); // index in tDS
760 nV1=aMNewOld.FindFromKey(mV1); // index in myDS
761 const TopoDS_Shape aV1=myDS->Shape(nV1);//mpv
763 const BOPTools_Pave& aPave2=aPB.Pave2();
766 nV2=aMNewOld.FindFromKey(mV2);
767 const TopoDS_Shape aV2=myDS->Shape(nV2);//mpv
769 if (!aMNewOld.Contains(mE)) {
770 // add new SE to the myDS
771 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
773 anASSeq.SetNewSuccessor(nV1);
774 anASSeq.SetNewOrientation(aV1.Orientation());
776 anASSeq.SetNewSuccessor(nV2);
777 anASSeq.SetNewOrientation(aV2.Orientation());
779 myDS->InsertShapeAndAncestorsSuccessors(aSp, anASSeq);
780 nE=myDS->NumberOfInsertedShapes();
782 aMNewOld.Add(mE, nE);
785 nE=aMNewOld.FindFromKey(mE);
788 BOPTools_PaveBlock aPBx;
789 BOPTools_Pave aP1, aP2;
805 aBC.AppendNewBlock(aPBx);
806 }// for (; aIt.More(); aIt.Next())
807 }// for (i=1; i<=aNbOld; ++i)
809 myIsDone=Standard_True;
811 //=======================================================================
812 // function: MakePCurves
814 //=======================================================================
815 void NMTTools_PaveFiller::MakePCurves()
817 Standard_Integer i, aNb, nF1, nF2, nE;
818 Standard_Integer aNbCB, aNbF, nSp, nF;
819 TopoDS_Face aF1FWD, aF2FWD;
820 TColStd_ListIteratorOfListOfInteger aItF;
821 BOPTools_ListIteratorOfListOfPaveBlock anIt;
822 NMTTools_ListIteratorOfListOfCommonBlock aItCB;
823 TopAbs_ShapeEnum aType;
825 BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
828 for (i=1; i<=aNb; i++) {
829 BOPTools_SSInterference& aFF=aFFs(i);
830 aFF.Indices(nF1, nF2);
832 const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
833 const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
836 aF1FWD.Orientation(TopAbs_FORWARD);
838 aF2FWD.Orientation(TopAbs_FORWARD);
840 // In, On parts processing
841 const BOPTools_ListOfPaveBlock& aLPBInOn=aFF.PaveBlocks();
843 anIt.Initialize(aLPBInOn);
844 for (; anIt.More(); anIt.Next()) {
845 const BOPTools_PaveBlock& aPB=anIt.Value();
847 const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv
849 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD);
850 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD);
854 //modified by NIZNHY-PKV Fri Mar 23 10:35:02 2007f
855 // Check common blocks between edges and faces
856 // Build P-Curves if they were not built in previos block.
858 // The main case is :arguments for e.g aEdge, aFace -> no FFs,
859 // but p-curves are needed.
861 aNb=myDS->NumberOfShapesOfTheObject();
862 for (i=1; i<=aNb; ++i) {
863 const TopoDS_Shape& aS=myDS->Shape(i);
864 aType=aS.ShapeType();
866 if (aType!=TopAbs_EDGE) {
869 const TopoDS_Edge& aE=TopoDS::Edge(aS);
871 if (BRep_Tool::Degenerated(aE)) {
875 const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(i));
881 aItCB.Initialize(aLCB);
882 for (; aItCB.More(); aItCB.Next()) {
883 const NMTTools_CommonBlock& aCB=aItCB.Value();
884 const BOPTools_PaveBlock &aPB1=aCB.PaveBlock1();
886 const TColStd_ListOfInteger& aLF=aCB.Faces();
893 const TopoDS_Edge aSp=TopoDS::Edge(myDS->Shape(nSp));//mpv
895 aItF.Initialize(aLF);
896 for (; aItF.More(); aItF.Next()) {
898 aF1FWD=TopoDS::Face(myDS->Shape(nF));
899 aF1FWD.Orientation(TopAbs_FORWARD);
901 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aSp, aF1FWD);
902 } // for (; aItCB.More(); aItCB.Next()) {
903 }//if (aS.ShapeType()==TopAbs_EDGE) {
905 //modified by NIZNHY-PKV Fri Mar 23 10:35:13 2007t
907 //=======================================================================
908 // function: IsExistingPaveBlock
910 //=======================================================================
911 Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
912 const BOPTools_ListOfPaveBlock& aLPBR,
913 const Standard_Real aTolR3D)
915 Standard_Boolean bFlag;
916 Standard_Integer nVNew1, nVNew2, nV1, nV2, iC;
917 BOPTools_ListIteratorOfListOfPaveBlock anIt;
919 bFlag=Standard_False;
920 nVNew1=aPBNew.Pave1().Index();
921 nVNew2=aPBNew.Pave2().Index();
923 anIt.Initialize(aLPBR);
924 for (; anIt.More(); anIt.Next()) {
925 const BOPTools_PaveBlock& aPBR=anIt.Value();
926 nV1=aPBR.Pave1().Index();
927 nV2=aPBR.Pave2().Index();
928 if (nVNew1==nV1 || nVNew1==nV2 || nVNew2==nV1 || nVNew2==nV2) {
930 iC=CheckIntermediatePoint(aPBNew, aPBR, aTolR3D);
938 //=======================================================================
939 // function: IsExistingPaveBlock
941 //=======================================================================
942 Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
943 const TopTools_ListOfShape& aLSE,
944 const Standard_Real aTolR3D)
946 Standard_Boolean bFlag;
947 Standard_Integer aNbSE, iC;
948 TopTools_ListIteratorOfListOfShape anIt;
950 bFlag=Standard_False;
957 anIt.Initialize(aLSE);
958 for (; anIt.More(); anIt.Next()) {
959 const TopoDS_Edge& aE=TopoDS::Edge(anIt.Value());
960 iC=CheckIntermediatePoint(aPBNew, aE, aTolR3D);
967 //=======================================================================
968 // function: CheckIntermediatePoint
970 //=======================================================================
971 Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
972 const BOPTools_PaveBlock& aPBR,
973 const Standard_Real aTolC)
976 Standard_Integer iVM, nE2;
979 const TopoDS_Edge aE2=TopoDS::Edge(myDS->Shape(nE2));//mpv
980 iVM=CheckIntermediatePoint(aPB, aE2, aTolC);
984 //=======================================================================
985 // function: CheckIntermediatePoint
987 //=======================================================================
988 Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
989 const TopoDS_Edge& aE2,
990 const Standard_Real aTolC)
992 Standard_Real aT11, aT12, aTM, aTmp;
993 Standard_Integer iVM;
999 const BOPTools_Pave& aPave11=aPB.Pave1();
1000 aT11=aPave11.Param();
1002 const BOPTools_Pave& aPave12=aPB.Pave2();
1003 aT12=aPave12.Param();
1005 aTM=IntTools_Tools::IntermediatePoint (aT11, aT12);
1007 const IntTools_Curve& aIC=aPB.Curve();
1010 aBB.MakeVertex (aVM, aPM, aTolC);
1012 iVM=myContext.ComputeVE(aVM, aE2, aTmp);
1016 //=======================================================================
1017 // function: PutBoundPaveOnCurve
1019 //=======================================================================
1020 void NMTTools_PaveFiller::PutBoundPaveOnCurve(BOPTools_Curve& aBC,
1021 BOPTools_SSInterference& aFFi)
1023 Standard_Boolean bHasBounds, bVF;
1024 Standard_Integer nF1, nF2;
1025 Standard_Real aT1, aT2, aTolR3D;
1028 const IntTools_Curve& aIC=aBC.Curve();
1029 bHasBounds=aIC.HasBounds ();
1035 aIC.Bounds (aT1, aT2, aP1, aP2);
1038 aFFi.Indices(nF1, nF2);
1039 aTolR3D=aFFi.TolR3D();
1041 const TopoDS_Face aF1=TopoDS::Face(myDS->GetShape(nF1));//mpv
1042 const TopoDS_Face aF2=TopoDS::Face(myDS->GetShape(nF2));//mpv
1044 bVF=myContext.IsValidPointForFaces (aP1, aF1, aF2, aTolR3D);
1046 PutBoundPaveOnCurve (aP1, aT1, aBC, aFFi);
1049 bVF=myContext.IsValidPointForFaces (aP2, aF1, aF2, aTolR3D);
1051 PutBoundPaveOnCurve (aP2, aT2, aBC, aFFi);
1054 //=======================================================================
1055 // function: PutBoundPaveOnCurve
1057 //=======================================================================
1058 void NMTTools_PaveFiller::PutBoundPaveOnCurve(const gp_Pnt& aP,
1059 const Standard_Real aT,
1060 BOPTools_Curve& aBC,
1061 BOPTools_SSInterference& aFFi)
1063 Standard_Boolean bFound1, bFound2;
1064 Standard_Integer nV;
1065 Standard_Real aTolV=aFFi.TolR3D();
1067 BOPTools_Pave aPave1, aPave2, aPave;
1068 BOPTools_PaveSet& aCPS=aBC.Set();
1069 BOPTools_PaveSet& aFFiPS=aFFi.NewPaveSet();
1070 const IntTools_Curve& aIC=aBC.Curve();
1072 bFound1=FindPave(aP, aTolV, aCPS , aPave1);
1073 bFound2=FindPave(aP, aTolV, aFFiPS, aPave2);
1075 if (!bFound1 && !bFound2) {
1076 TopoDS_Vertex aNewVertex;
1077 BOPTools_Tools::MakeNewVertex(aP, aTolV, aNewVertex);
1079 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
1080 myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
1081 nV=myDS->NumberOfInsertedShapes();
1086 aFFiPS.Append(aPave);
1088 // Append Techno Vertex to the Curve
1089 TColStd_ListOfInteger& aTVs=aBC.TechnoVertices();
1093 if (bFound1 && !bFound2) {
1097 aFFiPS.Append(aPave);
1099 const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));//mpv
1100 BOPTools_Tools::UpdateVertex (aIC, aT, aV);
1103 if (!bFound1 && bFound2) {
1109 const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));//mpv
1110 BOPTools_Tools::UpdateVertex (aIC, aT, aV);
1113 //=======================================================================
1114 // function: FindPave
1116 //=======================================================================
1117 Standard_Boolean NMTTools_PaveFiller::FindPave(const gp_Pnt& aP,
1118 const Standard_Real aTolPV,
1119 const BOPTools_PaveSet& aPS,
1120 BOPTools_Pave& aPave)
1122 Standard_Integer nV;
1123 Standard_Boolean bIsVertex=Standard_False;
1125 const BOPTools_ListOfPave& aLP=aPS.Set();
1126 BOPTools_ListIteratorOfListOfPave anIt(aLP);
1127 for (; anIt.More(); anIt.Next()) {
1128 const BOPTools_Pave& aPC=anIt.Value();
1130 const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));//mpv
1131 bIsVertex=IntTools_Tools::IsVertex (aP, aTolPV, aV);
1139 //=======================================================================
1140 // function: PrepareSetForFace
1142 //=======================================================================
1143 void NMTTools_PaveFiller::PrepareSetForFace(const Standard_Integer ,//nF1,
1144 const Standard_Integer ,//nF2,
1145 const BOPTools_ListOfPaveBlock& aLPBC,
1146 BOPTools_PaveSet& aPSF)
1148 Standard_Integer nV1, nV2;
1149 TColStd_MapOfInteger aMap;
1150 BOPTools_ListIteratorOfListOfPaveBlock anIt;
1152 anIt.Initialize(aLPBC);
1153 for (; anIt.More(); anIt.Next()) {
1154 const BOPTools_PaveBlock& aPB=anIt.Value();
1155 const BOPTools_Pave& aPave1=aPB.Pave1();
1157 if (!aMap.Contains(nV1)) {
1159 aPSF.Append(aPave1);
1161 const BOPTools_Pave& aPave2=aPB.Pave2();
1163 if (!aMap.Contains(nV2)) {
1165 aPSF.Append(aPave2);
1169 //=======================================================================
1170 // function: PutPaveOnCurve
1172 //=======================================================================
1173 void NMTTools_PaveFiller::PutPaveOnCurve(const BOPTools_PaveSet& aPaveSet,
1174 const Standard_Real aTolR3D,
1175 BOPTools_Curve& aBC)
1177 Standard_Integer nV;
1178 Standard_Boolean bIsVertexOnLine;
1180 BOPTools_ListIteratorOfListOfPave anIt;
1182 GeomAdaptor_Curve aGAC;
1184 const IntTools_Curve& aC=aBC.Curve();
1185 Handle (Geom_Curve) aC3D= aC.Curve();
1187 BndLib_Add3dCurve::Add(aGAC, aTolR3D, aBBC);
1189 const BOPTools_ListOfPave& aLP=aPaveSet.Set();
1190 anIt.Initialize(aLP);
1191 for (; anIt.More(); anIt.Next()) {
1192 const BOPTools_Pave& aPave=anIt.Value();
1195 const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));//mpv
1198 BRepBndLib::Add(aV, aBBV);
1199 if (aBBC.IsOut(aBBV)){
1203 bIsVertexOnLine=myContext.IsVertexOnLine(aV, aC, aTolR3D, aT);
1205 if (bIsVertexOnLine) {
1206 BOPTools_Pave aPaveNew(nV, aT, BooleanOperations_SurfaceSurface);
1207 BOPTools_PaveSet& aPS=aBC.Set();
1208 aPS.Append(aPaveNew);
1210 BOPTools_Tools::UpdateVertex (aC, aT, aV);
1215 //=======================================================================
1216 // function: IsPairFound
1218 //=======================================================================
1219 Standard_Boolean IsPairFound(const Standard_Integer nF1,
1220 const Standard_Integer nF2,
1221 BOPTools_InterferencePool* myIntrPool,
1222 BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
1223 BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith)
1225 Standard_Boolean bIsFound;
1227 if (!aMapWhat.Contains(nF1)) {
1228 TColStd_IndexedMapOfInteger aMWhat;
1229 FMapWhat(nF1, myIntrPool, aMWhat);
1230 aMapWhat.Add(nF1, aMWhat);
1233 if (!aMapWith.Contains(nF2)) {
1234 TColStd_IndexedMapOfInteger aMWith;
1235 FMapWith(nF2, myIntrPool, aMWith);
1236 aMapWith.Add(nF2, aMWith);
1239 const TColStd_IndexedMapOfInteger& aMWht=aMapWhat.FindFromKey(nF1);
1240 const TColStd_IndexedMapOfInteger& aMWit=aMapWith.FindFromKey(nF2);
1242 bIsFound=IsFound(aMWht, aMWit);
1246 //=======================================================================
1247 // function: FMapWhat
1249 //=======================================================================
1250 void FMapWhat(const Standard_Integer nF,
1251 BOPTools_InterferencePool* myIntrPool,
1252 TColStd_IndexedMapOfInteger& aMapWhat)
1255 Standard_Integer nE, nV;
1259 BooleanOperations_ShapesDataStructure* myDS=myIntrPool->DS();
1260 BooleanOperations_OnceExplorer aExp(*myDS);
1264 aExp.Init(nF, TopAbs_VERTEX);
1265 for (; aExp.More(); aExp.Next()) {
1270 aExp.Init(nF, TopAbs_EDGE);
1271 for (; aExp.More(); aExp.Next()) {
1276 //=======================================================================
1277 // function: FMapWith
1279 //=======================================================================
1280 void FMapWith(const Standard_Integer nF,
1281 BOPTools_InterferencePool* myIntrPool,
1282 TColStd_IndexedMapOfInteger& aMapWith)
1284 TColStd_IndexedMapOfInteger aMapWhat;
1286 FMapWhat(nF, myIntrPool, aMapWhat);
1289 Standard_Integer i, aNb, anIndex, aWhat, aWith;
1290 BOPTools_ListIteratorOfListOfInterference anIt;
1292 const BOPTools_CArray1OfInterferenceLine& anArrIL= myIntrPool->InterferenceTable();
1294 aNb=aMapWhat.Extent();
1295 for (i=1; i<=aNb; i++) {
1298 const BOPTools_InterferenceLine& aWithLine=anArrIL(aWhat);
1300 const BOPTools_ListOfInterference& aLI=aWithLine.List();
1301 anIt.Initialize(aLI);
1302 for (; anIt.More(); anIt.Next()) {
1303 const BOPTools_Interference& anIntf=anIt.Value();
1304 anIndex=anIntf.Index();
1306 aWith=anIntf.With();
1307 aMapWith.Add(aWith);
1312 //=======================================================================
1313 // function: IsFound
1315 //=======================================================================
1316 Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
1317 const TColStd_IndexedMapOfInteger& aMapWith)
1319 Standard_Boolean bFlag=Standard_False;
1320 Standard_Integer i, aNb, aWhat;
1322 aNb=aMapWhat.Extent();
1323 for (i=1; i<=aNb; i++) {
1325 if (aMapWith.Contains(aWhat)) {
1331 // Modified Thu Sep 14 14:35:18 2006
1332 // Contribution of Samtech www.samcef.com BEGIN
1333 //=======================================================================
1334 //function : SharedEdges1
1336 //=======================================================================
1337 void SharedEdges1(const TopoDS_Face& aF1,
1338 const TopoDS_Face& aF2,
1339 TopTools_ListOfShape& aLS)
1341 Standard_Integer i, aNbE, aNbF;;
1342 TopTools_IndexedDataMapOfShapeListOfShape aMEF;
1344 TopExp::MapShapesAndAncestors(aF1, TopAbs_EDGE, TopAbs_FACE, aMEF);
1345 TopExp::MapShapesAndAncestors(aF2, TopAbs_EDGE, TopAbs_FACE, aMEF);
1348 for (i=1; i<=aNbE; ++i) {
1349 const TopTools_ListOfShape& aLF=aMEF.FindFromIndex(i);
1353 const TopoDS_Shape& aF1x=aLF.First();
1354 const TopoDS_Shape& aF2x=aLF.Last();
1355 if (aF1x.IsSame(aF2x)) {
1359 const TopoDS_Shape& aE=aMEF.FindKey(i);
1365 //=======================================================================
1366 // function: CheckCoincidence
1368 //=======================================================================
1369 Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock& aPBNew,
1370 const BOPTools_ListOfPaveBlock& aLPBFF)
1373 Standard_Boolean bRet;
1375 Standard_Integer nV11, nV12, nV21, nV22, iVV, iVE, nE2;
1376 Standard_Integer iV, iCount, iCountExt;
1377 BOPTools_ListIteratorOfListOfPaveBlock anIt;
1379 const BOPTools_Pave& aPave11=aPBNew.Pave1();
1380 nV11=aPave11.Index();
1381 const TopoDS_Vertex& aV11=TopoDS::Vertex(myDS->Shape(nV11));
1384 const BOPTools_Pave& aPave12=aPBNew.Pave2();
1385 nV12=aPave12.Index();
1386 const TopoDS_Vertex& aV12=TopoDS::Vertex(myDS->Shape(nV12));
1390 anIt.Initialize(aLPBFF);
1391 for (; anIt.More(); anIt.Next()) {
1394 const BOPTools_PaveBlock& aPBR=anIt.Value();
1396 const BOPTools_Pave& aPave21=aPBR.Pave1();
1397 nV21=aPave21.Index();
1400 const BOPTools_Pave& aPave22=aPBR.Pave2();
1401 nV22=aPave22.Index();
1403 if (nV11==nV21 || nV11==nV22 || nV12==nV21 || nV12==nV22) {
1410 const TopoDS_Vertex& aV21=TopoDS::Vertex(myDS->Shape(nV21));
1411 const TopoDS_Vertex& aV22=TopoDS::Vertex(myDS->Shape(nV22));
1412 const TopoDS_Edge& aE2=TopoDS::Edge(myDS->Shape(nE2));
1416 iVV=IntTools_Tools::ComputeVV (aV11, aV21);
1420 if (iCount>iCountExt) {
1425 iVV=IntTools_Tools::ComputeVV (aV11, aV22);
1429 if (iCount>iCountExt) {
1435 iVE=myContext.ComputeVE (aV11, aE2, aTE);
1438 if (iCount>iCountExt) {
1445 iVV=IntTools_Tools::ComputeVV (aV12, aV21);
1449 if (iCount>iCountExt) {
1454 iVV=IntTools_Tools::ComputeVV (aV12, aV22);
1458 if (iCount>iCountExt) {
1464 iVE=myContext.ComputeVE (aV12, aE2, aTE);
1467 if (iCount>iCountExt) {
1473 bRet=(Standard_Boolean)(iCount>iCountExt);
1477 // Contribution of Samtech www.samcef.com END
1480 //=======================================================================
1481 //function : IsMicroEdge
1483 //=======================================================================
1484 Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
1485 IntTools_Context& aCtx)
1487 Standard_Boolean bRet;
1488 Standard_Integer iErr;
1489 Standard_Real aT1, aT2, aTmp;
1490 Handle(Geom_Curve) aC3D;
1491 TopoDS_Vertex aV1, aV2;
1494 bRet=(BRep_Tool::Degenerated(aE) ||
1495 !BRep_Tool::IsGeometric(aE));
1500 aC3D=BRep_Tool::Curve(aE, aT1, aT2);
1501 TopExp::Vertices(aE, aV1, aV2);
1502 aT1=BRep_Tool::Parameter(aV1, aE);
1503 aT2=BRep_Tool::Parameter(aV2, aE);
1512 IntTools_ShrunkRange aSR (aE, aV1, aV2, aR, aCtx);
1513 iErr=aSR.ErrorStatus();