]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/track.h
Add a vehicle property for swapping directions
[r2c2.git] / source / libr2c2 / track.h
index 6747ed7f082281865a2ac31551c3978b86d9b416..df4032567a8dbe84991d53b4a09e9a43f73e910a 100644 (file)
@@ -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<void, unsigned, Track *> signal_link_changed;
        sigc::signal<void, unsigned> 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<Track *> &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<Msp::DataFile::Statement> &) const;
 private:
        void turnout_event(unsigned, unsigned);