[2767] | 1 | #ifndef __VISUALIZATION_H
|
---|
| 2 | #define __VISUALIZATION_H
|
---|
| 3 |
|
---|
| 4 | #include "common.h"
|
---|
| 5 |
|
---|
| 6 |
|
---|
[2776] | 7 | namespace CHCDemoEngine
|
---|
[2767] | 8 | {
|
---|
| 9 |
|
---|
| 10 | class Bvh;
|
---|
[3062] | 11 | class PerspectiveCamera;
|
---|
[2767] | 12 | class Camera;
|
---|
| 13 | class RenderState;
|
---|
| 14 | class AxisAlignedBox3;
|
---|
[2796] | 15 | class GLUquadric;
|
---|
[3245] | 16 | struct ViewCell;
|
---|
[2767] | 17 |
|
---|
| 18 |
|
---|
| 19 | /** Abstract class implementing a scene traversal for rendering.
|
---|
| 20 | */
|
---|
| 21 | class Visualization
|
---|
| 22 | {
|
---|
| 23 | public:
|
---|
[2806] | 24 | /** Main constructor taking a bvh, a camera, a visualization camera and the current render state
|
---|
| 25 | as parameters
|
---|
| 26 | */
|
---|
[3062] | 27 | Visualization(Bvh *bvh, PerspectiveCamera *camera, Camera *vizCamera, RenderState *state);
|
---|
[2767] | 28 |
|
---|
[2796] | 29 | ~Visualization();
|
---|
[2767] | 30 | /** Renders the visualizatioin
|
---|
| 31 | */
|
---|
[3063] | 32 | void Render(bool showShadowFrustra);
|
---|
[2767] | 33 | /** Sets the scene hierarchy.
|
---|
| 34 | */
|
---|
| 35 | void SetHierarchy(Bvh *bvh);
|
---|
| 36 | /** Sets the visualization camera.
|
---|
| 37 | */
|
---|
[3063] | 38 | void SetVizCamera(Camera *cam) { mVizCamera = cam; }
|
---|
[2767] | 39 | /** Sets the currently used scene camera.
|
---|
| 40 | */
|
---|
[3063] | 41 | void SetCamera(PerspectiveCamera *cam) {mCamera = cam; }
|
---|
[2767] | 42 | /** Sets the current render state
|
---|
| 43 | */
|
---|
| 44 | void SetRenderState(RenderState *state);
|
---|
[2787] | 45 | /** Sets the currentframe id
|
---|
| 46 | */
|
---|
| 47 | void SetFrameId(int frameId);
|
---|
[3062] | 48 | /** Renders a camera frustum.
|
---|
[2767] | 49 | */
|
---|
| 50 | void RenderFrustum();
|
---|
[3245] | 51 | /** Sets the current view cell.
|
---|
| 52 | */
|
---|
| 53 | void SetViewCell(ViewCell *vc);
|
---|
[2767] | 54 |
|
---|
[3245] | 55 | /** Renders box as wireframe.
|
---|
| 56 | */
|
---|
| 57 | static void RenderBoxForViz(const AxisAlignedBox3 &box);
|
---|
[3063] | 58 |
|
---|
[2889] | 59 | protected:
|
---|
[2767] | 60 |
|
---|
| 61 | ////////////
|
---|
| 62 | //-- members
|
---|
| 63 |
|
---|
| 64 | /// the current camera
|
---|
[3062] | 65 | PerspectiveCamera *mCamera;
|
---|
[2767] | 66 | /// the visualization camera
|
---|
| 67 | Camera *mVizCamera;
|
---|
| 68 | /// the root of the scene hierarchy
|
---|
| 69 | Bvh *mBvh;
|
---|
| 70 | /// the current render state
|
---|
| 71 | RenderState *mRenderState;
|
---|
[2787] | 72 | /// the current frame id
|
---|
| 73 | int mFrameId;
|
---|
[3245] | 74 |
|
---|
| 75 | ViewCell *mViewCell;
|
---|
[2767] | 76 | };
|
---|
| 77 |
|
---|
| 78 | }
|
---|
| 79 |
|
---|
| 80 |
|
---|
| 81 |
|
---|
| 82 | #endif // VISUALIZATION_H |
---|