f2c521b5f19af2c3f51dfaa745a500f12ff5cf9f
[laserbrain_demo] / src / exhibit.h
1 #ifndef EXHIBIT_H_
2 #define EXHIBIT_H_
3
4 #include <string>
5 #include <gmath/gmath.h>
6 #include "object.h"
7 #include "geom.h"
8 #include "audio/stream.h"
9
10 class Exhibit;
11 class ExhibitPriv;
12 class Scene;
13
14 enum {
15         EXSEL_RAY = 1,
16         EXSEL_SPHERE = 2
17 };
18
19 class ExSelection {
20 public:
21         Exhibit *ex;
22         void *obj;
23         void *data;
24         Ray selray;
25         Sphere selsphere;
26         unsigned int validmask;
27
28         ExSelection(Exhibit *ex = 0);
29
30         operator bool() const;
31 };
32
33 enum {
34         EXDATA_INFO,
35         EXDATA_VIDEO
36 };
37
38 class ExData {
39 public:
40         int type;
41
42         std::string text;
43         AudioStream *voice;
44         // TODO: video stream
45
46         ExData();
47         ~ExData();
48 };
49
50
51 /* TODO
52 - select me aktina kai select me sfaira, epistrefei Selection
53 - hover me aktina kai hover me sfaira
54 - move me selection, origin, direction kai rotation (?)
55  */
56 class Exhibit : public Object {
57 private:
58         ExhibitPriv *priv;
59
60 public:
61         std::vector<ExData> data;
62
63         Exhibit();
64         virtual ~Exhibit();
65
66         Exhibit(const Exhibit&) = delete;
67         Exhibit &operator =(const Exhibit &) = delete;
68
69         virtual void set_node(SceneNode *node);
70
71         virtual ExSelection select(const Ray &ray) const;
72         virtual ExSelection select(const Sphere &sph) const;
73
74         virtual void update(float dt = 0.0f) override;
75
76         virtual void pre_draw() const;
77         virtual void draw() const override;
78         virtual void post_draw() const;
79
80         virtual const AABox &get_aabox() const override;
81 };
82
83 #endif  // EXHIBIT_H_