Line data Source code
1 :
2 : /* Copyright (c) 2007-2013, Stefan Eilemann <eile@equalizergraphics.com>
3 : * 2011, Daniel Nachbaur <danielnachbaur@gmail.com>
4 : * 2010, Cedric Stalder <cedric.stalder@gmail.com>
5 : *
6 : * This library is free software; you can redistribute it and/or modify it under
7 : * the terms of the GNU Lesser General Public License version 2.1 as published
8 : * by the Free Software Foundation.
9 : *
10 : * This library is distributed in the hope that it will be useful, but WITHOUT
11 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 : * details.
14 : *
15 : * You should have received a copy of the GNU Lesser General Public License
16 : * along with this library; if not, write to the Free Software Foundation, Inc.,
17 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 : */
19 :
20 : #include "compoundInitVisitor.h"
21 :
22 : #include "config.h"
23 : #include "frame.h"
24 : #include "log.h"
25 : #include "segment.h"
26 : #include "view.h"
27 : #include "window.h"
28 :
29 :
30 : namespace eq
31 : {
32 : namespace server
33 : {
34 2 : CompoundInitVisitor::CompoundInitVisitor( )
35 2 : : _taskID( 0 )
36 2 : {}
37 :
38 4 : VisitorResult CompoundInitVisitor::visit( Compound* compound )
39 : {
40 4 : Channel* channel = compound->getChannel();
41 :
42 4 : compound->setTaskID( ++_taskID );
43 4 : if( channel && channel->getView( ))
44 2 : channel->getView()->updateFrusta();
45 : else
46 2 : compound->updateFrustum( Vector3f::ZERO, 1.f );
47 :
48 4 : compound->updateInheritData( 0 ); // Compound::activate needs _inherit.eyes
49 :
50 8 : if( !channel || // non-channel root compounds
51 4 : ( compound->isDestination() && !channel->getSegment( )))
52 : {
53 : // Note: The second case are non-view destination compounds. One use
54 : // case is swap-syncing all output channels using task-less compounds.
55 :
56 2 : LBASSERT( !channel || !channel->getView( ));
57 2 : uint32_t eyes = compound->getEyes();
58 2 : if( eyes == fabric::EYE_UNDEFINED )
59 2 : eyes = fabric::EYES_ALL;
60 :
61 2 : compound->activate( eyes );
62 : }
63 :
64 4 : if( channel )
65 : {
66 2 : compound->updateInheritTasks();
67 2 : channel->addTasks( compound->getInheritTasks( ));
68 : }
69 4 : return TRAVERSE_CONTINUE;
70 : }
71 :
72 : }
73 84 : }
|