source: trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.h @ 440

Revision 440, 3.3 KB checked in by mattausch, 19 years ago (diff)
Line 
1#ifndef _Preprocessor_H__
2#define _Preprocessor_H__
3
4#include <string>
5using namespace std;
6#include "Containers.h"
7#include "Mesh.h"
8#include "KdTree.h"
9#include "ViewCellBsp.h"
10#include "ViewCell.h"
11#include "VspKdTree.h"
12
13class RenderSimulator;
14class SceneGraph;
15class Exporter;
16class ViewCellsManager;
17
18
19/** Namespace for the external visibility preprocessor
20
21    This namespace includes all classes which are created by the VUT (Vienna University
22    of Technology) for the External Visibility Preprocessor of the GTP (GameTools Project)
23    (www.gametools.org).
24*/
25 
26  /** Main class of the visibility preprocessor. Responsible for loading and
27      saving of the input and output files. Initiates construction of the kD-tree,
28      viewcell loading/generation and the visibility computation itself.
29  */
30class Preprocessor {
31public:
32        /** Default constructor initialising e.g., KD tree and BSP tree.
33        */
34        Preprocessor();
35
36   virtual ~Preprocessor();
37
38  /** Load the input scene.
39      @param filename file to load
40        @return true on success
41  */
42  virtual bool LoadScene(const string filename);
43 
44  /** Export all preprocessed data in a XML format understandable by the
45      PreprocessingInterface of the GtpVisibilityPreprocessor Module. The file can be compressed depending
46      on the environement settings.
47      @return true on successful export
48  */
49  virtual bool ExportPreprocessedData(const string filename);
50 
51  /** Build the KdTree of currently loaded occluders/occludees/viewcells. The construction
52      is driven by the environment settings, which also sais which of the three types of
53      entities should be used to drive the heuristical construction (only occluders by default)
54  */
55  virtual bool BuildKdTree();
56
57  /** Compute visibility method. This method has to be reimplemented by the actual
58      Preprocessor implementation (e.g. SamplingPreprocessor, ExactPreprocessor,
59      GlobalSamplingpreprocessor)
60    */
61  virtual bool ComputeVisibility() = 0;
62 
63  /** View cells are either loaded or prepared for generation, according to the chosen environment
64      object. Important evironment options are, e.g, the view cell type.
65      Should be done after scene loading (i.e., some options are based on scene type).
66  */
67  bool PrepareViewCells();
68 
69  bool
70  Export( const string filename,
71          const bool scene,
72          const bool kdtree,
73          const bool bsptree
74          );
75 
76 
77  virtual void KdTreeStatistics(ostream &s);
78  virtual void BspTreeStatistics(ostream &s);
79
80  /// scene graph loaded from file
81  SceneGraph *mSceneGraph;
82 
83  /// kD-tree organizing the scene graph (occluders + occludees) + viewcells
84  KdTree *mKdTree;
85 
86  /// list of all loaded occluders
87  ObjectContainer mOccluders;
88  /// list of all loaded occludees
89  ObjectContainer mOccludees;
90   
91  /// BSP tree representing the viewcells
92  BspTree *mBspTree;
93
94  ViewCellsManager *mViewCellsManager;
95
96  /** Kd tree inducing a coarse partition of view space that are the building
97          blocks for view cells.
98  */
99  VspKdTree *mVspKdTree;
100
101protected:
102
103  /////////////////////////
104
105  /// samples used for construction of the BSP view cells tree.
106  int mBspConstructionSamples;
107   /// samples used for construction of the VSP KD tree.
108  int mVspKdConstructionSamples;
109};
110
111
112
113
114
115#endif
Note: See TracBrowser for help on using the repository browser.