5 #include <msp/core/application.h>
6 #include <msp/graphics/simplewindow.h>
7 #include <msp/gl/camera.h>
8 #include <msp/gl/font.h>
9 #include <msp/gl/light.h>
10 #include <msp/gl/lighting.h>
11 #include <msp/gl/object.h>
12 #include <msp/gl/pipeline.h>
13 #include <msp/gltk/label.h>
14 #include <msp/gltk/layout.h>
15 #include <msp/gltk/resources.h>
16 #include <msp/gltk/root.h>
17 #include <msp/time/timestamp.h>
18 #include "libr2c2/catalogue.h"
19 #include "libr2c2/layout.h"
20 #include "3d/layout.h"
21 #include "3d/overlay.h"
24 #include "cameracontroller.h"
25 #include "manipulator.h"
27 #include "selection.h"
28 #include "selectionwrap.h"
32 class Designer: public Msp::RegisteredApplication<Designer>
44 Msp::Graphics::SimpleGLWindow window;
45 Msp::Input::Keyboard keyboard;
46 Msp::Input::Mouse mouse;
47 Msp::GLtk::Resources ui_res;
49 Msp::GLtk::Layout *root_layout;
51 std::vector<Toolbar *> toolbars;
52 Msp::GLtk::Label *lbl_status;
54 R2C2::Catalogue catalogue;
55 R2C2::Layout3D *cat_layout_3d;
56 R2C2::View3D *cat_view;
60 R2C2::Layout3D *layout_3d;
61 R2C2::View3D *main_view;
62 R2C2::Overlay3D *overlay;
63 Msp::GL::Object *base_object;
64 R2C2::Route *cur_route;
66 std::list<R2C2::Track *> new_tracks;
70 SelectionWrap sel_wrap;
71 Manipulator manipulator;
73 CameraController *camera_ctl;
75 Msp::Time::TimeStamp last_tick;
78 Designer(int, char **);
85 const R2C2::Catalogue &get_catalogue() const { return catalogue; }
86 R2C2::Layout &get_layout() { return *layout; }
87 R2C2::Layout3D &get_layout_3d() { return *layout_3d; }
88 const CameraController &get_camera_controller() const { return *camera_ctl; }
92 void track_properties();
94 void connect_tracks();
95 void flatten_tracks();
98 void edit_route(R2C2::Route *);
100 R2C2::Route *get_current_route() const { return cur_route; }
101 void add_selection_to_route();
103 void edit_zone(R2C2::Zone *);
104 void zone_properties();
105 R2C2::Zone *get_current_zone() const { return cur_zone; }
106 void add_selection_to_zone();
108 R2C2::Vector map_pointer_to_ground(const R2C2::Vector &);
111 void key_press(unsigned);
112 void button_press(unsigned);
113 void axis_motion(unsigned, float, float);
116 void object_added(R2C2::Object &);
117 void object_removed(R2C2::Object &);
118 R2C2::Object *pick_object(const R2C2::Vector &);
119 void update_track_icon(R2C2::Track3D &);
120 void selection_changed();
121 void manipulation_status(const std::string &);
122 void manipulation_done(bool);
123 void measure_changed();
125 void track_properties_response(int);
126 void route_name_accept(const std::string &);
127 void svg_export_accept(const std::string &);
128 std::string tooltip(int, int);
130 void show_route(const R2C2::Route &);
131 void show_zone(const R2C2::Zone &);