~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt/doc/man/man3/QwtAbstractScaleDraw.3

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2009-07-01 16:08:21 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090701160821-gog44m4w7x2f4u6o
Tags: 5.2.0-1
* New upstream release.
* Add branch pull patch from svn r544.
* Bump Standards-Version to 3.8.2. No changes needed.
* Update installed manpages.
* Use qwt as base name for directory (drop version).
* Add missing warnings patch.
* Rewrite debian/rules: use dh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH "QwtAbstractScaleDraw" 3 "22 Mar 2009" "Qwt User's Guide" \" -*- nroff -*-
 
2
.ad l
 
3
.nh
 
4
.SH NAME
 
5
QwtAbstractScaleDraw \- A abstract base class for drawing scales.  
 
6
 
 
7
.PP
 
8
.SH SYNOPSIS
 
9
.br
 
10
.PP
 
11
\fC#include <qwt_abstract_scale_draw.h>\fP
 
12
.PP
 
13
Inherited by \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
 
14
.PP
 
15
.SS "Public Types"
 
16
 
 
17
.in +1c
 
18
.ti -1c
 
19
.RI "enum \fBScaleComponent\fP { \fBBackbone\fP =  1, \fBTicks\fP =  2, \fBLabels\fP =  4 }"
 
20
.br
 
21
.SS "Public Member Functions"
 
22
 
 
23
.in +1c
 
24
.ti -1c
 
25
.RI "\fBQwtAbstractScaleDraw\fP ()"
 
26
.br
 
27
.ti -1c
 
28
.RI "\fBQwtAbstractScaleDraw\fP (const \fBQwtAbstractScaleDraw\fP &)"
 
29
.br
 
30
.ti -1c
 
31
.RI "virtual \fB~QwtAbstractScaleDraw\fP ()"
 
32
.br
 
33
.ti -1c
 
34
.RI "\fBQwtAbstractScaleDraw\fP & \fBoperator=\fP (const \fBQwtAbstractScaleDraw\fP &)"
 
35
.br
 
36
.ti -1c
 
37
.RI "void \fBsetScaleDiv\fP (const \fBQwtScaleDiv\fP &s)"
 
38
.br
 
39
.ti -1c
 
40
.RI "const \fBQwtScaleDiv\fP & \fBscaleDiv\fP () const "
 
41
.br
 
42
.ti -1c
 
43
.RI "void \fBsetTransformation\fP (\fBQwtScaleTransformation\fP *)"
 
44
.br
 
45
.ti -1c
 
46
.RI "const \fBQwtScaleMap\fP & \fBmap\fP () const "
 
47
.br
 
48
.ti -1c
 
49
.RI "void \fBenableComponent\fP (\fBScaleComponent\fP, bool enable=true)"
 
50
.br
 
51
.ti -1c
 
52
.RI "bool \fBhasComponent\fP (\fBScaleComponent\fP) const "
 
53
.br
 
54
.ti -1c
 
55
.RI "void \fBsetTickLength\fP (\fBQwtScaleDiv::TickType\fP, int length)"
 
56
.br
 
57
.ti -1c
 
58
.RI "int \fBtickLength\fP (\fBQwtScaleDiv::TickType\fP) const "
 
59
.br
 
60
.ti -1c
 
61
.RI "int \fBmajTickLength\fP () const "
 
62
.br
 
63
.ti -1c
 
64
.RI "void \fBsetSpacing\fP (int margin)"
 
65
.br
 
66
.ti -1c
 
67
.RI "int \fBspacing\fP () const "
 
68
.br
 
69
.ti -1c
 
70
.RI "virtual void \fBdraw\fP (QPainter *, const QPalette &) const "
 
71
.br
 
72
.ti -1c
 
73
.RI "virtual \fBQwtText\fP \fBlabel\fP (double) const "
 
74
.br
 
75
.ti -1c
 
76
.RI "virtual int \fBextent\fP (const QPen &, const QFont &) const =0"
 
77
.br
 
78
.ti -1c
 
79
.RI "void \fBsetMinimumExtent\fP (int)"
 
80
.br
 
81
.ti -1c
 
82
.RI "int \fBminimumExtent\fP () const "
 
83
.br
 
84
.ti -1c
 
85
.RI "\fBQwtScaleMap\fP & \fBscaleMap\fP ()"
 
86
.br
 
87
.in -1c
 
88
.SS "Protected Member Functions"
 
89
 
 
90
.in +1c
 
91
.ti -1c
 
92
.RI "virtual void \fBdrawTick\fP (QPainter *painter, double value, int len) const =0"
 
93
.br
 
94
.ti -1c
 
95
.RI "virtual void \fBdrawBackbone\fP (QPainter *painter) const =0"
 
