dear_implot3d/ui_ext.rs
1use crate::{Plot3DBuilder, Plot3DUi};
2use dear_imgui_rs::Ui;
3
4/// Ui extension for obtaining a Plot3DUi
5pub trait ImPlot3DExt {
6 fn implot3d<'ui>(&'ui self) -> Plot3DUi<'ui>;
7}
8
9impl ImPlot3DExt for Ui {
10 fn implot3d<'ui>(&'ui self) -> Plot3DUi<'ui> {
11 Plot3DUi { _ui: self }
12 }
13}
14
15impl<'ui> Plot3DUi<'ui> {
16 /// Convenience builder entry from Ui
17 pub fn plot3d<S: AsRef<str>>(&self, title: S) -> Plot3DBuilder {
18 self.begin_plot(title)
19 }
20}