63b289837ee707968e3517a910cf256337ab8f95
[laserbrain_demo] / src / exhibit.h
1 #ifndef EXHIBIT_H_
2 #define EXHIBIT_H_
3
4 #include <gmath/gmath.h>
5 #include "object.h"
6 #include "geom.h"
7
8 class Exhibit;
9 class ExhibitPriv;
10 class Scene;
11
12 enum {
13         EXSEL_RAY = 1,
14         EXSEL_SPHERE = 2
15 };
16
17 class ExSelection {
18 public:
19         Exhibit *ex;
20         void *obj;
21         void *data;
22         Ray selray;
23         Sphere selsphere;
24         unsigned int validmask;
25
26         ExSelection(Exhibit *ex = 0);
27
28         operator bool() const;
29 };
30
31 /* TODO
32 - select me aktina kai select me sfaira, epistrefei Selection
33 - hover me aktina kai hover me sfaira
34 - move me selection, origin, direction kai rotation (?)
35  */
36 class Exhibit : public Object {
37 private:
38         ExhibitPriv *priv;
39
40 public:
41         Exhibit();
42         virtual ~Exhibit();
43
44         Exhibit(const Exhibit&) = delete;
45         Exhibit &operator =(const Exhibit &) = delete;
46
47         virtual void set_node(SceneNode *node);
48
49         virtual ExSelection select(const Ray &ray) const;
50         virtual ExSelection select(const Sphere &sph) const;
51
52         virtual void update(float dt = 0.0f);
53
54         virtual void pre_draw() const;
55         virtual void draw() const;
56         virtual void post_draw() const;
57 };
58
59 #endif  // EXHIBIT_H_