96
.br
 
97
.ti -1c
 
98
.RI "virtual void \fBdrawLabel\fP (QPainter *painter, double value) const =0"
 
99
.br
 
100
.ti -1c
 
101
.RI "void \fBinvalidateCache\fP ()"
 
102
.br
 
103
.ti -1c
 
104
.RI "const \fBQwtText\fP & \fBtickLabel\fP (const QFont &, double value) const "
 
105
.br
 
106
.in -1c
 
107
.SH "Detailed Description"
 
108
.PP 
 
109
A abstract base class for drawing scales. 
 
110
 
 
111
\fBQwtAbstractScaleDraw\fP can be used to draw linear or logarithmic scales.
 
112
.PP
 
113
After a scale division has been specified as a \fBQwtScaleDiv\fP object using \fBQwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s)\fP, the scale can be drawn with the \fBQwtAbstractScaleDraw::draw()\fP member. 
 
114
.SH "Member Enumeration Documentation"
 
115
.PP 
 
116
.SS "enum \fBQwtAbstractScaleDraw::ScaleComponent\fP"
 
117
.PP
 
118
Components of a scale
 
119
.PP
 
120
.IP "\(bu" 2
 
121
Backbone
 
122
.IP "\(bu" 2
 
123
Ticks
 
124
.IP "\(bu" 2
 
125
Labels
 
126
.PP
 
127
.PP
 
128
\fBSee also:\fP
 
129
.RS 4
 
130
\fBenableComponent()\fP, \fBhasComponent\fP 
 
131
.RE
 
132
.PP
 
133
 
 
134
.SH "Constructor & Destructor Documentation"
 
135
.PP 
 
136
.SS "QwtAbstractScaleDraw::QwtAbstractScaleDraw ()"
 
137
.PP
 
138
Constructor. 
 
139
.PP
 
140
The range of the scale is initialized to [0, 100], The spacing (distance between ticks and labels) is set to 4, the tick lengths are set to 4,6 and 8 pixels 
 
141
.SS "QwtAbstractScaleDraw::QwtAbstractScaleDraw (const \fBQwtAbstractScaleDraw\fP & other)"
 
142
.PP
 
143
Copy constructor. 
 
144
.PP
 
145
.SS "QwtAbstractScaleDraw::~QwtAbstractScaleDraw ()\fC [virtual]\fP"
 
146
.PP
 
147
Destructor. 
 
148
.PP
 
149
.SH "Member Function Documentation"
 
150
.PP 
 
151
.SS "void QwtAbstractScaleDraw::draw (QPainter * painter, const QPalette & palette) const\fC [virtual]\fP"
 
152
.PP
 
153
Draw the scale. 
 
154
.PP
 
155
\fBParameters:\fP
 
156
.RS 4
 
157
\fIpainter\fP The painter
 
158
.br
 
159
\fIpalette\fP Palette, text color is used for the labels, foreground color for ticks and backbone 
 
160
.RE
 
161
.PP
 
162
 
 
163
.SS "virtual void QwtAbstractScaleDraw::drawBackbone (QPainter * painter) const\fC [protected, pure virtual]\fP"
 
164
.PP
 
165
Draws the baseline of the scale 
 
166
.PP
 
167
\fBParameters:\fP
 
168
.RS 4
 
169
\fIpainter\fP Painter
 
170
.RE
 
171
.PP
 
172
\fBSee also:\fP
 
173
.RS 4
 
174
\fBdrawTick()\fP, \fBdrawLabel()\fP 
 
175
.RE
 
176
.PP
 
177
 
 
178
.PP
 
179
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
 
180
.SS "virtual void QwtAbstractScaleDraw::drawLabel (QPainter * painter, double value) const\fC [protected, pure virtual]\fP"
 
181
.PP
 
182
Draws the label for a major scale tick
 
183
.PP
 
184
\fBParameters:\fP
 
185
.RS 4
 
186
\fIpainter\fP Painter 
 
187
.br
 
188
\fIvalue\fP Value
 
189
.RE
 
190
.PP
 
191
\fBSee also:\fP
 
192
.RS 4
 
193
\fBdrawTick\fP, \fBdrawBackbone\fP 
 
194
.RE
 
195
.PP
 
196
 
 
197
.PP
 
198
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
 
199
.SS "virtual void QwtAbstractScaleDraw::drawTick (QPainter * painter, double value, int len) const\fC [protected, pure virtual]\fP"
 
200
.PP
 
201
Draw a tick
 
202
.PP
 
203
\fBParameters:\fP
 
204
.RS 4
 
205
\fIpainter\fP Painter 
 
206
.br
 
207
\fIvalue\fP Value of the tick 
 
208
.br
 
