Line data Source code
1 :
2 : /* Copyright (c) 2008-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 "configUpdateDataVisitor.h"
19 :
20 : #include "channel.h"
21 : #include "node.h"
22 : #include "pipe.h"
23 : #include "view.h"
24 : #include "window.h"
25 :
26 : namespace eq
27 : {
28 : namespace server
29 : {
30 2 : ConfigUpdateDataVisitor::ConfigUpdateDataVisitor()
31 : : _lastDrawChannel(0)
32 : , _lastDrawWindow(0)
33 2 : , _lastDrawPipe(0)
34 : {
35 2 : }
36 :
37 2 : VisitorResult ConfigUpdateDataVisitor::visitPre(Node*)
38 : {
39 2 : _lastDrawPipe = 0;
40 2 : return TRAVERSE_CONTINUE;
41 : }
42 2 : VisitorResult ConfigUpdateDataVisitor::visitPost(Node* node)
43 : {
44 2 : node->setLastDrawPipe(_lastDrawPipe);
45 2 : return TRAVERSE_CONTINUE;
46 : }
47 :
48 4 : VisitorResult ConfigUpdateDataVisitor::visitPre(Pipe*)
49 : {
50 4 : _lastDrawWindow = 0;
51 4 : return TRAVERSE_CONTINUE;
52 : }
53 4 : VisitorResult ConfigUpdateDataVisitor::visitPost(Pipe* pipe)
54 : {
55 4 : pipe->setLastDrawWindow(_lastDrawWindow);
56 4 : if (_lastDrawWindow)
57 4 : _lastDrawPipe = pipe;
58 4 : return TRAVERSE_CONTINUE;
59 : }
60 :
61 4 : VisitorResult ConfigUpdateDataVisitor::visitPre(Window*)
62 : {
63 4 : _lastDrawChannel = 0;
64 4 : return TRAVERSE_CONTINUE;
65 : }
66 4 : VisitorResult ConfigUpdateDataVisitor::visitPost(Window* window)
67 : {
68 4 : window->setLastDrawChannel(_lastDrawChannel);
69 4 : if (_lastDrawChannel)
70 4 : _lastDrawWindow = window;
71 4 : return TRAVERSE_CONTINUE;
72 : }
73 :
74 18 : VisitorResult ConfigUpdateDataVisitor::visit(Channel* channel)
75 : {
76 18 : if (channel->getLastDrawCompound())
77 4 : _lastDrawChannel = channel;
78 :
79 18 : return TRAVERSE_CONTINUE;
80 : }
81 : }
82 60 : }
|