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/mesh.h>
18 #include <msp/gltk/label.h>
19 #include <msp/gltk/resources.h>
20 #include <msp/gltk/root.h>
21 #include <msp/time/timestamp.h>
22 #include "libmarklin/catalogue.h"
23 #include "libmarklin/layout.h"
24 #include "3d/layout.h"
33 class Designer: public Msp::Application
45 Msp::Graphics::Display *dpy;
46 Msp::Graphics::Window *wnd;
47 Msp::Graphics::GLContext *glc;
50 Msp::GLtk::Resources ui_res;
51 Msp::GLtk::Root *root;
54 Msp::GLtk::Label *lbl_tooltip;
55 Msp::Time::TimeStamp tooltip_timeout;
57 Marklin::Catalogue catalogue;
58 Marklin::Layout *cat_layout;
59 Marklin::Layout3D *cat_layout_3d;
61 Marklin::Layout *layout;
62 Marklin::Layout3D *layout_3d;
63 Msp::GL::Mesh *base_mesh;
64 Marklin::Route *cur_route;
68 Manipulator *manipulator;
74 Marklin::Point cam_pos;
85 Msp::Time::TimeStamp last_tick;
87 static Msp::Application::RegApp<Designer> reg;
90 Designer(int, char **);
97 Marklin::Layout *get_layout() { return layout; }
98 Marklin::Layout3D *get_layout_3d() { return layout_3d; }
99 const Msp::GLtk::Resources &get_ui_resources() const { return ui_res; }
100 Msp::GLtk::Root &get_root() const { return *root; }
101 void edit_route(Marklin::Route &);
102 Marklin::Route *get_current_route() const { return cur_route; }
103 void add_selection_to_route();
105 void map_pointer_coords(int, int, float &, float &);
108 void key_press(unsigned, unsigned, wchar_t);
109 void key_release(unsigned, unsigned);
110 void button_press(int, int, unsigned, unsigned);
111 void pointer_motion(int, int);
115 Marklin::Track3D *pick_track(int, int);
116 void update_track_color(Marklin::Track3D &);
117 void manipulation_status(const std::string &);
118 void manipulation_done(bool);
119 void measure_changed();
121 void set_tooltip(int, int, const std::string &);
122 void clear_tooltip();
124 void turnout_id_accept();
125 void sensor_id_accept();
126 void input_dismiss();