~showard314/ubuntu/natty/qtiplot/Python2.7_fix

« back to all changes in this revision

Viewing changes to 3rdparty/qwt/src/qwt_scale_div.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2008-04-04 15:11:55 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080404151155-rjp12ziov4tryj0o
Tags: 0.9.4-1
* New upstream release.
* Refresh patches.
* Remove 04_homepage_url patch. Merged upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
 
2
 * Qwt Widget Library
 
3
 * Copyright (C) 1997   Josef Wilgen
 
4
 * Copyright (C) 2002   Uwe Rathmann
 
5
 * 
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the Qwt License, Version 1.0
 
8
 *****************************************************************************/
 
9
 
 
10
#ifndef QWT_SCALE_DIV_H
 
11
#define QWT_SCALE_DIV_H
 
12
 
 
13
#include "qwt_global.h"
 
14
#include "qwt_valuelist.h"
 
15
 
 
16
class QwtDoubleInterval;
 
17
 
 
18
/*!
 
19
  \brief A class representing a scale division
 
20
 
 
21
  A scale division consists of its limits and 3 list
 
22
  of tick values qualified as major, medium and minor ticks.
 
23
 
 
24
  In most cases scale divisions are calculated by a QwtScaleEngine.
 
25
 
 
26
  \sa QwtScaleEngine::subDivideInto, QwtScaleEngine::subDivide
 
27
*/
 
28
 
 
29
class QWT_EXPORT QwtScaleDiv
 
30
{
 
31
public:
 
32
    enum TickType
 
33
    {
 
34
        NoTick = -1,
 
35
 
 
36
        MinorTick,
 
37
        MediumTick,
 
38
        MajorTick,
 
39
 
 
40
        NTickTypes
 
41
    };
 
42
 
 
43
    explicit QwtScaleDiv();
 
44
    explicit QwtScaleDiv(const QwtDoubleInterval &,
 
45
        QwtValueList[NTickTypes]);
 
46
    explicit QwtScaleDiv(double lBound, double rBound,
 
47
        QwtValueList[NTickTypes]);
 
48
 
 
49
    int operator==(const QwtScaleDiv &s) const;
 
50
    int operator!=(const QwtScaleDiv &s) const;
 
51
    
 
52
    inline double lBound() const;
 
53
    inline double hBound() const;
 
54
    inline double range() const;
 
55
 
 
56
    bool contains(double v) const;
 
57
 
 
58
    const QwtValueList &ticks(int type) const;
 
59
 
 
60
    void invalidate();
 
61
    bool isValid() const;
 
62
 
 
63
    void invert();
 
64
 
 
65
private:
 
66
    double d_lBound;
 
67
    double d_hBound;
 
68
    QwtValueList d_ticks[NTickTypes];
 
69
 
 
70
    bool d_isValid;
 
71
};
 
72
 
 
73
/*! 
 
74
  \return left bound
 
75
  \sa QwtScaleDiv::hBound
 
76
*/
 
77
inline double QwtScaleDiv::lBound() const 
 
78
 
79
    return d_lBound;
 
80
}
 
81
 
 
82
/*! 
 
83
  \return right bound
 
84
  \sa QwtScaleDiv::lBound
 
85
*/
 
86
inline double QwtScaleDiv::hBound() const 
 
87
 
88
    return d_hBound;
 
89
}
 
90
 
 
91
/*! 
 
92
  \return hBound() - lBound()
 
93
*/
 
94
inline double QwtScaleDiv::range() const 
 
95
 
96
    return d_hBound - d_lBound;
 
97
}
 
98
#endif