X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNMTTools%2FNMTTools_Tools.cxx;h=3f986765ec772cb1ea1533603942cb23684802fb;hb=b568e7744737ad193de8a49b27a5769a4777d7fd;hp=9963ce4d0a8dccd9004beb132978629f960465ec;hpb=9499b99fe2dcb53e1ea364f97986f8f432b04600;p=modules%2Fgeom.git diff --git a/src/NMTTools/NMTTools_Tools.cxx b/src/NMTTools/NMTTools_Tools.cxx index 9963ce4d0..3f986765e 100644 --- a/src/NMTTools/NMTTools_Tools.cxx +++ b/src/NMTTools/NMTTools_Tools.cxx @@ -67,6 +67,10 @@ #include #include #include +// +#include +#include +#include static void ProcessBlock(const Standard_Integer iV, @@ -79,6 +83,70 @@ static TopTools_IndexedMapOfShape& aProcessed, TopTools_IndexedMapOfShape& aChain); +//modified by NIZNHY-PKV Thu Nov 16 10:46:53 2006f SKL/PartC5 +//======================================================================= +// function: UpdateEdge +// purpose: +//======================================================================= + void NMTTools_Tools::UpdateEdge(const TopoDS_Edge& aE, + const Standard_Real aTolR) +{ + Standard_Real aTolE, aTolES, aTolV; + TopoDS_Iterator aIt; + BRep_Builder aBB; + // + aTolE=BRep_Tool::Tolerance(aE); + aTolES=Max(aTolR, aTolE); + aBB.UpdateEdge(aE, aTolES); + // + aIt.Initialize(aE); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Vertex& aV=TopoDS::Vertex(aIt.Value()); + aTolV=BRep_Tool::Tolerance(aV); + if (aTolVIsPeriodic()) { + BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D, aC2DA); + } + else { + BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA); + } + // + aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolE); + BRepLib::SameParameter(aE); +} +/* //======================================================================= // function: MakePCurve // purpose: @@ -137,7 +205,8 @@ static aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolFact); BRepLib::SameParameter(aE); } - +*/ +//modified by NIZNHY-PKV Thu Nov 16 10:46:55 2006t //======================================================================= // function: IsSplitInOnFace // purpose: @@ -373,21 +442,49 @@ void ProcessBlock(const Standard_Integer iV, IntTools_Context& aCtx) { Standard_Boolean bFlag; - Standard_Integer i, aNbE1, aNbE2; - - TopTools_IndexedMapOfShape aME1, aME2; - TopoDS_Edge aEF1, aEF2; + // Modified Thu Sep 14 14:35:18 2006 + // Contribution of Samtech www.samcef.com BEGIN + Standard_Integer aNbE1, aNbE2; + Standard_Real aTolF1, aTolF2, aTol; + gp_Pnt2d aP2D; + gp_Pnt aP; TopoDS_Face aF1, aF2; + TopExp_Explorer aExp; + TopTools_MapOfShape aME1, aME2; + TopTools_MapIteratorOfMapOfShape aIt; + // + bFlag=Standard_False; + // Contribution of Samtech www.samcef.com END // aF1=aF1x; aF1.Orientation(TopAbs_FORWARD); aF2=aF2y; aF2.Orientation(TopAbs_FORWARD); // - TopExp::MapShapes(aF1, TopAbs_EDGE, aME1); - TopExp::MapShapes(aF2, TopAbs_EDGE, aME2); + // Modified Thu Sep 14 14:35:18 2006 + // Contribution of Samtech www.samcef.com BEGIN // - bFlag=Standard_False; + // 1 + aExp.Init(aF1, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Edge& aE=TopoDS::Edge(aExp.Current()); + if (!BRep_Tool::Degenerated(aE)) { + aME1.Add(aE); + } + } + // + aExp.Init(aF2, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Edge& aE=TopoDS::Edge(aExp.Current()); + if (!BRep_Tool::Degenerated(aE)) { + if (!aME1.Contains(aE)) { + return bFlag; + } + aME2.Add(aE); + } + } + // + // Contribution of Samtech www.samcef.com END // aNbE1=aME1.Extent(); aNbE2=aME2.Extent(); @@ -400,72 +497,18 @@ void ProcessBlock(const Standard_Integer iV, return bFlag; } // - for (i=1; i<=aNbE1; ++i) { - const TopoDS_Edge& aE1=TopoDS::Edge(aME1(i)); - if (BRep_Tool::Degenerated(aE1)) { - // not try to compare deg edges because it - // can not have same TShape on different faces at all - continue; - } - if (!aME2.Contains(aE1)) { - return bFlag; - } - } - // - Standard_Real aTolF1, aTolF2, aTol; - gp_Pnt2d aP2D; - gp_Pnt aP; - TopExp_Explorer anExp; - // - aTolF1=BRep_Tool::Tolerance(aF1); - aTolF2=BRep_Tool::Tolerance(aF2); - aTol=aTolF1+aTolF2; - // - anExp.Init(aF1, TopAbs_EDGE); - for (; anExp.More(); anExp.Next()) { - const TopoDS_Edge& aE1=TopoDS::Edge(anExp.Current()); - if (!BRep_Tool::Degenerated(aE1)) { - BOPTools_Tools3D::PointNearEdge(aE1, aF1, aP2D, aP); - bFlag=aCtx.IsValidPointForFace(aP, aF2, aTol); - break; - } - } - return bFlag; - /* - // - Standard_Real aU1, aU2, aV1, aV2; - Standard_Real dU, dV, aU, aV; - Standard_Integer aNbP=5, aNbP1, j; - gp_Pnt2d aP2D; - gp_Pnt aP; - // + // 2 aTolF1=BRep_Tool::Tolerance(aF1); aTolF2=BRep_Tool::Tolerance(aF2); aTol=aTolF1+aTolF2; // - BRepTools::UVBounds(aF1, aU1, aU2, aV1, aV2); - Handle(Geom_Surface) aS1=BRep_Tool::Surface(aF1); - // - aNbP1=aNbP+1; - dU=(aU2-aU1)/aNbP1; - dV=(aV2-aV1)/aNbP1; - // - for (i=1; i<=aNbP; ++i) { - aU=aU1+i*dU; - for (j=1; j<=aNbP; ++j) { - aV=aV1+j*dV; - aP2D.SetCoord(aU, aV); - // - if(aCtx.IsPointInFace(aF1, aP2D)) { - aP=aS1->Value(aU, aV); - bFlag=aCtx.IsValidPointForFace(aP, aF2, aTol); - if (!bFlag) { - return bFlag; - } - } - } + aIt.Initialize(aME1); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Edge& aE=TopoDS::Edge(aIt.Key()); + BOPTools_Tools3D::PointNearEdge(aE, aF1, aP2D, aP); + bFlag=aCtx.IsValidPointForFace(aP, aF2, aTol); + break; } - */ // return bFlag; }