class Selection

Inherits: Module<Selection>

Handles selection not associated with any particular scene (e.g. resources).

Triggers events when selection changes and allows the user to query current selection state.

Public

Constructors

Selection

Selection() = default

Methods

SetSelectedResourcesByPath

void SetSelectedResourcesByPath(const Vector<Path> &paths)

Currently selected set of resource paths.

All paths are relative to the project library imported resources folder.

GetSelectedResourcePaths

const Vector<Path> &GetSelectedResourcePaths() const

SetSelectedResourcesById

void SetSelectedResourcesById(const Vector<UUID> &UUIDs)

Currently selected set of resource IDs.

GetSelectedResourceIds

Vector<UUID> GetSelectedResourceIds() const

ClearResourceSelection

void ClearResourceSelection()

Deselects all currently selected resources.

PingResource

void PingResource(const Path &relativeResourcePath)

Pings the resource, highlighting it in its respective editors.

relativeResourcePath
Resource path relative to the project library imported resources folder.

staticInstance

static T &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticInstancePtr

static T *InstancePtr()

Returns a pointer to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticShutDown

static void ShutDown()

Shuts down this module and frees any resources it is using.

staticIsStarted

static bool IsStarted()

Query if the module has been started.

Fields

OnResourcesAdded

Event<void (const Vector<Path> &)> OnResourcesAdded

Triggered when one or multiple resources are being added to the selection.

Provided paths are relative to the project library imported resources folder.

OnResourcesRemoved

Event<void (const Vector<Path> &)> OnResourcesRemoved

Triggered when one or multiple resources are being removed from the selection.

Provided paths are relative to the project library imported resources folder.

OnSelectionChanged

Event<void (const Vector<Path> &)> OnSelectionChanged

Triggered whenever resource selection changes.

The provided parameters will contain the newly resource paths. Provided resource paths are relative to the project library imported resources folder.

OnResourcePing

Event<void (const Path &)> OnResourcePing

Triggered when a resource ping is requested.

Ping usually means the object will be highlighted in its respective editors. Provided path is relative to the project library imported folder.

Protected

Methods

~Module<T>

virtual ~Module<T>() = default

OnStartUp

virtual void OnStartUp()

Override if you want your module to be notified once it has been constructed and started.

OnShutDown

virtual void OnShutDown()

Override if you want your module to be notified just before it is deleted.

staticInstanceInternal

static T *&InstanceInternal()

Returns a singleton instance of this module.

staticIsDestroyed

static bool &IsDestroyed()

Checks has the Module been shut down.

staticIsStartedUp

static bool &IsStartedUp()

Checks has the Module been started up.

Private

Fields

mSelectedResourcePaths

Vector<Path> mSelectedResourcePaths

mTempResources

Vector<Path> mTempResources