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

# qwt_scldiv.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_SCLDIV_H
    00011 #define QWT_SCLDIV_H
    00012
    00013 #include "qwt_global.h"
    00014 #include "qwt_array.h"
    00015
    00016 #if defined(QWT_TEMPLATEDLL)
    00017 // MOC_SKIP_BEGIN
    00018 template class QWT_EXPORT QwtArray<double>;
    00019 // MOC_SKIP_END
    00020 #endif
    00021
    00069 class QWT_EXPORT QwtScaleDiv
    00070 {
    00071 public:
    00072     QwtScaleDiv ();
    00073
    00074     int operator== (const QwtScaleDiv &s) const;
    00075     int operator!= (const QwtScaleDiv &s) const;
    00076
    00081     double lBound() const { return d_lBound; }
    00086     double hBound() const { return d_hBound; }
    00091     uint minCnt() const { return d_minMarks.size(); }
    00096     uint majCnt() const { return d_majMarks.size(); }
    00097
    00102     bool logScale() const { return d_log; }
    00103
    00105     double majMark(int i) const { return d_majMarks[i]; }
    00107     double minMark(int i) const { return d_minMarks[i]; }
    00108
    00113     double majStep() const { return d_majStep; }
    00114     void reset();
    00115
    00116     bool rebuild(double lBound, double hBound, int maxMaj, int maxMin,
    00117              bool log, double step = 0.0, bool ascend = TRUE);
    00118
    00119 private:
    00120     bool buildLinDiv(int maxMajMark, int maxMinMark, double step = 0.0);
    00121     bool buildLogDiv(int maxMajMark, int maxMinMark, double step = 0.0);
    00122
    00123     double d_lBound;
    00124     double d_hBound;
    00125     double d_majStep;
    00126     bool d_log;
    00127
    00128     QwtArray<double> d_majMarks;
    00129     QwtArray<double> d_minMarks;
    00130 };
    00131
    00132 #endif