]> git.tdb.fi Git - r2c2.git/blob - source/designer/measure.h
Provide some telemetry values from ArduControl
[r2c2.git] / source / designer / measure.h
1 #ifndef MEASURE_H_
2 #define MEASURE_H_
3
4 #include <sigc++/sigc++.h>
5 #include <msp/gl/renderable.h>
6 #include "libr2c2/geometry.h"
7 #include "tool.h"
8
9 class Designer;
10
11 class Measure: public Tool, public Msp::GL::Renderable
12 {
13 private:
14         R2C2::Snap start;
15         bool start_pinned;
16         float par_dist;
17         float perp_dist;
18         R2C2::Angle adiff;
19         Msp::GL::Mesh mesh;
20
21 public:
22         Measure(Designer &, Msp::Input::Keyboard &, Msp::Input::Mouse &);
23         virtual ~Measure();
24
25         float get_parallel_distance() const { return par_dist; }
26         float get_perpendicular_distance() const { return perp_dist; }
27         const R2C2::Angle &get_angle_difference() const { return adiff; }
28
29 private:
30         void back();
31         virtual void key_press(unsigned);
32         virtual void button_press(unsigned);
33         virtual void pointer_motion();
34
35 public:
36         virtual void render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
37 private:
38         void update_mesh();
39         void snap_to_tracks(R2C2::Snap &);
40 };
41
42 #endif