Salome HOME
Feature #233: Export of groups.
[modules/hydro.git] / src / HYDROData / HYDROData_BSplineOperation.h
1
2 #ifndef HYDROData_BSplineOperation_HeaderFile
3 #define HYDROData_BSplineOperation_HeaderFile
4
5 #include <HYDROData.h>
6
7 #include <Geom_BSplineCurve.hxx>
8
9 #include <NCollection_Sequence.hxx>
10
11 class QPainterPath;
12 class gp_XYZ;
13
14 /**\class HYDROData_BSplineOperation
15  *
16  * \brief Allows to work with splines: create, convert to Qt ToolPath.
17  *
18  * Uses GEOM module for creation of BSplines, OCCT algorithms for 
19  * manipulation and conversion.
20  */
21
22 class HYDRODATA_EXPORT HYDROData_BSplineOperation
23 {
24 public:
25
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 );
33   
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; }
37   
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;
41
42 private:
43   Handle(Geom_BSplineCurve) myCurve; ///< resulting BSpline, null if something is wrong
44 };
45
46 #endif