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;
143 TSharedPtr<FCesiumMetadataEnum> _pEnumDefinition;
150 : public UBlueprintFunctionLibrary {
163 Category =
"Cesium|Metadata|PropertyAttributeProperty")
178 Category =
"Cesium|Metadata|PropertyAttributeProperty")
193 Category =
"Cesium|Metadata|PropertyAttributeProperty")
205 Category =
"Cesium|Metadata|PropertyAttributeProperty")
236 Category =
"Cesium|Metadata|PropertyAttributeProperty")
240 uint8 DefaultValue = 0);
274 Category =
"Cesium|Metadata|PropertyAttributeProperty")
278 int32 DefaultValue = 0);
311 Category =
"Cesium|Metadata|PropertyAttributeProperty")
315 int64 DefaultValue = 0);
346 Category =
"Cesium|Metadata|PropertyAttributeProperty")
350 float DefaultValue = 0.0f);
379 Category =
"Cesium|Metadata|PropertyAttributeProperty")
383 double DefaultValue = 0.0);
422 Category =
"Cesium|Metadata|PropertyAttributeProperty")
426 const FIntPoint& DefaultValue);
461 Category =
"Cesium|Metadata|PropertyAttributeProperty")
465 const FVector2D& DefaultValue);
507 Category =
"Cesium|Metadata|PropertyAttributeProperty")
511 const FIntVector& DefaultValue);
553 Category =
"Cesium|Metadata|PropertyAttributeProperty")
557 const FVector3f& DefaultValue);
595 Category =
"Cesium|Metadata|PropertyAttributeProperty")
599 const FVector& DefaultValue);
637 Category =
"Cesium|Metadata|PropertyAttributeProperty")
641 const FVector4& DefaultValue);
684 Category =
"Cesium|Metadata|PropertyAttributeProperty")
688 const FMatrix& DefaultValue);
708 Category =
"Cesium|Metadata|PropertyAttributeProperty")
730 Category =
"Cesium|Metadata|PropertyAttributeProperty")
745 Category =
"Cesium|Metadata|PropertyAttributeProperty")
763 Category =
"Cesium|Metadata|PropertyAttributeProperty")
781 Category =
"Cesium|Metadata|PropertyAttributeProperty")
801 Category =
"Cesium|Metadata|PropertyAttributeProperty")
821 Category =
"Cesium|Metadata|PropertyAttributeProperty")
840 Category =
"Cesium|Metadata|PropertyAttributeProperty")
857 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.
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.