]> git.tdb.fi Git - r2c2.git/blob - source/engineer/trainview.h
598b43fab9209bb520228bd886d9961e9f8e5b34
[r2c2.git] / source / engineer / trainview.h
1 #ifndef TRAINVIEW_H_
2 #define TRAINVIEW_H_
3
4 #include <msp/gl/renderbuffer.h>
5 #include <msp/gl/framebuffer.h>
6 #include <msp/gl/texture2d.h>
7 #include <msp/gltk/dialog.h>
8 #include <msp/gltk/toggle.h>
9 #include "libr2c2/train.h"
10
11 class Engineer;
12
13 class TrainView: public Msp::GLtk::Dialog
14 {
15 public:
16         enum Mode
17         {
18                 ROOF,
19                 SIDE,
20                 HEAD
21         };
22
23 private:
24         Engineer &engineer;
25         const R2C2::Train &train;
26         Msp::GLtk::Toggle *tgl_forward;
27         Mode mode;
28         bool forward;
29         Msp::GL::Framebuffer fbo;
30         Msp::GL::Texture2D tex;
31         Msp::GL::Renderbuffer depth;
32         R2C2::View3D view;
33
34 public:
35         TrainView(Engineer &, const R2C2::Train &);
36         ~TrainView();
37
38         void set_mode(Mode);
39 private:
40         void ui_mode_toggled(bool, Mode);
41 public:
42         void set_forward(bool);
43         void prepare();
44 };
45
46 #endif