Line data Source code
1 :
2 : /* Copyright (c) 2007-2011, Stefan Eilemann <eile@equalizergraphics.com>
3 : *
4 : * This library is free software; you can redistribute it and/or modify it under
5 : * the terms of the GNU Lesser General Public License version 2.1 as published
6 : * by the Free Software Foundation.
7 : *
8 : * This library is distributed in the hope that it will be useful, but WITHOUT
9 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 : * details.
12 : *
13 : * You should have received a copy of the GNU Lesser General Public License
14 : * along with this library; if not, write to the Free Software Foundation, Inc.,
15 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 : */
17 :
18 : #ifndef EQSERVER_CHANNELUPDATEVISITOR_H
19 : #define EQSERVER_CHANNELUPDATEVISITOR_H
20 :
21 : #include "compoundVisitor.h" // base class
22 : #include "types.h"
23 :
24 : #include <eq/fabric/eye.h> // member
25 :
26 : namespace eq
27 : {
28 : namespace fabric
29 : {
30 : class ColorMask;
31 : class RenderContext;
32 : }
33 :
34 : namespace server
35 : {
36 : class Channel;
37 : class FrustumData;
38 :
39 : /** The compound visitor generating the draw tasks for a channel. */
40 : class ChannelUpdateVisitor : public CompoundVisitor
41 : {
42 : public:
43 : ChannelUpdateVisitor( Channel* channel, const uint128_t frameID,
44 : const uint32_t frameNumber );
45 31 : virtual ~ChannelUpdateVisitor() {}
46 :
47 93 : void setEye( const fabric::Eye eye ) { _eye = eye; }
48 :
49 : /** Visit a non-leaf compound on the down traversal. */
50 : virtual VisitorResult visitPre( const Compound* compound );
51 : /** Visit a leaf compound. */
52 : virtual VisitorResult visitLeaf( const Compound* compound );
53 : /** Visit a non-leaf compound on the up traversal. */
54 : virtual VisitorResult visitPost( const Compound* compound );
55 :
56 31 : bool isUpdated() const { return _updated; }
57 :
58 : private:
59 : Channel* _channel;
60 : fabric::Eye _eye;
61 : const uint128_t _frameID;
62 : const uint32_t _frameNumber;
63 : bool _updated;
64 :
65 : bool _skipCompound( const Compound* compound );
66 : void _sendClear( const RenderContext& context );
67 :
68 : void _updateDraw( const Compound* compound,
69 : const RenderContext& context );
70 : void _updateDrawTiles( const Compound* compound,
71 : const RenderContext& context );
72 : void _updateDrawFinish( const Compound* compound ) const;
73 : void _updateFrameRate( const Compound* compound ) const;
74 :
75 : uint32_t _getDrawBuffer( const Compound* compound ) const;
76 : fabric::ColorMask _getDrawBufferMask( const Compound* compound ) const;
77 :
78 : void _setupRenderContext( const Compound* compound,
79 : RenderContext& context );
80 :
81 : void _updatePostDraw( const Compound* compound,
82 : const fabric::RenderContext& context );
83 : void _updateAssemble( const Compound* compound,
84 : const fabric::RenderContext& context );
85 : void _updateReadback( const Compound* compound,
86 : const fabric::RenderContext& context );
87 : void _updateViewStart( const Compound* compound,
88 : const fabric::RenderContext& context );
89 : void _updateViewFinish( const Compound* compound,
90 : const fabric::RenderContext& context );
91 : };
92 : }
93 : }
94 : #endif // EQSERVER_CONSTCOMPOUNDVISITOR_H
|