#ifndef _VssPreprocessor_H__ #define _VssPreprocessor_H__ #include //using namespace std; #include "Preprocessor.h" #include "VssRay.h" namespace GtpVisibilityPreprocessor { class VssTree; class VssTreeLeaf; /** Sampling based visibility preprocessing. The implementation is based on heuristical sampling of view space */ class VssPreprocessor : public Preprocessor { public: int mSamplesPerPass; int mVssSamplesPerPass; int mInitialSamples; int mVssSamples; bool mUseImportanceSampling; bool mEnlargeViewSpace; //AxisAlignedBox3 mViewSpaceBox; ObjectContainer mObjects; /// if initial samples should be loaded from file bool mLoadInitialSamples; /// if initial samples should be stored in file bool mStoreInitialSamples; // rays cast during the processing VssRayContainer mVssRays; VssPreprocessor(); ~VssPreprocessor(); virtual bool ComputeVisibility(); Vector3 GetViewpoint(AxisAlignedBox3 *viewSpaceBox); Vector3 GetDirection(const Vector3 &viewpoint, AxisAlignedBox3 *viewSpaceBox ); bool ExportRays(const char *filename, const VssRayContainer &vssRays, const int number ); int GenerateImportanceRays(VssTree *vssTree, const int desiredSamples, SimpleRayContainer &rays ); bool ExportVssTreeLeaf(char *filename, VssTree *tree, VssTreeLeaf *leaf); void ExportVssTreeLeaves(VssTree *tree, const int number); bool ExportVssTree(char *filename, VssTree *tree, const Vector3 &dir ); float GetAvgPvsSize(VssTree *tree, const vector &viewcells ); void TestBeamCasting(VssTree *tre, ViewCellsManager *vm, const ObjectContainer &objects); void DeterminePvsObjects(VssRayContainer &rays); bool mTestBeamSampling; }; } #endif