]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/track.h
Rename turnout/sensor_id fields in Track and Block to *_addr
[r2c2.git] / source / libr2c2 / track.h
index f169c0a92671c7ac9a458aca9a36ae327986da3b..1d8cd714bf279a50dd726abf1852bc85955585c7 100644 (file)
@@ -25,10 +25,10 @@ public:
        private:
                void position(float, float, float);
                void rotation(float);
-               void sensor_id(unsigned);
+               void sensor_address(unsigned);
                void slope(float);
                void tilt(float);
-               void turnout_id(unsigned);
+               void turnout_address(unsigned);
        };
 
        typedef std::list<TrackAttachment *> AttachmentList;
@@ -42,8 +42,8 @@ private:
        Block *block;
        float slope;
        bool flex;
-       unsigned turnout_id;
-       unsigned sensor_id;
+       unsigned turnout_addr;
+       unsigned sensor_addr;
        std::vector<Track *> links;
        unsigned active_path;
        bool path_changing;
@@ -70,13 +70,14 @@ private:
        void check_slope();
 
 public:
-       void set_turnout_id(unsigned);
-       void set_sensor_id(unsigned);
-       unsigned get_turnout_id() const { return turnout_id; }
-       unsigned get_sensor_id() const { return sensor_id; }
+       void set_turnout_address(unsigned);
+       void set_sensor_address(unsigned);
+       unsigned get_turnout_address() const { return turnout_addr; }
+       unsigned get_sensor_address() const { return sensor_addr; }
        void set_active_path(unsigned);
        unsigned get_active_path() const { return active_path; }
        bool is_path_changing() const { return path_changing; }
+       float get_path_length(int = -1) const;
 
        OrientedPoint get_point(unsigned, unsigned, float) const;
        OrientedPoint get_point(unsigned, float) const;