source: trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.h @ 563

Revision 563, 2.5 KB checked in by bittner, 18 years ago (diff)

rss sampling changes, preprocessor::GenerateRays?

Line 
1#ifndef _RssPreprocessor_H__
2#define _RssPreprocessor_H__
3
4#include <fstream>
5using namespace std;
6
7
8#include "Preprocessor.h"
9#include "VssRay.h"
10class RssTree;
11class RssTreeLeaf;
12
13
14/** Sampling based visibility preprocessing. The implementation is based on heuristical
15    sampling of view space */
16class RssPreprocessor : public Preprocessor {
17 
18public:
19  int mPass;
20  int mSamplesPerPass;
21  int mRssSamplesPerPass;
22  int mInitialSamples;
23  int mRssSamples;
24  bool mUseImportanceSampling;
25
26  bool mExportPvs;
27  bool mExportRssTree;
28  bool mExportRays;
29  int mExportNumRays;
30
31  bool mUseViewcells;
32  bool mUpdateSubdivision;
33
34  bool mObjectBasedSampling;
35  bool mDirectionalSampling;
36 
37  AxisAlignedBox3 *mViewSpaceBox;
38
39  ofstream mStats;
40  RssTree *mRssTree;
41
42  // rays cast during the processing
43  VssRayContainer mVssRays;
44       
45   /// if initial samples should be loaded from file
46  bool mLoadInitialSamples;
47  /// if initial samples should be stored in file
48  bool mStoreInitialSamples;
49
50  RssPreprocessor();
51  ~RssPreprocessor();
52
53  virtual bool ComputeVisibility();
54
55  Vector3
56  GetViewpoint(AxisAlignedBox3 *viewSpaceBox);
57
58
59  void
60  SetupRay(Ray &ray,
61                   const Vector3 &point,
62                   const Vector3 &direction
63                   );
64
65
66       
67  int
68  CastRay(
69                  Vector3 &viewPoint,
70                  Vector3 &direction,
71                  const float probability,
72                  VssRayContainer &vssRays
73
74                  );
75               
76
77       
78  virtual bool BuildBspTree() { return false; }
79 
80  void
81  CastRays(
82                   SimpleRayContainer &rays,
83                   VssRayContainer &vssRays
84                   );
85
86  bool
87  ExportRays(const char *filename,
88                         const VssRayContainer &vssRays,
89                         const int number
90                         );
91
92  int
93  GenerateImportanceRays(RssTree *vssTree,
94                                                 const int desiredSamples,
95                                                 SimpleRayContainer &rays
96                                                 );
97
98
99  bool
100  ExportRssTreeLeaf(char *filename,
101                                        RssTree *tree,
102                                        RssTreeLeaf *leaf);
103
104  void
105  ExportRssTreeLeaves(RssTree *tree, const int number);
106       
107
108  bool
109  ExportRssTree(char *filename,
110                                RssTree *tree,
111                                const Vector3 &dir
112                                );
113
114
115  float
116  GetAvgPvsSize(RssTree *tree,
117                                const vector<AxisAlignedBox3> &viewcells
118                                );
119 
120
121  void
122  ExportPvs(char *filename,
123                        RssTree *rssTree
124                        );
125
126
127  void
128  ComputeRenderError();
129
130  /** Redefininition of the get sample rays method from the preprocessor */
131  bool
132  GenerateRays(
133                           const int number,
134                           const int sampleType,
135                           SimpleRayContainer &rays
136                           );
137
138};
139
140
141
142#endif
Note: See TracBrowser for help on using the repository browser.