#ifndef _RssPreprocessor_H__ #define _RssPreprocessor_H__ #include using namespace std; #include "Preprocessor.h" #include "VssRay.h" class RssTree; class RssTreeLeaf; /** Sampling based visibility preprocessing. The implementation is based on heuristical sampling of view space */ class RssPreprocessor : public Preprocessor { public: int mPass; int mSamplesPerPass; int mRssSamplesPerPass; int mInitialSamples; int mRssSamples; bool mUseImportanceSampling; AxisAlignedBox3 *mViewSpaceBox; ofstream mStats; ObjectContainer mObjects; // rays cast during the processing VssRayContainer mVssRays; RssPreprocessor(); ~RssPreprocessor(); virtual bool ComputeVisibility(); Vector3 GetViewpoint(AxisAlignedBox3 *viewSpaceBox); Vector3 GetDirection(const Vector3 &viewpoint, AxisAlignedBox3 *viewSpaceBox ); void SetupRay(Ray &ray, const Vector3 &point, const Vector3 &direction ); int CastRay( Vector3 &viewPoint, Vector3 &direction, VssRayContainer &vssRays ); virtual bool BuildBspTree() { return false; } bool ExportRays(const char *filename, const VssRayContainer &vssRays, const int number ); int GenerateImportanceRays(RssTree *vssTree, const int desiredSamples, SimpleRayContainer &rays ); bool ExportRssTreeLeaf(char *filename, RssTree *tree, RssTreeLeaf *leaf); void ExportRssTreeLeaves(RssTree *tree, const int number); bool ExportRssTree(char *filename, RssTree *tree, const Vector3 &dir ); float GetAvgPvsSize(RssTree *tree, const vector &viewcells ); void ExportPvs(char *filename, RssTree *rssTree ); }; #endif