channelUpdateVisitor.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef EQSERVER_CHANNELUPDATEVISITOR_H
00019 #define EQSERVER_CHANNELUPDATEVISITOR_H
00020
00021 #include "constCompoundVisitor.h"
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