X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fmeasure.cpp;h=442558d7c9205174b022d76612153935fe84f46a;hb=621c5c938d70ba0d155e0eda91a708db0a52c0dc;hp=cbe17938dd3debe1fa28f367c86175329b956130;hpb=38fb8d56efde037a71c46a58bda314655e68ab6c;p=r2c2.git diff --git a/source/designer/measure.cpp b/source/designer/measure.cpp index cbe1793..442558d 100644 --- a/source/designer/measure.cpp +++ b/source/designer/measure.cpp @@ -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 #include #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 <racks = designer.get_layout()->get_tracks(); + const set <racks = designer.get_layout().get_tracks(); for(set::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);