]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/trackpart.h
de449b3a59e05e5d4c6c873b9ff8400a3db66396
[r2c2.git] / source / libmarklin / trackpart.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef MARKLIN_TRACKPART_H_
9 #define MARKLIN_TRACKPART_H_
10
11 #include <msp/datafile/loader.h>
12 #include "endpoint.h"
13 #include "geometry.h"
14
15 namespace Marklin {
16
17 struct TrackPart
18 {
19         class Loader: public Msp::DataFile::BasicLoader<TrackPart>
20         {
21         public:
22                 Loader(TrackPart &);
23         private:
24                 virtual void finish();
25                 void start(float, float, float);
26         };
27
28         Point    pos;
29         float    dir;
30         float    length;
31         float    radius;
32         unsigned route;
33         bool     dead_end;
34
35         TrackPart();
36
37         void collect_endpoints(std::vector<Endpoint> &) const;
38         Point get_point(float) const;
39 };
40
41 } // namespace Marklin
42
43 #endif