Skip to main content

ObjectTreeState

Struct ObjectTreeState 

Source
pub struct ObjectTreeState {
Show 18 fields pub folders: BTreeSet<Vec<String>>, pub collapsed_folders: BTreeSet<Vec<String>>, pub creating_folder: Option<Vec<String>>, pub visible_ids: Vec<usize>, pub selected_ids: HashSet<usize>, pub last_selected_id: Option<usize>, pub selection_anchor: Option<usize>, pub expanded_groups: HashSet<String>, pub expanded_items: HashSet<usize>, pub data_window_expanded: bool, pub filter_text: String, pub filter_type: Option<SourceType>, pub dragging_id: Option<usize>, pub drag_start_pos: Option<Pos2>, pub drop_target: Option<usize>, pub renaming_id: Option<usize>, pub rename_text: String, pub hovered_id: Option<usize>,
}
Expand description

State for the Object Tree panel

Fields§

§folders: BTreeSet<Vec<String>>

Known folder paths, including empty folders. Hosts may save and restore this set per chart; nonempty folders are also recovered from source rows on each frame.

§collapsed_folders: BTreeSet<Vec<String>>

Collapsed folder paths. Search temporarily expands matching descendants.

§creating_folder: Option<Vec<String>>

Parent of the folder being created by the name prompt.

§visible_ids: Vec<usize>

Drawing and source ids in the rendered order, used for range selection.

§selected_ids: HashSet<usize>

Currently selected item IDs

§last_selected_id: Option<usize>

Last selected ID (for shift-click range selection)

§selection_anchor: Option<usize>

Anchor ID for range selection

§expanded_groups: HashSet<String>

Expanded group headers

§expanded_items: HashSet<usize>

Expanded item IDs (showing properties)

§data_window_expanded: bool

Data Window section expanded

§filter_text: String

Filter text (search query)

§filter_type: Option<SourceType>

Filter by source type

§dragging_id: Option<usize>

Currently dragging item ID

§drag_start_pos: Option<Pos2>

Drag start position

§drop_target: Option<usize>

Drop target position (index)

§renaming_id: Option<usize>

Currently renaming item ID

§rename_text: String

Rename text buffer

§hovered_id: Option<usize>

Currently hovered item ID

Implementations§

Source§

impl ObjectTreeState

Source

pub fn new() -> Self

Create a new state with default expansions

Source

pub fn select(&mut self, id: usize)

Select a single item (clears other selections)

Source

pub fn toggle_selection(&mut self, id: usize)

Add item to selection (toggle if already selected)

Source

pub fn range_select(&mut self, id: usize, ordered_ids: &[usize])

Range select from anchor to id (given a list of ordered IDs)

Source

pub fn select_all(&mut self, all_ids: &[usize])

Select all items

Source

pub fn clear_selection(&mut self)

Clear all selections

Source

pub fn is_selected(&self, id: usize) -> bool

Check if item is selected

Source

pub fn selection_count(&self) -> usize

Get number of selected items

Source

pub fn toggle_group(&mut self, group: &str)

Toggle group expansion

Source

pub fn is_group_expanded(&self, group: &str) -> bool

Check if group is expanded

Source

pub fn toggle_item(&mut self, id: usize)

Toggle item expansion (properties)

Source

pub fn is_item_expanded(&self, id: usize) -> bool

Check if item is expanded

Source

pub fn expand_all_groups(&mut self)

Expand all groups

Source

pub fn collapse_all_groups(&mut self)

Collapse all groups

Source

pub fn set_filter(&mut self, text: impl Into<String>)

Set filter text

Source

pub fn clear_filter(&mut self)

Clear filter

Source

pub fn has_filter(&self) -> bool

Check if filter is active

Source

pub fn start_rename(&mut self, id: usize, current_name: &str)

Start renaming an item

Source

pub fn cancel_rename(&mut self)

Cancel rename

Source

pub fn finish_rename(&mut self) -> Option<(usize, String)>

Finish rename and return new name if changed

Source

pub fn start_drag(&mut self, id: usize, pos: Pos2)

Start dragging an item

Source

pub fn set_drop_target(&mut self, target: Option<usize>)

Update drop target

Source

pub fn end_drag(&mut self) -> Option<(usize, usize)>

End drag operation

Source

pub fn is_dragging(&self) -> bool

Check if currently dragging

Source

pub fn sync_selected_drawing(&mut self, selected_drawing: Option<usize>)

Sync selected drawing from an external selection.

If selected_drawing is Some, ensures it is the sole selection.

Trait Implementations§

Source§

impl Clone for ObjectTreeState

Source§

fn clone(&self) -> ObjectTreeState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ObjectTreeState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ObjectTreeState

Source§

fn default() -> ObjectTreeState

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeSend for T
where T: Send + Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.