QwtPlotShapeItem.3 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. .TH "QwtPlotShapeItem" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtPlotShapeItem \- A plot item, which displays any graphical shape, that can be defined by a QPainterPath\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_plot_shapeitem\&.h>\fP
  11. .PP
  12. Inherits \fBQwtPlotItem\fP\&.
  13. .SS "Public Types"
  14. .in +1c
  15. .ti -1c
  16. .RI "enum \fBPaintAttribute\fP { \fBClipPolygons\fP = 0x01 }"
  17. .br
  18. .ti -1c
  19. .RI "enum \fBLegendMode\fP { \fBLegendShape\fP, \fBLegendColor\fP }"
  20. .br
  21. .RI "Mode how to display the item on the legend\&. "
  22. .ti -1c
  23. .RI "typedef QFlags< \fBPaintAttribute\fP > \fBPaintAttributes\fP"
  24. .br
  25. .RI "Paint attributes\&. "
  26. .in -1c
  27. .SS "Public Member Functions"
  28. .in +1c
  29. .ti -1c
  30. .RI "\fBQwtPlotShapeItem\fP (const QString &\fBtitle\fP=QString())"
  31. .br
  32. .RI "Constructor\&. "
  33. .ti -1c
  34. .RI "\fBQwtPlotShapeItem\fP (const \fBQwtText\fP &\fBtitle\fP)"
  35. .br
  36. .RI "Constructor\&. "
  37. .ti -1c
  38. .RI "virtual \fB~QwtPlotShapeItem\fP ()"
  39. .br
  40. .RI "Destructor\&. "
  41. .ti -1c
  42. .RI "void \fBsetPaintAttribute\fP (\fBPaintAttribute\fP, bool on=true)"
  43. .br
  44. .ti -1c
  45. .RI "bool \fBtestPaintAttribute\fP (\fBPaintAttribute\fP) const"
  46. .br
  47. .ti -1c
  48. .RI "void \fBsetLegendMode\fP (\fBLegendMode\fP)"
  49. .br
  50. .ti -1c
  51. .RI "\fBLegendMode\fP \fBlegendMode\fP () const"
  52. .br
  53. .ti -1c
  54. .RI "void \fBsetRect\fP (const QRectF &)"
  55. .br
  56. .RI "Set a path built from a rectangle\&. "
  57. .ti -1c
  58. .RI "void \fBsetPolygon\fP (const QPolygonF &)"
  59. .br
  60. .RI "Set a path built from a polygon\&. "
  61. .ti -1c
  62. .RI "void \fBsetShape\fP (const QPainterPath &)"
  63. .br
  64. .RI "Set the shape to be displayed\&. "
  65. .ti -1c
  66. .RI "QPainterPath \fBshape\fP () const"
  67. .br
  68. .ti -1c
  69. .RI "void \fBsetPen\fP (const QColor &, qreal width=0\&.0, Qt::PenStyle=Qt::SolidLine)"
  70. .br
  71. .ti -1c
  72. .RI "void \fBsetPen\fP (const QPen &)"
  73. .br
  74. .RI "Assign a pen\&. "
  75. .ti -1c
  76. .RI "QPen \fBpen\fP () const"
  77. .br
  78. .ti -1c
  79. .RI "void \fBsetBrush\fP (const QBrush &)"
  80. .br
  81. .ti -1c
  82. .RI "QBrush \fBbrush\fP () const"
  83. .br
  84. .ti -1c
  85. .RI "void \fBsetRenderTolerance\fP (double)"
  86. .br
  87. .RI "Set the tolerance for the weeding optimization\&. "
  88. .ti -1c
  89. .RI "double \fBrenderTolerance\fP () const"
  90. .br
  91. .ti -1c
  92. .RI "virtual QRectF \fBboundingRect\fP () const"
  93. .br
  94. .RI "Bounding rectangle of the shape\&. "
  95. .ti -1c
  96. .RI "virtual void \fBdraw\fP (QPainter *, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect) const"
  97. .br
  98. .ti -1c
  99. .RI "virtual \fBQwtGraphic\fP \fBlegendIcon\fP (int index, const QSizeF &) const"
  100. .br
  101. .ti -1c
  102. .RI "virtual int \fBrtti\fP () const"
  103. .br
  104. .in -1c
  105. .SS "Additional Inherited Members"
  106. .SH "Detailed Description"
  107. .PP
  108. A plot item, which displays any graphical shape, that can be defined by a QPainterPath\&.
  109. 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\&.
  110. .PP
  111. \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\&.
  112. .PP
  113. \fBSee also\fP
  114. .RS 4
  115. QwtPlotZone
  116. .RE
  117. .PP
  118. .SH "Member Enumeration Documentation"
  119. .PP
  120. .SS "enum \fBQwtPlotShapeItem::LegendMode\fP"
  121. .PP
  122. Mode how to display the item on the legend\&.
  123. .PP
  124. \fBEnumerator\fP
  125. .in +1c
  126. .TP
  127. \fB\fILegendShape \fP\fP
  128. Display a scaled down version of the shape\&.
  129. .TP
  130. \fB\fILegendColor \fP\fP
  131. Display a filled rectangle\&.
  132. .SS "enum \fBQwtPlotShapeItem::PaintAttribute\fP"
  133. Attributes to modify the drawing algorithm\&. The default disables all attributes
  134. .PP
  135. \fBSee also\fP
  136. .RS 4
  137. \fBsetPaintAttribute()\fP, \fBtestPaintAttribute()\fP
  138. .RE
  139. .PP
  140. .PP
  141. \fBEnumerator\fP
  142. .in +1c
  143. .TP
  144. \fB\fIClipPolygons \fP\fP
  145. 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
  146. .PP
  147. 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\&.
  148. .SH "Constructor & Destructor Documentation"
  149. .PP
  150. .SS "QwtPlotShapeItem::QwtPlotShapeItem (const QString & title = \fCQString()\fP)\fC [explicit]\fP"
  151. .PP
  152. Constructor\&. Sets the following item attributes:
  153. .IP "\(bu" 2
  154. \fBQwtPlotItem::AutoScale\fP: true
  155. .IP "\(bu" 2
  156. \fBQwtPlotItem::Legend\fP: false
  157. .PP
  158. .PP
  159. \fBParameters\fP
  160. .RS 4
  161. \fItitle\fP Title
  162. .RE
  163. .PP
  164. .SS "QwtPlotShapeItem::QwtPlotShapeItem (const \fBQwtText\fP & title)\fC [explicit]\fP"
  165. .PP
  166. Constructor\&. Sets the following item attributes:
  167. .IP "\(bu" 2
  168. \fBQwtPlotItem::AutoScale\fP: true
  169. .IP "\(bu" 2
  170. \fBQwtPlotItem::Legend\fP: false
  171. .PP
  172. .PP
  173. \fBParameters\fP
  174. .RS 4
  175. \fItitle\fP Title
  176. .RE
  177. .PP
  178. .SH "Member Function Documentation"
  179. .PP
  180. .SS "QBrush QwtPlotShapeItem::brush () const"
  181. .PP
  182. \fBReturns\fP
  183. .RS 4
  184. Brush used to fill the shape
  185. .RE
  186. .PP
  187. \fBSee also\fP
  188. .RS 4
  189. \fBsetBrush()\fP, \fBpen()\fP
  190. .RE
  191. .PP
  192. .SS "void QwtPlotShapeItem::draw (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QRectF & canvasRect) const\fC [virtual]\fP"
  193. Draw the shape item
  194. .PP
  195. \fBParameters\fP
  196. .RS 4
  197. \fIpainter\fP Painter
  198. .br
  199. \fIxMap\fP X-Scale Map
  200. .br
  201. \fIyMap\fP Y-Scale Map
  202. .br
  203. \fIcanvasRect\fP Contents rect of the plot canvas
  204. .RE
  205. .PP
  206. .PP
  207. Implements \fBQwtPlotItem\fP\&.
  208. .SS "\fBQwtGraphic\fP QwtPlotShapeItem::legendIcon (int index, const QSizeF & size) const\fC [virtual]\fP"
  209. .PP
  210. \fBReturns\fP
  211. .RS 4
  212. A rectangle filled with the color of the brush ( or the pen )
  213. .RE
  214. .PP
  215. \fBParameters\fP
  216. .RS 4
  217. \fIindex\fP Index of the legend entry ( usually there is only one )
  218. .br
  219. \fIsize\fP Icon size
  220. .RE
  221. .PP
  222. \fBSee also\fP
  223. .RS 4
  224. \fBsetLegendIconSize()\fP, \fBlegendData()\fP
  225. .RE
  226. .PP
  227. .PP
  228. Reimplemented from \fBQwtPlotItem\fP\&.
  229. .SS "\fBQwtPlotShapeItem::LegendMode\fP QwtPlotShapeItem::legendMode () const"
  230. .PP
  231. \fBReturns\fP
  232. .RS 4
  233. Mode how to represent the item on the legend
  234. .RE
  235. .PP
  236. \fBSee also\fP
  237. .RS 4
  238. \fBlegendMode()\fP
  239. .RE
  240. .PP
  241. .SS "QPen QwtPlotShapeItem::pen () const"
  242. .PP
  243. \fBReturns\fP
  244. .RS 4
  245. Pen used to draw the outline of the shape
  246. .RE
  247. .PP
  248. \fBSee also\fP
  249. .RS 4
  250. \fBsetPen()\fP, \fBbrush()\fP
  251. .RE
  252. .PP
  253. .SS "double QwtPlotShapeItem::renderTolerance () const"
  254. .PP
  255. \fBReturns\fP
  256. .RS 4
  257. Tolerance for the weeding optimization
  258. .RE
  259. .PP
  260. \fBSee also\fP
  261. .RS 4
  262. \fBsetRenderTolerance()\fP
  263. .RE
  264. .PP
  265. .SS "int QwtPlotShapeItem::rtti () const\fC [virtual]\fP"
  266. .PP
  267. \fBReturns\fP
  268. .RS 4
  269. \fBQwtPlotItem::Rtti_PlotShape\fP
  270. .RE
  271. .PP
  272. .PP
  273. Reimplemented from \fBQwtPlotItem\fP\&.
  274. .SS "void QwtPlotShapeItem::setBrush (const QBrush & brush)"
  275. Assign a brush\&.
  276. .PP
  277. The brush is used to fill the path
  278. .PP
  279. \fBParameters\fP
  280. .RS 4
  281. \fIbrush\fP Brush
  282. .RE
  283. .PP
  284. \fBSee also\fP
  285. .RS 4
  286. \fBbrush()\fP, \fBpen()\fP
  287. .RE
  288. .PP
  289. .SS "void QwtPlotShapeItem::setLegendMode (\fBLegendMode\fP mode)"
  290. Set the mode how to represent the item on the legend
  291. .PP
  292. \fBParameters\fP
  293. .RS 4
  294. \fImode\fP Mode
  295. .RE
  296. .PP
  297. \fBSee also\fP
  298. .RS 4
  299. \fBlegendMode()\fP
  300. .RE
  301. .PP
  302. .SS "void QwtPlotShapeItem::setPaintAttribute (\fBPaintAttribute\fP attribute, bool on = \fCtrue\fP)"
  303. Specify an attribute how to draw the shape
  304. .PP
  305. \fBParameters\fP
  306. .RS 4
  307. \fIattribute\fP Paint attribute
  308. .br
  309. \fIon\fP On/Off
  310. .RE
  311. .PP
  312. \fBSee also\fP
  313. .RS 4
  314. \fBtestPaintAttribute()\fP
  315. .RE
  316. .PP
  317. .SS "void QwtPlotShapeItem::setPen (const QColor & color, qreal width = \fC0\&.0\fP, Qt::PenStyle style = \fCQt::SolidLine\fP)"
  318. Build and assign a pen
  319. .PP
  320. 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\&.
  321. .PP
  322. \fBParameters\fP
  323. .RS 4
  324. \fIcolor\fP Pen color
  325. .br
  326. \fIwidth\fP Pen width
  327. .br
  328. \fIstyle\fP Pen style
  329. .RE
  330. .PP
  331. \fBSee also\fP
  332. .RS 4
  333. \fBpen()\fP, \fBbrush()\fP
  334. .RE
  335. .PP
  336. .SS "void QwtPlotShapeItem::setPen (const QPen & pen)"
  337. .PP
  338. Assign a pen\&. The pen is used to draw the outline of the shape
  339. .PP
  340. \fBParameters\fP
  341. .RS 4
  342. \fIpen\fP Pen
  343. .RE
  344. .PP
  345. \fBSee also\fP
  346. .RS 4
  347. \fBpen()\fP, \fBbrush()\fP
  348. .RE
  349. .PP
  350. .SS "void QwtPlotShapeItem::setPolygon (const QPolygonF & polygon)"
  351. .PP
  352. Set a path built from a polygon\&.
  353. .PP
  354. \fBParameters\fP
  355. .RS 4
  356. \fIpolygon\fP Polygon
  357. .RE
  358. .PP
  359. \fBSee also\fP
  360. .RS 4
  361. \fBsetShape()\fP, \fBsetRect()\fP, \fBshape()\fP
  362. .RE
  363. .PP
  364. .SS "void QwtPlotShapeItem::setRect (const QRectF & rect)"
  365. .PP
  366. Set a path built from a rectangle\&.
  367. .PP
  368. \fBParameters\fP
  369. .RS 4
  370. \fIrect\fP Rectangle
  371. .RE
  372. .PP
  373. \fBSee also\fP
  374. .RS 4
  375. \fBsetShape()\fP, \fBsetPolygon()\fP, \fBshape()\fP
  376. .RE
  377. .PP
  378. .SS "void QwtPlotShapeItem::setRenderTolerance (double tolerance)"
  379. .PP
  380. 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 )\&.
  381. .PP
  382. For shapes built from curves and ellipses weeding might have the opposite effect because they have to be expanded to polygons\&.
  383. .PP
  384. \fBParameters\fP
  385. .RS 4
  386. \fItolerance\fP Accepted error when reducing the number of points A value <= 0\&.0 disables weeding\&.
  387. .RE
  388. .PP
  389. \fBSee also\fP
  390. .RS 4
  391. \fBrenderTolerance()\fP, \fBQwtWeedingCurveFitter\fP
  392. .RE
  393. .PP
  394. .SS "void QwtPlotShapeItem::setShape (const QPainterPath & shape)"
  395. .PP
  396. Set the shape to be displayed\&.
  397. .PP
  398. \fBParameters\fP
  399. .RS 4
  400. \fIshape\fP Shape
  401. .RE
  402. .PP
  403. \fBSee also\fP
  404. .RS 4
  405. \fBsetShape()\fP, \fBshape()\fP
  406. .RE
  407. .PP
  408. .SS "QPainterPath QwtPlotShapeItem::shape () const"
  409. .PP
  410. \fBReturns\fP
  411. .RS 4
  412. Shape to be displayed
  413. .RE
  414. .PP
  415. \fBSee also\fP
  416. .RS 4
  417. \fBsetShape()\fP
  418. .RE
  419. .PP
  420. .SS "bool QwtPlotShapeItem::testPaintAttribute (\fBPaintAttribute\fP attribute) const"
  421. .PP
  422. \fBReturns\fP
  423. .RS 4
  424. True, when attribute is enabled
  425. .RE
  426. .PP
  427. \fBSee also\fP
  428. .RS 4
  429. \fBsetPaintAttribute()\fP
  430. .RE
  431. .PP
  432. .SH "Author"
  433. .PP
  434. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.