2 #ifndef HYDROData_BSplineOperation_HeaderFile
3 #define HYDROData_BSplineOperation_HeaderFile
7 #include <Geom_BSplineCurve.hxx>
9 #include <NCollection_Sequence.hxx>
14 /**\class HYDROData_BSplineOperation
16 * \brief Allows to work with splines: create, convert to Qt ToolPath.
18 * Uses GEOM module for creation of BSplines, OCCT algorithms for
19 * manipulation and conversion.
22 class HYDRODATA_EXPORT HYDROData_BSplineOperation
26 //! Creates a spline by list of coordinates: pairs X and Y
27 //! \param thePoints coordinates of curve
28 //! \param theIsClosed flag indicating that the result spline should be closed
29 //! \param theTolerance flag indicating the tolerance to skip equal points
30 HYDROData_BSplineOperation( const NCollection_Sequence<gp_XYZ>& thePoints,
31 const bool theIsClosed,
32 const double theTolerance );
34 //! Returns the BSpline curve passing through the points
35 //! \returns Null if Computation of BSpline was failed
36 Handle(Geom_BSplineCurve) Curve() const { return myCurve; }
38 //! Performs conversion from BSpline curve to QPainterPath made from Bezier curves
39 //! \returns computed PainterPath, not stored in this class, so calling of this method is not fast
40 void ComputePath( QPainterPath& thePath ) const;
43 Handle(Geom_BSplineCurve) myCurve; ///< resulting BSpline, null if something is wrong