[372] | 1 | #ifndef _VssPreprocessor_H__
|
---|
| 2 | #define _VssPreprocessor_H__
|
---|
| 3 |
|
---|
| 4 | #include <fstream>
|
---|
[2176] | 5 | //
|
---|
[372] | 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 |
|
---|
[2199] | 54 | virtual bool
|
---|
| 55 | ExportRays(const char *filename,
|
---|
| 56 | const VssRayContainer &vssRays,
|
---|
| 57 | const int number,
|
---|
| 58 | const bool exportScene = false
|
---|
| 59 | );
|
---|
| 60 |
|
---|
[574] | 61 |
|
---|
[434] | 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 |
|
---|
[2063] | 92 | void DeterminePvsObjects(VssRayContainer &rays);
|
---|
| 93 |
|
---|
[532] | 94 | bool mTestBeamSampling;
|
---|
[1221] | 95 |
|
---|
[372] | 96 | };
|
---|
| 97 |
|
---|
[860] | 98 | }
|
---|
[372] | 99 |
|
---|
| 100 | #endif
|
---|