cellular_raza_concepts

Trait PlotSelf

Source
pub trait PlotSelf {
    // Required method
    fn plot_self<Db>(
        &self,
        root: &mut DrawingArea<Db, Cartesian2d<RangedCoordf64, RangedCoordf64>>,
    ) -> Result<(), DrawingError>
       where Db: DrawingBackend;

    // Provided methods
    fn plot_self_bitmap(
        &self,
        root: &mut DrawingArea<BitMapBackend<'_>, Cartesian2d<RangedCoordf64, RangedCoordf64>>,
    ) -> Result<(), DrawingError> { ... }
    fn plot_self_svg(
        &self,
        root: &mut DrawingArea<SVGBackend<'_>, Cartesian2d<RangedCoordf64, RangedCoordf64>>,
    ) -> Result<(), DrawingError> { ... }
}
Expand description

Allows elements of the simulation such as cells and voxels to draw themselves onto a plotting root. Typically, voxels will draw first and cells afterwards.

Required Methods§

Source

fn plot_self<Db>( &self, root: &mut DrawingArea<Db, Cartesian2d<RangedCoordf64, RangedCoordf64>>, ) -> Result<(), DrawingError>
where Db: DrawingBackend,

Define which elements to draw when plotting the element itself.

Provided Methods§

Source

fn plot_self_bitmap( &self, root: &mut DrawingArea<BitMapBackend<'_>, Cartesian2d<RangedCoordf64, RangedCoordf64>>, ) -> Result<(), DrawingError>

Overload for backend to have a purely bitmap function. User are not expected to change this function.

Source

fn plot_self_svg( &self, root: &mut DrawingArea<SVGBackend<'_>, Cartesian2d<RangedCoordf64, RangedCoordf64>>, ) -> Result<(), DrawingError>

Overload for backend to have a purely bitmap function. User are not expected to change this function.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Cel> PlotSelf for CellAgentBox<Cel>
where Cel: PlotSelf + Serialize + for<'a> Deserialize<'a>,