32#ifndef DOXYGEN_SHOULD_SKIP_THIS
121 return radius ==
T(0);
132 return gf::squareDistance(center, point) <=
gf::square(radius);
143 return gf::squareDistance(center, other.center) <=
gf::square(radius + other.radius);
152 return this->center - gf::diry(this->radius);
161 return this->center + gf::diry(this->radius);
170 return this->center - gf::dirx(this->radius);
179 return this->center + gf::dirx(this->radius);
230 extern template struct GF_CORE_API
Circ<int>;
270 template<
typename Archive,
typename T>
275#ifndef DOXYGEN_SHOULD_SKIP_THIS
constexpr T square(T val)
Square function.
Definition: Math.h:299
constexpr ZeroType Zero
Constant to represent "zero".
Definition: Types.h:93
The namespace for gf classes.
Utility class for manipulating circles.
Definition: Circ.h:61
constexpr Circ() noexcept
Default constructor.
Definition: Circ.h:71
bool operator==(const Circ< T > &lhs, const Circ< T > &rhs)
Equality operator.
Definition: Circ.h:244
constexpr T getRadius() const noexcept
Get the radius of the circle.
Definition: Circ.h:109
Vector< T, 2 > center
Center of the circle.
Definition: Circ.h:62
constexpr Vector< T, 2 > getBottom() const noexcept
Get the bottom of the circle.
Definition: Circ.h:160
T radius
Radius of the circle.
Definition: Circ.h:63
constexpr Vector< T, 2 > getLeft() const noexcept
Get the left of the circle.
Definition: Circ.h:169
bool intersects(const Circ &other) const noexcept
Check the intersection between two circles.
Definition: Circ.h:142
Archive & operator|(Archive &ar, Circ< T > &circ)
Serialize a circle.
Definition: Circ.h:271
constexpr Vector< T, 2 > getRight() const noexcept
Get the right of the circle.
Definition: Circ.h:178
bool operator!=(const Circ< T > &lhs, const Circ< T > &rhs)
Inequality operator.
Definition: Circ.h:258
constexpr Circ(const Vector< T, 2 > &circCenter, T circRadius) noexcept
Construct the circle from center and radius.
Definition: Circ.h:83
constexpr Vector< T, 2 > getTop() const noexcept
Get the top of the circle.
Definition: Circ.h:151
constexpr Vector< T, 2 > getCenter() const noexcept
Get the center of the circle.
Definition: Circ.h:97
constexpr bool isEmpty() const noexcept
Check if the circle is empty.
Definition: Circ.h:120
bool contains(const Vector< T, 2 > &point) const noexcept
Check if a point is insied a circle's area.
Definition: Circ.h:131
A 2D vector.
Definition: Vector.h:316