209
\fIlen\fP Lenght of the tick
 
210
.RE
 
211
.PP
 
212
\fBSee also:\fP
 
213
.RS 4
 
214
\fBdrawBackbone()\fP, \fBdrawLabel()\fP 
 
215
.RE
 
216
.PP
 
217
 
 
218
.PP
 
219
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
 
220
.SS "void QwtAbstractScaleDraw::enableComponent (\fBScaleComponent\fP component, bool enable = \fCtrue\fP)"
 
221
.PP
 
222
En/Disable a component of the scale
 
223
.PP
 
224
\fBParameters:\fP
 
225
.RS 4
 
226
\fIcomponent\fP Scale component 
 
227
.br
 
228
\fIenable\fP On/Off
 
229
.RE
 
230
.PP
 
231
\fBSee also:\fP
 
232
.RS 4
 
233
\fBhasComponent()\fP 
 
234
.RE
 
235
.PP
 
236
 
 
237
.SS "virtual int QwtAbstractScaleDraw::extent (const QPen &, const QFont &) const\fC [pure virtual]\fP"
 
238
.PP
 
239
Calculate the extent
 
240
.PP
 
241
The extent is the distcance from the baseline to the outermost pixel of the scale draw in opposite to its orientation. It is at least \fBminimumExtent()\fP pixels.
 
242
.PP
 
243
\fBSee also:\fP
 
244
.RS 4
 
245
\fBsetMinimumExtent()\fP, \fBminimumExtent()\fP 
 
246
.RE
 
247
.PP
 
248
 
 
249
.PP
 
250
Implemented in \fBQwtRoundScaleDraw\fP, and \fBQwtScaleDraw\fP.
 
251
.SS "bool QwtAbstractScaleDraw::hasComponent (\fBScaleComponent\fP component) const"
 
252
.PP
 
253
Check if a component is enabled 
 
254
.PP
 
255
\fBSee also:\fP
 
256
.RS 4
 
257
\fBenableComponent()\fP 
 
258
.RE
 
259
.PP
 
260
 
 
261
.SS "void QwtAbstractScaleDraw::invalidateCache ()\fC [protected]\fP"
 
262
.PP
 
263
Invalidate the cache used by \fBQwtAbstractScaleDraw::tickLabel\fP
 
264
.PP
 
265
The cache is invalidated, when a new \fBQwtScaleDiv\fP is set. If the labels need to be changed. while the same \fBQwtScaleDiv\fP is set, \fBQwtAbstractScaleDraw::invalidateCache\fP needs to be called manually. 
 
266
.SS "\fBQwtText\fP QwtAbstractScaleDraw::label (double value) const\fC [virtual]\fP"
 
267
.PP
 
268
Convert a value into its representing label. 
 
269
.PP
 
270
The value is converted to a plain text using QLocale::system().toString(value). This method is often overloaded by applications to have individual labels.
 
271
.PP
 
272
\fBParameters:\fP
 
273
.RS 4
 
274
\fIvalue\fP Value 
 
275
.RE
 
276
.PP
 
277
\fBReturns:\fP
 
278
.RS 4
 
279
Label string. 
 
280
.RE
 
281
.PP
 
282
 
 
283
.PP
 
284
Reimplemented in \fBQwtDialScaleDraw\fP.
 
285
.SS "int QwtAbstractScaleDraw::majTickLength () const"
 
286
.PP
 
287
The same as QwtAbstractScaleDraw::tickLength(QwtScaleDiv::MajorTick). 
 
288
.SS "const \fBQwtScaleMap\fP & QwtAbstractScaleDraw::map () const"
 
289
.PP
 
290
\fBReturns:\fP
 
291
.RS 4
 
292
Map how to translate between scale and pixel values 
 
293
.RE
 
294
.PP
 
295
 
 
296
.SS "int QwtAbstractScaleDraw::minimumExtent () const"
 
297
.PP
 
298
Get the minimum extent 
 
299
.PP
 
300
\fBSee also:\fP
 
301
.RS 4
 
302
\fBextent()\fP, \fBsetMinimumExtent()\fP 
 
303
.RE
 
304
.PP
 
305
 
 
306
.SS "\fBQwtAbstractScaleDraw\fP & QwtAbstractScaleDraw::operator= (const \fBQwtAbstractScaleDraw\fP & other)"
 
307
.PP
 
308
Assignment operator. 
 
309
.PP
 
310
.SS "const \fBQwtScaleDiv\fP & QwtAbstractScaleDraw::scaleDiv () const"
 
311
.PP
 
312
\fBReturns:\fP
 
313
.RS 4
 
314
scale division 
 
315
.RE
 
316
.PP
 
317
 
 
318
.SS "\fBQwtScaleMap\fP & QwtAbstractScaleDraw::scaleMap ()"
 
