@@ -10,12 +10,6 @@ UCesiumPropertyArrayBlueprintLibrary::GetElementBlueprintType(
1010 return CesiumMetadataValueTypeToBlueprintType (array._elementType );
1111}
1212
13- ECesiumMetadataBlueprintType
14- UCesiumPropertyArrayBlueprintLibrary::GetBlueprintComponentType (
15- UPARAM (ref) const FCesiumPropertyArray& array) {
16- return CesiumMetadataValueTypeToBlueprintType (array._elementType );
17- }
18-
1913FCesiumMetadataValueType
2014UCesiumPropertyArrayBlueprintLibrary::GetElementValueType (
2115 UPARAM (ref) const FCesiumPropertyArray& array) {
@@ -27,11 +21,6 @@ int64 UCesiumPropertyArrayBlueprintLibrary::GetArraySize(
2721 return swl::visit ([](const auto & view) { return view.size (); }, array._value );
2822}
2923
30- int64 UCesiumPropertyArrayBlueprintLibrary::GetSize (
31- UPARAM (ref) const FCesiumPropertyArray& array) {
32- return swl::visit ([](const auto & view) { return view.size (); }, array._value );
33- }
34-
3524FCesiumMetadataValue UCesiumPropertyArrayBlueprintLibrary::GetValue (
3625 UPARAM (ref) const FCesiumPropertyArray& array,
3726 int64 index) {
@@ -54,140 +43,86 @@ FCesiumMetadataValue UCesiumPropertyArrayBlueprintLibrary::GetValue(
5443 array._value );
5544}
5645
46+ PRAGMA_DISABLE_DEPRECATION_WARNINGS
47+
48+ ECesiumMetadataBlueprintType
49+ UCesiumPropertyArrayBlueprintLibrary::GetBlueprintComponentType (
50+ UPARAM (ref) const FCesiumPropertyArray& array) {
51+ return CesiumMetadataValueTypeToBlueprintType (array._elementType );
52+ }
53+
5754ECesiumMetadataTrueType_DEPRECATED
5855UCesiumPropertyArrayBlueprintLibrary::GetTrueComponentType (
5956 UPARAM (ref) const FCesiumPropertyArray& array) {
6057 return CesiumMetadataValueTypeToTrueType (array._elementType );
6158}
6259
60+ int64 UCesiumPropertyArrayBlueprintLibrary::GetSize (
61+ UPARAM (ref) const FCesiumPropertyArray& array) {
62+ return swl::visit ([](const auto & view) { return view.size (); }, array._value );
63+ }
64+
6365bool UCesiumPropertyArrayBlueprintLibrary::GetBoolean (
6466 UPARAM (ref) const FCesiumPropertyArray& array,
6567 int64 index,
6668 bool defaultValue) {
67- return swl::visit (
68- [index, defaultValue](const auto & v) -> bool {
69- if (index < 0 || index >= v.size ()) {
70- return defaultValue;
71- }
72- auto value = v[index];
73- return CesiumGltf::MetadataConversions<bool , decltype (value)>::convert (
74- value)
75- .value_or (defaultValue);
76- },
77- array._value );
69+ return UCesiumMetadataValueBlueprintLibrary::GetBoolean (
70+ UCesiumPropertyArrayBlueprintLibrary::GetValue (array, index),
71+ defaultValue);
7872}
7973
8074uint8 UCesiumPropertyArrayBlueprintLibrary::GetByte (
8175 UPARAM (ref) const FCesiumPropertyArray& array,
8276 int64 index,
8377 uint8 defaultValue) {
84- return swl::visit (
85- [index, defaultValue](const auto & v) -> uint8 {
86- if (index < 0 || index >= v.size ()) {
87- return defaultValue;
88- }
89- auto value = v[index];
90- return CesiumGltf::MetadataConversions<uint8, decltype (value)>::convert (
91- value)
92- .value_or (defaultValue);
93- },
94- array._value );
78+ return UCesiumMetadataValueBlueprintLibrary::GetByte (
79+ UCesiumPropertyArrayBlueprintLibrary::GetValue (array, index),
80+ defaultValue);
9581}
9682
9783int32 UCesiumPropertyArrayBlueprintLibrary::GetInteger (
9884 UPARAM (ref) const FCesiumPropertyArray& array,
9985 int64 index,
10086 int32 defaultValue) {
101- return swl::visit (
102- [index, defaultValue](const auto & v) -> int32 {
103- if (index < 0 || index >= v.size ()) {
104- return defaultValue;
105- }
106- auto value = v[index];
107- return CesiumGltf::MetadataConversions<int32, decltype (value)>::convert (
108- value)
109- .value_or (defaultValue);
110- },
111- array._value );
87+ return UCesiumMetadataValueBlueprintLibrary::GetInteger (
88+ UCesiumPropertyArrayBlueprintLibrary::GetValue (array, index),
89+ defaultValue);
11290}
11391
11492int64 UCesiumPropertyArrayBlueprintLibrary::GetInteger64 (
11593 UPARAM (ref) const FCesiumPropertyArray& array,
11694 int64 index,
11795 int64 defaultValue) {
118- return swl::visit (
119- [index, defaultValue](const auto & v) -> int64 {
120- if (index < 0 || index >= v.size ()) {
121- return defaultValue;
122- }
123- auto value = v[index];
124- return CesiumGltf::MetadataConversions<int64_t , decltype (value)>::
125- convert (value)
126- .value_or (defaultValue);
127- },
128- array._value );
96+ return UCesiumMetadataValueBlueprintLibrary::GetInteger64 (
97+ UCesiumPropertyArrayBlueprintLibrary::GetValue (array, index),
98+ defaultValue);
12999}
130100
131101float UCesiumPropertyArrayBlueprintLibrary::GetFloat (
132102 UPARAM (ref) const FCesiumPropertyArray& array,
133103 int64 index,
134104 float defaultValue) {
135- return swl::visit (
136- [index, defaultValue](const auto & v) -> float {
137- if (index < 0 || index >= v.size ()) {
138- return defaultValue;
139- }
140- auto value = v[index];
141- return CesiumGltf::MetadataConversions<float , decltype (value)>::convert (
142- value)
143- .value_or (defaultValue);
144- },
145- array._value );
105+ return UCesiumMetadataValueBlueprintLibrary::GetFloat (
106+ UCesiumPropertyArrayBlueprintLibrary::GetValue (array, index),
107+ defaultValue);
146108}
147109
148110double UCesiumPropertyArrayBlueprintLibrary::GetFloat64 (
149111 UPARAM (ref) const FCesiumPropertyArray& array,
150112 int64 index,
151113 double defaultValue) {
152- return swl::visit (
153- [index, defaultValue](const auto & v) -> double {
154- auto value = v[index];
155- return CesiumGltf::MetadataConversions<double , decltype (value)>::
156- convert (value)
157- .value_or (defaultValue);
158- },
159- array._value );
114+ return UCesiumMetadataValueBlueprintLibrary::GetFloat64 (
115+ UCesiumPropertyArrayBlueprintLibrary::GetValue (array, index),
116+ defaultValue);
160117}
161118
162119FString UCesiumPropertyArrayBlueprintLibrary::GetString (
163120 UPARAM (ref) const FCesiumPropertyArray& array,
164121 int64 index,
165122 const FString& defaultValue) {
166- return swl::visit (
167- [index, defaultValue, &EnumDefinition = array._pEnumDefinition ](
168- const auto & v) -> FString {
169- if (index < 0 || index >= v.size ()) {
170- return defaultValue;
171- }
172- auto value = v[index];
173- using ValueType = decltype (value);
174-
175- if constexpr (CesiumGltf::IsMetadataInteger<ValueType>::value) {
176- if (EnumDefinition.IsValid ()) {
177- TOptional<FString> MaybeName = EnumDefinition->GetName (value);
178- if (MaybeName.IsSet ()) {
179- return MaybeName.GetValue ();
180- }
181- }
182- }
183-
184- auto maybeString =
185- CesiumGltf::MetadataConversions<std::string, ValueType>::convert (
186- value);
187- if (!maybeString) {
188- return defaultValue;
189- }
190- return UnrealMetadataConversions::toString (*maybeString);
191- },
192- array._value );
123+ return UCesiumMetadataValueBlueprintLibrary::GetString (
124+ UCesiumPropertyArrayBlueprintLibrary::GetValue (array, index),
125+ defaultValue);
193126}
127+
128+ PRAGMA_ENABLE_DEPRECATION_WARNINGS
0 commit comments