Cesium for Unreal 2.12.0
Loading...
Searching...
No Matches
CesiumFeatureIdAttribute.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "Kismet/BlueprintFunctionLibrary.h"
6#include <CesiumGltf/AccessorUtility.h>
7#include "CesiumFeatureIdAttribute.generated.h"
8
9namespace CesiumGltf {
10struct Model;
11struct Accessor;
12struct Node;
13} // namespace CesiumGltf
14
19UENUM(BlueprintType)
21 /* The feature ID attribute is valid. */
22 Valid = 0,
23 /* The feature ID attribute does not exist in the glTF primitive. */
25 /* The feature ID attribute uses an invalid accessor in the glTF. */
27};
28
35USTRUCT(BlueprintType)
36struct CESIUMRUNTIME_API FCesiumFeatureIdAttribute {
37 GENERATED_USTRUCT_BODY()
38
39public:
48 _featureIdAccessor(),
49 _attributeIndex(-1) {}
50
61 const CesiumGltf::Model& Model,
62 const CesiumGltf::MeshPrimitive& Primitive,
63 const int64 FeatureIDAttribute,
64 const FString& PropertyTableName);
65
77 const CesiumGltf::Model& Model,
78 const CesiumGltf::Node& Node,
79 const int64 FeatureIDAttribute,
80 const FString& PropertyTableName);
81
85 int64 getAttributeIndex() const { return this->_attributeIndex; }
86
87private:
89 CesiumGltf::FeatureIdAccessorType _featureIdAccessor;
90 int64 _attributeIndex;
91
92 // For backwards compatibility.
93 FString _propertyTableName;
94
96};
97
98UCLASS()
100 : public UBlueprintFunctionLibrary {
101 GENERATED_BODY()
102
103public:
104 PRAGMA_DISABLE_DEPRECATION_WARNINGS
110 UFUNCTION(
111 BlueprintCallable,
112 BlueprintPure,
113 Meta =
114 (DeprecatedFunction,
115 DeprecationMessage =
116 "Use GetPropertyTableIndex on a CesiumFeatureIdSet instead."))
117 static const FString&
119 const FCesiumFeatureIdAttribute& FeatureIDAttribute);
120 PRAGMA_ENABLE_DEPRECATION_WARNINGS
121
126 UFUNCTION(
127 BlueprintCallable,
128 BlueprintPure,
129 Category = "Cesium|Features|FeatureIDAttribute")
131 UPARAM(ref) const FCesiumFeatureIdAttribute& FeatureIDAttribute);
132
142 UFUNCTION(
143 BlueprintCallable,
144 BlueprintPure,
145 Category = "Cesium|Features|FeatureIDAttribute")
146 static int64
147 GetCount(UPARAM(ref) const FCesiumFeatureIdAttribute& FeatureIDAttribute);
148
158 UFUNCTION(
159 BlueprintCallable,
160 BlueprintPure,
161 Category = "Cesium|Features|FeatureIDAttribute")
162 static int64 GetFeatureID(
163 UPARAM(ref) const FCesiumFeatureIdAttribute& FeatureIDAttribute,
164 int64 Index);
165};
ECesiumFeatureIdAttributeStatus
Reports the status of a FCesiumFeatureIdAttribute.
static int64 GetFeatureID(UPARAM(ref) const FCesiumFeatureIdAttribute &FeatureIDAttribute, int64 Index)
Gets the feature ID at the given index.
static PRAGMA_ENABLE_DEPRECATION_WARNINGS ECesiumFeatureIdAttributeStatus GetFeatureIDAttributeStatus(UPARAM(ref) const FCesiumFeatureIdAttribute &FeatureIDAttribute)
Gets the status of the feature ID attribute.
static int64 GetCount(UPARAM(ref) const FCesiumFeatureIdAttribute &FeatureIDAttribute)
Gets the number of elements in the attribute.
static PRAGMA_DISABLE_DEPRECATION_WARNINGS const FString & GetFeatureTableName(UPARAM(ref) const FCesiumFeatureIdAttribute &FeatureIDAttribute)
Get the name of the feature table corresponding to this feature ID attribute.
std::variant< AccessorView< int8_t >, AccessorView< uint8_t >, AccessorView< int16_t >, AccessorView< uint16_t >, AccessorView< uint32_t >, AccessorView< float > > FeatureIdAccessorType
A blueprint-accessible wrapper for a feature ID attribute from a glTF model.
int64 getAttributeIndex() const
Gets the index of this feature ID attribute in the glTF primitive.
FCesiumFeatureIdAttribute(const CesiumGltf::Model &Model, const CesiumGltf::MeshPrimitive &Primitive, const int64 FeatureIDAttribute, const FString &PropertyTableName)
Constructs a feature ID attribute instance.
FCesiumFeatureIdAttribute(const CesiumGltf::Model &Model, const CesiumGltf::Node &Node, const int64 FeatureIDAttribute, const FString &PropertyTableName)
Constructs a feature ID attribute instance from EXT_instance_features data.
FCesiumFeatureIdAttribute()
Constructs an empty feature ID attribute instance.