[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;
|
---|
[1563] | 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;
|
---|
[1723] | 38 |
|
---|
[434] | 39 | // rays cast during the processing
|
---|
[376] | 40 | VssRayContainer mVssRays;
|
---|
[372] | 41 |
|
---|
| 42 | VssPreprocessor();
|
---|
| 43 | ~VssPreprocessor();
|
---|
| 44 |
|
---|
| 45 | virtual bool ComputeVisibility();
|
---|
| 46 |
|
---|
[434] | 47 | Vector3
|
---|
| 48 | GetViewpoint(AxisAlignedBox3 *viewSpaceBox);
|
---|
[376] | 49 |
|
---|
[434] | 50 | Vector3
|
---|
| 51 | GetDirection(const Vector3 &viewpoint,
|
---|
| 52 | AxisAlignedBox3 *viewSpaceBox
|
---|
| 53 | );
|
---|
[376] | 54 |
|
---|
[574] | 55 |
|
---|
[434] | 56 | bool
|
---|
| 57 | ExportRays(const char *filename,
|
---|
| 58 | const VssRayContainer &vssRays,
|
---|
| 59 | const int number
|
---|
| 60 | );
|
---|
| 61 |
|
---|
| 62 | int
|
---|
| 63 | GenerateImportanceRays(VssTree *vssTree,
|
---|
| 64 | const int desiredSamples,
|
---|
| 65 | SimpleRayContainer &rays
|
---|
[427] | 66 | );
|
---|
| 67 |
|
---|
[401] | 68 |
|
---|
[434] | 69 | bool
|
---|
| 70 | ExportVssTreeLeaf(char *filename,
|
---|
| 71 | VssTree *tree,
|
---|
| 72 | VssTreeLeaf *leaf);
|
---|
[427] | 73 |
|
---|
[434] | 74 | void
|
---|
| 75 | ExportVssTreeLeaves(VssTree *tree, const int number);
|
---|
| 76 |
|
---|
[427] | 77 |
|
---|
[434] | 78 | bool
|
---|
| 79 | ExportVssTree(char *filename,
|
---|
[438] | 80 | VssTree *tree,
|
---|
| 81 | const Vector3 &dir
|
---|
| 82 | );
|
---|
[434] | 83 |
|
---|
| 84 |
|
---|
| 85 | float
|
---|
| 86 | GetAvgPvsSize(VssTree *tree,
|
---|
| 87 | const vector<AxisAlignedBox3> &viewcells
|
---|
| 88 | );
|
---|
| 89 |
|
---|
[535] | 90 | void TestBeamCasting(VssTree *tre, ViewCellsManager *vm, const ObjectContainer &objects);
|
---|
[532] | 91 |
|
---|
| 92 | bool mTestBeamSampling;
|
---|
[1221] | 93 |
|
---|
[372] | 94 | };
|
---|
| 95 |
|
---|
[860] | 96 | }
|
---|
[372] | 97 |
|
---|
| 98 | #endif
|
---|