]> git.tdb.fi Git - r2c2.git/blob - source/3d/vehicletype.h
Plug memory leaks
[r2c2.git] / source / 3d / vehicletype.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2010  Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef LIBMARKLIN3D_VEHICLETYPE_H_
9 #define LIBMARKLIN3D_VEHICLETYPE_H_
10
11 #include <msp/gl/mesh.h>
12 #include <msp/gl/object.h>
13 #include "libmarklin/vehicletype.h"
14
15 namespace Marklin {
16
17 class Catalogue3D;
18
19 class VehicleType3D
20 {
21 private:
22         std::map<std::string, Msp::GL::Object *> objects;
23         Msp::GL::Object *body_object;
24         std::vector<Msp::GL::Object *> bogie_objects;
25
26 public:
27         VehicleType3D(Catalogue3D &, const VehicleType &);
28         ~VehicleType3D();
29
30         const Msp::GL::Object *get_body_object() const { return body_object; }
31         const Msp::GL::Object *get_axle_object(unsigned) const;
32         const Msp::GL::Object *get_bogie_object(unsigned) const;
33         const Msp::GL::Object *get_bogie_axle_object(unsigned, unsigned) const;
34 private:
35         Msp::GL::Object *get_object(const std::string &);
36 };
37
38 } // namespace Marklin
39
40 #endif