Navigation
API > API/Runtime > API/Runtime/InteractiveToolsFramework
UInteractiveToolManager allows users of the tools framework to create and operate Tool instances. For each Tool, a (string,ToolBuilder) pair is registered with the ToolManager. Tools can then be activated via the string identifier.
Currently a single Tool can be active for each input device. So for mouse input a single Tool is available and effectively a lightweight mode. The mouse uses the "Left" tool slot.
For VR controllers and touch input, a "Left" and "Right" tool can be active at the same time.
Tools are not directly created. Use SelectActiveToolType(side,string) to set the active ToolBuilder on a given side, and then use ActivateTool() to create the new Tool instance.
| Name | UInteractiveToolManager |
| Type | class |
| Header File | /Engine/Source/Runtime/InteractiveToolsFramework/Public/InteractiveToolManager.h |
| Include Path | #include "InteractiveToolManager.h" |
Syntax
UCLASS (Transient, MinimalAPI)
class UInteractiveToolManager :
public UObject ,
public IToolContextTransactionProvider
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UInteractiveToolManager
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UInteractiveToolManager() |
InteractiveToolManager.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnToolShutdownRequest | TBaseDelegate_ThreeParams< bool, UInteractiveToolManager *, UInteractiveTool *, EToolShutdownType > | InteractiveToolManager.h | |
| FOnToolUnexpectedShutdownMessage | TMulticastDelegate_FourParams< void, UInteractiveToolManager *, UInteractiveTool *, const FText &Message, bool bWasDuringToolSetup > | InteractiveToolManager.h | |
| FToolManagerToolCancelledSignature | TMulticastDelegate_ThreeParams< void, UInteractiveToolManager *, UInteractiveTool *, EToolShutdownType > | Variant of OnToolEnded that also reports the EToolShutdownType. | InteractiveToolManager.h |
| FToolManagerToolEndedSignature | TMulticastDelegate_TwoParams< void, UInteractiveToolManager *, UInteractiveTool * > | InteractiveToolManager.h | |
| FToolManagerToolPostBuildSignature | TMulticastDelegate_FiveParams< void, UInteractiveToolManager *, EToolSide, UInteractiveTool *, UInteractiveToolBuilder *, const FToolBuilderState & > | InteractiveToolManager.h | |
| FToolManagerToolPostSetupSignature | TMulticastDelegate_ThreeParams< void, UInteractiveToolManager *, EToolSide, UInteractiveTool * > | InteractiveToolManager.h | |
| FToolManagerToolStartedSignature | TMulticastDelegate_TwoParams< void, UInteractiveToolManager *, UInteractiveTool * > | InteractiveToolManager.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActiveLeftTool | TObjectPtr< UInteractiveTool > | Currently-active Left Tool, or null if no Tool is active | InteractiveToolManager.h | |
| ActiveRightTool | TObjectPtr< UInteractiveTool > | Currently-active Right Tool, or null if no Tool is active | InteractiveToolManager.h | |
| OnToolEnded | FToolManagerToolEndedSignature | InteractiveToolManager.h | ||
| OnToolEndedWithStatus | FToolManagerToolCancelledSignature | InteractiveToolManager.h | ||
| OnToolPostBuild | FToolManagerToolPostBuildSignature | InteractiveToolManager.h | ||
| OnToolPostSetup | FToolManagerToolPostSetupSignature | InteractiveToolManager.h | ||
| OnToolShutdownRequest | FOnToolShutdownRequest | If bound, OnToolShutdownRequest is called by PostActiveToolShutdownRequest to optionally handle requests to shut down a Tool (which may be sent by the Tool itself). | InteractiveToolManager.h | |
| OnToolStarted | FToolManagerToolStartedSignature | InteractiveToolManager.h | ||
| OnToolUnexpectedShutdownMessage | FOnToolUnexpectedShutdownMessage | PostActiveToolShutdownRequest() will broadcast this delegate with a Message if bShowUnexpectedShutdownMessage=true. | InteractiveToolManager.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool ActivateTool
(
EToolSide Side |
Try to activate a new Tool instance on the given Side. | InteractiveToolManager.h | |
virtual bool CanAcceptActiveTool
(
EToolSide Side |
Check if an active Tool on the given Side can be Accepted in its current state | InteractiveToolManager.h | |
virtual bool CanActivateTool
(
EToolSide eSide, |
Check if a named Tool type can currently be activated on the given ToolSide | InteractiveToolManager.h | |
virtual bool CanCancelActiveTool
(
EToolSide Side |
Check if an active Tool on the given Side can be Canceled | InteractiveToolManager.h | |
virtual void ConfigureChangeTrackingMode
(
EToolChangeTrackingMode ChangeMode |
Configure how tool changes emit change events. See EToolChangeTrackingMode for details. | InteractiveToolManager.h | |
virtual void DeactivateTool
(
EToolSide Side, |
Shut down an active Tool on the given side | InteractiveToolManager.h | |
virtual void DisplayMessage
(
const FText& Message, |
Functions that Tools can call to interact with Transactions API Post a message via the Transactions API | InteractiveToolManager.h | |
virtual void DrawHUD
(
FCanvas* Canvas, |
Let active Tools do their screen space drawing. | InteractiveToolManager.h | |
virtual UInteractiveTool * GetActiveTool
(
EToolSide Side |
Get pointer to active Tool on a given side | InteractiveToolManager.h | |
virtual UInteractiveToolBuilder * GetActiveToolBuilder
(
EToolSide Side |
Get pointer to active Tool Builder on a given side | InteractiveToolManager.h | |
virtual FString GetActiveToolName
(
EToolSide Side |
Get name of registered ToolBuilder that created active tool for given side, or empty string if no tool is active | InteractiveToolManager.h | |
virtual const FString & GetActiveToolType
(
EToolSide Side |
Get active ToolBuilder string identifier for a ToolSide | InteractiveToolManager.h | |
UContextObjectStore * GetContextObjectStore() |
InteractiveToolManager.h | ||
virtual IToolsContextQueriesAPI * GetContextQueriesAPI() |
Access to APIs, etc | InteractiveToolManager.h | |
virtual IToolsContextTransactionsAPI * GetContextTransactionsAPI() |
InteractiveToolManager.h | ||
UInteractiveGizmoManager * GetPairedGizmoManager() |
InteractiveToolManager.h | ||
virtual EToolManagerToolSwitchMode GetToolSwitchMode() |
Get the current setting for how to deactivate an already-active tool if switching directly to another tool. | InteractiveToolManager.h | |
virtual bool HasActiveTool
(
EToolSide Side |
Check if there is an active Tool on the given Side | InteractiveToolManager.h | |
virtual bool HasAnyActiveTool() |
InteractiveToolManager.h | ||
bool IsActive() |
InteractiveToolManager.h | ||
virtual bool PostActiveToolShutdownRequest
(
UInteractiveTool* Tool, |
A Tool (or other code) can call this function to request that the Tool be deactivated. | InteractiveToolManager.h | |
virtual void PostInvalidation() |
Request an Invalidation via the Transactions API (ie to cause a repaint, etc) | InteractiveToolManager.h | |
virtual void RegisterToolType
(
const FString& Identifier, |
Tool registration and Current Tool state Register a new ToolBuilder | InteractiveToolManager.h | |
virtual void Render
(
IToolsContextRenderAPI* RenderAPI |
Render any active Tools. | InteractiveToolManager.h | |
virtual bool RequestSelectionChange
(
const FSelectedObjectsChangeList& SelectionChange |
Forward an FChange object to the Context | InteractiveToolManager.h | |
virtual bool SelectActiveToolType
(
EToolSide Side, |
Set active ToolBuilder for a ToolSide via string identifier | InteractiveToolManager.h | |
virtual void SetToolSwitchMode
(
EToolManagerToolSwitchMode ToolSwitchModeIn |
Set the behavior for how to deactivate an already-active tool if ActivateTool is called while HasActiveTool is true. | InteractiveToolManager.h | |
virtual void Tick
(
float DeltaTime |
State control ( Tick any active Tools. Called by UInteractiveToolsContext | InteractiveToolManager.h | |
virtual void UnregisterToolType
(
const FString& Identifier |
Unregisters a ToolBuilder | InteractiveToolManager.h |
Overridden from IToolContextTransactionProvider
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginUndoTransaction
(
const FText& Description |
Request that the Context open a Transaction, whatever that means to the current Context | InteractiveToolManager.h | |
virtual void EmitObjectChange
(
UObject* TargetObject, |
Forward an FChange object to the Context | InteractiveToolManager.h | |
virtual void EndUndoTransaction() |
Request that the Context close and commit the open Transaction | InteractiveToolManager.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool ActivateToolInternal
(
EToolSide Side |
InteractiveToolManager.h | ||
virtual void DeactivateToolInternal
(
EToolSide Side, |
InteractiveToolManager.h | ||
virtual void DoPostBuild
(
EToolSide Side, |
Called immediately after a tool is built. Broadcasts OnToolPostBuild. | InteractiveToolManager.h | |
virtual void DoPostSetup
(
EToolSide Side, |
Called immediately after a tool's Setup is called. Broadcasts OnToolPostSetup. | InteractiveToolManager.h | |
virtual void Initialize
(
IToolsContextQueriesAPI* QueriesAPI, |
Initialize the ToolManager with the necessary Context-level state. | InteractiveToolManager.h | |
virtual void Shutdown () |
Shutdown the ToolManager. | InteractiveToolManager.h |