Navigation
Unreal Engine C++ API Reference > Plugins > ModelingComponents
References
Module | ModelingComponents |
Header | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/MeshOpPreviewHelpers.h |
Include | #include "MeshOpPreviewHelpers.h" |
Syntax
template<typename ResultDataType>
class TGenericDataBackgroundCompute
Remarks
TGenericDataBackgroundCompute is an infrastructure object that implements a common UI pattern in interactive 3D tools, where we want to run an expensive parameterized computation (via a TGenericDataOperator) in a background thread so as to not block the UI. If the user changes parameters while the Operator is running, it should be canceled and restarted.
The TGenericDataOperator are provided by the owner via a IGenericDataOperatorFactory implementation. The owner must also Tick() this object regularly to allow results to be extracted from the background thread and appropriate delegates fired when that occurs.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
TUniquePtr< ComputeSourceType > | BackgroundCompute | This object manages the background computes |
![]() |
bool | bResultValid | State flag, if true then we have valid result |
![]() |
TUniquePtr< ResultDataType > | CurrentResult | Current result value |
![]() |
FOnOpCompleted | OnOpCompleted | OnOpCompleted is fired via Tick() when an Operator finishes, with the operator pointer as argument |
![]() |
FOnResultUpdated | OnResultUpdated | OnResultUpdated is fired via Tick() when an Operator finishes, with the computed result as argument |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | Cancel () |
Terminate any active computation without returning anything |
![]() ![]() |
float | ||
![]() ![]() |
bool | ||
![]() |
void | Control flow Request that the current computation be canceled and a new one started | |
![]() |
void | Setup
(
FactoryType* OpGenerator |
Required calls to setup/update/shutdown this object |
![]() |
TUniquePtr< ResultDataType > | Shutdown () |
Terminate any active computation and return the current Result |
![]() |
void | Tick
(
float DeltaTime |
Tick the background computation to check for updated results |
![]() |
void | Update CurrentResult if a new result is available from BackgroundCompute, and fires relevant signals |
Typedefs
Name | Description |
---|---|
ComputeSourceType | |
FactoryType | |
FOnOpCompleted | Change notification |
FOnResultUpdated | |
OperatorType |