Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends

LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER > Class Template Reference

This writer will periodically write images in PPM format. More...

#include <ppmwriter.h>

Inherits Clonable< Writer< CELL_TYPE >, PPMWriter< CELL_TYPE, CELL_PLOTTER > >.

Collaboration diagram for LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Writer< CELL_TYPE >
::GridType 
GridType

Public Member Functions

template<typename MEMBER >
 PPMWriter (MEMBER CELL_TYPE::*member, MEMBER minValue, MEMBER maxValue, const std::string &prefix, const unsigned period=1, const Coord< 2 > &cellDimensions=Coord< 2 >(8, 8))
 This PPMWriter will render a given member (e.g.
template<typename MEMBER , typename PALETTE >
 PPMWriter (MEMBER CELL_TYPE::*member, const PALETTE &palette, const std::string &prefix, const unsigned period=1, const Coord< 2 > &cellDimensions=Coord< 2 >(8, 8))
 Creates a PPMWriter which will render the values of the given member variable.
virtual void stepFinished (const GridType &grid, unsigned step, WriterEvent event)
 is called back from sim after each simulation step.

Private Member Functions

void writePPM (const Image &img, unsigned step)

Private Attributes

Plotter< CELL_TYPE, CELL_PLOTTER > plotter

Friends

class PPMWriterTest

Detailed Description

template<typename CELL_TYPE, typename CELL_PLOTTER = SimpleCellPlotter<CELL_TYPE>>
class LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >

This writer will periodically write images in PPM format.

The CELL_PLOTTER is responsible for rendering individual cells into tiles. The default will render uniformly colored tiles.


Member Typedef Documentation

template<typename CELL_TYPE , typename CELL_PLOTTER = SimpleCellPlotter<CELL_TYPE>>
typedef Writer<CELL_TYPE>::GridType LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::GridType

Reimplemented from LibGeoDecomp::Writer< CELL_TYPE >.


Constructor & Destructor Documentation

template<typename CELL_TYPE , typename CELL_PLOTTER = SimpleCellPlotter<CELL_TYPE>>
template<typename MEMBER >
LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::PPMWriter ( MEMBER CELL_TYPE::*  member,
MEMBER  minValue,
MEMBER  maxValue,
const std::string &  prefix,
const unsigned  period = 1,
const Coord< 2 > &  cellDimensions = Coord<2>(8, 8) 
) [inline, explicit]

This PPMWriter will render a given member (e.g.

&Cell::fooBar). Colouring is handled by a predefined palette. The color range is mapped to the value range defined by [minValue, maxValue].

template<typename CELL_TYPE , typename CELL_PLOTTER = SimpleCellPlotter<CELL_TYPE>>
template<typename MEMBER , typename PALETTE >
LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::PPMWriter ( MEMBER CELL_TYPE::*  member,
const PALETTE &  palette,
const std::string &  prefix,
const unsigned  period = 1,
const Coord< 2 > &  cellDimensions = Coord<2>(8, 8) 
) [inline, explicit]

Creates a PPMWriter which will render the values of the given member variable.

Color mapping is done with the help of the custom palette object.


Member Function Documentation

template<typename CELL_TYPE , typename CELL_PLOTTER = SimpleCellPlotter<CELL_TYPE>>
virtual void LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::stepFinished ( const GridType grid,
unsigned  step,
WriterEvent  event 
) [inline, virtual]

is called back from sim after each simulation step.

event specifies the phase in which the simulation is currently in. This may be used for instance to open/close files at the beginning/end of the simulation.

Implements LibGeoDecomp::Writer< CELL_TYPE >.

template<typename CELL_TYPE , typename CELL_PLOTTER = SimpleCellPlotter<CELL_TYPE>>
void LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::writePPM ( const Image img,
unsigned  step 
) [inline, private]

Friends And Related Function Documentation

template<typename CELL_TYPE , typename CELL_PLOTTER = SimpleCellPlotter<CELL_TYPE>>
friend class PPMWriterTest [friend]

Member Data Documentation

template<typename CELL_TYPE , typename CELL_PLOTTER = SimpleCellPlotter<CELL_TYPE>>
Plotter<CELL_TYPE, CELL_PLOTTER> LibGeoDecomp::PPMWriter< CELL_TYPE, CELL_PLOTTER >::plotter [private]

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