00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 #ifndef QWT_SCALE_DIV_H
00011 #define QWT_SCALE_DIV_H
00012 
00013 #include "qwt_global.h"
00014 #include "qwt_valuelist.h"
00015 
00016 class QwtDoubleInterval;
00017 
00029 class QWT_EXPORT QwtScaleDiv
00030 {
00031 public:
00032     enum TickType
00033     {
00034         NoTick = -1,
00035 
00036         MinorTick,
00037         MediumTick,
00038         MajorTick,
00039 
00040         NTickTypes
00041     };
00042 
00043     explicit QwtScaleDiv();
00044     explicit QwtScaleDiv(const QwtDoubleInterval &,
00045         QwtValueList[NTickTypes]);
00046     explicit QwtScaleDiv(double lBound, double rBound,
00047         QwtValueList[NTickTypes]);
00048 
00049     int operator==(const QwtScaleDiv &s) const;
00050     int operator!=(const QwtScaleDiv &s) const;
00051     
00052     inline double lBound() const;
00053     inline double hBound() const;
00054     inline double range() const;
00055 
00056     bool contains(double v) const;
00057 
00058     const QwtValueList &ticks(int type) const;
00059 
00060     void invalidate();
00061     bool isValid() const;
00062  
00063     void invert();
00064 
00065 private:
00066     double d_lBound;
00067     double d_hBound;
00068     QwtValueList d_ticks[NTickTypes];
00069 
00070     bool d_isValid;
00071 };
00072 
00077 inline double QwtScaleDiv::lBound() const 
00078 { 
00079     return d_lBound;
00080 }
00081 
00086 inline double QwtScaleDiv::hBound() const 
00087 { 
00088     return d_hBound;
00089 }
00090 
00094 inline double QwtScaleDiv::range() const 
00095 { 
00096     return d_hBound - d_lBound;
00097 }
00098 #endif