compoundInitVisitor.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "compoundInitVisitor.h"
00019
00020 #include "config.h"
00021 #include "frame.h"
00022 #include "log.h"
00023 #include "segment.h"
00024 #include "view.h"
00025 #include "window.h"
00026 #include "swapBarrier.h"
00027 #include <eq/client/log.h>
00028
00029 using namespace std;
00030 using namespace eq::base;
00031
00032 namespace eq
00033 {
00034 namespace server
00035 {
00036 CompoundInitVisitor::CompoundInitVisitor()
00037 : _taskID( 0 )
00038 {}
00039
00040 VisitorResult CompoundInitVisitor::visit( Compound* compound )
00041 {
00042 compound->setTaskID( ++_taskID );
00043
00044 Channel* channel = compound->getChannel();
00045 if( compound->isDestination() && !channel->getSegment( ))
00046 {
00047 EQASSERT( !channel->getView( ));
00048
00049
00050
00051 compound->activate();
00052 }
00053
00054 Config* config = compound->getConfig();
00055 const uint32_t latency = config->getLatency();
00056 EQASSERT( config );
00057
00058 const std::vector< Frame* >& outputFrames = compound->getOutputFrames();
00059 for( vector<Frame*>::const_iterator i = outputFrames.begin();
00060 i != outputFrames.end(); ++i )
00061 {
00062 Frame* frame = *i;
00063 config->registerObject( frame );
00064 frame->setAutoObsolete( latency );
00065 EQLOG( eq::LOG_ASSEMBLY ) << "Output frame \"" << frame->getName()
00066 << "\" id " << frame->getID() << endl;
00067 }
00068
00069 const std::vector< Frame* >& inputFrames = compound->getInputFrames();
00070 for( vector<Frame*>::const_iterator i = inputFrames.begin();
00071 i != inputFrames.end(); ++i )
00072 {
00073 Frame* frame = *i;
00074 config->registerObject( frame );
00075 frame->setAutoObsolete( latency );
00076 EQLOG( eq::LOG_ASSEMBLY ) << "Input frame \"" << frame->getName()
00077 << "\" id " << frame->getID() << endl;
00078 }
00079
00080 compound->updateFrustum();
00081 compound->updateInheritData( 0 );
00082
00083 if( channel )
00084 channel->addTasks( compound->getInheritTasks( ));
00085
00086 return TRAVERSE_CONTINUE;
00087 }
00088
00089 }
00090 }