3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
12 #include <msp/core/application.h>
13 #include <msp/gbase/simplewindow.h>
14 #include <msp/gl/camera.h>
15 #include <msp/gl/font.h>
16 #include <msp/gl/light.h>
17 #include <msp/gl/lighting.h>
18 #include <msp/gl/object.h>
19 #include <msp/gl/pipeline.h>
20 #include <msp/gltk/label.h>
21 #include <msp/gltk/resources.h>
22 #include <msp/gltk/root.h>
23 #include <msp/time/timestamp.h>
24 #include "libmarklin/catalogue.h"
25 #include "libmarklin/layout.h"
26 #include "3d/layout.h"
27 #include "3d/overlay.h"
29 #include "cameracontroller.h"
30 #include "manipulator.h"
32 #include "selection.h"
36 class Designer: public Msp::Application
47 Msp::Graphics::SimpleGLWindow window;
48 Msp::GLtk::Resources ui_res;
49 Msp::GLtk::Root *root;
52 Msp::GLtk::Label *lbl_status;
54 Marklin::Catalogue catalogue;
55 Marklin::Layout3D *cat_layout_3d;
57 Marklin::Layout *layout;
58 Marklin::Layout3D *layout_3d;
59 Marklin::Overlay3D *overlay;
60 Msp::GL::Object *base_object;
61 Marklin::Route *cur_route;
62 Msp::GL::Pipeline *pipeline;
63 Msp::GL::Camera camera;
64 Msp::GL::Lighting lighting;
69 Manipulator manipulator;
71 CameraController camera_ctl;
73 Msp::Time::TimeStamp last_tick;
75 static Msp::Application::RegApp<Designer> reg;
78 Designer(int, char **);
85 Marklin::Layout *get_layout() { return layout; }
86 Marklin::Layout3D *get_layout_3d() { return layout_3d; }
87 const Msp::GL::Camera &get_camera() const { return camera; }
88 const Msp::GLtk::Resources &get_ui_resources() const { return ui_res; }
89 Msp::GLtk::Root &get_root() const { return *root; }
92 void set_turnout_id();
96 void edit_route(Marklin::Route *);
97 Marklin::Route *get_current_route() const { return cur_route; }
98 void add_selection_to_route();
100 Marklin::Point map_pointer_coords(int, int);
103 void key_press(unsigned, unsigned, wchar_t);
104 void button_press(int, int, unsigned, unsigned);
105 void pointer_motion(int, int);
108 Marklin::Track3D *pick_track(int, int);
109 void update_track_icon(Marklin::Track3D &);
110 void selection_changed();
111 void manipulation_status(const std::string &);
112 void manipulation_done(bool);
113 void measure_changed();
115 void turnout_id_accept(const std::string &);
116 void sensor_id_accept(const std::string &);
117 void route_name_accept(const std::string &);
119 std::string tooltip(int, int);
120 void show_route(const Marklin::Route *);