3 #include "CesiumGltf/PropertyArrayView.h"
4 #include "CesiumGltf/PropertyType.h"
10 #include <type_traits>
57 template <glm::length_t n,
typename T, glm::qualifier P>
65 template <glm::length_t n,
typename T, glm::qualifier P>
100 template <
typename T>
141 template <
typename T>
145 template <
typename T>
155 #pragma region Scalar Property Types
158 static constexpr PropertyComponentType component =
159 PropertyComponentType::Uint8;
160 static constexpr PropertyType value = PropertyType::Scalar;
164 static constexpr PropertyComponentType component =
165 PropertyComponentType::Int8;
166 static constexpr PropertyType value = PropertyType::Scalar;
170 static constexpr PropertyComponentType component =
171 PropertyComponentType::Uint16;
172 static constexpr PropertyType value = PropertyType::Scalar;
176 static constexpr PropertyComponentType component =
177 PropertyComponentType::Int16;
178 static constexpr PropertyType value = PropertyType::Scalar;
182 static constexpr PropertyComponentType component =
183 PropertyComponentType::Uint32;
184 static constexpr PropertyType value = PropertyType::Scalar;
188 static constexpr PropertyComponentType component =
189 PropertyComponentType::Int32;
190 static constexpr PropertyType value = PropertyType::Scalar;
194 static constexpr PropertyComponentType component =
195 PropertyComponentType::Uint64;
196 static constexpr PropertyType value = PropertyType::Scalar;
200 static constexpr PropertyComponentType component =
201 PropertyComponentType::Int64;
202 static constexpr PropertyType value = PropertyType::Scalar;
206 static constexpr PropertyComponentType component =
207 PropertyComponentType::Float32;
208 static constexpr PropertyType value = PropertyType::Scalar;
212 static constexpr PropertyComponentType component =
213 PropertyComponentType::Float64;
214 static constexpr PropertyType value = PropertyType::Scalar;
218 #pragma region Vector Property Types
220 template <
typename T, glm::qualifier P>
222 static constexpr PropertyComponentType component =
224 static constexpr PropertyType value = PropertyType::Vec2;
227 template <
typename T, glm::qualifier P>
229 static constexpr PropertyComponentType component =
231 static constexpr PropertyType value = PropertyType::Vec3;
234 template <
typename T, glm::qualifier P>
236 static constexpr PropertyComponentType component =
238 static constexpr PropertyType value = PropertyType::Vec4;
243 #pragma region Matrix Property Types
245 template <
typename T, glm::qualifier P>
247 static constexpr PropertyComponentType component =
249 static constexpr PropertyType value = PropertyType::Mat2;
252 template <
typename T, glm::qualifier P>
254 static constexpr PropertyComponentType component =
256 static constexpr PropertyType value = PropertyType::Mat3;
259 template <
typename T, glm::qualifier P>
261 static constexpr PropertyComponentType component =
263 static constexpr PropertyType value = PropertyType::Mat4;
269 static constexpr PropertyComponentType component =
270 PropertyComponentType::None;
271 static constexpr PropertyType value = PropertyType::Boolean;
275 static constexpr PropertyComponentType component =
276 PropertyComponentType::None;
277 static constexpr PropertyType value = PropertyType::String;
294 template <glm::length_t n,
typename T, glm::qualifier P>
297 template <glm::length_t n,
typename T, glm::qualifier P>
300 template <
typename T>
333 template <glm::length_t N,
typename T, glm::qualifier Q>
335 using type = glm::vec<N, double, Q>;
338 template <glm::length_t N,
typename T, glm::qualifier Q>
340 using type = glm::mat<N, N, double, Q>;
368 template <glm::length_t N,
typename T, glm::qualifier Q>
373 template <glm::length_t N,
typename T, glm::qualifier Q>
387 template <
typename T>
393 template <
typename T>
394 using PropertyValueCopyToView = std::conditional_t<
408 template <
typename T>
409 static std::optional<PropertyValueViewToCopy<T>>
410 propertyValueViewToCopy(
const std::optional<T>& view) {
413 return std::make_optional<PropertyValueViewToCopy<T>>(
414 std::vector(view->begin(), view->end()));
423 template <
typename T>
424 static PropertyValueViewToCopy<T> propertyValueViewToCopy(
const T& view) {
425 if constexpr (IsMetadataNumericArray<T>::value) {
426 return PropertyValueViewToCopy<T>(std::vector(view.begin(), view.end()));
432 template <
typename T>
433 static PropertyValueCopyToView<T> propertyValueCopyToView(
const T& copy) {
434 if constexpr (IsMetadataNumericArray<T>::value) {
A copy of an array element of a PropertyTableProperty or PropertyTextureProperty.
A view on an array element of a PropertyTableProperty or PropertyTextureProperty.
Classes for working with glTF models.
std::conditional_t< IsMetadataNumericArray< T >::value, PropertyArrayCopy< typename MetadataArrayType< T >::type >, T > PropertyValueViewToCopy
Transforms a property value type from a view to an equivalent type that owns the data it is viewing....
Check if a C++ type can be normalized.
Convert an integer numeric type to the corresponding representation as a double type....
Convert a C++ type to PropertyType and PropertyComponentType.