]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/measure.h
Make use of the mspmath library
[r2c2.git] / source / designer / measure.h
index 69442d823984fdcbfe7ee3e21e9ce91a1043cd62..c5696984fc32aba12b20ca37cfae8103efddff65 100644 (file)
@@ -2,10 +2,12 @@
 #define MEASURE_H_
 
 #include <sigc++/sigc++.h>
+#include <msp/gl/renderable.h>
+#include "libr2c2/geometry.h"
 
 class Designer;
 
-class Measure
+class Measure: public Msp::GL::Renderable
 {
 private:
        enum State
@@ -22,24 +24,25 @@ public:
 private:
        Designer &designer;
        R2C2::Vector pointer;
-       R2C2::Vector spoint;
-       float sdir;
+       R2C2::Snap ssnap;
        float par_dist;
        float perp_dist;
-       float adiff;
+       R2C2::Angle adiff;
        State state;
+       Msp::GL::Mesh mesh;
 
 public:
        Measure(Designer &);
        float get_parallel_distance() const { return par_dist; }
        float get_perpendicular_distance() const { return perp_dist; }
-       float get_angle_difference() const { return adiff; }
+       const R2C2::Angle &get_angle_difference() const { return adiff; }
        void start();
-       void button_press(int, int, float, float, unsigned);
-       void pointer_motion(int, int, float, float);
-       void render();
+       void button_press(float, float, unsigned);
+       void pointer_motion(float, float);
+       virtual void render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
 private:
-       void snap_to_tracks(R2C2::Vector &, float &);
+       void update_mesh();
+       void snap_to_tracks(R2C2::Snap &);
 };
 
 #endif