00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_AUTOSCL_H
00011 #define QWT_AUTOSCL_H
00012
00013 #include "qwt_global.h"
00014 #include "qwt_scldiv.h"
00015
00078 class QWT_EXPORT QwtAutoScale
00079 {
00080 public:
00081 enum {None = 0, IncludeRef = 1, Symmetric = 2, Floating = 4,
00082 Logarithmic = 8, Inverted = 16 };
00083
00084 QwtAutoScale();
00085 ~QwtAutoScale();
00086
00087 void setAutoScale();
00088 bool autoScale() const;
00089
00090 void setAutoRebuild(bool);
00091 bool autoRebuild() const;
00092
00093 void changeOptions(int opt, bool tf);
00094 void setOptions(int opt);
00095 bool option(int opt) const;
00096 int options() const;
00097
00098 void setMaxMajor( int n );
00099 int maxMajor() const;
00100 void setMaxMinor(int n);
00101 int maxMinor() const;
00102
00103 void setReference(double r);
00104 double reference() const;
00105
00106 void setMargins(double m1, double m2);
00107 double loMargin() const;
00108 double hiMargin() const;
00109
00110 void setScale(double xmin, double xmax, double step = 0.0);
00111 const QwtScaleDiv &scaleDiv() const;
00112
00113 void adjust(double *arr, int n, int reset = 0);
00114 void adjust(const QwtArray<double> &x, int reset = 0);
00115 void adjust(double x1, double x2, int reset = 0);
00116
00117 void build();
00118 void reset();
00119
00120 protected:
00121 void buildLinScale();
00122 void buildLogScale();
00123 void setRange(double x1, double x2);
00124
00125 private:
00126 QwtScaleDiv d_scldiv;
00127
00128 double d_minValue;
00129 double d_maxValue;
00130
00131 double d_scaleMin;
00132 double d_scaleMax;
00133
00134 double d_step;
00135 int d_maxMajor;
00136 int d_maxMinor;
00137
00138 int d_scaleOpt;
00139 bool d_autoScale;
00140
00141 double d_loMargin;
00142 double d_hiMargin;
00143
00144 int d_reset;
00145 double d_ref;
00146 double d_lref;
00147
00148 bool d_autoRebuild;
00149
00150
00151 };
00152
00153 #endif