#ifndef _VISIBILITYSOLUTIONLOADER_H #define _VISIBILITYSOLUTIONLOADER_H #include "common.h" namespace CHCDemoEngine { class ViewCellsTree; struct ViewCell; class Bvh; typedef std::vector ViewCellsContainer; /** Loads a preprocessed visibility solution. */ class VisibilitySolutionLoader { public: VisibilitySolutionLoader(): mNumNodes(0) {}; ViewCellsTree *Load(const std::string &filename, Bvh *bvh); protected: /** Creates list of bvh nodes where the index is equivalent to the id of this node in the bvh. */ bool CreateIdSortedList(Bvh *bvh, BvhNodeContainer &nodes); bool LoadPvs(FILE *fw, Bvh *bvh); void AllocateLeafViewCells(ViewCellsTree *viewCellsTree); /////////////// int mNumNodes; ViewCellsContainer mViewCells; }; } #endif