pub trait GridRenderer {
// Required methods
fn line(
&mut self,
x0_cm: f64,
y0_cm: f64,
x1_cm: f64,
y1_cm: f64,
gp: &Gpar,
);
fn polyline(&mut self, x_cm: &[f64], y_cm: &[f64], gp: &Gpar);
fn rect(&mut self, x_cm: f64, y_cm: f64, w_cm: f64, h_cm: f64, gp: &Gpar);
fn circle(&mut self, x_cm: f64, y_cm: f64, r_cm: f64, gp: &Gpar);
fn polygon(&mut self, x_cm: &[f64], y_cm: &[f64], gp: &Gpar);
fn text(&mut self, x_cm: f64, y_cm: f64, label: &str, rot: f64, gp: &Gpar);
fn point(&mut self, x_cm: f64, y_cm: f64, pch: u8, size_cm: f64, gp: &Gpar);
fn clip(&mut self, x_cm: f64, y_cm: f64, w_cm: f64, h_cm: f64);
fn unclip(&mut self);
fn device_size_cm(&self) -> (f64, f64);
}Expand description
Abstract renderer for grid graphics.
All coordinates are in centimeters from the device origin (bottom-left). The renderer converts these to whatever coordinate system the backend uses.
Required Methods§
Sourcefn line(&mut self, x0_cm: f64, y0_cm: f64, x1_cm: f64, y1_cm: f64, gp: &Gpar)
fn line(&mut self, x0_cm: f64, y0_cm: f64, x1_cm: f64, y1_cm: f64, gp: &Gpar)
Draw a single line segment.
Sourcefn polyline(&mut self, x_cm: &[f64], y_cm: &[f64], gp: &Gpar)
fn polyline(&mut self, x_cm: &[f64], y_cm: &[f64], gp: &Gpar)
Draw a connected polyline (multiple segments sharing endpoints).
Sourcefn point(&mut self, x_cm: f64, y_cm: f64, pch: u8, size_cm: f64, gp: &Gpar)
fn point(&mut self, x_cm: f64, y_cm: f64, pch: u8, size_cm: f64, gp: &Gpar)
Draw a point (plotting symbol).
Sourcefn clip(&mut self, x_cm: f64, y_cm: f64, w_cm: f64, h_cm: f64)
fn clip(&mut self, x_cm: f64, y_cm: f64, w_cm: f64, h_cm: f64)
Set a clipping rectangle. All subsequent drawing is clipped to this region.
Sourcefn device_size_cm(&self) -> (f64, f64)
fn device_size_cm(&self) -> (f64, f64)
Return the device size in centimeters (width, height).