|
12 | 12 | namespace hydroc { |
13 | 13 | namespace gui { |
14 | 14 |
|
15 | | -// ============================================================================= |
16 | | -// ViewerSettings: Runtime-adjustable water visualization settings |
17 | | -// ============================================================================= |
18 | | -// Allows tuning water appearance without recompiling. |
19 | | -// Owned by GUIImplVSG, passed by pointer to GUI component and water surface. |
| 15 | +/// Runtime-adjustable water visualization settings. |
| 16 | +/// |
| 17 | +/// Allows tuning water appearance without recompiling. Owned by GUIImplVSG |
| 18 | +/// and passed by pointer to GUI components and the water surface renderer. |
20 | 19 | struct ViewerSettings { |
| 20 | + // --- Display Options --- |
21 | 21 | bool show_water = true; ///< Toggle water surface visibility |
22 | | - float wave_visual_scale = 1.0f; ///< Multiplier for wave elevation display |
23 | | - int grid_resolution = 64; ///< Vertices per side (32/64/96/128) |
24 | | - int update_hz = 30; ///< Max update rate in Hz (10-60) |
| 22 | + bool show_water_grid = false; ///< Show wireframe overlay on water surface |
25 | 23 | bool show_water_status = false; ///< Show status line in overlay |
26 | 24 |
|
27 | | - // Allowed discrete values for grid resolution. |
| 25 | + // --- Wave Rendering --- |
| 26 | + float wave_visual_scale = 1.0f; ///< Multiplier for wave elevation display |
| 27 | + int update_hz = 30; ///< Maximum update rate [Hz], range 10-60 |
| 28 | + |
| 29 | + // --- Grid Resolution --- |
| 30 | + int grid_resolution = 64; ///< Vertices per side (32, 64, 96, or 128) |
| 31 | + bool resolution_changed = false; ///< Triggers mesh rebuild when resolution changes |
| 32 | + |
28 | 33 | static constexpr int kResolutionOptions[] = {32, 64, 96, 128}; |
29 | 34 | static constexpr int kResolutionCount = 4; |
30 | 35 |
|
31 | | - // Track if resolution changed (requires mesh rebuild). |
32 | | - bool resolution_changed = false; |
| 36 | + // --- Grid Extent --- |
| 37 | + // Values <= 0 use defaults (100m x 100m centered at origin). |
| 38 | + double grid_width = 0.0; ///< Grid extent in X direction [m] |
| 39 | + double grid_length = 0.0; ///< Grid extent in Y direction [m] |
| 40 | + double grid_center_x = 0.0; ///< Grid center X coordinate [m] |
| 41 | + double grid_center_y = 0.0; ///< Grid center Y coordinate [m] |
| 42 | + bool grid_extent_changed = false; ///< Triggers mesh rebuild when extent changes |
33 | 43 |
|
34 | | - // ========================================================================= |
35 | | - // Radiation Visualization (Tier 0 - Approximate, Visual Only) |
36 | | - // ========================================================================= |
37 | | - // Simple visualization of radiated waves from moving bodies. |
38 | | - // NOT physically accurate - purely for visual feedback. |
39 | | - // |
40 | | - // Most parameters are auto-derived from physics: |
41 | | - // - Wavelength derived from wave speed using deep water dispersion |
42 | | - // - Amplitude scales with body velocity and size |
43 | | - // - Only "Visual Scale" is user-adjustable (for inspection) |
| 44 | + // --- Radiation Visualization (Approximate) --- |
| 45 | + // Visual-only representation of radiated waves from moving bodies. |
| 46 | + // NOT physically accurate; wavelength derived from dispersion relation, |
| 47 | + // amplitude scales with body velocity and size. |
44 | 48 | bool show_radiation_viz = false; ///< Enable radiated wave visualization |
45 | | - float radiation_visual_scale = 1.0f; ///< Visual amplification (range 0.1-5x, for inspection only) |
46 | | - |
47 | | - // Water surface grid overlay for better visibility. |
48 | | - bool show_water_grid = false; ///< Show wireframe grid on water surface |
| 49 | + float radiation_visual_scale = 1.0f; ///< Visual amplification [0.1x - 5x] |
49 | 50 | }; |
50 | 51 |
|
51 | 52 | /// ImGui component for HydroChrono visualization overlay. |
|
0 commit comments