Cesium for Unreal 2.18.0
Loading...
Searching...
No Matches
CesiumPropertyAttributeProperty.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
8#include "Kismet/BlueprintFunctionLibrary.h"
9#include "UObject/ObjectMacros.h"
10
11#include <CesiumGltf/PropertyAttributePropertyView.h>
12#include <CesiumGltf/PropertyTypeTraits.h>
13#include <any>
14
15#include "CesiumPropertyAttributeProperty.generated.h"
16
17/**
18 * @brief Reports the status of a FCesiumPropertyAttributeProperty. If the
19 * property attribute property cannot be accessed, this briefly indicates why.
20 */
21UENUM(BlueprintType)
23 /* The property attribute property is valid. */
24 Valid = 0,
25 /* The property attribute property is empty but has a specified default value.
26 */
28 /* The property attribute property does not exist in the glTF, or the property
29 definition itself contains errors. */
31 /* The data associated with the property attribute property is malformed and
32 cannot be retrieved. */
34};
35
36/**
37 * A Blueprint-accessible wrapper for a glTF property attribute property in
38 * EXT_structural_metadata. Provides per-vertex access to metadata encoded in a
39 * glTF primitive's vertices.
40 */
41USTRUCT(BlueprintType)
42struct CESIUMRUNTIME_API FCesiumPropertyAttributeProperty {
43 GENERATED_USTRUCT_BODY()
44
45public:
46 /**
47 * Construct an invalid property with an unknown type.
48 */
51 _property(),
52 _valueType(),
53 _normalized(false) {}
54
55 /**
56 * Construct a wrapper for the property attribute property view.
57 *
58 * @param Property The PropertyAttributePropertyView to be stored in this
59 * struct.
60 */
61 template <typename T, bool Normalized>
67
68 /**
69 * Construct a wrapper for the property attribute property view.
70 *
71 * @param Property The PropertyAttributePropertyView to be stored in this
72 * struct.
73 * @param EnumDefinition The enum definition to use, if any.
74 */
75 template <typename T, bool Normalized>
78 const TSharedPtr<FCesiumMetadataEnum>& EnumDefinition)
80 _property(Property),
81 _valueType(),
82 _normalized(Normalized),
83 _pEnumDefinition(EnumDefinition) {
84 switch (Property.status()) {
85 case CesiumGltf::PropertyAttributePropertyViewStatus::Valid:
86 _status = ECesiumPropertyAttributePropertyStatus::Valid;
87 break;
88 case CesiumGltf::PropertyAttributePropertyViewStatus::
89 EmptyPropertyWithDefault:
90 _status =
91 ECesiumPropertyAttributePropertyStatus::EmptyPropertyWithDefault;
92 break;
93 case CesiumGltf::PropertyAttributePropertyViewStatus::
94 ErrorInvalidPropertyAttribute:
95 case CesiumGltf::PropertyAttributePropertyViewStatus::
96 ErrorNonexistentProperty:
97 case CesiumGltf::PropertyAttributePropertyViewStatus::ErrorTypeMismatch:
98 case CesiumGltf::PropertyAttributePropertyViewStatus::
99 ErrorComponentTypeMismatch:
100 case CesiumGltf::PropertyAttributePropertyViewStatus::
101 ErrorArrayTypeMismatch:
102 case CesiumGltf::PropertyAttributePropertyViewStatus::
103 ErrorInvalidNormalization:
104 case CesiumGltf::PropertyAttributePropertyViewStatus::
105 ErrorNormalizationMismatch:
106 case CesiumGltf::PropertyAttributePropertyViewStatus::ErrorInvalidOffset:
107 case CesiumGltf::PropertyAttributePropertyViewStatus::ErrorInvalidScale:
108 case CesiumGltf::PropertyAttributePropertyViewStatus::ErrorInvalidMax:
109 case CesiumGltf::PropertyAttributePropertyViewStatus::ErrorInvalidMin:
110 case CesiumGltf::PropertyAttributePropertyViewStatus::
111 ErrorInvalidNoDataValue:
112 case CesiumGltf::PropertyAttributePropertyViewStatus::
113 ErrorInvalidDefaultValue:
114 // The status was already set in the initializer list.
115 return;
116 default:
117 _status =
118 ECesiumPropertyAttributePropertyStatus::ErrorInvalidPropertyData;
119 return;
120 }
121
122 _valueType = TypeToMetadataValueType<T>(EnumDefinition);
123 _normalized = Normalized;
124 }
125
126private:
128
129 std::any _property;
130
131 FCesiumMetadataValueType _valueType;
132 bool _normalized;
133 TSharedPtr<FCesiumMetadataEnum> _pEnumDefinition;
134
136};
137
138UCLASS()
140 : public UBlueprintFunctionLibrary {
141 GENERATED_BODY()
142
143public:
144 /**
145 * Gets the status of the property attribute property. If this property
146 * attribute property is invalid in any way, this will briefly indicate why.
147 *
148 * @param Property The property attribute property.
149 */
150 UFUNCTION(
151 BlueprintCallable,
152 BlueprintPure,
153 Category = "Cesium|Metadata|PropertyAttributeProperty")
156 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property);
157
158 /**
159 * Gets the best-fitting type for the property that is accessible from
160 * Blueprints. For the most precise representation of the values possible in
161 * Blueprints, you should retrieve it using this type.
162 *
163 * @param Property The property attribute property.
164 */
165 UFUNCTION(
166 BlueprintCallable,
167 BlueprintPure,
168 Category = "Cesium|Metadata|PropertyAttributeProperty")
171 const FCesiumPropertyAttributeProperty& Property);
172
173 /**
174 * Gets the type of the metadata value as defined in the
175 * EXT_structural_metadata extension. Many of these types are not accessible
176 * from Blueprints, but can be converted to a Blueprint-accessible type.
177 *
178 * @param Property The property attribute property.
179 */
180 UFUNCTION(
181 BlueprintCallable,
182 BlueprintPure,
183 Category = "Cesium|Metadata|PropertyAttributeProperty")
185 GetValueType(UPARAM(ref) const FCesiumPropertyAttributeProperty& Property);
186
187 /**
188 * Gets the number of values in the property.
189 *
190 * @param Property The property attribute property.
191 */
192 UFUNCTION(
193 BlueprintCallable,
194 BlueprintPure,
195 Category = "Cesium|Metadata|PropertyAttributeProperty")
196 static int64
198
199 /**
200 * Attempts to retrieve the value at the given index as an unsigned 8-bit
201 * integer.
202 *
203 * For numeric properties, the raw value will be transformed by the property's
204 * normalization, scale, and offset before it is further converted. If the raw
205 * value is equal to the property's "no data" value, then the property's
206 * default value will be converted if possible. If the property-defined
207 * default value cannot be converted, or does not exist, then the user-defined
208 * default value is returned.
209 *
210 * If the value is an integer between 0 and 255, it is returned as-is.
211 * Otherwise, if the value is a floating-point number in the aforementioned
212 * range, it is truncated (rounded toward zero) and returned.
213 *
214 * In all other cases, the user-defined default value is returned. If the
215 * index is out-of-range, or if the property attribute property is somehow
216 * invalid, the user-defined default value is returned.
217 *
218 * @param Property The property attribute property.
219 * @param Index The index.
220 * @param DefaultValue The default value to fall back on.
221 * @return The property value as a Byte.
222 */
223 UFUNCTION(
224 BlueprintCallable,
225 BlueprintPure,
226 Category = "Cesium|Metadata|PropertyAttributeProperty")
227 static uint8 GetByte(
228 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
229 int64 Index,
230 uint8 DefaultValue = 0);
231
232 /**
233 * Attempts to retrieve the value for the given index as a signed 32-bit
234 * integer.
235 *
236 * Although property attribute properties do not directly support
237 * 32-bit signed integers, this can be used to losslessly retrieve values from
238 * smaller integer properties.
239 *
240 * For numeric properties, the raw value will be transformed by the property's
241 * normalization, scale, and offset before it is further converted. If the raw
242 * value is equal to the property's "no data" value, then the property's
243 * default value will be converted if possible. If the property-defined
244 * default value cannot be converted, or does not exist, then the user-defined
245 * default value is returned.
246 *
247 * If the value is an integer between -2,147,483,648 and 2,147,483,647, it
248 * is returned as-is. Otherwise, if the value is a floating-point number in
249 * the aforementioned range, it is truncated (rounded toward zero) and
250 * returned.
251 *
252 * In all other cases, the user-defined default value is returned. If the
253 * index is out-of-range, or if the property attribute property is
254 * somehow invalid, the user-defined default value is returned.
255 *
256 * @param Property The property attribute property.
257 * @param Index The index.
258 * @param DefaultValue The default value to fall back on.
259 * @return The property value as an Integer.
260 */
261 UFUNCTION(
262 BlueprintCallable,
263 BlueprintPure,
264 Category = "Cesium|Metadata|PropertyAttributeProperty")
265 static int32 GetInteger(
266 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
267 int64 Index,
268 int32 DefaultValue = 0);
269
270 /**
271 * Attempts to retrieve the value for the given index as a signed 64-bit
272 * integer.
273 *
274 * Although property attribute properties do not directly support
275 * 64-bit integers, this can be used to losslessly retrieve values from
276 * unsigned 32-bit integer properties.
277 *
278 * For numeric properties, the raw value will be transformed by the property's
279 * normalization, scale, and offset before it is further converted. If the raw
280 * value is equal to the property's "no data" value, then the property's
281 * default value will be converted if possible. If the property-defined
282 * default value cannot be converted, or does not exist, then the user-defined
283 * default value is returned.
284 *
285 * If the value is an integer and between -2^63 and (2^63 - 1), it is
286 * returned as-is. Otherwise, if the value is a floating-point number in the
287 * aforementioned range, it is truncated (rounded toward zero) and returned.
288 *
289 * In all other cases, the user-defined default value is returned. If the
290 * index ID is out-of-range, or if the property table property is somehow
291 * invalid, the user-defined default value is returned.
292 *
293 * @param Property The property table property.
294 * @param Index The index.
295 * @param DefaultValue The default value to fall back on.
296 * @return The property value as an Integer64.
297 */
298 UFUNCTION(
299 BlueprintCallable,
300 BlueprintPure,
301 Category = "Cesium|Metadata|PropertyAttributeProperty")
302 static int64 GetInteger64(
303 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
304 int64 Index,
305 int64 DefaultValue = 0);
306
307 /**
308 * Attempts to retrieve the value for the given index as a single-precision
309 * floating-point number.
310 *
311 * For numeric properties, the raw value will be transformed by the property's
312 * normalization, scale, and offset before it is further converted. If the raw
313 * value is equal to the property's "no data" value, then the property's
314 * default value will be converted if possible. If the property-defined
315 * default value cannot be converted, or does not exist, then the user-defined
316 * default value is returned.
317 *
318 * If the value is already a single-precision floating-point number, it is
319 * returned as-is. Otherwise, if the value is a scalar of any other type
320 * within the range of values that a single-precision float can represent, it
321 * is converted to its closest representation as a single-precision float and
322 * returned.
323 *
324 * In all other cases, the user-defined default value is returned. If the
325 * index is out-of-range, or if the property attribute property is
326 * somehow invalid, the user-defined default value is returned.
327 *
328 * @param Property The property attribute property.
329 * @param Index The index.
330 * @param DefaultValue The default value to fall back on.
331 * @return The property value as a Float.
332 */
333 UFUNCTION(
334 BlueprintCallable,
335 BlueprintPure,
336 Category = "Cesium|Metadata|PropertyAttributeProperty")
337 static float GetFloat(
338 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
339 int64 Index,
340 float DefaultValue = 0.0f);
341
342 /**
343 * Attempts to retrieve the value for the given index as a double-precision
344 * floating-point number.
345 *
346 * For numeric properties, the raw value will be transformed by the property's
347 * normalization, scale, and offset before it is further converted. If the raw
348 * value is equal to the property's "no data" value, then the property's
349 * default value will be converted if possible. If the property-defined
350 * default value cannot be converted, or does not exist, then the user-defined
351 * default value is returned.
352 *
353 * If the value is a single-precision floating-point number, it is returned
354 * as-is. Otherwise, if the value is an integer, it is converted to the
355 * closest representation as a double-precision floating-point number.
356 *
357 * In all other cases, the user-defined default value is returned. If the
358 * index is out-of-range, or if the property attribute property is
359 * somehow invalid, the user-defined default value is returned.
360 *
361 * @param Property The property attribute property.
362 * @param Index The index.
363 * @param DefaultValue The default value to fall back on.
364 * @return The property value as a Float64.
365 */
366 UFUNCTION(
367 BlueprintCallable,
368 BlueprintPure,
369 Category = "Cesium|Metadata|PropertyAttributeProperty")
370 static double GetFloat64(
371 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
372 int64 Index,
373 double DefaultValue = 0.0);
374
375 /**
376 * Attempts to retrieve the value for the given index as a FIntPoint.
377 *
378 * For numeric properties, the raw value will be transformed by the property's
379 * normalization, scale, and offset before it is further converted. If the raw
380 * value is equal to the property's "no data" value, then the property's
381 * default value will be converted if possible. If the property-defined
382 * default value cannot be converted, or does not exist, then the user-defined
383 * default value is returned.
384 *
385 * Property values are converted as follows:
386 *
387 * - If the value is a 2-dimensional vector, its components will be converted
388 * to 32-bit signed integers if possible.
389 *
390 * - If the value is a 3- or 4-dimensional vector, it will use the first two
391 * components to construct the FIntPoint.
392 *
393 * - If the value is a scalar that can be converted to a 32-bit signed
394 * integer, the resulting FIntPoint will have this value in both of its
395 * components.
396 *
397 * In all other cases, the user-defined default value is returned. In all
398 * vector cases, if any of the relevant components cannot be represented as a
399 * 32-bit signed, the default value is returned.
400 *
401 * If the index is out-of-range, or if the property attribute property is
402 * somehow invalid, the user-defined default value is returned.
403 *
404 * @param Property The property attribute property.
405 * @param Index The index.
406 * @param DefaultValue The default value to fall back on.
407 * @return The property value as a FIntPoint.
408 */
409 UFUNCTION(
410 BlueprintCallable,
411 BlueprintPure,
412 Category = "Cesium|Metadata|PropertyAttributeProperty")
413 static FIntPoint GetIntPoint(
414 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
415 int64 Index,
416 const FIntPoint& DefaultValue);
417
418 /**
419 * Attempts to retrieve the value for the given index as a FVector2D.
420 *
421 * For numeric properties, the raw value will be transformed by the property's
422 * normalization, scale, and offset before it is further converted. If the raw
423 * value is equal to the property's "no data" value, then the property's
424 * default value will be converted if possible. If the property-defined
425 * default value cannot be converted, or does not exist, then the user-defined
426 * default value is returned.
427 *
428 * Property values are converted as follows:
429 *
430 * - If the value is a 2-dimensional vector, its components will be converted
431 * to double-precision floating-point numbers.
432 *
433 * - If the value is a 3- or 4-dimensional vector, it will use the first two
434 * components to construct the FVector2D.
435 *
436 * - If the value is a scalar, the resulting FVector2D will have this value in
437 * both of its components.
438 *
439 * In all other cases, the user-defined default value is returned. If the
440 * index is out-of-range, or if the property attribute property is
441 * somehow invalid, the user-defined default value is returned.
442 *
443 * @param Property The property attribute property.
444 * @param Index The index.
445 * @param DefaultValue The default value to fall back on.
446 * @return The property value as a FVector2D.
447 */
448 UFUNCTION(
449 BlueprintCallable,
450 BlueprintPure,
451 Category = "Cesium|Metadata|PropertyAttributeProperty")
452 static FVector2D GetVector2D(
453 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
454 int64 Index,
455 const FVector2D& DefaultValue);
456
457 /**
458 * Attempts to retrieve the value for the given index as a FIntVector.
459 *
460 * For numeric properties, the raw value will be transformed by the property's
461 * normalization, scale, and offset before it is further converted. If the raw
462 * value is equal to the property's "no data" value, then the property's
463 * default value will be converted if possible. If the property-defined
464 * default value cannot be converted, or does not exist, then the user-defined
465 * default value is returned.
466 *
467 * Property values are converted as follows:
468 *
469 * - If the value is a 3-dimensional vector, its components will be converted
470 * to 32-bit signed integers if possible.
471 *
472 * - If the value is a 4-dimensional vector, it will use the first three
473 * components to construct the FIntVector.
474 *
475 * - If the value is a 2-dimensional vector, it will become the XY-components
476 * of the FIntVector. The Z component will be set to zero.
477 *
478 * - If the value is a scalar that can be converted to a 32-bit signed
479 * integer, the resulting FIntVector will have this value in all of its
480 * components.
481 *
482 * In all other cases, the user-defined default value is returned. In all
483 * vector cases, if any of the relevant components cannot be represented as a
484 * 32-bit signed integer, the default value is returned.
485 *
486 * If the index is out-of-range, or if the property attribute property is
487 * somehow invalid, the user-defined default value is returned.
488 *
489 * @param Property The property attribute property.
490 * @param Index The index.
491 * @param DefaultValue The default value to fall back on.
492 * @return The property value as a FIntVector.
493 */
494 UFUNCTION(
495 BlueprintCallable,
496 BlueprintPure,
497 Category = "Cesium|Metadata|PropertyAttributeProperty")
498 static FIntVector GetIntVector(
499 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
500 int64 Index,
501 const FIntVector& DefaultValue);
502
503 /**
504 * Attempts to retrieve the value for the given index as a FVector3f.
505 *
506 * For numeric properties, the raw value transformed by the property's
507 * normalization, scale, and offset before it is further converted. If the raw
508 * value is equal to the property's "no data" value, then the property's
509 * default value will be converted if possible. If the property-defined
510 * default value cannot be converted, or does not exist, then the user-defined
511 * default value is returned.
512 *
513 * Property values are converted as follows:
514 *
515 * - If the value is a 3-dimensional vector, its components will be converted
516 * to the closest represenattribute single-precision floats, if possible.
517 *
518 * - If the value is a 4-dimensional vector, a FVector3f containing the first
519 * three components will be returned.
520 *
521 * - If the value is a 2-dimensional vector, it will become the XY-components
522 * of the FVector3f. The Z-component will be set to zero.
523 *
524 * - If the value is a scalar that can be converted to a single-precision
525 * floating-point number, then the resulting FVector3f will have this value in
526 * all of its components.
527 *
528 * In all other cases, the user-defined default value is returned. In all
529 * vector cases, if any of the relevant components cannot be represented as a
530 * single-precision float, the user-defined default value is returned.
531 *
532 * If the index is out-of-range, or if the property attribute property is
533 * somehow invalid, the user-defined default value is returned.
534 *
535 * @param Property The property attribute property.
536 * @param Index The index.
537 * @param DefaultValue The default value to fall back on.
538 * @return The property value as a FVector3f.
539 */
540 UFUNCTION(
541 BlueprintCallable,
542 BlueprintPure,
543 Category = "Cesium|Metadata|PropertyAttributeProperty")
544 static FVector3f GetVector3f(
545 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
546 int64 Index,
547 const FVector3f& DefaultValue);
548
549 /**
550 * Attempts to retrieve the value for the given index as a FVector.
551 *
552 * For numeric properties, the raw value will be transformed by the property's
553 * normalization, scale, and offset before it is further converted. If the raw
554 * value is equal to the property's "no data" value, then the property's
555 * default value will be converted if possible. If the property-defined
556 * default value cannot be converted, or does not exist, then the user-defined
557 * default value is returned.
558 *
559 * Property values are converted as follows:
560 *
561 * - If the value is a 3-dimensional vector, its components will be converted
562 * to double-precision floating-point numbers.
563 *
564 * - If the value is a 4-dimensional vector, a FVector containing the first
565 * three components will be returned.
566 *
567 * - If the value is a 2-dimensional vector, it will become the XY-components
568 * of the FVector. The Z-component will be set to zero.
569 *
570 * - If the value is a scalar, then the resulting FVector will have this value
571 * as a double-precision floating-point number in all of its components.
572 *
573 * In all other cases, the user-defined default value is returned. If the
574 * index is out-of-range, or if the property attribute property is
575 * somehow invalid, the user-defined default value is returned.
576 *
577 * @param Property The property attribute property.
578 * @param Index The index.
579 * @param DefaultValue The default value to fall back on.
580 * @return The property value as a FVector.
581 */
582 UFUNCTION(
583 BlueprintCallable,
584 BlueprintPure,
585 Category = "Cesium|Metadata|PropertyAttributeProperty")
586 static FVector GetVector(
587 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
588 int64 Index,
589 const FVector& DefaultValue);
590
591 /**
592 * Attempts to retrieve the value for the given index as a FVector4.
593 *
594 * For numeric properties, the raw value will be transformed by the property's
595 * normalization, scale, and offset before it is further converted. If the raw
596 * value is equal to the property's "no data" value, then the property's
597 * default value will be converted if possible. If the property-defined
598 * default value cannot be converted, or does not exist, then the user-defined
599 * default value is returned.
600 *
601 * Property values are converted as follows:
602 *
603 * - If the value is a 4-dimensional vector, its components will be converted
604 * to double-precision floating-point numbers.
605 *
606 * - If the value is a 3-dimensional vector, it will become the XYZ-components
607 * of the FVector4. The W-component will be set to zero.
608 *
609 * - If the value is a 2-dimensional vector, it will become the XY-components
610 * of the FVector4. The Z- and W-components will be set to zero.
611 *
612 * - If the value is a scalar, then the resulting FVector4 will have this
613 * value as a double-precision floating-point number in all of its components.
614 *
615 * In all other cases, the user-defined default value is returned. If the
616 * index is out-of-range, or if the property attribute property is
617 * somehow invalid, the user-defined default value is returned.
618 *
619 * @param Property The property attribute property.
620 * @param Index The index.
621 * @param DefaultValue The default value to fall back on.
622 * @return The property value as a FVector4.
623 */
624 UFUNCTION(
625 BlueprintCallable,
626 BlueprintPure,
627 Category = "Cesium|Metadata|PropertyAttributeProperty")
628 static FVector4 GetVector4(
629 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
630 int64 Index,
631 const FVector4& DefaultValue);
632
633 /**
634 * Attempts to retrieve the value for the given index as a FMatrix.
635 *
636 * For numeric properties, the raw value will be transformed by the property's
637 * normalization, scale, and offset before it is further converted. If the raw
638 * value is equal to the property's "no data" value, then the property's
639 * default value will be converted if possible. If the property-defined
640 * default value cannot be converted, or does not exist, then the user-defined
641 * default value is returned.
642 *
643 * Property values are converted as follows:
644 *
645 * - If the value is a 4-by-4 matrix, its components will be converted to
646 * double-precision floating-point numbers.
647 *
648 * - If the value is a 3-by-3 matrix, it will initialize the corresponding
649 * entries of the FMatrix, while all other entries are set to zero. In other
650 * words, the 3-by-3 matrix is returned in an FMatrix where the fourth row and
651 * column are filled with zeroes.
652 *
653 * - If the value is a 2-by-2 matrix, it will initialize the corresponding
654 * entries of the FMatrix, while all other entries are set to zero. In other
655 * words, the 2-by-2 matrix is returned in an FMatrix where the third and
656 * fourth rows / columns are filled with zeroes.
657 *
658 * - If the value is a scalar, then the resulting FMatrix will have this value
659 * along its diagonal, including the very last component. All other entries
660 * will be zero.
661 *
662 * In all other cases, the user-defined default value is returned. If the
663 * index is out-of-range, or if the property attribute property is
664 * somehow invalid, the user-defined default value is returned.
665 *
666 * @param Property The property attribute property.
667 * @param Index The index.
668 * @param DefaultValue The default value to fall back on.
669 * @return The property value as a FMatrix.
670 */
671 UFUNCTION(
672 BlueprintCallable,
673 BlueprintPure,
674 Category = "Cesium|Metadata|PropertyAttributeProperty")
675 static FMatrix GetMatrix(
676 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
677 int64 Index,
678 const FMatrix& DefaultValue);
679
680 /**
681 * Retrieves the value of the property for the given index. This allows the
682 * value to be acted on more generically; its true value can be retrieved
683 * later as a specific Blueprints type.
684 *
685 * For numeric properties, the raw value will be transformed by the property's
686 * normalization, scale, and offset before it is returned. If the raw value is
687 * equal to the property's "no data" value, an empty value will be returned.
688 * However, if the property itself specifies a default value, then the
689 * property-defined default value will be returned.
690 *
691 * @param Property The property attribute property.
692 * @param Index The index.
693 * @return The property value.
694 */
695 UFUNCTION(
696 BlueprintCallable,
697 BlueprintPure,
698 Category = "Cesium|Metadata|PropertyAttributeProperty")
700 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
701 int64 Index);
702
703 /**
704 * Retrieves the raw value of the property for the given index. This is the
705 * value of the property without normalization, offset, or scale applied.
706 *
707 * If this property specifies a "no data" value, and the raw value is equal to
708 * this "no data" value, the value is returned as-is.
709 *
710 * If this property is an empty property with a specified default value, it
711 * will not have any raw data to retrieve. The returned value will be empty.
712
713 * @param Property The property attribute property.
714 * @param Index The index.
715 * @return The raw property value.
716 */
717 UFUNCTION(
718 BlueprintCallable,
719 BlueprintPure,
720 Category = "Cesium|Metadata|PropertyAttributeProperty")
722 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
723 int64 Index);
724
725 /**
726 * Whether this property is normalized. Only applicable when this property has
727 * an integer component type.
728 *
729 * @param Property The property attribute property.
730 * @return Whether this property is normalized.
731 */
732 UFUNCTION(
733 BlueprintCallable,
734 BlueprintPure,
735 Category = "Cesium|Metadata|PropertyAttributeProperty")
736 static bool
737 IsNormalized(UPARAM(ref) const FCesiumPropertyAttributeProperty& Property);
738
739 /**
740 * Gets the offset of this property. This can be defined by the class property
741 * that it implements, or overridden by the instance of the property itself.
742 *
743 * This is only applicable to properties with floating-point or normalized
744 * integer component types. If an offset is not defined or applicable, this
745 * returns an empty value.
746 *
747 * @param Property The property attribute property.
748 * @return The offset of the property.
749 */
750 UFUNCTION(
751 BlueprintCallable,
752 BlueprintPure,
753 Category = "Cesium|Metadata|PropertyAttributeProperty")
755 GetOffset(UPARAM(ref) const FCesiumPropertyAttributeProperty& Property);
756
757 /**
758 * Gets the scale of this property. This can be defined by the class property
759 * that it implements, or overridden by the instance of the property itself.
760 *
761 * This is only applicable to properties with floating-point or normalized
762 * integer component types. If a scale is not defined or applicable, this
763 * returns an empty value.
764 *
765 * @param Property The property attribute property.
766 * @return The scale of the property.
767 */
768 UFUNCTION(
769 BlueprintCallable,
770 BlueprintPure,
771 Category = "Cesium|Metadata|PropertyAttributeProperty")
773 GetScale(UPARAM(ref) const FCesiumPropertyAttributeProperty& Property);
774
775 /**
776 * Gets the minimum value of this property. This can be defined by the class
777 * property that it implements, or overridden by the instance of the property
778 * itself.
779 *
780 * This is only applicable to scalar, vecN and matN properties. It represents
781 * the component-wise minimum of all property values with normalization,
782 * offset, and scale applied. If a minimum value is not defined or
783 * applicable, this returns an empty value.
784 *
785 * @param Property The property attribute property.
786 * @return The minimum value of the property.
787 */
788 UFUNCTION(
789 BlueprintCallable,
790 BlueprintPure,
791 Category = "Cesium|Metadata|PropertyAttributeProperty")
794
795 /**
796 * Gets the maximum value of this property. This can be defined by the class
797 * property that it implements, or overridden by the instance of the property
798 * itself.
799 *
800 * This is only applicable to scalar, vecN and matN properties. It represents
801 * the component-wise maximum of all property values with normalization,
802 * offset, and scale applied. If a maximum value is not defined or applicable,
803 * this returns an empty value.
804 *
805 * @param Property The property attribute property.
806 * @return The maximum value of the property.
807 */
808 UFUNCTION(
809 BlueprintCallable,
810 BlueprintPure,
811 Category = "Cesium|Metadata|PropertyAttributeProperty")
814
815 /**
816 * Gets the "no data" value of this property, as defined by its class
817 * property. This value functions a sentinel value, indicating missing data
818 * wherever it appears. The value is compared against the property's raw data,
819 * without normalization, offset, or scale applied.
820 *
821 * If a "no data" value is not defined or applicable, this returns an empty
822 * value.
823 *
824 * @param Property The property attribute property.
825 * @return The "no data" value of the property.
826 */
827 UFUNCTION(
828 BlueprintCallable,
829 BlueprintPure,
830 Category = "Cesium|Metadata|PropertyAttributeProperty")
833
834 /**
835 * Gets the default value of this property, as defined by its class
836 * property. This default value is used use when encountering a "no data"
837 * value in the property.
838 *
839 * If a default value is not defined, this returns an empty value.
840 *
841 * @param Property The property attribute property.
842 * @return The default value of the property.
843 */
844 UFUNCTION(
845 BlueprintCallable,
846 BlueprintPure,
847 Category = "Cesium|Metadata|PropertyAttributeProperty")
850};
ECesiumMetadataBlueprintType
The Blueprint type that can losslessly represent values of a given property.
ECesiumPropertyAttributePropertyStatus
Reports the status of a FCesiumPropertyAttributeProperty.
static double GetFloat64(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, double DefaultValue=0.0)
Attempts to retrieve the value for the given index as a double-precision floating-point number.
static FVector GetVector(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, const FVector &DefaultValue)
Attempts to retrieve the value for the given index as a FVector.
static FVector2D GetVector2D(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, const FVector2D &DefaultValue)
Attempts to retrieve the value for the given index as a FVector2D.
static ECesiumMetadataBlueprintType GetBlueprintType(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property)
Gets the best-fitting type for the property that is accessible from Blueprints.
static ECesiumPropertyAttributePropertyStatus GetPropertyAttributePropertyStatus(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property)
Gets the status of the property attribute property.
static FCesiumMetadataValue GetRawValue(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index)
Retrieves the raw value of the property for the given index.
static FIntPoint GetIntPoint(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, const FIntPoint &DefaultValue)
Attempts to retrieve the value for the given index as a FIntPoint.
static FCesiumMetadataValueType GetValueType(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property)
Gets the type of the metadata value as defined in the EXT_structural_metadata extension.
static int64 GetPropertySize(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property)
Gets the number of values in the property.
static FVector3f GetVector3f(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, const FVector3f &DefaultValue)
Attempts to retrieve the value for the given index as a FVector3f.
static FCesiumMetadataValue GetScale(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property)
Gets the scale of this property.
static int64 GetInteger64(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, int64 DefaultValue=0)
Attempts to retrieve the value for the given index as a signed 64-bit integer.
static FCesiumMetadataValue GetDefaultValue(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property)
Gets the default value of this property, as defined by its class property.
static FCesiumMetadataValue GetOffset(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property)
Gets the offset of this property.
static FMatrix GetMatrix(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, const FMatrix &DefaultValue)
Attempts to retrieve the value for the given index as a FMatrix.
static FCesiumMetadataValue GetMinimumValue(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property)
Gets the minimum value of this property.
static int32 GetInteger(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, int32 DefaultValue=0)
Attempts to retrieve the value for the given index as a signed 32-bit integer.
static bool IsNormalized(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property)
Whether this property is normalized.
static float GetFloat(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, float DefaultValue=0.0f)
Attempts to retrieve the value for the given index as a single-precision floating-point number.
static FIntVector GetIntVector(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, const FIntVector &DefaultValue)
Attempts to retrieve the value for the given index as a FIntVector.
static FVector4 GetVector4(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, const FVector4 &DefaultValue)
Attempts to retrieve the value for the given index as a FVector4.
static FCesiumMetadataValue GetMaximumValue(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property)
Gets the maximum value of this property.
static FCesiumMetadataValue GetValue(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index)
Retrieves the value of the property for the given index.
static uint8 GetByte(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property, int64 Index, uint8 DefaultValue=0)
Attempts to retrieve the value at the given index as an unsigned 8-bit integer.
static FCesiumMetadataValue GetNoDataValue(UPARAM(ref) const FCesiumPropertyAttributeProperty &Property)
Gets the "no data" value of this property, as defined by its class property.
Stores information on the values of an enum and the corresponding names of those values.
Represents the true value type of a metadata value, akin to the property types in EXT_structural_meta...
A Blueprint-accessible wrapper for a glTF metadata value.
A Blueprint-accessible wrapper for a glTF property attribute property in EXT_structural_metadata.
FCesiumPropertyAttributeProperty()
Construct an invalid property with an unknown type.
FCesiumPropertyAttributeProperty(const CesiumGltf::PropertyAttributePropertyView< T, Normalized > &Property, const TSharedPtr< FCesiumMetadataEnum > &EnumDefinition)
Construct a wrapper for the property attribute property view.
FCesiumPropertyAttributeProperty(const CesiumGltf::PropertyAttributePropertyView< T, Normalized > &Property)
Construct a wrapper for the property attribute property view.