#ifndef _RssPreprocessor_H__ #define _RssPreprocessor_H__ #include using namespace std; #include "Preprocessor.h" #include "VssRay.h" #include "SamplingStrategy.h" namespace GtpVisibilityPreprocessor { class RssTree; class RssTreeLeaf; /** Sampling based visibility preprocessing. The implementation is based on heuristical sampling of view space */ class RssPreprocessor : public Preprocessor { public: vector mDistributions; MixtureDistribution *mMixtureDistribution; int mSamplesPerPass; int mRssSamplesPerPass; int mInitialSamples; int mRssSamples; bool mUseImportanceSampling; bool mUseRssTree; bool mExportPvs; bool mExportRssTree; bool mUseViewcells; bool mUpdateSubdivision; bool mObjectBasedSampling; bool mDirectionalSampling; //AxisAlignedBox3 *mViewSpaceBox; RssTree *mRssTree; // rays cast during the processing VssRayContainer mVssRays; /// if initial samples should be loaded from file bool mLoadInitialSamples; /// if initial samples should be stored in file bool mStoreInitialSamples; RssPreprocessor(); ~RssPreprocessor(); virtual bool ComputeVisibility(); #if 0 // matt:: moved up into preprocessor int CastRay( Vector3 &viewPoint, Vector3 &direction, const float probability, VssRayContainer &vssRays ); #endif virtual bool BuildBspTree() { return false; } void ExportObjectRays(VssRayContainer &rays, const int objectId); 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 ); /** Redefininition of the get sample rays method from the preprocessor */ int GenerateRays(const int number, SamplingStrategy &strategy, SimpleRayContainer &rays); }; }; #endif