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

Revision 1884, 2.6 KB checked in by bittner, 18 years ago (diff)

temporary version, rss preprocessor not functional

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