9#include "Kismet/BlueprintFunctionLibrary.h"
10#include "UObject/ObjectMacros.h"
12#include <CesiumGltf/PropertyTablePropertyView.h>
13#include <CesiumGltf/PropertyTypeTraits.h>
16#include "CesiumPropertyTableProperty.generated.h"
44 GENERATED_USTRUCT_BODY()
62 template <
typename T,
bool Normalized>
75 template <
typename T,
bool Normalized>
78 const TSharedPtr<FCesiumMetadataEnum>& pEnumDefinition)
82 _normalized(Normalized),
83 _pEnumDefinition(pEnumDefinition) {
84 switch (property.status()) {
85 case CesiumGltf::PropertyTablePropertyViewStatus::Valid:
86 _status = ECesiumPropertyTablePropertyStatus::Valid;
88 case CesiumGltf::PropertyTablePropertyViewStatus::EmptyPropertyWithDefault:
89 _status = ECesiumPropertyTablePropertyStatus::EmptyPropertyWithDefault;
91 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidPropertyTable:
92 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorNonexistentProperty:
93 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorTypeMismatch:
94 case CesiumGltf::PropertyTablePropertyViewStatus::
95 ErrorComponentTypeMismatch:
96 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorArrayTypeMismatch:
97 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidNormalization:
98 case CesiumGltf::PropertyTablePropertyViewStatus::
99 ErrorNormalizationMismatch:
100 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidOffset:
101 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidScale:
102 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidMax:
103 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidMin:
104 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidNoDataValue:
105 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidDefaultValue:
109 _status = ECesiumPropertyTablePropertyStatus::ErrorInvalidPropertyData;
113 _valueType = TypeToMetadataValueType<T>(pEnumDefinition);
114 _normalized = Normalized;
124 TSharedPtr<FCesiumMetadataEnum> _pEnumDefinition;
131 : public UBlueprintFunctionLibrary {
144 Category =
"Cesium|Metadata|PropertyTableProperty")
158 Category =
"Cesium|Metadata|PropertyTableProperty")
172 Category =
"Cesium|Metadata|PropertyTableProperty")
176 PRAGMA_DISABLE_DEPRECATION_WARNINGS
189 DeprecationMessage =
"Use GetArrayElementBlueprintType instead."))
193 PRAGMA_ENABLE_DEPRECATION_WARNINGS
205 Category =
"Cesium|Metadata|PropertyTableProperty")
209 PRAGMA_DISABLE_DEPRECATION_WARNINGS
222 "CesiumMetadataTrueType is deprecated. Use GetValueType to get the CesiumMetadataValueType instead."))
240 "CesiumMetadataTrueType is deprecated. Use GetValueType to get the CesiumMetadataValueType instead."))
244 PRAGMA_ENABLE_DEPRECATION_WARNINGS
254 Category =
"Cesium|Metadata|PropertyTableProperty")
258 PRAGMA_DISABLE_DEPRECATION_WARNINGS
269 DeprecationMessage =
"Use GetPropertySize instead."))
272 PRAGMA_ENABLE_DEPRECATION_WARNINGS
283 Category =
"Cesium|Metadata|PropertyTableProperty")
287 PRAGMA_DISABLE_DEPRECATION_WARNINGS
299 DeprecationMessage =
"Use GetArraySize instead."))
302 PRAGMA_ENABLE_DEPRECATION_WARNINGS
338 Category =
"Cesium|Metadata|PropertyTableProperty")
342 bool DefaultValue = false);
380 Category =
"Cesium|Metadata|PropertyTableProperty")
384 uint8 DefaultValue = 0);
425 Category =
"Cesium|Metadata|PropertyTableProperty")
429 int32 DefaultValue = 0);
469 Category =
"Cesium|Metadata|PropertyTableProperty")
473 int64 DefaultValue = 0);
514 Category =
"Cesium|Metadata|PropertyTableProperty")
518 float DefaultValue = 0.0f);
558 Category =
"Cesium|Metadata|PropertyTableProperty")
562 double DefaultValue = 0.0);
607 Category =
"Cesium|Metadata|PropertyTableProperty")
611 const FIntPoint& DefaultValue);
652 Category =
"Cesium|Metadata|PropertyTableProperty")
656 const FVector2D& DefaultValue);
704 Category =
"Cesium|Metadata|PropertyTableProperty")
708 const FIntVector& DefaultValue);
756 Category =
"Cesium|Metadata|PropertyTableProperty")
760 const FVector3f& DefaultValue);
804 Category =
"Cesium|Metadata|PropertyTableProperty")
808 const FVector& DefaultValue);
854 Category =
"Cesium|Metadata|PropertyTableProperty")
858 const FVector4& DefaultValue);
905 Category =
"Cesium|Metadata|PropertyTableProperty")
909 const FMatrix& DefaultValue);
949 Category =
"Cesium|Metadata|PropertyTableProperty")
953 const FString& DefaultValue =
"");
974 Category =
"Cesium|Metadata|PropertyTableProperty")
997 Category =
"Cesium|Metadata|PropertyTableProperty")
1002 PRAGMA_DISABLE_DEPRECATION_WARNINGS
1015 Meta = (DeprecatedFunction, DeprecatedMessage =
"Use GetValue instead."))
1019 PRAGMA_ENABLE_DEPRECATION_WARNINGS
1038 Category =
"Cesium|Metadata|PropertyTableProperty")
1053 Category =
"Cesium|Metadata|PropertyTableProperty")
1071 Category =
"Cesium|Metadata|PropertyTableProperty")
1089 Category =
"Cesium|Metadata|PropertyTableProperty")
1109 Category =
"Cesium|Metadata|PropertyTableProperty")
1129 Category =
"Cesium|Metadata|PropertyTableProperty")
1148 Category =
"Cesium|Metadata|PropertyTableProperty")
1165 Category =
"Cesium|Metadata|PropertyTableProperty")
@ EmptyPropertyWithDefault
@ ErrorInvalidPropertyData
ECesiumPropertyTablePropertyStatus
Reports the status of a FCesiumPropertyTableProperty.
static FCesiumPropertyArray GetArray(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID)
Attempts to retrieve the value for the given feature as a FCesiumPropertyArray.
static PRAGMA_DISABLE_DEPRECATION_WARNINGS FCesiumMetadataValue GetGenericValue(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID)
Retrieves the value of the property for the given feature.
static FVector3f GetVector3f(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, const FVector3f &DefaultValue)
Attempts to retrieve the value for the given feature as a FVector3f.
static PRAGMA_ENABLE_DEPRECATION_WARNINGS int64 GetArraySize(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the number of elements in an array of this property.
static int32 GetInteger(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, int32 DefaultValue=0)
Attempts to retrieve the value for the given feature as a signed 32-bit integer.
static FCesiumMetadataValue GetMaximumValue(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the maximum value of this property.
static FCesiumMetadataValue GetScale(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the scale of this property.
static PRAGMA_DISABLE_DEPRECATION_WARNINGS int64 GetNumberOfFeatures(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the number of values in this property.
static FIntPoint GetIntPoint(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, const FIntPoint &DefaultValue)
Attempts to retrieve the value for the given feature as a FIntPoint.
static PRAGMA_DISABLE_DEPRECATION_WARNINGS ECesiumMetadataTrueType_DEPRECATED GetTrueType(UPARAM(ref) const FCesiumPropertyTableProperty &Value)
Gets true type of the value.
static PRAGMA_DISABLE_DEPRECATION_WARNINGS int64 GetComponentCount(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the number of elements in an array of this property.
static FMatrix GetMatrix(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, const FMatrix &DefaultValue)
Attempts to retrieve the value for the given feature as a FMatrix.
static FCesiumMetadataValue GetMinimumValue(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the minimum value of this property.
static FVector2D GetVector2D(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, const FVector2D &DefaultValue)
Attempts to retrieve the value for the given feature as a FVector2D.
static PRAGMA_DISABLE_DEPRECATION_WARNINGS ECesiumMetadataBlueprintType GetBlueprintComponentType(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the best-fitting Blueprints type for the elements in this property's array values.
static PRAGMA_ENABLE_DEPRECATION_WARNINGS bool GetBoolean(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, bool DefaultValue=false)
Attempts to retrieve the value for the given feature as a boolean.
static FIntVector GetIntVector(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, const FIntVector &DefaultValue)
Attempts to retrieve the value for the given feature as a FIntVector.
static FCesiumMetadataValue GetDefaultValue(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the default value of this property, as defined by its class property.
static double GetFloat64(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, double DefaultValue=0.0)
Attempts to retrieve the value for the given feature as a double-precision floating-point number.
static float GetFloat(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, float DefaultValue=0.0f)
Attempts to retrieve the value for the given feature as a single-precision floating-point number.
static FVector4 GetVector4(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, const FVector4 &DefaultValue)
Attempts to retrieve the value for the given feature as a FVector4.
static int64 GetInteger64(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, int64 DefaultValue=0)
Attempts to retrieve the value for the given feature as a signed 64-bit integer.
static ECesiumMetadataBlueprintType GetBlueprintType(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the best-fitting type for the property that is accessible from Blueprints.
static uint8 GetByte(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, uint8 DefaultValue=0)
Attempts to retrieve the value for the given feature as an unsigned 8-bit integer.
static FString GetString(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, const FString &DefaultValue="")
Attempts to retrieve the value for the given feature as a FString.
static bool IsNormalized(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Whether this property is normalized.
static ECesiumPropertyTablePropertyStatus GetPropertyTablePropertyStatus(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the status of the property table property.
static ECesiumMetadataTrueType_DEPRECATED GetTrueComponentType(UPARAM(ref) const FCesiumPropertyTableProperty &Value)
Gets true type of the elements in this array property.
static PRAGMA_ENABLE_DEPRECATION_WARNINGS FCesiumMetadataValue GetRawValue(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID)
Retrieves the raw value of the property for the given feature.
static PRAGMA_ENABLE_DEPRECATION_WARNINGS int64 GetPropertySize(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the number of values in the property.
static PRAGMA_ENABLE_DEPRECATION_WARNINGS FCesiumMetadataValueType GetValueType(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the type of the metadata value as defined in the EXT_structural_metadata extension.
static FCesiumMetadataValue GetNoDataValue(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the "no data" value of this property, as defined by its class property.
static ECesiumMetadataBlueprintType GetArrayElementBlueprintType(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the best-fitting Blueprints type for the elements in this property's array values.
static FCesiumMetadataValue GetValue(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID)
Retrieves the value of the property for the given feature.
static FVector GetVector(UPARAM(ref) const FCesiumPropertyTableProperty &Property, int64 FeatureID, const FVector &DefaultValue)
Attempts to retrieve the value for the given feature as a FVector.
static FCesiumMetadataValue GetOffset(UPARAM(ref) const FCesiumPropertyTableProperty &Property)
Gets the offset of this property.
A Blueprint-accessible wrapper for an array property in glTF metadata.
A Blueprint-accessible wrapper for a glTF property table property in EXT_structural_metadata.
FCesiumPropertyTableProperty()
Construct an invalid property with an unknown type.
FCesiumPropertyTableProperty(const CesiumGltf::PropertyTablePropertyView< T, Normalized > &property, const TSharedPtr< FCesiumMetadataEnum > &pEnumDefinition)
Construct a wrapper for the property table property view.
friend class UCesiumPropertyTablePropertyBlueprintLibrary
FCesiumPropertyTableProperty(const CesiumGltf::PropertyTablePropertyView< T, Normalized > &property)
Construct a wrapper for the property table property view.