Cesium for Unreal 2.18.0
Loading...
Searching...
No Matches
CesiumModelMetadata.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
8
9#include "Containers/Array.h"
10#include "Containers/Map.h"
11#include "Containers/UnrealString.h"
12
13#include "CesiumModelMetadata.generated.h"
14
15namespace CesiumGltf {
17struct Model;
18} // namespace CesiumGltf
19
20/**
21 * @brief A blueprint-accessible wrapper for metadata contained in a glTF model.
22 * Provides access to views of property tables, property textures, and property
23 * attributes available on the glTF.
24 */
25USTRUCT(BlueprintType)
26struct CESIUMRUNTIME_API FCesiumModelMetadata {
27 GENERATED_USTRUCT_BODY()
28
29public:
30 FCesiumModelMetadata() : _enumDefinitions() {}
31
33 const CesiumGltf::Model& InModel,
35
36private:
37 TArray<FCesiumPropertyTable> _propertyTables;
38 TArray<FCesiumPropertyTexture> _propertyTextures;
39 TSharedPtr<FCesiumMetadataEnumCollection> _enumDefinitions;
40
42};
43
44UCLASS()
46 : public UBlueprintFunctionLibrary {
47 GENERATED_BODY()
48
49public:
50 /**
51 * Gets the model metadata of a glTF primitive component. If component is
52 * not a Cesium glTF primitive component, the returned metadata is empty.
53 */
54 UFUNCTION(
55 BlueprintCallable,
56 BlueprintPure,
57 Category = "Cesium|Model|Metadata")
58 static const FCesiumModelMetadata&
59 GetModelMetadata(const UPrimitiveComponent* component);
60
61 PRAGMA_DISABLE_DEPRECATION_WARNINGS
62 /**
63 * @brief Get all the feature tables for this model metadata.
64 */
65 UFUNCTION(
66 BlueprintCallable,
67 BlueprintPure,
68 Category = "Cesium|Metadata|Model",
69 Meta =
70 (DeprecatedFunction,
71 DeprecationMessage =
72 "Use GetPropertyTables to get an array of property tables instead."))
73 static const TMap<FString, FCesiumPropertyTable>
74 GetFeatureTables(UPARAM(ref) const FCesiumModelMetadata& ModelMetadata);
75
76 /**
77 * @brief Get all the feature textures for this model metadata.
78 */
79 UFUNCTION(
80 BlueprintCallable,
81 BlueprintPure,
82 Category = "Cesium|Metadata|Model",
83 Meta =
84 (DeprecatedFunction,
85 DeprecationMessage =
86 "Use GetPropertyTextures to get an array of property textures instead."))
87 static const TMap<FString, FCesiumPropertyTexture>
88 GetFeatureTextures(UPARAM(ref) const FCesiumModelMetadata& ModelMetadata);
89
90 PRAGMA_ENABLE_DEPRECATION_WARNINGS
91
92 /**
93 * Gets an array of all the property tables for this model metadata.
94 */
95 UFUNCTION(
96 BlueprintCallable,
97 BlueprintPure,
98 Category = "Cesium|Model|Metadata")
99 static const TArray<FCesiumPropertyTable>&
100 GetPropertyTables(UPARAM(ref) const FCesiumModelMetadata& ModelMetadata);
101
102 /**
103 * Gets the property table at the specified index for this model metadata. If
104 * the index is out-of-bounds, this returns an invalid property table.
105 */
106 UFUNCTION(
107 BlueprintCallable,
108 BlueprintPure,
109 Category = "Cesium|Model|Metadata")
111 UPARAM(ref) const FCesiumModelMetadata& ModelMetadata,
112 const int64 Index);
113
114 /**
115 * Gets the property table at the specified indices for this model metadata.
116 * An invalid property table will be returned for any out-of-bounds index.
117 */
118 UFUNCTION(
119 BlueprintCallable,
120 BlueprintPure,
121 Category = "Cesium|Model|Metadata")
123 UPARAM(ref) const FCesiumModelMetadata& ModelMetadata,
124 const TArray<int64>& Indices);
125
126 /**
127 * Gets an array of all the property textures for this model metadata.
128 */
129 UFUNCTION(
130 BlueprintCallable,
131 BlueprintPure,
132 Category = "Cesium|Model|Metadata")
133 static const TArray<FCesiumPropertyTexture>&
134 GetPropertyTextures(UPARAM(ref) const FCesiumModelMetadata& ModelMetadata);
135
136 /**
137 * Gets the property table at the specified index for this model metadata. If
138 * the index is out-of-bounds, this returns an invalid property table.
139 */
140 UFUNCTION(
141 BlueprintCallable,
142 BlueprintPure,
143 Category = "Cesium|Model|Metadata")
145 UPARAM(ref) const FCesiumModelMetadata& ModelMetadata,
146 const int64 Index);
147
148 /**
149 * Gets an array of the property textures at the specified indices for this
150 * model metadata.
151 */
152 UFUNCTION(
153 BlueprintCallable,
154 BlueprintPure,
155 Category = "Cesium|Model|Metadata")
157 UPARAM(ref) const FCesiumModelMetadata& ModelMetadata,
158 const TArray<int64>& Indices);
159};
static const FCesiumModelMetadata & GetModelMetadata(const UPrimitiveComponent *component)
Gets the model metadata of a glTF primitive component.
static PRAGMA_ENABLE_DEPRECATION_WARNINGS const TArray< FCesiumPropertyTable > & GetPropertyTables(UPARAM(ref) const FCesiumModelMetadata &ModelMetadata)
Gets an array of all the property tables for this model metadata.
static const FCesiumPropertyTexture & GetPropertyTexture(UPARAM(ref) const FCesiumModelMetadata &ModelMetadata, const int64 Index)
Gets the property table at the specified index for this model metadata.
static PRAGMA_DISABLE_DEPRECATION_WARNINGS const TMap< FString, FCesiumPropertyTable > GetFeatureTables(UPARAM(ref) const FCesiumModelMetadata &ModelMetadata)
Get all the feature tables for this model metadata.
static const TArray< FCesiumPropertyTexture > & GetPropertyTextures(UPARAM(ref) const FCesiumModelMetadata &ModelMetadata)
Gets an array of all the property textures for this model metadata.
static const TArray< FCesiumPropertyTable > GetPropertyTablesAtIndices(UPARAM(ref) const FCesiumModelMetadata &ModelMetadata, const TArray< int64 > &Indices)
Gets the property table at the specified indices for this model metadata.
static const TMap< FString, FCesiumPropertyTexture > GetFeatureTextures(UPARAM(ref) const FCesiumModelMetadata &ModelMetadata)
Get all the feature textures for this model metadata.
static const TArray< FCesiumPropertyTexture > GetPropertyTexturesAtIndices(UPARAM(ref) const FCesiumModelMetadata &ModelMetadata, const TArray< int64 > &Indices)
Gets an array of the property textures at the specified indices for this model metadata.
static const FCesiumPropertyTable & GetPropertyTable(UPARAM(ref) const FCesiumModelMetadata &ModelMetadata, const int64 Index)
Gets the property table at the specified index for this model metadata.
A blueprint-accessible wrapper for metadata contained in a glTF model.
friend class UCesiumModelMetadataBlueprintLibrary
FCesiumModelMetadata(const CesiumGltf::Model &InModel, const CesiumGltf::ExtensionModelExtStructuralMetadata &Metadata)
A Blueprint-accessible wrapper for a glTF property table.
A blueprint-accessible wrapper of a property texture from a glTF.