channelUpdateVisitor.h

00001 
00002 /* Copyright (c) 2007-2010, 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 "compoundVisitor.h" // base class
00022 
00023 #include <eq/client/colorMask.h>
00024 #include <eq/client/eye.h>
00025 #include <eq/client/os.h>
00026 #include <eq/client/renderContext.h>
00027 
00028 namespace eq
00029 {
00030 namespace server
00031 {
00032     class Channel;
00033     class FrustumData;
00034     
00036     class ChannelUpdateVisitor : public CompoundVisitor
00037     {
00038     public:
00039         ChannelUpdateVisitor( Channel* channel, const uint32_t frameID, 
00040                               const uint32_t frameNumber );
00041         virtual ~ChannelUpdateVisitor() {}
00042 
00043         void setEye( const eq::Eye eye ) { _eye = eye; }
00044 
00046         virtual VisitorResult visitPre( const Compound* compound );
00048         virtual VisitorResult visitLeaf( const Compound* compound );
00050         virtual VisitorResult visitPost( const Compound* compound );
00051 
00052         bool isUpdated() const { return _updated; }
00053 
00054     private:
00055         Channel*       _channel;
00056         eq::Eye        _eye;
00057         const uint32_t _frameID;
00058         const uint32_t _frameNumber;
00059         bool           _updated;
00060 
00061         bool _skipCompound( const Compound* compound );
00062 
00063         void _updateDrawFinish( const Compound* compound ) const;
00064         void _updateFrameRate( const Compound* compound ) const;
00065 
00066         GLenum _getDrawBuffer() const;
00067         eq::ColorMask _getDrawBufferMask( const Compound* compound ) const;
00068 
00069         void _setupRenderContext( const Compound* compound,
00070                                   eq::RenderContext& context );
00071 
00072         void _computeFrustum( const Compound* compound,
00073                               eq::RenderContext& context );
00074         eq::Vector3f _getEyePosition( const Compound* compound ) const;
00075         const eq::Matrix4f& _getInverseHeadMatrix( const Compound* compound )
00076             const;
00077 
00078         void   _computeFrustumCorners( eq::Frustumf& frustum,
00079                                        const Compound* compound,
00080                                        const FrustumData& frustumData,
00081                                        const eq::Vector3f& eye,
00082                                        const bool ortho );
00083         void _updatePostDraw( const Compound* compound, 
00084                               const eq::RenderContext& context );
00085         void _updateAssemble( const Compound* compound,
00086                               const eq::RenderContext& context );
00087         void _updateReadback( const Compound* compound,
00088                               const eq::RenderContext& context );  
00089         void _updateViewStart( const Compound* compound,
00090                                const eq::RenderContext& context );
00091         void _updateViewFinish( const Compound* compound,
00092                                 const eq::RenderContext& context );
00093     };
00094 }
00095 }
00096 #endif // EQSERVER_CONSTCOMPOUNDVISITOR_H
Generated on Sat Feb 6 12:59:45 2010 for Equalizer 0.9.1 by  doxygen 1.6.1