channelUpdateVisitor.h

00001 
00002 /* Copyright (c) 2007-2008, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef EQSERVER_CHANNELUPDATEVISITOR_H
00019 #define EQSERVER_CHANNELUPDATEVISITOR_H
00020 
00021 #include "constCompoundVisitor.h" // base class
00022 
00023 #include <eq/client/colorMask.h>
00024 #include <eq/client/eye.h>
00025 #include <eq/client/renderContext.h>
00026 #include <eq/client/windowSystem.h>
00027 
00028 namespace eq
00029 {
00030 namespace server
00031 {
00032     class Channel;
00033     class FrustumData;
00034     
00038     class ChannelUpdateVisitor : public ConstCompoundVisitor
00039     {
00040     public:
00041         ChannelUpdateVisitor( Channel* channel, const uint32_t frameID, 
00042                               const uint32_t frameNumber );
00043         virtual ~ChannelUpdateVisitor() {}
00044 
00045         void setEye( const eq::Eye eye ) { _eye = eye; }
00046 
00048         virtual VisitorResult visitPre( const Compound* compound );
00050         virtual VisitorResult visitLeaf( const Compound* compound );
00052         virtual VisitorResult visitPost( const Compound* compound );
00053 
00054         bool isUpdated() const { return _updated; }
00055 
00056     private:
00057         Channel*       _channel;
00058         eq::Eye        _eye;
00059         const uint32_t _frameID;
00060         const uint32_t _frameNumber;
00061         bool           _updated;
00062 
00063         bool _skipCompound( const Compound* compound );
00064 
00065         void _updateDrawFinish( const Compound* compound ) const;
00066         void _updateFrameRate( const Compound* compound ) const;
00067 
00068         GLenum _getDrawBuffer() const;
00069         eq::ColorMask _getDrawBufferMask( const Compound* compound ) const;
00070 
00071         void _setupRenderContext( const Compound* compound,
00072                                   eq::RenderContext& context );
00073 
00074         void _computeFrustum( const Compound* compound,
00075                               eq::RenderContext& context );
00076         eq::Vector3f _getEyePosition( const Compound* compound ) const;
00077         const eq::Matrix4f& _getInverseHeadMatrix( const Compound* compound )
00078             const;
00079 
00080         void   _computeFrustumCorners( eq::Frustumf& frustum,
00081                                        const Compound* compound,
00082                                        const FrustumData& frustumData,
00083                                        const eq::Vector3f& eye,
00084                                        const bool ortho );
00085         void _updatePostDraw( const Compound* compound, 
00086                               const eq::RenderContext& context );
00087         void _updateAssemble( const Compound* compound,
00088                               const eq::RenderContext& context );
00089         void _updateReadback( const Compound* compound,
00090                               const eq::RenderContext& context );  
00091         void _updateViewStart( const Compound* compound,
00092                                const eq::RenderContext& context );
00093         void _updateViewFinish( const Compound* compound,
00094                                 const eq::RenderContext& context );
00095     };
00096 }
00097 }
00098 #endif // EQSERVER_CONSTCOMPOUNDVISITOR_H
Generated on Mon Aug 10 18:58:31 2009 for Equalizer 0.9 by  doxygen 1.5.8