3 This file is part of R²C²
4 Copyright © 2006-2011 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"
30 #include "cameracontroller.h"
31 #include "manipulator.h"
33 #include "selection.h"
34 #include "trackwrap.h"
38 class Designer: public Msp::Application
50 Msp::Graphics::SimpleGLWindow window;
51 Msp::GLtk::Resources ui_res;
54 std::vector<Toolbar *> toolbars;
55 Msp::GLtk::Label *lbl_status;
57 R2C2::Catalogue catalogue;
58 R2C2::Layout3D *cat_layout_3d;
59 R2C2::View3D *cat_view;
63 R2C2::Layout3D *layout_3d;
64 R2C2::View3D *main_view;
65 R2C2::Overlay3D *overlay;
66 Msp::GL::Object *base_object;
67 R2C2::Route *cur_route;
69 std::list<R2C2::Track *> new_tracks;
73 Manipulator manipulator;
75 CameraController *camera_ctl;
76 TrackWrap *track_wrap;
78 Msp::Time::TimeStamp last_tick;
80 static Msp::Application::RegApp<Designer> reg;
83 Designer(int, char **);
90 const R2C2::Catalogue &get_catalogue() const { return catalogue; }
91 R2C2::Layout &get_layout() { return *layout; }
92 R2C2::Layout3D &get_layout_3d() { return *layout_3d; }
93 const CameraController &get_camera_controller() const { return *camera_ctl; }
94 const Msp::GLtk::Resources &get_ui_resources() const { return ui_res; }
95 Msp::GLtk::Root &get_root() { return root; }
99 void track_properties();
101 void connect_tracks();
102 void flatten_tracks();
105 void edit_route(R2C2::Route *);
107 R2C2::Route *get_current_route() const { return cur_route; }
108 void add_selection_to_route();
110 void edit_zone(R2C2::Zone *);
111 void zone_properties();
112 R2C2::Zone *get_current_zone() const { return cur_zone; }
113 void add_selection_to_zone();
115 R2C2::Vector map_pointer_to_ground(int, int);
118 void key_press(unsigned, unsigned, wchar_t);
119 void button_press(int, int, unsigned, unsigned);
120 void pointer_motion(int, int);
123 void track_added(R2C2::Track &);
124 void track_removed(R2C2::Track &);
125 R2C2::Track *pick_track(int, int);
126 void update_track_icon(R2C2::Track3D &);
127 void selection_changed();
128 void manipulation_status(const std::string &);
129 void manipulation_done(bool);
130 void measure_changed();
132 void arrange_toolbars();
133 void track_properties_response(int);
134 void route_name_accept(const std::string &);
135 void svg_export_accept(const std::string &);
136 std::string tooltip(int, int);
138 void show_route(const R2C2::Route &);
139 void show_zone(const R2C2::Zone &);