Type Alias RunningState

Source
pub type RunningState = State<InnerGraphicalState>;
Expand description

Holds the application state. Starting point to add visualization datas.

Aliased Type§

pub struct RunningState(/* private fields */);

Implementations§

Source§

impl RunningState

Source

pub fn resize_scene(&mut self)

Fit camera and ground to match the visible shapes

Source

pub fn screenshot(&mut self)

Take a screenshot of the scene. The screenshot is then saved on disk under the name screenshot_[nnn].png, with nnn incrementing each time.

Source

pub fn screenshot_to_buffer(&mut self) -> Result<Vec<u8>, ()>

Take a screenshot of the scene. The screenshot is then returned as a vector oy bytes, each storing r g b a (in order) values of each pixel.

Should not fail, unless internal buffer storage is messed up.

Source

pub fn get_picked(&self) -> &Option<(String, Picked)>

Get current selected object: first the name, then index i and type of the selected element

Source

pub fn refresh(&mut self)

Politely ask to render the next frame, even if no change is detected

Trait Implementations§

Source§

impl Deref for RunningState

Source§

type Target = InnerGraphicalState

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for RunningState

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.