UInteractiveToolManager

[UInteractiveToolManager](API\Runtime\InteractiveToolsFramework\UInteractiveToolManager) allows users of the tools framework to create and operate Tool instances.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

InteractiveToolsFramework

Header

/Engine/Source/Runtime/Experimental/InteractiveToolsFramework/Public/InteractiveToolManager.h

Include

#include "InteractiveToolManager.h"

Syntax

class UInteractiveToolManager :
    public UObject,
    public IToolContextTransactionProvider

Remarks

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.

Variables

Name Description

Protected variable

UInteractiveToo...

 

ActiveLeftBuilder

Protected variable

FString

 

ActiveLeftBuilderName

Currently-active Left ToolBuilder

Public variable

UInteractiveToo...

 

ActiveLeftTool

Currently-active Left Tool, or null if no Tool is active

Protected variable

FString

 

ActiveLeftToolName

Protected variable

UInteractiveToo...

 

ActiveRightBuilder

Protected variable

FString

 

ActiveRightBuilderName

Currently-active Right ToolBuilder

Public variable

UInteractiveToo...

 

ActiveRightTool

Currently-active Right Tool, or null if no Tool is active

Protected variable

FString

 

ActiveRightToolName

Protected variable

EToolChangeTrac...

 

ActiveToolChangeTrackingMode

Protected variable

bool

 

bIsActive

This flag is set to true on Initialize() and false on Shutdown().

Protected variable

UInputRouter &#...

 

InputRouter

Pointer to current InputRouter (Context owns this)

Public variable

FToolManagerToo...

 

OnToolEnded

Public variable

FToolManagerToo...

 

OnToolStarted

Protected variable

IToolsContextQu...

 

QueriesAPI

Pointer to current Context-Queries implementation

Protected variable

TMap< FString, ...

 

ToolBuilders

Current set of named ToolBuilders

Protected variable

IToolsContextTr...

 

TransactionsAPI

Pointer to current Transactions implementation

Constructors

Name Description

Protected function

UInteractiveToolManager()

Functions

Name Description

Public function Virtual

bool

 

ActivateTool

(
    EToolSide Side
)

Try to activate a new Tool instance on the given Side

Protected function Virtual

bool

 

ActivateToolInternal

(
    EToolSide Side
)

Public function Virtual

bool

 

CanAcceptActiveTool

(
    EToolSide Side
)

Check if an active Tool on the given Side can be Accepted in its current state

Public function Virtual

bool

 

CanActivateTool

(
    EToolSide eSide,
    const FString& Identifier
)

Check if a named Tool type can currently be activated on the given ToolSide

Public function Virtual

bool

 

CanCancelActiveTool

(
    EToolSide Side
)

Check if an active Tool on the given Side can be Canceled

Public function Virtual

void

 

ConfigureChangeTrackingMode

(
    EToolChangeTrackingMode ChangeMode
)

Configure how tool changes emit change events. See EToolChangeTrackingMode for details.

Public function Virtual

void

 

DeactivateTool

(
    EToolSide Side,
    EToolShutdownType ShutdownType
)

Shut down an active Tool on the given side

Protected function Virtual

void

 

DeactivateToolInternal

(
    EToolSide Side,
    EToolShutdownType ShutdownType
)

Public function Virtual

void

 

DisplayMessage

(
    const FText& Message,
    EToolMessageLevel Level
)

Functions that Tools can call to interact with Transactions APIPost a message via the Transactions API

Public function Virtual

void

 

DrawHUD

(
    FCanvas* Canvas,
    IToolsContextRenderAPI* Render...
)

Let active Tools do their screen space drawing.

Public function Virtual

UInteractive...

 

GetActiveTool

(
    EToolSide Side
)

Get pointer to active Tool on a given side

Public function Virtual

UInteractive...

 

GetActiveToolBuilder

(
    EToolSide Side
)

Get pointer to active Tool Builder on a given side

Public function 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

Public function Virtual

IToolsContex...

 

GetContextQueriesAPI()

Access to APIs, etc

Public function

UInteractive...

 

GetPairedGizmoManager()

Public function Virtual Const

bool

 

HasActiveTool

(
    EToolSide Side
)

Check if there is an active Tool on the given Side

Public function Virtual Const

bool

 

HasAnyActiveTool()

Protected function Virtual

void

 

Initialize

(
    IToolsContextQueriesAPI* Queri...,
    IToolsContextTransactionsAPI* ...,
    UInputRouter* InputRouter
)

Initialize the ToolManager with the necessary Context-level state.

Public function Const

bool

 

IsActive()

Public function Virtual

void

 

PostInvalidation()

Request an Invalidation via the Transactions API (ie to cause a repaint, etc)

Public function Virtual

void

 

RegisterToolType

(
    const FString& Identifier,
    UInteractiveToolBuilder* Build...
)

Tool registration and Current Tool state Register a new ToolBuilder

Public function Virtual

void

 

Render

(
    IToolsContextRenderAPI* Render...
)

Render any active Tools.

Public function Virtual

bool

 

RequestSelectionChange

(
    const FSelectedOjectsChangeList& S...
)

Forward an FChange object to the Context

Public function Virtual

bool

 

SelectActiveToolType

(
    EToolSide Side,
    const FString& Identifier
)

Set active ToolBuilder for a ToolSide via string identifier

Protected function Virtual

void

 

Shutdown()

Shutdown the ToolManager.

Public function Virtual

void

 

Tick

(
    float DeltaTime
)

State control (Tick any active Tools. Called by UInteractiveToolsContext

Overridden from IToolContextTransactionProvider

Name Description

Public function Virtual

void

 

BeginUndoTransaction

(
    const FText& Description
)

Request that the Context open a Transaction, whatever that means to the current Context

Public function Virtual

void

 

EmitObjectChange

(
    UObject* TargetObject,
    TUniquePtr< FToolCommandChange > Ch...,
    const FText& Description
)

Forward an FChange object to the Context

Public function Virtual

void

 

EndUndoTransaction()

Request that the Context close and commit the open Transaction

Typedefs

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss