8#include "CoreMinimal.h"
9#include "Kismet/BlueprintFunctionLibrary.h"
10#include "Misc/Optional.h"
11#include "UObject/ObjectMacros.h"
13#include <CesiumGltf/PropertyTypeTraits.h>
14#include <CesiumUtility/JsonValue.h>
17#include <swl/variant.hpp>
19#include "CesiumMetadataValue.generated.h"
26 GENERATED_USTRUCT_BODY()
29#pragma region ValueType declaration
30 using ValueType = swl::variant<
47 glm::vec<2, uint16_t>,
49 glm::vec<2, uint32_t>,
51 glm::vec<2, uint64_t>,
57 glm::vec<3, uint16_t>,
59 glm::vec<3, uint32_t>,
61 glm::vec<3, uint64_t>,
67 glm::vec<4, uint16_t>,
69 glm::vec<4, uint32_t>,
71 glm::vec<4, uint64_t>,
74 glm::mat<2, 2, int8_t>,
75 glm::mat<2, 2, uint8_t>,
76 glm::mat<2, 2, int16_t>,
77 glm::mat<2, 2, uint16_t>,
78 glm::mat<2, 2, int32_t>,
79 glm::mat<2, 2, uint32_t>,
80 glm::mat<2, 2, int64_t>,
81 glm::mat<2, 2, uint64_t>,
82 glm::mat<2, 2, float>,
83 glm::mat<2, 2, double>,
84 glm::mat<3, 3, int8_t>,
85 glm::mat<3, 3, uint8_t>,
86 glm::mat<3, 3, int16_t>,
87 glm::mat<3, 3, uint16_t>,
88 glm::mat<3, 3, int32_t>,
89 glm::mat<3, 3, uint32_t>,
90 glm::mat<3, 3, int64_t>,
91 glm::mat<3, 3, uint64_t>,
92 glm::mat<3, 3, float>,
93 glm::mat<3, 3, double>,
94 glm::mat<4, 4, int8_t>,
95 glm::mat<4, 4, uint8_t>,
96 glm::mat<4, 4, int16_t>,
97 glm::mat<4, 4, uint16_t>,
98 glm::mat<4, 4, int32_t>,
99 glm::mat<4, 4, uint32_t>,
100 glm::mat<4, 4, int64_t>,
101 glm::mat<4, 4, uint64_t>,
102 glm::mat<4, 4, float>,
103 glm::mat<4, 4, double>>;
119 template <
typename T>
122 const TSharedPtr<FCesiumMetadataEnum>& pEnumDefinition)
125 _valueType(TypeToMetadataValueType<T>(pEnumDefinition)),
126 _pEnumDefinition(pEnumDefinition) {}
133 template <
typename T>
137 template <
typename ArrayType>
140 const TSharedPtr<FCesiumMetadataEnum>& pEnumDefinition =
nullptr)
142 CesiumGltf::PropertyArrayView<ArrayType>(Value),
145 template <
typename ArrayType>
148 const TSharedPtr<FCesiumMetadataEnum>& pEnumDefinition =
nullptr)
150 CesiumGltf::PropertyArrayCopy<ArrayType>(Copy),
153 template <
typename ArrayType>
156 const TSharedPtr<FCesiumMetadataEnum>& pEnumDefinition =
nullptr)
160 TypeToMetadataValueType<
CesiumGltf::PropertyArrayView<ArrayType>>(
162 _pEnumDefinition(pEnumDefinition) {}
164 template <
typename ArrayType>
167 const TSharedPtr<FCesiumMetadataEnum>& pEnumDefinition =
nullptr)
171 TypeToMetadataValueType<
CesiumGltf::PropertyArrayView<ArrayType>>(
173 _pEnumDefinition(pEnumDefinition) {}
182 template <
typename T>
184 const std::optional<T>& MaybeValue,
185 const TSharedPtr<FCesiumMetadataEnum>& pEnumDefinition =
nullptr)
189 _pEnumDefinition(pEnumDefinition) {
195 this->_value = std::move(temp._value);
196 this->_arrayValue = std::move(temp._arrayValue);
197 this->_valueType = std::move(temp._valueType);
235 void initializeFromJsonArray(
238 void initializeAsScalarArray(
241 void initializeAsVecOrMat(
244 void initializeAsVecOrMatArray(
249 TOptional<FCesiumPropertyArray> _arrayValue;
251 TSharedPtr<FCesiumMetadataEnum> _pEnumDefinition;
260 : public UBlueprintFunctionLibrary {
272 Category =
"Cesium|Metadata|Value")
283 Category =
"Cesium|Metadata|Value")
295 Category =
"Cesium|Metadata|Value")
299 PRAGMA_DISABLE_DEPRECATION_WARNINGS
310 "CesiumMetadataTrueType is deprecated. Use GetValueType to get the CesiumMetadataValueType instead."))
325 "CesiumMetadataTrueType is deprecated. Use GetValueType to get the CesiumMetadataValueType instead."))
329 PRAGMA_ENABLE_DEPRECATION_WARNINGS
354 Category =
"Cesium|Metadata|Value")
384 Category =
"Cesium|Metadata|Value")
416 Category =
"Cesium|Metadata|Value")
448 Category =
"Cesium|Metadata|Value")
480 Category =
"Cesium|Metadata|Value")
510 Category =
"Cesium|Metadata|Value")
513 double DefaultValue);
545 Category =
"Cesium|Metadata|Value")
548 const FIntPoint& DefaultValue);
578 Category =
"Cesium|Metadata|Value")
581 const FVector2D& DefaultValue);
616 Category =
"Cesium|Metadata|Value")
619 const FIntVector& DefaultValue);
655 Category =
"Cesium|Metadata|Value")
658 const FVector3f& DefaultValue);
691 Category =
"Cesium|Metadata|Value")
694 const FVector& DefaultValue);
729 Category =
"Cesium|Metadata|Value")
732 const FVector4& DefaultValue);
768 Category =
"Cesium|Metadata|Value")
771 const FMatrix& DefaultValue);
802 Category =
"Cesium|Metadata|Value")
805 const FString& DefaultValue);
817 Category =
"Cesium|Metadata|Value")
834 Category =
"Cesium|Metadata|Value")
848 Category =
"Cesium|Metadata|Value")
849 static TMap<FString, FString>
std::vector< JsonValue > Array
A Blueprint-accessible wrapper for an array value from 3D Tiles or glTF metadata.