3 This file is part of R²C²
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 "libr2c2/catalogue.h"
25 #include "libr2c2/layout.h"
26 #include "3d/layout.h"
27 #include "3d/overlay.h"
29 #include "cameracontroller.h"
30 #include "manipulator.h"
32 #include "selection.h"
33 #include "trackwrap.h"
37 class Designer: public Msp::Application
49 Msp::Graphics::SimpleGLWindow window;
50 Msp::GLtk::Resources ui_res;
53 std::vector<Toolbar *> toolbars;
54 Msp::GLtk::Label *lbl_status;
56 R2C2::Catalogue catalogue;
57 R2C2::Layout3D *cat_layout_3d;
60 R2C2::Layout3D *layout_3d;
61 R2C2::Overlay3D *overlay;
62 Msp::GL::Object *base_object;
63 R2C2::Route *cur_route;
64 std::list<R2C2::Track *> new_tracks;
65 Msp::GL::Pipeline *pipeline;
66 Msp::GL::Camera camera;
67 Msp::GL::Lighting lighting;
72 Manipulator manipulator;
74 CameraController camera_ctl;
77 Msp::Time::TimeStamp last_tick;
79 static Msp::Application::RegApp<Designer> reg;
82 Designer(int, char **);
89 const R2C2::Catalogue &get_catalogue() const { return catalogue; }
90 R2C2::Layout &get_layout() { return *layout; }
91 R2C2::Layout3D &get_layout_3d() { return *layout_3d; }
92 const CameraController &get_camera_controller() const { return camera_ctl; }
93 const Msp::GLtk::Resources &get_ui_resources() const { return ui_res; }
94 Msp::GLtk::Root &get_root() { return root; }
98 void track_properties();
100 void connect_tracks();
101 void flatten_tracks();
105 void edit_route(R2C2::Route *);
106 R2C2::Route *get_current_route() const { return cur_route; }
107 void add_selection_to_route();
109 R2C2::Point map_pointer_to_ground(int, int);
112 void key_press(unsigned, unsigned, wchar_t);
113 void button_press(int, int, unsigned, unsigned);
114 void pointer_motion(int, int);
117 void track_added(R2C2::Track &);
118 void track_removed(R2C2::Track &);
119 R2C2::Track3D *pick_track(int, int);
120 void update_track_icon(R2C2::Track3D &);
121 void selection_changed();
122 void manipulation_status(const std::string &);
123 void manipulation_done(bool);
124 void measure_changed();
126 void arrange_toolbars();
127 void track_properties_response(int);
128 void route_name_accept(const std::string &);
129 void svg_export_accept(const std::string &);
130 std::string tooltip(int, int);
131 void show_route(const R2C2::Route *);