source: trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.h @ 501

Revision 501, 2.0 KB checked in by mattausch, 19 years ago (diff)
Line 
1#ifndef _VssPreprocessor_H__
2#define _VssPreprocessor_H__
3
4#include <fstream>
5using namespace std;
6
7#include "Preprocessor.h"
8#include "VssRay.h"
9class VssTree;
10class VssTreeLeaf;
11
12
13/** Sampling based visibility preprocessing. The implementation is based on heuristical
14    sampling of view space */
15class VssPreprocessor : public Preprocessor {
16public:
17  int mPass;
18  int mSamplesPerPass;
19  int mVssSamplesPerPass;
20  int mInitialSamples;
21  int mVssSamples;
22  bool mUseImportanceSampling;
23
24  AxisAlignedBox3 *mViewSpaceBox;
25
26  ofstream mStats;
27       
28  ObjectContainer mObjects;
29
30  /// if initial samples should be loaded from file
31  bool mLoadInitialSamples;
32  /// if initial samples should be stored in file
33  bool mStoreInitialSamples;
34  /// if box around view space should be used
35  bool mUseViewSpaceBox;
36  // rays cast during the processing
37  VssRayContainer mVssRays;
38       
39  VssPreprocessor();
40  ~VssPreprocessor();
41
42  virtual bool ComputeVisibility();
43
44  Vector3
45  GetViewpoint(AxisAlignedBox3 *viewSpaceBox);
46
47  Vector3
48  GetDirection(const Vector3 &viewpoint,
49                           AxisAlignedBox3 *viewSpaceBox
50                           );
51       
52  void
53  SetupRay(Ray &ray,
54                   const Vector3 &point,
55                   const Vector3 &direction
56                   );
57
58
59       
60  int
61  CastRay(
62                  Vector3 &viewPoint,
63                  Vector3 &direction,
64                  VssRayContainer &vssRays
65
66                  );
67
68
69  bool
70  ExportRays(const char *filename,
71                         const VssRayContainer &vssRays,
72                         const int number
73                         );
74
75  int
76  GenerateImportanceRays(VssTree *vssTree,
77                                                 const int desiredSamples,
78                                                 SimpleRayContainer &rays
79                                                 );
80
81
82  bool
83  ExportVssTreeLeaf(char *filename,
84                                        VssTree *tree,
85                                        VssTreeLeaf *leaf);
86
87  void
88  ExportVssTreeLeaves(VssTree *tree, const int number);
89       
90
91  bool
92  ExportVssTree(char *filename,
93                                VssTree *tree,
94                                const Vector3 &dir
95                                );
96
97
98  float
99  GetAvgPvsSize(VssTree *tree,
100                                const vector<AxisAlignedBox3> &viewcells
101                                );
102 
103  void CastRay(const BspTree &tree, const VssRay & vssRay);
104};
105
106
107
108#endif
Note: See TracBrowser for help on using the repository browser.