Qwt User's Guide 6.1.0

- Main Page
- Related Pages
- Classes

All Classes Functions Variables Typedefs Enumerations Enumerator Pages
qwt_scale_div.h
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_interval.h"
15 #include <qlist.h>
16
17 #ifndef QT_NO_DEBUG_STREAM
18 #include <qdebug.h>
19 #endif
20
36 class QWT_EXPORT QwtScaleDiv
37 {
38 public:
40 enum TickType
41 {
43 NoTick = -1,
44
46 MinorTick,
47
49 MediumTick,
50
52 MajorTick,
53
55 NTickTypes
56 };
57
58 explicit QwtScaleDiv( double lowerBound = 0.0,
59 double upperBound = 0.0 );
60
61 explicit QwtScaleDiv( const QwtInterval &, QList<double>[NTickTypes] );
62
63 explicit QwtScaleDiv( double lowerBound, double upperBound,
64 QList<double>[NTickTypes] );
65
66 explicit QwtScaleDiv( double lowerBound, double upperBound,
67 const QList<double> &minorTicks, const QList<double> &mediumTicks,
68 const QList<double> &majorTicks );
69
70 bool operator==( const QwtScaleDiv & ) const;
71 bool operator!=( const QwtScaleDiv & ) const;
72
73 void setInterval( double lowerBound, double upperBound );
74 void setInterval( const QwtInterval & );
75 QwtInterval interval() const;
76
77 void setLowerBound( double );
78 double lowerBound() const;
79
80 void setUpperBound( double );
81 double upperBound() const;
82
83 double range() const;
84
85 bool contains( double value ) const;
86
87 void setTicks( int tickType, const QList<double> & );
88 QList<double> ticks( int tickType ) const;
89
90 bool isEmpty() const;
91 bool isIncreasing() const;
92
93 void invert();
94 QwtScaleDiv inverted() const;
95
96 QwtScaleDiv bounded( double lowerBound, double upperBound ) const;
97
98 private:
99 double d_lowerBound;
100 double d_upperBound;
101 QList<double> d_ticks[NTickTypes];
102 };
103
104 Q_DECLARE_TYPEINFO( QwtScaleDiv, Q_MOVABLE_TYPE );
105
106 #ifndef QT_NO_DEBUG_STREAM
107 QWT_EXPORT QDebug operator<<( QDebug, const QwtScaleDiv & );
108 #endif
109
110 #endif