1 #ifndef HYDROData_BSplineOperation_HeaderFile
2 #define HYDROData_BSplineOperation_HeaderFile
6 #include <QPainterPath>
7 #include <Geom_BSplineCurve.hxx>
9 /**\class HYDROData_BSplineOperation
11 * \brief Allows to work with splines: create, convert to Qt ToolPath.
13 * Uses GEOM module for creation of BSplines, OCCT algorithms for
14 * manipulation and conversion.
17 class HYDRODATA_EXPORT HYDROData_BSplineOperation
21 //! Creates a spline by list of coordinates: pairs X and Y
22 //! \param thePoints coordinates in format X1, Y1, X2, Y2, etc. must be even number of elements
23 //! \param theZValue constant value of the spline Z coordinate
24 //! \param theIsClosed flag indicating that the result spline should be closed
25 HYDROData_BSplineOperation(const QList<double>& thePoints,
26 const double theZValue,
27 const bool theIsClosed);
29 //! Returns the BSpline curve passing through the points
30 //! \returns Null if Computation of BSpline was failed
31 Handle(Geom_BSplineCurve) Curve() const {return myCurve;}
33 //! Performs conversion from BSpline curve to QPainterPath made from Bezier curves
34 //! \returns computed PainterPath, not stored in this class, so calling of this method is not fast
35 QPainterPath ComputePath() const;
37 Handle(Geom_BSplineCurve) myCurve; ///< resulting BSpline, null if something is wrong