compoundExitVisitor.cpp

00001 
00002 /* Copyright (c) 2007-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 "compoundExitVisitor.h"
00019 
00020 #include "config.h"
00021 #include "frame.h"
00022 #include "swapBarrier.h"
00023 #include "window.h"
00024 
00025 #include <eq/client/log.h>
00026 
00027 using namespace std;
00028 using namespace eq::base;
00029 
00030 namespace eq
00031 {
00032 namespace server
00033 {
00034 CompoundExitVisitor::CompoundExitVisitor()
00035 {}
00036 
00037 VisitorResult CompoundExitVisitor::visit( Compound* compound )
00038 {
00039     Config* config = compound->getConfig();
00040     EQASSERT( config );
00041 
00042     const std::vector< Frame* >& outputFrames = compound->getOutputFrames();
00043     for( vector<Frame*>::const_iterator i = outputFrames.begin(); 
00044          i != outputFrames.end(); ++i )
00045     {
00046         Frame* frame = *i;
00047         frame->flush();
00048         config->deregisterObject( frame );
00049     }
00050 
00051     const std::vector< Frame* >& inputFrames = compound->getInputFrames();
00052     for( vector<Frame*>::const_iterator i = inputFrames.begin(); 
00053          i != inputFrames.end(); ++i )
00054     {
00055         Frame* frame = *i;
00056         config->deregisterObject( frame );
00057     }
00058 
00059     Channel* channel = compound->getChannel();
00060     if( compound->isDestination() && !channel->getSegment( ))
00061     {
00062         EQASSERT( !channel->getView( ));
00063         
00064         // old-school (non-Layout) destination channel, deactivate compound
00065         //  layout destination channel compounds are deactivated by canvas
00066         compound->deactivate();
00067     }
00068     
00069     return TRAVERSE_CONTINUE;    
00070 }
00071 
00072 }
00073 }
Generated on Mon Aug 10 18:58:32 2009 for Equalizer 0.9 by  doxygen 1.5.8