source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.h @ 3257

Revision 3257, 863 bytes checked in by mattausch, 15 years ago (diff)
Line 
1#ifndef _VISIBILITYSOLUTIONLOADER_H
2#define _VISIBILITYSOLUTIONLOADER_H
3
4#include "common.h"
5
6
7namespace CHCDemoEngine
8{
9
10class ViewCellsTree;
11struct ViewCell;
12class Bvh;
13
14typedef std::vector<ViewCell *> ViewCellsContainer;
15
16
17/** Loads a preprocessed visibility solution.
18*/
19class VisibilitySolutionLoader
20{
21public:
22
23        VisibilitySolutionLoader(): mNumNodes(0) {};
24
25        ViewCellsTree *Load(const std::string &filename, Bvh *bvh, float viewCellsScaleFactor = 1.0f);
26
27
28protected:
29        /** Creates list of bvh nodes where the index
30                is equivalent to the id of this node in the bvh.
31        */
32        bool CreateIdSortedList(Bvh *bvh, BvhNodeContainer &nodes);
33
34        bool LoadPvs(FILE *fw, Bvh *bvh);
35
36        void AllocateLeafViewCells(ViewCellsTree *viewCellsTree);
37
38
39        ///////////////
40
41        int mNumNodes;
42
43        ViewCellsContainer mViewCells;
44};
45
46}
47
48#endif
Note: See TracBrowser for help on using the repository browser.