[372] | 1 | #ifndef _VssPreprocessor_H__
|
---|
| 2 | #define _VssPreprocessor_H__
|
---|
| 3 |
|
---|
| 4 | #include <fstream>
|
---|
| 5 | using namespace std;
|
---|
| 6 |
|
---|
| 7 | #include "Preprocessor.h"
|
---|
[376] | 8 | #include "VssRay.h"
|
---|
[860] | 9 |
|
---|
| 10 | namespace GtpVisibilityPreprocessor {
|
---|
| 11 |
|
---|
[401] | 12 | class VssTree;
|
---|
[427] | 13 | class VssTreeLeaf;
|
---|
[372] | 14 |
|
---|
[487] | 15 |
|
---|
[860] | 16 |
|
---|
[372] | 17 | /** Sampling based visibility preprocessing. The implementation is based on heuristical
|
---|
| 18 | sampling of view space */
|
---|
| 19 | class VssPreprocessor : public Preprocessor {
|
---|
| 20 | public:
|
---|
[1251] | 21 |
|
---|
[372] | 22 | int mSamplesPerPass;
|
---|
[427] | 23 | int mVssSamplesPerPass;
|
---|
[403] | 24 | int mInitialSamples;
|
---|
| 25 | int mVssSamples;
|
---|
[434] | 26 | bool mUseImportanceSampling;
|
---|
[674] | 27 | bool mEnlargeViewSpace;
|
---|
[1486] | 28 | AxisAlignedBox3 mViewSpaceBox;
|
---|
[427] | 29 |
|
---|
[434] | 30 | ofstream mStats;
|
---|
[376] | 31 |
|
---|
[372] | 32 | ObjectContainer mObjects;
|
---|
[376] | 33 |
|
---|
[490] | 34 | /// if initial samples should be loaded from file
|
---|
| 35 | bool mLoadInitialSamples;
|
---|
| 36 | /// if initial samples should be stored in file
|
---|
| 37 | bool mStoreInitialSamples;
|
---|
[501] | 38 | /// if box around view space should be used
|
---|
| 39 | bool mUseViewSpaceBox;
|
---|
[434] | 40 | // rays cast during the processing
|
---|
[376] | 41 | VssRayContainer mVssRays;
|
---|
[372] | 42 |
|
---|
| 43 | VssPreprocessor();
|
---|
| 44 | ~VssPreprocessor();
|
---|
| 45 |
|
---|
| 46 | virtual bool ComputeVisibility();
|
---|
| 47 |
|
---|
[434] | 48 | Vector3
|
---|
| 49 | GetViewpoint(AxisAlignedBox3 *viewSpaceBox);
|
---|
[376] | 50 |
|
---|
[434] | 51 | Vector3
|
---|
| 52 | GetDirection(const Vector3 &viewpoint,
|
---|
| 53 | AxisAlignedBox3 *viewSpaceBox
|
---|
| 54 | );
|
---|
[376] | 55 |
|
---|
[574] | 56 |
|
---|
[434] | 57 | bool
|
---|
| 58 | ExportRays(const char *filename,
|
---|
| 59 | const VssRayContainer &vssRays,
|
---|
| 60 | const int number
|
---|
| 61 | );
|
---|
| 62 |
|
---|
| 63 | int
|
---|
| 64 | GenerateImportanceRays(VssTree *vssTree,
|
---|
| 65 | const int desiredSamples,
|
---|
| 66 | SimpleRayContainer &rays
|
---|
[427] | 67 | );
|
---|
| 68 |
|
---|
[401] | 69 |
|
---|
[434] | 70 | bool
|
---|
| 71 | ExportVssTreeLeaf(char *filename,
|
---|
| 72 | VssTree *tree,
|
---|
| 73 | VssTreeLeaf *leaf);
|
---|
[427] | 74 |
|
---|
[434] | 75 | void
|
---|
| 76 | ExportVssTreeLeaves(VssTree *tree, const int number);
|
---|
| 77 |
|
---|
[427] | 78 |
|
---|
[434] | 79 | bool
|
---|
| 80 | ExportVssTree(char *filename,
|
---|
[438] | 81 | VssTree *tree,
|
---|
| 82 | const Vector3 &dir
|
---|
| 83 | );
|
---|
[434] | 84 |
|
---|
| 85 |
|
---|
| 86 | float
|
---|
| 87 | GetAvgPvsSize(VssTree *tree,
|
---|
| 88 | const vector<AxisAlignedBox3> &viewcells
|
---|
| 89 | );
|
---|
| 90 |
|
---|
[535] | 91 | void TestBeamCasting(VssTree *tre, ViewCellsManager *vm, const ObjectContainer &objects);
|
---|
[532] | 92 |
|
---|
| 93 | bool mTestBeamSampling;
|
---|
[1221] | 94 |
|
---|
[372] | 95 | };
|
---|
| 96 |
|
---|
[860] | 97 | }
|
---|
[372] | 98 |
|
---|
| 99 | #endif
|
---|