8#include "Kismet/BlueprintFunctionLibrary.h"
9#include "UObject/ObjectMacros.h"
11#include <CesiumGltf/PropertyAttributePropertyView.h>
12#include <CesiumGltf/PropertyTypeTraits.h>
15#include "CesiumPropertyAttributeProperty.generated.h"
43 GENERATED_USTRUCT_BODY()
61 template <
typename T,
bool Normalized>
75 template <
typename T,
bool Normalized>
78 const TSharedPtr<FCesiumMetadataEnum>& EnumDefinition)
82 _normalized(Normalized),
83 _pEnumDefinition(EnumDefinition) {
84 switch (Property.status()) {
85 case CesiumGltf::PropertyAttributePropertyViewStatus::Valid:
86 _status = ECesiumPropertyAttributePropertyStatus::Valid;
88 case CesiumGltf::PropertyAttributePropertyViewStatus::
89 EmptyPropertyWithDefault:
91 ECesiumPropertyAttributePropertyStatus::EmptyPropertyWithDefault;
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:
118 ECesiumPropertyAttributePropertyStatus::ErrorInvalidPropertyData;
122 _valueType = TypeToMetadataValueType<T>(EnumDefinition);
123 _normalized = Normalized;
133 TSharedPtr<FCesiumMetadataEnum> _pEnumDefinition;
140 : public UBlueprintFunctionLibrary {
153 Category =
"Cesium|Metadata|PropertyAttributeProperty")
168 Category =
"Cesium|Metadata|PropertyAttributeProperty")
183 Category =
"Cesium|Metadata|PropertyAttributeProperty")
195 Category =
"Cesium|Metadata|PropertyAttributeProperty")
226 Category =
"Cesium|Metadata|PropertyAttributeProperty")
230 uint8 DefaultValue = 0);
264 Category =
"Cesium|Metadata|PropertyAttributeProperty")
268 int32 DefaultValue = 0);
301 Category =
"Cesium|Metadata|PropertyAttributeProperty")
305 int64 DefaultValue = 0);
336 Category =
"Cesium|Metadata|PropertyAttributeProperty")
340 float DefaultValue = 0.0f);
369 Category =
"Cesium|Metadata|PropertyAttributeProperty")
373 double DefaultValue = 0.0);
412 Category =
"Cesium|Metadata|PropertyAttributeProperty")
416 const FIntPoint& DefaultValue);
451 Category =
"Cesium|Metadata|PropertyAttributeProperty")
455 const FVector2D& DefaultValue);
497 Category =
"Cesium|Metadata|PropertyAttributeProperty")
501 const FIntVector& DefaultValue);
543 Category =
"Cesium|Metadata|PropertyAttributeProperty")
547 const FVector3f& DefaultValue);
585 Category =
"Cesium|Metadata|PropertyAttributeProperty")
589 const FVector& DefaultValue);
627 Category =
"Cesium|Metadata|PropertyAttributeProperty")
631 const FVector4& DefaultValue);
674 Category =
"Cesium|Metadata|PropertyAttributeProperty")
678 const FMatrix& DefaultValue);
698 Category =
"Cesium|Metadata|PropertyAttributeProperty")
720 Category =
"Cesium|Metadata|PropertyAttributeProperty")
735 Category =
"Cesium|Metadata|PropertyAttributeProperty")
753 Category =
"Cesium|Metadata|PropertyAttributeProperty")
771 Category =
"Cesium|Metadata|PropertyAttributeProperty")
791 Category =
"Cesium|Metadata|PropertyAttributeProperty")
811 Category =
"Cesium|Metadata|PropertyAttributeProperty")
830 Category =
"Cesium|Metadata|PropertyAttributeProperty")
847 Category =
"Cesium|Metadata|PropertyAttributeProperty")
ECesiumPropertyAttributePropertyStatus
Reports the status of a FCesiumPropertyAttributeProperty.
@ EmptyPropertyWithDefault
@ ErrorInvalidPropertyData
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.
A Blueprint-accessible wrapper for a glTF property attribute property in EXT_structural_metadata.
FCesiumPropertyAttributeProperty()
Construct an invalid property with an unknown type.
friend class UCesiumPropertyAttributePropertyBlueprintLibrary
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.