Cesium for Unreal 2.28.0
Loading...
Searching...
No Matches
CesiumVectorTilesRasterOverlay.h
Go to the documentation of this file.
1// Copyright 2020-2026 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include <CesiumVectorOverlays/VectorStylingProvider.h>
6
8#include "CesiumIonServer.h"
10#include "CesiumRasterOverlay.h"
11#include "CesiumVectorStyle.h"
12#include "Components/ActorComponent.h"
13#include "CoreMinimal.h"
14#include "Delegates/Delegate.h"
15#include "CesiumVectorTilesRasterOverlay.generated.h"
16
17/**
18 * Determines the styling provider to be used to provide styling information for
19 * individual features.
20 */
21UENUM()
23 None = 0 UMETA(ToolTip = "Only the default style will be used."),
25 ToolTip =
26 "Uses the Blueprint class implementing the ICesiumVectorTilesStylingCallbacks interface specified in BlueprintStylingProvider."),
28 ToolTip =
29 "Calls the TFunction specified on the overlay using C++ to create a VectorStylingProvider directly.")
30};
31
32UINTERFACE(Blueprintable, MinimalAPI)
33class UCesiumVectorTilesStylingCallbacks : public UInterface {
34 GENERATED_BODY()
35};
36
38 GENERATED_BODY()
39
40public:
41 /**
42 * This function is called before styling begins. It should be used to look up
43 * metadata property tables and store them for use in the styling functions.
44 */
45 UFUNCTION(
46 BlueprintCallable,
47 BlueprintNativeEvent,
48 Category = "Cesium|Styling")
49 void OnStylingBegin(const FCesiumModelMetadata& InModelMetadata);
50 virtual void
52
53 /**
54 * This function is called for each individual point feature.
55 *
56 * If it returns false, the default style will be used for this feature. If it
57 * returns true, the "Out Point Style" will be used for this feature.
58 */
59 UFUNCTION(
60 BlueprintCallable,
61 BlueprintNativeEvent,
62 Category = "Cesium|Styling")
64 int64 InFeatureId,
65 const FVector& InPointLlh,
66 FCesiumVectorPointStyle& OutPointStyle);
68 int64 InFeatureId,
69 const FVector& InPointLlh,
70 FCesiumVectorPointStyle& OutPointStyle) {
71 return false;
72 }
73
74 /**
75 * This function is called for each individual polyline feature.
76 *
77 * If it returns false, the default style will be used for this feature. If it
78 * returns true, the "Out Line Style" will be used for this feature.
79 */
80 UFUNCTION(
81 BlueprintCallable,
82 BlueprintNativeEvent,
83 Category = "Cesium|Styling")
85 int64 InFeatureId,
86 const TArray<FVector>& InPolylineLlh,
87 FCesiumVectorLineStyle& OutLineStyle);
89 int64 InFeatureId,
90 const TArray<FVector>& InPolylineLlh,
91 FCesiumVectorLineStyle& OutLineStyle) {
92 return false;
93 }
94
95 /**
96 * This function is called for each individual polygon feature.
97 *
98 * If it returns false, the default style will be used for this feature. If it
99 * returns true, the "Out Polygon Style" will be used for this feature.
100 */
101 UFUNCTION(
102 BlueprintCallable,
103 BlueprintNativeEvent,
104 Category = "Cesium|Styling")
106 int64 InFeatureId,
107 const TArray<FVector>& InPolygonLlh,
108 FCesiumVectorPolygonStyle& OutPolygonStyle);
110 int64 InFeatureId,
111 const TArray<FVector>& InPolygonLlh,
112 FCesiumVectorPolygonStyle& OutPolygonStyle) {
113 return false;
114 }
115};
116
117/**
118 * Configures where the CesiumVectorTilesRasterOverlay should load its vector
119 * data from.
120 */
121UENUM(BlueprintType)
123 /**
124 * The raster overlay will load a vector tileset from Cesium ion.
125 */
127 /**
128 * The raster overlay will load a vector tileset from a URL.
129 */
131};
132
133UCLASS(
134 ClassGroup = Cesium,
135 BlueprintType,
137 meta = (BlueprintSpawnableComponent))
138class CESIUMRUNTIME_API UCesiumVectorTilesRasterOverlay
139 : public UCesiumRasterOverlay {
140 GENERATED_BODY()
141
142public:
143 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
146 /**
147 * The ID of the Cesium ion asset to use.
148 */
149 UPROPERTY(
150 EditAnywhere,
151 BlueprintReadWrite,
152 Category = "Cesium",
153 meta =
154 (EditCondition =
155 "Source == ECesiumVectorTilesRasterOverlaySource::FromCesiumIon"))
157
158 /**
159 * The access token to use to access the Cesium ion resource.
160 */
161 UPROPERTY(
162 EditAnywhere,
163 BlueprintReadWrite,
164 Category = "Cesium",
165 meta =
166 (EditCondition =
167 "Source == ECesiumVectorTilesRasterOverlaySource::FromCesiumIon"))
169
170 /**
171 * The Cesium ion Server from which this raster overlay is loaded.
172 */
173 UPROPERTY(
174 EditAnywhere,
175 BlueprintReadWrite,
176 Category = "Cesium",
177 AdvancedDisplay,
178 meta =
179 (EditCondition =
180 "Source == ECesiumVectorTilesRasterOverlaySource::FromCesiumIon"))
182
183 /**
184 * A URL to load a vector tiles tileset from.
185 */
186 UPROPERTY(
187 EditAnywhere,
188 BlueprintReadWrite,
189 Category = "Cesium",
190 meta =
191 (EditCondition =
192 "Source == ECesiumVectorTilesRasterOverlaySource::FromUrl"))
193 FString Url;
194
195 /**
196 * Headers to use while making a request to `Url` to load a vector tiles
197 * tileset.
198 */
199 UPROPERTY(
200 EditAnywhere,
201 BlueprintReadWrite,
202 Category = "Cesium",
203 meta =
204 (EditCondition =
205 "Source == ECesiumVectorTilesRasterOverlaySource::FromUrl"))
206 TMap<FString, FString> RequestHeaders;
207
208 /**
209 * The number of mip levels to generate for each tile of this raster overlay.
210 *
211 * Additional mip levels can improve the visual quality of tiles farther from
212 * the camera at the cost of additional rasterization time to create each mip
213 * level.
214 */
215 UPROPERTY(
216 EditAnywhere,
217 BlueprintReadWrite,
218 Category = "Cesium",
219 meta = (ClampMin = "0", ClampMax = "8"))
220 int32 MipLevels = 0;
221
222 /**
223 * The default style to use for this raster overlay.
224 *
225 * If no style information is present in the vector tiles tileset, this style
226 * will be used instead.
227 */
228 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Styling")
230
231 /**
232 * The styling provider to use to apply styling information to individual
233 * features.
234 *
235 * If this is set to None, the DefaultStyle will be used for all features.
236 */
237 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Styling")
240
241 /**
242 * The Blueprint class that will be instantiated to provide styling
243 * information for features when StylingProviderType is set to Blueprint.
244 *
245 * Because Blueprints in Unreal need to run on the main thread, a Blueprint
246 * styling provider can cause significant performance degradation when styling
247 * large numbers of features. If improved performance is required, styling via
248 * C++ via the LambdaStylingProvider property should be used instead.
249 */
250 UPROPERTY(
251 EditAnywhere,
252 BlueprintReadWrite,
253 Category = "Cesium|Styling",
254 meta =
255 (EditCondition =
256 "StylingProviderType == ECesiumVectorStylingProviderType::Blueprint",
257 MustImplement =
258 "/Script/CesiumRuntime.CesiumVectorTilesStylingCallbacks"))
259 TSubclassOf<UObject> BlueprintStylingProvider;
260
261 /**
262 * The lambda that will be called to instantiate a
263 * `CesiumVectorOverlays::VectorStylingProvider` when StylingProviderType is
264 * set to Lambda.
265 */
266 TOptional<
267 TFunction<std::shared_ptr<CesiumVectorOverlays::VectorStylingProvider>()>>
269
270protected:
271 virtual std::unique_ptr<CesiumRasterOverlays::RasterOverlay> CreateOverlay(
272 const CesiumRasterOverlays::RasterOverlayOptions& options = {}) override;
273
274private:
275 UPROPERTY(Transient)
276 UObject* _pStylingInterfaceObject;
277};
@ UMETA
The tileset will be loaded from Cesium Ion using the provided IonAssetID and IonAccessToken.
@ Blueprint
Visual styles for each feature are evaluated in Blueprints before being passed to the generated mater...
@ FromCesiumIon
The raster overlay will load a GeoJsonDocument from Cesium ion.
@ FromUrl
The raster overlay will load a GeoJsonDocument from a URL.
Blueprintable
ECesiumVectorStylingProviderType
Determines the styling provider to be used to provide styling information for individual features.
ECesiumVectorTilesRasterOverlaySource
Configures where the CesiumVectorTilesRasterOverlay should load its vector data from.
@ FromCesiumIon
The raster overlay will load a vector tileset from Cesium ion.
bool OnStylePoint(int64 InFeatureId, const FVector &InPointLlh, FCesiumVectorPointStyle &OutPointStyle)
This function is called for each individual point feature.
virtual bool OnStylePoint_Implementation(int64 InFeatureId, const FVector &InPointLlh, FCesiumVectorPointStyle &OutPointStyle)
virtual void OnStylingBegin_Implementation(const FCesiumModelMetadata &InModelMetadata)
bool OnStylePolygon(int64 InFeatureId, const TArray< FVector > &InPolygonLlh, FCesiumVectorPolygonStyle &OutPolygonStyle)
This function is called for each individual polygon feature.
virtual bool OnStylePolyline_Implementation(int64 InFeatureId, const TArray< FVector > &InPolylineLlh, FCesiumVectorLineStyle &OutLineStyle)
virtual bool OnStylePolygon_Implementation(int64 InFeatureId, const TArray< FVector > &InPolygonLlh, FCesiumVectorPolygonStyle &OutPolygonStyle)
bool OnStylePolyline(int64 InFeatureId, const TArray< FVector > &InPolylineLlh, FCesiumVectorLineStyle &OutLineStyle)
This function is called for each individual polyline feature.
void OnStylingBegin(const FCesiumModelMetadata &InModelMetadata)
This function is called before styling begins.
Defines a Cesium ion Server.
TSubclassOf< UObject > BlueprintStylingProvider
The Blueprint class that will be instantiated to provide styling information for features when Stylin...
TMap< FString, FString > RequestHeaders
Headers to use while making a request to Url to load a vector tiles tileset.
ECesiumVectorTilesRasterOverlaySource Source
int64 IonAssetID
The ID of the Cesium ion asset to use.
UCesiumIonServer * CesiumIonServer
The Cesium ion Server from which this raster overlay is loaded.
int32 MipLevels
The number of mip levels to generate for each tile of this raster overlay.
FString Url
A URL to load a vector tiles tileset from.
FString IonAccessToken
The access token to use to access the Cesium ion resource.
FCesiumVectorStyle DefaultStyle
The default style to use for this raster overlay.
ECesiumVectorStylingProviderType StylingProviderType
The styling provider to use to apply styling information to individual features.
virtual std::unique_ptr< CesiumRasterOverlays::RasterOverlay > CreateOverlay(const CesiumRasterOverlays::RasterOverlayOptions &options={}) override
TOptional< TFunction< std::shared_ptr< CesiumVectorOverlays::VectorStylingProvider >()> > LambdaStylingProvider
The lambda that will be called to instantiate a CesiumVectorOverlays::VectorStylingProvider when Styl...
STL namespace.
A blueprint-accessible wrapper for metadata contained in a glTF model.
The style used to draw polylines and strokes.
The style used to draw polygons.
Style information to use when drawing vector data.