]> git.tdb.fi Git - r2c2.git/blob - source/3d/object.h
Don't crash if a train has no router
[r2c2.git] / source / 3d / object.h
1 #ifndef R2C2_3D_OBJECT_H_
2 #define R2C2_3D_OBJECT_H_
3
4 #include <sigc++/trackable.h>
5 #include <msp/gl/matrix.h>
6 #include "libr2c2/geometry.h"
7 #include "libr2c2/object.h"
8
9 namespace R2C2 {
10
11 class Layout3D;
12
13 class Object3D: public sigc::trackable
14 {
15 protected:
16         Layout3D &layout;
17         Object &object;
18         Msp::GL::Matrix matrix;
19
20         Object3D(Layout3D &, Object &);
21 public:
22         virtual ~Object3D();
23
24         Layout3D &get_layout() const { return layout; }
25         Object &get_object() const { return object; }
26
27         const Msp::GL::Matrix &get_matrix() const { return matrix; }
28         virtual Vector get_node() const = 0;
29         virtual bool is_visible() const = 0;
30 protected:
31         virtual void moved();
32 };
33
34 } // namespace R2C2
35
36 #endif