Navigation
API > API/Plugins > API/Plugins/NiagaraEditor
A helper class to allow us to hook up Niagara view model types with the source models that they are currently observing. The assumption is that a ViewModel class will register and unregister the correct the model during its lifetime. Since it is possible that the ViewModel will hold onto the Model with a weak object pointer, we keep track of the registered pair using a separate data structure (aka Handle). You can only unregister with a valid handle. It is possible for a Model to be pointed to by multiple simultaneous ViewModels (like say event handler scripts). If this happens, you can query the additional ViewModels in the GetExistingViewModelForObject method.
| Name | TNiagaraViewModelManager |
| Type | class |
| Header File | /Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Public/ViewModels/TNiagaraViewModelManager.h |
| Include Path | #include "ViewModels/TNiagaraViewModelManager.h" |
Syntax
template<class ObjectType, class ViewModelType>
class TNiagaraViewModelManager
Derived Classes
TNiagaraViewModelManager derived class hierarchy
Classes
| Name | Remarks |
|---|---|
| Handle |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ObjectsToViewModels | TMap< ObjectType *, TArray< ViewModelType * > > | ViewModels/TNiagaraViewModelManager.h |
Functions
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
Handle RegisterViewModelWithMap
(
ObjectType* Model, |
Called to register a specific Model/ViewModel pair. | ViewModels/TNiagaraViewModelManager.h | |
void UnregisterViewModelWithMap
(
Handle InHandle |
Called to forget about a specific Model/ViewModel pair. | ViewModels/TNiagaraViewModelManager.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void CleanAll() |
Called by a module manager to ensure that all known references have been cleared out before module shutdown. | ViewModels/TNiagaraViewModelManager.h | |
static void GetAllViewModels
(
TArray< TSharedRef< ViewModelType > >& OutViewModels |
ViewModels/TNiagaraViewModelManager.h | ||
static bool GetAllViewModelsForObject
(
ObjectType* Object, |
ViewModels/TNiagaraViewModelManager.h | ||
static TSharedPtr< ViewModelType > GetExistingViewModelForObject
(
ObjectType* Object, |
Query to determine if any ViewModel is currently pointing at this Model. | ViewModels/TNiagaraViewModelManager.h |