aboutsummaryrefslogtreecommitdiffstats
path: root/ui.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui.hpp')
-rw-r--r--ui.hpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/ui.hpp b/ui.hpp
index 552dfa2..8496b58 100644
--- a/ui.hpp
+++ b/ui.hpp
@@ -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
};
@@ -28,8 +26,8 @@ class UI {
hilare_a_param *_param;
problem _p;
-
solution _s;
+ solver _solver;
struct {
double x0, y0, zoom;
@@ -40,14 +38,22 @@ 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_pos(const hilare_a &pos, sf::Color c);
void render_obstacle(const obstacle &o);
- void render_mvt(const hilare_a_mvt &m);
+ void render_mvt(const hilare_a_mvt &m, sf::Color c);
+ void render_sol(const solution &s, sf::Color c);
void render_problem();
void render_solution();
@@ -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();
};