]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/engineer.h
Complete rewrite of the engineer UI
[r2c2.git] / source / engineer / engineer.h
index 2ec017b8a9363e7ce8929d32c13573ae0c6d172d..7997242e17cf0c82409e08d80b376d2e86c68566 100644 (file)
@@ -2,7 +2,7 @@
 #define ENGINEER_H_
 
 #include <msp/core/application.h>
-#include <msp/gbase/simplewindow.h>
+#include <msp/graphics/simplewindow.h>
 #include <msp/gl/camera.h>
 #include <msp/gl/light.h>
 #include <msp/gl/lighting.h>
 #include "network/server.h"
 #include "options.h"
 
-class MainPanel;
-class TrainPanel;
+class MainWindow;
 class TrainView;
 
-class Engineer: public Msp::Application
+class Engineer: public Msp::RegisteredApplication<Engineer>
 {
 public:
        sigc::signal<void, R2C2::Track *, int> signal_pick_done;
@@ -30,6 +29,8 @@ private:
        Options options;
 
        Msp::Graphics::SimpleGLWindow window;
+       Msp::Input::Keyboard keyboard;
+       Msp::Input::Mouse mouse;
        Msp::GLtk::Resources ui_res;
        Msp::GLtk::Root *root;
 
@@ -47,16 +48,15 @@ private:
        Msp::GL::Pipeline pipeline;
        Msp::GL::Mesh arrow_mesh;
 
-       MainPanel *main_panel;
-       std::list<TrainPanel *> train_panels;
+       MainWindow *main_wnd;
+       std::list<R2C2::Train *> new_trains;
        std::list<TrainView *> train_views;
        Msp::Time::TimeStamp status_timeout;
        bool picking;
        R2C2::Track *picking_track;
        int picking_entry;
        R2C2::Path3D *picking_path;
-       int pointer_x;
-       int pointer_y;
+       R2C2::Vector pointer;
        bool pointer_moved;
 
 public:
@@ -70,7 +70,6 @@ public:
        R2C2::Layout3D &get_layout_3d() { return layout_3d; }
        const Msp::GL::Lighting &get_lighting() const { return lighting; }
        void set_status(const std::string &);
-       void rearrange_panels();
        void add_train_view(TrainView &);
        void remove_train_view(TrainView &);
        void pick(bool);
@@ -78,18 +77,17 @@ public:
        void quit() { exit(0); }
 private:
        void tick();
-       void button_press(int, int, unsigned, unsigned);
-       void pointer_motion(int, int);
+       void button_press(unsigned);
+       void axis_motion(unsigned, float, float);
        void view_all();
        void set_block_color(const R2C2::Block &, const Msp::GL::Color &);
        void reset_block_color(const R2C2::Block &);
        void sensor_event(unsigned, bool);
        void block_reserved(const R2C2::Block &, const R2C2::Train *);
-       R2C2::Track *pick_track(int, int);
+       R2C2::Object *pick_object(const R2C2::Vector &);
        void train_added(R2C2::Train &);
+       void process_new_train(R2C2::Train &);
        virtual void sighandler(int);
-
-       static Msp::Application::RegApp<Engineer> reg;
 };
 
 #endif