]> OCCT Git - occt-copy.git/commitdiff
0028765: Get rid of creation of trimmed curve in IntTools_Context::Hatcher to avoid...
authormsv <msv@opencascade.com>
Tue, 23 May 2017 06:44:38 +0000 (09:44 +0300)
committeremv <emv@opencascade.com>
Fri, 29 Sep 2017 13:55:48 +0000 (16:55 +0300)
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
src/IntTools/IntTools_Context.cxx

index d27dc7e15587cf12f36dcb803ce17ae20e37efdc..e30e8a54592aba674addb8169bf547d8c0032d1e 100644 (file)
@@ -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 :
index a4d26b8e2f2146b0a0822a387cd0752bb440f657..01737fed35fdddbfac4041ba05ffd0547614fd25 100644 (file)
@@ -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()) {
     //