1 | /* |
---|
2 | * ---------------------------------------------------------------------- |
---|
3 | * Renderable.h: abstract class, a drawable thing |
---|
4 | * |
---|
5 | * ====================================================================== |
---|
6 | * AUTHOR: Wei Qiao <qiaow@purdue.edu> |
---|
7 | * Purdue Rendering and Perceptualization Lab (PURPL) |
---|
8 | * |
---|
9 | * Copyright (c) 2004-2006 Purdue Research Foundation |
---|
10 | * |
---|
11 | * See the file "license.terms" for information on usage and |
---|
12 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
13 | * ====================================================================== |
---|
14 | */ |
---|
15 | |
---|
16 | |
---|
17 | #ifndef _RENDERABLE_H_ |
---|
18 | #define _RENDERABLE_H_ |
---|
19 | |
---|
20 | |
---|
21 | #include "Vector3.h" |
---|
22 | |
---|
23 | struct BoundBox{ |
---|
24 | Vector3 low; //lower coordinates |
---|
25 | Vector3 high; //higher coordinates |
---|
26 | |
---|
27 | BoundBox(){} |
---|
28 | BoundBox(float low_x, float low_y, float low_z, |
---|
29 | float high_x, float high_y, float high_z): |
---|
30 | low(Vector3(low_x, low_y, low_z)), |
---|
31 | high(Vector3(high_x, high_y, high_z)){} |
---|
32 | }; |
---|
33 | |
---|
34 | class Renderable{ |
---|
35 | protected: |
---|
36 | Vector3 location; //the location (x,y,z) of the object |
---|
37 | bool enabled; //display is enabled |
---|
38 | BoundBox boundary; //the bounding box |
---|
39 | |
---|
40 | public: |
---|
41 | explicit Renderable(Vector3 loc); |
---|
42 | Renderable(); |
---|
43 | virtual ~Renderable(); |
---|
44 | |
---|
45 | void move(Vector3 new_loc); |
---|
46 | virtual void render() = 0; |
---|
47 | void enable(); |
---|
48 | void disable(); |
---|
49 | bool is_enabled(); |
---|
50 | }; |
---|
51 | |
---|
52 | |
---|
53 | #endif |
---|