Line data Source code
1 :
2 : /* Copyright (c) 2007-2016, Stefan Eilemann <eile@equalizergraphics.com>
3 : * Daniel Nachbaur <danielnachbaur@gmail.com>
4 : * 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 : namespace eq
30 : {
31 : namespace server
32 : {
33 14 : CompoundInitVisitor::CompoundInitVisitor()
34 14 : : _taskID(0)
35 : {
36 14 : }
37 :
38 132 : VisitorResult CompoundInitVisitor::visit(Compound* compound)
39 : {
40 132 : Channel* channel = compound->getChannel();
41 :
42 132 : compound->setTaskID(++_taskID);
43 132 : if (channel && channel->getView())
44 90 : channel->getView()->updateFrusta();
45 : else
46 42 : compound->updateFrustum(Vector3f(), 1.f);
47 :
48 132 : compound->updateInheritData(0); // Compound::activate needs _inherit.eyes
49 :
50 264 : if (!channel || // non-channel root compounds
51 132 : (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 14 : LBASSERT(!channel || !channel->getView());
57 14 : uint32_t eyes = compound->getEyes();
58 14 : if (eyes == fabric::EYE_UNDEFINED)
59 14 : eyes = fabric::EYES_ALL;
60 :
61 14 : compound->activate(eyes);
62 : }
63 :
64 132 : if (channel)
65 : {
66 118 : compound->updateInheritTasks();
67 118 : channel->addTasks(compound->getInheritTasks());
68 : }
69 132 : return TRAVERSE_CONTINUE;
70 : }
71 : }
72 60 : }
|