2#include <ossia/network/dataspace/dataspace_base.hpp>
3#include <ossia/network/domain/domain_base_impl.hpp>
10template <
typename Impl>
11struct orientation_unit
13 using is_unit = std::true_type;
14 using is_multidimensional = std::true_type;
15 using dataspace_type = orientation_u;
16 using neutral_unit = quaternion_u;
17 using concrete_type = Impl;
20struct OSSIA_EXPORT quaternion_u :
public orientation_unit<quaternion_u>
22 static constexpr auto text()
24 constexpr_return(ossia::make_string_array(
"quaternion",
"quat"));
26 static constexpr auto array_parameters()
28 constexpr_return(ossia::make_string_view(
"abcd"));
30 static constexpr auto units()
32 constexpr_return(ossia::make_string_array(
33 "distance.m",
"distance.m",
"distance.m",
"distance.m"));
35 using value_type = vec4f;
36 static constexpr strong_value<neutral_unit>
37 to_neutral(strong_value<concrete_type> self)
42 static constexpr value_type from_neutral(strong_value<neutral_unit> self)
44 return self.dataspace_value;
47 static ossia::vecf_domain<4> domain()
49 return vecf_domain<4>{
50 ossia::make_vec(0.f, 0.f, 0.f, 0.f), ossia::make_vec(1.f, 1.f, 1.f, 1.f)};
53 static constexpr auto bounding() {
return ossia::bounding_mode::FREE; }
56struct OSSIA_EXPORT euler_u :
public orientation_unit<euler_u>
58 static constexpr auto text()
60 constexpr_return(ossia::make_string_array(
"euler",
"ypr"));
62 static constexpr auto array_parameters()
64 constexpr_return(ossia::make_string_view(
"ypr"));
66 static constexpr auto units()
69 ossia::make_string_array(
"angle.degree",
"angle.degree",
"angle.degree"));
71 using value_type = vec3f;
73 static strong_value<neutral_unit> to_neutral(strong_value<concrete_type> self);
75 static value_type from_neutral(strong_value<neutral_unit> self);
77 static ossia::vecf_domain<3> domain()
79 return vecf_domain<3>{
80 ossia::make_vec(0.f, 0.f, 0.f), ossia::make_vec(360.f, 360.f, 360.f)};
85struct OSSIA_EXPORT axis_u :
public orientation_unit<axis_u>
87 static constexpr auto text()
89 constexpr_return(ossia::make_string_array(
"axis",
"xyzw"));
91 static constexpr auto array_parameters()
93 constexpr_return(ossia::make_string_view(
"xyzw"));
95 static constexpr auto units()
97 constexpr_return(ossia::make_string_array(
98 "distance.m",
"distance.m",
"distance.m",
"angle.degree"));
100 using value_type = vec4f;
102 static strong_value<neutral_unit> to_neutral(strong_value<concrete_type> self);
104 static value_type from_neutral(strong_value<neutral_unit> self);
106 static ossia::vecf_domain<4> domain()
108 return vecf_domain<4>{
109 ossia::make_vec(0.f, 0.f, 0.f, 0.f), ossia::make_vec(1.f, 1.f, 1.f, 360.f)};
112 static constexpr auto bounding() {
return ossia::bounding_mode::FREE; }