319
.PP
 
320
\fBReturns:\fP
 
321
.RS 4
 
322
Map how to translate between scale and pixel values 
 
323
.RE
 
324
.PP
 
325
 
 
326
.SS "void QwtAbstractScaleDraw::setMinimumExtent (int minExtent)"
 
327
.PP
 
328
Set a minimum for the extent. 
 
329
.PP
 
330
The extent is calculated from the coomponents of the scale draw. In situations, where the labels are changing and the layout depends on the extent (f.e scrolling a scale), setting an upper limit as minimum extent will avoid jumps of the layout.
 
331
.PP
 
332
\fBParameters:\fP
 
333
.RS 4
 
334
\fIminExtent\fP Minimum extent
 
335
.RE
 
336
.PP
 
337
\fBSee also:\fP
 
338
.RS 4
 
339
\fBextent()\fP, \fBminimumExtent()\fP 
 
340
.RE
 
341
.PP
 
342
 
 
343
.SS "void QwtAbstractScaleDraw::setScaleDiv (const \fBQwtScaleDiv\fP & sd)"
 
344
.PP
 
345
Change the scale division 
 
346
.PP
 
347
\fBParameters:\fP
 
348
.RS 4
 
349
\fIsd\fP New scale division 
 
350
.RE
 
351
.PP
 
352
 
 
353
.SS "void QwtAbstractScaleDraw::setSpacing (int spacing)"
 
354
.PP
 
355
Set the spacing between tick and labels. 
 
356
.PP
 
357
The spacing is the distance between ticks and labels. The default spacing is 4 pixels.
 
358
.PP
 
359
\fBParameters:\fP
 
360
.RS 4
 
361
\fIspacing\fP Spacing
 
362
.RE
 
363
.PP
 
364
\fBSee also:\fP
 
365
.RS 4
 
366
\fBspacing()\fP 
 
367
.RE
 
368
.PP
 
369
 
 
370
.SS "void QwtAbstractScaleDraw::setTickLength (\fBQwtScaleDiv::TickType\fP tickType, int length)"
 
371
.PP
 
372
Set the length of the ticks
 
373
.PP
 
374
\fBParameters:\fP
 
375
.RS 4
 
376
\fItickType\fP Tick type 
 
377
.br
 
378
\fIlength\fP New length
 
379
.RE
 
380
.PP
 
381
\fBWarning:\fP
 
382
.RS 4
 
383
the length is limited to [0..1000] 
 
384
.RE
 
385
.PP
 
386
 
 
387
.SS "void QwtAbstractScaleDraw::setTransformation (\fBQwtScaleTransformation\fP * transformation)"
 
388
.PP
 
389
Change the transformation of the scale 
 
390
.PP
 
391
\fBParameters:\fP
 
392
.RS 4
 
393
\fItransformation\fP New scale transformation 
 
394
.RE
 
395
.PP
 
396
 
 
397
.SS "int QwtAbstractScaleDraw::spacing () const"
 
398
.PP
 
399
Get the spacing. 
 
400
.PP
 
401
The spacing is the distance between ticks and labels. The default spacing is 4 pixels.
 
402
.PP
 
403
\fBSee also:\fP
 
404
.RS 4
 
405
\fBsetSpacing()\fP 
 
406
.RE
 
407
.PP
 
408
 
 
409
.SS "const \fBQwtText\fP & QwtAbstractScaleDraw::tickLabel (const QFont & font, double value) const\fC [protected]\fP"
 
410
.PP
 
411
Convert a value into its representing label and cache it. 
 
412
.PP
 
413
The conversion between value and label is called very often in the layout and painting code. Unfortunately the calculation of the label sizes might be slow (really slow for rich text in Qt4), so it's necessary to cache the labels.
 
414
.PP
 
415
\fBParameters:\fP
 
416
.RS 4
 
417
\fIfont\fP Font 
 
418
.br
 
419
\fIvalue\fP Value
 
420
.RE
 
421
.PP
 
422
\fBReturns:\fP
 
423
.RS 4
 
424
Tick label 
 
425
.RE
 
426
.PP
 
427
 
 
428
.SS "int QwtAbstractScaleDraw::tickLength (\fBQwtScaleDiv::TickType\fP tickType) const"
 
429
.PP
 
430
Return the length of the ticks
 
431
.PP
 
432
\fBSee also:\fP
 
433
.RS 4
 
434
\fBsetTickLength()\fP, \fBmajTickLength()\fP 
 
435
.RE
 
436
.PP
 
437
 
 
438
 
 
439
.SH "Author"
 
440
.PP 
 
441
Generated automatically by Doxygen for Qwt User's Guide from the source code.