X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fmeasure.h;h=c5696984fc32aba12b20ca37cfae8103efddff65;hb=64d23de66c33d0f77454c3db2e40cccc18f7851b;hp=6800ecce307826fa0bcc46d204e0ec84b539b4b4;hpb=1ff06c5bc46a677fa389ef86c6b26664368f1653;p=r2c2.git diff --git a/source/designer/measure.h b/source/designer/measure.h index 6800ecc..c569698 100644 --- a/source/designer/measure.h +++ b/source/designer/measure.h @@ -1,18 +1,13 @@ -/* $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 +#include +#include "libr2c2/geometry.h" class Designer; -class Measure +class Measure: public Msp::GL::Renderable { private: enum State @@ -28,25 +23,26 @@ public: private: Designer &designer; - R2C2::Point pointer; - R2C2::Point spoint; - float sdir; + R2C2::Vector pointer; + 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::Point &, float &); + void update_mesh(); + void snap_to_tracks(R2C2::Snap &); }; #endif