Virtual Testbed
Ship dynamics simulator for extreme conditions
StatisticsWindow.hh
1 #ifndef VTESTBED_GUI_STATISTICSWINDOW_HH
2 #define VTESTBED_GUI_STATISTICSWINDOW_HH
3 
4 #include <vector>
5 
6 #include <vtestbed/gui/SelectableGroup.hh>
7 #include <vtestbed/gui/TimeSeriesPanel.hh>
8 #include <vtestbed/gui/Window.hh>
9 
10 namespace vtb {
11 
12  namespace gui {
13 
14  template <class T>
15  class StatisticsWindow: public Window {
16 
17  private:
20  typedef typename statistics_type::Record Record;
21 
22  private:
23  std::vector<TimeSeriesPanel<T>> _timeSeries;
24  std::vector<SelectableGroup<3>> _timeSeriesGroups;
25  static constexpr const T time_range = T{60};
26  static constexpr const size_t multiple = 2;
27 
28  public:
29 
31 
32  void
33  step(T t, const statistics_type& stats);
34 
35  void
36  draw();
37 
38  private:
39 
40  inline const TimeSeriesPanel<T>&
41  time_series_panel(Record rec) const {
42  return this->_timeSeries[static_cast<size_t>(rec)];
43  }
44 
45  inline TimeSeriesPanel<T>&
46  time_series_panel(Record rec) {
47  return this->_timeSeries[static_cast<size_t>(rec)];
48  }
49 
50  };
51 
52  }
53 
54 }
55 
56 #endif // vim:filetype=cpp
A region defined by start and end index and lower and upper bound for each dimension.
Definition: core/grid.hh:25
Main namespace.
Definition: convert.hh:9