5#include "CesiumGltf/PropertyTablePropertyView.h"
6#include "CesiumGltf/PropertyTypeTraits.h"
11#include "Kismet/BlueprintFunctionLibrary.h"
12#include "UObject/ObjectMacros.h"
17#include "CesiumPropertyTableProperty.generated.h"
45 GENERATED_USTRUCT_BODY()
63 template <
typename T,
bool Normalized>
76 template <
typename T,
bool Normalized>
79 const TSharedPtr<FCesiumMetadataEnum>& EnumDefinition)
83 _normalized(Normalized),
84 _pEnumDefinition(EnumDefinition) {
85 switch (Property.status()) {
86 case CesiumGltf::PropertyTablePropertyViewStatus::Valid:
87 _status = ECesiumPropertyTablePropertyStatus::Valid;
89 case CesiumGltf::PropertyTablePropertyViewStatus::EmptyPropertyWithDefault:
90 _status = ECesiumPropertyTablePropertyStatus::EmptyPropertyWithDefault;
92 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidPropertyTable:
93 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorNonexistentProperty:
94 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorTypeMismatch:
95 case CesiumGltf::PropertyTablePropertyViewStatus::
96 ErrorComponentTypeMismatch:
97 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorArrayTypeMismatch:
98 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidNormalization:
99 case CesiumGltf::PropertyTablePropertyViewStatus::
100 ErrorNormalizationMismatch:
101 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidOffset:
102 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidScale:
103 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidMax:
104 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidMin:
105 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidNoDataValue:
106 case CesiumGltf::PropertyTablePropertyViewStatus::ErrorInvalidDefaultValue:
110 _status = ECesiumPropertyTablePropertyStatus::ErrorInvalidPropertyData;
114 _valueType = TypeToMetadataValueType<T>(EnumDefinition);
115 _normalized = Normalized;
125 TSharedPtr<FCesiumMetadataEnum> _pEnumDefinition;
132 : public UBlueprintFunctionLibrary {
145 Category =
"Cesium|Metadata|PropertyTableProperty")
159 Category =
"Cesium|Metadata|PropertyTableProperty")
173 Category =
"Cesium|Metadata|PropertyTableProperty")
177 PRAGMA_DISABLE_DEPRECATION_WARNINGS
190 DeprecationMessage =
"Use GetArrayElementBlueprintType instead."))
194 PRAGMA_ENABLE_DEPRECATION_WARNINGS
206 Category =
"Cesium|Metadata|PropertyTableProperty")
210 PRAGMA_DISABLE_DEPRECATION_WARNINGS
223 "CesiumMetadataTrueType is deprecated. Use GetValueType to get the CesiumMetadataValueType instead."))
241 "CesiumMetadataTrueType is deprecated. Use GetValueType to get the CesiumMetadataValueType instead."))
245 PRAGMA_ENABLE_DEPRECATION_WARNINGS
255 Category =
"Cesium|Metadata|PropertyTableProperty")
259 PRAGMA_DISABLE_DEPRECATION_WARNINGS
270 DeprecationMessage =
"Use GetPropertySize instead."))
273 PRAGMA_ENABLE_DEPRECATION_WARNINGS
284 Category =
"Cesium|Metadata|PropertyTableProperty")
288 PRAGMA_DISABLE_DEPRECATION_WARNINGS
300 DeprecationMessage =
"Use GetArraySize instead."))
303 PRAGMA_ENABLE_DEPRECATION_WARNINGS
339 Category =
"Cesium|Metadata|PropertyTableProperty")
343 bool DefaultValue = false);
381 Category =
"Cesium|Metadata|PropertyTableProperty")
385 uint8 DefaultValue = 0);
426 Category =
"Cesium|Metadata|PropertyTableProperty")
430 int32 DefaultValue = 0);
470 Category =
"Cesium|Metadata|PropertyTableProperty")
474 int64 DefaultValue = 0);
515 Category =
"Cesium|Metadata|PropertyTableProperty")
519 float DefaultValue = 0.0f);
559 Category =
"Cesium|Metadata|PropertyTableProperty")
563 double DefaultValue = 0.0);
608 Category =
"Cesium|Metadata|PropertyTableProperty")
612 const FIntPoint& DefaultValue);
653 Category =
"Cesium|Metadata|PropertyTableProperty")
657 const FVector2D& DefaultValue);
705 Category =
"Cesium|Metadata|PropertyTableProperty")
709 const FIntVector& DefaultValue);
757 Category =
"Cesium|Metadata|PropertyTableProperty")
761 const FVector3f& DefaultValue);
805 Category =
"Cesium|Metadata|PropertyTableProperty")
809 const FVector& DefaultValue);
855 Category =
"Cesium|Metadata|PropertyTableProperty")
859 const FVector4& DefaultValue);
906 Category =
"Cesium|Metadata|PropertyTableProperty")
910 const FMatrix& DefaultValue);
950 Category =
"Cesium|Metadata|PropertyTableProperty")
954 const FString& DefaultValue =
"");
975 Category =
"Cesium|Metadata|PropertyTableProperty")
998 Category =
"Cesium|Metadata|PropertyTableProperty")
1003 PRAGMA_DISABLE_DEPRECATION_WARNINGS
1016 Meta = (DeprecatedFunction, DeprecatedMessage =
"Use GetValue instead."))
1020 PRAGMA_ENABLE_DEPRECATION_WARNINGS
1039 Category =
"Cesium|Metadata|PropertyTableProperty")
1054 Category =
"Cesium|Metadata|PropertyTableProperty")
1072 Category =
"Cesium|Metadata|PropertyTableProperty")
1090 Category =
"Cesium|Metadata|PropertyTableProperty")
1110 Category =
"Cesium|Metadata|PropertyTableProperty")
1130 Category =
"Cesium|Metadata|PropertyTableProperty")
1149 Category =
"Cesium|Metadata|PropertyTableProperty")
1166 Category =
"Cesium|Metadata|PropertyTableProperty")
ECesiumPropertyTablePropertyStatus
Reports the status of a FCesiumPropertyTableProperty.
@ EmptyPropertyWithDefault
@ ErrorInvalidPropertyData
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)
Construct a wrapper for the property table property view.
FCesiumPropertyTableProperty(const CesiumGltf::PropertyTablePropertyView< T, Normalized > &Property, const TSharedPtr< FCesiumMetadataEnum > &EnumDefinition)
Construct a wrapper for the property table property view.
friend class UCesiumPropertyTablePropertyBlueprintLibrary