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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492
|
.TH "QwtRoundScaleDraw" 3 "Mon Aug 1 2011" "Version 5.2.2" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtRoundScaleDraw \-
.PP
A class for drawing round scales.
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_round_scale_draw.h>\fP
.PP
Inherits \fBQwtAbstractScaleDraw\fP.
.PP
Inherited by \fBQwtDialScaleDraw\fP.
.SS "Public Types"
.in +1c
.ti -1c
.RI "enum \fBScaleComponent\fP { \fBBackbone\fP = 1, \fBTicks\fP = 2, \fBLabels\fP = 4 }"
.br
.in -1c
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "QPoint \fBcenter\fP () const "
.br
.ti -1c
.RI "virtual void \fBdraw\fP (QPainter *, const QPalette &) const "
.br
.ti -1c
.RI "void \fBenableComponent\fP (\fBScaleComponent\fP, bool enable=true)"
.br
.ti -1c
.RI "virtual int \fBextent\fP (const QPen &, const QFont &) const "
.br
.ti -1c
.RI "bool \fBhasComponent\fP (\fBScaleComponent\fP) const "
.br
.ti -1c
.RI "virtual \fBQwtText\fP \fBlabel\fP (double) const "
.br
.ti -1c
.RI "int \fBmajTickLength\fP () const "
.br
.ti -1c
.RI "const \fBQwtScaleMap\fP & \fBmap\fP () const "
.br
.ti -1c
.RI "int \fBminimumExtent\fP () const "
.br
.ti -1c
.RI "void \fBmoveCenter\fP (const QPoint &)"
.br
.ti -1c
.RI "void \fBmoveCenter\fP (int x, int y)"
.br
.ti -1c
.RI "\fBQwtRoundScaleDraw\fP & \fBoperator=\fP (const \fBQwtRoundScaleDraw\fP &other)"
.br
.ti -1c
.RI "\fBQwtRoundScaleDraw\fP (const \fBQwtRoundScaleDraw\fP &)"
.br
.ti -1c
.RI "\fBQwtRoundScaleDraw\fP ()"
.br
.ti -1c
.RI "int \fBradius\fP () const "
.br
.ti -1c
.RI "const \fBQwtScaleDiv\fP & \fBscaleDiv\fP () const "
.br
.ti -1c
.RI "\fBQwtScaleMap\fP & \fBscaleMap\fP ()"
.br
.ti -1c
.RI "void \fBsetAngleRange\fP (double angle1, double angle2)"
.br
.ti -1c
.RI "void \fBsetMinimumExtent\fP (int)"
.br
.ti -1c
.RI "void \fBsetRadius\fP (int radius)"
.br
.ti -1c
.RI "void \fBsetScaleDiv\fP (const \fBQwtScaleDiv\fP &s)"
.br
.ti -1c
.RI "void \fBsetSpacing\fP (int margin)"
.br
.ti -1c
.RI "void \fBsetTickLength\fP (\fBQwtScaleDiv::TickType\fP, int length)"
.br
.ti -1c
.RI "void \fBsetTransformation\fP (\fBQwtScaleTransformation\fP *)"
.br
.ti -1c
.RI "int \fBspacing\fP () const "
.br
.ti -1c
.RI "int \fBtickLength\fP (\fBQwtScaleDiv::TickType\fP) const "
.br
.ti -1c
.RI "virtual \fB~QwtRoundScaleDraw\fP ()"
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "virtual void \fBdrawBackbone\fP (QPainter *p) const "
.br
.ti -1c
.RI "virtual void \fBdrawLabel\fP (QPainter *p, double val) const "
.br
.ti -1c
.RI "virtual void \fBdrawTick\fP (QPainter *p, double val, int len) const "
.br
.ti -1c
.RI "void \fBinvalidateCache\fP ()"
.br
.ti -1c
.RI "const \fBQwtText\fP & \fBtickLabel\fP (const QFont &, double value) const "
.br
.in -1c
.SH "Detailed Description"
.PP
A class for drawing round scales.
\fBQwtRoundScaleDraw\fP can be used to draw round scales. The circle segment can be adjusted by \fBQwtRoundScaleDraw::setAngleRange()\fP. The geometry of the scale can be specified with \fBQwtRoundScaleDraw::moveCenter()\fP and \fBQwtRoundScaleDraw::setRadius()\fP.
.PP
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.
.SH "Member Enumeration Documentation"
.PP
.SS "enum \fBQwtAbstractScaleDraw::ScaleComponent\fP\fC [inherited]\fP"Components of a scale
.PP
.IP "\(bu" 2
Backbone
.IP "\(bu" 2
Ticks
.IP "\(bu" 2
Labels
.PP
.PP
\fBSee also:\fP
.RS 4
\fBenableComponent()\fP, \fBhasComponent\fP
.RE
.PP
.SH "Constructor & Destructor Documentation"
.PP
.SS "QwtRoundScaleDraw::QwtRoundScaleDraw ()"
.PP
Constructor. The range of the scale is initialized to [0, 100], The center is set to (50, 50) with a radius of 50. The angle range is set to [\-135, 135].
.SS "QwtRoundScaleDraw::QwtRoundScaleDraw (const \fBQwtRoundScaleDraw\fP &other)"
.PP
Copy constructor.
.SS "QwtRoundScaleDraw::~QwtRoundScaleDraw ()\fC [virtual]\fP"
.PP
Destructor.
.SH "Member Function Documentation"
.PP
.SS "QPoint QwtRoundScaleDraw::center () const"
.PP
Get the center of the scale.
.SS "void QwtAbstractScaleDraw::draw (QPainter *painter, const QPalette &palette) const\fC [virtual, inherited]\fP"
.PP
Draw the scale. \fBParameters:\fP
.RS 4
\fIpainter\fP The painter
.br
\fIpalette\fP Palette, text color is used for the labels, foreground color for ticks and backbone
.RE
.PP
.SS "void QwtRoundScaleDraw::drawBackbone (QPainter *painter) const\fC [protected, virtual]\fP"Draws the baseline of the scale
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter
.RE
.PP
\fBSee also:\fP
.RS 4
\fBdrawTick()\fP, \fBdrawLabel()\fP
.RE
.PP
.PP
Implements \fBQwtAbstractScaleDraw\fP.
.SS "void QwtRoundScaleDraw::drawLabel (QPainter *painter, doublevalue) const\fC [protected, virtual]\fP"Draws the label for a major scale tick
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter
.br
\fIvalue\fP Value
.RE
.PP
\fBSee also:\fP
.RS 4
\fBdrawTick()\fP, \fBdrawBackbone()\fP
.RE
.PP
.PP
Implements \fBQwtAbstractScaleDraw\fP.
.SS "void QwtRoundScaleDraw::drawTick (QPainter *painter, doublevalue, intlen) const\fC [protected, virtual]\fP"Draw a tick
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter
.br
\fIvalue\fP Value of the tick
.br
\fIlen\fP Length of the tick
.RE
.PP
\fBSee also:\fP
.RS 4
\fBdrawBackbone()\fP, \fBdrawLabel()\fP
.RE
.PP
.PP
Implements \fBQwtAbstractScaleDraw\fP.
.SS "void QwtAbstractScaleDraw::enableComponent (\fBScaleComponent\fPcomponent, boolenable = \fCtrue\fP)\fC [inherited]\fP"En/Disable a component of the scale
.PP
\fBParameters:\fP
.RS 4
\fIcomponent\fP Scale component
.br
\fIenable\fP On/Off
.RE
.PP
\fBSee also:\fP
.RS 4
\fBhasComponent()\fP
.RE
.PP
.SS "int QwtRoundScaleDraw::extent (const QPen &pen, const QFont &font) const\fC [virtual]\fP"Calculate the extent of the scale
.PP
The extent is the distcance between the baseline to the outermost pixel of the scale draw. \fBradius()\fP + \fBextent()\fP is an upper limit for the radius of the bounding circle.
.PP
\fBParameters:\fP
.RS 4
\fIpen\fP Pen that is used for painting backbone and ticks
.br
\fIfont\fP Font used for painting the labels
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetMinimumExtent()\fP, \fBminimumExtent()\fP
.RE
.PP
\fBWarning:\fP
.RS 4
The implemented algo is not too smart and calculates only an upper limit, that might be a few pixels too large
.RE
.PP
.PP
Implements \fBQwtAbstractScaleDraw\fP.
.SS "bool QwtAbstractScaleDraw::hasComponent (\fBScaleComponent\fPcomponent) const\fC [inherited]\fP"Check if a component is enabled
.PP
\fBSee also:\fP
.RS 4
\fBenableComponent()\fP
.RE
.PP
.SS "void QwtAbstractScaleDraw::invalidateCache ()\fC [protected, inherited]\fP"Invalidate the cache used by \fBQwtAbstractScaleDraw::tickLabel\fP
.PP
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.
.SS "\fBQwtText\fP QwtAbstractScaleDraw::label (doublevalue) const\fC [virtual, inherited]\fP"
.PP
Convert a value into its representing label. The value is converted to a plain text using QLocale::system().toString(value). This method is often overloaded by applications to have individual labels.
.PP
\fBParameters:\fP
.RS 4
\fIvalue\fP Value
.RE
.PP
\fBReturns:\fP
.RS 4
Label string.
.RE
.PP
.PP
Reimplemented in \fBQwtDialScaleDraw\fP.
.SS "int QwtAbstractScaleDraw::majTickLength () const\fC [inherited]\fP"The same as QwtAbstractScaleDraw::tickLength(QwtScaleDiv::MajorTick).
.SS "const \fBQwtScaleMap\fP & QwtAbstractScaleDraw::map () const\fC [inherited]\fP"\fBReturns:\fP
.RS 4
Map how to translate between scale and pixel values
.RE
.PP
.SS "int QwtAbstractScaleDraw::minimumExtent () const\fC [inherited]\fP"Get the minimum extent
.PP
\fBSee also:\fP
.RS 4
\fBextent()\fP, \fBsetMinimumExtent()\fP
.RE
.PP
.SS "void QwtRoundScaleDraw::moveCenter (const QPoint ¢er)"Move the center of the scale draw, leaving the radius unchanged
.PP
\fBParameters:\fP
.RS 4
\fIcenter\fP New center
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetRadius()\fP
.RE
.PP
.SS "void QwtRoundScaleDraw::moveCenter (intx, inty)\fC [inline]\fP"
.PP
Move the center of the scale draw, leaving the radius unchanged.
.SS "\fBQwtRoundScaleDraw\fP & QwtRoundScaleDraw::operator= (const \fBQwtRoundScaleDraw\fP &other)"
.PP
Assignment operator.
.SS "int QwtRoundScaleDraw::radius () const"Get the radius
.PP
Radius is the radius of the backbone without ticks and labels.
.PP
\fBSee also:\fP
.RS 4
\fBsetRadius()\fP, \fBextent()\fP
.RE
.PP
.SS "const \fBQwtScaleDiv\fP & QwtAbstractScaleDraw::scaleDiv () const\fC [inherited]\fP"\fBReturns:\fP
.RS 4
scale division
.RE
.PP
.SS "\fBQwtScaleMap\fP & QwtAbstractScaleDraw::scaleMap ()\fC [inherited]\fP"\fBReturns:\fP
.RS 4
Map how to translate between scale and pixel values
.RE
.PP
.SS "void QwtRoundScaleDraw::setAngleRange (doubleangle1, doubleangle2)"
.PP
Adjust the baseline circle segment for round scales. The baseline will be drawn from min(angle1,angle2) to max(angle1, angle2). The default setting is [ \-135, 135 ]. An angle of 0 degrees corresponds to the 12 o'clock position, and positive angles count in a clockwise direction.
.PP
\fBParameters:\fP
.RS 4
\fIangle1\fP
.br
\fIangle2\fP boundaries of the angle interval in degrees.
.RE
.PP
\fBWarning:\fP
.RS 4
.PD 0
.IP "\(bu" 2
The angle range is limited to [\-360, 360] degrees. Angles exceeding this range will be clipped.
.IP "\(bu" 2
For angles more than 359 degrees above or below min(angle1, angle2), scale marks will not be drawn.
.IP "\(bu" 2
If you need a counterclockwise scale, use QwtScaleDiv::setRange
.PP
.RE
.PP
.SS "void QwtAbstractScaleDraw::setMinimumExtent (intminExtent)\fC [inherited]\fP"
.PP
Set a minimum for the extent. 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.
.PP
\fBParameters:\fP
.RS 4
\fIminExtent\fP Minimum extent
.RE
.PP
\fBSee also:\fP
.RS 4
\fBextent()\fP, \fBminimumExtent()\fP
.RE
.PP
.SS "void QwtRoundScaleDraw::setRadius (intradius)"Change of radius the scale
.PP
Radius is the radius of the backbone without ticks and labels.
.PP
\fBParameters:\fP
.RS 4
\fIradius\fP New Radius
.RE
.PP
\fBSee also:\fP
.RS 4
\fBmoveCenter()\fP
.RE
.PP
.SS "void QwtAbstractScaleDraw::setScaleDiv (const \fBQwtScaleDiv\fP &sd)\fC [inherited]\fP"Change the scale division
.PP
\fBParameters:\fP
.RS 4
\fIsd\fP New scale division
.RE
.PP
.SS "void QwtAbstractScaleDraw::setSpacing (intspacing)\fC [inherited]\fP"
.PP
Set the spacing between tick and labels. The spacing is the distance between ticks and labels. The default spacing is 4 pixels.
.PP
\fBParameters:\fP
.RS 4
\fIspacing\fP Spacing
.RE
.PP
\fBSee also:\fP
.RS 4
\fBspacing()\fP
.RE
.PP
.SS "void QwtAbstractScaleDraw::setTickLength (\fBQwtScaleDiv::TickType\fPtickType, intlength)\fC [inherited]\fP"Set the length of the ticks
.PP
\fBParameters:\fP
.RS 4
\fItickType\fP Tick type
.br
\fIlength\fP New length
.RE
.PP
\fBWarning:\fP
.RS 4
the length is limited to [0..1000]
.RE
.PP
.SS "void QwtAbstractScaleDraw::setTransformation (\fBQwtScaleTransformation\fP *transformation)\fC [inherited]\fP"Change the transformation of the scale
.PP
\fBParameters:\fP
.RS 4
\fItransformation\fP New scale transformation
.RE
.PP
.SS "int QwtAbstractScaleDraw::spacing () const\fC [inherited]\fP"
.PP
Get the spacing. The spacing is the distance between ticks and labels. The default spacing is 4 pixels.
.PP
\fBSee also:\fP
.RS 4
\fBsetSpacing()\fP
.RE
.PP
.SS "const \fBQwtText\fP & QwtAbstractScaleDraw::tickLabel (const QFont &font, doublevalue) const\fC [protected, inherited]\fP"
.PP
Convert a value into its representing label and cache it. 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.
.PP
\fBParameters:\fP
.RS 4
\fIfont\fP Font
.br
\fIvalue\fP Value
.RE
.PP
\fBReturns:\fP
.RS 4
Tick label
.RE
.PP
.SS "int QwtAbstractScaleDraw::tickLength (\fBQwtScaleDiv::TickType\fPtickType) const\fC [inherited]\fP"Return the length of the ticks
.PP
\fBSee also:\fP
.RS 4
\fBsetTickLength()\fP, \fBmajTickLength()\fP
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for Qwt User's Guide from the source code.
|