X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FHYDROData%2FHYDROData_BSplineOperation.cxx;h=64ae37d4cb6ce8342354165aaafc3bf44e8d304b;hb=0f4c16e80e5c9160fb6e240e3f09b151701a1e5b;hp=f07d10174fdd6cb4edefefea321feafcf1ad6492;hpb=2cf9e838e652ae811d9b3931914771ad1836c6b8;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_BSplineOperation.cxx b/src/HYDROData/HYDROData_BSplineOperation.cxx index f07d1017..64ae37d4 100644 --- a/src/HYDROData/HYDROData_BSplineOperation.cxx +++ b/src/HYDROData/HYDROData_BSplineOperation.cxx @@ -17,16 +17,15 @@ // #include - -#include - -#include #include #include - +#include +#include #include -HYDROData_BSplineOperation::HYDROData_BSplineOperation( +#include + +Handle(Geom_BSplineCurve) HYDROData_BSplineOperation::ComputeCurve( const NCollection_Sequence& thePoints, const bool theIsClosed, const double theTolerance ) @@ -56,18 +55,20 @@ HYDROData_BSplineOperation::HYDROData_BSplineOperation( } // compute BSpline - GeomAPI_Interpolate aGBC( aHCurvePoints, theIsClosed, gp::Resolution() ); - aGBC.Perform(); - if ( aGBC.IsDone() ) - myCurve = aGBC.Curve(); + Handle(Geom_BSplineCurve) aBSpline; + if( CurveCreator_Utils::constructBSpline( aHCurvePoints, theIsClosed, aBSpline ) ) + return aBSpline; + else + return Handle(Geom_BSplineCurve)(); } -void HYDROData_BSplineOperation::ComputePath( QPainterPath& thePath ) const +void HYDROData_BSplineOperation::ComputePath( const Handle(Geom_BSplineCurve)& theCurve, + QPainterPath& thePath ) { - if ( myCurve.IsNull() ) // returns an empty Path if original curve is invalid + if ( theCurve.IsNull() ) // returns an empty Path if original curve is invalid return; - GeomConvert_BSplineCurveToBezierCurve aConverter(myCurve); + GeomConvert_BSplineCurveToBezierCurve aConverter(theCurve); int a, aNumArcs = aConverter.NbArcs(); for(a = 1; a <= aNumArcs; a++) {