class GUISceneTreeView

Inherits: GUITreeView

GUI element that displays all SceneObjects in the current scene in the active project in a tree view.

Public

Methods

staticGetGuiTypeName

static const String &GetGuiTypeName()

Returns type name of the GUI element used for finding GUI element styles.

staticCreate

static GUISceneTreeView *Create(const SPtr<SceneInstance> &scene)

Creates a new scene tree view for the specified scene.

staticCreate

static GUISceneTreeView *Create(const SPtr<SceneInstance> &scene, const GUIOptions &options)

Creates a new scene tree view for the specified scene.

scene
Scene which objects to display.
options
Options that allow you to control how is the element positioned and sized. This will override any similar options set by style.

GetSelection

Vector<HSceneObject> GetSelection() const

Returns a list of SceneObject &s currently selected (if any).

SetSelection

void SetSelection(const Vector<HSceneObject> &objects)

Changes the active selection to the provided SceneObjects.

Ping

void Ping(const HSceneObject &object)

Scrolls to and highlights the selected object (does not select it).

DuplicateSelection

void DuplicateSelection() override

Duplicates the currently selected entries.

CopySelection

void CopySelection() override

Marks the current selection for copying.

CutSelection

void CutSelection() override

Marks the current selection for cutting.

Paste

void Paste() override

Pastes a set of entries previously marked for cut or copy.

GetState

SPtr<SceneTreeViewState> GetState() const

Returns the expand/collapse state of the elements in the tree view, allowing it to be restored later.

SetState

void SetState(const SPtr<SceneTreeViewState> &state)

Sets the expand/collapse state of the elements in the tree view.

Fields

OnSelectionChanged

Event<void ()> OnSelectionChanged

Triggered whenever the selection changes.

Call getSelection() to retrieve new selection.

OnModified

Event<void ()> OnModified

Triggered whenever the scene is modified in any way from within the scene tree view (for example object is deleted, added, etc.).

OnResourceDropped

Event<void (const HSceneObject &, const Vector<Path> &)> OnResourceDropped

Triggered when a resource drag and drop operation finishes over the scene tree view.

Provided scene object is the tree view element that the operation finished over (or null if none), and the list of paths is the list of paths of the resources that were dropped. The paths are relative to the project library imported resources folder.

Protected

Constructors

GUISceneTreeView

GUISceneTreeView(const SPtr<SceneInstance> &scene, const GUISizeConstraints &sizeConstraints)

Methods

~GUISceneTreeView

virtual ~GUISceneTreeView() noexcept

UpdateTreeElement

void UpdateTreeElement(SceneTreeElement *element)

Checks it the SceneObject referenced by this tree element changed in any way and updates the tree element.

This can involve recursing all children and updating them as well.

DragAndDropFinalize

void DragAndDropFinalize()

Triggered when a drag and drop operation that was started by the tree view ends, regardless if it was processed or not.

GetRootElement

TreeElement &GetRootElement() override

Returns the top level TreeElement.

GetRootElementConst

const TreeElement &GetRootElementConst() const override

Returns the top level TreeElement that cannot be modified.

UpdateTreeElementHierarchy

void UpdateTreeElementHierarchy() override

Checks if the hierarchy needs any updates and performs those updates if needed.

RenameTreeElement

void RenameTreeElement(TreeElement *element, const String &name) override

Changes the name of the content associated with the provided tree element.

DeleteTreeElement

void DeleteTreeElement(TreeElement *element) override

Deletes the content associated with the provided tree element.

AcceptDragAndDrop

bool AcceptDragAndDrop() const override

Checks whether the tree view can accept the currently active drag and drop operation.

DragAndDropStart

void DragAndDropStart(const Vector<TreeElement *> &elements) override

Triggered when the user drags a tree element and starts a drag and drop operation.

DragAndDropEnded

void DragAndDropEnded(TreeElement *overTreeElement) override

Triggered when the user ends a drag and drop operation over the tree view.

overTreeElement
TreeElement the drag operation ended over, if any.

AcceptDragAndDrop

bool AcceptDragAndDrop(const GUIPhysicalPoint &position, u32 typeId) const override

Checks if the GUI element accepts a drag and drop operation of the specified type.

SelectionChanged

void SelectionChanged() override

Triggered whenever a TreeElement gets selected or deselected.

DeleteTreeElementInternal

void DeleteTreeElementInternal(TreeElement *element)

Deletes the internal TreeElement representation without actually deleting the referenced SceneObject.

FindTreeElement

SceneTreeElement *FindTreeElement(const HSceneObject &so)

Attempts to find a tree element referencing the specified scene object.

CreateNewSo

void CreateNewSo()

Creates a new scene object as a child of the currently selected object (if any).

ClearCopyList

void ClearCopyList()

Removes all elements from the list used for copy/cut operations.

SetSelection

void SetSelection(const Vector<HSceneObject> &objects, bool triggerEvents)

Changes the active selection to the provided SceneObjects and optionally triggers the necessary event callbacks.

staticCleanDuplicates

static void CleanDuplicates(Vector<HSceneObject> &objects)

Cleans duplicate objects from the provided scene object list.

This involves removing child elements if their parents are already part of the list.

Fields

mScene

WeakSPtr<SceneInstance> mScene

mRootElement

SceneTreeElement mRootElement

mCopyList

Vector<HSceneObject> mCopyList

mCutFlag

bool mCutFlag