1 #ifndef LIBR2C2_VEHICLEPLACEMENT_H_
2 #define LIBR2C2_VEHICLEPLACEMENT_H_
5 #include "trackoffsetiter.h"
6 #include "vehicletype.h"
10 class VehiclePlacement
25 const VehicleType::Axle *type;
26 TrackOffsetIter position;
28 Axle(const VehicleType::Axle &);
31 const VehicleType &type;
32 std::vector<Axle> axles;
33 float front_back_span;
34 float front_back_ratio;
37 VehiclePlacement(const VehicleType &);
39 void place(const TrackOffsetIter &, Anchor = CENTER);
41 float get_anchor_position(Anchor) const;
43 void place_after(const VehiclePlacement &);
44 void place_before(const VehiclePlacement &);
46 bool is_placed() const;
48 OrientedPoint get_point() const;
49 const TrackOffsetIter &get_axle_position(unsigned) const;
50 TrackOffsetIter get_position(Anchor) const;
51 OrientedPoint get_axle_point(unsigned) const;
52 OrientedPoint get_bogie_point(unsigned) const;
54 OrientedPoint get_front_point() const;
55 OrientedPoint get_back_point() const;
56 OrientedPoint get_bogie_point_from_axle(unsigned) const;
57 static OrientedPoint create_point(const Vector &, const Vector &, float);
60 void advance(float, Anchor = CENTER);
62 void fix_positions(float);
63 void fix_bogie_position(unsigned);
64 static float compute_adjustment(const Vector &, const Vector &, float, float &);