Salome HOME
Dump to Python script correction.
[modules/hydro.git] / src / HYDROData / HYDROData_BSplineOperation.h
1 #ifndef HYDROData_BSplineOperation_HeaderFile
2 #define HYDROData_BSplineOperation_HeaderFile
3
4 #include <HYDROData.h>
5 #include <QList>
6 #include <QPainterPath>
7 #include <Geom_BSplineCurve.hxx>
8
9 /**\class HYDROData_BSplineOperation
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 HYDROData_BSplineOperation
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   //! \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);
28   
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;}
32   
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;
36 private:
37   Handle(Geom_BSplineCurve) myCurve; ///< resulting BSpline, null if something is wrong
38 };
39
40 #endif