Virtual Testbed
Ship dynamics simulator for extreme conditions
RootWindow.hh
1 #ifndef VTESTBED_GUI_ROOTWINDOW_HH
2 #define VTESTBED_GUI_ROOTWINDOW_HH
3 
4 #include <sqlitex/connection.hh>
5 
6 #include <vtestbed/core/testbed.hh>
7 #include <vtestbed/db/hull.hh>
8 #include <vtestbed/db/ship.hh>
9 #include <vtestbed/graphics/ShipCompartments.hh>
10 #include <vtestbed/gui/ApplicationBase.hh>
11 #include <vtestbed/gui/ConsoleWindow.hh>
12 #include <vtestbed/gui/ControlWindow.hh>
13 #include <vtestbed/gui/FileDialog.hh>
14 #include <vtestbed/gui/GeneratorPanel.hh>
15 #include <vtestbed/gui/HullWindow.hh>
16 #include <vtestbed/gui/MagnumImgui/MagnumImGui.h>
17 #include <vtestbed/gui/SettingsWindow.hh>
18 #include <vtestbed/gui/ShipCompartmentsWindow.hh>
19 #include <vtestbed/gui/ShipMotionWindow.hh>
20 #include <vtestbed/gui/SimulationWindow.hh>
21 #include <vtestbed/gui/StatisticsWindow.hh>
22 #include <vtestbed/gui/TablePanel.hh>
23 #include <vtestbed/gui/TestbedPipeline.hh>
24 #include <vtestbed/gui/WavySurfaceWindow.hh>
25 #include <vtestbed/gui/WindWindow.hh>
26 #include <vtestbed/gui/imgui.hh>
27 #include <vtestbed/gui/types.hh>
28 
29 namespace vtb {
30 
31  namespace gui {
32 
33  template <class T>
34  class RootWindow {
35 
36  private:
38  using database_type = sqlite::connection;
41 
42  private:
43  bool _showShip = true;
44  bool _transparencyShip = false;
45  bool _showWavySurface = true;
46  bool _showVelocityPotential = false;
47  bool _showEarthFixedAxes = false;
48  bool _showBodyFixedAxes = false;
49  bool _showWindField = false;
50  bool _showWindFieldBoundary = false;
51  bool _showHullWindow = false;
52  TableDialog _shipDialog;
53  FileDialog _shipFileDialog;
54  ship_type _selectedShip;
55  database_type _db;
56  SimulationWindow<T> _simulationWindow;
57  StatisticsWindow<T> _statisticsWindow;
58  WavySurfaceWindow<T> _wavySurfaceWindow;
59  WindWindow<T> _windWindow;
60  ConsoleWindow _logWindow;
61  ShipCompartmentsWindow<T> _compartmentsWindow;
62  ControlWindow<T> _controlWindow;
63  SettingsWindow<T> _settingsWindow;
64  ShipMotionWindow<T> _shipMotionWindow;
65  HullWindow<T> _hullWindow;
66 
67  public:
68 
69  explicit
71 
72  void step(const testbed_type& testbed);
73  void draw();
74 
75  inline const ship_type& selectedShip() const { return this->_selectedShip; }
76  inline ship_type& selectedShip() { return this->_selectedShip; }
77 
79  compartmentsWindow() {
80  return &this->_compartmentsWindow;
81  }
82 
83  inline SimulationWindow<T>& simulationWindow() { return this->_simulationWindow; }
84  inline HullWindow<T>& hullWindow() { return this->_hullWindow; }
85 
86  inline const SimulationWindow<T>&
87  simulationWindow() const {
88  return this->_simulationWindow;
89  }
90 
91  inline bool
92  showShip() const noexcept {
93  return _showShip;
94  }
95 
96  inline bool
97  transparencyShip() const noexcept {
98  return _transparencyShip;
99  }
100 
101  inline bool
102  showWavySurface() const noexcept {
103  return _showWavySurface;
104  }
105 
106  inline bool
107  showVelocityPotential() const noexcept {
108  return _showVelocityPotential;
109  }
110 
111  inline bool showAxes() const { return this->_showEarthFixedAxes; }
112  inline bool showBodyFixedAxes() const { return this->_showBodyFixedAxes; }
113  inline bool showWindField() const { return this->_showWindField; }
114  inline bool showWindFieldBoundary() const { return this->_showWindFieldBoundary; }
115 
116  inline database_type* db() { return &this->_db; }
117 
118  void importShip();
119 
120  void init(const testbed_type& testbed);
121 
122  };
123 
124  }
125 
126 }
127 
128 #endif // vim:filetype=cpp
Main namespace.
Definition: convert.hh:9