UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LandscapeEditLayerRenderer.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "LandscapeUtils.h"
11
12#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_6
15#endif // UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_6
16
17#include "LandscapeEditLayerRenderer.generated.h"
18
19// ----------------------------------------------------------------------------------
20// Forward declarations
21
23
24namespace UE::Landscape
25{
26 class FRDGBuilderRecorder;
27} // namespace UE::Landscape
28
30{
32 struct FRenderParams;
35} // namespace UE::Landscape::EditLayers
36
37
38// ----------------------------------------------------------------------------------
39
41{
42
43#if WITH_EDITOR
44
45// ----------------------------------------------------------------------------------
46
48// TODO [jonathan.bard] : use FOrientedBox2d instead?
49struct FOOBox2D
50{
51 FOOBox2D() = default;
54 , Extents(InExtents)
55 {}
56
58 FVector2D Extents = FVector2D(ForceInit);
59
60 FBox BuildAABB() const;
61};
62
63
64// ----------------------------------------------------------------------------------
65
70{
71public:
72 enum class EType
73 {
74 LocalComponent, // Designates any landscape component (i.e. the input area corresponds to the component being requested), with an optional number of neighboring components around it
75 SpecificComponent, // Designates a specific landscape component (based on its component key), with an optional number of neighboring components around it
76 OOBox, // Designates a fixed world area (an object-oriented box)
77 Infinite, // Designates the entire loaded landscape area
78 };
79
80 static FInputWorldArea CreateInfinite() { return FInputWorldArea(EType::Infinite); }
84
85 EType GetType() const { return Type; }
91 const FOOBox2D& GetOOBox() const { check(Type == EType::OOBox); return OOBox2D; }
92 const FOOBox2D* TryGetOOBox() const { return (Type == EType::OOBox) ? &OOBox2D : nullptr; }
93
96
97private:
99 : Type(InType)
103 {}
104
105private:
106 EType Type = EType::LocalComponent;
112
115};
116
117
118// ----------------------------------------------------------------------------------
119
125{
126public:
127 enum class EType
128 {
129 LocalComponent, // Designates any landscape component (i.e. the input area corresponds to the component being requested)
130 SpecificComponent, // Designates a specific landscape component (based on its component key)
131 OOBox, // Designates a fixed world area (an Object-oriented box)
132 };
133
134 static FOutputWorldArea CreateLocalComponent() { return FOutputWorldArea(EType::LocalComponent); }
135 static FOutputWorldArea CreateSpecificComponent(const FIntPoint& InComponentKey) { return FOutputWorldArea(EType::SpecificComponent, InComponentKey); }
136 static FOutputWorldArea CreateOOBox(const FOOBox2D& InOOBox) { return FOutputWorldArea(EType::OOBox, FIntPoint(ForceInit), InOOBox); }
137
138 EType GetType() const { return Type; }
140 const FIntPoint& GetSpecificComponentKey() const { check(Type == EType::SpecificComponent); return SpecificComponentKey; }
142 const FOOBox2D& GetOOBox() const { check(Type == EType::OOBox); return OOBox2D; }
143 const FOOBox2D* TryGetOOBox() const { return (Type == EType::OOBox) ? &OOBox2D : nullptr; }
144
147
148private:
150 : Type(InType)
153 {}
154
155private:
156 EType Type = EType::LocalComponent;
161};
162
163
164// ----------------------------------------------------------------------------------
165
172{
173public:
174 FEditLayerRenderItem() = delete;
180 {}
181
183
184 const FInputWorldArea& GetInputWorldArea() const { return InputWorldArea; }
186
187 const FOutputWorldArea& GetOutputWorldArea() const { return OutputWorldArea; }
189
191
192private:
193
196
204
212
215};
216
217
218// ----------------------------------------------------------------------------------
219
224{
225public:
226 virtual ~IEditLayerRendererProvider() {}
227
233 virtual TArray<FEditLayerRendererState> GetEditLayerRendererStates(const FMergeContext* InMergeContext) PURE_VIRTUAL(IEditLayerRendererProvider::GetEditLayerRendererStates, return {}; );
234};
235
236#endif // WITH_EDITOR
237
238} // namespace UE::Landscape::EditLayers
239
240
241// ----------------------------------------------------------------------------------
242
253
260{
262
263#if WITH_EDITOR
264public:
265 using FRenderParams UE_DEPRECATED(5.6, "Use UE::Landscape::EditLayers::FRenderParams") = UE::Landscape::EditLayers::FRenderParams;
266
287 virtual void GetRendererStateInfo(const UE::Landscape::EditLayers::FMergeContext* InMergeContext,
288 UE::Landscape::EditLayers::FEditLayerTargetTypeState& OutSupportedTargetTypeState, UE::Landscape::EditLayers::FEditLayerTargetTypeState& OutEnabledTargetTypeState,
290 PURE_VIRTUAL(ILandscapeEditLayerRenderer::GetRendererStateInfo, );
291
295 virtual FString GetEditLayerRendererDebugName() const
296 PURE_VIRTUAL(ILandscapeEditLayerRenderer::GetEditLayerRendererDebugName, return TEXT(""); );
297
305 virtual TArray<UE::Landscape::EditLayers::FEditLayerRenderItem> GetRenderItems(const UE::Landscape::EditLayers::FMergeContext* InMergeContext) const
306 PURE_VIRTUAL(ILandscapeEditLayerRenderer::GetRenderItems, return { }; );
307
313 virtual UE::Landscape::EditLayers::ERenderFlags GetRenderFlags(const UE::Landscape::EditLayers::FMergeContext* InMergeContext) const
314 PURE_VIRTUAL(ILandscapeEditLayerRenderer::GetRenderFlags, return UE::Landscape::EditLayers::ERenderFlags::None; );
315
336 virtual bool RenderLayer(UE::Landscape::EditLayers::FRenderParams& RenderParams, UE::Landscape::FRDGBuilderRecorder& RDGBuilderRecorder)
337 PURE_VIRTUAL(ILandscapeEditLayerRenderer::RenderLayer, return false; );
338
348 virtual void BlendLayer(UE::Landscape::EditLayers::FRenderParams& RenderParams, UE::Landscape::FRDGBuilderRecorder& RDGBuilderRecorder) {}
349
359
366 virtual void BeginRenderLayerGroup(UE::Landscape::EditLayers::FRenderParams& RenderParams, UE::Landscape::FRDGBuilderRecorder& RDGBuilderRecorder) {}
367
374 virtual void EndRenderLayerGroup(UE::Landscape::EditLayers::FRenderParams& RenderParams, UE::Landscape::FRDGBuilderRecorder& RDGBuilderRecorder) {}
375
376#endif // WITH_EDITOR
377};
#define check(expr)
Definition AssertionMacros.h:314
#define PURE_VIRTUAL(func,...)
Definition CoreMiscDefines.h:103
@ ForceInit
Definition CoreMiscDefines.h:155
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::Math::TIntRect< int32 > FIntRect
Definition MathFwd.h:133
UE::Math::TVector2< double > FVector2D
Definition MathFwd.h:48
FInt32Point FIntPoint
Definition MathFwd.h:124
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UINTERFACE(...)
Definition ObjectMacros.h:780
Definition LandscapeEditLayerRenderer.h:260
Definition Array.h:670
Definition ScriptInterface.h:139
Definition LandscapeUtils.h:106
Definition Interface.h:19
Definition LandscapeEditLayerRenderer.h:249
Definition LandscapeLayerInfoObject.h:60
ECollisionShapeType GetType(const Chaos::FImplicitObject &InGeometry)
Definition ChaosInterfaceWrapperCore.h:105
Type
Definition PawnAction_Move.h:11
EType
Definition AccessDetection.h:11
Definition Landscape.h:55
Definition Landscape.h:55
Definition IntPoint.h:25