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

qwt_autoscl.h

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

Generated on Fri Nov 7 14:11:44 2003 for Qwt Developer's Guide by doxygen 1.3.2