3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
8 #ifndef LIBMARKLIN_TRACKTYPE_H_
9 #define LIBMARKLIN_TRACKTYPE_H_
11 #include <msp/datafile/loader.h>
13 #include "trackpart.h"
23 float dir; // Direction outwards from the endpoint
26 Endpoint(float, float, float, unsigned);
29 class Loader: public Msp::DataFile::BasicLoader<TrackType>
34 virtual void finish();
36 void position(float, float, float);
41 std::string description;
42 std::vector<TrackPart> parts;
43 std::vector<Endpoint> endpoints;
49 unsigned get_article_number() const { return art_nr; }
50 const std::string &get_description() const { return description; }
51 float get_total_length() const;
52 float get_path_length(int) const;
53 unsigned get_paths() const;
54 unsigned get_n_paths() const;
55 bool is_turnout() const;
56 bool is_dead_end() const;
57 bool is_double_address() const { return double_address; }
58 const std::vector<TrackPart> &get_parts() const { return parts; }
59 const std::vector<Endpoint> &get_endpoints() const { return endpoints; }
60 TrackPoint get_point(unsigned, unsigned, float) const;
63 void collect_endpoints();
66 } // namespace Marklin