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(double x1, double x2, int reset = 0);
00115
00116 void build();
00117 void reset();
00118
00119 protected:
00120 void buildLinScale();
00121 void buildLogScale();
00122 void setRange(double x1, double x2);
00123
00124 private:
00125 QwtScaleDiv d_scldiv;
00126
00127 double d_minValue;
00128 double d_maxValue;
00129
00130 double d_scaleMin;
00131 double d_scaleMax;
00132
00133 double d_step;
00134 int d_maxMajor;
00135 int d_maxMinor;
00136
00137 int d_scaleOpt;
00138 bool d_autoScale;
00139
00140 double d_loMargin;
00141 double d_hiMargin;
00142
00143 int d_reset;
00144 double d_ref;
00145 double d_lref;
00146
00147 bool d_autoRebuild;
00148
00149
00150 };
00151
00152 #endif