-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathqwt_scale_draw.h
69 lines (52 loc) · 1.75 KB
/
qwt_scale_draw.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include "qwt_abstract_scale_draw.h"
#include <qpoint.h>
#include <qrect.h>
#include <qtransform.h>
/*!
\brief A class for drawing scales
QwtScaleDraw can be used to draw linear or logarithmic scales.
A scale has a position, an alignment and a length, which can be specified .
After a scale division has been specified as a QwtScaleDiv object
using QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s),
the scale can be drawn with the QwtAbstractScaleDraw::draw() member.
*/
class QwtScaleDraw: public QwtAbstractScaleDraw
{
public:
/*!
Alignment of the scale draw
\sa setAlignment(), alignment()
*/
enum Alignment
{
//! The scale is below
BottomScale,
//! The scale is above
TopScale,
//! The scale is left
LeftScale,
//! The scale is right
RightScale
};
double Multiplier;
QwtScaleDraw();
virtual double extent( const QFont & ) const;
void move( double x, double y ) { move( QPointF( x, y ) ); }
void move( const QPointF & );
void setLength( double length );
void setAlignment( Alignment );
Qt::Orientation orientation() const;
int maxLabelHeight( const QFont & ) const;
int maxLabelWidth( const QFont & ) const;
QPointF labelPosition( double val ) const;
QSizeF labelSize( const QFont &, double val ) const;
QPointF labelOffset( const QSizeF & ) const;
virtual void drawTick( QPainter *, double val, double len ) const;
virtual void drawBackbone( QPainter * ) const;
virtual void drawLabel( QPainter *, double val ) const;
void updateMap();
QPointF pos;
double len;
Alignment alignment;
};