Langmuir
Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LangmuirCore::GridImage Class Reference

A class to draw images of the grid. More...

#include <writer.h>

Public Member Functions

 GridImage (World &world, QColor bg=Qt::black, QObject *parent=0)
 create the image and painter, setting the background and size More...
 
void drawSites (QList< int > &sites, QColor color, int layer)
 draw some sites More...
 
void drawCharges (QList< ChargeAgent * > &charges, QColor color, int layer)
 draw some sites More...
 
void save (QString name, int scale=3)
 save the image to a file More...
 

Private Attributes

QPainter m_painter
 the painter that paints the image More...
 
QImage m_image
 the image we draw onto More...
 
Worldm_world
 reference to the world object More...
 

Detailed Description

A class to draw images of the grid.

Constructor & Destructor Documentation

LangmuirCore::GridImage::GridImage ( World world,
QColor  bg = Qt::black,
QObject *  parent = 0 
)

create the image and painter, setting the background and size

Parameters
worldReference to the world object
bgBackground color
parentparent QObject

Member Function Documentation

void LangmuirCore::GridImage::drawCharges ( QList< ChargeAgent * > &  charges,
QColor  color,
int  layer 
)

draw some sites

Parameters
chargesA list of ChargeAgents, which have site ids
  • could be the list of electrons
  • could be the list of holes
colorThe color of the points
layerWhich layer are we drawing? its a 2D image
void LangmuirCore::GridImage::drawSites ( QList< int > &  sites,
QColor  color,
int  layer 
)

draw some sites

Parameters
sitesA list of integers that are site ids
  • could be the list of trap ids
  • could be the list of defect ids
colorThe color of the points
layerWhich layer are we drawing? its a 2D image
void LangmuirCore::GridImage::save ( QString  name,
int  scale = 3 
)

save the image to a file

Parameters
nameA file name that is passed to a OutputInfo object, the output is assummed png
scaleMultiply the image by some scale, increasing the resolution

Member Data Documentation

QImage LangmuirCore::GridImage::m_image
private

the image we draw onto

QPainter LangmuirCore::GridImage::m_painter
private

the painter that paints the image

World& LangmuirCore::GridImage::m_world
private

reference to the world object


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