Qwt User's Guide
svn
|
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_CURVE_FITTER_H 00011 #define QWT_CURVE_FITTER_H 00012 00013 #include "qwt_global.h" 00014 #include <qpolygon.h> 00015 #include <qrect.h> 00016 00017 class QwtSpline; 00018 00022 class QWT_EXPORT QwtCurveFitter 00023 { 00024 public: 00025 virtual ~QwtCurveFitter(); 00026 00033 virtual QPolygonF fitCurve( const QPolygonF &polygon ) const = 0; 00034 00035 protected: 00036 QwtCurveFitter(); 00037 00038 private: 00039 QwtCurveFitter( const QwtCurveFitter & ); 00040 QwtCurveFitter &operator=( const QwtCurveFitter & ); 00041 }; 00042 00046 class QWT_EXPORT QwtSplineCurveFitter: public QwtCurveFitter 00047 { 00048 public: 00054 enum FitMode 00055 { 00061 Auto, 00062 00064 Spline, 00065 00067 ParametricSpline 00068 }; 00069 00070 QwtSplineCurveFitter(); 00071 virtual ~QwtSplineCurveFitter(); 00072 00073 void setFitMode( FitMode ); 00074 FitMode fitMode() const; 00075 00076 void setSpline( const QwtSpline& ); 00077 const QwtSpline &spline() const; 00078 QwtSpline &spline(); 00079 00080 void setSplineSize( int size ); 00081 int splineSize() const; 00082 00083 virtual QPolygonF fitCurve( const QPolygonF & ) const; 00084 00085 private: 00086 QPolygonF fitSpline( const QPolygonF & ) const; 00087 QPolygonF fitParametric( const QPolygonF & ) const; 00088 00089 class PrivateData; 00090 PrivateData *d_data; 00091 }; 00092 00110 class QWT_EXPORT QwtWeedingCurveFitter: public QwtCurveFitter 00111 { 00112 public: 00113 QwtWeedingCurveFitter( double tolerance = 1.0 ); 00114 virtual ~QwtWeedingCurveFitter(); 00115 00116 void setTolerance( double ); 00117 double tolerance() const; 00118 00119 virtual QPolygonF fitCurve( const QPolygonF & ) const; 00120 00121 private: 00122 class Line; 00123 00124 class PrivateData; 00125 PrivateData *d_data; 00126 }; 00127 00128 #endif