UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TypedElementWorldInterface.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6
8
9#include "CoreFwd.h"
10#include "UObject/Interface.h"
12
13#include "TypedElementWorldInterface.generated.h"
14
15class ULevel;
17class UWorld;
18struct FCollisionShape;
20struct FConvexVolume;
21struct FEngineShowFlags;
23
24UENUM()
26{
27 Game,
28 Editor,
29};
30
31USTRUCT(BlueprintType)
33{
35
36public:
38 bool VerifyDeletionCanHappen() const { return bVerifyDeletionCanHappen; }
39
41 bool WarnAboutReferences() const { return bWarnAboutReferences; }
42
44 bool WarnAboutSoftReferences() const { return bWarnAboutSoftReferences; }
45
46private:
47 UPROPERTY(BlueprintReadWrite, Category="TypedElementInterfaces|World|DeletionOptions", meta=(AllowPrivateAccess=true))
48 bool bVerifyDeletionCanHappen = false;
49
50 UPROPERTY(BlueprintReadWrite, Category="TypedElementInterfaces|World|DeletionOptions", meta=(AllowPrivateAccess=true))
51 bool bWarnAboutReferences = true;
52
53 UPROPERTY(BlueprintReadWrite, Category="TypedElementInterfaces|World|DeletionOptions", meta=(AllowPrivateAccess=true))
54 bool bWarnAboutSoftReferences = true;
55};
56
72
73UINTERFACE(MinimalAPI, BlueprintType, meta = (CannotImplementInterfaceInBlueprint))
78
80{
82
83public:
87 virtual bool IsTemplateElement(const FTypedElementHandle& InElementHandle) { return false; }
88
92 virtual bool CanEditElement(const FTypedElementHandle& InElementHandle) { return true; }
93
97 virtual ULevel* GetOwnerLevel(const FTypedElementHandle& InElementHandle) { return nullptr; }
98
102 virtual UWorld* GetOwnerWorld(const FTypedElementHandle& InElementHandle) { return nullptr; }
103
108
113
117 virtual bool CanScaleElement(const FTypedElementHandle& InElementHandle) { return true; }
118
122 virtual bool GetWorldTransform(const FTypedElementHandle& InElementHandle, FTransform& OutTransform) { return false; }
123
127 virtual bool SetWorldTransform(const FTypedElementHandle& InElementHandle, const FTransform& InTransform) { return false; }
128
132 virtual bool GetRelativeTransform(const FTypedElementHandle& InElementHandle, FTransform& OutTransform) { return GetWorldTransform(InElementHandle, OutTransform); }
133
138
143
147 virtual bool SetPivotOffset(const FTypedElementHandle& InElementHandle, const FVector& InPivotOffset) { return false; }
148
153
158
163
172
180
195
199 virtual bool CanDeleteElement(const FTypedElementHandle& InElementHandle) { return false; }
200
209
215
219 virtual bool CanDuplicateElement(const FTypedElementHandle& InElementHandle) { return false; }
220
231
239
240 virtual bool CanCopyElement(const FTypedElementHandle& InElementHandle) { return false; }
241
251
259
261 {
262 return {};
263 }
264
271 {
272 return false;
273 }
274
286
291 ENGINE_API virtual bool IsElementInConvexVolume(const FTypedElementHandle& Handle, const FConvexVolume& InVolume, bool bMustEncompassEntireElement = false);
292
297 ENGINE_API virtual bool IsElementInBox(const FTypedElementHandle& Handle, const FBox& InBox, bool bMustEncompassEntireElement = false);
298
303
308
312 const TFunction<bool(const FTypedElementHandle& /*ElementHandle*/, const FWorldSelectionElementArgs& /*SelectionArgs*/)>& SelectionFunction
313 );
314
315
323 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
325
329 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
331
335 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
337
341 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
343
347 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
349
353 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
355
359 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
361
365 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
367
371 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
373
377 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
379
383 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
385
389 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
391
395 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
397
401 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
403
407 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
409
413 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
415
419 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
421
426 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
428
432 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
434
439 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
441
447 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
449
457 UFUNCTION(BlueprintCallable, Category="TypedElementInterfaces|World")
459
465};
466
467template <>
469{
470 bool IsTemplateElement() const { return InterfacePtr->IsTemplateElement(*this); }
471 bool CanEditElement() const { return InterfacePtr->CanEditElement(*this); }
472 ULevel* GetOwnerLevel() const { return InterfacePtr->GetOwnerLevel(*this); }
473 UWorld* GetOwnerWorld() const { return InterfacePtr->GetOwnerWorld(*this); }
474 bool GetBounds(FBoxSphereBounds& OutBounds) const { return InterfacePtr->GetBounds(*this, OutBounds); }
475 bool CanMoveElement(const ETypedElementWorldType InWorldType) const { return InterfacePtr->CanMoveElement(*this, InWorldType); }
476 bool CanScaleElement() const { return InterfacePtr->CanScaleElement(*this); }
477 bool GetWorldTransform(FTransform& OutTransform) const { return InterfacePtr->GetWorldTransform(*this, OutTransform); }
478 bool SetWorldTransform(const FTransform& InTransform) const { return InterfacePtr->SetWorldTransform(*this, InTransform); }
479 bool GetRelativeTransform(FTransform& OutTransform) const { return InterfacePtr->GetRelativeTransform(*this, OutTransform); }
480 bool SetRelativeTransform(const FTransform& InTransform) const { return InterfacePtr->SetRelativeTransform(*this, InTransform); }
481 bool GetPivotOffset(FVector& OutPivotOffset) const { return InterfacePtr->GetPivotOffset(*this, OutPivotOffset); }
482 bool SetPivotOffset(const FVector& InPivotOffset) const { return InterfacePtr->SetPivotOffset(*this, InPivotOffset); }
483 void NotifyMovementStarted() const { InterfacePtr->NotifyMovementStarted(*this); }
484 void NotifyMovementOngoing() const { InterfacePtr->NotifyMovementOngoing(*this); }
485 void NotifyMovementEnded() const { InterfacePtr->NotifyMovementEnded(*this); }
486 bool FindSuitableTransformAtPoint(const FTransform& InPotentialTransform, FTransform& OutSuitableTransform) const { return InterfacePtr->FindSuitableTransformAtPoint(*this, InPotentialTransform, OutSuitableTransform); }
489 bool CanDeleteElement() const { return InterfacePtr->CanDeleteElement(*this); }
491 bool CanDuplicateElement() const { return InterfacePtr->CanDuplicateElement(*this); }
492 FTypedElementHandle DuplicateElement(UWorld* InWorld, const FVector& InLocationOffset) const { return InterfacePtr->DuplicateElement(*this, InWorld, InLocationOffset); }
493 bool CanCopyElement() const { return InterfacePtr->CanCopyElement(*this); }
494 void CopyElement(FOutputDevice& Out) const { InterfacePtr->CopyElement(*this, Out); }
495 bool CanPromoteElement() const { return InterfacePtr->CanPromoteElement(*this); }
496 FTypedElementHandle PromoteElement(UWorld* OverrideWorld = nullptr) const { return InterfacePtr->PromoteElement(*this, OverrideWorld); }
497 bool IsElementInConvexVolume(const FConvexVolume& InVolume, bool bMustEncompassEntireElement = false) const { return InterfacePtr->IsElementInConvexVolume(*this, InVolume, bMustEncompassEntireElement); }
498 bool IsElementInBox(const FBox& InBox, bool bMustEncompassEntireElement = false) const { return InterfacePtr->IsElementInBox(*this, InBox, bMustEncompassEntireElement); }
499 TArray<FTypedElementHandle> GetSelectionElementsInConvexVolume(const FConvexVolume& InVolume, const FWorldSelectionElementArgs& SelectionArgs) const { return InterfacePtr->GetSelectionElementsInConvexVolume(*this, InVolume, SelectionArgs); }
500 TArray<FTypedElementHandle> GetSelectionElementsInBox(const FBox& InBox, const FWorldSelectionElementArgs& SelectionArgs) const { return InterfacePtr->GetSelectionElementsInBox(*this, InBox, SelectionArgs); }
502 {
503 return InterfacePtr->GetSelectionElementsFromSelectionFunction(*this, SelectionArgs, SelectionFunction);
504 }
505};
506
508{
509 // Optional selection set to use to get the selectable elements only
511
513
515
516 // Optional show flag to avoid selecting non rendered elements
518
519 bool bMustEncompassEntireElement = false;
520
521 // To deprecate once the BSP tools are removed from the engine
522 bool bBSPSelectionOnly = false;
523};
constexpr auto MakeArrayView(OtherRangeType &&Other)
Definition ArrayView.h:873
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UINTERFACE(...)
Definition ObjectMacros.h:780
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
ETypedElementSelectionMethod
Definition TypedElementSelectionInterface.h:25
ETypedElementWorldType
Definition TypedElementWorldInterface.h:26
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition OutputDevice.h:133
Definition TypedElementWorldInterface.h:80
virtual bool CanMoveElement(const FTypedElementHandle &InElementHandle, const ETypedElementWorldType InWorldType)
Definition TypedElementWorldInterface.h:112
virtual bool GetRelativeTransform(const FTypedElementHandle &InElementHandle, FTransform &OutTransform)
Definition TypedElementWorldInterface.h:132
virtual bool CanPromoteElement(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:270
virtual bool SetWorldTransform(const FTypedElementHandle &InElementHandle, const FTransform &InTransform)
Definition TypedElementWorldInterface.h:127
virtual bool SetPivotOffset(const FTypedElementHandle &InElementHandle, const FVector &InPivotOffset)
Definition TypedElementWorldInterface.h:147
virtual TSharedPtr< FWorldElementPasteImporter > GetPasteImporter()
Definition TypedElementWorldInterface.h:260
virtual ENGINE_API bool IsElementInConvexVolume(const FTypedElementHandle &Handle, const FConvexVolume &InVolume, bool bMustEncompassEntireElement=false)
Definition TypedElementWorldInterface.cpp:14
virtual FTypedElementHandle PromoteElement(const FTypedElementHandle &InElementHandle, UWorld *OverrideWorld=nullptr)
Definition TypedElementWorldInterface.h:282
virtual bool GetBounds(const FTypedElementHandle &InElementHandle, FBoxSphereBounds &OutBounds)
Definition TypedElementWorldInterface.h:107
virtual void NotifyMovementStarted(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:152
virtual bool FindSuitableTransformAtPoint(const FTypedElementHandle &InElementHandle, const FTransform &InPotentialTransform, FTransform &OutSuitableTransform)
Definition TypedElementWorldInterface.h:167
ENGINE_API TArray< FTypedElementHandle > GetSelectionElementsInConvexVolume(const FTypedElementHandle &Handle, const FConvexVolume &InVolume, const FWorldSelectionElementArgs &SelectionArgs)
Definition TypedElementWorldInterface.cpp:49
virtual ENGINE_API class UTypedElementRegistry & GetRegistry() const
Definition TypedElementWorldInterface.cpp:425
virtual ENGINE_API TArray< FTypedElementHandle > GetSelectionElementsFromSelectionFunction(const FTypedElementHandle &Handle, const FWorldSelectionElementArgs &SelectionArgs, const TFunction< bool(const FTypedElementHandle &, const FWorldSelectionElementArgs &)> &SelectionFunction)
Definition TypedElementWorldInterface.cpp:77
virtual bool CanCopyElement(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:240
virtual ENGINE_API bool IsElementInBox(const FTypedElementHandle &Handle, const FBox &InBox, bool bMustEncompassEntireElement=false)
Definition TypedElementWorldInterface.cpp:29
virtual FTypedElementHandle DuplicateElement(const FTypedElementHandle &InElementHandle, UWorld *InWorld, const FVector &InLocationOffset)
Definition TypedElementWorldInterface.h:225
virtual bool CanDeleteElement(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:199
virtual void NotifyMovementOngoing(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:157
virtual bool FindSuitableTransformAlongPath(const FTypedElementHandle &InElementHandle, const FVector &InPathStart, const FVector &InPathEnd, const FCollisionShape &InTestShape, TArrayView< const FTypedElementHandle > InElementsToIgnore, FTransform &OutSuitableTransform)
Definition TypedElementWorldInterface.h:176
virtual bool DeleteElements(TArrayView< const FTypedElementHandle > InElementHandles, UWorld *InWorld, UTypedElementSelectionSet *InSelectionSet, const FTypedElementDeletionOptions &InDeletionOptions)
Definition TypedElementWorldInterface.h:214
virtual ULevel * GetOwnerLevel(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:97
virtual bool CanDuplicateElement(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:219
virtual bool CanScaleElement(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:117
virtual bool GetPivotOffset(const FTypedElementHandle &InElementHandle, FVector &OutPivotOffset)
Definition TypedElementWorldInterface.h:142
virtual void CopyElement(const FTypedElementHandle &InElementHandle, FOutputDevice &Out)
Definition TypedElementWorldInterface.h:247
virtual bool SetRelativeTransform(const FTypedElementHandle &InElementHandle, const FTransform &InTransform)
Definition TypedElementWorldInterface.h:137
virtual bool GetWorldTransform(const FTypedElementHandle &InElementHandle, FTransform &OutTransform)
Definition TypedElementWorldInterface.h:122
virtual void NotifyMovementEnded(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:162
virtual bool DeleteElement(const FTypedElementHandle &InElementHandle, UWorld *InWorld, UTypedElementSelectionSet *InSelectionSet, const FTypedElementDeletionOptions &InDeletionOptions)
Definition TypedElementWorldInterface.h:205
virtual bool AddIgnoredElementToCollisionQueryParams(const FTypedElementHandle &InElementHandle, FCollisionQueryParams &InOutParams, bool bAlsoIgnoreSubElements=true)
Definition TypedElementWorldInterface.h:190
virtual UWorld * GetOwnerWorld(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:102
ENGINE_API TArray< FTypedElementHandle > GetSelectionElementsInBox(const FTypedElementHandle &Handle, const FBox &InBox, const FWorldSelectionElementArgs &SelectionArgs)
Definition TypedElementWorldInterface.cpp:63
virtual bool IsTemplateElement(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:87
virtual void CopyElements(TArrayView< const FTypedElementHandle > InElementHandles, FOutputDevice &Out)
Definition TypedElementWorldInterface.h:256
virtual void DuplicateElements(TArrayView< const FTypedElementHandle > InElementHandles, UWorld *InWorld, const FVector &InLocationOffset, TArray< FTypedElementHandle > &OutNewElements)
Definition TypedElementWorldInterface.h:236
virtual bool CanEditElement(const FTypedElementHandle &InElementHandle)
Definition TypedElementWorldInterface.h:92
Definition ArrayView.h:139
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
Definition AndroidPlatformMisc.h:14
Definition Interface.h:19
Definition Level.h:423
Definition TypedElementRegistry.h:55
Definition TypedElementSelectionSet.h:180
Definition TypedElementWorldInterface.h:75
Definition World.h:918
@ false
Definition radaudio_common.h:23
Definition CollisionQueryParams.h:43
Definition CollisionShape.h:21
Definition ConvexVolume.h:44
Definition ShowFlags.h:56
Definition TypedElementHandle.h:625
Definition TypedElementWorldInterface.h:33
bool WarnAboutReferences() const
Definition TypedElementWorldInterface.h:41
FTypedElementDeletionOptions & SetVerifyDeletionCanHappen(const bool InVerifyDeletionCanHappen)
Definition TypedElementWorldInterface.h:37
FTypedElementDeletionOptions & SetWarnAboutReferences(const bool InWarnAboutReferences)
Definition TypedElementWorldInterface.h:40
bool WarnAboutSoftReferences() const
Definition TypedElementWorldInterface.h:44
bool VerifyDeletionCanHappen() const
Definition TypedElementWorldInterface.h:38
FTypedElementDeletionOptions & SetWarnAboutSoftReferences(const bool InWarnAboutSoftReferences)
Definition TypedElementWorldInterface.h:43
Definition TypedElementHandle.h:18
Definition TypedElementSelectionInterface.h:67
Definition TypedElementWorldInterface.h:62
FStringView Text
Definition TypedElementWorldInterface.h:65
FTypedElementListConstPtr CurrentSelection
Definition TypedElementWorldInterface.h:63
UWorld * World
Definition TypedElementWorldInterface.h:64
Definition TypedElementWorldInterface.h:58
virtual TArray< FTypedElementHandle > GetImportedElements()
Definition TypedElementWorldInterface.h:70
virtual ~FWorldElementPasteImporter()=default
virtual void Import(FContext &Context)
Definition TypedElementWorldInterface.h:68
Definition TypedElementWorldInterface.h:508
FEngineShowFlags * ShowFlags
Definition TypedElementWorldInterface.h:517
FTypedElementSelectionOptions SelectionOptions
Definition TypedElementWorldInterface.h:514
const UTypedElementSelectionSet * SelectionSet
Definition TypedElementWorldInterface.h:510
Definition TypedElementHandle.h:271
bool CanDeleteElement() const
Definition TypedElementWorldInterface.h:489
bool AddIgnoredElementToCollisionQueryParams(const FTypedElementHandle &InElementHandle, FCollisionQueryParams &InOutParams, bool bAlsoIgnoreSubElements=true) const
Definition TypedElementWorldInterface.h:488
bool CanScaleElement() const
Definition TypedElementWorldInterface.h:476
bool FindSuitableTransformAlongPath(const FVector &InPathStart, const FVector &InPathEnd, const FCollisionShape &InTestShape, TArrayView< const FTypedElementHandle > InElementsToIgnore, FTransform &OutSuitableTransform) const
Definition TypedElementWorldInterface.h:487
bool SetWorldTransform(const FTransform &InTransform) const
Definition TypedElementWorldInterface.h:478
void CopyElement(FOutputDevice &Out) const
Definition TypedElementWorldInterface.h:494
TArray< FTypedElementHandle > GetSelectionElementsInBox(const FBox &InBox, const FWorldSelectionElementArgs &SelectionArgs) const
Definition TypedElementWorldInterface.h:500
bool CanMoveElement(const ETypedElementWorldType InWorldType) const
Definition TypedElementWorldInterface.h:475
bool GetRelativeTransform(FTransform &OutTransform) const
Definition TypedElementWorldInterface.h:479
FTypedElementHandle DuplicateElement(UWorld *InWorld, const FVector &InLocationOffset) const
Definition TypedElementWorldInterface.h:492
void NotifyMovementStarted() const
Definition TypedElementWorldInterface.h:483
bool GetPivotOffset(FVector &OutPivotOffset) const
Definition TypedElementWorldInterface.h:481
TArray< FTypedElementHandle > GetSelectionElementsInConvexVolume(const FConvexVolume &InVolume, const FWorldSelectionElementArgs &SelectionArgs) const
Definition TypedElementWorldInterface.h:499
bool DeleteElement(UWorld *InWorld, UTypedElementSelectionSet *InSelectionSet, const FTypedElementDeletionOptions &InDeletionOptions) const
Definition TypedElementWorldInterface.h:490
void NotifyMovementEnded() const
Definition TypedElementWorldInterface.h:485
bool GetBounds(FBoxSphereBounds &OutBounds) const
Definition TypedElementWorldInterface.h:474
FTypedElementHandle PromoteElement(UWorld *OverrideWorld=nullptr) const
Definition TypedElementWorldInterface.h:496
bool IsTemplateElement() const
Definition TypedElementWorldInterface.h:470
bool CanDuplicateElement() const
Definition TypedElementWorldInterface.h:491
TArray< FTypedElementHandle > GetSelectionElementsFromSelectionFunction(const FWorldSelectionElementArgs &SelectionArgs, const TFunction< bool(const FTypedElementHandle &, const FWorldSelectionElementArgs &)> &SelectionFunction) const
Definition TypedElementWorldInterface.h:501
bool FindSuitableTransformAtPoint(const FTransform &InPotentialTransform, FTransform &OutSuitableTransform) const
Definition TypedElementWorldInterface.h:486
ULevel * GetOwnerLevel() const
Definition TypedElementWorldInterface.h:472
bool SetRelativeTransform(const FTransform &InTransform) const
Definition TypedElementWorldInterface.h:480
bool IsElementInConvexVolume(const FConvexVolume &InVolume, bool bMustEncompassEntireElement=false) const
Definition TypedElementWorldInterface.h:497
bool IsElementInBox(const FBox &InBox, bool bMustEncompassEntireElement=false) const
Definition TypedElementWorldInterface.h:498
bool CanCopyElement() const
Definition TypedElementWorldInterface.h:493
bool CanPromoteElement() const
Definition TypedElementWorldInterface.h:495
void NotifyMovementOngoing() const
Definition TypedElementWorldInterface.h:484
bool CanEditElement() const
Definition TypedElementWorldInterface.h:471
bool SetPivotOffset(const FVector &InPivotOffset) const
Definition TypedElementWorldInterface.h:482
bool GetWorldTransform(FTransform &OutTransform) const
Definition TypedElementWorldInterface.h:477
UWorld * GetOwnerWorld() const
Definition TypedElementWorldInterface.h:473
Definition TypedElementHandle.h:396
Definition BoxSphereBounds.h:25