Class SelectionSystem¶
Defined in File selection_system.h
Class Documentation¶
-
class SelectionSystem¶
Static utility class for managing selection state in the editor.
SelectionSystem provides scoped selection using StringId identifiers, where selections are tied to a scope entity (typically a scene). This allows different scenes or contexts to maintain independent selection states. StringId-based selection generalizes beyond entities to support selecting resources, paths, or any named item.
Selections are additive by default. To replace the current selection, call deselect_all() before select().
Public Static Functions
-
static void select(StringId id, Entity scope)¶
Adds an item to the selection within a given scope.
- Parameters:
id – The StringId of the item to select.
scope – The scope entity (e.g., scene) the selection belongs to.
-
static void select(Entity entity, Entity scope)¶
Adds an entity to the selection within a given scope (by name).
- Parameters:
entity – The entity to select.
scope – The scope entity (e.g., scene) the selection belongs to.
-
static void select_all(std::span<const StringId> ids, Entity scope)¶
Selects multiple items within a given scope, skipping duplicates.
- Parameters:
ids – The StringIds to select.
scope – The scope entity the selection belongs to.
-
static bool is_selected(const StringId &id, Entity scope)¶
Checks if an item is selected within a specific scope.
- Parameters:
id – The StringId to check.
scope – The scope to check within.
- Returns:
True if the item is selected in the given scope.
-
static bool is_selected(Entity entity, Entity scope)¶
Checks if an entity is selected within a specific scope (by name).
- Parameters:
entity – The entity to check.
scope – The scope to check within.
- Returns:
True if the entity is selected in the given scope.
-
static bool has_selection(Entity scope)¶
Checks if there is any selection within a scope.
- Parameters:
scope – The scope to check.
- Returns:
True if any item is selected in the scope.
-
static StringId get_selected(Entity scope)¶
Gets the first selection in a scope.
- Parameters:
scope – The scope to query.
- Returns:
The first selected StringId, or an empty StringId if none selected.
-
static const std::vector<StringId> &get_selections(Entity scope)¶
Gets all selections in a scope.
- Parameters:
scope – The scope to query.
- Returns:
A const reference to the vector of selected StringIds.
-
static size_t selection_count(Entity scope)¶
Returns the number of selections in a scope.
- Parameters:
scope – The scope to query.
- Returns:
The number of selections.
-
static void deselect(const StringId &id, ecs::Registry ®istry)¶
Deselects an item from all scopes in the given registry.
- Parameters:
id – The StringId to deselect.
registry – The registry to search for selection scopes.
-
static void deselect(StringId id, Entity scope)¶
Deselects an item from a specific scope.
- Parameters:
id – The StringId to deselect.
scope – The scope to deselect from.
-
static void deselect_all(Entity scope)¶
Clears all selections in a scope.
- Parameters:
scope – The scope to clear.
-
static void select(StringId id, Entity scope)¶