source: GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.h @ 1771

Revision 1771, 1.8 KB checked in by bittner, 18 years ago (diff)

merge, preparing sampling strategy support for mixed distributions, filter changes, histogram output for preprocessor

Line 
1#ifndef _VssPreprocessor_H__
2#define _VssPreprocessor_H__
3
4#include <fstream>
5using namespace std;
6
7#include "Preprocessor.h"
8#include "VssRay.h"
9
10namespace GtpVisibilityPreprocessor {
11
12class VssTree;
13class VssTreeLeaf;
14
15
16
17/** Sampling based visibility preprocessing. The implementation is based on heuristical
18    sampling of view space */
19class VssPreprocessor : public Preprocessor {
20public:
21 
22  int mSamplesPerPass;
23  int mVssSamplesPerPass;
24  int mInitialSamples;
25  int mVssSamples;
26  bool mUseImportanceSampling;
27  bool mEnlargeViewSpace;
28  //AxisAlignedBox3 mViewSpaceBox;
29
30       
31  ObjectContainer mObjects;
32
33  /// if initial samples should be loaded from file
34  bool mLoadInitialSamples;
35  /// if initial samples should be stored in file
36  bool mStoreInitialSamples;
37 
38  // rays cast during the processing
39  VssRayContainer mVssRays;
40       
41  VssPreprocessor();
42  ~VssPreprocessor();
43
44  virtual bool ComputeVisibility();
45
46  Vector3
47  GetViewpoint(AxisAlignedBox3 *viewSpaceBox);
48
49  Vector3
50  GetDirection(const Vector3 &viewpoint,
51                           AxisAlignedBox3 *viewSpaceBox
52                           );
53       
54
55  bool
56  ExportRays(const char *filename,
57                         const VssRayContainer &vssRays,
58                         const int number
59                         );
60
61  int
62  GenerateImportanceRays(VssTree *vssTree,
63                                                 const int desiredSamples,
64                                                 SimpleRayContainer &rays
65                                                 );
66
67
68  bool
69  ExportVssTreeLeaf(char *filename,
70                                        VssTree *tree,
71                                        VssTreeLeaf *leaf);
72
73  void
74  ExportVssTreeLeaves(VssTree *tree, const int number);
75       
76
77  bool
78  ExportVssTree(char *filename,
79                                VssTree *tree,
80                                const Vector3 &dir
81                                );
82
83
84  float
85  GetAvgPvsSize(VssTree *tree,
86                                const vector<AxisAlignedBox3> &viewcells
87                                );
88 
89  void TestBeamCasting(VssTree *tre, ViewCellsManager *vm, const ObjectContainer &objects);
90
91  bool mTestBeamSampling;
92
93};
94
95}
96
97#endif
Note: See TracBrowser for help on using the repository browser.