]> git.tdb.fi Git - r2c2.git/blob - source/3d/layout.h
Use GL::Renderables and a Pipeline for rendering
[r2c2.git] / source / 3d / layout.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef MARKLIN3D_LAYOUT_H_
9 #define MARKLIN3D_LAYOUT_H_
10
11 #include <msp/gl/scene.h>
12 #include "libmarklin/layout.h"
13 #include "catalogue.h"
14 #include "track.h"
15
16 namespace Marklin {
17
18 class Layout3D
19 {
20 private:
21         Layout &layout;
22         Catalogue3D catalogue;
23         std::list<Track3D *> tracks;
24         Msp::GL::Scene scene;
25         Msp::GL::Scene ep_scene;
26         unsigned quality;
27
28 public:
29         Layout3D(Layout &);
30         ~Layout3D();
31
32         const Catalogue3D &get_catalogue() const { return catalogue; }
33         void set_quality(unsigned);
34
35         void add_track(Track3D &);
36         void remove_track(Track3D &);
37         const std::list<Track3D *> &get_tracks() const { return tracks; }
38         Track3D &get_track(const Track &) const;
39         Track3D *pick_track(float, float, float) const;
40
41         Msp::GL::Scene &get_scene() { return scene; }
42         Msp::GL::Scene &get_endpoint_scene() { return ep_scene; }
43
44 private:
45         void track_added(Track &);
46         void track_removed(Track &);
47 };
48
49 } // namespace Marklin
50
51 #endif
52