]> git.tdb.fi Git - r2c2.git/blob - source/3d/track.h
7b8c23565f3024ecb1c954f6839a7f3c48fd8925
[r2c2.git] / source / 3d / track.h
1 /* $Id$
2
3 This file is part of R²C²
4 Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef R2C2_3D_TRACK_H_
9 #define R2C2_3D_TRACK_H_
10
11 #include <list>
12 #include <msp/gl/renderable.h>
13 #include <msp/gl/vertexarray.h>
14 #include <msp/gl/vertexarraybuilder.h>
15 #include "libr2c2/track.h"
16 #include "libr2c2/trackpart.h"
17 #include "object.h"
18
19 namespace R2C2 {
20
21 class Endpoint3D;
22 class Layout3D;
23 class Path3D;
24 class TrackType3D;
25
26 class Track3D: public Object3D, public Msp::GL::Renderable
27 {
28 private:
29         Layout3D &layout;
30         Track &track;
31         const TrackType3D &type;
32         std::vector<Endpoint3D *> endpoints;
33         Path3D *path;
34
35 public:
36         Track3D(Layout3D &, Track &);
37         ~Track3D();
38
39         Layout3D &get_layout() const { return layout; }
40         Track &get_track() const { return track; }
41         const TrackType3D &get_type() const { return type; }
42         void get_bounds(float, Point &, Point &) const;
43         Path3D &get_path() { return *path; }
44
45         virtual Point get_node() const;
46         virtual bool is_visible() const { return true; }
47
48         void apply_matrix() const;
49         virtual void render(const Msp::GL::Tag &) const;
50 };
51
52 } // namespace R2C2
53
54 #endif