]> git.tdb.fi Git - r2c2.git/blob - source/3d/track.h
Make use of the geometry part of libmspmath
[r2c2.git] / source / 3d / track.h
1 #ifndef R2C2_3D_TRACK_H_
2 #define R2C2_3D_TRACK_H_
3
4 #include <list>
5 #include <sigc++/trackable.h>
6 #include <msp/gl/matrix.h>
7 #include <msp/gl/objectinstance.h>
8 #include "libr2c2/track.h"
9 #include "libr2c2/trackpart.h"
10 #include "object.h"
11
12 namespace R2C2 {
13
14 class Endpoint3D;
15 class Layout3D;
16 class Path3D;
17 class TrackType3D;
18
19 class Track3D: public Object3D, public Msp::GL::ObjectInstance, public sigc::trackable
20 {
21 private:
22         Layout3D &layout;
23         Track &track;
24         const TrackType3D &type;
25         std::vector<Endpoint3D *> endpoints;
26         Path3D *path;
27
28 public:
29         Track3D(Layout3D &, Track &);
30         ~Track3D();
31
32         Layout3D &get_layout() const { return layout; }
33         Track &get_track() const { return track; }
34         const TrackType3D &get_type() const { return type; }
35         Path3D &get_path() { return *path; }
36
37         virtual Vector get_node() const;
38         virtual bool is_visible() const { return true; }
39
40         Msp::GL::Matrix create_matrix() const;
41         virtual void setup_render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
42 private:
43         void link_changed(unsigned, Track *);
44 };
45
46 } // namespace R2C2
47
48 #endif