HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
axis.hpp
Go to the documentation of this file.
1// Copyright Take Vos 2021.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
8#pragma once
9
10#include "../macros.hpp"
11namespace hi {
12inline namespace v1 {
13
19enum class axis : unsigned char {
20 none = 0,
21 x = 1,
22 y = 2,
23 z = 4,
24 both = x | y,
25 all = x | y | z,
26
27 horizontal = x,
28 vertical = y,
29};
30
34[[nodiscard]] constexpr axis operator&(axis const &lhs, axis const &rhs) noexcept
35{
36 return static_cast<axis>(static_cast<unsigned char>(lhs) & static_cast<unsigned char>(rhs));
37}
38
42[[nodiscard]] constexpr axis operator|(axis const &lhs, axis const &rhs) noexcept
43{
44 return static_cast<axis>(static_cast<unsigned char>(lhs) | static_cast<unsigned char>(rhs));
45}
46
50[[nodiscard]] constexpr bool to_bool(axis const& rhs) noexcept
51{
52 return to_bool(static_cast<unsigned char>(rhs));
53}
54
55}} // namespace hi::inline v1
axis
An enumeration of the 3 axis for 3D geometry.
Definition axis.hpp:19
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377