Cesium for Unreal 2.12.0
Loading...
Searching...
No Matches
CesiumFeatureIdSet.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
7#include "Kismet/BlueprintFunctionLibrary.h"
8#include <variant>
9#include "CesiumFeatureIdSet.generated.h"
10
11namespace CesiumGltf {
12struct Model;
13struct FeatureId;
14struct ExtensionExtInstanceFeaturesFeatureId;
15} // namespace CesiumGltf
16
20UENUM(BlueprintType)
21enum class ECesiumFeatureIdSetType : uint8 {
22 None,
24 Texture,
28};
29
37USTRUCT(BlueprintType)
38struct CESIUMRUNTIME_API FCesiumFeatureIdSet {
39 GENERATED_USTRUCT_BODY()
40
41 using FeatureIDType = std::variant<
42 std::monostate,
45
46public:
48 : _featureIDSetType(ECesiumFeatureIdSetType::None),
49 _featureCount(0),
50 _nullFeatureID(-1) {}
51
53 const CesiumGltf::Model& Model,
54 const CesiumGltf::MeshPrimitive& Primitive,
55 const CesiumGltf::FeatureId& FeatureId);
56
58 const CesiumGltf::Model& Model,
59 const CesiumGltf::Node& Node,
61 InstanceFeatureId);
62
63private:
64 FeatureIDType _featureID;
65 ECesiumFeatureIdSetType _featureIDSetType;
66 int64 _featureCount;
67 int64 _nullFeatureID;
68 int64 _propertyTableIndex;
69 FString _label;
70
72};
73
74UCLASS()
76 : public UBlueprintFunctionLibrary {
77 GENERATED_BODY()
78public:
82 UFUNCTION(
83 BlueprintCallable,
84 BlueprintPure,
85 Category = "Cesium|Features|FeatureIDSet")
86 static const ECesiumFeatureIdSetType
87 GetFeatureIDSetType(UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet);
88
95 UFUNCTION(
96 BlueprintCallable,
97 BlueprintPure,
98 Category = "Cesium|Features|FeatureIDSet")
99 static const FCesiumFeatureIdAttribute&
100 GetAsFeatureIDAttribute(UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet);
101
107 UFUNCTION(
108 BlueprintCallable,
109 BlueprintPure,
110 Category = "Cesium|Features|FeatureIDSet")
111 static const FCesiumFeatureIdTexture&
112 GetAsFeatureIDTexture(UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet);
113
120 UFUNCTION(
121 BlueprintCallable,
122 BlueprintPure,
123 Category = "Cesium|Features|FeatureIDSet")
124 static const int64
125 GetPropertyTableIndex(UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet);
126
130 UFUNCTION(
131 BlueprintCallable,
132 BlueprintPure,
133 Category = "Cesium|Features|FeatureIDSet")
134 static int64 GetFeatureCount(UPARAM(ref)
135 const FCesiumFeatureIdSet& FeatureIDSet);
136
145 UFUNCTION(
146 BlueprintCallable,
147 BlueprintPure,
148 Category = "Cesium|Features|FeatureIDSet")
149 static const int64
150 GetNullFeatureID(UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet);
151
156 UFUNCTION(
157 BlueprintCallable,
158 BlueprintPure,
159 Category = "Cesium|Features|FeatureIDSet")
160 static const FString GetLabel(UPARAM(ref)
161 const FCesiumFeatureIdSet& FeatureIDSet);
162
170 UFUNCTION(
171 BlueprintCallable,
172 BlueprintPure,
173 Category = "Cesium|Features|FeatureIDSet")
175 UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet,
176 int64 VertexIndex);
177
188 UFUNCTION(
189 BlueprintCallable,
190 BlueprintPure,
191 Category = "Cesium|Features|FeatureIDSet")
193 UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet,
194 int64 InstanceIndex);
195
210 UFUNCTION(
211 BlueprintCallable,
212 BlueprintPure,
213 Category = "Cesium|Features|FeatureIDSet")
215 UPARAM(ref) const FCesiumFeatureIdSet& FeatureIDSet,
216 const FHitResult& Hit);
217};
ECesiumFeatureIdSetType
The type of a feature ID set.
static const int64 GetNullFeatureID(UPARAM(ref) const FCesiumFeatureIdSet &FeatureIDSet)
Gets the null feature ID, i.e., the value that indicates no feature is associated with the owner.
static const FCesiumFeatureIdAttribute & GetAsFeatureIDAttribute(UPARAM(ref) const FCesiumFeatureIdSet &FeatureIDSet)
Gets this feature ID set as a feature ID attribute.
static const int64 GetPropertyTableIndex(UPARAM(ref) const FCesiumFeatureIdSet &FeatureIDSet)
Get the index of the property table corresponding to this feature ID set.
static int64 GetFeatureIDFromHit(UPARAM(ref) const FCesiumFeatureIdSet &FeatureIDSet, const FHitResult &Hit)
Given a trace hit result, gets the feature ID from the feature ID set on the hit component.
static int64 GetFeatureIDForInstance(UPARAM(ref) const FCesiumFeatureIdSet &FeatureIDSet, int64 InstanceIndex)
Gets the feature ID associated with a given instance in glTF models using the EXT_mesh_gpu_instancing...
static int64 GetFeatureCount(UPARAM(ref) const FCesiumFeatureIdSet &FeatureIDSet)
Get the number of features this primitive has.
static int64 GetFeatureIDForVertex(UPARAM(ref) const FCesiumFeatureIdSet &FeatureIDSet, int64 VertexIndex)
Gets the feature ID associated with a given vertex.
static const ECesiumFeatureIdSetType GetFeatureIDSetType(UPARAM(ref) const FCesiumFeatureIdSet &FeatureIDSet)
Gets the type of this feature ID set.
static const FString GetLabel(UPARAM(ref) const FCesiumFeatureIdSet &FeatureIDSet)
Gets the label assigned to this feature ID set.
static const FCesiumFeatureIdTexture & GetAsFeatureIDTexture(UPARAM(ref) const FCesiumFeatureIdSet &FeatureIDSet)
Gets this feature ID set as a feature ID texture.
STL namespace.
A blueprint-accessible wrapper for a feature ID attribute from a glTF model.
A blueprint-accessible wrapper for a feature ID set from a glTF primitive.
std::variant< std::monostate, FCesiumFeatureIdAttribute, FCesiumFeatureIdTexture > FeatureIDType
FCesiumFeatureIdSet(const CesiumGltf::Model &Model, const CesiumGltf::MeshPrimitive &Primitive, const CesiumGltf::FeatureId &FeatureId)
FCesiumFeatureIdSet(const CesiumGltf::Model &Model, const CesiumGltf::Node &Node, const CesiumGltf::ExtensionExtInstanceFeaturesFeatureId &InstanceFeatureId)
A blueprint-accessible wrapper for a feature ID texture from a glTF primitive.