Qwt User's Guide svn
qwt_spline.h
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
00008  *****************************************************************************/
00009 
00010 #ifndef QWT_SPLINE_H
00011 #define QWT_SPLINE_H
00012 
00013 #include "qwt_global.h"
00014 #include <qpolygon.h>
00015 #include <qvector.h>
00016 
00057 class QWT_EXPORT QwtSpline
00058 {
00059 public:
00061     enum SplineType
00062     {
00064         Natural,
00065 
00067         Periodic
00068     };
00069 
00070     QwtSpline();
00071     QwtSpline( const QwtSpline & );
00072 
00073     ~QwtSpline();
00074 
00075     QwtSpline &operator=( const QwtSpline & );
00076 
00077     void setSplineType( SplineType );
00078     SplineType splineType() const;
00079 
00080     bool setPoints( const QPolygonF& points );
00081     QPolygonF points() const;
00082 
00083     void reset();
00084 
00085     bool isValid() const;
00086     double value( double x ) const;
00087 
00088     const QVector<double> &coefficientsA() const;
00089     const QVector<double> &coefficientsB() const;
00090     const QVector<double> &coefficientsC() const;
00091 
00092 protected:
00093     bool buildNaturalSpline( const QPolygonF & );
00094     bool buildPeriodicSpline( const QPolygonF & );
00095 
00096 private:
00097     class PrivateData;
00098     PrivateData *d_data;
00099 };
00100 
00101 #endif
qmi style