Cesium for Unreal 2.24.1
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
126 /**
127 * @brief Gets the stride of the underlying accessor.
128 */
129 int64 getAccessorStride() const;
130
131 /**
132 * @brief Gets a pointer to the first byte of the underlying accessor's data.
133 */
134 const std::byte* getAccessorData() const;
135
136private:
138
139 std::any _property;
140
141 FCesiumMetadataValueType _valueType;
142 bool _normalized;
143 TSharedPtr<FCesiumMetadataEnum> _pEnumDefinition;
144
146};
147
148UCLASS()
150 : public UBlueprintFunctionLibrary {
151 GENERATED_BODY()
152
153public:
154 /**
155 * Gets the status of the property attribute property. If this property
156 * attribute property is invalid in any way, this will briefly indicate why.
157 *
158 * @param Property The property attribute property.
159 */
160 UFUNCTION(
161 BlueprintCallable,
162 BlueprintPure,
163 Category = "Cesium|Metadata|PropertyAttributeProperty")
166 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property);
167
168 /**
169 * Gets the best-fitting type for the property that is accessible from
170 * Blueprints. For the most precise representation of the values possible in
171 * Blueprints, you should retrieve it using this type.
172 *
173 * @param Property The property attribute property.
174 */
175 UFUNCTION(
176 BlueprintCallable,
177 BlueprintPure,
178 Category = "Cesium|Metadata|PropertyAttributeProperty")
181 const FCesiumPropertyAttributeProperty& Property);
182
183 /**
184 * Gets the type of the metadata value as defined in the
185 * EXT_structural_metadata extension. Many of these types are not accessible
186 * from Blueprints, but can be converted to a Blueprint-accessible type.
187 *
188 * @param Property The property attribute property.
189 */
190 UFUNCTION(
191 BlueprintCallable,
192 BlueprintPure,
193 Category = "Cesium|Metadata|PropertyAttributeProperty")
195 GetValueType(UPARAM(ref) const FCesiumPropertyAttributeProperty& Property);
196
197 /**
198 * Gets the number of values in the property.
199 *
200 * @param Property The property attribute property.
201 */
202 UFUNCTION(
203 BlueprintCallable,
204 BlueprintPure,
205 Category = "Cesium|Metadata|PropertyAttributeProperty")
206 static int64
208
209 /**
210 * Attempts to retrieve the value at the given index as an unsigned 8-bit
211 * integer.
212 *
213 * For numeric properties, the raw value will be transformed by the property's
214 * normalization, scale, and offset before it is further converted. If the raw
215 * value is equal to the property's "no data" value, then the property's
216 * default value will be converted if possible. If the property-defined
217 * default value cannot be converted, or does not exist, then the user-defined
218 * default value is returned.
219 *
220 * If the value is an integer between 0 and 255, it is returned as-is.
221 * Otherwise, if the value is a floating-point number in the aforementioned
222 * range, it is truncated (rounded toward zero) and returned.
223 *
224 * In all other cases, the user-defined default value is returned. If the
225 * index is out-of-range, or if the property attribute property is somehow
226 * invalid, the user-defined default value is returned.
227 *
228 * @param Property The property attribute property.
229 * @param Index The index.
230 * @param DefaultValue The default value to fall back on.
231 * @return The property value as a Byte.
232 */
233 UFUNCTION(
234 BlueprintCallable,
235 BlueprintPure,
236 Category = "Cesium|Metadata|PropertyAttributeProperty")
237 static uint8 GetByte(
238 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
239 int64 Index,
240 uint8 DefaultValue = 0);
241
242 /**
243 * Attempts to retrieve the value for the given index as a signed 32-bit
244 * integer.
245 *
246 * Although property attribute properties do not directly support
247 * 32-bit signed integers, this can be used to losslessly retrieve values from
248 * smaller integer properties.
249 *
250 * For numeric properties, the raw value will be transformed by the property's
251 * normalization, scale, and offset before it is further converted. If the raw
252 * value is equal to the property's "no data" value, then the property's
253 * default value will be converted if possible. If the property-defined
254 * default value cannot be converted, or does not exist, then the user-defined
255 * default value is returned.
256 *
257 * If the value is an integer between -2,147,483,648 and 2,147,483,647, it
258 * is returned as-is. Otherwise, if the value is a floating-point number in
259 * the aforementioned range, it is truncated (rounded toward zero) and
260 * returned.
261 *
262 * In all other cases, the user-defined default value is returned. If the
263 * index is out-of-range, or if the property attribute property is
264 * somehow invalid, the user-defined default value is returned.
265 *
266 * @param Property The property attribute property.
267 * @param Index The index.
268 * @param DefaultValue The default value to fall back on.
269 * @return The property value as an Integer.
270 */
271 UFUNCTION(
272 BlueprintCallable,
273 BlueprintPure,
274 Category = "Cesium|Metadata|PropertyAttributeProperty")
275 static int32 GetInteger(
276 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
277 int64 Index,
278 int32 DefaultValue = 0);
279
280 /**
281 * Attempts to retrieve the value for the given index as a signed 64-bit
282 * integer.
283 *
284 * Although property attribute properties do not directly support
285 * 64-bit integers, this can be used to losslessly retrieve values from
286 * unsigned 32-bit integer properties.
287 *
288 * For numeric properties, the raw value will be transformed by the property's
289 * normalization, scale, and offset before it is further converted. If the raw
290 * value is equal to the property's "no data" value, then the property's
291 * default value will be converted if possible. If the property-defined
292 * default value cannot be converted, or does not exist, then the user-defined
293 * default value is returned.
294 *
295 * If the value is an integer and between -2^63 and (2^63 - 1), it is
296 * returned as-is. Otherwise, if the value is a floating-point number in the
297 * aforementioned range, it is truncated (rounded toward zero) and returned.
298 *
299 * In all other cases, the user-defined default value is returned. If the
300 * index ID is out-of-range, or if the property table property is somehow
301 * invalid, the user-defined default value is returned.
302 *
303 * @param Property The property table property.
304 * @param Index The index.
305 * @param DefaultValue The default value to fall back on.
306 * @return The property value as an Integer64.
307 */
308 UFUNCTION(
309 BlueprintCallable,
310 BlueprintPure,
311 Category = "Cesium|Metadata|PropertyAttributeProperty")
312 static int64 GetInteger64(
313 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
314 int64 Index,
315 int64 DefaultValue = 0);
316
317 /**
318 * Attempts to retrieve the value for the given index as a single-precision
319 * floating-point number.
320 *
321 * For numeric properties, the raw value will be transformed by the property's
322 * normalization, scale, and offset before it is further converted. If the raw
323 * value is equal to the property's "no data" value, then the property's
324 * default value will be converted if possible. If the property-defined
325 * default value cannot be converted, or does not exist, then the user-defined
326 * default value is returned.
327 *
328 * If the value is already a single-precision floating-point number, it is
329 * returned as-is. Otherwise, if the value is a scalar of any other type
330 * within the range of values that a single-precision float can represent, it
331 * is converted to its closest representation as a single-precision float and
332 * returned.
333 *
334 * In all other cases, the user-defined default value is returned. If the
335 * index is out-of-range, or if the property attribute property is
336 * somehow invalid, the user-defined default value is returned.
337 *
338 * @param Property The property attribute property.
339 * @param Index The index.
340 * @param DefaultValue The default value to fall back on.
341 * @return The property value as a Float.
342 */
343 UFUNCTION(
344 BlueprintCallable,
345 BlueprintPure,
346 Category = "Cesium|Metadata|PropertyAttributeProperty")
347 static float GetFloat(
348 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
349 int64 Index,
350 float DefaultValue = 0.0f);
351
352 /**
353 * Attempts to retrieve the value for the given index as a double-precision
354 * floating-point number.
355 *
356 * For numeric properties, the raw value will be transformed by the property's
357 * normalization, scale, and offset before it is further converted. If the raw
358 * value is equal to the property's "no data" value, then the property's
359 * default value will be converted if possible. If the property-defined
360 * default value cannot be converted, or does not exist, then the user-defined
361 * default value is returned.
362 *
363 * If the value is a single-precision floating-point number, it is returned
364 * as-is. Otherwise, if the value is an integer, it is converted to the
365 * closest representation as a double-precision floating-point number.
366 *
367 * In all other cases, the user-defined default value is returned. If the
368 * index is out-of-range, or if the property attribute property is
369 * somehow invalid, the user-defined default value is returned.
370 *
371 * @param Property The property attribute property.
372 * @param Index The index.
373 * @param DefaultValue The default value to fall back on.
374 * @return The property value as a Float64.
375 */
376 UFUNCTION(
377 BlueprintCallable,
378 BlueprintPure,
379 Category = "Cesium|Metadata|PropertyAttributeProperty")
380 static double GetFloat64(
381 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
382 int64 Index,
383 double DefaultValue = 0.0);
384
385 /**
386 * Attempts to retrieve the value for the given index as a FIntPoint.
387 *
388 * For numeric properties, the raw value will be transformed by the property's
389 * normalization, scale, and offset before it is further converted. If the raw
390 * value is equal to the property's "no data" value, then the property's
391 * default value will be converted if possible. If the property-defined
392 * default value cannot be converted, or does not exist, then the user-defined
393 * default value is returned.
394 *
395 * Property values are converted as follows:
396 *
397 * - If the value is a 2-dimensional vector, its components will be converted
398 * to 32-bit signed integers if possible.
399 *
400 * - If the value is a 3- or 4-dimensional vector, it will use the first two
401 * components to construct the FIntPoint.
402 *
403 * - If the value is a scalar that can be converted to a 32-bit signed
404 * integer, the resulting FIntPoint will have this value in both of its
405 * components.
406 *
407 * In all other cases, the user-defined default value is returned. In all
408 * vector cases, if any of the relevant components cannot be represented as a
409 * 32-bit signed, the default value is returned.
410 *
411 * If the index is out-of-range, or if the property attribute property is
412 * somehow invalid, the user-defined default value is returned.
413 *
414 * @param Property The property attribute property.
415 * @param Index The index.
416 * @param DefaultValue The default value to fall back on.
417 * @return The property value as a FIntPoint.
418 */
419 UFUNCTION(
420 BlueprintCallable,
421 BlueprintPure,
422 Category = "Cesium|Metadata|PropertyAttributeProperty")
423 static FIntPoint GetIntPoint(
424 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
425 int64 Index,
426 const FIntPoint& DefaultValue);
427
428 /**
429 * Attempts to retrieve the value for the given index as a FVector2D.
430 *
431 * For numeric properties, the raw value will be transformed by the property's
432 * normalization, scale, and offset before it is further converted. If the raw
433 * value is equal to the property's "no data" value, then the property's
434 * default value will be converted if possible. If the property-defined
435 * default value cannot be converted, or does not exist, then the user-defined
436 * default value is returned.
437 *
438 * Property values are converted as follows:
439 *
440 * - If the value is a 2-dimensional vector, its components will be converted
441 * to double-precision floating-point numbers.
442 *
443 * - If the value is a 3- or 4-dimensional vector, it will use the first two
444 * components to construct the FVector2D.
445 *
446 * - If the value is a scalar, the resulting FVector2D will have this value in
447 * both of its components.
448 *
449 * In all other cases, the user-defined default value is returned. If the
450 * index is out-of-range, or if the property attribute property is
451 * somehow invalid, the user-defined default value is returned.
452 *
453 * @param Property The property attribute property.
454 * @param Index The index.
455 * @param DefaultValue The default value to fall back on.
456 * @return The property value as a FVector2D.
457 */
458 UFUNCTION(
459 BlueprintCallable,
460 BlueprintPure,
461 Category = "Cesium|Metadata|PropertyAttributeProperty")
462 static FVector2D GetVector2D(
463 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
464 int64 Index,
465 const FVector2D& DefaultValue);
466
467 /**
468 * Attempts to retrieve the value for the given index as a FIntVector.
469 *
470 * For numeric properties, the raw value will be transformed by the property's
471 * normalization, scale, and offset before it is further converted. If the raw
472 * value is equal to the property's "no data" value, then the property's
473 * default value will be converted if possible. If the property-defined
474 * default value cannot be converted, or does not exist, then the user-defined
475 * default value is returned.
476 *
477 * Property values are converted as follows:
478 *
479 * - If the value is a 3-dimensional vector, its components will be converted
480 * to 32-bit signed integers if possible.
481 *
482 * - If the value is a 4-dimensional vector, it will use the first three
483 * components to construct the FIntVector.
484 *
485 * - If the value is a 2-dimensional vector, it will become the XY-components
486 * of the FIntVector. The Z component will be set to zero.
487 *
488 * - If the value is a scalar that can be converted to a 32-bit signed
489 * integer, the resulting FIntVector will have this value in all of its
490 * components.
491 *
492 * In all other cases, the user-defined default value is returned. In all
493 * vector cases, if any of the relevant components cannot be represented as a
494 * 32-bit signed integer, the default value is returned.
495 *
496 * If the index is out-of-range, or if the property attribute property is
497 * somehow invalid, the user-defined default value is returned.
498 *
499 * @param Property The property attribute property.
500 * @param Index The index.
501 * @param DefaultValue The default value to fall back on.
502 * @return The property value as a FIntVector.
503 */
504 UFUNCTION(
505 BlueprintCallable,
506 BlueprintPure,
507 Category = "Cesium|Metadata|PropertyAttributeProperty")
508 static FIntVector GetIntVector(
509 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
510 int64 Index,
511 const FIntVector& DefaultValue);
512
513 /**
514 * Attempts to retrieve the value for the given index as a FVector3f.
515 *
516 * For numeric properties, the raw value transformed by the property's
517 * normalization, scale, and offset before it is further converted. If the raw
518 * value is equal to the property's "no data" value, then the property's
519 * default value will be converted if possible. If the property-defined
520 * default value cannot be converted, or does not exist, then the user-defined
521 * default value is returned.
522 *
523 * Property values are converted as follows:
524 *
525 * - If the value is a 3-dimensional vector, its components will be converted
526 * to the closest represenattribute single-precision floats, if possible.
527 *
528 * - If the value is a 4-dimensional vector, a FVector3f containing the first
529 * three components will be returned.
530 *
531 * - If the value is a 2-dimensional vector, it will become the XY-components
532 * of the FVector3f. The Z-component will be set to zero.
533 *
534 * - If the value is a scalar that can be converted to a single-precision
535 * floating-point number, then the resulting FVector3f will have this value in
536 * all of its components.
537 *
538 * In all other cases, the user-defined default value is returned. In all
539 * vector cases, if any of the relevant components cannot be represented as a
540 * single-precision float, the user-defined default value is returned.
541 *
542 * If the index is out-of-range, or if the property attribute property is
543 * somehow invalid, the user-defined default value is returned.
544 *
545 * @param Property The property attribute property.
546 * @param Index The index.
547 * @param DefaultValue The default value to fall back on.
548 * @return The property value as a FVector3f.
549 */
550 UFUNCTION(
551 BlueprintCallable,
552 BlueprintPure,
553 Category = "Cesium|Metadata|PropertyAttributeProperty")
554 static FVector3f GetVector3f(
555 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
556 int64 Index,
557 const FVector3f& DefaultValue);
558
559 /**
560 * Attempts to retrieve the value for the given index as a FVector.
561 *
562 * For numeric properties, the raw value will be transformed by the property's
563 * normalization, scale, and offset before it is further converted. If the raw
564 * value is equal to the property's "no data" value, then the property's
565 * default value will be converted if possible. If the property-defined
566 * default value cannot be converted, or does not exist, then the user-defined
567 * default value is returned.
568 *
569 * Property values are converted as follows:
570 *
571 * - If the value is a 3-dimensional vector, its components will be converted
572 * to double-precision floating-point numbers.
573 *
574 * - If the value is a 4-dimensional vector, a FVector containing the first
575 * three components will be returned.
576 *
577 * - If the value is a 2-dimensional vector, it will become the XY-components
578 * of the FVector. The Z-component will be set to zero.
579 *
580 * - If the value is a scalar, then the resulting FVector will have this value
581 * as a double-precision floating-point number in all of its components.
582 *
583 * In all other cases, the user-defined default value is returned. If the
584 * index is out-of-range, or if the property attribute property is
585 * somehow invalid, the user-defined default value is returned.
586 *
587 * @param Property The property attribute property.
588 * @param Index The index.
589 * @param DefaultValue The default value to fall back on.
590 * @return The property value as a FVector.
591 */
592 UFUNCTION(
593 BlueprintCallable,
594 BlueprintPure,
595 Category = "Cesium|Metadata|PropertyAttributeProperty")
596 static FVector GetVector(
597 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
598 int64 Index,
599 const FVector& DefaultValue);
600
601 /**
602 * Attempts to retrieve the value for the given index as a FVector4.
603 *
604 * For numeric properties, the raw value will be transformed by the property's
605 * normalization, scale, and offset before it is further converted. If the raw
606 * value is equal to the property's "no data" value, then the property's
607 * default value will be converted if possible. If the property-defined
608 * default value cannot be converted, or does not exist, then the user-defined
609 * default value is returned.
610 *
611 * Property values are converted as follows:
612 *
613 * - If the value is a 4-dimensional vector, its components will be converted
614 * to double-precision floating-point numbers.
615 *
616 * - If the value is a 3-dimensional vector, it will become the XYZ-components
617 * of the FVector4. The W-component will be set to zero.
618 *
619 * - If the value is a 2-dimensional vector, it will become the XY-components
620 * of the FVector4. The Z- and W-components will be set to zero.
621 *
622 * - If the value is a scalar, then the resulting FVector4 will have this
623 * value as a double-precision floating-point number in all of its components.
624 *
625 * In all other cases, the user-defined default value is returned. If the
626 * index is out-of-range, or if the property attribute property is
627 * somehow invalid, the user-defined default value is returned.
628 *
629 * @param Property The property attribute property.
630 * @param Index The index.
631 * @param DefaultValue The default value to fall back on.
632 * @return The property value as a FVector4.
633 */
634 UFUNCTION(
635 BlueprintCallable,
636 BlueprintPure,
637 Category = "Cesium|Metadata|PropertyAttributeProperty")
638 static FVector4 GetVector4(
639 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
640 int64 Index,
641 const FVector4& DefaultValue);
642
643 /**
644 * Attempts to retrieve the value for the given index as a FMatrix.
645 *
646 * For numeric properties, the raw value will be transformed by the property's
647 * normalization, scale, and offset before it is further converted. If the raw
648 * value is equal to the property's "no data" value, then the property's
649 * default value will be converted if possible. If the property-defined
650 * default value cannot be converted, or does not exist, then the user-defined
651 * default value is returned.
652 *
653 * Property values are converted as follows:
654 *
655 * - If the value is a 4-by-4 matrix, its components will be converted to
656 * double-precision floating-point numbers.
657 *
658 * - If the value is a 3-by-3 matrix, it will initialize the corresponding
659 * entries of the FMatrix, while all other entries are set to zero. In other
660 * words, the 3-by-3 matrix is returned in an FMatrix where the fourth row and
661 * column are filled with zeroes.
662 *
663 * - If the value is a 2-by-2 matrix, it will initialize the corresponding
664 * entries of the FMatrix, while all other entries are set to zero. In other
665 * words, the 2-by-2 matrix is returned in an FMatrix where the third and
666 * fourth rows / columns are filled with zeroes.
667 *
668 * - If the value is a scalar, then the resulting FMatrix will have this value
669 * along its diagonal, including the very last component. All other entries
670 * will be zero.
671 *
672 * In all other cases, the user-defined default value is returned. If the
673 * index is out-of-range, or if the property attribute property is
674 * somehow invalid, the user-defined default value is returned.
675 *
676 * @param Property The property attribute property.
677 * @param Index The index.
678 * @param DefaultValue The default value to fall back on.
679 * @return The property value as a FMatrix.
680 */
681 UFUNCTION(
682 BlueprintCallable,
683 BlueprintPure,
684 Category = "Cesium|Metadata|PropertyAttributeProperty")
685 static FMatrix GetMatrix(
686 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
687 int64 Index,
688 const FMatrix& DefaultValue);
689
690 /**
691 * Retrieves the value of the property for the given index. This allows the
692 * value to be acted on more generically; its true value can be retrieved
693 * later as a specific Blueprints type.
694 *
695 * For numeric properties, the raw value will be transformed by the property's
696 * normalization, scale, and offset before it is returned. If the raw value is
697 * equal to the property's "no data" value, an empty value will be returned.
698 * However, if the property itself specifies a default value, then the
699 * property-defined default value will be returned.
700 *
701 * @param Property The property attribute property.
702 * @param Index The index.
703 * @return The property value.
704 */
705 UFUNCTION(
706 BlueprintCallable,
707 BlueprintPure,
708 Category = "Cesium|Metadata|PropertyAttributeProperty")
710 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
711 int64 Index);
712
713 /**
714 * Retrieves the raw value of the property for the given index. This is the
715 * value of the property without normalization, offset, or scale applied.
716 *
717 * If this property specifies a "no data" value, and the raw value is equal to
718 * this "no data" value, the value is returned as-is.
719 *
720 * If this property is an empty property with a specified default value, it
721 * will not have any raw data to retrieve. The returned value will be empty.
722
723 * @param Property The property attribute property.
724 * @param Index The index.
725 * @return The raw property value.
726 */
727 UFUNCTION(
728 BlueprintCallable,
729 BlueprintPure,
730 Category = "Cesium|Metadata|PropertyAttributeProperty")
732 UPARAM(ref) const FCesiumPropertyAttributeProperty& Property,
733 int64 Index);
734
735 /**
736 * Whether this property is normalized. Only applicable when this property has
737 * an integer component type.
738 *
739 * @param Property The property attribute property.
740 * @return Whether this property is normalized.
741 */
742 UFUNCTION(
743 BlueprintCallable,
744 BlueprintPure,
745 Category = "Cesium|Metadata|PropertyAttributeProperty")
746 static bool
747 IsNormalized(UPARAM(ref) const FCesiumPropertyAttributeProperty& Property);
748
749 /**
750 * Gets the offset of this property. This can be defined by the class property
751 * that it implements, or overridden by the instance of the property itself.
752 *
753 * This is only applicable to properties with floating-point or normalized
754 * integer component types. If an offset is not defined or applicable, this
755 * returns an empty value.
756 *
757 * @param Property The property attribute property.
758 * @return The offset of the property.
759 */
760 UFUNCTION(
761 BlueprintCallable,
762 BlueprintPure,
763 Category = "Cesium|Metadata|PropertyAttributeProperty")
765 GetOffset(UPARAM(ref) const FCesiumPropertyAttributeProperty& Property);
766
767 /**
768 * Gets the scale of this property. This can be defined by the class property
769 * that it implements, or overridden by the instance of the property itself.
770 *
771 * This is only applicable to properties with floating-point or normalized
772 * integer component types. If a scale is not defined or applicable, this
773 * returns an empty value.
774 *
775 * @param Property The property attribute property.
776 * @return The scale of the property.
777 */
778 UFUNCTION(
779 BlueprintCallable,
780 BlueprintPure,
781 Category = "Cesium|Metadata|PropertyAttributeProperty")
783 GetScale(UPARAM(ref) const FCesiumPropertyAttributeProperty& Property);
784
785 /**
786 * Gets the minimum value of this property. This can be defined by the class
787 * property that it implements, or overridden by the instance of the property
788 * itself.
789 *
790 * This is only applicable to scalar, vecN and matN properties. It represents
791 * the component-wise minimum of all property values with normalization,
792 * offset, and scale applied. If a minimum value is not defined or
793 * applicable, this returns an empty value.
794 *
795 * @param Property The property attribute property.
796 * @return The minimum value of the property.
797 */
798 UFUNCTION(
799 BlueprintCallable,
800 BlueprintPure,
801 Category = "Cesium|Metadata|PropertyAttributeProperty")
804
805 /**
806 * Gets the maximum value of this property. This can be defined by the class
807 * property that it implements, or overridden by the instance of the property
808 * itself.
809 *
810 * This is only applicable to scalar, vecN and matN properties. It represents
811 * the component-wise maximum of all property values with normalization,
812 * offset, and scale applied. If a maximum value is not defined or applicable,
813 * this returns an empty value.
814 *
815 * @param Property The property attribute property.
816 * @return The maximum value of the property.
817 */
818 UFUNCTION(
819 BlueprintCallable,
820 BlueprintPure,
821 Category = "Cesium|Metadata|PropertyAttributeProperty")
824
825 /**
826 * Gets the "no data" value of this property, as defined by its class
827 * property. This value functions a sentinel value, indicating missing data
828 * wherever it appears. The value is compared against the property's raw data,
829 * without normalization, offset, or scale applied.
830 *
831 * If a "no data" value is not defined or applicable, this returns an empty
832 * value.
833 *
834 * @param Property The property attribute property.
835 * @return The "no data" value of the property.
836 */
837 UFUNCTION(
838 BlueprintCallable,
839 BlueprintPure,
840 Category = "Cesium|Metadata|PropertyAttributeProperty")
843
844 /**
845 * Gets the default value of this property, as defined by its class
846 * property. This default value is used use when encountering a "no data"
847 * value in the property.
848 *
849 * If a default value is not defined, this returns an empty value.
850 *
851 * @param Property The property attribute property.
852 * @return The default value of the property.
853 */
854 UFUNCTION(
855 BlueprintCallable,
856 BlueprintPure,
857 Category = "Cesium|Metadata|PropertyAttributeProperty")
860};
ECesiumMetadataBlueprintType
The Blueprint type that can losslessly represent values of a given property.
ECesiumPropertyAttributePropertyStatus
Reports the status of a FCesiumPropertyAttributeProperty.
USTRUCT() struct FCesiumVoxelClassDescription
Description of the metadata properties available in the class used by the 3DTILES_content_voxels exte...
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.
int64 getAccessorStride() const
Gets the stride of the underlying accessor.
const std::byte * getAccessorData() const
Gets a pointer to the first byte of the underlying accessor's data.