Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OcclusionCullTraverser.h

Go to the documentation of this file.
00001 // Copyright NVIDIA Corporation 2002-2004
00002 // TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
00003 // *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
00004 // OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
00005 // AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
00006 // BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
00007 // WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
00008 // BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
00009 // ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
00010 // BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES 
00011 
00012 #pragma once
00013 
00015 #include "nvsgcommon.h"
00016 
00017 #include "nvtraverser/CullTraverser.h"
00018 #include "nvtraverser/OcclusionCullGLTraverser.h"
00019 
00020 namespace nvtraverser
00021 {
00023 
00026   class OcclusionCullTraverser : public CullTraverser
00027   {
00028     public:
00030       NVSG_API OcclusionCullTraverser(void);
00031 
00032       // We need this for the contained OcclusionCullGLTraverser
00033       //
00035       //** \return The currently used geometry caching technique. */
00036       NVSG_API RenderTraverser::GeometryCacheTechnique getGeometryCacheTechnique( void ) const;
00038 
00039       NVSG_API bool isGeometryCacheTechniqueSupported( RenderTraverser::GeometryCacheTechnique gct  
00040                                                      ) const;
00042 
00043       NVSG_API bool setGeometryCacheTechnique( RenderTraverser::GeometryCacheTechnique gct          
00044                                              );
00045     protected:
00047       NVSG_API virtual ~OcclusionCullTraverser(void);
00048         
00049       // doApply override
00050       NVSG_API virtual void doApply( const nvsg::ViewState *pViewState, const nvsg::Scene *pScene );
00051 
00052       //  Reimplemented from CullTraverser
00053       NVSG_API virtual nvsg::CullCode cullCode( const nvsg::Drawable *p ) const;
00054       NVSG_API virtual nvsg::CullCode cullCode( const nvsg::Node *p ) const;
00055 
00056     private:
00057       OcclusionCullGLTraverser  * m_glTraverser;
00058       mutable size_t              m_index;
00059       std::vector<GLuint>       * m_queries;
00060 #if defined( _DEBUG )
00061       std::vector<const nvsg::Drawable *> * m_drawables;
00062 #endif
00063   };
00064 
00065   inline RenderTraverser::GeometryCacheTechnique OcclusionCullTraverser::getGeometryCacheTechnique() const
00066   {
00067     __ASSERT( m_glTraverser );
00068     return m_glTraverser->getGeometryCacheTechnique();
00069   }
00070 
00071   inline bool OcclusionCullTraverser::isGeometryCacheTechniqueSupported(RenderTraverser::GeometryCacheTechnique gct) const
00072   {
00073     __ASSERT( m_glTraverser );
00074     return m_glTraverser->isGeometryCacheTechniqueSupported(gct);
00075   }
00076 
00077   inline bool OcclusionCullTraverser::setGeometryCacheTechnique(RenderTraverser::GeometryCacheTechnique gct)
00078   {
00079     __ASSERT( m_glTraverser );
00080     return m_glTraverser->setGeometryCacheTechnique(gct);
00081   }
00082                                              
00083 }
00084 

Generated on Tue Mar 1 13:19:20 2005 for NVSGSDK by NVIDIA