1 #ifndef LIBR2C2_VEHICLETYPE_H_
2 #define LIBR2C2_VEHICLETYPE_H_
4 #include <msp/datafile/objectloader.h>
6 #include "objecttype.h"
10 class VehicleType: public ObjectType
13 class Loader: public Msp::DataFile::DerivedObjectLoader<VehicleType, ObjectType::Loader>
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;
129 FunctionMap functions;
141 VehicleType(const ArticleNumber &);
143 bool is_locomotive() const { return locomotive; }
144 unsigned get_max_function() const;
145 const FunctionMap &get_functions() const { return functions; }
146 bool get_swap_direction() const { return swap_direction; }
147 float get_length() const { return length; }
148 float get_width() const { return width; }
149 float get_height() const { return height; }
150 const AxleArray &get_fixed_axles() const { return axles; }
151 const Axle &get_fixed_axle(unsigned) const;
152 const BogieArray &get_bogies() const { return bogies; }
153 const Bogie &get_bogie(unsigned) const;
154 const Axle &get_bogie_axle(unsigned, unsigned) const;
155 const RodArray &get_rods() const { return rods; }
156 const Rod &get_rod(unsigned) const;
157 float get_front_axle_offset() const;
158 float get_back_axle_offset() const;
159 const std::string &get_object() const { return object; }
160 bool get_rotate_object() const { return rotate_object; }