#include <msp/gbase/window.h>
#include <msp/gbase/glcontext.h>
#include <msp/gl/font.h>
+#include <msp/gl/mesh.h>
+#include <msp/gltk/label.h>
+#include <msp/gltk/resources.h>
+#include <msp/gltk/root.h>
#include <msp/time/timestamp.h>
#include "libmarklin/catalogue.h"
#include "libmarklin/layout.h"
class Manipulator;
class Measure;
class Selection;
+class Toolbar;
class Designer: public Msp::Application
{
Msp::Graphics::Display *dpy;
Msp::Graphics::Window *wnd;
Msp::Graphics::GLContext *glc;
- unsigned screen_w;
- unsigned screen_h;
- Msp::GL::Font *font;
+ unsigned screen_w;
+ unsigned screen_h;
+ Msp::GLtk::Resources ui_res;
+ Msp::GLtk::Root *root;
+
+ Toolbar *toolbar;
+ Msp::GLtk::Label *lbl_tooltip;
+ Msp::Time::TimeStamp tooltip_timeout;
+
Marklin::Catalogue catalogue;
- Marklin::Layout *layout;
- Marklin::Layout3D *layout_3d;
- Marklin::Layout *cat_layout;
- Marklin::Layout3D *cat_layout_3d;
- Selection *selection;
- Manipulator *manipulator;
- Measure *measure;
- Input *input;
- Mode mode;
- float cam_yaw;
- float cam_pitch;
+ Marklin::Layout *cat_layout;
+ Marklin::Layout3D *cat_layout_3d;
+ std::string filename;
+ Marklin::Layout *layout;
+ Marklin::Layout3D *layout_3d;
+ Msp::GL::Mesh *base_mesh;
+ Marklin::Route *cur_route;
+
+ Mode mode;
+ Selection *selection;
+ Manipulator *manipulator;
+ Measure *measure;
+ Input *input;
+
+ float cam_yaw;
+ float cam_pitch;
Marklin::Point cam_pos;
- bool shift;
- int move_x;
- int move_y;
- int zoom;
- int rotate;
- int pitch;
- int pointer_x;
- int pointer_y;
- int tooltip_x;
- int tooltip_y;
- std::string tooltip;
- Msp::Time::TimeStamp tooltip_timeout;
+
+ bool shift;
+ int move_x;
+ int move_y;
+ int zoom;
+ int rotate;
+ int pitch;
+ int pointer_x;
+ int pointer_y;
+
Msp::Time::TimeStamp last_tick;
+ static Msp::Application::RegApp<Designer> reg;
+
public:
Designer(int, char **);
~Designer();
+ int main();
+ void save();
+ void quit();
+
Marklin::Layout *get_layout() { return layout; }
Marklin::Layout3D *get_layout_3d() { return layout_3d; }
- Msp::GL::Font &get_font() { return *font; }
- int main();
- void map_pointer_coords(int, int, float &, float &);
+ const Msp::GLtk::Resources &get_ui_resources() const { return ui_res; }
+ Msp::GLtk::Root &get_root() const { return *root; }
+ void edit_route(Marklin::Route &);
+ Marklin::Route *get_current_route() const { return cur_route; }
+ void add_selection_to_route();
+
+ void map_pointer_coords(int, int, float &, float &);
private:
void tick();
void key_press(unsigned, unsigned, wchar_t);
void apply_camera();
void render();
Marklin::Track3D *pick_track(int, int);
+ void update_track_color(Marklin::Track3D &);
void manipulation_status(const std::string &);
void manipulation_done(bool);
void measure_changed();
void measure_done();
- void move_tooltip(int, int);
+ void set_tooltip(int, int, const std::string &);
+ void clear_tooltip();
void save_accept();
void turnout_id_accept();
void sensor_id_accept();
void input_dismiss();
-
- static Msp::Application::RegApp<Designer> reg;
};
#endif