Karana.KUtils.MultibodyTUI.history#

Contains StateHistroy. A class for keeping track of the TUI state history.

Attributes#

Classes#

StateHistory

Container for a state object with undo and redo capabilities.

Module Contents#

Karana.KUtils.MultibodyTUI.history.State#
class Karana.KUtils.MultibodyTUI.history.StateHistory(init_state: State)[source]#

Bases: Generic[State]

Container for a state object with undo and redo capabilities.

property state: State#

The current state.

push(state: State)[source]#

Set a new state.

property current_state_count: int#

The number of states in the undo stack.

Note that this includes the current state and is always positive.

property total_state_count: int#

The number of states - past, present, and future.

This is similar to past_state_count but also includes states in the redo stack.

undoStackSize() int[source]#

Return the number of states in the undo stack.

Note that this includes the current state and is always positive

canUndo() bool[source]#

Return whether an undo state is available.

undo()[source]#

Return to the previous state.

canRedo() bool[source]#

Return whether a redo state is available.

redo()[source]#

Return to the next state (ie: undo a previous undo).