Salome HOME
Drawing of zones in OCC view improved.
[modules/hydro.git] / src / HYDROData / HYDROOperations_BSpline.h
1 #ifndef HYDROOperations_BSpline_HeaderFile
2 #define HYDROOperations_BSpline_HeaderFile
3
4 #include <HYDROData.h>
5 #include <QList>
6 #include <QPainterPath>
7 #include <Geom_BSplineCurve.hxx>
8
9 /**\class HYDROOperations_BSpline
10  *
11  * \brief Allows to work with splines: create, convert to Qt ToolPath.
12  *
13  * Uses GEOM module for creation of BSplines, OCCT algorithms for 
14  * manipulation and conversion.
15  */
16
17 class HYDRODATA_EXPORT HYDROOperations_BSpline
18 {
19 public:
20
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   HYDROOperations_BSpline(QList<double>& thePoints);
24   
25   //! Returns the BSpline curve passing through the points
26   //! \returns Null if Computation of BSpline was failed
27   Handle(Geom_BSplineCurve) Curve() const {return myCurve;}
28   
29   //! Performs conversion from BSpline curve to QPainterPath made from Bezier curves
30   //! \returns computed PainterPath, not stored in this class, so calling of this method is not fast
31   QPainterPath ComputePath() const;
32 private:
33   Handle(Geom_BSplineCurve) myCurve; ///< resulting BSpline, null if something is wrong
34 };
35
36 #endif