HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
identity.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
9#pragma once
10
11#include "matrix.hpp"
12
13namespace hi { inline namespace v1 {
14namespace geo {
15
20class identity {
21public:
22 constexpr identity(identity const&) noexcept = default;
23 constexpr identity(identity&&) noexcept = default;
24 constexpr identity& operator=(identity const&) noexcept = default;
25 constexpr identity& operator=(identity&&) noexcept = default;
26
27 constexpr identity() noexcept = default;
28
29 template<int E>
30 constexpr operator matrix<E>() const noexcept
31 {
32 return matrix<E>();
33 }
34
35 [[nodiscard]] identity operator~() const noexcept
36 {
37 return {};
38 }
39
40 template<typename O, int E>
41 [[nodiscard]] constexpr vector<O, E> operator*(vector<O, E> const& rhs) const noexcept
42 {
43 return rhs;
44 }
45
46 template<typename O, int E>
47 [[nodiscard]] constexpr point<O, E> operator*(point<O, E> const& rhs) const noexcept
48 {
49 return rhs;
50 }
51
52 [[nodiscard]] constexpr axis_aligned_rectangle operator*(axis_aligned_rectangle const& rhs) const noexcept
53 {
54 return rhs;
55 }
56
57 [[nodiscard]] constexpr rectangle operator*(rectangle const& rhs) const noexcept
58 {
59 return rhs;
60 }
61
62 template<int E>
63 [[nodiscard]] constexpr identity operator*(identity const&) const noexcept
64 {
65 return {};
66 }
67
68 [[nodiscard]] constexpr bool is_valid() const noexcept
69 {
70 return true;
71 }
72};
73
74} // namespace geo
75
79using identity2 = geo::identity;
80
84using identity3 = geo::identity;
85
86}} // namespace hi::v1
Defines geo::matrix, matrix2 and matrix3.
geo::identity identity2
2D identity transform.
Definition identity.hpp:79
@ rectangle
The gui_event has rectangle data.
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:27
Identity transform.
Definition identity.hpp:20
A 2D or 3D homogenius matrix for transforming homogenious vectors and points.
Definition matrix.hpp:33