]> git.tdb.fi Git - r2c2.git/blob - source/3d/vehicle.h
Use generic objects in Layout3D
[r2c2.git] / source / 3d / vehicle.h
1 #ifndef LIBR2C23D_VEHICLE_H_
2 #define LIBR2C23D_VEHICLE_H_
3
4 #include <msp/gl/renderable.h>
5 #include "libr2c2/vehicle.h"
6 #include "object.h"
7
8 namespace R2C2 {
9
10 class Axle3D;
11 class Bogie3D;
12 class Rod3D;
13 class VehicleType3D;
14
15 class Vehicle3D: public Object3D, public Msp::GL::ObjectInstance
16 {
17 private:
18         Vehicle &vehicle;
19         const VehicleType3D &type;
20         std::vector<Axle3D *> axles;
21         std::vector<Bogie3D *> bogies;
22         std::vector<Rod3D *> rods;
23
24 public:
25         Vehicle3D(Layout3D &, Vehicle &);
26         ~Vehicle3D();
27
28         Vehicle &get_vehicle() const { return vehicle; }
29         const VehicleType3D &get_type() const { return type; }
30
31         virtual Vector get_node() const;
32         virtual bool is_visible() const;
33
34         virtual void render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
35         virtual void setup_render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
36 };
37
38 } // namespace R2C2
39
40 #endif