HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
identity.hpp
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
5#pragma once
6
7#include "matrix.hpp"
8
9namespace hi::inline v1::geo {
10
11class identity {
12public:
13 constexpr identity(identity const &) noexcept = default;
14 constexpr identity(identity &&) noexcept = default;
15 constexpr identity &operator=(identity const &) noexcept = default;
16 constexpr identity &operator=(identity &&) noexcept = default;
17
18 constexpr identity() noexcept = default;
19
20 template<int E>
21 constexpr operator matrix<E>() const noexcept
22 {
23 return matrix<E>();
24 }
25
26 [[nodiscard]] identity operator~() const noexcept
27 {
28 return {};
29 }
30
31 template<int E>
32 [[nodiscard]] constexpr vector<E> operator*(vector<E> const &rhs) const noexcept
33 {
34 return rhs;
35 }
36
37 template<int E>
38 [[nodiscard]] constexpr point<E> operator*(point<E> const &rhs) const noexcept
39 {
40 return rhs;
41 }
42
43 [[nodiscard]] constexpr color operator*(color const &rhs) const noexcept
44 {
45 return rhs;
46 }
47
48 [[nodiscard]] constexpr axis_aligned_rectangle operator*(axis_aligned_rectangle const &rhs) const noexcept
49 {
50 return rhs;
51 }
52
53 [[nodiscard]] constexpr rectangle operator*(rectangle const &rhs) const noexcept
54 {
55 return rhs;
56 }
57
58 template<int E>
59 [[nodiscard]] constexpr identity operator*(identity const &) const noexcept
60 {
61 return {};
62 }
63
64 [[nodiscard]] constexpr bool is_valid() const noexcept
65 {
66 return true;
67 }
68};
69
70} // namespace hi::inline v1::geo
This is a RGBA floating point color.
Definition color.hpp:37
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:20
Definition identity.hpp:11
A rectangle / parallelogram in 3D space.
Definition rectangle.hpp:20