![]() |
ezEngine
Release 25.03
|
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 ezDocumentObject * | GetCurrentObject () 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 ezDocument * | GetDocument () const |
ezSharedPtr< ezSelectionManager::Storage > | SwapStorage (ezSharedPtr< ezSelectionManager::Storage > pNewStorage) |
ezSharedPtr< ezSelectionManager::Storage > | GetStorage () |
Public Attributes | |
ezCopyOnBroadcastEvent< const ezSelectionManagerEvent & > | m_Events |
Friends | |
class | ezDocument |
Selection Manager stores a set of selected document objects.
|
inline |
Returns the current runtime override selection.
Valid, if the selection is non-empty. See SetRuntimeOverrideSelection() for details.
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.
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.