]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/trackpart.h
Make LCD output selectable at runtime through an extra I/O pin
[r2c2.git] / source / libmarklin / trackpart.h
index 0411d72ab3ee2d649851656dea18c6efd2dcb8a7..13e0f38528c86e94046e7dc2b03d8f71857e5931 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of the MSP Märklin suite
-Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
+Copyright © 2006-2010  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -9,13 +9,13 @@ Distributed under the GPL
 #define MARKLIN_TRACKPART_H_
 
 #include <msp/datafile/loader.h>
-#include "endpoint.h"
 #include "geometry.h"
 
 namespace Marklin {
 
-struct TrackPart
+class TrackPart
 {
+public:
        class Loader: public Msp::DataFile::BasicLoader<TrackPart>
        {
        public:
@@ -25,17 +25,25 @@ struct TrackPart
                void start(float, float, float);
        };
 
+private:
        Point pos;
        float dir;
        float length;
        float radius;
        unsigned path;
        bool dead_end;
+       TrackPart *links[2];
 
+public:
        TrackPart();
 
-       void collect_endpoints(std::vector<Endpoint> &) const;
-       Point get_point(float) const;
+       float get_length() const;
+       bool is_curved() const { return radius; }
+       TrackPoint get_point(float) const;
+       unsigned get_path() const { return path; }
+       bool is_dead_end() const { return dead_end; }
+       void check_link(TrackPart &);
+       TrackPart *get_link(unsigned) const;
 };
 
 } // namespace Marklin