3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
12 #include <msp/core/application.h>
13 #include <msp/gbase/display.h>
14 #include <msp/gbase/window.h>
15 #include <msp/gbase/glcontext.h>
16 #include <msp/gl/font.h>
17 #include <msp/gl/light.h>
18 #include <msp/gl/lighting.h>
19 #include <msp/gl/object.h>
20 #include <msp/gl/pipeline.h>
21 #include <msp/gltk/label.h>
22 #include <msp/gltk/resources.h>
23 #include <msp/gltk/root.h>
24 #include <msp/time/timestamp.h>
25 #include "libmarklin/catalogue.h"
26 #include "libmarklin/layout.h"
27 #include "3d/layout.h"
36 class Designer: public Msp::Application
48 Msp::Graphics::Display *dpy;
49 Msp::Graphics::Window *wnd;
50 Msp::Graphics::GLContext *glc;
53 Msp::GLtk::Resources ui_res;
54 Msp::GLtk::Root *root;
57 Msp::GLtk::Label *lbl_tooltip;
58 Msp::Time::TimeStamp tooltip_timeout;
60 Marklin::Catalogue catalogue;
61 Marklin::Layout *cat_layout;
62 Marklin::Layout3D *cat_layout_3d;
64 Marklin::Layout *layout;
65 Marklin::Layout3D *layout_3d;
66 Msp::GL::Object *base_object;
67 Marklin::Route *cur_route;
68 Msp::GL::Pipeline *pipeline;
69 Msp::GL::Lighting lighting;
74 Manipulator *manipulator;
80 Marklin::Point cam_pos;
91 Msp::Time::TimeStamp last_tick;
93 static Msp::Application::RegApp<Designer> reg;
96 Designer(int, char **);
103 Marklin::Layout *get_layout() { return layout; }
104 Marklin::Layout3D *get_layout_3d() { return layout_3d; }
105 const Msp::GLtk::Resources &get_ui_resources() const { return ui_res; }
106 Msp::GLtk::Root &get_root() const { return *root; }
107 void edit_route(Marklin::Route &);
108 Marklin::Route *get_current_route() const { return cur_route; }
109 void add_selection_to_route();
111 void map_pointer_coords(int, int, float &, float &);
114 void key_press(unsigned, unsigned, wchar_t);
115 void key_release(unsigned, unsigned);
116 void button_press(int, int, unsigned, unsigned);
117 void pointer_motion(int, int);
121 Marklin::Track3D *pick_track(int, int);
122 void update_track_color(Marklin::Track3D &);
123 void manipulation_status(const std::string &);
124 void manipulation_done(bool);
125 void measure_changed();
127 void set_tooltip(int, int, const std::string &);
128 void clear_tooltip();
130 void turnout_id_accept();
131 void sensor_id_accept();
132 void input_dismiss();