X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_PolylineXY.cxx;h=1c824402a3276a9d19d48de047d4790d619d2061;hb=18bf2fdae8933e8a31ca58f36b6dceb7a4a8cf42;hp=32f2ddabdc1d7a21e19920f2f29c3dbb76db9f6f;hpb=f9bd5128a1aed8c1974b1d1cfb87aff32191fa60;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index 32f2ddab..1c824402 100755 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -428,9 +428,10 @@ TopoDS_Wire HYDROData_PolylineXY::BuildWire( const SectionType& if ( thePoints.Size() > 1 ) { - HYDROData_BSplineOperation aBSpline( thePoints, theIsClosed, LOCAL_SELECTION_TOLERANCE ); + Handle(Geom_BSplineCurve) aCurve = + HYDROData_BSplineOperation::ComputeCurve( thePoints, theIsClosed, LOCAL_SELECTION_TOLERANCE ); - TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aBSpline.Curve() ).Edge(); + TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aCurve ).Edge(); aMakeWire.Add( anEdge ); } aMakeWire.Build(); @@ -466,8 +467,9 @@ void HYDROData_PolylineXY::BuildPainterPath( QPainterPath& } else { - HYDROData_BSplineOperation aBSpline( thePoints, theIsClosed, LOCAL_SELECTION_TOLERANCE ); - aBSpline.ComputePath( thePath ); + Handle(Geom_BSplineCurve) aCurve = + HYDROData_BSplineOperation::ComputeCurve( thePoints, theIsClosed, LOCAL_SELECTION_TOLERANCE ); + HYDROData_BSplineOperation::ComputePath( aCurve, thePath ); } } @@ -655,18 +657,19 @@ double HYDROData_PolylineXY::GetDistance( const int theSectionIndex, aPointToTest = aPoint; } - HYDROData_BSplineOperation aBSpline( aPoints, anIsSectionClosed, LOCAL_SELECTION_TOLERANCE ); + Handle(Geom_BSplineCurve) aCurve = + HYDROData_BSplineOperation::ComputeCurve( aPoints, anIsSectionClosed, LOCAL_SELECTION_TOLERANCE ); - Quantity_Parameter aFirstParam = aBSpline.Curve()->FirstParameter(); - Quantity_Parameter aSecondParam = aBSpline.Curve()->LastParameter(); + Quantity_Parameter aFirstParam = aCurve->FirstParameter(); + Quantity_Parameter aSecondParam = aCurve->LastParameter(); if ( thePointIndex != aSectNbPoints - 1 ) { - GeomAPI_ProjectPointOnCurve aProject( aPointToTest, aBSpline.Curve() ); + GeomAPI_ProjectPointOnCurve aProject( aPointToTest, aCurve ); aSecondParam = aProject.LowerDistanceParameter(); } - GeomAdaptor_Curve anAdap( aBSpline.Curve() ); + GeomAdaptor_Curve anAdap( aCurve ); aResDistance = GCPnts_AbscissaPoint::Length( anAdap, aFirstParam, aSecondParam ); }