Line data Source code
1 :
2 : /* Copyright (c) 2007-2013, 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 : #include "compoundUpdateDataVisitor.h"
19 :
20 : #include "compound.h"
21 :
22 : #include <eq/client/log.h>
23 :
24 : namespace eq
25 : {
26 : namespace server
27 : {
28 : using fabric::TASK_DRAW;
29 :
30 72 : CompoundUpdateDataVisitor::CompoundUpdateDataVisitor(
31 : const uint32_t frameNumber )
32 72 : : _frameNumber( frameNumber )
33 72 : {}
34 :
35 491 : VisitorResult CompoundUpdateDataVisitor::visit( Compound* compound )
36 : {
37 491 : compound->fireUpdatePre( _frameNumber );
38 491 : compound->updateInheritData( _frameNumber );
39 :
40 491 : _updateDrawFinish( compound );
41 491 : return TRAVERSE_CONTINUE;
42 : }
43 :
44 :
45 491 : void CompoundUpdateDataVisitor::_updateDrawFinish( Compound* compound )
46 : {
47 491 : if( compound->testInheritTask( TASK_DRAW ) && compound->isActive( ))
48 : {
49 13 : Channel* channel = compound->getChannel();
50 13 : channel->setLastDrawCompound( compound );
51 : }
52 491 : }
53 :
54 : }
55 27 : }
|