17 #ifndef DGL_GEOMETRY_HPP_INCLUDED
18 #define DGL_GEOMETRY_HPP_INCLUDED
27 template<
typename>
class Line;
51 Point(
const T& x,
const T& y) noexcept;
61 const T&
getX()
const noexcept;
66 const T&
getY()
const noexcept;
71 void setX(
const T& x) noexcept;
76 void setY(
const T& y) noexcept;
81 void setPos(
const T& x,
const T& y) noexcept;
91 void moveBy(
const T& x,
const T& y) noexcept;
101 bool isZero()
const noexcept;
113 bool operator==(
const Point<T>& pos)
const noexcept;
114 bool operator!=(
const Point<T>& pos)
const noexcept;
118 template<
typename>
friend class Line;
119 template<
typename>
friend class Circle;
120 template<
typename>
friend class Triangle;
121 template<
typename>
friend class Rectangle;
143 Size(
const T& width,
const T& height) noexcept;
163 void setWidth(
const T& width) noexcept;
168 void setHeight(
const T& height) noexcept;
173 void setSize(
const T& width,
const T& height) noexcept;
183 void growBy(
double multiplier) noexcept;
188 void shrinkBy(
double divider) noexcept;
194 bool isNull()
const 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;
229 template<
typename>
friend class Rectangle;
251 Line(const T& startX, const T& startY, const T& endX, const T& endY) noexcept;
256 Line(const T& startX, const T& startY, const
Point<T>& endPos) noexcept;
261 Line(const
Point<T>& startPos, const T& endX, const T& endY) noexcept;
286 const T&
getEndX() const noexcept;
291 const T&
getEndY() const noexcept;
326 void setEndX(const T& x) noexcept;
331 void setEndY(const T& y) noexcept;
336 void setEndPos(const T& x, const T& y) noexcept;
346 void moveBy(const T& x, const T& y) noexcept;
356 bool isNull() const noexcept;
363 #ifndef DPF_TEST_POINT_CPP
371 bool operator==(
const Line<T>& line)
const noexcept;
372 bool operator!=(
const Line<T>& line)
const noexcept;
374 #ifndef DPF_TEST_POINT_CPP
379 DISTRHO_DEPRECATED_BY(
"draw(const GraphicsContext&)")
409 Circle(const T& x, const T& y, const
float size, const uint numSegments = 300);
414 Circle(const
Point<T>& pos, const
float size, const uint numSegments = 300);
424 const T&
getX() const noexcept;
429 const T&
getY() const noexcept;
439 void setX(const T& x) noexcept;
444 void setY(const T& y) noexcept;
449 void setPos(const T& x, const T& y) noexcept;
459 float getSize() const noexcept;
465 void setSize(const
float size) noexcept;
489 bool operator==(const
Circle<T>& cir) const noexcept;
490 bool operator!=(const
Circle<T>& cir) const noexcept;
492 #ifndef DPF_TEST_POINT_CPP
497 DISTRHO_DEPRECATED_BY(
"draw(const GraphicsContext&)")
514 float fTheta, fCos, fSin;
536 Triangle(const T& x1, const T& y1, const T& x2, const T& y2, const T& x3, const T& y3) noexcept;
552 bool isNull() const noexcept;
582 bool operator==(const
Triangle<T>& tri) const noexcept;
583 bool operator!=(const
Triangle<T>& tri) const noexcept;
585 #ifndef DPF_TEST_POINT_CPP
590 DISTRHO_DEPRECATED_BY(
"draw(const GraphicsContext&)")
624 Rectangle(const T& x, const T& y, const T& width, const T& height) noexcept;
629 Rectangle(const T& x, const T& y, const
Size<T>& size) noexcept;
634 Rectangle(const
Point<T>& pos, const T& width, const T& height) noexcept;
649 const T&
getX() const noexcept;
654 const T&
getY() const noexcept;
679 void setX(const T& x) noexcept;
684 void setY(const T& y) noexcept;
689 void setPos(const T& x, const T& y) noexcept;
699 void moveBy(const T& x, const T& y) noexcept;
709 void setWidth(const T& width) noexcept;
714 void setHeight(const T& height) noexcept;
719 void setSize(const T& width, const T& height) noexcept;
729 void growBy(
double multiplier) noexcept;
734 void shrinkBy(
double divider) noexcept;
749 bool contains(const T& x, const T& y) const noexcept;
759 template<typename T2>
765 bool containsX(const T& x) const noexcept;
770 bool containsY(const T& y) const noexcept;
776 bool isNull() const noexcept;
806 Rectangle<T>& operator*=(
double m) noexcept;
807 Rectangle<T>& operator/=(
double d) noexcept;
808 bool operator==(const
Rectangle<T>& size) const noexcept;
809 bool operator!=(const
Rectangle<T>& size) const noexcept;
834 #endif // DGL_GEOMETRY_HPP_INCLUDED
void setY(const T &y) noexcept
Definition: Geometry.hpp:29
void setX(const T &x) noexcept
void setNumSegments(const uint num)
bool isZero() const noexcept
const T & getHeight() const noexcept
const T & getX() const noexcept
const T & getWidth() const noexcept
bool isValid() const noexcept
const T & getY() const noexcept
bool isNotNull() const noexcept
void setStartX(const T &x) noexcept
void setRectangle(const Point< T > &pos, const Size< T > &size) noexcept
Definition: Geometry.hpp:132
void setEndY(const T &y) noexcept
const T & getStartY() const noexcept
Definition: Geometry.hpp:30
bool containsX(const T &x) const noexcept
bool isNull() const noexcept
bool isInvalid() const noexcept
bool isValid() const noexcept
const T & getX() const noexcept
void setStartPos(const T &x, const T &y) noexcept
bool contains(const T &x, const T &y) const noexcept
const T & getWidth() const noexcept
Definition: Geometry.hpp:28
bool isNotNull() const noexcept
const T & getY() const noexcept
bool isNotNull() const noexcept
void shrinkBy(double divider) noexcept
void setX(const T &x) noexcept
uint getNumSegments() const noexcept
void shrinkBy(double divider) noexcept
bool containsY(const T &y) const noexcept
const Size< T > & getSize() const noexcept
void growBy(double multiplier) noexcept
void setHeight(const T &height) noexcept
const Point< T > & getPos() const noexcept
void moveBy(const T &x, const T &y) noexcept
void setSize(const T &width, const T &height) noexcept
bool isInvalid() const noexcept
void moveBy(const T &x, const T &y) noexcept
void setStartY(const T &y) noexcept
Definition: Geometry.hpp:27
void setPos(const T &x, const T &y) noexcept
const Point< T > & getEndPos() const noexcept
const T & getHeight() const noexcept
const T & getY() const noexcept
void setPos(const T &x, const T &y) noexcept
void setWidth(const T &width) noexcept
void setY(const T &y) noexcept
void setSize(const float size) noexcept
void setPos(const T &x, const T &y) noexcept
void setY(const T &y) noexcept
void setSize(const T &width, const T &height) noexcept
const T & getX() const noexcept
void setEndPos(const T &x, const T &y) noexcept
Definition: Geometry.hpp:40
void setWidth(const T &width) noexcept
void growBy(double multiplier) noexcept
const T & getEndX() const noexcept
float getSize() const noexcept
void moveBy(const T &x, const T &y) noexcept
bool isValid() const noexcept
void setHeight(const T &height) noexcept
bool isNull() const noexcept
const T & getStartX() const noexcept
bool isNull() const noexcept
const Point< T > & getStartPos() const noexcept
const Point< T > & getPos() const noexcept
const T & getEndY() const noexcept
bool isNull() const noexcept
bool isInvalid() const noexcept
void setX(const T &x) noexcept
bool isNotNull() const noexcept
bool isNotZero() const noexcept
void setEndX(const T &x) noexcept