From: msv Date: Tue, 23 May 2017 06:44:38 +0000 (+0300) Subject: 0028765: Get rid of creation of trimmed curve in IntTools_Context::Hatcher to avoid... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR28765;p=occt-copy.git 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. --- 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 903a0e38f9..7913db5276 100644 --- a/src/IntTools/IntTools_Context.cxx +++ b/src/IntTools/IntTools_Context.cxx @@ -421,7 +421,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; // @@ -455,8 +454,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()) { //