]> git.localhorst.tv Git - blobs.git/blob - src/ui/BodyPanel.hpp
allow clicking celestial bodies
[blobs.git] / src / ui / BodyPanel.hpp
1 #ifndef BLOBS_UI_BODYPANEL_HPP_
2 #define BLOBS_UI_BODYPANEL_HPP_
3
4 #include "Panel.hpp"
5
6 namespace blobs {
7 namespace app {
8         struct Assets;
9 }
10 namespace graphics {
11         class Viewport;
12 }
13 namespace world {
14         class Body;
15 }
16 namespace ui {
17
18 class Label;
19
20 class BodyPanel {
21
22 public:
23         explicit BodyPanel(app::Assets &);
24         ~BodyPanel();
25
26         BodyPanel(const BodyPanel &) = delete;
27         BodyPanel &operator =(const BodyPanel &) = delete;
28
29         BodyPanel(BodyPanel &&) = delete;
30         BodyPanel &operator =(BodyPanel &&) = delete;
31
32 public:
33         void Show(world::Body &);
34         void Hide() noexcept;
35
36         bool Shown() const noexcept { return body; }
37         const world::Body &GetBody() const noexcept { return *body; }
38
39         void ZIndex(float z) noexcept { panel.ZIndex(z); }
40
41         void Draw(graphics::Viewport &) noexcept;
42
43 private:
44         app::Assets &assets;
45         world::Body *body;
46
47         Label *name;
48         Label *mass;
49         Label *radius;
50         Label *soi;
51         Label *operiod;
52         Label *rperiod;
53         Label *atm;
54         Label *sma;
55         Label *ecc;
56         Label *inc;
57         Label *asc;
58         Label *arg;
59         Label *mna;
60         Panel panel;
61
62 };
63
64 }
65 }
66
67 #endif