Cesium for Unreal 2.12.0
Loading...
Searching...
No Matches
CesiumPropertyTexture.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "CesiumGltf/PropertyTextureView.h"
7#include "Containers/Array.h"
8#include "Kismet/BlueprintFunctionLibrary.h"
9#include "Kismet/GameplayStatics.h"
10#include "CesiumPropertyTexture.generated.h"
11
12namespace CesiumGltf {
13struct Model;
14struct PropertyTexture;
15}; // namespace CesiumGltf
16
17UENUM(BlueprintType)
18enum class ECesiumPropertyTextureStatus : uint8 {
19 /* The property texture is valid. */
20 Valid = 0,
21 /* The property texture instance was not initialized from an actual glTF
22 property texture. */
24 /* The property texture's class could be found in the schema of the metadata
25 extension. */
27};
28
34USTRUCT(BlueprintType)
35struct CESIUMRUNTIME_API FCesiumPropertyTexture {
36 GENERATED_USTRUCT_BODY()
37
38public:
41
43 const CesiumGltf::Model& model,
44 const CesiumGltf::PropertyTexture& PropertyTexture);
45
49 FString getClassName() const { return _className; }
50
51private:
53 FString _name;
54 FString _className;
55
56 TMap<FString, FCesiumPropertyTextureProperty> _properties;
57
59};
60
61UCLASS()
63 : public UBlueprintFunctionLibrary {
64 GENERATED_BODY()
65
66public:
73 UFUNCTION(
74 BlueprintCallable,
75 BlueprintPure,
76 Category = "Cesium|Metadata|PropertyTexture")
79 const FCesiumPropertyTexture& PropertyTexture);
80
86 UFUNCTION(
87 BlueprintCallable,
88 BlueprintPure,
89 Category = "Cesium|Metadata|PropertyTexture")
90 static const FString&
92 const FCesiumPropertyTexture& PropertyTexture);
93
99 UFUNCTION(
100 BlueprintCallable,
101 BlueprintPure,
102 Category = "Cesium|Metadata|PropertyTexture")
103 static const TMap<FString, FCesiumPropertyTextureProperty>
104 GetProperties(UPARAM(ref) const FCesiumPropertyTexture& PropertyTexture);
105
112 UFUNCTION(
113 BlueprintCallable,
114 BlueprintPure,
115 Category = "Cesium|Metadata|PropertyTexture")
116 static const TArray<FString>
117 GetPropertyNames(UPARAM(ref) const FCesiumPropertyTexture& PropertyTexture);
118
127 UFUNCTION(
128 BlueprintCallable,
129 BlueprintPure,
130 Category = "Cesium|Metadata|PropertyTexture")
132 UPARAM(ref) const FCesiumPropertyTexture& PropertyTexture,
133 const FString& PropertyName);
134
150 UFUNCTION(
151 BlueprintCallable,
152 BlueprintPure,
153 Category = "Cesium|Metadata|PropertyTexture")
155 UPARAM(ref) const FCesiumPropertyTexture& PropertyTexture,
156 const FVector2D& UV);
157
171 UFUNCTION(
172 BlueprintCallable,
173 BlueprintPure,
174 Category = "Cesium|Metadata|PropertyTexture")
176 UPARAM(ref) const FCesiumPropertyTexture& PropertyTexture,
177 const FHitResult& Hit);
178};
ECesiumPropertyTextureStatus
static const ECesiumPropertyTextureStatus GetPropertyTextureStatus(UPARAM(ref) const FCesiumPropertyTexture &PropertyTexture)
Gets the status of the property texture.
static TMap< FString, FCesiumMetadataValue > GetMetadataValuesFromHit(UPARAM(ref) const FCesiumPropertyTexture &PropertyTexture, const FHitResult &Hit)
Given a trace hit result, gets all of the property values from property texture on the hit component,...
static const FString & GetPropertyTextureName(UPARAM(ref) const FCesiumPropertyTexture &PropertyTexture)
Gets the name of the property texture.
static const FCesiumPropertyTextureProperty & FindProperty(UPARAM(ref) const FCesiumPropertyTexture &PropertyTexture, const FString &PropertyName)
Retrieve a FCesiumPropertyTextureProperty by name.
static const TMap< FString, FCesiumPropertyTextureProperty > GetProperties(UPARAM(ref) const FCesiumPropertyTexture &PropertyTexture)
Gets all the properties of the property texture, mapped by property name.
static TMap< FString, FCesiumMetadataValue > GetMetadataValuesForUV(UPARAM(ref) const FCesiumPropertyTexture &PropertyTexture, const FVector2D &UV)
Gets all of the property values at the given texture coordinates, mapped by property name.
static const TArray< FString > GetPropertyNames(UPARAM(ref) const FCesiumPropertyTexture &PropertyTexture)
Gets the names of the properties in this property texture.
A Blueprint-accessible wrapper for a glTF metadata value.
A blueprint-accessible wrapper for a property texture property from a glTF.
A blueprint-accessible wrapper of a property texture from a glTF.
FString getClassName() const
Gets the name of the metadata class that this property table conforms to.
FCesiumPropertyTexture(const CesiumGltf::Model &model, const CesiumGltf::PropertyTexture &PropertyTexture)