#ifndef _Preprocessor_H__ #define _Preprocessor_H__ #include "Containers.h" #include "Mesh.h" #include "KdTree.h" #include "ViewCellBsp.h" #include "SceneGraph.h" #include /** Namespace for the external visibility preprocessor This namespace includes all classes which are created by the VUT (Vienna University of Technology) for the External Visibility Preprocessor of the GTP (GameTools Project) (www.gametools.org). */ namespace GtpVisibilityPreprocessor { /** Main class of the visibility preprocessor. Responsible for loading and saving of the input and output files. Initiates construction of the kD-tree, viewcell loading/generation and the visibility computation itself. */ class Preprocessor { public: /** Load the input scene. @param filename file to load @return true on success */ virtual bool LoadScene(const string filename); /** Generate the viewCells automatically. The particular algorithm to be used depends on the environment setting. Initially the generated viewcells will cover the whole bounding volume of the scene. They can be pruned later depending on the results of visibility computations. @return true on successful viewcell generation. */ virtual bool GenerateViewCells(); /** Export all preprocessed data in a XML format understandable by the PreprocessingInterface of the GtpVisibilityPreprocessor Module. The file can be compressed depending on the environement settings. @return true on successful export */ virtual bool ExportPreprocessedData(const string filename); /** Build the KdTree of currently loaded occluders/occludees/viewcells. The construction is driven by the environment settings, which also sais which of the three types of entities should be used to drive the heuristical construction (only occluders by default) */ virtual bool BuildKdTree(); /** Compute visibility method. This method has to be reimplemented by the actual Preprocessor implementation (e.g. SamplingPreprocessor, ExactPreprocessor, GlobalSamplingpreprocessor) */ virtual bool ComputeVisibility() = 0; protected: /// scene graph loaded from file SceneGraph *mSceneGraph; /// BSP tree representing the viewcells BspTree *mViewCellBspTree; /// kD-tree organizing the scene graph (occluders + occludees) + viewcells KdTree *mKdTree; /// list of all loaded occluders MeshContainer mOccluders; /// list of all loaded occludees MeshContainer mOccludees; /// list of all loaded/generated viewcells ViewCellContainer mViewcells; }; }; #endif