File: QwtPlotShapeItem.3

package info (click to toggle)
qwt 6.1.2-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,848 kB
  • ctags: 15,811
  • sloc: cpp: 57,382; makefile: 41
file content (479 lines) | stat: -rw-r--r-- 9,975 bytes parent folder | download
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
.TH "QwtPlotShapeItem" 3 "Thu Dec 11 2014" "Version 6.1.2" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtPlotShapeItem \- 
.PP
A plot item, which displays any graphical shape, that can be defined by a QPainterPath\&.  

.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_plot_shapeitem\&.h>\fP
.PP
Inherits \fBQwtPlotItem\fP\&.
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBPaintAttribute\fP { \fBClipPolygons\fP = 0x01 }"
.br
.ti -1c
.RI "enum \fBLegendMode\fP { \fBLegendShape\fP, \fBLegendColor\fP }"
.br
.RI "\fIMode how to display the item on the legend\&. \fP"
.ti -1c
.RI "typedef QFlags< \fBPaintAttribute\fP > \fBPaintAttributes\fP"
.br
.RI "\fIPaint attributes\&. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQwtPlotShapeItem\fP (const QString &\fBtitle\fP=QString::null)"
.br
.RI "\fIConstructor\&. \fP"
.ti -1c
.RI "\fBQwtPlotShapeItem\fP (const \fBQwtText\fP &\fBtitle\fP)"
.br
.RI "\fIConstructor\&. \fP"
.ti -1c
.RI "virtual \fB~QwtPlotShapeItem\fP ()"
.br
.RI "\fIDestructor\&. \fP"
.ti -1c
.RI "void \fBsetPaintAttribute\fP (\fBPaintAttribute\fP, bool on=true)"
.br
.ti -1c
.RI "bool \fBtestPaintAttribute\fP (\fBPaintAttribute\fP) const "
.br
.ti -1c
.RI "void \fBsetLegendMode\fP (\fBLegendMode\fP)"
.br
.ti -1c
.RI "\fBLegendMode\fP \fBlegendMode\fP () const "
.br
.ti -1c
.RI "void \fBsetRect\fP (const QRectF &)"
.br
.RI "\fISet a path built from a rectangle\&. \fP"
.ti -1c
.RI "void \fBsetPolygon\fP (const QPolygonF &)"
.br
.RI "\fISet a path built from a polygon\&. \fP"
.ti -1c
.RI "void \fBsetShape\fP (const QPainterPath &)"
.br
.RI "\fISet the shape to be displayed\&. \fP"
.ti -1c
.RI "QPainterPath \fBshape\fP () const "
.br
.ti -1c
.RI "void \fBsetPen\fP (const QColor &, qreal width=0\&.0, Qt::PenStyle=Qt::SolidLine)"
.br
.ti -1c
.RI "void \fBsetPen\fP (const QPen &)"
.br
.RI "\fIAssign a pen\&. \fP"
.ti -1c
.RI "QPen \fBpen\fP () const "
.br
.ti -1c
.RI "void \fBsetBrush\fP (const QBrush &)"
.br
.ti -1c
.RI "QBrush \fBbrush\fP () const "
.br
.ti -1c
.RI "void \fBsetRenderTolerance\fP (double)"
.br
.RI "\fISet the tolerance for the weeding optimization\&. \fP"
.ti -1c
.RI "double \fBrenderTolerance\fP () const "
.br
.ti -1c
.RI "virtual QRectF \fBboundingRect\fP () const "
.br
.RI "\fIBounding rectangle of the shape\&. \fP"
.ti -1c
.RI "virtual void \fBdraw\fP (QPainter *p, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &rect) const "
.br
.ti -1c
.RI "virtual \fBQwtGraphic\fP \fBlegendIcon\fP (int index, const QSizeF &) const "
.br
.ti -1c
.RI "virtual int \fBrtti\fP () const "
.br
.in -1c
.SS "Additional Inherited Members"
.SH "Detailed Description"
.PP 
A plot item, which displays any graphical shape, that can be defined by a QPainterPath\&. 

A QPainterPath is a shape composed from intersecting and uniting regions, rectangles, ellipses or irregular areas defined by lines, and curves\&. \fBQwtPlotShapeItem\fP displays a shape with a pen and brush\&.
.PP
\fBQwtPlotShapeItem\fP offers a couple of optimizations like clipping or weeding\&. These algorithms need to convert the painter path into polygons that might be less performant for paths built from curves and ellipses\&.
.PP
\fBSee Also:\fP
.RS 4
QwtPlotZone 
.RE
.PP

.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBQwtPlotShapeItem::LegendMode\fP"

.PP
Mode how to display the item on the legend\&. 
.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fILegendShape \fP\fP
Display a scaled down version of the shape\&. 
.TP
\fB\fILegendColor \fP\fP
Display a filled rectangle\&. 
.SS "enum \fBQwtPlotShapeItem::PaintAttribute\fP"
Attributes to modify the drawing algorithm\&. The default disables all attributes
.PP
\fBSee Also:\fP
.RS 4
\fBsetPaintAttribute()\fP, \fBtestPaintAttribute()\fP 
.RE
.PP

.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fIClipPolygons \fP\fP
Clip polygons before painting them\&. In situations, where points are far outside the visible area (f\&.e when zooming deep) this might be a substantial improvement for the painting performance
.PP
But polygon clipping will convert the painter path into polygons what might introduce a negative impact on the performance of paths composed from curves or ellipses\&. 
.SH "Constructor & Destructor Documentation"
.PP 
.SS "QwtPlotShapeItem::QwtPlotShapeItem (const QString &title = \fCQString::null\fP)\fC [explicit]\fP"

.PP
Constructor\&. Sets the following item attributes:
.IP "\(bu" 2
\fBQwtPlotItem::AutoScale\fP: true
.IP "\(bu" 2
\fBQwtPlotItem::Legend\fP: false
.PP
.PP
\fBParameters:\fP
.RS 4
\fItitle\fP Title 
.RE
.PP

.SS "QwtPlotShapeItem::QwtPlotShapeItem (const \fBQwtText\fP &title)\fC [explicit]\fP"

.PP
Constructor\&. Sets the following item attributes:
.IP "\(bu" 2
\fBQwtPlotItem::AutoScale\fP: true
.IP "\(bu" 2
\fBQwtPlotItem::Legend\fP: false
.PP
.PP
\fBParameters:\fP
.RS 4
\fItitle\fP Title 
.RE
.PP

.SH "Member Function Documentation"
.PP 
.SS "QBrush QwtPlotShapeItem::brush () const"

.PP
\fBReturns:\fP
.RS 4
Brush used to fill the shape 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetBrush()\fP, \fBpen()\fP 
.RE
.PP

.SS "void QwtPlotShapeItem::draw (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect) const\fC [virtual]\fP"
Draw the shape item
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter 
.br
\fIxMap\fP X-Scale Map 
.br
\fIyMap\fP Y-Scale Map 
.br
\fIcanvasRect\fP Contents rect of the plot canvas 
.RE
.PP

.PP
Implements \fBQwtPlotItem\fP\&.
.SS "\fBQwtGraphic\fP QwtPlotShapeItem::legendIcon (intindex, const QSizeF &size) const\fC [virtual]\fP"

.PP
\fBReturns:\fP
.RS 4
A rectangle filled with the color of the brush ( or the pen )
.RE
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP Index of the legend entry ( usually there is only one ) 
.br
\fIsize\fP Icon size
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetLegendIconSize()\fP, \fBlegendData()\fP 
.RE
.PP

.PP
Reimplemented from \fBQwtPlotItem\fP\&.
.SS "\fBQwtPlotShapeItem::LegendMode\fP QwtPlotShapeItem::legendMode () const"

.PP
\fBReturns:\fP
.RS 4
Mode how to represent the item on the legend 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBlegendMode()\fP 
.RE
.PP

.SS "QPen QwtPlotShapeItem::pen () const"

.PP
\fBReturns:\fP
.RS 4
Pen used to draw the outline of the shape 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetPen()\fP, \fBbrush()\fP 
.RE
.PP

.SS "double QwtPlotShapeItem::renderTolerance () const"

.PP
\fBReturns:\fP
.RS 4
Tolerance for the weeding optimization 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetRenderTolerance()\fP 
.RE
.PP

.SS "int QwtPlotShapeItem::rtti () const\fC [virtual]\fP"

