]> git.tdb.fi Git - r2c2.git/blob - source/engineer/engineer.h
Initial revision
[r2c2.git] / source / engineer / engineer.h
1 #ifndef ENGINEER_H_
2 #define ENGINEER_H_
3
4 #include <msp/core/application.h>
5 #include <msp/gl/font.h>
6 #include <msp/gltk/resources.h>
7 #include "libmarklin/catalogue.h"
8 #include "libmarklin/control.h"
9 #include "libmarklin/trafficmanager.h"
10 #include "3d/layout.h"
11
12 class MainPanel;
13 class TrainPanel;
14
15 class Engineer: public Msp::Application
16 {
17 public:
18         Engineer(int argc, char **argv);
19         ~Engineer();
20
21         Marklin::Control &get_control()    { return control; }
22         unsigned get_screen_width() const  { return screen_w; }
23         unsigned get_screen_height() const { return screen_h; }
24         unsigned get_font_size() const     { return font_size; }
25         Msp::GL::Font &get_font()          { return *font; }
26         void     add_train(unsigned);
27         int      main();
28         void     quit() { exit(0); }
29 private:
30         typedef std::list<TrainPanel *> TrainPanelSeq;
31
32         unsigned           screen_w;
33         unsigned           screen_h;
34         unsigned           font_size;
35         bool               fullscreen;
36         Msp::GL::Font      *font;
37         Marklin::Catalogue catalogue;
38         Marklin::Layout    layout;
39         Marklin::Layout3D  layout_3d;
40         Marklin::Control   control;
41         Marklin::Point     cam_pos;
42         float              cam_rot;
43         Msp::GLtk::Resources ui_res;
44         MainPanel          *main_panel;
45         TrainPanelSeq      train_panels;
46         std::string        status_text;
47         bool               no_lighting;
48         Marklin::TrafficManager *trfc_mgr;
49         Train              *placing_train;
50
51         void tick();
52         void key_press(unsigned, unsigned);
53         void button_press(int, int, unsigned);
54         void button_release(int, int, unsigned);
55         void pointer_motion(int, int);
56         void view_all();
57         void turnout_route_changed(unsigned);
58         void sensor_state_changed(bool, unsigned);
59         void project_3d();
60         Marklin::Track3D *pick_track(int, int);
61
62         static Msp::Application::RegApp<Engineer> reg;
63 };
64
65 #endif