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