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§
Sourcefn plot_self<Db>(
&self,
root: &mut DrawingArea<Db, Cartesian2d<RangedCoordf64, RangedCoordf64>>,
) -> Result<(), DrawingError>where
Db: DrawingBackend,
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§
Sourcefn plot_self_bitmap(
&self,
root: &mut DrawingArea<BitMapBackend<'_>, Cartesian2d<RangedCoordf64, RangedCoordf64>>,
) -> Result<(), DrawingError>
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.
Sourcefn plot_self_svg(
&self,
root: &mut DrawingArea<SVGBackend<'_>, Cartesian2d<RangedCoordf64, RangedCoordf64>>,
) -> Result<(), DrawingError>
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.