27 #include "Portability.h" 29 #include "VectorOps.h" 32 #ifndef DOXYGEN_SHOULD_SKIP_THIS 111 Circ& operator=(
const Circ&) =
default;
154 return { center.
x, center.
y - radius };
163 return { center.
x, center.
y + radius };
172 return { center.
x - radius, center.
y };
181 return { center.
x + radius, center.
y };
192 return gf::squareDistance(center, point) <=
gf::square(radius);
203 return gf::squareDistance(center, other.center) <=
gf::square(radius + other.radius);
284 template<
typename Archive,
typename T>
289 #ifndef DOXYGEN_SHOULD_SKIP_THIS T x
First coordinate in the (x,y) representation.
Definition: Vector.h:509
Archive & operator|(Archive &ar, Circ< T > &circ)
Serialize a circle.
Definition: Circ.h:285
T radius
Radius of the circle.
Definition: Circ.h:75
constexpr Vector< T, 2 > getBottom() const noexcept
Get the bottom of the circle.
Definition: Circ.h:162
constexpr T getRadius() const noexcept
Get the radius of the circle.
Definition: Circ.h:133
constexpr Vector< T, 2 > getLeft() const noexcept
Get the left of the circle.
Definition: Circ.h:171
constexpr Vector< T, 2 > getTop() const noexcept
Get the top of the circle.
Definition: Circ.h:153
bool intersects(const Circ< T > &other) const noexcept
Check the intersection between two circles.
Definition: Circ.h:202
constexpr Circ() noexcept
Default constructor.
Definition: Circ.h:83
bool operator==(const Circ< T > &lhs, const Circ< T > &rhs)
Equality operator.
Definition: Circ.h:258
T y
Second coordinate in the (x,y) representation.
Definition: Vector.h:520
constexpr T square(T val)
Square function.
Definition: Math.h:275
Utility class for manipulating circles.
Definition: Circ.h:73
constexpr Vector< T, 2 > getRight() const noexcept
Get the right of the circle.
Definition: Circ.h:180
constexpr bool isEmpty() const noexcept
Check if the circle is empty.
Definition: Circ.h:144
bool operator!=(const Circ< T > &lhs, const Circ< T > &rhs)
Inequality operator.
Definition: Circ.h:272
The namespace for gf classes.
Definition: Action.h:35
bool contains(const Vector< T, 2 > &point) const noexcept
Check if a point is insied a circle's area.
Definition: Circ.h:191
A 2D vector.
Definition: Vector.h:316
constexpr Vector< T, 2 > getCenter() const noexcept
Get the center of the circle.
Definition: Circ.h:121
Vector< T, 2 > center
Center of the circle.
Definition: Circ.h:74
constexpr Circ(const Vector< T, 2 > &circCenter, T circRadius) noexcept
Construct the circle from center and radius.
Definition: Circ.h:96