From 61e0a1daf4a4fe0bae3daee09010d7680b191499 Mon Sep 17 00:00:00 2001 From: msv Date: Tue, 23 May 2017 09:44:38 +0300 Subject: [PATCH] 0028765: Get rid of creation of trimmed curve in IntTools_Context::Hatcher to avoid exception In the method IntTools_Context::Hatcher 2D curve adaptor is created to pass to Geom2dHatch_Hatcher::AddElement(). An extra step of creation of the trimmed curve is excessive here, because the bounding parameters of the curve are also passed to the curve adaptor. --- src/Geom2dHatch/Geom2dHatch_Hatcher.cxx | 4 ++-- src/IntTools/IntTools_Context.cxx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Geom2dHatch/Geom2dHatch_Hatcher.cxx b/src/Geom2dHatch/Geom2dHatch_Hatcher.cxx index d27dc7e155..e30e8a5459 100644 --- a/src/Geom2dHatch/Geom2dHatch_Hatcher.cxx +++ b/src/Geom2dHatch/Geom2dHatch_Hatcher.cxx @@ -751,7 +751,7 @@ Standard_Boolean Geom2dHatch_Hatcher::GlobalTransition (HatchGen_PointOnHatching const Geom2dAdaptor_Curve& CurveH = HatchingCurve (Point.Index()) ; - myIntersector.LocalGeometry(CurveH.Curve(), Point.Parameter(), Tangente2d, Normale2d, Courbure); + myIntersector.LocalGeometry(CurveH, Point.Parameter(), Tangente2d, Normale2d, Courbure); Tangente.SetCoord (Tangente2d.X(), Tangente2d.Y(), 0.0) ; if (Courbure < Precision::Confusion()) { @@ -805,7 +805,7 @@ Standard_Boolean Geom2dHatch_Hatcher::GlobalTransition (HatchGen_PointOnHatching #endif Param = PntE.Parameter(); - myIntersector.LocalGeometry(CurveE.Curve(), Param, Tangente2d, Normale2d, Courbure); + myIntersector.LocalGeometry(CurveE, Param, Tangente2d, Normale2d, Courbure); //----------------------------------------------------------------------- // Calcul de la transition locale. On suppose les relations suivantes : diff --git a/src/IntTools/IntTools_Context.cxx b/src/IntTools/IntTools_Context.cxx index a4d26b8e2f..01737fed35 100644 --- a/src/IntTools/IntTools_Context.cxx +++ b/src/IntTools/IntTools_Context.cxx @@ -391,7 +391,6 @@ Geom2dHatch_Hatcher& IntTools_Context::Hatcher(const TopoDS_Face& aF) TopAbs_Orientation aOrE; Handle(Geom_Surface) aS; Handle(Geom2d_Curve) aC2D; - Handle(Geom2d_TrimmedCurve) aCT2D; TopoDS_Face aFF; TopExp_Explorer aExp; // @@ -425,8 +424,7 @@ Geom2dHatch_Hatcher& IntTools_Context::Hatcher(const TopoDS_Face& aF) continue; } // - aCT2D=new Geom2d_TrimmedCurve(aC2D, aU1, aU2); - Geom2dAdaptor_Curve aGAC (aCT2D); + Geom2dAdaptor_Curve aGAC (aC2D, aU1, aU2); pHatcher->AddElement(aGAC, aOrE); }// for (; aExp.More() ; aExp.Next()) { // -- 2.39.5