1 #ifndef LIBR2C2_VEHICLETYPE_H_
2 #define LIBR2C2_VEHICLETYPE_H_
4 #include <msp/datafile/objectloader.h>
5 #include "articlenumber.h"
13 class Loader: public Msp::DataFile::ObjectLoader<VehicleType>
16 std::map<std::string, unsigned> rod_tags;
19 Loader(VehicleType &);
23 void function(unsigned, const std::string &);
32 class Loader: public Msp::DataFile::ObjectLoader<Axle>
38 void wheel_diameter(float);
49 typedef std::vector<Axle> AxleArray;
53 class Loader: public Msp::DataFile::ObjectLoader<Bogie>
70 typedef std::vector<Bogie> BogieArray;
89 class Loader: public Msp::DataFile::ObjectLoader<Rod>
92 const std::map<std::string, unsigned> &tags;
96 Loader(Rod &, const std::map<std::string, unsigned> &);
97 const std::string &get_tag() const { return tag; }
99 void connect(const std::string &, float, float, float, float);
102 void pivot_axle(unsigned);
103 void pivot_bogie_axle(unsigned, unsigned);
104 void pivot_rod(const std::string &);
105 void position(float, float, float);
106 void set_tag(const std::string &);
110 unsigned pivot_index;
111 unsigned pivot_index2;
115 Vector connect_point;
116 Vector connect_offset;
123 typedef std::vector<Rod> RodArray;
125 typedef std::map<unsigned, std::string> FunctionMap;
128 ArticleNumber art_nr;
131 FunctionMap functions;
142 VehicleType(const ArticleNumber &);
144 const ArticleNumber &get_article_number() const { return art_nr; }
145 const std::string &get_name() const { return name; }
146 bool is_locomotive() const { return locomotive; }
147 unsigned get_max_function() const;
148 const FunctionMap &get_functions() const { return functions; }
149 bool get_swap_direction() const { return swap_direction; }
150 float get_length() const { return length; }
151 float get_width() const { return width; }
152 float get_height() const { return height; }
153 const AxleArray &get_fixed_axles() const { return axles; }
154 const Axle &get_fixed_axle(unsigned) const;
155 const BogieArray &get_bogies() const { return bogies; }
156 const Bogie &get_bogie(unsigned) const;
157 const Axle &get_bogie_axle(unsigned, unsigned) const;
158 const RodArray &get_rods() const { return rods; }
159 const Rod &get_rod(unsigned) const;
160 float get_front_axle_offset() const;
161 float get_back_axle_offset() const;
162 const std::string &get_object() const { return object; }