QwtPlotRescaler.3 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. .TH "QwtPlotRescaler" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtPlotRescaler \- \fBQwtPlotRescaler\fP takes care of fixed aspect ratios for plot scales\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_plot_rescaler\&.h>\fP
  11. .PP
  12. Inherits QObject\&.
  13. .SS "Public Types"
  14. .in +1c
  15. .ti -1c
  16. .RI "enum \fBRescalePolicy\fP { \fBFixed\fP, \fBExpanding\fP, \fBFitting\fP }"
  17. .br
  18. .ti -1c
  19. .RI "enum \fBExpandingDirection\fP { \fBExpandUp\fP, \fBExpandDown\fP, \fBExpandBoth\fP }"
  20. .br
  21. .in -1c
  22. .SS "Public Member Functions"
  23. .in +1c
  24. .ti -1c
  25. .RI "\fBQwtPlotRescaler\fP (QWidget *\fBcanvas\fP, int \fBreferenceAxis\fP=\fBQwtPlot::xBottom\fP, \fBRescalePolicy\fP=\fBExpanding\fP)"
  26. .br
  27. .ti -1c
  28. .RI "virtual \fB~QwtPlotRescaler\fP ()"
  29. .br
  30. .RI "Destructor\&. "
  31. .ti -1c
  32. .RI "void \fBsetEnabled\fP (bool)"
  33. .br
  34. .RI "En/disable the rescaler\&. "
  35. .ti -1c
  36. .RI "bool \fBisEnabled\fP () const"
  37. .br
  38. .ti -1c
  39. .RI "void \fBsetRescalePolicy\fP (\fBRescalePolicy\fP)"
  40. .br
  41. .ti -1c
  42. .RI "\fBRescalePolicy\fP \fBrescalePolicy\fP () const"
  43. .br
  44. .ti -1c
  45. .RI "void \fBsetExpandingDirection\fP (\fBExpandingDirection\fP)"
  46. .br
  47. .ti -1c
  48. .RI "void \fBsetExpandingDirection\fP (int axis, \fBExpandingDirection\fP)"
  49. .br
  50. .ti -1c
  51. .RI "\fBExpandingDirection\fP \fBexpandingDirection\fP (int axis) const"
  52. .br
  53. .ti -1c
  54. .RI "void \fBsetReferenceAxis\fP (int axis)"
  55. .br
  56. .ti -1c
  57. .RI "int \fBreferenceAxis\fP () const"
  58. .br
  59. .ti -1c
  60. .RI "void \fBsetAspectRatio\fP (double ratio)"
  61. .br
  62. .ti -1c
  63. .RI "void \fBsetAspectRatio\fP (int axis, double ratio)"
  64. .br
  65. .ti -1c
  66. .RI "double \fBaspectRatio\fP (int axis) const"
  67. .br
  68. .ti -1c
  69. .RI "void \fBsetIntervalHint\fP (int axis, const \fBQwtInterval\fP &)"
  70. .br
  71. .ti -1c
  72. .RI "\fBQwtInterval\fP \fBintervalHint\fP (int axis) const"
  73. .br
  74. .ti -1c
  75. .RI "QWidget * \fBcanvas\fP ()"
  76. .br
  77. .ti -1c
  78. .RI "const QWidget * \fBcanvas\fP () const"
  79. .br
  80. .ti -1c
  81. .RI "\fBQwtPlot\fP * \fBplot\fP ()"
  82. .br
  83. .ti -1c
  84. .RI "const \fBQwtPlot\fP * \fBplot\fP () const"
  85. .br
  86. .ti -1c
  87. .RI "virtual bool \fBeventFilter\fP (QObject *, QEvent *)"
  88. .br
  89. .RI "Event filter for the plot canvas\&. "
  90. .ti -1c
  91. .RI "void \fBrescale\fP () const"
  92. .br
  93. .RI "Adjust the plot axes scales\&. "
  94. .in -1c
  95. .SS "Protected Member Functions"
  96. .in +1c
  97. .ti -1c
  98. .RI "virtual void \fBcanvasResizeEvent\fP (QResizeEvent *)"
  99. .br
  100. .ti -1c
  101. .RI "virtual void \fBrescale\fP (const QSize &oldSize, const QSize &newSize) const"
  102. .br
  103. .ti -1c
  104. .RI "virtual \fBQwtInterval\fP \fBexpandScale\fP (int axis, const QSize &oldSize, const QSize &newSize) const"
  105. .br
  106. .ti -1c
  107. .RI "virtual \fBQwtInterval\fP \fBsyncScale\fP (int axis, const \fBQwtInterval\fP &reference, const QSize &size) const"
  108. .br
  109. .ti -1c
  110. .RI "virtual void \fBupdateScales\fP (\fBQwtInterval\fP intervals[\fBQwtPlot::axisCnt\fP]) const"
  111. .br
  112. .ti -1c
  113. .RI "Qt::Orientation \fBorientation\fP (int axis) const"
  114. .br
  115. .ti -1c
  116. .RI "\fBQwtInterval\fP \fBinterval\fP (int axis) const"
  117. .br
  118. .ti -1c
  119. .RI "\fBQwtInterval\fP \fBexpandInterval\fP (const \fBQwtInterval\fP &, double width, \fBExpandingDirection\fP) const"
  120. .br
  121. .in -1c
  122. .SH "Detailed Description"
  123. .PP
  124. \fBQwtPlotRescaler\fP takes care of fixed aspect ratios for plot scales\&.
  125. \fBQwtPlotRescaler\fP auto adjusts the axes of a \fBQwtPlot\fP according to fixed aspect ratios\&.
  126. .SH "Member Enumeration Documentation"
  127. .PP
  128. .SS "enum \fBQwtPlotRescaler::ExpandingDirection\fP"
  129. When \fBrescalePolicy()\fP is set to Expanding its direction depends on ExpandingDirection
  130. .PP
  131. \fBEnumerator\fP
  132. .in +1c
  133. .TP
  134. \fB\fIExpandUp \fP\fP
  135. The upper limit of the scale is adjusted\&.
  136. .TP
  137. \fB\fIExpandDown \fP\fP
  138. The lower limit of the scale is adjusted\&.
  139. .TP
  140. \fB\fIExpandBoth \fP\fP
  141. Both limits of the scale are adjusted\&.
  142. .SS "enum \fBQwtPlotRescaler::RescalePolicy\fP"
  143. The rescale policy defines how to rescale the reference axis and their depending axes\&.
  144. .PP
  145. \fBSee also\fP
  146. .RS 4
  147. \fBExpandingDirection\fP, \fBsetIntervalHint()\fP
  148. .RE
  149. .PP
  150. .PP
  151. \fBEnumerator\fP
  152. .in +1c
  153. .TP
  154. \fB\fIFixed \fP\fP
  155. The interval of the reference axis remains unchanged, when the geometry of the canvas changes\&. All other axes will be adjusted according to their aspect ratio\&.
  156. .TP
  157. \fB\fIExpanding \fP\fP
  158. The interval of the reference axis will be shrunk/expanded, when the geometry of the canvas changes\&. All other axes will be adjusted according to their aspect ratio\&.
  159. .PP
  160. The interval, that is represented by one pixel is fixed\&.
  161. .TP
  162. \fB\fIFitting \fP\fP
  163. The intervals of the axes are calculated, so that all axes include their interval hint\&.
  164. .SH "Constructor & Destructor Documentation"
  165. .PP
  166. .SS "QwtPlotRescaler::QwtPlotRescaler (QWidget * canvas, int referenceAxis = \fC\fBQwtPlot::xBottom\fP\fP, \fBRescalePolicy\fP policy = \fC\fBExpanding\fP\fP)\fC [explicit]\fP"
  167. Constructor
  168. .PP
  169. \fBParameters\fP
  170. .RS 4
  171. \fIcanvas\fP Canvas
  172. .br
  173. \fIreferenceAxis\fP Reference axis, see RescalePolicy
  174. .br
  175. \fIpolicy\fP Rescale policy
  176. .RE
  177. .PP
  178. \fBSee also\fP
  179. .RS 4
  180. \fBsetRescalePolicy()\fP, \fBsetReferenceAxis()\fP
  181. .RE
  182. .PP
  183. .SH "Member Function Documentation"
  184. .PP
  185. .SS "double QwtPlotRescaler::aspectRatio (int axis) const"
  186. .PP
  187. \fBReturns\fP
  188. .RS 4
  189. Aspect ratio between an axis and the reference axis\&.
  190. .RE
  191. .PP
  192. \fBParameters\fP
  193. .RS 4
  194. \fIaxis\fP Axis index ( see QwtPlot::AxisId )
  195. .RE
  196. .PP
  197. \fBSee also\fP
  198. .RS 4
  199. \fBsetAspectRatio()\fP
  200. .RE
  201. .PP
  202. .SS "QWidget * QwtPlotRescaler::canvas ()"
  203. .PP
  204. \fBReturns\fP
  205. .RS 4
  206. plot canvas
  207. .RE
  208. .PP
  209. .SS "const QWidget * QwtPlotRescaler::canvas () const"
  210. .PP
  211. \fBReturns\fP
  212. .RS 4
  213. plot canvas
  214. .RE
  215. .PP
  216. .SS "void QwtPlotRescaler::canvasResizeEvent (QResizeEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
  217. Event handler for resize events of the plot canvas
  218. .PP
  219. \fBParameters\fP
  220. .RS 4
  221. \fIevent\fP Resize event
  222. .RE
  223. .PP
  224. \fBSee also\fP
  225. .RS 4
  226. \fBrescale()\fP
  227. .RE
  228. .PP
  229. .SS "\fBQwtPlotRescaler::ExpandingDirection\fP QwtPlotRescaler::expandingDirection (int axis) const"
  230. .PP
  231. \fBReturns\fP
  232. .RS 4
  233. Direction in which an axis should be expanded
  234. .RE
  235. .PP
  236. \fBParameters\fP
  237. .RS 4
  238. \fIaxis\fP Axis index ( see QwtPlot::AxisId )
  239. .RE
  240. .PP
  241. \fBSee also\fP
  242. .RS 4
  243. \fBsetExpandingDirection()\fP
  244. .RE
  245. .PP
  246. .SS "\fBQwtInterval\fP QwtPlotRescaler::expandInterval (const \fBQwtInterval\fP & interval, double width, \fBExpandingDirection\fP direction) const\fC [protected]\fP"
  247. Expand the interval
  248. .PP
  249. \fBParameters\fP
  250. .RS 4
  251. \fIinterval\fP Interval to be expanded
  252. .br
  253. \fIwidth\fP Distance to be added to the interval
  254. .br
  255. \fIdirection\fP Direction of the expand operation
  256. .RE
  257. .PP
  258. \fBReturns\fP
  259. .RS 4
  260. Expanded interval
  261. .RE
  262. .PP
  263. .SS "\fBQwtInterval\fP QwtPlotRescaler::expandScale (int axis, const QSize & oldSize, const QSize & newSize) const\fC [protected]\fP, \fC [virtual]\fP"
  264. Calculate the new scale interval of a plot axis
  265. .PP
  266. \fBParameters\fP
  267. .RS 4
  268. \fIaxis\fP Axis index ( see QwtPlot::AxisId )
  269. .br
  270. \fIoldSize\fP Previous size of the canvas
  271. .br
  272. \fInewSize\fP New size of the canvas
  273. .RE
  274. .PP
  275. \fBReturns\fP
  276. .RS 4
  277. Calculated new interval for the axis
  278. .RE
  279. .PP
  280. .SS "\fBQwtInterval\fP QwtPlotRescaler::interval (int axis) const\fC [protected]\fP"
  281. .PP
  282. \fBParameters\fP
  283. .RS 4
  284. \fIaxis\fP Axis index ( see QwtPlot::AxisId )
  285. .RE
  286. .PP
  287. \fBReturns\fP
  288. .RS 4
  289. Normalized interval of an axis
  290. .RE
  291. .PP
  292. .SS "\fBQwtInterval\fP QwtPlotRescaler::intervalHint (int axis) const"
  293. .PP
  294. \fBParameters\fP
  295. .RS 4
  296. \fIaxis\fP Axis, see \fBQwtPlot::Axis\fP
  297. .RE
  298. .PP
  299. \fBReturns\fP
  300. .RS 4
  301. Interval hint
  302. .RE
  303. .PP
  304. \fBSee also\fP
  305. .RS 4
  306. \fBsetIntervalHint()\fP, \fBRescalePolicy\fP
  307. .RE
  308. .PP
  309. .SS "bool QwtPlotRescaler::isEnabled () const"
  310. .PP
  311. \fBReturns\fP
  312. .RS 4
  313. true when enabled, false otherwise
  314. .RE
  315. .PP
  316. \fBSee also\fP
  317. .RS 4
  318. \fBsetEnabled\fP, \fBeventFilter()\fP
  319. .RE
  320. .PP
  321. .SS "Qt::Orientation QwtPlotRescaler::orientation (int axis) const\fC [protected]\fP"
  322. .PP
  323. \fBReturns\fP
  324. .RS 4
  325. Orientation of an axis
  326. .RE
  327. .PP
  328. \fBParameters\fP
  329. .RS 4
  330. \fIaxis\fP Axis index ( see QwtPlot::AxisId )
  331. .RE
  332. .PP
  333. .SS "\fBQwtPlot\fP * QwtPlotRescaler::plot ()"
  334. .PP
  335. \fBReturns\fP
  336. .RS 4
  337. plot widget
  338. .RE
  339. .PP
  340. .SS "const \fBQwtPlot\fP * QwtPlotRescaler::plot () const"
  341. .PP
  342. \fBReturns\fP
  343. .RS 4
  344. plot widget
  345. .RE
  346. .PP
  347. .SS "int QwtPlotRescaler::referenceAxis () const"
  348. .PP
  349. \fBReturns\fP
  350. .RS 4
  351. Reference axis ( see RescalePolicy )
  352. .RE
  353. .PP
  354. \fBSee also\fP
  355. .RS 4
  356. \fBsetReferenceAxis()\fP
  357. .RE
  358. .PP
  359. .SS "void QwtPlotRescaler::rescale (const QSize & oldSize, const QSize & newSize) const\fC [protected]\fP, \fC [virtual]\fP"
  360. Adjust the plot axes scales
  361. .PP
  362. \fBParameters\fP
  363. .RS 4
  364. \fIoldSize\fP Previous size of the canvas
  365. .br
  366. \fInewSize\fP New size of the canvas
  367. .RE
  368. .PP
  369. .SS "\fBQwtPlotRescaler::RescalePolicy\fP QwtPlotRescaler::rescalePolicy () const"
  370. .PP
  371. \fBReturns\fP
  372. .RS 4
  373. Rescale policy
  374. .RE
  375. .PP
  376. \fBSee also\fP
  377. .RS 4
  378. \fBsetRescalePolicy()\fP
  379. .RE
  380. .PP
  381. .SS "void QwtPlotRescaler::setAspectRatio (double ratio)"
  382. Set the aspect ratio between the scale of the reference axis and the other scales\&. The default ratio is 1\&.0
  383. .PP
  384. \fBParameters\fP
  385. .RS 4
  386. \fIratio\fP Aspect ratio
  387. .RE
  388. .PP
  389. \fBSee also\fP
  390. .RS 4
  391. \fBaspectRatio()\fP
  392. .RE
  393. .PP
  394. .SS "void QwtPlotRescaler::setAspectRatio (int axis, double ratio)"
  395. Set the aspect ratio between the scale of the reference axis and another scale\&. The default ratio is 1\&.0
  396. .PP
  397. \fBParameters\fP
  398. .RS 4
  399. \fIaxis\fP Axis index ( see QwtPlot::AxisId )
  400. .br
  401. \fIratio\fP Aspect ratio
  402. .RE
  403. .PP
  404. \fBSee also\fP
  405. .RS 4
  406. \fBaspectRatio()\fP
  407. .RE
  408. .PP
  409. .SS "void QwtPlotRescaler::setEnabled (bool on)"
  410. .PP
  411. En/disable the rescaler\&. When enabled is true an event filter is installed for the canvas, otherwise the event filter is removed\&.
  412. .PP
  413. \fBParameters\fP
  414. .RS 4
  415. \fIon\fP true or false
  416. .RE
  417. .PP
  418. \fBSee also\fP
  419. .RS 4
  420. \fBisEnabled()\fP, \fBeventFilter()\fP
  421. .RE
  422. .PP
  423. .SS "void QwtPlotRescaler::setExpandingDirection (\fBExpandingDirection\fP direction)"
  424. Set the direction in which all axis should be expanded
  425. .PP
  426. \fBParameters\fP
  427. .RS 4
  428. \fIdirection\fP Direction
  429. .RE
  430. .PP
  431. \fBSee also\fP
  432. .RS 4
  433. \fBexpandingDirection()\fP
  434. .RE
  435. .PP
  436. .SS "void QwtPlotRescaler::setExpandingDirection (int axis, \fBExpandingDirection\fP direction)"
  437. Set the direction in which an axis should be expanded
  438. .PP
  439. \fBParameters\fP
  440. .RS 4
  441. \fIaxis\fP Axis index ( see QwtPlot::AxisId )
  442. .br
  443. \fIdirection\fP Direction
  444. .RE
  445. .PP
  446. \fBSee also\fP
  447. .RS 4
  448. \fBexpandingDirection()\fP
  449. .RE
  450. .PP
  451. .SS "void QwtPlotRescaler::setIntervalHint (int axis, const \fBQwtInterval\fP & interval)"
  452. Set an interval hint for an axis
  453. .PP
  454. In Fitting mode, the hint is used as minimal interval that always needs to be displayed\&.
  455. .PP
  456. \fBParameters\fP
  457. .RS 4
  458. \fIaxis\fP Axis, see \fBQwtPlot::Axis\fP
  459. .br
  460. \fIinterval\fP Axis
  461. .RE
  462. .PP
  463. \fBSee also\fP
  464. .RS 4
  465. \fBintervalHint()\fP, \fBRescalePolicy\fP
  466. .RE
  467. .PP
  468. .SS "void QwtPlotRescaler::setReferenceAxis (int axis)"
  469. Set the reference axis ( see RescalePolicy )
  470. .PP
  471. \fBParameters\fP
  472. .RS 4
  473. \fIaxis\fP Axis index ( \fBQwtPlot::Axis\fP )
  474. .RE
  475. .PP
  476. \fBSee also\fP
  477. .RS 4
  478. \fBreferenceAxis()\fP
  479. .RE
  480. .PP
  481. .SS "void QwtPlotRescaler::setRescalePolicy (\fBRescalePolicy\fP policy)"
  482. Change the rescale policy
  483. .PP
  484. \fBParameters\fP
  485. .RS 4
  486. \fIpolicy\fP Rescale policy
  487. .RE
  488. .PP
  489. \fBSee also\fP
  490. .RS 4
  491. \fBrescalePolicy()\fP
  492. .RE
  493. .PP
  494. .SS "\fBQwtInterval\fP QwtPlotRescaler::syncScale (int axis, const \fBQwtInterval\fP & reference, const QSize & size) const\fC [protected]\fP, \fC [virtual]\fP"
  495. Synchronize an axis scale according to the scale of the reference axis
  496. .PP
  497. \fBParameters\fP
  498. .RS 4
  499. \fIaxis\fP Axis index ( see QwtPlot::AxisId )
  500. .br
  501. \fIreference\fP Interval of the reference axis
  502. .br
  503. \fIsize\fP Size of the canvas
  504. .RE
  505. .PP
  506. \fBReturns\fP
  507. .RS 4
  508. New interval for axis
  509. .RE
  510. .PP
  511. .SS "void QwtPlotRescaler::updateScales (\fBQwtInterval\fP intervals[QwtPlot::axisCnt]) const\fC [protected]\fP, \fC [virtual]\fP"
  512. Update the axes scales
  513. .PP
  514. \fBParameters\fP
  515. .RS 4
  516. \fIintervals\fP Scale intervals
  517. .RE
  518. .PP
  519. .SH "Author"
  520. .PP
  521. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.