source: GTP/trunk/Lib/Vis/OnlineCullingCHC/include/PreprocessingManager.h @ 2353

Revision 2353, 5.1 KB checked in by mattausch, 17 years ago (diff)

cleaned up project files

Line 
1#ifndef _VisibilityPreprocessingManager_H__
2#define _VisibilityPreprocessingManager_H__
3
4#include <string>
5
6#include "HierarchyInterface.h"
7#include "VisibilityInfo.h"
8
9
10namespace GtpVisibility {
11 
12/**
13        This class defines an interface to the external visibility preprocessor.
14    It allows to export the static part of the scene to a file in the XML format
15    understood by the preprocessor. By default all the exported meshes are considered
16    as scene occluders, whereas occludees are formed by their bounding boxes,
17    and bounding boxes of the scene hierarchy.
18
19    This class also allows to import the preprocessed data with PVS
20    information for the viewcells (note that the viewcells are either generated
21    automatically by the preprocessor or loaded from a polyhedral definition stored
22    in a file (see documentation for the Preprocessor class).
23*/
24 
25class PreprocessingManager
26{
27public:
28   
29        /** Constructor taking a HierarchyInterface as argument.
30        The HierarchyInterface makes the PreprocessingManager independent from the actual
31        scene representation as long as it supports a required set of methods.
32    */
33    PreprocessingManager(HierarchyInterface *hierarchyInterface);
34   
35
36    /**
37        Destructor which deletes all data describing static scene visibility.
38    */
39    virtual ~PreprocessingManager();
40
41    /** Export the scene for visibility preprocessing. Exports the hierarchyInterface including
42        its bounding boxes + mesh data. Note that the bounding boxes can be used as occludees
43        by the extrenal preprocessor. The viewcell data will either be supplied directly to the
44        visibility preprocessing standalone module.
45
46        @param filename name of the file to export.
47        @return true if the export was succesful.
48    */
49        virtual bool ExportScene(const std::string &filename) = 0;
50   
51        /** Load preprocessed visibility information. The loaded data is matched with the current
52        scene graph. The topology of the current scene graph has to match with the loaded data.
53        There is also geometrical check of the bounding boxes. Once loading is succesful the
54        PreprocessingManager establishes links from its internal visibility representation
55        to the scene graph: no change of this part of the scene graph is allowed; this would
56        violate the static scene assumption!
57
58        @param filename name of the file to load.
59        @return true if the loading was succesful.
60    */
61        virtual bool LoadPreprocessedData(const std::string &filename) = 0;
62   
63    /**
64        Retrieve a PVS corresponding to the given spherical neighborhood of the point.
65        Typically the implementation of this method will firs locate all viewcells
66        intersecting the sphere using efficient logarithmic search enhanced with caching
67        the last query. Then it computes a union of the PVS for the found viewcells.
68
69        @param point the center point of the spherical neighborhood
70
71        @param radius the radius of the spherical neighborhood. Note that if radius==0 a
72        more efficient implementation of the method for this special case can be used.
73
74        @param visibleNodes of not NULL
75        a set of visible hierarchy nodes is added to the visibleNodes container.
76        This set is formed of visible leafs or fully visible interior nodes.
77
78        @param visibleMeshes if not NULL the set of visible meshes is
79        added to the container. Returns true if the corresponding PVS exists.
80    */
81 /*   virtual bool GetPVS(const Vector3 &point,
82                        const float radius,
83                        NodeInfoContainer *visibleNodes,
84                        MeshInfoContainer *visibleMeshes);
85   */
86   
87 
88    /** Sets the scene traverser.
89        @remark the scene traverser is dependent on the type of hierarchyInterface the scene consists of.
90    */
91    virtual void SetSceneTraverser(HierarchyInterface *hierarchyInterface) {
92      mSceneTraverser = hierarchyInterface;
93    }
94   
95  protected:
96    /** Get checksum of the current occluder set in the scene graph. This method is used to check
97        if the preprocessed data matches the current scene graph
98        -> $$ could be moved to VisibilitySceneTraverser */
99    long GetOccluderChecksum() const {
100      return 0;
101    }
102     
103   
104    /** Get checksum of the current occludee set in the scene graph. This method is used to check
105        if the preprocessed data matches the current scene graph
106        -> $$ could be moved to VisibilitySceneTraverser */
107    long GetOccludeeChecksum() const {
108      return 0;
109    }
110   
111   
112    /**
113        Find viewcells intersecting a spherical neighborhood of a point.
114        Returns false if no viewcell was found.
115    */
116/*    virtual bool LocateViewCellIds(const Vector3 &center,
117                                   const float radius,
118                                   vector<int> *viewCellIds
119                                   ) = 0;
120  */ 
121    /**
122       Add a PVS of the given viewcell to the already evaluated PVS by computing
123       a union with visibleNodes and visibleMeshes. Returns the number of added entries.
124    */
125   /* virtual int AddViewCellPVS(const int cellID,
126                                                           NodeInfoContainer *visibleNodes,
127                                                           MeshInfoContainer *visibleMeshes ) = 0;
128    */
129    HierarchyInterface *mSceneTraverser;
130  };
131 
132};
133
134#endif // VisibilityPreprocessingInterafce
Note: See TracBrowser for help on using the repository browser.