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