.PP
\fBReturns:\fP
.RS 4
\fBQwtPlotItem::Rtti_PlotShape\fP 
.RE
.PP

.PP
Reimplemented from \fBQwtPlotItem\fP\&.
.SS "void QwtPlotShapeItem::setBrush (const QBrush &brush)"
Assign a brush\&.
.PP
The brush is used to fill the path
.PP
\fBParameters:\fP
.RS 4
\fIbrush\fP Brush 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBbrush()\fP, \fBpen()\fP 
.RE
.PP

.SS "void QwtPlotShapeItem::setLegendMode (\fBLegendMode\fPmode)"
Set the mode how to represent the item on the legend
.PP
\fBParameters:\fP
.RS 4
\fImode\fP Mode 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBlegendMode()\fP 
.RE
.PP

.SS "void QwtPlotShapeItem::setPaintAttribute (\fBPaintAttribute\fPattribute, boolon = \fCtrue\fP)"
Specify an attribute how to draw the shape
.PP
\fBParameters:\fP
.RS 4
\fIattribute\fP Paint attribute 
.br
\fIon\fP On/Off 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBtestPaintAttribute()\fP 
.RE
.PP

.SS "void QwtPlotShapeItem::setPen (const QColor &color, qrealwidth = \fC0\&.0\fP, Qt::PenStylestyle = \fCQt::SolidLine\fP)"
Build and assign a pen
.PP
In Qt5 the default pen width is 1\&.0 ( 0\&.0 in Qt4 ) what makes it non cosmetic ( see QPen::isCosmetic() )\&. This method has been introduced to hide this incompatibility\&.
.PP
\fBParameters:\fP
.RS 4
\fIcolor\fP Pen color 
.br
\fIwidth\fP Pen width 
.br
\fIstyle\fP Pen style
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBpen()\fP, \fBbrush()\fP 
.RE
.PP

.SS "void QwtPlotShapeItem::setPen (const QPen &pen)"

.PP
Assign a pen\&. The pen is used to draw the outline of the shape
.PP
\fBParameters:\fP
.RS 4
\fIpen\fP Pen 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBpen()\fP, \fBbrush()\fP 
.RE
.PP

.SS "void QwtPlotShapeItem::setPolygon (const QPolygonF &polygon)"

.PP
Set a path built from a polygon\&. 
.PP
\fBParameters:\fP
.RS 4
\fIpolygon\fP Polygon 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetShape()\fP, \fBsetRect()\fP, \fBshape()\fP 
.RE
.PP

.SS "void QwtPlotShapeItem::setRect (const QRectF &rect)"

.PP
Set a path built from a rectangle\&. 
.PP
\fBParameters:\fP
.RS 4
\fIrect\fP Rectangle 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetShape()\fP, \fBsetPolygon()\fP, \fBshape()\fP 
.RE
.PP

.SS "void QwtPlotShapeItem::setRenderTolerance (doubletolerance)"

.PP
Set the tolerance for the weeding optimization\&. After translating the shape into target device coordinate ( usually widget geometries ) the painter path can be simplified by a point weeding algorithm ( Douglas-Peucker )\&.
.PP
For shapes built from curves and ellipses weeding might have the opposite effect because they have to be expanded to polygons\&.
.PP
\fBParameters:\fP
.RS 4
\fItolerance\fP Accepted error when reducing the number of points A value <= 0\&.0 disables weeding\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBrenderTolerance()\fP, \fBQwtWeedingCurveFitter\fP 
.RE
.PP

.SS "void QwtPlotShapeItem::setShape (const QPainterPath &shape)"

.PP
Set the shape to be displayed\&. 
.PP
\fBParameters:\fP
.RS 4
\fIshape\fP Shape 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetShape()\fP, \fBshape()\fP 
.RE
.PP

.SS "QPainterPath QwtPlotShapeItem::shape () const"

.PP
\fBReturns:\fP
.RS 4
Shape to be displayed 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetShape()\fP 
.RE
.PP

.SS "bool QwtPlotShapeItem::testPaintAttribute (\fBPaintAttribute\fPattribute) const"

.PP
\fBReturns:\fP
.RS 4
True, when attribute is enabled 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetPaintAttribute()\fP 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.