00001 00002 /* Copyright (c) 2008-2009, Stefan Eilemann <eile@equalizergraphics.com> 00003 * 00004 * This library is free software; you can redistribute it and/or modify it under 00005 * the terms of the GNU Lesser General Public License version 2.1 as published 00006 * by the Free Software Foundation. 00007 * 00008 * This library is distributed in the hope that it will be useful, but WITHOUT 00009 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00010 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00011 * details. 00012 * 00013 * You should have received a copy of the GNU Lesser General Public License 00014 * along with this library; if not, write to the Free Software Foundation, Inc., 00015 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00016 */ 00017 00018 #include "configUpdateDataVisitor.h" 00019 00020 #include "channel.h" 00021 #include "node.h" 00022 #include "pipe.h" 00023 #include "window.h" 00024 00025 using namespace std; 00026 00027 namespace eq 00028 { 00029 namespace server 00030 { 00031 ConfigUpdateDataVisitor::ConfigUpdateDataVisitor() 00032 : _lastDrawChannel( 0 ) 00033 , _lastDrawWindow( 0 ) 00034 , _lastDrawPipe( 0 ) 00035 {} 00036 00037 00038 VisitorResult ConfigUpdateDataVisitor::visitPre( Node* node ) 00039 { 00040 _lastDrawPipe = 0; 00041 return TRAVERSE_CONTINUE; 00042 } 00043 VisitorResult ConfigUpdateDataVisitor::visitPost( Node* node ) 00044 { 00045 node->setLastDrawPipe( _lastDrawPipe ); 00046 return TRAVERSE_CONTINUE; 00047 } 00048 00049 VisitorResult ConfigUpdateDataVisitor::visitPre( Pipe* pipe ) 00050 { 00051 _lastDrawWindow = 0; 00052 return TRAVERSE_CONTINUE; 00053 } 00054 VisitorResult ConfigUpdateDataVisitor::visitPost( Pipe* pipe ) 00055 { 00056 pipe->setLastDrawWindow( _lastDrawWindow ); 00057 if( _lastDrawWindow ) 00058 _lastDrawPipe = pipe; 00059 return TRAVERSE_CONTINUE; 00060 } 00061 00062 VisitorResult ConfigUpdateDataVisitor::visitPre( Window* window ) 00063 { 00064 _lastDrawChannel = 0; 00065 return TRAVERSE_CONTINUE; 00066 } 00067 VisitorResult ConfigUpdateDataVisitor::visitPost( Window* window ) 00068 { 00069 window->setLastDrawChannel( _lastDrawChannel ); 00070 if( _lastDrawChannel ) 00071 _lastDrawWindow = window; 00072 return TRAVERSE_CONTINUE; 00073 } 00074 00075 VisitorResult ConfigUpdateDataVisitor::visit( Channel* channel ) 00076 { 00077 if( channel->getLastDrawCompound( )) 00078 _lastDrawChannel = channel; 00079 00080 return TRAVERSE_CONTINUE; 00081 } 00082 00083 } 00084 }
0.9 by
1.5.8