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

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"
[1884]9#include "SamplingStrategy.h"
[863]10
11namespace GtpVisibilityPreprocessor {
12
13
[447]14class RssTree;
15class RssTreeLeaf;
16
[1737]17 
[1251]18/** Sampling based visibility preprocessing. The implementation is
19        based on heuristical sampling of view space
20*/
[447]21class RssPreprocessor : public Preprocessor {
[492]22 
[447]23public:
[1771]24  vector<SamplingStrategy *> mDistributions;
[1884]25  MixtureDistribution *mMixtureDistribution;
[447]26  int mSamplesPerPass;
27  int mRssSamplesPerPass;
28  int mInitialSamples;
29  int mRssSamples;
30  bool mUseImportanceSampling;
[1785]31  bool mUseRssTree;
[447]32
[464]33  bool mExportPvs;
34  bool mExportRssTree;
35  bool mExportRays;
36  int mExportNumRays;
37
38  bool mUseViewcells;
39  bool mUpdateSubdivision;
[492]40
41  bool mObjectBasedSampling;
42  bool mDirectionalSampling;
[464]43 
[1563]44  //AxisAlignedBox3 *mViewSpaceBox;
[447]45
[1737]46 
[563]47  RssTree *mRssTree;
[487]48
[447]49  // rays cast during the processing
50  VssRayContainer mVssRays;
51       
[490]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
[447]57  RssPreprocessor();
58  ~RssPreprocessor();
59
60  virtual bool ComputeVisibility();
61
[1251]62#if 0 // matt:: moved up into preprocessor
[447]63  int
64  CastRay(
65                  Vector3 &viewPoint,
66                  Vector3 &direction,
[537]67                  const float probability,
[447]68                  VssRayContainer &vssRays
69                  );
[1251]70#endif         
[447]71  virtual bool BuildBspTree() { return false; }
[563]72 
[447]73
74  bool
75  ExportRays(const char *filename,
76                         const VssRayContainer &vssRays,
77                         const int number
78                         );
79
[1112]80  bool
81  ExportRayAnimation(const char *filename,
82                                         const vector<VssRayContainer> &vssRays
83                                         );
84
[576]85  void
86  ExportObjectRays(VssRayContainer &rays,
87                                   const int objectId);
88       
[447]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                        );
[450]122
[492]123
124  void
125  ComputeRenderError();
126
[563]127  /** Redefininition of the get sample rays method from the preprocessor */
[1765]128  int
[1867]129  GenerateRays(const int number,
130                           SamplingStrategy &strategy,
131                           SimpleRayContainer &rays);
132 
[447]133};
134
135
[863]136};
[447]137
138#endif
Note: See TracBrowser for help on using the repository browser.