Karana.KUtils.MultibodyTUI.history
==================================

.. py:module:: Karana.KUtils.MultibodyTUI.history

.. autoapi-nested-parse::

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



Attributes
----------

.. autoapisummary::

   Karana.KUtils.MultibodyTUI.history.State


Classes
-------

.. autoapisummary::

   Karana.KUtils.MultibodyTUI.history.StateHistory


Module Contents
---------------

.. py:data:: State

.. py:class:: StateHistory(init_state: State)

   Bases: :py:obj:`Generic`\ [\ :py:obj:`State`\ ]


   Container for a state object with undo and redo capabilities.


   .. py:property:: state
      :type: State


      The current state.


   .. py:method:: push(state: State)

      Set a new state.



   .. py:property:: current_state_count
      :type: int


      The number of states in the undo stack.

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


   .. py:property:: total_state_count
      :type: int


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

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


   .. py:method:: undoStackSize() -> int

      Return the number of states in the undo stack.

      Note that this includes the current state and is always positive



   .. py:method:: canUndo() -> bool

      Return whether an undo state is available.



   .. py:method:: undo()

      Return to the previous state.



   .. py:method:: canRedo() -> bool

      Return whether a redo state is available.



   .. py:method:: redo()

      Return to the next state (i.e., undo a previous undo).



