3#include <ossia/network/dataspace/dataspace_base.hpp>
4#include <ossia/network/domain/domain_base_impl.hpp>
9template <
typename Impl>
12 using is_unit = std::true_type;
13 using neutral_unit = radian_u;
14 using value_type = float;
15 using concrete_type = Impl;
16 using dataspace_type = angle_u;
17 using is_multidimensional = std::false_type;
20struct OSSIA_EXPORT radian_u :
public angle_unit<radian_u>
22 static constexpr auto text()
24 constexpr_return(ossia::make_string_array(
"radian",
"rad"));
27 static constexpr strong_value<neutral_unit>
28 to_neutral(strong_value<concrete_type> self)
33 static constexpr value_type from_neutral(strong_value<neutral_unit> self)
35 return self.dataspace_value;
38 static ossia::domain_base<float> domain() {
return {0.f, float(ossia::two_pi)}; }
43struct OSSIA_EXPORT degree_u :
public angle_unit<degree_u>
45 static constexpr auto text()
47 constexpr_return(ossia::make_string_array(
"degree",
"deg"));
50 static constexpr strong_value<neutral_unit>
51 to_neutral(strong_value<concrete_type> self)
53 return {self.dataspace_value * float(ossia::deg_to_rad)};
56 static constexpr value_type from_neutral(strong_value<neutral_unit> self)
58 return self.dataspace_value * float(ossia::rad_to_deg);
61 static ossia::domain_base<float> domain() {
return {0.f, 360.f}; }