diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-01 16:50:09 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-01 16:50:09 +0100 |
commit | 74dba84f9197a3b65b194d8a3dc53bf086d9f072 (patch) | |
tree | b0956f6e166b6cef9c717403a7564418c32afe19 /ui.hpp | |
parent | d6cef8b0585dcadd7a4c6c5811e127fce8436ec3 (diff) | |
download | Robotique-Projet-74dba84f9197a3b65b194d8a3dc53bf086d9f072.tar.gz Robotique-Projet-74dba84f9197a3b65b194d8a3dc53bf086d9f072.zip |
Basic interface : can add obstacles ; set begin/end position, ...
Diffstat (limited to 'ui.hpp')
-rw-r--r-- | ui.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -10,7 +10,6 @@ enum { M_NORMAL, M_INS_OBSTACLE, - M_DEL_OBSTACLE, M_SEL_BEGIN, M_SEL_END }; @@ -19,7 +18,6 @@ enum { S_XY, S_THETA, S_PHI, - S_CENTER, S_RADIUS }; @@ -40,11 +38,19 @@ class UI { // interaction mode int _mode, _sel_step; + hilare_a _sel_pos; + circle _sel_obs; public: UI(hilare_a_param *p); + void handle_normal(const sf::Event &ev); + void handle_ins_obs(const sf::Event &ev); + void handle_sel_pos(const sf::Event &ev); + void render_circle(const circle& c, sf::Color border, sf::Color inside, int linewidth); + void render_seg(vec a, vec b, sf::Color l, int w); + void render_pos(const hilare_a &pos, sf::Color c); void render_obstacle(const obstacle &o); void render_mvt(const hilare_a_mvt &m); @@ -55,6 +61,8 @@ class UI { sf::Vector2f to_view(const vec &p); vec from_view(const sf::Vector2f &p); + vec from_view(const sf::Vector2i &p); + vec mouse_coord(); void run(); }; |