Navigation
API > API/Runtime > API/Runtime/InteractiveToolsFramework
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UToolTargetManager
References
| Module | InteractiveToolsFramework |
| Header | /Engine/Source/Runtime/InteractiveToolsFramework/Public/ToolTargetManager.h |
| Include | #include "ToolTargetManager.h" |
Syntax
class UToolTargetManager : public UObject
Remarks
TODO: Do we need more control over factory order to prioritize which gets used if we can make multiple qualifying targets? It should theoretically not matter, but in practice, one target or another could be more efficient for certain tasks. This is probably only worth thinking about once we encounter it. NOTE FOR IMPLEMENTING CACHING: Someday we will probably write a tool target manager that caches tool targets and gives prebuilt ones when possible to avoid any extra conversions. When implementing this, note that currently, some targets store converted versions of their source objects without a way to determine whether their stored conversion is out of date. The cached target will then give an incorrect result if the source object has been modified after caching. One way to deal with this is to have subclasses of UToolTarget that give the degree of cacheability- fully cacheable (i.e., detects changes and rebuilds if necessary), cacheable only if changes are made through that tool target (i.e. target manager has to clear it if object may have changed; may choose not to have this option), or not cacheable. The tool target manager converts input objects into tool targets- objects that can expose various interfaces that tools need to operate on them.
Someday, the tool target manager may implement caching of targets.
See the class comment for UToolTarget for more info.
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bIsActive | This flag is set to true on Initialize() and false on Shutdown(). | |
| TArray< TObjectPtr< UToolTargetFactory > > | Factories |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddTargetFactory
(
UToolTargetFactory* Factory |
Add a new ToolTargetFactory | |
| TArray< TObjectPtr< UToolTarget > > | BuildAllSelectedTargetable
(
const FToolBuilderState& SceneState, |
Looks through the current selected components and actors and builds all targets that satisfy the requirements. | |
| UToolTarget * | BuildFirstSelectedTargetable
(
const FToolBuilderState& SceneState, |
Looks through the currently selected components and actors and builds a target out of the first encountered element that satisfies the requirements. | |
| UToolTarget * | BuildTarget
(
UObject* SourceObject, |
Uses one of the stored factories to build a tool target out of the given input object that satisfies the given requirements. | |
| CastToType * | BuildTarget
(
UObject* SourceObject, |
Much like BuildTarget, but casts the target to the template argument before returning. | |
| bool | CanBuildTarget
(
UObject* SourceObject, |
Examines stored target factories to see if one can build the requested type of target. | |
| int32 | CountSelectedAndTargetable
(
const FToolBuilderState& SceneState, |
Looks through the currently selected components and actors and counts the number of inputs that could be used to create qualifying tool targets. | |
| int32 | CountSelectedAndTargetableWithPredicate
(
const FToolBuilderState& SceneState, |
Looks through the currently selected components and actors and counts the number of inputs that could be used to create qualifying tool targets with an additional test predicate. | |
| void | EnumerateSelectedAndTargetableComponents
(
const FToolBuilderState& SceneState, |
Looks through the currently selected components and actors and counts the number of inputs that could be used to create qualifying tool targets. | |
| UToolTargetFactory * | FindFirstFactoryByPredicate
(
TFunctionRef< bool(UToolTargetFactory*)> Predicate |
Find the first ToolTargetFactory that passes the Predicate function | |
| CastToType * | Find the first ToolTargetFactory of a given type | ||
| void | Initialize () |
Initialize the ToolTargetManager. | |
| bool | IsActive () |
||
| void | Shutdown () |
Shutdown the ToolTargetManager. |