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 "../utility/utility.hpp"
11#include "../macros.hpp"
12#include <compare>
13
14hi_export_module(hikogui.geometry : axis);
15
16hi_export namespace hi {
17inline namespace v1 {
18
24enum class axis : unsigned char {
25 none = 0,
26 x = 1,
27 y = 2,
28 z = 4,
29 both = x | y,
30 all = x | y | z,
31
32 horizontal = x,
33 vertical = y,
34};
35
39[[nodiscard]] constexpr axis operator&(axis const &lhs, axis const &rhs) noexcept
40{
41 return static_cast<axis>(static_cast<unsigned char>(lhs) & static_cast<unsigned char>(rhs));
42}
43
47[[nodiscard]] constexpr axis operator|(axis const &lhs, axis const &rhs) noexcept
48{
49 return static_cast<axis>(static_cast<unsigned char>(lhs) | static_cast<unsigned char>(rhs));
50}
51
55[[nodiscard]] constexpr bool to_bool(axis const& rhs) noexcept
56{
57 return to_bool(static_cast<unsigned char>(rhs));
58}
59
60}} // namespace hi::inline v1
axis
An enumeration of the 3 axis for 3D geometry.
Definition axis.hpp:24
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20