Qwt User's Guide 6.3.0

Loading...
Searching...
No Matches
qwt_scale_div.h
1/******************************************************************************
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 <qlist.h>
15
16 class QwtInterval;
17
33 class QWT_EXPORT QwtScaleDiv
34{
35 public:
37 enum TickType
38 {
40 NoTick = -1,
41
43 MinorTick,
44
46 MediumTick,
47
49 MajorTick,
50
52 NTickTypes
53 };
54
55 explicit QwtScaleDiv( double lowerBound = 0.0,
56 double upperBound = 0.0 );
57
58 explicit QwtScaleDiv( const QwtInterval&, QList< double >[NTickTypes] );
59
60 explicit QwtScaleDiv( double lowerBound, double upperBound,
61 QList< double >[NTickTypes] );
62
63 explicit QwtScaleDiv( double lowerBound, double upperBound,
64 const QList< double >& minorTicks, const QList< double >& mediumTicks,
65 const QList< double >& majorTicks );
66
67 bool operator==( const QwtScaleDiv& ) const;
68 bool operator!=( const QwtScaleDiv& ) const;
69
70 void setInterval( double lowerBound, double upperBound );
71 void setInterval( const QwtInterval& );
72 QwtInterval interval() const;
73
74 void setLowerBound( double );
75 double lowerBound() const;
76
77 void setUpperBound( double );
78 double upperBound() const;
79
80 double range() const;
81
82 bool contains( double value ) const;
83
84 void setTicks( int tickType, const QList< double >& );
85 QList< double > ticks( int tickType ) const;
86
87 bool isEmpty() const;
88 bool isIncreasing() const;
89
90 void invert();
91 QwtScaleDiv inverted() const;
92
93 QwtScaleDiv bounded( double lowerBound, double upperBound ) const;
94
95 private:
96 double m_lowerBound;
97 double m_upperBound;
98 QList< double > m_ticks[NTickTypes];
99};
100
101Q_DECLARE_TYPEINFO( QwtScaleDiv, Q_MOVABLE_TYPE );
102
103#ifndef QT_NO_DEBUG_STREAM
104QWT_EXPORT QDebug operator<<( QDebug, const QwtScaleDiv& );
105#endif
106
107#endif
QList< double >
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23
QwtScaleDiv
A class representing a scale division.
Definition qwt_scale_div.h:34
QwtScaleDiv::TickType
TickType
Scale tick types.
Definition qwt_scale_div.h:38
QwtScaleDiv::MediumTick
@ MediumTick
Medium ticks.
Definition qwt_scale_div.h:46
QwtScaleDiv::MinorTick
@ MinorTick
Minor ticks.
Definition qwt_scale_div.h:43
QwtScaleDiv::MajorTick
@ MajorTick
Major ticks.
Definition qwt_scale_div.h:49