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