X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrack.h;h=df4032567a8dbe84991d53b4a09e9a43f73e910a;hb=b14059de03324aecde3efc649293d98ce5b7aaf2;hp=6747ed7f082281865a2ac31551c3978b86d9b416;hpb=247742fbc1c27bfc9fdef4630afcdc2408cdd550;p=r2c2.git diff --git a/source/libr2c2/track.h b/source/libr2c2/track.h index 6747ed7..df40325 100644 --- a/source/libr2c2/track.h +++ b/source/libr2c2/track.h @@ -1,7 +1,7 @@ /* $Id$ This file is part of R²C² -Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa +Copyright © 2006-2011 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ @@ -33,13 +33,14 @@ public: void turnout_id(unsigned); }; + sigc::signal signal_link_changed; sigc::signal signal_path_changed; private: Layout &layout; const TrackType &type; Block *block; - Point pos; + Vector pos; float rot; float slope; bool flex; @@ -59,11 +60,11 @@ public: void set_block(Block *); Block &get_block() const; - void set_position(const Point &); + void set_position(const Vector &); void set_rotation(float); void set_slope(float); void set_flex(bool); - const Point &get_position() const { return pos; } + const Vector &get_position() const { return pos; } float get_rotation() const { return rot; } float get_slope() const { return slope; } bool get_flex() const { return flex; } @@ -77,10 +78,10 @@ public: unsigned get_active_path() const { return active_path; } int get_endpoint_by_link(Track &) const; - Point get_endpoint_position(unsigned) const; + Vector get_endpoint_position(unsigned) const; float get_endpoint_direction(unsigned) const; bool snap_to(Track &, bool, float = 0); - bool snap(Point &, float &) const; + bool snap(Vector &, float &) const; void break_link(Track &); void break_links(); const std::vector &get_links() const { return links; } @@ -88,6 +89,8 @@ public: TrackPoint get_point(unsigned, unsigned, float) const; TrackPoint get_point(unsigned, float) const; + bool collide_ray(const Vector &, const Vector &); + void save(std::list &) const; private: void turnout_event(unsigned, unsigned);