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 "compoundVisitor.h"
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