4 #include <msp/core/application.h>
5 #include <msp/graphics/simplewindow.h>
6 #include <msp/gl/camera.h>
7 #include <msp/gl/light.h>
8 #include <msp/gl/lighting.h>
9 #include <msp/gl/pipeline.h>
10 #include <msp/input/keyboard.h>
11 #include <msp/input/mouse.h>
12 #include "libr2c2/catalogue.h"
13 #include "libr2c2/train.h"
14 #include "3d/layout.h"
15 #include "3d/overlay.h"
17 #include "3d/trackchain.h"
19 #include "network/server.h"
21 #include "userinterface.h"
23 class Engineer: public Msp::RegisteredApplication<Engineer>
28 Msp::Graphics::SimpleGLWindow window;
29 Msp::Input::Keyboard keyboard;
30 Msp::Input::Mouse mouse;
32 R2C2::Catalogue catalogue;
34 R2C2::Layout3D layout_3d;
36 Msp::IO::EventDispatcher event_disp;
37 R2C2::Overlay3D *overlay;
38 std::map<R2C2::Train *, Msp::GL::Color> train_colors;
40 R2C2::View3D main_view;
43 std::list<R2C2::Train *> new_trains;
45 std::list<R2C2::TrackChain3D *> emergencies;
46 Msp::Time::TimeStamp emergency_blink_timeout;
47 unsigned emergency_blink_state;
50 Engineer(int argc, char **argv);
53 const R2C2::Catalogue &get_catalogue() const { return catalogue; }
54 R2C2::Layout &get_layout() { return layout; }
55 R2C2::Layout3D &get_layout_3d() { return layout_3d; }
56 R2C2::View3D &get_main_view() { return main_view; }
57 UserInterface &get_user_interface() { return ui; }
59 void quit() { exit(0); }
62 void button_press(unsigned);
63 void axis_motion(unsigned, float, float);
65 R2C2::Object *pick_object(const R2C2::Vector &);
66 void emergency(R2C2::Block *, const std::string &);
67 void halt_event(bool);
68 void train_added(R2C2::Train &);
69 void process_new_train(R2C2::Train &);
70 virtual void sighandler(int);