ezEngine  Release 25.03
ezSelectionManager Class Reference

Selection Manager stores a set of selected document objects. More...

#include <SelectionManager.h>

Classes

class  Storage
 

Public Member Functions

 ezSelectionManager (const ezDocumentObjectManager *pObjectManager)
 
void Clear ()
 
void AddObject (const ezDocumentObject *pObject)
 
void RemoveObject (const ezDocumentObject *pObject, bool bRecurseChildren=false)
 
void SetSelection (const ezDocumentObject *pSingleObject)
 
void SetSelection (const ezDeque< const ezDocumentObject * > &selection)
 
void ToggleObject (const ezDocumentObject *pObject)
 
void SetRuntimeOverrideSelection (const ezDeque< const ezDocumentObject * > &selection)
 Sets a separate selection (temporarily), which is sent to the engine but not propagated to the editor. More...
 
const ezDeque< const ezDocumentObject * > & GetRuntimeOverrideSelection () const
 Returns the current runtime override selection. More...
 
const ezDocumentObjectGetCurrentObject () const
 Returns the last selected object in the selection or null if empty.
 
const ezDeque< const ezDocumentObject * > & GetSelection () const
 Returns the selection in the same order the objects were added to the list.
 
bool IsSelectionEmpty () const
 
void GetTopLevelSelection (ezDynamicArray< ezSelectionEntry > &out_entries) const
 Returns the subset of selected items which have no parent selected. More...
 
void GetTopLevelSelectionOfType (const ezRTTI *pBase, ezDynamicArray< ezSelectionEntry > &out_entries) const
 Same as GetTopLevelSelection() but additionally requires that all objects are derived from type pBase.
 
bool IsSelected (const ezDocumentObject *pObject) const
 
bool IsParentSelected (const ezDocumentObject *pObject) const
 
const ezDocumentGetDocument () const
 
ezSharedPtr< ezSelectionManager::StorageSwapStorage (ezSharedPtr< ezSelectionManager::Storage > pNewStorage)
 
ezSharedPtr< ezSelectionManager::StorageGetStorage ()
 

Public Attributes

ezCopyOnBroadcastEvent< const ezSelectionManagerEvent & > m_Events
 

Friends

class ezDocument
 

Detailed Description

Selection Manager stores a set of selected document objects.

Member Function Documentation

◆ GetRuntimeOverrideSelection()

const ezDeque<const ezDocumentObject*>& ezSelectionManager::GetRuntimeOverrideSelection ( ) const
inline

Returns the current runtime override selection.

Valid, if the selection is non-empty. See SetRuntimeOverrideSelection() for details.

◆ GetTopLevelSelection()

void ezSelectionManager::GetTopLevelSelection ( ezDynamicArray< ezSelectionEntry > &  out_entries) const

Returns the subset of selected items which have no parent selected.

I.e. if an object is selected and one of its ancestors is selected, it is culled from the list. Items are returned in the order of appearance in an expanded scene tree. Their order in the selection is returned through ezSelectionEntry.

◆ SetRuntimeOverrideSelection()

void ezSelectionManager::SetRuntimeOverrideSelection ( const ezDeque< const ezDocumentObject * > &  selection)

Sets a separate selection (temporarily), which is sent to the engine but not propagated to the editor.

This is used for cases where temporarily the engine should use a different selection than the editor. Currently this is used during drag-and-drop, to already show the dragged object as selected and especially to exclude it from picking, but not yet show the new object as selected in the property grids, such that users can interact with the previously selected object.

To clear a runtime override selection, simply set an empty selection.


The documentation for this class was generated from the following files: