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/gltk/resources.h>
11 #include <msp/gltk/root.h>
12 #include "libr2c2/catalogue.h"
13 #include "libr2c2/train.h"
14 #include "3d/layout.h"
15 #include "3d/overlay.h"
18 #include "network/server.h"
24 class Engineer: public Msp::RegisteredApplication<Engineer>
29 Msp::Graphics::SimpleGLWindow window;
30 Msp::Input::Keyboard keyboard;
31 Msp::Input::Mouse mouse;
32 Msp::GLtk::Resources ui_res;
33 Msp::GLtk::Root *root;
34 Msp::GLtk::Arrangement *root_arrangement;
36 R2C2::Catalogue catalogue;
38 R2C2::Layout3D layout_3d;
40 Msp::IO::EventDispatcher event_disp;
41 R2C2::Overlay3D *overlay;
42 std::map<R2C2::Train *, Msp::GL::Color> train_colors;
44 R2C2::View3D main_view;
47 std::list<R2C2::Train *> new_trains;
48 std::list<TrainView *> train_views;
49 Msp::Time::TimeStamp status_timeout;
53 Engineer(int argc, char **argv);
56 const Msp::GLtk::Resources &get_ui_resources() const { return ui_res; }
57 Msp::GLtk::Root &get_root() const { return *root; }
58 const R2C2::Catalogue &get_catalogue() const { return catalogue; }
59 R2C2::Layout &get_layout() { return layout; }
60 R2C2::Layout3D &get_layout_3d() { return layout_3d; }
61 R2C2::View3D &get_main_view() { return main_view; }
62 void set_status(const std::string &);
63 void add_train_view(TrainView &);
64 void remove_train_view(TrainView &);
66 void quit() { exit(0); }
69 void button_press(unsigned);
70 void axis_motion(unsigned, float, float);
72 void sensor_event(unsigned, bool);
73 void block_reserved(const R2C2::Block &, const R2C2::Train *);
74 R2C2::Object *pick_object(const R2C2::Vector &);
75 void train_added(R2C2::Train &);
76 void process_new_train(R2C2::Train &);
77 virtual void sighandler(int);