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

Revision 1251, 2.6 KB checked in by mattausch, 18 years ago (diff)
RevLine 
[447]1#ifndef _RssPreprocessor_H__
2#define _RssPreprocessor_H__
3
4#include <fstream>
5using namespace std;
6
7#include "Preprocessor.h"
8#include "VssRay.h"
[863]9
10namespace GtpVisibilityPreprocessor {
11
12
[447]13class RssTree;
14class RssTreeLeaf;
15
[487]16
[1251]17/** Sampling based visibility preprocessing. The implementation is
18        based on heuristical sampling of view space
19*/
[447]20class RssPreprocessor : public Preprocessor {
[492]21 
[447]22public:
23  int mSamplesPerPass;
24  int mRssSamplesPerPass;
25  int mInitialSamples;
26  int mRssSamples;
27  bool mUseImportanceSampling;
28
[464]29  bool mExportPvs;
30  bool mExportRssTree;
31  bool mExportRays;
32  int mExportNumRays;
33
34  bool mUseViewcells;
35  bool mUpdateSubdivision;
[492]36
37  bool mObjectBasedSampling;
38  bool mDirectionalSampling;
[464]39 
[447]40  AxisAlignedBox3 *mViewSpaceBox;
41
42  ofstream mStats;
[563]43  RssTree *mRssTree;
[487]44
[447]45  // rays cast during the processing
46  VssRayContainer mVssRays;
47       
[490]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
[447]53  RssPreprocessor();
54  ~RssPreprocessor();
55
56  virtual bool ComputeVisibility();
57
[1251]58#if 0 // matt:: moved up into preprocessor
[447]59  int
60  CastRay(
61                  Vector3 &viewPoint,
62                  Vector3 &direction,
[537]63                  const float probability,
[447]64                  VssRayContainer &vssRays
65                  );
[1251]66#endif         
[447]67  virtual bool BuildBspTree() { return false; }
[563]68 
69  void
70  CastRays(
71                   SimpleRayContainer &rays,
72                   VssRayContainer &vssRays
73                   );
[447]74
75  bool
76  ExportRays(const char *filename,
77                         const VssRayContainer &vssRays,
78                         const int number
79                         );
80
[1112]81  bool
82  ExportRayAnimation(const char *filename,
83                                         const vector<VssRayContainer> &vssRays
84                                         );
85
[576]86  void
87  ExportObjectRays(VssRayContainer &rays,
88                                   const int objectId);
89       
[447]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                        );
[450]123
[492]124
125  void
126  ComputeRenderError();
127
[563]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
[447]136};
137
138
[863]139};
[447]140
141#endif
Note: See TracBrowser for help on using the repository browser.