Cesium for Unreal 2.15.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 // TODO: property attributes
41
43};
44
45UCLASS()
47 : public UBlueprintFunctionLibrary {
48 GENERATED_BODY()
49
50public:
51 /**
52 * Gets the model metadata of a glTF primitive component. If component is
53 * not a Cesium glTF primitive component, the returned metadata is empty.
54 */
55 UFUNCTION(
56 BlueprintCallable,
57 BlueprintPure,
58 Category = "Cesium|Model|Metadata")
59 static const FCesiumModelMetadata&
60 GetModelMetadata(const UPrimitiveComponent* component);
61
62 PRAGMA_DISABLE_DEPRECATION_WARNINGS
63 /**
64 * @brief Get all the feature tables for this model metadata.
65 */
66 UFUNCTION(
67 BlueprintCallable,
68 BlueprintPure,
69 Category = "Cesium|Metadata|Model",
70 Meta =
71 (DeprecatedFunction,
72 DeprecationMessage =
73 "Use GetPropertyTables to get an array of property tables instead."))
74 static const TMap<FString, FCesiumPropertyTable>
75 GetFeatureTables(UPARAM(ref) const FCesiumModelMetadata& ModelMetadata);
76
77 /**
78 * @brief Get all the feature textures for this model metadata.
79 */
80 UFUNCTION(
81 BlueprintCallable,
82 BlueprintPure,
83 Category = "Cesium|Metadata|Model",
84 Meta =
85 (DeprecatedFunction,
86 DeprecationMessage =
87 "Use GetPropertyTextures to get an array of property textures instead."))
88 static const TMap<FString, FCesiumPropertyTexture>
89 GetFeatureTextures(UPARAM(ref) const FCesiumModelMetadata& ModelMetadata);
90
91 PRAGMA_ENABLE_DEPRECATION_WARNINGS
92
93 /**
94 * Gets an array of all the property tables for this model metadata.
95 */
96 UFUNCTION(
97 BlueprintCallable,
98 BlueprintPure,
99 Category = "Cesium|Model|Metadata")
100 static const TArray<FCesiumPropertyTable>&
101 GetPropertyTables(UPARAM(ref) const FCesiumModelMetadata& ModelMetadata);
102
103 /**
104 * Gets the property table at the specified index for this model metadata. If
105 * the index is out-of-bounds, this returns an invalid property table.
106 */
107 UFUNCTION(
108 BlueprintCallable,
109 BlueprintPure,
110 Category = "Cesium|Model|Metadata")
112 UPARAM(ref) const FCesiumModelMetadata& ModelMetadata,
113 const int64 Index);
114
115 /**
116 * Gets the property table at the specified indices for this model metadata.
117 * An invalid property table will be returned for any out-of-bounds index.
118 */
119 UFUNCTION(
120 BlueprintCallable,
121 BlueprintPure,
122 Category = "Cesium|Model|Metadata")
124 UPARAM(ref) const FCesiumModelMetadata& ModelMetadata,
125 const TArray<int64>& Indices);
126
127 /**
128 * Gets an array of all the property textures for this model metadata.
129 */
130 UFUNCTION(
131 BlueprintCallable,
132 BlueprintPure,
133 Category = "Cesium|Model|Metadata")
134 static const TArray<FCesiumPropertyTexture>&
135 GetPropertyTextures(UPARAM(ref) const FCesiumModelMetadata& ModelMetadata);
136
137 /**
138 * Gets the property table at the specified index for this model metadata. If
139 * the index is out-of-bounds, this returns an invalid property table.
140 */
141 UFUNCTION(
142 BlueprintCallable,
143 BlueprintPure,
144 Category = "Cesium|Model|Metadata")
146 UPARAM(ref) const FCesiumModelMetadata& ModelMetadata,
147 const int64 Index);
148
149 /**
150 * Gets an array of the property textures at the specified indices for this
151 * model metadata.
152 */
153 UFUNCTION(
154 BlueprintCallable,
155 BlueprintPure,
156 Category = "Cesium|Model|Metadata")
158 UPARAM(ref) const FCesiumModelMetadata& ModelMetadata,
159 const TArray<int64>& Indices);
160};
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.