3#include "MRViewer/exports.h"
30 struct BoundedValue<std::string>
34 std::optional<std::vector<std::string>> allowedValues;
46 using UnderlyingValueType = std::conditional_t<std::is_floating_point_v<T>, double, std::conditional_t<std::is_signed_v<T>, std::int64_t, std::uint64_t>>;
51[[nodiscard]] MRVIEWER_API
bool createButton( std::string_view name );
60template <AllowedValueType T>
61requires std::is_arithmetic_v<T>
62[[nodiscard]] std::optional<T>
createValue( std::string_view name, T value, T min, T max )
66 min = std::numeric_limits<T>::lowest();
67 max = std::numeric_limits<T>::max();
71 static_assert(
sizeof(T) <=
sizeof(U),
"The used type is too large.");
74 return ret ? std::optional<T>( T( *ret ) ) : std::nullopt;
77[[nodiscard]] MRVIEWER_API std::optional<std::string>
createValue( std::string_view name, std::string value, std::optional<std::vector<std::string>> allowedValues = std::nullopt );
83template <AllowedValueType T>
87 return ret ? std::optional<T>( T( *ret ) ) : std::nullopt;
91MRVIEWER_API
void pushTree( std::string_view name );
105 template <
typename T>
120 template <std::same_as<std::
string> T>
140 std::map<std::string, Entry, std::less<>>
elems;
145 std::variant<ButtonEntry, ValueEntry, GroupEntry>
value;
Definition MRUITestEngine.h:54
MRVIEWER_API std::optional< T > createValueLow(std::string_view name, std::optional< BoundedValue< T > > value)
std::conditional_t< std::is_floating_point_v< T >, double, std::conditional_t< std::is_signed_v< T >, std::int64_t, std::uint64_t > > UnderlyingValueType
Definition MRUITestEngine.h:46
Definition MRUITestEngine.h:18
std::optional< T > createValue(std::string_view name, T value, T min, T max)
Definition MRUITestEngine.h:62
MRVIEWER_API bool createButton(std::string_view name)
std::optional< T > createValueTentative(std::string_view name)
Definition MRUITestEngine.h:84
MRVIEWER_API const GroupEntry & getRootEntry()
MRVIEWER_API void popTree()
MRVIEWER_API void pushTree(std::string_view name)
Definition MRUITestEngine.h:97
bool simulateClick
Definition MRUITestEngine.h:99
Definition MRUITestEngine.h:144
std::variant< ButtonEntry, ValueEntry, GroupEntry > value
Definition MRUITestEngine.h:145
bool visitedOnThisFrame
Definition MRUITestEngine.h:149
Definition MRUITestEngine.h:138
std::map< std::string, Entry, std::less<> > elems
Definition MRUITestEngine.h:140
Value()
Definition MRUITestEngine.h:131
std::optional< std::string > simulatedValue
Definition MRUITestEngine.h:129
std::string value
Definition MRUITestEngine.h:124
std::optional< std::vector< std::string > > allowedValues
Definition MRUITestEngine.h:126
Definition MRUITestEngine.h:107
Value()
Definition MRUITestEngine.h:118
T max
Definition MRUITestEngine.h:113
T value
Definition MRUITestEngine.h:109
T min
Definition MRUITestEngine.h:112
std::optional< T > simulatedValue
Definition MRUITestEngine.h:116
Definition MRUITestEngine.h:104
std::variant< Value< std::int64_t >, Value< std::uint64_t >, Value< double >, Value< std::string > > ValueVar
Definition MRUITestEngine.h:133
ValueVar value
Definition MRUITestEngine.h:134
Definition MRUITestEngine.h:24
T min
Definition MRUITestEngine.h:26
T max
Definition MRUITestEngine.h:27
T value
Definition MRUITestEngine.h:25