X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fdesigner%2Fmeasure.cpp;h=e5e5abb542c3a434a96795df13e8c7f6e1571c01;hb=f8a7788cee0261babfc4c804a58515aad6dfbc3d;hp=cbe17938dd3debe1fa28f367c86175329b956130;hpb=38fb8d56efde037a71c46a58bda314655e68ab6c;p=r2c2.git diff --git a/source/designer/measure.cpp b/source/designer/measure.cpp index cbe1793..e5e5abb 100644 --- a/source/designer/measure.cpp +++ b/source/designer/measure.cpp @@ -1,6 +1,6 @@ /* $Id$ -This file is part of the MSP Märklin suite +This file is part of R²C² Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ @@ -12,7 +12,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 +25,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 +40,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 +63,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);