Qwt User's Guide: qwt_scale_div.h Source File

- Main Page
- Classes
- Files
- Related Pages

# qwt_scale_div.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_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