struct TreeNodePosition {
node: usize,
parent: Option<NodePositionIdx>,
previous_sibling: Option<NodePositionIdx>,
child_index: NodePositionIdx,
children: Vec<NodePositionIdx>,
ancestor: NodePositionIdx,
thread: Option<NodePositionIdx>,
x: i32,
y: f32,
mod: f32,
change: f32,
shift: f32,
}Expand description
Stores tree links as vector indices
Fields§
§node: usize§parent: Option<NodePositionIdx>§previous_sibling: Option<NodePositionIdx>§child_index: NodePositionIdx§children: Vec<NodePositionIdx>§ancestor: NodePositionIdx§thread: Option<NodePositionIdx>§x: i32§y: f32§mod: f32§change: f32§shift: f32Implementations§
Source§impl TreeNodePosition
impl TreeNodePosition
Sourcefn add_child(
nodes: &mut Vec<TreeNodePosition>,
tree: &mut AdvancementRegistry,
parent_idx: NodePositionIdx,
adv_node_idx: usize,
previous_idx: Option<NodePositionIdx>,
) -> Option<NodePositionIdx>
fn add_child( nodes: &mut Vec<TreeNodePosition>, tree: &mut AdvancementRegistry, parent_idx: NodePositionIdx, adv_node_idx: usize, previous_idx: Option<NodePositionIdx>, ) -> Option<NodePositionIdx>
Adds displayed children traversing through nodes without a display
Sourcefn first_walk(nodes: &mut [TreeNodePosition], idx: NodePositionIdx)
fn first_walk(nodes: &mut [TreeNodePosition], idx: NodePositionIdx)
Traverse every node and compute each y position relative to its siblings and children.
fn second_walk( nodes: &mut [TreeNodePosition], idx: NodePositionIdx, mod_sum: f32, depth: i32, min: f32, ) -> f32
Sourcefn normalize_y(nodes: &mut [TreeNodePosition], offset: f32)
fn normalize_y(nodes: &mut [TreeNodePosition], offset: f32)
just make the minimal y coord to be 0
fn execute_shifts(nodes: &mut [TreeNodePosition], idx: NodePositionIdx)
fn previous_or_thread( nodes: &[TreeNodePosition], idx: NodePositionIdx, ) -> Option<NodePositionIdx>
fn next_or_thread( nodes: &[TreeNodePosition], idx: NodePositionIdx, ) -> Option<NodePositionIdx>
fn apportion( nodes: &mut [TreeNodePosition], idx: NodePositionIdx, default_ancestor: NodePositionIdx, ) -> NodePositionIdx
fn move_subtree( nodes: &mut [TreeNodePosition], left: NodePositionIdx, right: NodePositionIdx, shift: f32, )
fn get_ancestor( nodes: &[TreeNodePosition], idx: NodePositionIdx, other: NodePositionIdx, default_ancestor: NodePositionIdx, ) -> NodePositionIdx
fn set_position( tree: &mut AdvancementRegistry, nodes: &[TreeNodePosition], idx: NodePositionIdx, )
Auto Trait Implementations§
impl Freeze for TreeNodePosition
impl RefUnwindSafe for TreeNodePosition
impl Send for TreeNodePosition
impl Sync for TreeNodePosition
impl Unpin for TreeNodePosition
impl UnsafeUnpin for TreeNodePosition
impl UnwindSafe for TreeNodePosition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreWraps this value in an
Arc<SyncMutex<>>