SampleGeneratorThread Class Reference

Threaded PointSample generation over the 2D unit interval [0,1]^2 (represents the 'producer' in the classic producer/consumer problem). More...

#include <SampleGeneratorThread.h>

Inheritance diagram for SampleGeneratorThread:

SampleGenerator PropertyMap

List of all members.

Public Member Functions

Constructors
 SampleGeneratorThread (PointSampleRenderer *renderer=NULL)
virtual ~SampleGeneratorThread ()
Main usage interface
virtual void run ()
Accessors / Mutators
PointSampleRenderergetRenderer ()
void setRenderer (PointSampleRenderer *renderer)
const ViewportgetViewport () const
void setViewport (const Viewport &v)

Static Public Member Functions

Static factory
static SampleGeneratorThreadcreate (const std::string &type)

Protected Member Functions

virtual void _addSample (const PointSample &s, PointSampleList &samples)
 Main interface for subclasses to add a given PointSample to be 'generated'. Default implementation is simple: samples.push_back(s); Subclasses should not access samples list directly but should instead use this method which allows for SampleGeneratorThread to override _addSample to instead notify a PointSampleRenderer's shared pool of pending work.

Protected Attributes

Viewport m_viewport
PointSampleRendererm_renderer


Detailed Description

Threaded PointSample generation over the 2D unit interval [0,1]^2 (represents the 'producer' in the classic producer/consumer problem).

Author:
Travis Fischer (fisch0920@gmail.com)
Date:
Fall 2008
See also:
Viewport

SampleGenerator

SampleConsumer

Definition at line 23 of file SampleGeneratorThread.h.


Constructor & Destructor Documentation

SampleGeneratorThread::SampleGeneratorThread ( PointSampleRenderer renderer = NULL  )  [inline]

Definition at line 29 of file SampleGeneratorThread.h.

SampleGeneratorThread::~SampleGeneratorThread (  )  [virtual]

Definition at line 21 of file SampleGeneratorThread.cpp.


Member Function Documentation

SampleGeneratorThread * SampleGeneratorThread::create ( const std::string &  type  )  [static]

Reimplemented from SampleGenerator.

Definition at line 47 of file SampleGeneratorThread.cpp.

void SampleGeneratorThread::run (  )  [virtual]

Generates samples over the unit domain in a new thread ('producer')

Definition at line 27 of file SampleGeneratorThread.cpp.

PointSampleRenderer* SampleGeneratorThread::getRenderer (  )  [inline]

Definition at line 58 of file SampleGeneratorThread.h.

void SampleGeneratorThread::setRenderer ( PointSampleRenderer renderer  ) 

Definition at line 40 of file SampleGeneratorThread.cpp.

const Viewport& SampleGeneratorThread::getViewport (  )  const [inline]

Definition at line 64 of file SampleGeneratorThread.h.

void SampleGeneratorThread::setViewport ( const Viewport v  )  [inline]

Definition at line 68 of file SampleGeneratorThread.h.

void SampleGeneratorThread::_addSample ( const PointSample s,
PointSampleList &  samples 
) [protected, virtual]

Main interface for subclasses to add a given PointSample to be 'generated'. Default implementation is simple: samples.push_back(s); Subclasses should not access samples list directly but should instead use this method which allows for SampleGeneratorThread to override _addSample to instead notify a PointSampleRenderer's shared pool of pending work.

Reimplemented from SampleGenerator.

Definition at line 34 of file SampleGeneratorThread.cpp.


Member Data Documentation

Definition at line 79 of file SampleGeneratorThread.h.


The documentation for this class was generated from the following files:

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6