X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fmeasure.h;h=84b1c832ea21a646052b05c432e07cdeb0c3da5f;hb=d0af7846e05691d65d8021e46c8f81e8ca05199a;hp=f68178dcacaf2b2368a641c53d1fb0fd5426420a;hpb=449fb5de95ddb2ac9da4bd72a1c12150505d5549;p=r2c2.git diff --git a/source/designer/measure.h b/source/designer/measure.h index f68178d..84b1c83 100644 --- a/source/designer/measure.h +++ b/source/designer/measure.h @@ -1,18 +1,12 @@ -/* $Id$ - -This file is part of the MSP Märklin suite -Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #ifndef MEASURE_H_ #define MEASURE_H_ #include +#include class Designer; -class Measure +class Measure: public Msp::GL::Renderable { private: enum State @@ -28,13 +22,14 @@ public: private: Designer &designer; - Marklin::Point pointer; - Marklin::Point spoint; + R2C2::Vector pointer; + R2C2::Vector spoint; float sdir; float par_dist; float perp_dist; float adiff; State state; + Msp::GL::Mesh mesh; public: Measure(Designer &); @@ -42,11 +37,12 @@ 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 snap_to_tracks(Marklin::Point &, float &); + void update_mesh(); + void snap_to_tracks(R2C2::Vector &, float &); }; #endif