SampleConsumer.cpp

Go to the documentation of this file.
00001 /**<!-------------------------------------------------------------------->
00002    @file   SampleConsumer.cpp
00003    @author Travis Fischer (fisch0920@gmail.com)
00004    @author Matthew Jacobs (jacobs.mh@gmail.com)
00005    @date   Fall 2008
00006    
00007    @brief
00008       Threaded point sample evaluation (represents the 'consumer' in the 
00009    classic producer/consumer problem)
00010    
00011    @see SampleGenerator
00012    <!-------------------------------------------------------------------->**/
00013 
00014 #include "SampleConsumer.h"
00015 #include <PointSampleRenderer.h>
00016 #include <RenderOutput.h>
00017 #include <PointSample.h>
00018 #include <QtCore>
00019 
00020 void SampleConsumer::init() {
00021    ASSERT(m_renderer);
00022 }
00023 
00024 void SampleConsumer::run() {
00025    ASSERT(m_renderer);
00026    
00027    //setPriority(NormalPriority);
00028    //cerr << priority() << endl;
00029    
00030    RenderOutput *output = m_renderer->getOutput();
00031    PointSample pointSample;
00032    
00033    while(m_renderer->getSharedSample(pointSample)) {
00034       m_renderer->sample(pointSample);
00035       
00036       output->addSample(pointSample);
00037    }
00038 }
00039 

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6