]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/track.h
Add TrackIter and BlockIter classes
[r2c2.git] / source / libmarklin / track.h
index c1c95810f1d4d3dac8f0ab666cb41cc2b323775d..eaf8de217c8c267bf7e2d831da8002aab4a5c878 100644 (file)
@@ -16,6 +16,7 @@ Distributed under the GPL
 
 namespace Marklin {
 
+class Block;
 class Layout;
 class TrackType;
 
@@ -35,6 +36,7 @@ public:
 private:
        Layout &layout;
        const TrackType &type;
+       Block *block;
        Point pos;
        float rot;
        float slope;
@@ -50,8 +52,11 @@ public:
        Track(Layout &, const TrackType &);
        ~Track();
 
+       Layout &get_layout() const { return layout; }
        const TrackType &get_type() const { return type; }
 
+       void set_block(Block *);
+       Block &get_block() const;
        void set_position(const Point &);
        void set_rotation(float);
        void set_slope(float);
@@ -69,7 +74,7 @@ public:
        void set_active_path(unsigned);
        unsigned get_active_path() const { return active_path; }
 
-       int get_endpoint_by_link(const Track &) const;
+       int get_endpoint_by_link(Track &) const;
        Point get_endpoint_position(unsigned) const;
        float get_endpoint_direction(unsigned) const;
        bool snap_to(Track &, bool);
@@ -78,8 +83,8 @@ public:
        void break_links();
        const std::vector<Track *> &get_links() const { return links; }
        Track *get_link(unsigned) const;
-       unsigned traverse(unsigned, unsigned) const;
        TrackPoint get_point(unsigned, unsigned, float) const;
+       TrackPoint get_point(unsigned, float) const;
 
        void save(std::list<Msp::DataFile::Statement> &) const;
 private: