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 template<typename O>
53 [[nodiscard]] constexpr axis_aligned_rectangle<O> operator*(axis_aligned_rectangle<O> const& rhs) const noexcept
54 {
55 return rhs;
56 }
57
58 [[nodiscard]] constexpr rectangle operator*(rectangle const& rhs) const noexcept
59 {
60 return rhs;
61 }
62
63 template<int E>
64 [[nodiscard]] constexpr identity operator*(identity const&) const noexcept
65 {
66 return {};
67 }
68
69 [[nodiscard]] constexpr bool is_valid() const noexcept
70 {
71 return true;
72 }
73};
74
75} // namespace geo
76
80using identity2 = geo::identity;
81
85using identity3 = geo::identity;
86
87}} // namespace hi::v1
Defines geo::matrix, matrix2 and matrix3.
geo::identity identity2
2D identity transform.
Definition identity.hpp:80
@ 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:26
Identity transform.
Definition identity.hpp:20
A 2D or 3D homogenius matrix for transforming homogenious vectors and points.
Definition matrix.hpp:33