Cesium for Unreal 2.12.0
Loading...
Searching...
No Matches
CesiumPropertyArray.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "CesiumGltf/PropertyArrayView.h"
6#include "CesiumGltf/PropertyTypeTraits.h"
8#include "UObject/ObjectMacros.h"
9#include <swl/variant.hpp>
10#include "CesiumPropertyArray.generated.h"
11
15USTRUCT(BlueprintType)
16struct CESIUMRUNTIME_API FCesiumPropertyArray {
17 GENERATED_USTRUCT_BODY()
18
19private:
20#pragma region ArrayType
21 template <typename T>
23
24 using ArrayType = swl::variant<
97#pragma endregion
98
99public:
103 FCesiumPropertyArray() : _value(), _elementType() {}
104
109 template <typename T>
111 : _value(), _elementType(), _storage() {
112 this->_value = std::move(value).toViewAndExternalBuffer(this->_storage);
117 bool isArray = false;
118
119 _elementType = {type, componentType, isArray};
120 }
121
122 template <typename T>
124 : FCesiumPropertyArray(CesiumGltf::PropertyArrayCopy<T>(value)) {}
125
126 template <typename T>
128 : _value(value), _elementType() {
133 bool isArray = false;
134
135 _elementType = {type, componentType, isArray};
136 }
137
142
143private:
144 template <typename T, typename... VariantType>
145 static bool
146 holdsArrayAlternative(const swl::variant<VariantType...>& variant) {
147 return swl::holds_alternative<CesiumGltf::PropertyArrayView<T>>(variant);
148 }
149
150 ArrayType _value;
151 FCesiumMetadataValueType _elementType;
152 std::vector<std::byte> _storage;
153
155};
ECesiumMetadataComponentType
The component type of a metadata property in EXT_structural_metadata.
ECesiumMetadataType
The type of a metadata property in EXT_structural_metadata.
Blueprint library functions for acting on an array property in EXT_structural_metadata.
Represents the true value type of a metadata value, akin to the property types in EXT_structural_meta...
A Blueprint-accessible wrapper for an array property in glTF metadata.
FCesiumPropertyArray(const FCesiumPropertyArray &rhs)
FCesiumPropertyArray(CesiumGltf::PropertyArrayCopy< T > &&value)
Constructs an array instance.
FCesiumPropertyArray()
Constructs an empty array instance with an unknown element type.
FCesiumPropertyArray(FCesiumPropertyArray &&rhs)
FCesiumPropertyArray & operator=(FCesiumPropertyArray &&rhs)
FCesiumPropertyArray(const CesiumGltf::PropertyArrayCopy< T > &value)
FCesiumPropertyArray & operator=(const FCesiumPropertyArray &rhs)
FCesiumPropertyArray(const CesiumGltf::PropertyArrayView< T > &value)