use crate::{Line3DFlags, Scatter3DFlags};
use super::core::Plot3DUi;
#[cfg(feature = "mint")]
impl<'ui> Plot3DUi<'ui> {
pub fn plot_line_mint<S: AsRef<str>>(
&self,
label: S,
pts: &[mint::Point3<f32>],
flags: Line3DFlags,
) {
let mut xs = Vec::with_capacity(pts.len());
let mut ys = Vec::with_capacity(pts.len());
let mut zs = Vec::with_capacity(pts.len());
for p in pts {
xs.push(p.x);
ys.push(p.y);
zs.push(p.z);
}
self.plot_line_f32(label, &xs, &ys, &zs, flags);
}
pub fn plot_scatter_mint<S: AsRef<str>>(
&self,
label: S,
pts: &[mint::Point3<f32>],
flags: Scatter3DFlags,
) {
let mut xs = Vec::with_capacity(pts.len());
let mut ys = Vec::with_capacity(pts.len());
let mut zs = Vec::with_capacity(pts.len());
for p in pts {
xs.push(p.x);
ys.push(p.y);
zs.push(p.z);
}
self.plot_scatter_f32(label, &xs, &ys, &zs, flags);
}
pub fn plot_text_mint(
&self,
text: &str,
pos: mint::Point3<f32>,
angle: f32,
pix_offset: [f32; 2],
) {
self.plot_text(text, pos.x, pos.y, pos.z, angle, pix_offset);
}
pub fn plot_to_pixels_mint(&self, point: mint::Point3<f32>) -> [f32; 2] {
self.plot_to_pixels([point.x, point.y, point.z])
}
}