Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

qwt_autoscl.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_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;          // smallest input value
00129     double d_maxValue;          // greatest input value
00130 
00131     double d_scaleMin;          // scale minimum
00132     double d_scaleMax;          // scale maximum
00133 
00134     double d_step;          // user-defined step size
00135     int d_maxMajor;         // max. no. of scale divisions
00136     int d_maxMinor;         // max. number of minor intervals
00137 
00138     int d_scaleOpt;         // scale options
00139     bool d_autoScale;           // autoscale mode
00140 
00141     double d_loMargin;          // margins
00142     double d_hiMargin;
00143 
00144     int d_reset;            // d_minValue and d_maxValue are invalid
00145     double d_ref;           // reference point
00146     double d_lref;          // special reference point for logarithmic scales
00147 
00148     bool d_autoRebuild;         // rebuild scale automatically with
00149             // call to 'adjust'
00150 
00151 };
00152 
00153 #endif

Generated on Sun Nov 21 11:12:42 2004 for Qwt User's Guide by doxygen 1.3.5