Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Geometry.hpp 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839
  1. /*
  2. * DISTRHO Plugin Framework (DPF)
  3. * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. * or without fee is hereby granted, provided that the above copyright notice and this
  7. * permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  10. * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  11. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  12. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  13. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef DGL_GEOMETRY_HPP_INCLUDED
  17. #define DGL_GEOMETRY_HPP_INCLUDED
  18. #include "Base.hpp"
  19. START_NAMESPACE_DGL
  20. // --------------------------------------------------------------------------------------------------------------------
  21. // Forward class names
  22. template<typename> class Line;
  23. template<typename> class Circle;
  24. template<typename> class Triangle;
  25. template<typename> class Rectangle;
  26. // --------------------------------------------------------------------------------------------------------------------
  27. /**
  28. DGL Point class.
  29. This class describes a single point in space, defined by an X and Y value.
  30. */
  31. template<typename T>
  32. class Point
  33. {
  34. public:
  35. /**
  36. Constructor for (0, 0) point.
  37. */
  38. Point() noexcept;
  39. /**
  40. Constructor using custom X and Y values.
  41. */
  42. Point(const T& x, const T& y) noexcept;
  43. /**
  44. Constructor using another Point class values.
  45. */
  46. Point(const Point<T>& pos) noexcept;
  47. /**
  48. Get X value.
  49. */
  50. const T& getX() const noexcept;
  51. /**
  52. Get Y value.
  53. */
  54. const T& getY() const noexcept;
  55. /**
  56. Set X value to @a x.
  57. */
  58. void setX(const T& x) noexcept;
  59. /**
  60. Set Y value to @a y.
  61. */
  62. void setY(const T& y) noexcept;
  63. /**
  64. Set X and Y values to @a x and @a y respectively.
  65. */
  66. void setPos(const T& x, const T& y) noexcept;
  67. /**
  68. Set X and Y values according to @a pos.
  69. */
  70. void setPos(const Point<T>& pos) noexcept;
  71. /**
  72. Move this point by @a x and @a y values.
  73. */
  74. void moveBy(const T& x, const T& y) noexcept;
  75. /**
  76. Move this point by @a pos.
  77. */
  78. void moveBy(const Point<T>& pos) noexcept;
  79. /**
  80. Return true if point is (0, 0).
  81. */
  82. bool isZero() const noexcept;
  83. /**
  84. Return true if point is not (0, 0).
  85. */
  86. bool isNotZero() const noexcept;
  87. Point<T> operator+(const Point<T>& pos) noexcept;
  88. Point<T> operator-(const Point<T>& pos) noexcept;
  89. Point<T>& operator=(const Point<T>& pos) noexcept;
  90. Point<T>& operator+=(const Point<T>& pos) noexcept;
  91. Point<T>& operator-=(const Point<T>& pos) noexcept;
  92. bool operator==(const Point<T>& pos) const noexcept;
  93. bool operator!=(const Point<T>& pos) const noexcept;
  94. private:
  95. T x, y;
  96. template<typename> friend class Line;
  97. template<typename> friend class Circle;
  98. template<typename> friend class Triangle;
  99. template<typename> friend class Rectangle;
  100. };
  101. // --------------------------------------------------------------------------------------------------------------------
  102. /**
  103. DGL Size class.
  104. This class describes a size, defined by a width and height value.
  105. */
  106. template<typename T>
  107. class Size
  108. {
  109. public:
  110. /**
  111. Constructor for null size (0x0).
  112. */
  113. Size() noexcept;
  114. /**
  115. Constructor using custom width and height values.
  116. */
  117. Size(const T& width, const T& height) noexcept;
  118. /**
  119. Constructor using another Size class values.
  120. */
  121. Size(const Size<T>& size) noexcept;
  122. /**
  123. Get width.
  124. */
  125. const T& getWidth() const noexcept;
  126. /**
  127. Get height.
  128. */
  129. const T& getHeight() const noexcept;
  130. /**
  131. Set width.
  132. */
  133. void setWidth(const T& width) noexcept;
  134. /**
  135. Set height.
  136. */
  137. void setHeight(const T& height) noexcept;
  138. /**
  139. Set size to @a width and @a height.
  140. */
  141. void setSize(const T& width, const T& height) noexcept;
  142. /**
  143. Set size.
  144. */
  145. void setSize(const Size<T>& size) noexcept;
  146. /**
  147. Grow size by @a multiplier.
  148. */
  149. void growBy(double multiplier) noexcept;
  150. /**
  151. Shrink size by @a divider.
  152. */
  153. void shrinkBy(double divider) noexcept;
  154. /**
  155. Return true if size is null (0x0).
  156. An null size is also invalid.
  157. */
  158. bool isNull() const noexcept;
  159. /**
  160. Return true if size is not null (0x0).
  161. A non-null size is still invalid if its width or height are negative.
  162. */
  163. bool isNotNull() const noexcept;
  164. /**
  165. Return true if size is valid (width and height are higher than zero).
  166. */
  167. bool isValid() const noexcept;
  168. /**
  169. Return true if size is invalid (width or height are lower or equal to zero).
  170. An invalid size might not be null under some circumstances.
  171. */
  172. bool isInvalid() const noexcept;
  173. Size<int> toInt() const noexcept;
  174. Size<T> operator+(const Size<T>& size) noexcept;
  175. Size<T> operator-(const Size<T>& size) noexcept;
  176. Size<T>& operator=(const Size<T>& size) noexcept;
  177. Size<T>& operator+=(const Size<T>& size) noexcept;
  178. Size<T>& operator-=(const Size<T>& size) noexcept;
  179. Size<T>& operator*=(double m) noexcept;
  180. Size<T>& operator/=(double d) noexcept;
  181. Size<T> operator*(double m) const noexcept;
  182. Size<T> operator/(double m) const noexcept;
  183. bool operator==(const Size<T>& size) const noexcept;
  184. bool operator!=(const Size<T>& size) const noexcept;
  185. private:
  186. T fWidth, fHeight;
  187. template<typename> friend class Rectangle;
  188. };
  189. // -----------------------------------------------------------------------
  190. /**
  191. DGL Line class.
  192. This class describes a line, defined by two points.
  193. */
  194. template<typename T>
  195. class Line
  196. {
  197. public:
  198. /**
  199. Constructor for a null line ([0,0] to [0,0]).
  200. */
  201. Line() noexcept;
  202. /**
  203. Constructor using custom start X, start Y, end X and end Y values.
  204. */
  205. Line(const T& startX, const T& startY, const T& endX, const T& endY) noexcept;
  206. /**
  207. Constructor using custom start X, start Y and end pos values.
  208. */
  209. Line(const T& startX, const T& startY, const Point<T>& endPos) noexcept;
  210. /**
  211. Constructor using custom start pos, end X and end Y values.
  212. */
  213. Line(const Point<T>& startPos, const T& endX, const T& endY) noexcept;
  214. /**
  215. Constructor using custom start and end pos values.
  216. */
  217. Line(const Point<T>& startPos, const Point<T>& endPos) noexcept;
  218. /**
  219. Constructor using another Line class values.
  220. */
  221. Line(const Line<T>& line) noexcept;
  222. /**
  223. Get start X value.
  224. */
  225. const T& getStartX() const noexcept;
  226. /**
  227. Get start Y value.
  228. */
  229. const T& getStartY() const noexcept;
  230. /**
  231. Get end X value.
  232. */
  233. const T& getEndX() const noexcept;
  234. /**
  235. Get end Y value.
  236. */
  237. const T& getEndY() const noexcept;
  238. /**
  239. Get start position.
  240. */
  241. const Point<T>& getStartPos() const noexcept;
  242. /**
  243. Get end position.
  244. */
  245. const Point<T>& getEndPos() const noexcept;
  246. /**
  247. Set start X value to @a x.
  248. */
  249. void setStartX(const T& x) noexcept;
  250. /**
  251. Set start Y value to @a y.
  252. */
  253. void setStartY(const T& y) noexcept;
  254. /**
  255. Set start X and Y values to @a x and @a y respectively.
  256. */
  257. void setStartPos(const T& x, const T& y) noexcept;
  258. /**
  259. Set start X and Y values according to @a pos.
  260. */
  261. void setStartPos(const Point<T>& pos) noexcept;
  262. /**
  263. Set end X value to @a x.
  264. */
  265. void setEndX(const T& x) noexcept;
  266. /**
  267. Set end Y value to @a y.
  268. */
  269. void setEndY(const T& y) noexcept;
  270. /**
  271. Set end X and Y values to @a x and @a y respectively.
  272. */
  273. void setEndPos(const T& x, const T& y) noexcept;
  274. /**
  275. Set end X and Y values according to @a pos.
  276. */
  277. void setEndPos(const Point<T>& pos) noexcept;
  278. /**
  279. Move this line by @a x and @a y values.
  280. */
  281. void moveBy(const T& x, const T& y) noexcept;
  282. /**
  283. Move this line by @a pos.
  284. */
  285. void moveBy(const Point<T>& pos) noexcept;
  286. /**
  287. Return true if line is null (start and end pos are equal).
  288. */
  289. bool isNull() const noexcept;
  290. /**
  291. Return true if line is not null (start and end pos are different).
  292. */
  293. bool isNotNull() const noexcept;
  294. #ifndef DPF_TEST_POINT_CPP
  295. /**
  296. Draw this line using the provided graphics context, optionally specifying line width.
  297. */
  298. void draw(const GraphicsContext& context, T width = 1);
  299. #endif
  300. Line<T>& operator=(const Line<T>& line) noexcept;
  301. bool operator==(const Line<T>& line) const noexcept;
  302. bool operator!=(const Line<T>& line) const noexcept;
  303. #ifndef DPF_TEST_POINT_CPP
  304. /**
  305. Draw this line using the current OpenGL state.@n
  306. DEPRECATED Please use draw(const GraphicsContext&) instead.
  307. */
  308. DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)")
  309. void draw();
  310. #endif
  311. private:
  312. Point<T> posStart, posEnd;
  313. };
  314. // -----------------------------------------------------------------------
  315. /**
  316. DGL Circle class.
  317. This class describes a circle, defined by position, size and a minimum of 3 segments.
  318. TODO: report if circle starts at top-left, bottom-right or center.
  319. and size grows from which point?
  320. */
  321. template<typename T>
  322. class Circle
  323. {
  324. public:
  325. /**
  326. Constructor for a null circle.
  327. */
  328. Circle() noexcept;
  329. /**
  330. Constructor using custom X, Y and size values.
  331. */
  332. Circle(const T& x, const T& y, const float size, const uint numSegments = 300);
  333. /**
  334. Constructor using custom position and size values.
  335. */
  336. Circle(const Point<T>& pos, const float size, const uint numSegments = 300);
  337. /**
  338. Constructor using another Circle class values.
  339. */
  340. Circle(const Circle<T>& cir) noexcept;
  341. /**
  342. Get X value.
  343. */
  344. const T& getX() const noexcept;
  345. /**
  346. Get Y value.
  347. */
  348. const T& getY() const noexcept;
  349. /**
  350. Get position.
  351. */
  352. const Point<T>& getPos() const noexcept;
  353. /**
  354. Set X value to @a x.
  355. */
  356. void setX(const T& x) noexcept;
  357. /**
  358. Set Y value to @a y.
  359. */
  360. void setY(const T& y) noexcept;
  361. /**
  362. Set X and Y values to @a x and @a y respectively.
  363. */
  364. void setPos(const T& x, const T& y) noexcept;
  365. /**
  366. Set X and Y values according to @a pos.
  367. */
  368. void setPos(const Point<T>& pos) noexcept;
  369. /**
  370. Get size.
  371. */
  372. float getSize() const noexcept;
  373. /**
  374. Set size.
  375. @note Must always be > 0
  376. */
  377. void setSize(const float size) noexcept;
  378. /**
  379. Get the current number of line segments that make this circle.
  380. */
  381. uint getNumSegments() const noexcept;
  382. /**
  383. Set the number of line segments that will make this circle.
  384. @note Must always be >= 3
  385. */
  386. void setNumSegments(const uint num);
  387. /**
  388. Draw this circle using the provided graphics context.
  389. */
  390. void draw(const GraphicsContext& context);
  391. /**
  392. Draw lines (outline of this circle) using the provided graphics context, optionally specifying line width.
  393. */
  394. void drawOutline(const GraphicsContext& context, T lineWidth = 1);
  395. Circle<T>& operator=(const Circle<T>& cir) noexcept;
  396. bool operator==(const Circle<T>& cir) const noexcept;
  397. bool operator!=(const Circle<T>& cir) const noexcept;
  398. #ifndef DPF_TEST_POINT_CPP
  399. /**
  400. Draw this circle using the current OpenGL state.@n
  401. DEPRECATED Please use draw(const GraphicsContext&) instead.
  402. */
  403. DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)")
  404. void draw();
  405. /**
  406. Draw lines (outline of this circle) using the current OpenGL state.@n
  407. DEPRECATED Please use drawOutline(const GraphicsContext&,T) instead.
  408. */
  409. DISTRHO_DEPRECATED_BY("drawOutline(const GraphicsContext&)")
  410. void drawOutline();
  411. #endif
  412. private:
  413. Point<T> fPos;
  414. float fSize;
  415. uint fNumSegments;
  416. // cached values
  417. float fTheta, fCos, fSin;
  418. };
  419. // -----------------------------------------------------------------------
  420. /**
  421. DGL Triangle class.
  422. This class describes a triangle, defined by 3 points.
  423. */
  424. template<typename T>
  425. class Triangle
  426. {
  427. public:
  428. /**
  429. Constructor for a null triangle.
  430. */
  431. Triangle() noexcept;
  432. /**
  433. Constructor using custom X and Y values.
  434. */
  435. Triangle(const T& x1, const T& y1, const T& x2, const T& y2, const T& x3, const T& y3) noexcept;
  436. /**
  437. Constructor using custom position values.
  438. */
  439. Triangle(const Point<T>& pos1, const Point<T>& pos2, const Point<T>& pos3) noexcept;
  440. /**
  441. Constructor using another Triangle class values.
  442. */
  443. Triangle(const Triangle<T>& tri) noexcept;
  444. /**
  445. Return true if triangle is null (all its points are equal).
  446. An null triangle is also invalid.
  447. */
  448. bool isNull() const noexcept;
  449. /**
  450. Return true if triangle is not null (one its points is different from the others).
  451. A non-null triangle is still invalid if two of its points are equal.
  452. */
  453. bool isNotNull() const noexcept;
  454. /**
  455. Return true if triangle is valid (all its points are different).
  456. */
  457. bool isValid() const noexcept;
  458. /**
  459. Return true if triangle is invalid (one or two of its points are equal).
  460. An invalid triangle might not be null under some circumstances.
  461. */
  462. bool isInvalid() const noexcept;
  463. /**
  464. Draw this triangle using the provided graphics context.
  465. */
  466. void draw(const GraphicsContext& context);
  467. /**
  468. Draw lines (outline of this triangle) using the provided graphics context, optionally specifying line width.
  469. */
  470. void drawOutline(const GraphicsContext& context, T lineWidth = 1);
  471. Triangle<T>& operator=(const Triangle<T>& tri) noexcept;
  472. bool operator==(const Triangle<T>& tri) const noexcept;
  473. bool operator!=(const Triangle<T>& tri) const noexcept;
  474. #ifndef DPF_TEST_POINT_CPP
  475. /**
  476. Draw this triangle using the current OpenGL state.@n
  477. DEPRECATED Please use draw(const GraphicsContext&) instead.
  478. */
  479. DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)")
  480. void draw();
  481. /**
  482. Draw lines (outline of this triangle) using the current OpenGL state.@n
  483. DEPRECATED Please use drawOutline(const GraphicsContext&,T) instead.
  484. */
  485. DISTRHO_DEPRECATED_BY("drawOutline(const GraphicsContext&)")
  486. void drawOutline();
  487. #endif
  488. private:
  489. Point<T> pos1, pos2, pos3;
  490. };
  491. // -----------------------------------------------------------------------
  492. /**
  493. DGL Rectangle class.
  494. This class describes a rectangle, defined by a starting point and a size.
  495. */
  496. template<typename T>
  497. class Rectangle
  498. {
  499. public:
  500. /**
  501. Constructor for a null rectangle.
  502. */
  503. Rectangle() noexcept;
  504. /**
  505. Constructor using custom X, Y, width and height values.
  506. */
  507. Rectangle(const T& x, const T& y, const T& width, const T& height) noexcept;
  508. /**
  509. Constructor using custom X, Y and size values.
  510. */
  511. Rectangle(const T& x, const T& y, const Size<T>& size) noexcept;
  512. /**
  513. Constructor using custom pos, width and height values.
  514. */
  515. Rectangle(const Point<T>& pos, const T& width, const T& height) noexcept;
  516. /**
  517. Constructor using custom position and size.
  518. */
  519. Rectangle(const Point<T>& pos, const Size<T>& size) noexcept;
  520. /**
  521. Constructor using another Rectangle class values.
  522. */
  523. Rectangle(const Rectangle<T>& rect) noexcept;
  524. /**
  525. Get X value.
  526. */
  527. const T& getX() const noexcept;
  528. /**
  529. Get Y value.
  530. */
  531. const T& getY() const noexcept;
  532. /**
  533. Get width.
  534. */
  535. const T& getWidth() const noexcept;
  536. /**
  537. Get height.
  538. */
  539. const T& getHeight() const noexcept;
  540. /**
  541. Get position.
  542. */
  543. const Point<T>& getPos() const noexcept;
  544. /**
  545. Get size.
  546. */
  547. const Size<T>& getSize() const noexcept;
  548. /**
  549. Set X value as @a x.
  550. */
  551. void setX(const T& x) noexcept;
  552. /**
  553. Set Y value as @a y.
  554. */
  555. void setY(const T& y) noexcept;
  556. /**
  557. Set X and Y values as @a x and @a y respectively.
  558. */
  559. void setPos(const T& x, const T& y) noexcept;
  560. /**
  561. Set X and Y values according to @a pos.
  562. */
  563. void setPos(const Point<T>& pos) noexcept;
  564. /**
  565. Move this rectangle by @a x and @a y values.
  566. */
  567. void moveBy(const T& x, const T& y) noexcept;
  568. /**
  569. Move this rectangle by @a pos.
  570. */
  571. void moveBy(const Point<T>& pos) noexcept;
  572. /**
  573. Set width.
  574. */
  575. void setWidth(const T& width) noexcept;
  576. /**
  577. Set height.
  578. */
  579. void setHeight(const T& height) noexcept;
  580. /**
  581. Set size using @a width and @a height.
  582. */
  583. void setSize(const T& width, const T& height) noexcept;
  584. /**
  585. Set size.
  586. */
  587. void setSize(const Size<T>& size) noexcept;
  588. /**
  589. Grow size by @a multiplier.
  590. */
  591. void growBy(double multiplier) noexcept;
  592. /**
  593. Shrink size by @a divider.
  594. */
  595. void shrinkBy(double divider) noexcept;
  596. /**
  597. Set rectangle using @a pos and @a size.
  598. */
  599. void setRectangle(const Point<T>& pos, const Size<T>& size) noexcept;
  600. /**
  601. Set rectangle.
  602. */
  603. void setRectangle(const Rectangle<T>& rect) noexcept;
  604. /**
  605. Check if this rectangle contains the point defined by @a X and @a Y.
  606. */
  607. bool contains(const T& x, const T& y) const noexcept;
  608. /**
  609. Check if this rectangle contains the point @a pos.
  610. */
  611. bool contains(const Point<T>& pos) const noexcept;
  612. /**
  613. Check if this rectangle contains the point @a pos affected by a custom scale.
  614. */
  615. bool containsAfterScaling(const Point<T>& pos, double scaling) const noexcept;
  616. /**
  617. Check if this rectangle contains the point @a pos of another type.
  618. */
  619. template<typename T2>
  620. bool contains(const Point<T2>& pos) const noexcept;
  621. /**
  622. Check if this rectangle contains X.
  623. */
  624. bool containsX(const T& x) const noexcept;
  625. /**
  626. Check if this rectangle contains Y.
  627. */
  628. bool containsY(const T& y) const noexcept;
  629. /**
  630. Return true if size is null (0x0).
  631. An null size is also invalid.
  632. */
  633. bool isNull() const noexcept;
  634. /**
  635. Return true if size is not null (0x0).
  636. A non-null size is still invalid if its width or height are negative.
  637. */
  638. bool isNotNull() const noexcept;
  639. /**
  640. Return true if size is valid (width and height are higher than zero).
  641. */
  642. bool isValid() const noexcept;
  643. /**
  644. Return true if size is invalid (width or height are lower or equal to zero).
  645. An invalid size might not be null under some circumstances.
  646. */
  647. bool isInvalid() const noexcept;
  648. /**
  649. Draw this rectangle using the provided graphics context.
  650. */
  651. void draw(const GraphicsContext& context);
  652. /**
  653. Draw lines (outline of this rectangle) using the provided graphics context, optionally specifying line width.
  654. */
  655. void drawOutline(const GraphicsContext& context, T lineWidth = 1);
  656. Rectangle<T>& operator=(const Rectangle<T>& rect) noexcept;
  657. Rectangle<T>& operator*=(double m) noexcept;
  658. Rectangle<T>& operator/=(double d) noexcept;
  659. bool operator==(const Rectangle<T>& size) const noexcept;
  660. bool operator!=(const Rectangle<T>& size) const noexcept;
  661. /**
  662. Draw this rectangle using the current OpenGL state.@n
  663. DEPRECATED Please use draw(const GraphicsContext&) instead.
  664. */
  665. DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)")
  666. void draw();
  667. /**
  668. Draw lines (outline of this rectangle) using the current OpenGL state.@n
  669. DEPRECATED Please use drawOutline(const GraphicsContext&,T) instead.
  670. */
  671. DISTRHO_DEPRECATED_BY("drawOutline(const GraphicsContext&)")
  672. void drawOutline();
  673. private:
  674. Point<T> pos;
  675. Size<T> size;
  676. };
  677. // -----------------------------------------------------------------------
  678. END_NAMESPACE_DGL
  679. #endif // DGL_GEOMETRY_HPP_INCLUDED