Ignore:
Timestamp:
06/27/08 13:33:46 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.h

    r2800 r2801  
    3939        int mNumStateChanges; 
    4040        int mNumBatches; 
    41          
    42         double mRenderTime; 
    4341 
    4442        double mWaitTime; 
     
    5351{ 
    5452public: 
    55          
     53 
     54        /** Default constructor. 
     55        */ 
     56        RenderTraverser(); 
     57        /** Virtual constructor, has to be redefined in subclasses 
     58        */ 
     59        virtual ~RenderTraverser(); 
     60        /** Abstract method that traverses and renders the scene 
     61        */ 
     62        void RenderScene(); 
     63 
    5664        enum {CULL_FRUSTUM, STOP_AND_WAIT, CHC, CHCPLUSPLUS, NUM_TRAVERSAL_TYPES}; 
    57  
    58         RenderTraverser(); 
    59         ~RenderTraverser(); 
    60  
    61         //! Renders the scene with the specified method 
    62         /** 
    63                 The method is one of 
     65        /** Returns the type of the traversal. 
     66            The type is one of 
    6467                CULL_FRUSTUM: view frustum culling only 
    6568                STOP_AND_WAIT: hierarchical stop and wait algorithm 
     
    6770                CHCPLUSPLUS: coherent hierarchical algorithm revisited 
    6871        */ 
    69         void RenderScene(); 
     72        virtual int GetType() const = 0; 
    7073        /** Sets the scene hierarchy. 
    7174        */ 
     
    7477        */ 
    7578        void SetCamera(Camera *cam)  {mCamera = cam;} 
     79        /** Sets the render queue. 
     80        */ 
     81        void SetRenderQueue(RenderQueue *rq) {mRenderQueue =rq;} 
    7682        /** Renders a visualization of the hierarchy 
    7783        */ 
     
    8692        */ 
    8793        int GetCurrentFrameId() const { return mFrameId; } 
    88  
    89  
     94         
    9095        ////////////////// 
    9196        //-- options for the different rendering algorithms 
     
    95100        */ 
    96101        void SetUseRenderQueue(bool useRenderQueue); 
     102        /** If depth pass should be used. 
     103                If true, the entities found visible in the current pass are stored 
     104        */ 
     105        void SetUseDepthPass(bool storeVisibleObjects); 
    97106        /** Sets visible pixels threshold for visibility classification 
    98107        */ 
    99108        void SetVisibilityThreshold(int threshold); 
    100  
    101109 
    102110        /////////////////// 
    103111        //-- CHC / CHC ++ related options 
    104112 
    105  
    106113        /** CHC optimization to query the geometry itself instead of the bounding box. 
    107114        */ 
     
    122129        */ 
    123130        void SetShowBounds(bool showBounds); 
    124  
    125         virtual int GetType() const = 0; 
    126          
     131        /** Returns the entities found visible in current frame 
     132            (only if StoreVisibleObjects is set) 
     133        */ 
     134        const SceneEntityContainer &GetVisibleObjects() const { return mVisibleObjects; } 
     135 
    127136protected: 
    128137 
     
    172181        TraversalStatistics mStats; 
    173182         
    174         RenderQueue mRenderQueue; 
     183        RenderQueue *mRenderQueue; 
     184 
     185        /// the objects found visible in current frame 
     186        SceneEntityContainer mVisibleObjects; 
    175187 
    176188 
     
    194206        bool mShowBounds; 
    195207 
    196         // timers 
    197         PerfTimer restTimer; 
    198         PerfTimer waitTimer; 
    199         PerfTimer queryTimer; 
     208        bool mUseDepthPass; 
    200209}; 
    201210 
     
    207216 
    208217 
     218/// timers for detailed benchmarks 
     219static PerfTimer restTimer; 
     220static PerfTimer waitTimer; 
     221static PerfTimer queryTimer; 
     222 
    209223} 
    210224 
Note: See TracChangeset for help on using the changeset viewer.