DISTRHO Plugin Framework
Geometry.hpp
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 
17 #ifndef DGL_GEOMETRY_HPP_INCLUDED
18 #define DGL_GEOMETRY_HPP_INCLUDED
19 
20 #include "Base.hpp"
21 
22 START_NAMESPACE_DGL
23 
24 // --------------------------------------------------------------------------------------------------------------------
25 // Forward class names
26 
27 template<typename> class Line;
28 template<typename> class Circle;
29 template<typename> class Triangle;
30 template<typename> class Rectangle;
31 
32 // --------------------------------------------------------------------------------------------------------------------
33 
34 /**
35  DGL Point class.
36 
37  This class describes a single point in space, defined by an X and Y value.
38  */
39 template<typename T>
40 class Point
41 {
42 public:
43  /**
44  Constructor for (0, 0) point.
45  */
46  Point() noexcept;
47 
48  /**
49  Constructor using custom X and Y values.
50  */
51  Point(const T& x, const T& y) noexcept;
52 
53  /**
54  Constructor using another Point class values.
55  */
56  Point(const Point<T>& pos) noexcept;
57 
58  /**
59  Get X value.
60  */
61  const T& getX() const noexcept;
62 
63  /**
64  Get Y value.
65  */
66  const T& getY() const noexcept;
67 
68  /**
69  Set X value to @a x.
70  */
71  void setX(const T& x) noexcept;
72 
73  /**
74  Set Y value to @a y.
75  */
76  void setY(const T& y) noexcept;
77 
78  /**
79  Set X and Y values to @a x and @a y respectively.
80  */
81  void setPos(const T& x, const T& y) noexcept;
82 
83  /**
84  Set X and Y values according to @a pos.
85  */
86  void setPos(const Point<T>& pos) noexcept;
87 
88  /**
89  Move this point by @a x and @a y values.
90  */
91  void moveBy(const T& x, const T& y) noexcept;
92 
93  /**
94  Move this point by @a pos.
95  */
96  void moveBy(const Point<T>& pos) noexcept;
97 
98  /**
99  Return true if point is (0, 0).
100  */
101  bool isZero() const noexcept;
102 
103  /**
104  Return true if point is not (0, 0).
105  */
106  bool isNotZero() const noexcept;
107 
108  Point<T> operator+(const Point<T>& pos) noexcept;
109  Point<T> operator-(const Point<T>& pos) noexcept;
110  Point<T>& operator=(const Point<T>& pos) noexcept;
111  Point<T>& operator+=(const Point<T>& pos) noexcept;
112  Point<T>& operator-=(const Point<T>& pos) noexcept;
113  bool operator==(const Point<T>& pos) const noexcept;
114  bool operator!=(const Point<T>& pos) const noexcept;
115 
116 private:
117  T x, y;
118  template<typename> friend class Line;
119  template<typename> friend class Circle;
120  template<typename> friend class Triangle;
121  template<typename> friend class Rectangle;
122 };
123 
124 // --------------------------------------------------------------------------------------------------------------------
125 
126 /**
127  DGL Size class.
128 
129  This class describes a size, defined by a width and height value.
130  */
131 template<typename T>
132 class Size
133 {
134 public:
135  /**
136  Constructor for null size (0x0).
137  */
138  Size() noexcept;
139 
140  /**
141  Constructor using custom width and height values.
142  */
143  Size(const T& width, const T& height) noexcept;
144 
145  /**
146  Constructor using another Size class values.
147  */
148  Size(const Size<T>& size) noexcept;
149 
150  /**
151  Get width.
152  */
153  const T& getWidth() const noexcept;
154 
155  /**
156  Get height.
157  */
158  const T& getHeight() const noexcept;
159 
160  /**
161  Set width.
162  */
163  void setWidth(const T& width) noexcept;
164 
165  /**
166  Set height.
167  */
168  void setHeight(const T& height) noexcept;
169 
170  /**
171  Set size to @a width and @a height.
172  */
173  void setSize(const T& width, const T& height) noexcept;
174 
175  /**
176  Set size.
177  */
178  void setSize(const Size<T>& size) noexcept;
179 
180  /**
181  Grow size by @a multiplier.
182  */
183  void growBy(double multiplier) noexcept;
184 
185  /**
186  Shrink size by @a divider.
187  */
188  void shrinkBy(double divider) noexcept;
189 
190  /**
191  Return true if size is null (0x0).
192  An null size is also invalid.
193  */
194  bool isNull() const noexcept;
195 
196  /**
197  Return true if size is not null (0x0).
198  A non-null size is still invalid if its width or height are negative.
199  */
200  bool isNotNull() const noexcept;
201 
202  /**
203  Return true if size is valid (width and height are higher than zero).
204  */
205  bool isValid() const noexcept;
206 
207  /**
208  Return true if size is invalid (width or height are lower or equal to zero).
209  An invalid size might not be null under some circumstances.
210  */
211  bool isInvalid() const noexcept;
212 
213  Size<int> toInt() const noexcept;
214 
215  Size<T> operator+(const Size<T>& size) noexcept;
216  Size<T> operator-(const Size<T>& size) noexcept;
217  Size<T>& operator=(const Size<T>& size) noexcept;
218  Size<T>& operator+=(const Size<T>& size) noexcept;
219  Size<T>& operator-=(const Size<T>& size) noexcept;
220  Size<T>& operator*=(double m) noexcept;
221  Size<T>& operator/=(double d) noexcept;
222  bool operator==(const Size<T>& size) const noexcept;
223  bool operator!=(const Size<T>& size) const noexcept;
224 
225 private:
226  T fWidth, fHeight;
227  template<typename> friend class Rectangle;
228 };
229 
230 // -----------------------------------------------------------------------
231 
232 /**
233  DGL Line class.
234 
235  This class describes a line, defined by two points.
236  */
237 template<typename T>
238 class Line
239 {
240 public:
241  /**
242  Constructor for a null line ([0,0] to [0,0]).
243  */
244  Line() noexcept;
245 
246  /**
247  Constructor using custom start X, start Y, end X and end Y values.
248  */
249  Line(const T& startX, const T& startY, const T& endX, const T& endY) noexcept;
250 
251  /**
252  Constructor using custom start X, start Y and end pos values.
253  */
254  Line(const T& startX, const T& startY, const Point<T>& endPos) noexcept;
255 
256  /**
257  Constructor using custom start pos, end X and end Y values.
258  */
259  Line(const Point<T>& startPos, const T& endX, const T& endY) noexcept;
260 
261  /**
262  Constructor using custom start and end pos values.
263  */
264  Line(const Point<T>& startPos, const Point<T>& endPos) noexcept;
265 
266  /**
267  Constructor using another Line class values.
268  */
269  Line(const Line<T>& line) noexcept;
270 
271  /**
272  Get start X value.
273  */
274  const T& getStartX() const noexcept;
275 
276  /**
277  Get start Y value.
278  */
279  const T& getStartY() const noexcept;
280 
281  /**
282  Get end X value.
283  */
284  const T& getEndX() const noexcept;
285 
286  /**
287  Get end Y value.
288  */
289  const T& getEndY() const noexcept;
290 
291  /**
292  Get start position.
293  */
294  const Point<T>& getStartPos() const noexcept;
295 
296  /**
297  Get end position.
298  */
299  const Point<T>& getEndPos() const noexcept;
300 
301  /**
302  Set start X value to @a x.
303  */
304  void setStartX(const T& x) noexcept;
305 
306  /**
307  Set start Y value to @a y.
308  */
309  void setStartY(const T& y) noexcept;
310 
311  /**
312  Set start X and Y values to @a x and @a y respectively.
313  */
314  void setStartPos(const T& x, const T& y) noexcept;
315 
316  /**
317  Set start X and Y values according to @a pos.
318  */
319  void setStartPos(const Point<T>& pos) noexcept;
320 
321  /**
322  Set end X value to @a x.
323  */
324  void setEndX(const T& x) noexcept;
325 
326  /**
327  Set end Y value to @a y.
328  */
329  void setEndY(const T& y) noexcept;
330 
331  /**
332  Set end X and Y values to @a x and @a y respectively.
333  */
334  void setEndPos(const T& x, const T& y) noexcept;
335 
336  /**
337  Set end X and Y values according to @a pos.
338  */
339  void setEndPos(const Point<T>& pos) noexcept;
340 
341  /**
342  Move this line by @a x and @a y values.
343  */
344  void moveBy(const T& x, const T& y) noexcept;
345 
346  /**
347  Move this line by @a pos.
348  */
349  void moveBy(const Point<T>& pos) noexcept;
350 
351  /**
352  Return true if line is null (start and end pos are equal).
353  */
354  bool isNull() const noexcept;
355 
356  /**
357  Return true if line is not null (start and end pos are different).
358  */
359  bool isNotNull() const noexcept;
360 
361 #ifndef DPF_TEST_POINT_CPP
362  /**
363  Draw this line using the provided graphics context, optionally specifying line width.
364  */
365  void draw(const GraphicsContext& context, T width = 1);
366 #endif
367 
368  Line<T>& operator=(const Line<T>& line) noexcept;
369  bool operator==(const Line<T>& line) const noexcept;
370  bool operator!=(const Line<T>& line) const noexcept;
371 
372 #ifndef DPF_TEST_POINT_CPP
373  /**
374  Draw this line using the current OpenGL state.
375  DEPRECATED please use draw(const GraphicsContext&) instead.
376  */
377  DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)")
378  void draw();
379 #endif
380 
381 private:
382  Point<T> posStart, posEnd;
383 };
384 
385 // -----------------------------------------------------------------------
386 
387 /**
388  DGL Circle class.
389 
390  This class describes a circle, defined by position, size and a minimum of 3 segments.
391 
392  TODO: report if circle starts at top-left, bottom-right or center.
393  and size grows from which point?
394  */
395 template<typename T>
396 class Circle
397 {
398 public:
399  /**
400  Constructor for a null circle.
401  */
402  Circle() noexcept;
403 
404  /**
405  Constructor using custom X, Y and size values.
406  */
407  Circle(const T& x, const T& y, const float size, const uint numSegments = 300);
408 
409  /**
410  Constructor using custom position and size values.
411  */
412  Circle(const Point<T>& pos, const float size, const uint numSegments = 300);
413 
414  /**
415  Constructor using another Circle class values.
416  */
417  Circle(const Circle<T>& cir) noexcept;
418 
419  /**
420  Get X value.
421  */
422  const T& getX() const noexcept;
423 
424  /**
425  Get Y value.
426  */
427  const T& getY() const noexcept;
428 
429  /**
430  Get position.
431  */
432  const Point<T>& getPos() const noexcept;
433 
434  /**
435  Set X value to @a x.
436  */
437  void setX(const T& x) noexcept;
438 
439  /**
440  Set Y value to @a y.
441  */
442  void setY(const T& y) noexcept;
443 
444  /**
445  Set X and Y values to @a x and @a y respectively.
446  */
447  void setPos(const T& x, const T& y) noexcept;
448 
449  /**
450  Set X and Y values according to @a pos.
451  */
452  void setPos(const Point<T>& pos) noexcept;
453 
454  /**
455  Get size.
456  */
457  float getSize() const noexcept;
458 
459  /**
460  Set size.
461  @note Must always be > 0
462  */
463  void setSize(const float size) noexcept;
464 
465  /**
466  Get the current number of line segments that make this circle.
467  */
468  uint getNumSegments() const noexcept;
469 
470  /**
471  Set the number of line segments that will make this circle.
472  @note Must always be >= 3
473  */
474  void setNumSegments(const uint num);
475 
476  /**
477  Draw this circle using the provided graphics context.
478  */
479  void draw(const GraphicsContext& context);
480 
481  /**
482  Draw lines (outline of this circle) using the provided graphics context, optionally specifying line width.
483  */
484  void drawOutline(const GraphicsContext& context, T lineWidth = 1);
485 
486  Circle<T>& operator=(const Circle<T>& cir) noexcept;
487  bool operator==(const Circle<T>& cir) const noexcept;
488  bool operator!=(const Circle<T>& cir) const noexcept;
489 
490 #ifndef DPF_TEST_POINT_CPP
491  /**
492  Draw this circle using the current OpenGL state.
493  DEPRECATED please use draw(const GraphicsContext&) instead.
494  */
495  DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)")
496  void draw();
497 
498  /**
499  Draw lines (outline of this circle) using the current OpenGL state.
500  DEPRECATED please use draw(const GraphicsContext&,T) instead.
501  */
502  DISTRHO_DEPRECATED_BY("drawOutline(const GraphicsContext&)")
503  void drawOutline();
504 #endif
505 
506 private:
507  Point<T> fPos;
508  float fSize;
509  uint fNumSegments;
510 
511  // cached values
512  float fTheta, fCos, fSin;
513 };
514 
515 // -----------------------------------------------------------------------
516 
517 /**
518  DGL Triangle class.
519 
520  This class describes a triangle, defined by 3 points.
521  */
522 template<typename T>
523 class Triangle
524 {
525 public:
526  /**
527  Constructor for a null triangle.
528  */
529  Triangle() noexcept;
530 
531  /**
532  Constructor using custom X and Y values.
533  */
534  Triangle(const T& x1, const T& y1, const T& x2, const T& y2, const T& x3, const T& y3) noexcept;
535 
536  /**
537  Constructor using custom position values.
538  */
539  Triangle(const Point<T>& pos1, const Point<T>& pos2, const Point<T>& pos3) noexcept;
540 
541  /**
542  Constructor using another Triangle class values.
543  */
544  Triangle(const Triangle<T>& tri) noexcept;
545 
546  /**
547  Return true if triangle is null (all its points are equal).
548  An null triangle is also invalid.
549  */
550  bool isNull() const noexcept;
551 
552  /**
553  Return true if triangle is not null (one its points is different from the others).
554  A non-null triangle is still invalid if two of its points are equal.
555  */
556  bool isNotNull() const noexcept;
557 
558  /**
559  Return true if triangle is valid (all its points are different).
560  */
561  bool isValid() const noexcept;
562 
563  /**
564  Return true if triangle is invalid (one or two of its points are equal).
565  An invalid triangle might not be null under some circumstances.
566  */
567  bool isInvalid() const noexcept;
568 
569  /**
570  Draw this triangle using the provided graphics context.
571  */
572  void draw(const GraphicsContext& context);
573 
574  /**
575  Draw lines (outline of this triangle) using the provided graphics context, optionally specifying line width.
576  */
577  void drawOutline(const GraphicsContext& context, T lineWidth = 1);
578 
579  Triangle<T>& operator=(const Triangle<T>& tri) noexcept;
580  bool operator==(const Triangle<T>& tri) const noexcept;
581  bool operator!=(const Triangle<T>& tri) const noexcept;
582 
583 #ifndef DPF_TEST_POINT_CPP
584  /**
585  Draw this triangle using the current OpenGL state.
586  DEPRECATED please use draw(const GraphicsContext&) instead.
587  */
588  DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)")
589  void draw();
590 
591  /**
592  Draw lines (outline of this triangle) using the current OpenGL state.
593  DEPRECATED please use draw(const GraphicsContext&,T) instead.
594  */
595  DISTRHO_DEPRECATED_BY("drawOutline(const GraphicsContext&)")
596  void drawOutline();
597 #endif
598 
599 private:
600  Point<T> pos1, pos2, pos3;
601 };
602 
603 // -----------------------------------------------------------------------
604 
605 /**
606  DGL Rectangle class.
607 
608  This class describes a rectangle, defined by a starting point and a size.
609  */
610 template<typename T>
611 class Rectangle
612 {
613 public:
614  /**
615  Constructor for a null rectangle.
616  */
617  Rectangle() noexcept;
618 
619  /**
620  Constructor using custom X, Y, width and height values.
621  */
622  Rectangle(const T& x, const T& y, const T& width, const T& height) noexcept;
623 
624  /**
625  Constructor using custom X, Y and size values.
626  */
627  Rectangle(const T& x, const T& y, const Size<T>& size) noexcept;
628 
629  /**
630  Constructor using custom pos, width and height values.
631  */
632  Rectangle(const Point<T>& pos, const T& width, const T& height) noexcept;
633 
634  /**
635  Constructor using custom position and size.
636  */
637  Rectangle(const Point<T>& pos, const Size<T>& size) noexcept;
638 
639  /**
640  Constructor using another Rectangle class values.
641  */
642  Rectangle(const Rectangle<T>& rect) noexcept;
643 
644  /**
645  Get X value.
646  */
647  const T& getX() const noexcept;
648 
649  /**
650  Get Y value.
651  */
652  const T& getY() const noexcept;
653 
654  /**
655  Get width.
656  */
657  const T& getWidth() const noexcept;
658 
659  /**
660  Get height.
661  */
662  const T& getHeight() const noexcept;
663 
664  /**
665  Get position.
666  */
667  const Point<T>& getPos() const noexcept;
668 
669  /**
670  Get size.
671  */
672  const Size<T>& getSize() const noexcept;
673 
674  /**
675  Set X value as @a x.
676  */
677  void setX(const T& x) noexcept;
678 
679  /**
680  Set Y value as @a y.
681  */
682  void setY(const T& y) noexcept;
683 
684  /**
685  Set X and Y values as @a x and @a y respectively.
686  */
687  void setPos(const T& x, const T& y) noexcept;
688 
689  /**
690  Set X and Y values according to @a pos.
691  */
692  void setPos(const Point<T>& pos) noexcept;
693 
694  /**
695  Move this rectangle by @a x and @a y values.
696  */
697  void moveBy(const T& x, const T& y) noexcept;
698 
699  /**
700  Move this rectangle by @a pos.
701  */
702  void moveBy(const Point<T>& pos) noexcept;
703 
704  /**
705  Set width.
706  */
707  void setWidth(const T& width) noexcept;
708 
709  /**
710  Set height.
711  */
712  void setHeight(const T& height) noexcept;
713 
714  /**
715  Set size using @a width and @a height.
716  */
717  void setSize(const T& width, const T& height) noexcept;
718 
719  /**
720  Set size.
721  */
722  void setSize(const Size<T>& size) noexcept;
723 
724  /**
725  Grow size by @a multiplier.
726  */
727  void growBy(double multiplier) noexcept;
728 
729  /**
730  Shrink size by @a divider.
731  */
732  void shrinkBy(double divider) noexcept;
733 
734  /**
735  Set rectangle using @a pos and @a size.
736  */
737  void setRectangle(const Point<T>& pos, const Size<T>& size) noexcept;
738 
739  /**
740  Set rectangle.
741  */
742  void setRectangle(const Rectangle<T>& rect) noexcept;
743 
744  /**
745  Check if this rectangle contains the point defined by @a X and @a Y.
746  */
747  bool contains(const T& x, const T& y) const noexcept;
748 
749  /**
750  Check if this rectangle contains the point @a pos.
751  */
752  bool contains(const Point<T>& pos) const noexcept;
753 
754  /**
755  Check if this rectangle contains X.
756  */
757  bool containsX(const T& x) const noexcept;
758 
759  /**
760  Check if this rectangle contains Y.
761  */
762  bool containsY(const T& y) const noexcept;
763 
764  /**
765  Return true if size is null (0x0).
766  An null size is also invalid.
767  */
768  bool isNull() const noexcept;
769 
770  /**
771  Return true if size is not null (0x0).
772  A non-null size is still invalid if its width or height are negative.
773  */
774  bool isNotNull() const noexcept;
775 
776  /**
777  Return true if size is valid (width and height are higher than zero).
778  */
779  bool isValid() const noexcept;
780 
781  /**
782  Return true if size is invalid (width or height are lower or equal to zero).
783  An invalid size might not be null under some circumstances.
784  */
785  bool isInvalid() const noexcept;
786 
787  /**
788  Draw this rectangle using the provided graphics context.
789  */
790  void draw(const GraphicsContext& context);
791 
792  /**
793  Draw lines (outline of this rectangle) using the provided graphics context, optionally specifying line width.
794  */
795  void drawOutline(const GraphicsContext& context, T lineWidth = 1);
796 
797  Rectangle<T>& operator=(const Rectangle<T>& rect) noexcept;
798  Rectangle<T>& operator*=(double m) noexcept;
799  Rectangle<T>& operator/=(double d) noexcept;
800  bool operator==(const Rectangle<T>& size) const noexcept;
801  bool operator!=(const Rectangle<T>& size) const noexcept;
802 
803  /**
804  Draw this rectangle using the current OpenGL state.
805  DEPRECATED please use draw(const GraphicsContext&) instead.
806  */
807  DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)")
808  void draw();
809 
810  /** DEPRECATED
811  Draw lines (outline of this rectangle) using the current OpenGL state.
812  DEPRECATED please use drawOutline(const GraphicsContext&,T) instead.
813  */
814  DISTRHO_DEPRECATED_BY("drawOutline(const GraphicsContext&)")
815  void drawOutline();
816 
817 private:
818  Point<T> pos;
819  Size<T> size;
820 };
821 
822 // -----------------------------------------------------------------------
823 
824 END_NAMESPACE_DGL
825 
826 #endif // DGL_GEOMETRY_HPP_INCLUDED
Rectangle::setY
void setY(const T &y) noexcept
Triangle
Definition: Geometry.hpp:29
Rectangle::setX
void setX(const T &x) noexcept
Triangle::draw
void draw()
GraphicsContext
Definition: Base.hpp:154
Circle::setNumSegments
void setNumSegments(const uint num)
Point::isZero
bool isZero() const noexcept
Circle::Circle
Circle() noexcept
Rectangle::getHeight
const T & getHeight() const noexcept
Circle::getX
const T & getX() const noexcept
Circle::draw
void draw()
Rectangle::getWidth
const T & getWidth() const noexcept
Rectangle::isValid
bool isValid() const noexcept
Rectangle::getY
const T & getY() const noexcept
Triangle::Triangle
Triangle() noexcept
Line::isNotNull
bool isNotNull() const noexcept
Line::setStartX
void setStartX(const T &x) noexcept
Rectangle::setRectangle
void setRectangle(const Point< T > &pos, const Size< T > &size) noexcept
Size
Definition: Geometry.hpp:132
Line::setEndY
void setEndY(const T &y) noexcept
Circle::drawOutline
void drawOutline()
Line::getStartY
const T & getStartY() const noexcept
Rectangle
Definition: Geometry.hpp:30
Rectangle::containsX
bool containsX(const T &x) const noexcept
Rectangle::isNull
bool isNull() const noexcept
Size::isInvalid
bool isInvalid() const noexcept
Triangle::isValid
bool isValid() const noexcept
Line::draw
void draw()
Point::getX
const T & getX() const noexcept
Line::setStartPos
void setStartPos(const T &x, const T &y) noexcept
Rectangle::contains
bool contains(const T &x, const T &y) const noexcept
Size::getWidth
const T & getWidth() const noexcept
Circle
Definition: Geometry.hpp:28
Triangle::isNotNull
bool isNotNull() const noexcept
Point::getY
const T & getY() const noexcept
Rectangle::isNotNull
bool isNotNull() const noexcept
Size::shrinkBy
void shrinkBy(double divider) noexcept
Circle::setX
void setX(const T &x) noexcept
Circle::getNumSegments
uint getNumSegments() const noexcept
Rectangle::shrinkBy
void shrinkBy(double divider) noexcept
Rectangle::containsY
bool containsY(const T &y) const noexcept
Rectangle::getSize
const Size< T > & getSize() const noexcept
Rectangle::growBy
void growBy(double multiplier) noexcept
Size::setHeight
void setHeight(const T &height) noexcept
Rectangle::draw
void draw()
Circle::getPos
const Point< T > & getPos() const noexcept
Point::moveBy
void moveBy(const T &x, const T &y) noexcept
Rectangle::setSize
void setSize(const T &width, const T &height) noexcept
Point::Point
Point() noexcept
Triangle::drawOutline
void drawOutline()
Triangle::isInvalid
bool isInvalid() const noexcept
Rectangle::drawOutline
void drawOutline()
Rectangle::Rectangle
Rectangle() noexcept
Line::moveBy
void moveBy(const T &x, const T &y) noexcept
Line::setStartY
void setStartY(const T &y) noexcept
Line
Definition: Geometry.hpp:27
Circle::setPos
void setPos(const T &x, const T &y) noexcept
Line::getEndPos
const Point< T > & getEndPos() const noexcept
Size::Size
Size() noexcept
Size::getHeight
const T & getHeight() const noexcept
Circle::getY
const T & getY() const noexcept
Point::setPos
void setPos(const T &x, const T &y) noexcept
Size::setWidth
void setWidth(const T &width) noexcept
Circle::setY
void setY(const T &y) noexcept
Circle::setSize
void setSize(const float size) noexcept
Line::Line
Line() noexcept
Rectangle::setPos
void setPos(const T &x, const T &y) noexcept
Point::setY
void setY(const T &y) noexcept
Size::setSize
void setSize(const T &width, const T &height) noexcept
Rectangle::getX
const T & getX() const noexcept
Line::setEndPos
void setEndPos(const T &x, const T &y) noexcept
Point
Definition: Geometry.hpp:40
Rectangle::setWidth
void setWidth(const T &width) noexcept
Size::growBy
void growBy(double multiplier) noexcept
Line::getEndX
const T & getEndX() const noexcept
Circle::getSize
float getSize() const noexcept
Rectangle::moveBy
void moveBy(const T &x, const T &y) noexcept
Size::isValid
bool isValid() const noexcept
Rectangle::setHeight
void setHeight(const T &height) noexcept
Size::isNull
bool isNull() const noexcept
Line::getStartX
const T & getStartX() const noexcept
Line::isNull
bool isNull() const noexcept
Line::getStartPos
const Point< T > & getStartPos() const noexcept
Rectangle::getPos
const Point< T > & getPos() const noexcept
Line::getEndY
const T & getEndY() const noexcept
Triangle::isNull
bool isNull() const noexcept
Rectangle::isInvalid
bool isInvalid() const noexcept
Point::setX
void setX(const T &x) noexcept
Size::isNotNull
bool isNotNull() const noexcept
Point::isNotZero
bool isNotZero() const noexcept
Line::setEndX
void setEndX(const T &x) noexcept