SPH
RunPage.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "gui/Settings.h"
6 #include "system/Settings.h"
7 #include "system/Timer.h"
8 #include <wx/panel.h>
9 
10 class wxBoxSizer;
11 class wxGauge;
12 class wxCheckBox;
13 class wxTextCtrl;
14 class wxPanel;
15 class wxDialog;
16 
17 class wxAuiManager;
18 class wxAuiNotebookEvent;
19 
21 
22 class IColorizer;
23 class IGraphicsPane;
24 class IPlot;
25 class IPluginControls;
26 class Controller;
27 class OrthoPane;
28 class ParticleProbe;
29 class PlotView;
30 class Particle;
31 class Rgba;
32 class Statistics;
33 class Storage;
34 struct DiagnosticsError;
36 class TimeLine;
37 class ProgressPanel;
38 class ComboBox;
39 
44 class RunPage : public wxPanel {
45 private:
47  RawPtr<Controller> controller;
48 
49  AutoPtr<wxAuiManager> manager;
50 
52  GuiSettings& gui;
53 
56 
58 
60  PlotView* firstPlot = nullptr;
61  PlotView* secondPlot = nullptr;
62 
63  LockingPtr<SelectedParticlePlot> selectedParticlePlot;
64 
65  wxTextCtrl* statsText = nullptr;
66  Timer statsTimer;
67 
68  wxDialog* waitingDialog = nullptr;
69 
71  ComboBox* quantityBox;
72  Size selectedIdx = 0;
73  wxPanel* quantityPanel;
74  wxSizer* quantityPanelSizer;
75 
76  TimeLine* timelineBar;
77  ProgressPanel* progressBar;
78  wxPanel* statsBar;
79 
81  Array<SharedPtr<IColorizer>> colorizerList;
82 
83 public:
84  RunPage(wxWindow* window, Controller* controller, GuiSettings& guiSettings);
85 
86  ~RunPage();
87 
88  void refresh();
89 
90  void showTimeLine(const bool show);
91 
92  void runStarted(const Storage& storage, const Path& path);
93 
94  void onTimeStep(const Storage& storage, const Statistics& stats);
95 
96  void onRunEnd();
97 
98  // false means close has been veto'd
99  bool close();
100 
101  void setProgress(const Statistics& stats);
102 
103  void newPhase(const std::string& className, const std::string& instanceName);
104 
105  void setColorizerList(Array<SharedPtr<IColorizer>>&& colorizers);
106 
107  void setSelectedParticle(const Particle& particle, const Rgba color);
108 
109  void deselectParticle();
110 
111  wxSize getCanvasSize() const;
112 
113 private:
115  // wxPanel* createToolBar();
116 
118  wxPanel* createPlotBar();
119 
121  wxPanel* createVisBar();
122 
124  wxPanel* createStatsBar();
125 
126  wxWindow* createParticleBox(wxPanel* parent);
127  wxWindow* createRaymarcherBox(wxPanel* parent);
128  wxWindow* createVolumeBox(wxPanel* parent);
129 
130  void makeStatsText(const Size particleCnt, const Statistics& stats);
131 
132  void setColorizer(const Size idx);
133 
134  void replaceQuantityBar(const Size idx);
135 
136  void addComponentIdBar(wxWindow* parent, wxSizer* sizer, SharedPtr<IColorizer> colorizer);
137 
138  void updateCutoff(const double cutoff);
139 };
140 
141 
Generic dynamically allocated resizable storage.
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
uint32_t Size
Integral type used to index arrays (by default).
Definition: Globals.h:16
Smart pointer associated with a mutex.
#define NAMESPACE_SPH_END
Definition: Object.h:12
Measuring time intervals and executing periodic events.
Generic dynamically allocated resizable storage.
Definition: Array.h:43
Main GUI class connection the simulation with UI controls.
Definition: Controller.h:42
Interface for objects assigning colors to particles.
Definition: Colorizer.h:34
Interface for constructing generic plots from quantities stored in storage.
Definition: Plot.h:75
Object holding information about single particle.
Definition: Particle.h:17
Object representing a path on a filesystem.
Definition: Path.h:17
Definition: Color.h:8
Main frame of the application.
Definition: RunPage.h:44
~RunPage()
Definition: RunPage.cpp:125
wxSize getCanvasSize() const
Definition: RunPage.cpp:941
bool close()
Definition: RunPage.cpp:963
void deselectParticle()
Definition: RunPage.cpp:936
void setColorizerList(Array< SharedPtr< IColorizer >> &&colorizers)
Definition: RunPage.cpp:919
void setProgress(const Statistics &stats)
Definition: RunPage.cpp:826
void refresh()
Definition: RunPage.cpp:840
void newPhase(const std::string &className, const std::string &instanceName)
Definition: RunPage.cpp:836
void runStarted(const Storage &storage, const Path &path)
Definition: RunPage.cpp:857
RunPage(wxWindow *window, Controller *controller, GuiSettings &guiSettings)
Definition: RunPage.cpp:73
void showTimeLine(const bool show)
Definition: RunPage.cpp:844
void onTimeStep(const Storage &storage, const Statistics &stats)
Definition: RunPage.cpp:876
void setSelectedParticle(const Particle &particle, const Rgba color)
Definition: RunPage.cpp:931
void onRunEnd()
Definition: RunPage.cpp:912
Temporal plot of currently selected particle.
Definition: Plots.h:26
Object holding various statistics about current run.
Definition: Statistics.h:22
Container storing all quantities used within the simulations.
Definition: Storage.h:230
Basic time-measuring tool. Starts automatically when constructed.
Definition: Timer.h:27
Generic storage and input/output routines of settings.
Object containing a reported error message.
Definition: Diagnostics.h:15