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

Revision 674, 2.2 KB checked in by mattausch, 18 years ago (diff)
RevLine 
[372]1#ifndef _VssPreprocessor_H__
2#define _VssPreprocessor_H__
3
4#include <fstream>
5using namespace std;
6
7#include "Preprocessor.h"
[376]8#include "VssRay.h"
[401]9class VssTree;
[427]10class VssTreeLeaf;
[372]11
[487]12
[372]13/** Sampling based visibility preprocessing. The implementation is based on heuristical
14    sampling of view space */
15class VssPreprocessor : public Preprocessor {
16public:
[434]17  int mPass;
[372]18  int mSamplesPerPass;
[427]19  int mVssSamplesPerPass;
[403]20  int mInitialSamples;
21  int mVssSamples;
[434]22  bool mUseImportanceSampling;
[674]23  bool mEnlargeViewSpace;
[434]24  AxisAlignedBox3 *mViewSpaceBox;
[427]25
[434]26  ofstream mStats;
[376]27       
[372]28  ObjectContainer mObjects;
[376]29
[490]30  /// if initial samples should be loaded from file
31  bool mLoadInitialSamples;
32  /// if initial samples should be stored in file
33  bool mStoreInitialSamples;
[501]34  /// if box around view space should be used
35  bool mUseViewSpaceBox;
[434]36  // rays cast during the processing
[376]37  VssRayContainer mVssRays;
[372]38       
39  VssPreprocessor();
40  ~VssPreprocessor();
41
42  virtual bool ComputeVisibility();
43
[434]44  Vector3
45  GetViewpoint(AxisAlignedBox3 *viewSpaceBox);
[376]46
[434]47  Vector3
48  GetDirection(const Vector3 &viewpoint,
49                           AxisAlignedBox3 *viewSpaceBox
50                           );
[376]51       
[574]52  void CastRays(SimpleRayContainer &rays, VssRayContainer &vssRays);
53
[372]54  void
55  SetupRay(Ray &ray,
[434]56                   const Vector3 &point,
57                   const Vector3 &direction
58                   );
[372]59
60
[376]61       
[434]62  int
63  CastRay(
64                  Vector3 &viewPoint,
65                  Vector3 &direction,
66                  VssRayContainer &vssRays
[401]67
[434]68                  );
[372]69
[374]70
[434]71  bool
72  ExportRays(const char *filename,
73                         const VssRayContainer &vssRays,
74                         const int number
75                         );
76
77  int
78  GenerateImportanceRays(VssTree *vssTree,
79                                                 const int desiredSamples,
80                                                 SimpleRayContainer &rays
[427]81                                                 );
82
[401]83
[434]84  bool
85  ExportVssTreeLeaf(char *filename,
86                                        VssTree *tree,
87                                        VssTreeLeaf *leaf);
[427]88
[434]89  void
90  ExportVssTreeLeaves(VssTree *tree, const int number);
91       
[427]92
[434]93  bool
94  ExportVssTree(char *filename,
[438]95                                VssTree *tree,
96                                const Vector3 &dir
97                                );
[434]98
99
100  float
101  GetAvgPvsSize(VssTree *tree,
102                                const vector<AxisAlignedBox3> &viewcells
103                                );
104 
105  void CastRay(const BspTree &tree, const VssRay & vssRay);
[530]106
[535]107  void TestBeamCasting(VssTree *tre, ViewCellsManager *vm, const ObjectContainer &objects);
[532]108
109  bool mTestBeamSampling;
[372]110};
111
112
113
114#endif
Note: See TracBrowser for help on using the repository browser.