]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/measure.h
Separate train routing logic to a class derived from TrainAI
[r2c2.git] / source / designer / measure.h
index fc675a6b9a859fed36250140b0715e284f6e093b..84b1c832ea21a646052b05c432e07cdeb0c3da5f 100644 (file)
@@ -1,18 +1,12 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
 #ifndef MEASURE_H_
 #define MEASURE_H_
 
 #include <sigc++/sigc++.h>
+#include <msp/gl/renderable.h>
 
 class Designer;
 
-class Measure
+class Measure: public Msp::GL::Renderable
 {
 private:
        enum State
@@ -35,6 +29,7 @@ private:
        float perp_dist;
        float adiff;
        State state;
+       Msp::GL::Mesh mesh;
 
 public:
        Measure(Designer &);
@@ -42,10 +37,11 @@ public:
        float get_perpendicular_distance() const { return perp_dist; }
        float 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 update_mesh();
        void snap_to_tracks(R2C2::Vector &, float &);
 };