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;
45 unsigned autofit_preference;
50 unsigned get_article_number() const { return art_nr; }
51 const std::string &get_description() const { return description; }
52 float get_total_length() const;
53 float get_path_length(int) const;
54 unsigned get_paths() const;
55 unsigned get_n_paths() const;
56 bool is_turnout() const;
57 bool is_dead_end() const;
58 bool is_double_address() const { return double_address; }
59 unsigned get_autofit_preference() const { return autofit_preference; }
60 const std::vector<TrackPart> &get_parts() const { return parts; }
61 const std::vector<Endpoint> &get_endpoints() const { return endpoints; }
62 TrackPoint get_point(unsigned, unsigned, float) const;
65 void collect_endpoints();
68 } // namespace Marklin