source: GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h @ 1251

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