Dusk Audio Framework
Loading...
Searching...
No Matches
Geometry.hpp
1/*
2 * DISTRHO Plugin Framework (DPF)
3 * Copyright (C) 2012-2025 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
22START_NAMESPACE_DGL
23
24// --------------------------------------------------------------------------------------------------------------------
25// Forward class names
26
27template<typename> class Line;
28template<typename> class Circle;
29template<typename> class Triangle;
30template<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 */
39template<typename T>
40class Point
41{
42public:
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
116private:
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 */
131template<typename T>
132class Size
133{
134public:
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 Size<T> operator*(double m) const noexcept;
223 Size<T> operator/(double m) const noexcept;
224 bool operator==(const Size<T>& size) const noexcept;
225 bool operator!=(const Size<T>& size) const noexcept;
226
227private:
228 T fWidth, fHeight;
229 template<typename> friend class Rectangle;
230};
231
232// -----------------------------------------------------------------------
233
234/**
235 DGL Line class.
236
237 This class describes a line, defined by two points.
238 */
239template<typename T>
240class Line
241{
242public:
243 /**
244 Constructor for a null line ([0,0] to [0,0]).
245 */
246 Line() noexcept;
247
248 /**
249 Constructor using custom start X, start Y, end X and end Y values.
250 */
251 Line(const T& startX, const T& startY, const T& endX, const T& endY) noexcept;
252
253 /**
254 Constructor using custom start X, start Y and end pos values.
255 */
256 Line(const T& startX, const T& startY, const Point<T>& endPos) noexcept;
257
258 /**
259 Constructor using custom start pos, end X and end Y values.
260 */
261 Line(const Point<T>& startPos, const T& endX, const T& endY) noexcept;
262
263 /**
264 Constructor using custom start and end pos values.
265 */
266 Line(const Point<T>& startPos, const Point<T>& endPos) noexcept;
267
268 /**
269 Constructor using another Line class values.
270 */
271 Line(const Line<T>& line) noexcept;
272
273 /**
274 Get start X value.
275 */
276 const T& getStartX() const noexcept;
277
278 /**
279 Get start Y value.
280 */
281 const T& getStartY() const noexcept;
282
283 /**
284 Get end X value.
285 */
286 const T& getEndX() const noexcept;
287
288 /**
289 Get end Y value.
290 */
291 const T& getEndY() const noexcept;
292
293 /**
294 Get start position.
295 */
296 const Point<T>& getStartPos() const noexcept;
297
298 /**
299 Get end position.
300 */
301 const Point<T>& getEndPos() const noexcept;
302
303 /**
304 Set start X value to @a x.
305 */
306 void setStartX(const T& x) noexcept;
307
308 /**
309 Set start Y value to @a y.
310 */
311 void setStartY(const T& y) noexcept;
312
313 /**
314 Set start X and Y values to @a x and @a y respectively.
315 */
316 void setStartPos(const T& x, const T& y) noexcept;
317
318 /**
319 Set start X and Y values according to @a pos.
320 */
321 void setStartPos(const Point<T>& pos) noexcept;
322
323 /**
324 Set end X value to @a x.
325 */
326 void setEndX(const T& x) noexcept;
327
328 /**
329 Set end Y value to @a y.
330 */
331 void setEndY(const T& y) noexcept;
332
333 /**
334 Set end X and Y values to @a x and @a y respectively.
335 */
336 void setEndPos(const T& x, const T& y) noexcept;
337
338 /**
339 Set end X and Y values according to @a pos.
340 */
341 void setEndPos(const Point<T>& pos) noexcept;
342
343 /**
344 Move this line by @a x and @a y values.
345 */
346 void moveBy(const T& x, const T& y) noexcept;
347
348 /**
349 Move this line by @a pos.
350 */
351 void moveBy(const Point<T>& pos) noexcept;
352
353 /**
354 Return true if line is null (start and end pos are equal).
355 */
356 bool isNull() const noexcept;
357
358 /**
359 Return true if line is not null (start and end pos are different).
360 */
361 bool isNotNull() const noexcept;
362
363 /**
364 Draw this line using the provided graphics context, optionally specifying line width.
365 */
366 void draw(const GraphicsContext& context, T width = 1);
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 #ifdef DGL_ALLOW_DEPRECATED_METHODS
373 /**
374 Draw this line using the current OpenGL state.@n
375 DEPRECATED Please use draw(const GraphicsContext&) instead.
376 */
377 DAF_DEPRECATED_BY("draw(const GraphicsContext&)")
378 void draw();
379 #endif
380
381private:
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 */
395template<typename T>
397{
398public:
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 #ifdef DGL_ALLOW_DEPRECATED_METHODS
491 /**
492 Draw this circle using the current OpenGL state.@n
493 DEPRECATED Please use draw(const GraphicsContext&) instead.
494 */
495 DAF_DEPRECATED_BY("draw(const GraphicsContext&)")
496 void draw();
497
498 /**
499 Draw lines (outline of this circle) using the current OpenGL state.@n
500 DEPRECATED Please use drawOutline(const GraphicsContext&,T) instead.
501 */
502 DAF_DEPRECATED_BY("drawOutline(const GraphicsContext&)")
504 #endif
505
506private:
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 */
522template<typename T>
524{
525public:
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 #ifdef DGL_ALLOW_DEPRECATED_METHODS
584 /**
585 Draw this triangle using the current OpenGL state.@n
586 DEPRECATED Please use draw(const GraphicsContext&) instead.
587 */
588 DAF_DEPRECATED_BY("draw(const GraphicsContext&)")
589 void draw();
590
591 /**
592 Draw lines (outline of this triangle) using the current OpenGL state.@n
593 DEPRECATED Please use drawOutline(const GraphicsContext&,T) instead.
594 */
595 DAF_DEPRECATED_BY("drawOutline(const GraphicsContext&)")
597 #endif
598
599private:
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 */
610template<typename T>
612{
613public:
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 the point @a pos affected by a custom scale.
756 */
757 bool containsAfterScaling(const Point<T>& pos, double scaling) const noexcept;
758
759 /**
760 Check if this rectangle contains the point @a pos of another type.
761 */
762 template<typename T2>
763 bool contains(const Point<T2>& pos) const noexcept;
764
765 /**
766 Check if this rectangle contains X.
767 */
768 bool containsX(const T& x) const noexcept;
769
770 /**
771 Check if this rectangle contains Y.
772 */
773 bool containsY(const T& y) const noexcept;
774
775 /**
776 Return true if size is null (0x0).
777 An null size is also invalid.
778 */
779 bool isNull() const noexcept;
780
781 /**
782 Return true if size is not null (0x0).
783 A non-null size is still invalid if its width or height are negative.
784 */
785 bool isNotNull() const noexcept;
786
787 /**
788 Return true if size is valid (width and height are higher than zero).
789 */
790 bool isValid() const noexcept;
791
792 /**
793 Return true if size is invalid (width or height are lower or equal to zero).
794 An invalid size might not be null under some circumstances.
795 */
796 bool isInvalid() const noexcept;
797
798 /**
799 Draw this rectangle using the provided graphics context.
800 */
801 void draw(const GraphicsContext& context);
802
803 /**
804 Draw lines (outline of this rectangle) using the provided graphics context, optionally specifying line width.
805 */
806 void drawOutline(const GraphicsContext& context, T lineWidth = 1);
807
808 Rectangle<T>& operator=(const Rectangle<T>& rect) noexcept;
809 Rectangle<T>& operator*=(double m) noexcept;
810 Rectangle<T>& operator/=(double d) noexcept;
811 bool operator==(const Rectangle<T>& size) const noexcept;
812 bool operator!=(const Rectangle<T>& size) const noexcept;
813
814 #ifdef DGL_ALLOW_DEPRECATED_METHODS
815 /**
816 Draw this rectangle using the current OpenGL state.@n
817 DEPRECATED Please use draw(const GraphicsContext&) instead.
818 */
819 DAF_DEPRECATED_BY("draw(const GraphicsContext&)")
820 void draw();
821
822 /**
823 Draw lines (outline of this rectangle) using the current OpenGL state.@n
824 DEPRECATED Please use drawOutline(const GraphicsContext&,T) instead.
825 */
826 DAF_DEPRECATED_BY("drawOutline(const GraphicsContext&)")
828 #endif
829
830private:
831 Point<T> pos;
832 Size<T> size;
833};
834
835// -----------------------------------------------------------------------
836
837END_NAMESPACE_DGL
838
839#endif // DGL_GEOMETRY_HPP_INCLUDED
Definition Geometry.hpp:397
void setSize(const float size) noexcept
void setY(const T &y) noexcept
void setPos(const T &x, const T &y) noexcept
void draw(const GraphicsContext &context)
void setNumSegments(const uint num)
uint getNumSegments() const noexcept
const T & getX() const noexcept
Circle() noexcept
float getSize() const noexcept
const Point< T > & getPos() const noexcept
void drawOutline(const GraphicsContext &context, T lineWidth=1)
const T & getY() const noexcept
void setX(const T &x) noexcept
Definition Geometry.hpp:241
const T & getStartY() const noexcept
void setEndY(const T &y) noexcept
const T & getStartX() const noexcept
void setEndX(const T &x) noexcept
const T & getEndY() const noexcept
void moveBy(const T &x, const T &y) noexcept
const T & getEndX() const noexcept
const Point< T > & getEndPos() const noexcept
Line() noexcept
void setStartPos(const T &x, const T &y) noexcept
bool isNull() const noexcept
bool isNotNull() const noexcept
void setStartX(const T &x) noexcept
const Point< T > & getStartPos() const noexcept
void setStartY(const T &y) noexcept
void setEndPos(const T &x, const T &y) noexcept
void draw(const GraphicsContext &context, T width=1)
Definition Geometry.hpp:41
void setX(const T &x) noexcept
const T & getY() const noexcept
void moveBy(const T &x, const T &y) noexcept
const T & getX() const noexcept
bool isZero() const noexcept
void setY(const T &y) noexcept
void setPos(const T &x, const T &y) noexcept
Point() noexcept
bool isNotZero() const noexcept
Definition Geometry.hpp:612
void moveBy(const T &x, const T &y) noexcept
void growBy(double multiplier) noexcept
bool contains(const T &x, const T &y) const noexcept
const T & getX() const noexcept
const Size< T > & getSize() const noexcept
void shrinkBy(double divider) noexcept
void setRectangle(const Point< T > &pos, const Size< T > &size) noexcept
void draw(const GraphicsContext &context)
bool isValid() const noexcept
bool containsY(const T &y) const noexcept
bool isNotNull() const noexcept
const T & getY() const noexcept
bool isInvalid() const noexcept
void setPos(const T &x, const T &y) noexcept
const T & getHeight() const noexcept
void setHeight(const T &height) noexcept
void setSize(const T &width, const T &height) noexcept
bool containsX(const T &x) const noexcept
void setWidth(const T &width) noexcept
bool containsAfterScaling(const Point< T > &pos, double scaling) const noexcept
const T & getWidth() const noexcept
void drawOutline(const GraphicsContext &context, T lineWidth=1)
void setY(const T &y) noexcept
Rectangle() noexcept
const Point< T > & getPos() const noexcept
bool isNull() const noexcept
void setX(const T &x) noexcept
Definition Geometry.hpp:133
bool isValid() const noexcept
void setHeight(const T &height) noexcept
bool isNotNull() const noexcept
const T & getWidth() const noexcept
void setSize(const T &width, const T &height) noexcept
void setWidth(const T &width) noexcept
bool isNull() const noexcept
bool isInvalid() const noexcept
void shrinkBy(double divider) noexcept
void growBy(double multiplier) noexcept
Size() noexcept
const T & getHeight() const noexcept
Definition Geometry.hpp:524
bool isNull() const noexcept
void drawOutline(const GraphicsContext &context, T lineWidth=1)
void draw(const GraphicsContext &context)
bool isValid() const noexcept
bool isInvalid() const noexcept
bool isNotNull() const noexcept
Triangle() noexcept
Definition Base.hpp:287