13#include "../macros.hpp"
17hi_export_module(hikogui.geometry : circle);
19hi_export
namespace hi {
inline namespace v1 {
25 using array_type =
f32x4;
34 hi_axiom(holds_invariant());
39 hi_axiom(holds_invariant());
50 hi_axiom(holds_invariant());
56 hi_axiom(holds_invariant());
65 hi_axiom(holds_invariant());
68 [[
nodiscard]]
constexpr bool empty()
const noexcept
70 return _v.w() == 0.0f;
78 [[
nodiscard]]
constexpr float radius()
const noexcept
83 [[
nodiscard]]
constexpr float diameter()
const noexcept
85 return radius() * 2.0f;
88 [[
nodiscard]]
constexpr point3 center()
const noexcept
90 return point3{_v.xyz1()};
95 return circle{lhs._v +
f32x4{0.0f, 0.0f, 0.0f, rhs}};
100 return circle{lhs._v -
f32x4{0.0f, 0.0f, 0.0f, rhs}};
105 return circle{lhs._v *
f32x4{1.0f, 1.0f, 1.0f, rhs}};
108 [[
nodiscard]]
constexpr friend point3 midpoint(
circle const& rhs)
noexcept
110 return point3{rhs.center()};
115 auto const p = rhs._v.xyxy();
167 return _v.w() >= 0.0f;
@ middle
Align to the vertical-middle.
@ bottom
Align to the bottom.
@ right
Align the text to the right side.
@ left
Align the text to the left side.
@ center
Align the text in the center.
@ other
The gui_event does not have associated data.
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
Class which represents an axis-aligned rectangle.
Definition aarectangle.hpp:33
Horizontal/Vertical alignment combination.
Definition alignment.hpp:244
A type defining a 2D circle.
Definition circle.hpp:23
friend constexpr circle align(aarectangle haystack, circle needle, alignment alignment) noexcept
Align a rectangle within another rectangle.
Definition circle.hpp:126