Cesium for Unreal 2.12.0
Loading...
Searching...
No Matches
CesiumRasterOverlay.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
6#include "CesiumRasterOverlays/RasterOverlay.h"
7#include "Components/ActorComponent.h"
8#include "CoreMinimal.h"
9#include "Engine/Texture.h"
10#include "Engine/TextureDefines.h"
11#include <memory>
12#include "CesiumRasterOverlay.generated.h"
13
14namespace Cesium3DTilesSelection {
15class Tileset;
16}
17
23 FCesiumRasterOverlayLoadFailure,
25
26CESIUMRUNTIME_API extern FCesiumRasterOverlayLoadFailure
28
33USTRUCT(BlueprintType)
35 GENERATED_BODY()
36
37 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
38 TEnumAsByte<TextureFilter> filter = TextureFilter::TF_Default;
39
40 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
41 TEnumAsByte<TextureGroup> group = TextureGroup::TEXTUREGROUP_World;
42
43 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
44 bool useMipmaps = true;
45};
46
52UCLASS(Abstract)
53class CESIUMRUNTIME_API UCesiumRasterOverlay : public UActorComponent {
54 GENERATED_BODY()
55
56public:
66 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
67 FString MaterialLayerKey = "Overlay0";
68
74 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
76
77 // Sets default values for this component's properties
79
90 UFUNCTION(BlueprintCallable, Category = "Cesium")
91 void AddToTileset();
92
103 UFUNCTION(BlueprintCallable, Category = "Cesium")
104 void RemoveFromTileset();
105
113 UFUNCTION(BlueprintCallable, Category = "Cesium")
114 void Refresh();
115
116 UFUNCTION(BlueprintCallable, Category = "Cesium")
117 double GetMaximumScreenSpaceError() const;
118
119 UFUNCTION(BlueprintCallable, Category = "Cesium")
120 void SetMaximumScreenSpaceError(double Value);
121
122 UFUNCTION(BlueprintCallable, Category = "Cesium")
123 int32 GetMaximumTextureSize() const;
124
125 UFUNCTION(BlueprintCallable, Category = "Cesium")
126 void SetMaximumTextureSize(int32 Value);
127
128 UFUNCTION(BlueprintCallable, Category = "Cesium")
129 int32 GetMaximumSimultaneousTileLoads() const;
130
131 UFUNCTION(BlueprintCallable, Category = "Cesium")
132 void SetMaximumSimultaneousTileLoads(int32 Value);
133
134 UFUNCTION(BlueprintCallable, Category = "Cesium")
135 int64 GetSubTileCacheBytes() const;
136
137 UFUNCTION(BlueprintCallable, Category = "Cesium")
138 void SetSubTileCacheBytes(int64 Value);
139
157 virtual void Activate(bool bReset) override;
158
164 virtual void Deactivate() override;
165
166 virtual void OnComponentDestroyed(bool bDestroyingHierarchy) override;
167 virtual bool IsReadyForFinishDestroy() override;
168
169protected:
178 UPROPERTY(
179 EditAnywhere,
180 BlueprintReadWrite,
181 BlueprintGetter = GetMaximumScreenSpaceError,
182 BlueprintSetter = SetMaximumScreenSpaceError,
183 Category = "Cesium")
184 double MaximumScreenSpaceError = 2.0;
185
194 UPROPERTY(
195 EditAnywhere,
196 BlueprintReadWrite,
197 BlueprintGetter = GetMaximumTextureSize,
198 BlueprintSetter = SetMaximumTextureSize,
199 Category = "Cesium")
200 int32 MaximumTextureSize = 2048;
201
206 UPROPERTY(
207 EditAnywhere,
208 BlueprintReadWrite,
209 BlueprintGetter = GetMaximumSimultaneousTileLoads,
210 BlueprintSetter = SetMaximumSimultaneousTileLoads,
211 Category = "Cesium")
212 int32 MaximumSimultaneousTileLoads = 20;
213
224 UPROPERTY(
225 EditAnywhere,
226 BlueprintReadWrite,
227 BlueprintGetter = GetSubTileCacheBytes,
228 BlueprintSetter = SetSubTileCacheBytes,
229 Category = "Cesium")
230 int64 SubTileCacheBytes = 16 * 1024 * 1024;
231
235 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
236 bool ShowCreditsOnScreen;
237
238#if WITH_EDITOR
239 // Called when properties are changed in the editor
240 virtual void
241 PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
242#endif
243
245
246 virtual std::unique_ptr<CesiumRasterOverlays::RasterOverlay>
248 PURE_VIRTUAL(UCesiumRasterOverlay::CreateOverlay, return nullptr;);
249
250 virtual void OnAdd(
256
257private:
259 int32 _overlaysBeingDestroyed;
260};
DECLARE_MULTICAST_DELEGATE_OneParam(FCesiumRasterOverlayLoadFailure, const FCesiumRasterOverlayLoadFailureDetails &)
The delegate for OnCesiumRasterOverlayLoadFailure, which is triggered when the raster overlay encount...
FCesiumRasterOverlayLoadFailure OnCesiumRasterOverlayLoadFailure
A quadtree pyramid of 2D raster images meant to be draped over a Cesium 3D Tileset.
virtual void OnAdd(Cesium3DTilesSelection::Tileset *pTileset, CesiumRasterOverlays::RasterOverlay *pOverlay)
virtual void OnRemove(Cesium3DTilesSelection::Tileset *pTileset, CesiumRasterOverlays::RasterOverlay *pOverlay)
virtual std::unique_ptr< CesiumRasterOverlays::RasterOverlay > CreateOverlay(const CesiumRasterOverlays::RasterOverlayOptions &options={}) 0
Cesium3DTilesSelection::Tileset * FindTileset() const
This struct is passed through the raster overlay options and is used when prepareRasterInLoadThread i...