]> git.tdb.fi Git - r2c2.git/blob - source/3d/catalogue.h
1f33ebb808e7aec3a7af34bc042dd757ec118431
[r2c2.git] / source / 3d / catalogue.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 MARKLIN3D_CATALOGUE_H_
9 #define MARKLIN3D_CATALOGUE_H_
10
11 #include <msp/gl/material.h>
12 #include <msp/gl/mesh.h>
13 #include "libmarklin/catalogue.h"
14
15 namespace Marklin {
16
17 class TrackType3D;
18 class VehicleType3D;
19
20 class Catalogue3D
21 {
22 private:
23         Catalogue &catalogue;
24         std::map<const TrackType *, TrackType3D *> tracks;
25         std::map<const VehicleType *, VehicleType3D *> vehicles;
26         Msp::GL::Material ballast_material;
27         Msp::GL::Material rail_material;
28         Msp::GL::Mesh endpoint_mesh;
29
30 public:
31         Catalogue3D(Catalogue &);
32         ~Catalogue3D();
33
34         const Catalogue &get_catalogue() const { return catalogue; }
35         const TrackType3D &get_track(const TrackType &) const;
36         const VehicleType3D &get_vehicle(const VehicleType &) const;
37         const Msp::GL::Material &get_ballast_material() const { return ballast_material; }
38         const Msp::GL::Material &get_rail_material() const { return rail_material; }
39         const Msp::GL::Mesh &get_endpoint_mesh() const { return endpoint_mesh; }
40 private:
41         void track_added(const TrackType &);
42         void vehicle_added(const VehicleType &);
43         void build_endpoint_mesh();
44 };
45
46 }
47
48 #endif