| UObjectBase
|
Module |
|
Header |
/Engine/Plugins/Experimental/MeshModelingToolset/Source/ModelingComponents/Public/MeshOpPreviewHelpers.h |
Include |
#include "MeshOpPreviewHelpers.h" |
[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)(Transient)
class UMeshOpPreviewWithBackgroundCompute : public UObject
UMeshOpPreviewWithBackgroundCompute is an infrastructure object that implements a common UI pattern in interactive 3D tools, where we want to run an expensive computation on a mesh that is based on user-specified parameters, and show a preview of the result. The expensive computation (a MeshOperator) must run 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. When it completes, the Preview will be updated. When the user is happy, the current Mesh is returned to the owner of this object.
The MeshOperators are provided by the owner via a IDynamicMeshOperatorFactory implementation. The owner must also Tick() this object regularly to allow the Preview to update when the background computations complete.
If an InProgress Material is set (via ConfigureMaterials) then when a background computation is active, this material will be used to draw the previous Preview result, to give the user a visual indication that work is happening.
Name | Description | ||
---|---|---|---|
|
TUniquePtr< FBa... |
BackgroundCompute |
This object manages the background computes |
|
bResultValid |
State flag, if true then we have valid result |
|
|
bVisible |
||
|
OnMeshUpdated |
This delegate is broadcast whenever the embedded preview mesh is updated |
|
|
OnOpCompleted |
||
|
OverrideMaterial |
Override material to forward to PreviewMesh if set |
|
|
UPreviewMesh &#... |
PreviewMesh |
Preview of MeshOperator result |
|
float |
SecondsBeforeWorkingMaterial |
|
|
StandardMaterials |
Input set of materials to assign to PreviewMesh |
|
|
WorkingMaterial |
If non-null, this material is swapped in when a background compute is active |
Name | Description | ||
---|---|---|---|
|
Cancel() |
Terminate any active computation without returning anything |
|
|
ConfigureMaterials ( |
Optional configuration Configure the Standard and In-Progress materials |
|
|
ConfigureMaterials ( |
Configure the Standard and In-Progress materials |
|
|
GetCurrentResultCopy ( |
Read back a copy of current preview mesh. |
|
|
HaveValidResult() |
||
|
InvalidateResult() |
Control flow Request that the current computation be canceled and a new one started |
|
|
IsUsingWorkingMaterial() |
||
|
Setup ( |
Required calls to setup/update/shutdown this object |
|
|
SetVisibility ( |
Set the visibility of the Preview mesh |
|
|
SetWorkingMaterialDelay ( |
Set time that Preview will wait before showing working material |
|
|
FDynamicMesh... |
Shutdown() |
Terminate any active computation and return the current Preview Mesh/Transform |
|
Tick ( |
Tick the background computation and Preview update. |
|
|
UpdateResults() |
Update the PreviewMesh if a new result is available from BackgroundCompute |
Name |
Description |
---|---|
FOnMeshUpdated |
Change notification |
FOnOpCompleted |