Cesium for Unreal 2.13.2
Loading...
Searching...
No Matches
CesiumMetadataPropertyDetails.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
6#include "UObject/ObjectMacros.h"
7
8#include "CesiumMetadataPropertyDetails.generated.h"
9
10/**
11 * Represents information about a metadata property according to how the
12 * property is defined in EXT_structural_metadata.
13 */
14USTRUCT(BlueprintType)
15struct CESIUMRUNTIME_API FCesiumMetadataPropertyDetails {
16 GENERATED_USTRUCT_BODY()
17
20 ComponentType(ECesiumMetadataComponentType::None),
21 bIsArray(false) {}
22
25 ECesiumMetadataComponentType InComponentType,
26 bool IsArray)
27 : Type(InType), ComponentType(InComponentType), bIsArray(IsArray) {}
28
29 /**
30 * The type of the metadata property.
31 */
32 UPROPERTY(EditAnywhere, Category = "Cesium")
34
35 /**
36 * The component of the metadata property. Only applies when the type is a
37 * Scalar, VecN, or MatN type.
38 */
39 UPROPERTY(
40 EditAnywhere,
41 Category = "Cesium",
42 Meta =
43 (EditCondition =
47
48 /**
49 * Whether or not this represents an array containing elements of the
50 * specified types.
51 */
52 UPROPERTY(EditAnywhere, Category = "Cesium")
53 bool bIsArray = false;
54
55 /**
56 * The size of the arrays in the metadata property. If the property contains
57 * arrays of varying length, this will be zero even though bIsArray will be
58 * true> If this property does not contain arrays, this is set to zero.
59 */
60 UPROPERTY(
61 EditAnywhere,
62 Category = "Cesium",
63 Meta = (EditCondition = "bIsArray"))
64 int64 ArraySize = 0;
65
66 /**
67 * Whether or not the values in this property are normalized. Only applicable
68 * to scalar, vecN, and matN types with integer components.
69 *
70 * For unsigned integer component types, values are normalized between
71 * [0.0, 1.0]. For signed integer component types, values are normalized
72 * between [-1.0, 1.0]
73 */
74 UPROPERTY(
75 EditAnywhere,
76 Category = "Cesium",
77 Meta =
78 (EditCondition =
80 bool bIsNormalized = false;
81
82 /**
83 * Whether or not the property is transformed by an offset. This value is
84 * defined either in the class property, or in the instance of the property
85 * itself.
86 */
87 UPROPERTY(
88 EditAnywhere,
89 Category = "Cesium",
90 Meta =
91 (EditCondition =
93 bool bHasOffset = false;
94
95 /**
96 * Whether or not the property is transformed by a scale. This value is
97 * defined either in the class property, or in the instance of the property
98 * itself.
99 */
100 UPROPERTY(
101 EditAnywhere,
102 Category = "Cesium",
103 Meta =
104 (EditCondition =
106 bool bHasScale = false;
107
108 /**
109 * Whether or not the property specifies a "no data" value. This value
110 * functions a sentinel value, indicating missing data wherever it appears.
111 */
112 UPROPERTY(
113 EditAnywhere,
114 Category = "Cesium",
115 Meta =
116 (EditCondition =
118 bool bHasNoDataValue = false;
119
120 /**
121 * Whether or not the property specifies a default value. This default value
122 * is used use when encountering a "no data" value in the property, or when a
123 * non-required property has been omitted.
124 */
125 UPROPERTY(
126 EditAnywhere,
127 Category = "Cesium",
128 Meta =
129 (EditCondition =
130 "Type != ECesiumMetadataType::Invalid && Type != ECesiumMetadataType::Enum"))
131 bool bHasDefaultValue = false;
132
133 inline bool
134 operator==(const FCesiumMetadataPropertyDetails& ValueType) const {
135 return Type == ValueType.Type && ComponentType == ValueType.ComponentType &&
136 bIsArray == ValueType.bIsArray;
137 }
138
139 inline bool
141 return !operator==(ValueType);
142 }
143
144 /**
145 * Returns the internal types as a FCesiumMetadataValueType.
146 */
148 return FCesiumMetadataValueType(Type, ComponentType, bIsArray);
149 }
150
151 /**
152 * Sets the internal types to the values supplied by the input
153 * FCesiumMetadataValueType.
154 */
156 Type = ValueType.Type;
157 ComponentType = ValueType.ComponentType;
158 bIsArray = ValueType.bIsArray;
159 }
160
161 /**
162 * Whether this property has one or more value transforms. This includes
163 * normalization, offset, and scale, as well as the "no data" and default
164 * values.
165 */
166 bool HasValueTransforms() const {
167 return bIsNormalized || bHasOffset || bHasScale || bHasNoDataValue ||
168 bHasDefaultValue;
169 }
170};
ECesiumMetadataComponentType
The component type of a metadata property in EXT_structural_metadata.
ECesiumMetadataType
The type of a metadata property in EXT_structural_metadata.
Represents information about a metadata property according to how the property is defined in EXT_stru...
bool operator!=(const FCesiumMetadataPropertyDetails &ValueType) const
bool HasValueTransforms() const
Whether this property has one or more value transforms.
FCesiumMetadataValueType GetValueType() const
Returns the internal types as a FCesiumMetadataValueType.
void SetValueType(FCesiumMetadataValueType ValueType)
Sets the internal types to the values supplied by the input FCesiumMetadataValueType.
FCesiumMetadataPropertyDetails(ECesiumMetadataType InType, ECesiumMetadataComponentType InComponentType, bool IsArray)
Represents the true value type of a metadata value, akin to the property types in EXT_structural_meta...
ECesiumMetadataType Type
The type of the metadata property or value.
bool bIsArray
Whether or not this represents an array containing elements of the specified types.
ECesiumMetadataComponentType ComponentType
The component of the metadata property or value.