runmat_plot/gui/
window.rs1#[derive(Debug, Clone)]
8pub struct WindowConfig {
9 pub title: String,
10 pub width: u32,
11 pub height: u32,
12 pub resizable: bool,
13 pub maximized: bool,
14 pub vsync: bool,
15}
16
17impl Default for WindowConfig {
18 fn default() -> Self {
19 Self {
20 title: "RunMat - Interactive Visualization | Powered by Dystr".to_string(),
21 width: 1200,
22 height: 800,
23 resizable: true,
24 maximized: false,
25 vsync: true,
26 }
27 }
28}
29
30#[cfg(feature = "gui")]
32pub struct PlotWindow<'window> {
33 pub window: std::sync::Arc<winit::window::Window>,
34 pub event_loop: Option<winit::event_loop::EventLoop<()>>,
35 pub plot_renderer: crate::core::PlotRenderer,
36 pub plot_overlay: crate::gui::PlotOverlay,
37 pub surface: wgpu::Surface<'window>,
38 pub depth_texture: wgpu::Texture,
39 pub depth_view: wgpu::TextureView,
40 pub egui_ctx: egui::Context,
41 pub egui_state: egui_winit::State,
42 pub egui_renderer: egui_wgpu::Renderer,
43 pub config: WindowConfig,
44 pub mouse_position: glam::Vec2,
45 pub is_mouse_over_plot: bool,
46}
47
48#[cfg(not(feature = "gui"))]
52pub struct PlotWindow;
53
54#[cfg(not(feature = "gui"))]
55impl PlotWindow {
56 pub async fn new(_config: WindowConfig) -> Result<Self, Box<dyn std::error::Error>> {
57 Err("GUI feature not enabled".into())
58 }
59
60 pub fn add_test_plot(&mut self) {
61 }
63
64 pub fn run(self) -> Result<(), Box<dyn std::error::Error>> {
65 Err("GUI feature not enabled".into())
66 }
67}