UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InteractiveToolQueryInterfaces.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"
6#include "InteractiveTool.h" // EToolShutdownType, EToolShutdownReason
7#include "UObject/Interface.h"
8#include "InteractiveToolQueryInterfaces.generated.h"
9
10
11//
12// Below are various interfaces that a UInteractiveTool can implement to allow
13// higher-level code (eg like an EdMode) to query into the Tool.
14//
15
16
17
18// UInterface for IInteractiveToolCameraFocusAPI
19UINTERFACE(MinimalAPI)
24
41{
43public:
44
48 virtual bool SupportsWorldSpaceFocusBox() { return false; }
49
53 virtual FBox GetWorldSpaceFocusBox() { return FBox(); }
54
58 virtual bool SupportsWorldSpaceFocusPoint() { return false; }
59
65 virtual bool GetWorldSpaceFocusPoint(const FRay& WorldRay, FVector& PointOut) { return false; }
66
67
68};
69
70
71
72
73
74
75
76// UInterface for IInteractiveToolNestedAcceptCancelAPI
77UINTERFACE(MinimalAPI)
82
92{
94public:
95
99 virtual bool SupportsNestedCancelCommand() { return false; }
100
104 virtual bool CanCurrentlyNestedCancel() { return false; }
105
110 virtual bool ExecuteNestedCancelCommand() { return false; }
111
112
113
117 virtual bool SupportsNestedAcceptCommand() { return false; }
118
122 virtual bool CanCurrentlyNestedAccept() { return false; }
123
128 virtual bool ExecuteNestedAcceptCommand() { return false; }
129
130
131};
132
133// UInterface for IInteractiveToolShutdownQueryAPI
134UINTERFACE(MinimalAPI)
139
153{
155public:
156
157 enum class UE_DEPRECATED(5.7, "EShutdownReason has moved to InteractiveTool.h (under the name EToolShutdownReason).") EShutdownReason
158 {
159 // Another tool is being activated without the user having explicitly shut down this one.
161 };
162
170 UE_DEPRECATED(5.7, "Prefer the GetPreferredShutdownType variant which uses EToolShutdownReason.")
177
186 {
188 {
189 // todo: remove this special case when removing the deprecated variant of GetPreferredShutdownType.
191 return GetPreferredShutdownType(EShutdownReason::SwitchTool, StandardShutdownType);
193 }
194
196 }
197
198 //~ Not currently supported, but someday we might let tools query the user with an "are you sure"
199 //~ type of message, and allow the tool to ask to NOT be shut down after all. This is one way
200 //~ we might implement the ability for tools to ask for this:
201 //~ struct FShutdownUserQuery
202 //~ {
203 //~ FString MessageToUser;
204 //~ EAppMsgType::Type QueryType;
205 //~ TFunction<void(EAppReturnType::Type UserResponse, bool& bStillShutdownOut, EToolShutdownType& ShutdownTypeOut)> ResponseHandler;
206 //~ };
207 //~ TOptional<FShutdownUserQuery> GetShutdownUserQuery() { return TOptional<FShutdownUserQuery>(); }
208};
209
210
211// UInterface for IInteractiveToolExclusiveToolAPI
212UINTERFACE(MinimalAPI)
217
229
230
231
232// UInterface for IInteractiveToolEditorGizmoAPI
233UINTERFACE(MinimalAPI)
238
244{
246public:
247
251 virtual bool GetAllowStandardEditorGizmos() { return false; }
252};
253
254
255
256// UInterface for IInteractiveToolManageGeometrySelectionAPI
257UINTERFACE(MinimalAPI)
262
267{
269public:
270
274 virtual bool IsInputSelectionValidOnOutput() { return false; }
275};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
EToolShutdownType
Definition InteractiveTool.h:45
EToolShutdownReason
Definition InteractiveTool.h:56
UE::Math::TBox< double > FBox
Definition MathFwd.h:55
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UINTERFACE(...)
Definition ObjectMacros.h:780
Definition InteractiveToolQueryInterfaces.h:41
virtual bool SupportsWorldSpaceFocusPoint()
Definition InteractiveToolQueryInterfaces.h:58
virtual bool GetWorldSpaceFocusPoint(const FRay &WorldRay, FVector &PointOut)
Definition InteractiveToolQueryInterfaces.h:65
virtual FBox GetWorldSpaceFocusBox()
Definition InteractiveToolQueryInterfaces.h:53
virtual bool SupportsWorldSpaceFocusBox()
Definition InteractiveToolQueryInterfaces.h:48
Definition InteractiveToolQueryInterfaces.h:244
virtual bool GetAllowStandardEditorGizmos()
Definition InteractiveToolQueryInterfaces.h:251
Definition InteractiveToolQueryInterfaces.h:226
Definition InteractiveToolQueryInterfaces.h:267
virtual bool IsInputSelectionValidOnOutput()
Definition InteractiveToolQueryInterfaces.h:274
Definition InteractiveToolQueryInterfaces.h:92
virtual bool CanCurrentlyNestedAccept()
Definition InteractiveToolQueryInterfaces.h:122
virtual bool SupportsNestedCancelCommand()
Definition InteractiveToolQueryInterfaces.h:99
virtual bool ExecuteNestedCancelCommand()
Definition InteractiveToolQueryInterfaces.h:110
virtual bool SupportsNestedAcceptCommand()
Definition InteractiveToolQueryInterfaces.h:117
virtual bool ExecuteNestedAcceptCommand()
Definition InteractiveToolQueryInterfaces.h:128
virtual bool CanCurrentlyNestedCancel()
Definition InteractiveToolQueryInterfaces.h:104
Definition InteractiveToolQueryInterfaces.h:153
virtual PRAGMA_DISABLE_DEPRECATION_WARNINGS EToolShutdownType GetPreferredShutdownType(EShutdownReason ShutdownReason, EToolShutdownType StandardShutdownType) const PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition InteractiveToolQueryInterfaces.h:172
virtual EToolShutdownType GetPreferredShutdownType(EToolShutdownReason ShutdownReason, EToolShutdownType StandardShutdownType) const
Definition InteractiveToolQueryInterfaces.h:185
enum UE_DEPRECATED(5.7, "EShutdownReason has moved to InteractiveTool.h (under the name EToolShutdownReason).") EShutdownReason
Definition InteractiveToolQueryInterfaces.h:157
Definition InteractiveToolQueryInterfaces.h:21
Definition InteractiveToolQueryInterfaces.h:235
Definition InteractiveToolQueryInterfaces.h:214
Definition InteractiveToolQueryInterfaces.h:259
Definition InteractiveToolQueryInterfaces.h:79
Definition InteractiveToolQueryInterfaces.h:136
Definition Interface.h:19