]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/measure.cpp
Use GL::Renderer in TrackWrap
[r2c2.git] / source / designer / measure.cpp
index cbe17938dd3debe1fa28f367c86175329b956130..442558d7c9205174b022d76612153935fe84f46a 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of the MSP Märklin suite
-Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
 #include <cmath>
 #include <GL/gl.h>
 #include "designer.h"
@@ -12,7 +5,7 @@ Distributed under the GPL
 #include "measure.h"
 
 using namespace std;
-using namespace Marklin;
+using namespace R2C2;
 using namespace Msp;
 
 Measure::Measure(Designer &d):
@@ -25,9 +18,9 @@ void Measure::start()
        state = STARTING;
 }
 
-void Measure::snap_to_tracks(Point &pt, float &dir)
+void Measure::snap_to_tracks(Vector &pt, float &dir)
 {
-       const set<Track *> &ltracks = designer.get_layout()->get_tracks();
+       const set<Track *> &ltracks = designer.get_layout().get_tracks();
        for(set<Track *>::const_iterator i=ltracks.begin(); i!=ltracks.end(); ++i)
                if((*i)->snap(pt, dir))
                        return;
@@ -40,7 +33,7 @@ void Measure::button_press(int, int, float gx, float gy, unsigned btn)
 
        if(btn==1)
        {
-               spoint = Point(gx, gy, 0);
+               spoint = Vector(gx, gy, 0);
                sdir = 0;
                snap_to_tracks(spoint, sdir);
 
@@ -63,13 +56,13 @@ void Measure::pointer_motion(int, int, float gx, float gy)
        if(!state)
                return;
 
-       pointer = Point(gx, gy, 0);
+       pointer = Vector(gx, gy, 0);
        float dir = sdir;
        snap_to_tracks(pointer, dir);
 
        if(state!=STARTING)
        {
-               Point delta(pointer.x-spoint.x, pointer.y-spoint.y, 0);
+               Vector delta(pointer.x-spoint.x, pointer.y-spoint.y, 0);
                float c = cos(sdir);
                float s = sin(sdir);