]> git.tdb.fi Git - r2c2.git/blob - source/designer/trackwrap.h
09bacda3e7f8be18ba9dd43ffa802b93b2c89255
[r2c2.git] / source / designer / trackwrap.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 TRACKWRAP_H_
9 #define TRACKWRAP_H_
10
11 #include <msp/gl/mesh.h>
12 #include <msp/gl/renderable.h>
13 #include "libmarklin/track.h"
14
15 class Designer;
16 class Selection;
17
18 class TrackWrap: public Msp::GL::Renderable
19 {
20 private:
21         struct Wrap
22         {
23                 Marklin::Track *track;
24                 Msp::GL::Mesh *mesh;
25         };
26
27         Designer &designer;
28         Selection &selection;
29         std::map<const Marklin::TrackType *, Msp::GL::Mesh *> meshes;
30         std::list<Wrap> wraps;
31
32 public:
33         TrackWrap(Designer &, Selection &);
34
35         virtual void render(const Msp::GL::Tag &) const;
36
37 private:
38         void selection_changed();
39         Msp::GL::Mesh &get_mesh(const Marklin::TrackType &);
40 };
41
42 #endif