Changeset 71 for trunk/VUT/GtpVisibility


Ignore:
Timestamp:
04/29/05 18:32:50 (19 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/GtpVisibility
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibility/include/PreprocessingManager.h

    r67 r71  
    1111namespace GtpVisibility { 
    1212   
    13   /** 
    14      This class defines an interface to the external visibility preprocessor. 
    15      It allows to export the static part of the scene to a file in the XML format 
    16      understood by the preprocessor. By default all the exported meshes are considered 
    17      as scene occluders, whereas occludees are formed by their bounding boxes, 
    18      and bounding boxes of the scene hierarchy. 
     13/** 
     14        This class defines an interface to the external visibility preprocessor. 
     15    It allows to export the static part of the scene to a file in the XML format 
     16    understood by the preprocessor. By default all the exported meshes are considered 
     17    as scene occluders, whereas occludees are formed by their bounding boxes, 
     18    and bounding boxes of the scene hierarchy. 
    1919 
    20      This class also allows to import the preprocessed data with PVS 
    21      information for the viewcells (note that the viewcells are either generated 
    22      automatically by the preprocessor or loaded from a polyhedral definition stored 
    23      in a file (see documentation for the Preprocessor class). 
    24   */ 
     20    This class also allows to import the preprocessed data with PVS 
     21    information for the viewcells (note that the viewcells are either generated 
     22    automatically by the preprocessor or loaded from a polyhedral definition stored 
     23    in a file (see documentation for the Preprocessor class). 
     24*/ 
    2525   
    26   class PreprocessingManager 
    27   { 
    28   public: 
     26class PreprocessingManager 
     27{ 
     28public: 
    2929     
    30     /** 
    31        Constructor taking a HierarchyInterface as argument. 
    32        The HierarchyInterface makes the PreprocessingManager independent from the actual 
    33        scene representation as long as it supports a required set of methods. 
    34      */ 
    35     PreprocessingManager( HierarchyInterface *hierarchyInterface ); 
     30        /** Constructor taking a HierarchyInterface as argument. 
     31        The HierarchyInterface makes the PreprocessingManager independent from the actual 
     32        scene representation as long as it supports a required set of methods. 
     33    */ 
     34    PreprocessingManager(HierarchyInterface *hierarchyInterface); 
    3635     
    3736 
    3837    /** 
    39        Destructor which deletes all data describing static scene visibility. 
     38        Destructor which deletes all data describing static scene visibility. 
    4039    */ 
    4140    virtual ~PreprocessingManager(); 
    4241 
    43     /** 
    44        Export the scene for visibility preprocessing. Exports the hierarchyInterface including 
    45        its bounding boxes + mesh data. Note that the bounding boxes can be used as occludees 
    46        by the extrenal preprocessor. The viewcell data will either be supplied directly to the 
    47        visibility preprocessing standalone module. 
     42    /** Export the scene for visibility preprocessing. Exports the hierarchyInterface including 
     43        its bounding boxes + mesh data. Note that the bounding boxes can be used as occludees 
     44        by the extrenal preprocessor. The viewcell data will either be supplied directly to the 
     45        visibility preprocessing standalone module. 
    4846 
    49        @param filename name of the file to export. 
    50        @return true if the export was succesful. 
     47        @param filename name of the file to export. 
     48        @return true if the export was succesful. 
    5149    */ 
    52     virtual bool ExportScene(const string filename 
    53                              ) = 0; 
     50    virtual bool ExportScene(const string filename) = 0; 
    5451     
    55     /** 
    56        Load preprocessed visibility information. The loaded data is matched with the current 
    57        scene graph. The topology of the current scene graph has to match with the loaded data. 
    58        There is also geometrical check of the bounding boxes. Once loading is succesful the 
    59        PreprocessingManager establishes links from its internal visibility representation 
    60        to the scene graph: no change of this part of the scene graph is allowed; this would 
    61        violate the static scene assumption! 
     52        /** Load preprocessed visibility information. The loaded data is matched with the current 
     53        scene graph. The topology of the current scene graph has to match with the loaded data. 
     54        There is also geometrical check of the bounding boxes. Once loading is succesful the 
     55        PreprocessingManager establishes links from its internal visibility representation 
     56        to the scene graph: no change of this part of the scene graph is allowed; this would 
     57        violate the static scene assumption! 
    6258 
    63        @param filename name of the file to load. 
    64        @return true if the loading was succesful. 
     59        @param filename name of the file to load. 
     60        @return true if the loading was succesful. 
    6561    */ 
    66     virtual bool LoadPreprocessedData(const string filename 
    67                                       ) = 0; 
     62    virtual bool LoadPreprocessedData(const string filename) = 0; 
    6863     
    6964    /**  
  • trunk/VUT/GtpVisibility/include/QueryManager.h

    r65 r71  
    1919    output of the visibility preprocessor. 
    2020*/ 
    21   class QueryManager 
    22   { 
    23   public: 
     21class QueryManager 
     22{ 
     23public: 
    2424    /** Constructor taking a hierarchy interface as an argument. This allows to operate 
    2525        onm different hierarchy types, while reusing the implementation of the query methods. 
     
    7474 
    7575      @return true if there is any intersection.  
    76   */ 
     76        */ 
    7777    virtual bool 
    7878    ShootRay(const Ray &ray, 
     
    8181             ); 
    8282   
    83   /** Sets the scene traverser. 
     83        /** Sets the scene traverser. 
    8484      @remark the scene traverser depends on the type of hierarchyInterface the scene consists of. 
    85   */ 
    86   void SetSceneTraverser(HierarchyInterface *hierarchyInterface ); 
     85        */ 
     86        void SetSceneTraverser(HierarchyInterface *hierarchyInterface ); 
    8787 
    8888protected: 
  • trunk/VUT/GtpVisibility/include/VisibilityEnvironment.h

    r59 r71  
    2020}; 
    2121} // namespace GtpVisibility 
     22 
     23/** @}*/ // end of group Visibility 
     24 
    2225#endif // VisibilityEnvironment_H 
  • trunk/VUT/GtpVisibility/include/VisibilityInfo.h

    r65 r71  
    99namespace GtpVisibility { 
    1010   
    11   /** Class storing the visibility information of a scene node.  
    12    */ 
    13   class NodeInfo { 
    14   public: 
    15     NodeInfo(HierarchyNode *node, 
    16              const float v): 
    17       mNode(node), mVisibility(v) {} 
     11/** Class storing the visibility information of a scene node.  
     12*/ 
     13class NodeInfo  
     14{ 
     15public: 
     16    NodeInfo(HierarchyNode *node,const float v): mNode(node), mVisibility(v) {} 
    1817 
    19   protected: 
     18protected: 
    2019    /** pointer to the scene node */ 
    2120    HierarchyNode *mNode; 
     
    2423        total number of ratsterized pixels */ 
    2524    float mVisibility; 
    26   }; 
     25}; 
    2726   
     27/** Class storing the visibility information of a mesh. 
     28*/ 
     29class MeshInfo  
     30{ 
     31public: 
     32        MeshInfo(Mesh *mesh, const float v): mMesh(mesh), mVisibility(v) {} 
     33 
     34protected: 
     35    /** Pointer to the mesh. 
     36        */ 
     37    Mesh *mMesh; 
     38    /** Node visibility can either be a number of visible pixels or relative 
     39        number of visible pixels (if the hardware queries will provide the 
     40        total number of ratsterized pixels. 
     41        */ 
     42    float mVisibility; 
     43}; 
    2844   
    29   /** Class storing the visibility information of a mesh.  
    30    */ 
    31   class MeshInfo { 
    32   public: 
    33     MeshInfo(Mesh *mesh, 
    34              const float v): 
    35       mMesh(mesh), mVisibility(v) {} 
    36  
    37   protected: 
    38     /** pointer to the scene node */ 
    39     Mesh *mMesh; 
    40     /** node visibility can either be a number of visible pixels or relative 
    41         number of visible pixels (if the hardware queries will provide the 
    42         total number of ratsterized pixels */ 
    43     float mVisibility; 
    44   }; 
    45    
    46   // this define shall be replaced by template typedef 
     45//TODO: this define shall be replaced by template typedef 
    4746#define InfoContainer std::vector 
    4847}; 
  • trunk/VUT/GtpVisibility/include/VisibilityManager.h

    r65 r71  
    1 #ifndef _Manager_H__ 
    2 #define _Manager_H__ 
     1#ifndef _VisibilityManager_H__ 
     2#define _VisibilityManager_H__ 
    33 
    44#include "CullingManager.h" 
    55#include "VisibilityEnvironment.h" 
    6  
    76 
    87/** This namespace includes all classes which are created by the VUT (Vienna University 
     
    109        and are not directly derived from an Ogre class. 
    1110*/ 
    12  
    1311namespace GtpVisibility { 
    1412 
     
    5250}; 
    5351} // namespace GtpVisibility 
     52 
    5453#endif // VisibilityManager 
  • trunk/VUT/GtpVisibility/include/VisibilityMesh.h

    r65 r71  
    99 
    1010 
    11  
    12 #endif 
     11#endif // VisibilityMesh.h 
  • trunk/VUT/GtpVisibility/scripts/GtpVisibility.vcproj

    r64 r71  
    2020                                Name="VCCLCompilerTool" 
    2121                                Optimization="0" 
    22                                 AdditionalIncludeDirectories="..\include" 
     22                                AdditionalIncludeDirectories=""$(OGRE_PATH)/OgreMain/include";..\include" 
    2323                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB" 
    2424                                MinimalRebuild="TRUE" 
     
    106106                        </File> 
    107107                        <File 
     108                                RelativePath="..\src\DummyPreprocessingManager.cpp"> 
     109                        </File> 
     110                        <File 
     111                                RelativePath="..\src\DummyQueryManager.cpp"> 
     112                        </File> 
     113                        <File 
    108114                                RelativePath="..\src\FrustumCullingManager.cpp"> 
    109115                        </File> 
    110116                        <File 
    111117                                RelativePath="..\src\HierarchyInterface.cpp"> 
     118                        </File> 
     119                        <File 
     120                                RelativePath="..\src\PreprocessingManager.cpp"> 
     121                        </File> 
     122                        <File 
     123                                RelativePath="..\src\QueryManager.cpp"> 
    112124                        </File> 
    113125                        <File 
     
    161173                                RelativePath="..\include\VisibilityManager.h"> 
    162174                        </File> 
     175                        <File 
     176                                RelativePath="..\include\VisibilityMesh.h"> 
     177                        </File> 
    163178                </Filter> 
    164179        </Files> 
  • trunk/VUT/GtpVisibility/src/PreprocessingManager.cpp

    r65 r71  
    33namespace GtpVisibility { 
    44   
    5    
    6   bool 
    7   PreprocessingManager::GetPVS( 
    8                                const Vector3 &center, 
    9                                const float radius, 
    10                                InfoContainer<NodeInfo> *visibleNodes, 
    11                                InfoContainer<MeshInfo> *visibleMeshes ) 
    12   { 
     5PreprocessingManager::PreprocessingManager(HierarchyInterface *hierarchyInterface) 
     6{ 
     7} 
     8 
     9PreprocessingManager::~PreprocessingManager() 
     10{ 
     11} 
     12 
     13bool PreprocessingManager::GetPVS(const Vector3 &center, 
     14                                                                  const float radius, 
     15                                                                  InfoContainer<NodeInfo> *visibleNodes, 
     16                                                                  InfoContainer<MeshInfo> *visibleMeshes) 
     17{ 
    1318    vector<int> viewCellIds; 
    14     if (LocateViewCellIds(center, radius, &viewCellIds)) { 
    15       for (vector<int>::iterator ci = viewCellIds.begin(); 
    16            ci != viewCellIds.end(); 
    17            ci++) { 
    18         AddViewCellPVS(*ci, 
    19                        visibleNodes, 
    20                        visibleMeshes ); 
    21         // remove duplicates of the PVS entries if any? 
    22       } 
    23       return true; 
     19    if (LocateViewCellIds(center, radius, &viewCellIds))  
     20        { 
     21                for (vector<int>::iterator ci = viewCellIds.begin(); ci != viewCellIds.end(); ci++)  
     22                { 
     23                        AddViewCellPVS(*ci, visibleNodes, visibleMeshes ); 
     24                        // remove duplicates of the PVS entries if any? 
     25                } 
     26                return true; 
    2427    } 
    2528    return false; 
  • trunk/VUT/GtpVisibility/src/QueryManager.cpp

    r65 r71  
    33 
    44namespace GtpVisibility { 
     5  
     6QueryManager::QueryManager(HierarchyInterface *hierarchyInterface) 
     7{ 
     8} 
     9  
     10bool QueryManager::ShootRay(const Ray &ray, std::vector<Mesh *> *visibleMeshes, bool isGlobalLine) 
     11{ 
     12    // run OGRE ray shooting query 
     13    return false; 
     14} 
    515   
    6   bool 
    7   QueryManager::ShootRay(const Ray &ray, 
    8                          std::vector<Mesh *> *visibleMeshes, 
    9                          bool isGlobalLine 
    10                          ) 
    11   { 
    12     // run OGRE ray shooting query 
    13      
    14  
    15     return false; 
    16   } 
    17    
    18    
    19 }; 
     16} // namespace GtpVisibility 
Note: See TracChangeset for help on using the changeset viewer.