Cesium for Unreal 2.15.0
Loading...
Searching...
No Matches
CesiumTileExcluder.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4#include "CesiumTile.h"
5#include "Components/ActorComponent.h"
6#include "CoreMinimal.h"
7#include "CesiumTileExcluder.generated.h"
8
9class CesiumTileExcluderAdapter;
10
11/**
12 * An actor component for excluding Cesium Tiles.
13 * This class provides an interface for excluding Cesium Tiles from a tileset.
14 * You can create a blueprint that derives from this class and override the
15 * `ShouldExclude` function to implement custom logic for determining whether a
16 * tile should be excluded. This function can be implemented in either C++ or
17 * Blueprints.
18 */
19UCLASS(
20 ClassGroup = (Cesium),
21 meta = (BlueprintSpawnableComponent),
23 Abstract)
24class CESIUMRUNTIME_API UCesiumTileExcluder : public UActorComponent {
25 GENERATED_BODY()
26private:
27 CesiumTileExcluderAdapter* pExcluderAdapter;
28
29 UPROPERTY()
30 UCesiumTile* CesiumTile;
31
32public:
33 UCesiumTileExcluder(const FObjectInitializer& ObjectInitializer);
34
35 virtual void Activate(bool bReset) override;
36 virtual void Deactivate() override;
37 virtual void OnComponentDestroyed(bool bDestroyingHierarchy) override;
38
39#if WITH_EDITOR
40 // Called when properties are changed in the editor
41 virtual void
42 PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
43#endif
44
45 /**
46 * Adds this tile excluder to its owning Cesium 3D Tileset Actor. If the
47 * excluder is already added or if this component's Owner is not a Cesium 3D
48 * Tileset, this method does nothing.
49 */
50 UFUNCTION(BlueprintCallable, Category = "Cesium")
52
53 /**
54 * Removes this tile excluder from its owning Cesium 3D Tileset Actor. If the
55 * excluder is not yet added or if this component's Owner is not a Cesium 3D
56 * Tileset, this method does nothing.
57 */
58 UFUNCTION(BlueprintCallable, Category = "Cesium")
60
61 /**
62 * Refreshes this tile excluderby removing from its owning Cesium 3D Tileset
63 * Actor and re-adding it. If this component's Owner is not a Cesium 3D
64 * Tileset Actor, this method does nothing.
65 */
66 UFUNCTION(BlueprintCallable, Category = "Cesium")
67 void Refresh();
68
69 /**
70 * Determines whether a tile should be excluded.
71 * This function is called to determine whether a tile should be excluded from
72 * the tileset. You can override this function in a derived class or blueprint
73 * to implement custom exclusion logic.
74 */
75 UFUNCTION(BlueprintNativeEvent)
76 bool ShouldExclude(const UCesiumTile* TileObject);
77};
Blueprintable
void AddToTileset()
Adds this tile excluder to its owning Cesium 3D Tileset Actor.
bool ShouldExclude(const UCesiumTile *TileObject)
Determines whether a tile should be excluded.
void RemoveFromTileset()
Removes this tile excluder from its owning Cesium 3D Tileset Actor.
virtual void Deactivate() override
virtual void Activate(bool bReset) override
UCesiumTileExcluder(const FObjectInitializer &ObjectInitializer)
virtual void OnComponentDestroyed(bool bDestroyingHierarchy) override
void Refresh()
Refreshes this tile excluderby removing from its owning Cesium 3D Tileset Actor and re-adding it.
A UObject representation of a Cesium Tile.
Definition CesiumTile.h:18