9#include <Common/assertion.h>
10#include <Common/primitive_type.h>
19template<
typename Owner,
typename Element = real,
typename SdlValueType = TSdlValue<std::vector<math::TVector3<Element>>, Owner>>
22 static_assert(std::is_base_of_v<TSdlAbstractValue<std::vector<math::TVector3<Element>>, Owner>, SdlValueType>,
23 "SdlValueType should be a subclass of TSdlAbstractValue.");
25 static_assert(std::is_same_v<Element, real>,
26 "Currently supports only ph::real");
29 template<
typename ValueType>
31 SdlValueType(
"vector3-array",
std::move(valueName), valuePtr)
36 return "[" + std::to_string(vec3Array.size()) +
" vector3 values...]";
41 std::vector<math::TVector3<Element>>*
const vec3Vec = this->getValue(owner);
50 const auto vec3Idx = elementIdx / 3;
51 const auto compIdx = elementIdx - vec3Idx * 3;
56 const auto vec3Idx = elementIdx / 3;
57 const auto compIdx = elementIdx - vec3Idx * 3;
Data that SDL input process can rely on.
Definition SdlInputContext.h:19
Definition SdlNativeData.h:88
static auto permissiveElementSetter(SdlSetterVariant input, ElementType *out_elementPtr) -> bool
Given a valid target element, set its value in a permissive way (with auto conversions).
Definition SdlNativeData.ipp:349
std::size_t numElements
Hint for number of elements in this block of native data. For example, numElements would be 12 for an...
Definition SdlNativeData.h:99
std::size_t tupleSize
Hint for number of elements that form a natural group. For an array of 10 vec3s, tupleSize may have a...
Definition SdlNativeData.h:105
static auto permissiveElementGetter(ElementType *elementPtr) -> SdlGetterVariant
Given a valid target element, get its value in a permissive way (with auto conversions).
Definition SdlNativeData.ipp:312
ESdlDataType elementType
Hint for the type of elements.
Definition SdlNativeData.h:113
ESdlDataFormat elementContainer
Hint for the type that encapsulates elements.
Definition SdlNativeData.h:109
Carries SDL representation of various data during the output process. Helps to write output data such...
Definition SdlOutputClause.h:14
std::string value
Stores stringified data of a clause. As the output clause generator knows best how its data look like...
Definition SdlOutputClause.h:29
Data that SDL output process can rely on.
Definition SdlOutputContext.h:19
Definition SdlNativeData.h:24
Definition TSdlVector3Array.h:21
void saveToSdl(const Owner &owner, SdlOutputClause &out_clause, const SdlOutputContext &ctx) const override
Definition TSdlVector3Array.h:81
SdlNativeData ownedNativeData(Owner &owner) const override
Definition TSdlVector3Array.h:39
std::string valueAsString(const std::vector< math::TVector3< Element > > &vec3Array) const override
Definition TSdlVector3Array.h:34
void loadFromSdl(Owner &owner, const SdlInputClause &clause, const SdlInputContext &ctx) const override
Definition TSdlVector3Array.h:71
TSdlVector3Array(std::string valueName, ValueType Owner::*const valuePtr)
Definition TSdlVector3Array.h:30
Represents a 3-D vector.
Definition TVector3.h:17
std::vector< math::TVector3< Element > > load_vector3_array(std::string_view sdlVec3ArrayStr)
Definition sdl_helpers.ipp:200
void save_vector3_array(TSpanView< math::TVector3< Element > > values, std::string &out_str)
Definition sdl_helpers.ipp:383
constexpr ESdlDataType number_type_of()
Definition sdl_helpers.ipp:478
The root for all renderer implementations.
Definition EEngineProject.h:6
TAnyPtr< false > AnyNonConstPtr
A type-safe, lightweight wrapper for any non-const raw pointer type.
Definition TAnyPtr.h:47
Low-level helpers for SDL. Helpers are in an additional sdl namespace.