#ifndef _VISIBILITYSOLUTIONLOADER_H #define _VISIBILITYSOLUTIONLOADER_H #include "common.h" namespace CHCDemoEngine { class ViewCellsTree; struct ViewCell; class Bvh; class BvhNode; typedef std::vector ViewCellsContainer; /** Loads a preprocessed visibility solution. */ class VisibilitySolutionLoader { public: VisibilitySolutionLoader(): mNumNodes(0) {}; ViewCellsTree *Load(const std::string &filename, Bvh *bvh, float &totalSamples, float &totalTime, float viewCellsScaleFactor = 1.0f); 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 CreateIdSortedList2(BvhNode *n, BvhNodeContainer &nodes); bool LoadPvs(FILE *fw, Bvh *bvh); void AllocateLeafViewCells(ViewCellsTree *viewCellsTree); /////////////// int mNumNodes; ViewCellsContainer mViewCells; }; } #endif