Navigation
API > API/Runtime > API/Runtime/InteractiveToolsFramework
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UInteractiveToolManager
References
| Module | InteractiveToolsFramework |
| Header | /Engine/Source/Runtime/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
| Type | Name | Description | |
|---|---|---|---|
| UInteractiveToolBuilder * | ActiveLeftBuilder | ||
| FString | ActiveLeftBuilderName | Currently-active Left ToolBuilder | |
| TObjectPtr< UInteractiveTool > | ActiveLeftTool | Currently-active Left Tool, or null if no Tool is active | |
| FString | ActiveLeftToolName | ||
| UInteractiveToolBuilder * | ActiveRightBuilder | ||
| FString | ActiveRightBuilderName | Currently-active Right ToolBuilder | |
| TObjectPtr< UInteractiveTool > | ActiveRightTool | Currently-active Right Tool, or null if no Tool is active | |
| FString | ActiveRightToolName | ||
| EToolChangeTrackingMode | ActiveToolChangeTrackingMode | ||
| bool | bActiveToolMadeSelectionStoreRequest | Tracks whether the last activated tool has made a request to store a tool selection. | |
| bool | bInToolSetup | This bool is for handling the case where a Tool posts a shutdown request during it's Setup() call. | |
| bool | bInToolShutdown | ||
| bool | bIsActive | This flag is set to true on Initialize() and false on Shutdown(). | |
| bool | bToolRequestedTerminationDuringSetup | ||
| UInputRouter * | InputRouter | Pointer to current InputRouter (Context owns this) | |
| FToolManagerToolEndedSignature | OnToolEnded | ||
| FToolManagerToolPostBuildSignature | OnToolPostBuild | ||
| FToolManagerToolPostSetupSignature | OnToolPostSetup | ||
| FOnToolShutdownRequest | OnToolShutdownRequest | If bound, OnToolShutdownRequest is called by PostActiveToolShutdownRequest to optionally handle requests to shut down a Tool (which may be sent by the Tool itself). | |
| FToolManagerToolStartedSignature | OnToolStarted | ||
| FOnToolUnexpectedShutdownMessage | OnToolUnexpectedShutdownMessage | PostActiveToolShutdownRequest() will broadcast this delegate with a Message if bShowUnexpectedShutdownMessage=true. | |
| IToolsContextQueriesAPI * | QueriesAPI | Pointer to current Context-Queries implementation | |
| TMap< FString, TObjectPtr< UInteractiveToolBuilder > > | ToolBuilders | Current set of named ToolBuilders | |
| IToolsContextTransactionsAPI * | TransactionsAPI | Pointer to current Transactions implementation |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | ActivateTool
(
EToolSide Side |
Try to activate a new Tool instance on the given Side | |
| bool | ActivateToolInternal
(
EToolSide Side |
||
| bool | CanAcceptActiveTool
(
EToolSide Side |
Check if an active Tool on the given Side can be Accepted in its current state | |
| bool | CanActivateTool
(
EToolSide eSide, |
Check if a named Tool type can currently be activated on the given ToolSide | |
| bool | CanCancelActiveTool
(
EToolSide Side |
Check if an active Tool on the given Side can be Canceled | |
| void | ConfigureChangeTrackingMode
(
EToolChangeTrackingMode ChangeMode |
Configure how tool changes emit change events. See EToolChangeTrackingMode for details. | |
| void | DeactivateTool
(
EToolSide Side, |
Shut down an active Tool on the given side | |
| void | DeactivateToolInternal
(
EToolSide Side, |
||
| void | DisplayMessage
(
const FText& Message, |
Functions that Tools can call to interact with Transactions APIPost a message via the Transactions API | |
| void | DoPostBuild
(
EToolSide Side, |
Called immediately after a tool is built. Broadcasts OnToolPostBuild. | |
| void | DoPostSetup
(
EToolSide Side, |
Called immediately after a tool's Setup is called. Broadcasts OnToolPostSetup. | |
| void | DrawHUD
(
FCanvas* Canvas, |
Let active Tools do their screen space drawing. | |
| UInteractiveTool * | GetActiveTool
(
EToolSide Side |
Get pointer to active Tool on a given side | |
| UInteractiveToolBuilder * | GetActiveToolBuilder
(
EToolSide Side |
Get pointer to active Tool Builder on a given side | |
| FString | GetActiveToolName
(
EToolSide Side |
Get name of registered ToolBuilder that created active tool for given side, or empty string if no tool is active | |
| UContextObjectStore * | |||
| IToolsContextQueriesAPI * | Access to APIs, etc | ||
| IToolsContextTransactionsAPI * | |||
| UInteractiveGizmoManager * | |||
| bool | HasActiveTool
(
EToolSide Side |
Check if there is an active Tool on the given Side | |
| bool | |||
| void | Initialize
(
IToolsContextQueriesAPI* QueriesAPI, |
Initialize the ToolManager with the necessary Context-level state. | |
| bool | IsActive () |
||
| bool | PostActiveToolShutdownRequest
(
UInteractiveTool* Tool, |
A Tool (or other code) can call this function to request that the Tool be deactivated. | |
| void | Request an Invalidation via the Transactions API (ie to cause a repaint, etc) | ||
| void | RegisterToolType
(
const FString& Identifier, |
Tool registration and Current Tool state Register a new ToolBuilder | |
| void | Render
(
IToolsContextRenderAPI* RenderAPI |
Render any active Tools. | |
| bool | RequestSelectionChange
(
const FSelectedOjectsChangeList& SelectionChange |
Forward an FChange object to the Context | |
| bool | SelectActiveToolType
(
EToolSide Side, |
Set active ToolBuilder for a ToolSide via string identifier | |
| void | Shutdown () |
Shutdown the ToolManager. | |
| void | Tick
(
float DeltaTime |
State control (Tick any active Tools. Called by UInteractiveToolsContext | |
| void | UnregisterToolType
(
const FString& Identifier |
Unregisters a ToolBuilder |
Overridden from IToolContextTransactionProvider
| Type | Name | Description | |
|---|---|---|---|
| void | BeginUndoTransaction
(
const FText& Description |
Request that the Context open a Transaction, whatever that means to the current Context | |
| void | EmitObjectChange
(
UObject* TargetObject, |
Forward an FChange object to the Context | |
| void | Request that the Context close and commit the open Transaction |