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

Widget to view Langmuir Simulation in real time. More...

#include <langmuirviewer.h>

Public Slots

void setElectronPointMode (PointCloud::Mode mode)
 set the render mode for points More...
 
void setDefectPointMode (PointCloud::Mode mode)
 set the render mode for points More...
 
void setHolePointMode (PointCloud::Mode mode)
 set the render mode for points More...
 
void setPointMode (PointCloud::Mode mode)
 set the render mode for points More...
 
void setIterationsPrint (int value)
 set the value of iterations.print More...
 
void toggleTrapsShown (bool on=true)
 turn on the traps texture More...
 
void toggleOpenCL (bool on=true)
 turn OpenCL on and off More...
 
void toggleCoulomb (bool on=true)
 turn Coulomb on and off More...
 
void toggleCornerAxisIsVisible ()
 show/hide the corner axis More...
 
void toggleGridIsVisible ()
 show/hide the grid More...
 
void load (QString fileName)
 load a simulation More...
 
void save (QString fileName)
 save a checkpoint file More...
 
void resetCamera ()
 reset the camera to the default position More...
 
void unload ()
 unload the current simulation More...
 
void reset ()
 reset the current simulation More...
 
void pause ()
 pause the simulation More...
 
void play ()
 play the simulation More...
 
void showParameters ()
 show parameters in a window More...
 
void drawLightSource (GLenum light, float scale=1.0f) const
 draw an OpenGL light source More...
 
void loadSettings (QString fileName)
 load settings from a file More...
 
void saveSettings (QString fileName)
 save settings to a file More...
 
void errorMessage (QString message)
 show error message window More...
 
void setSettings (QSettings &settings)
 set the properties of settings object More...
 
void getSettings (QSettings &settings)
 get the properties of settings object More...
 
void setTrapColor (QColor color)
 Change the trap color. More...
 
void setStageColor2 (QColor color)
 Change the stage color2. More...
 
void setBackgroundColor (QColor color)
 set background color More...
 
void initTraps ()
 init trap texture More...
 
void initStage ()
 init stage texture More...
 
void generateIsoSurface (float value)
 generate isosurface More...
 
void updateTrapMesh ()
 update trap mesh More...
 
void resetSettings ()
 set default colors More...
 
void setCanCalculateIsoSurface (bool enabled)
 set can calculate isosurface More...
 
void setCheckerSize (float size)
 set size of checkers on stage More...
 

Signals

void showMessage (const QString &message, int timeout=0)
 show a message in the status bar More...
 
void clearMessage ()
 clear the status bar message More...
 
void isUsingOpenCL (bool useOpenCL)
 signal if OpenCL is being used More...
 
void isUsingCoulomb (bool useCoulomb)
 signal if Coulomb is being used More...
 
void isAnimated (bool playing)
 signal if simulation is playing More...
 
void isShowingTraps (bool shown)
 signal if traps are shown More...
 
void iterationsPrintChanged (int value)
 signal that iterations.print changed More...
 
void currentStepChanged (int value)
 signal that current.step changed More...
 
void openGLInitFinished ()
 signal that OpenGL has been initialized More...
 
void trapColorChanged (QColor color)
 signal that the trap color changed More...
 
void stageColor2Changed (QColor color)
 signal that the stage color2 changed More...
 
void backgroundColorChanged (QColor color)
 signal that the background color changed More...
 
void canCalculateIsoSurface (bool able)
 signal that the isosurface can by calculated again More...
 
void isoSurfaceProgress (int)
 show calculation progress More...
 
void checkerSizeChanged (float)
 signal that the checker size changed More...
 

Public Member Functions

 LangmuirViewer (QWidget *parent=0)
 create the LangmuirViewer More...
 
 ~LangmuirViewer ()
 destroy the LangmuirViewer More...
 
QMatrix4x4 & getModelViewProjectionMatrix ()
 obtain the model-view-projection matrix (QGLViewer camera) More...
 
QMatrix4x4 & getProjectionMatrix ()
 obtain the projection matrix (QGLViewer camera) More...
 
QMatrix4x4 & getOpenGLModelViewMatrix ()
 obtain the model-view matrix (OpenGL matrix stack) More...
 
QMatrix4x4 & getOpenGLProjectionMatrix ()
 obtain the projection matrix (OpenGL matrix stack) More...
 
LangmuirCore::Randomrandom ()
 get the random number generator More...
 
bool okToCalculateIsoSurface ()
 its ok when not already calculating More...
 
const QColor & trapColor () const
 get the trap color More...
 
const QColor & stageColor2 () const
 get the stage color More...
 
CornerAxiscornerAxis ()
 get corner axis object More...
 
PointCloudelectrons ()
 get electrons object More...
 
PointClouddefects ()
 get defects object More...
 
PointCloudholes ()
 get holes object More...
 
PointCloudtraps ()
 get traps object More...
 
BoxrightBox ()
 get right box object More...
 
BoxleftBox ()
 get left box object More...
 
BoxbaseBox ()
 get base box object More...
 
BoxtrapBox ()
 get trap box object More...
 
BoxstageBox ()
 get stage box object More...
 
MeshtrapMesh ()
 get trap mesh object More...
 
Lightlight ()
 get light object More...
 
Gridgrid ()
 get grid object More...
 

Protected Member Functions

void updateElectronCloud ()
 update the electron point cloud More...
 
void updateDefectCloud ()
 update the defect point cloud More...
 
void updateTrapCloud ()
 update the defect point cloud More...
 
void updateHoleCloud ()
 update the hole point cloud More...
 
void initGeometry ()
 update the geometry using simulation parameters More...
 
virtual void init ()
 setup OpenGL More...
 
virtual void preDraw ()
 draw on the OpenGL widget before the main draw event More...
 
virtual void draw ()
 draw on the OpenGL widget More...
 
virtual void postDraw ()
 draw on the OpenGL widget after the main draw event More...
 
virtual void animate ()
 change the state of the system before drawing More...
 
virtual void help ()
 open the help widget More...
 
virtual QString helpString () const
 get the help string More...
 
void drawTraps (QImage &image, QColor bcolor, QColor fcolor)
 draw traps on image More...
 
void drawChecker (QImage &image, QColor color1, QColor color2)
 draw checker pattern on stage More...
 
void loadTexture (GLuint imageID, QImage &image)
 load texture to gpu memory More...
 

Protected Attributes

GLuint m_textures [2]
 texture ids More...
 
CornerAxism_cornerAxis
 axis that sits in the corner and doesnt change size More...
 
PointCloudm_electrons
 point cloud representing electrons More...
 
PointCloudm_defects
 point cloud representing defects More...
 
PointCloudm_holes
 point cloud representing holes More...
 
PointCloudm_traps
 point cloud representing traps More...
 
Boxm_trapBox
 trap box More...
 
Boxm_baseBox
 base box More...
 
Boxm_lBox
 box (left) More...
 
Boxm_rBox
 box (right) More...
 
Boxm_stageBox
 box (stage) More...
 
double m_boxThickness
 box parameter More...
 
QColor m_trapColor
 box parameter More...
 
QColor m_stageColor2
 stage color More...
 
Gridm_grid
 grid that outlines sites More...
 
Meshm_trapMesh
 trap mesh More...
 
MarchingCubes::Isosurfacem_isoSurface
 isosurface More...
 
Lightm_light0
 main light source More...
 
LangmuirCore::Simulationm_simulation
 the simulation manipulator More...
 
LangmuirCore::Random m_random
 a random number generator instance More...
 
LangmuirCore::Worldm_world
 the simulation data More...
 
float m_gridHalfX
 half of grid.x More...
 
float m_gridHalfY
 half of grid.y More...
 
float m_gridHalfZ
 half of grid.z More...
 
float m_gridX
 grid.x More...
 
float m_gridY
 grid.y More...
 
float m_gridZ
 grid.z More...
 
QErrorMessage * m_error
 error messages More...
 
bool m_canCalculateIsoSurface
 can calculate isosurface More...
 
float m_sceneRadius
 size of scene More...
 
float m_stageExtend
 stage size More...
 
float m_checkerSize
 size of checkers on stage More...
 

Detailed Description

Widget to view Langmuir Simulation in real time.

Constructor & Destructor Documentation

LangmuirView::LangmuirViewer::LangmuirViewer ( QWidget *  parent = 0)
explicit

create the LangmuirViewer

Parameters
parentQObject this belongs to
LangmuirView::LangmuirViewer::~LangmuirViewer ( )

destroy the LangmuirViewer

Member Function Documentation

virtual void LangmuirView::LangmuirViewer::animate ( )
protectedvirtual

change the state of the system before drawing

void LangmuirView::LangmuirViewer::backgroundColorChanged ( QColor  color)
signal

signal that the background color changed

Box& LangmuirView::LangmuirViewer::baseBox ( )
inline

get base box object

void LangmuirView::LangmuirViewer::canCalculateIsoSurface ( bool  able)
signal

signal that the isosurface can by calculated again

void LangmuirView::LangmuirViewer::checkerSizeChanged ( float  )
signal

signal that the checker size changed

void LangmuirView::LangmuirViewer::clearMessage ( )
signal

clear the status bar message

CornerAxis& LangmuirView::LangmuirViewer::cornerAxis ( )
inline

get corner axis object

void LangmuirView::LangmuirViewer::currentStepChanged ( int  value)
signal

signal that current.step changed

Parameters
valuevalue of current.step
PointCloud& LangmuirView::LangmuirViewer::defects ( )
inline

get defects object

virtual void LangmuirView::LangmuirViewer::draw ( )
protectedvirtual

draw on the OpenGL widget

void LangmuirView::LangmuirViewer::drawChecker ( QImage &  image,
QColor  color1,
QColor  color2 
)
protected

draw checker pattern on stage

Parameters
imageimage to draw on
color1first color
color2second color
void LangmuirView::LangmuirViewer::drawLightSource ( GLenum  light,
float  scale = 1.0f 
) const
slot

draw an OpenGL light source

Parameters
light
scale
void LangmuirView::LangmuirViewer::drawTraps ( QImage &  image,
QColor  bcolor,
QColor  fcolor 
)
protected

draw traps on image

Parameters
imageimage to draw draws on
bcolorbackground color
fcolorforeground color
fcolorforeground color
PointCloud& LangmuirView::LangmuirViewer::electrons ( )
inline

get electrons object

void LangmuirView::LangmuirViewer::errorMessage ( QString  message)
slot

show error message window

Parameters
messageerror message
void LangmuirView::LangmuirViewer::generateIsoSurface ( float  value)
slot

generate isosurface

QMatrix4x4& LangmuirView::LangmuirViewer::getModelViewProjectionMatrix ( )

obtain the model-view-projection matrix (QGLViewer camera)

QMatrix4x4& LangmuirView::LangmuirViewer::getOpenGLModelViewMatrix ( )

obtain the model-view matrix (OpenGL matrix stack)

QMatrix4x4& LangmuirView::LangmuirViewer::getOpenGLProjectionMatrix ( )

obtain the projection matrix (OpenGL matrix stack)

QMatrix4x4& LangmuirView::LangmuirViewer::getProjectionMatrix ( )

obtain the projection matrix (QGLViewer camera)

void LangmuirView::LangmuirViewer::getSettings ( QSettings &  settings)
slot

get the properties of settings object

Parameters
settingssettings object
Grid& LangmuirView::LangmuirViewer::grid ( )
inline

get grid object

virtual void LangmuirView::LangmuirViewer::help ( )
protectedvirtual

open the help widget

virtual QString LangmuirView::LangmuirViewer::helpString ( ) const
protectedvirtual

get the help string

PointCloud& LangmuirView::LangmuirViewer::holes ( )
inline

get holes object

virtual void LangmuirView::LangmuirViewer::init ( )
protectedvirtual

setup OpenGL

void LangmuirView::LangmuirViewer::initGeometry ( )
protected

update the geometry using simulation parameters

void LangmuirView::LangmuirViewer::initStage ( )
slot

init stage texture

void LangmuirView::LangmuirViewer::initTraps ( )
slot

init trap texture

void LangmuirView::LangmuirViewer::isAnimated ( bool  playing)
signal

signal if simulation is playing

Parameters
playingtrue if playing
void LangmuirView::LangmuirViewer::isoSurfaceProgress ( int  )
signal

show calculation progress

void LangmuirView::LangmuirViewer::isShowingTraps ( bool  shown)
signal

signal if traps are shown

Parameters
showntrue if showing traps
void LangmuirView::LangmuirViewer::isUsingCoulomb ( bool  useCoulomb)
signal

signal if Coulomb is being used

Parameters
useCoulombtrue if using Coulomb
void LangmuirView::LangmuirViewer::isUsingOpenCL ( bool  useOpenCL)
signal

signal if OpenCL is being used

Parameters
useOpenCLtrue if using OpenCL
void LangmuirView::LangmuirViewer::iterationsPrintChanged ( int  value)
signal

signal that iterations.print changed

Parameters
valuevalue of iterations.print
Box& LangmuirView::LangmuirViewer::leftBox ( )
inline

get left box object

Light& LangmuirView::LangmuirViewer::light ( )
inline

get light object

void LangmuirView::LangmuirViewer::load ( QString  fileName)
slot

load a simulation

Parameters
fileNamename of simulation input file
void LangmuirView::LangmuirViewer::loadSettings ( QString  fileName)
slot

load settings from a file

Parameters
fileNamename of settings file
void LangmuirView::LangmuirViewer::loadTexture ( GLuint  imageID,
QImage &  image 
)
protected

load texture to gpu memory

Parameters
imageIDOpenGL texture ID
imagetexture
bool LangmuirView::LangmuirViewer::okToCalculateIsoSurface ( )
inline

its ok when not already calculating

void LangmuirView::LangmuirViewer::openGLInitFinished ( )
signal

signal that OpenGL has been initialized

void LangmuirView::LangmuirViewer::pause ( )
slot

pause the simulation

void LangmuirView::LangmuirViewer::play ( )
slot

play the simulation

virtual void LangmuirView::LangmuirViewer::postDraw ( )
protectedvirtual

draw on the OpenGL widget after the main draw event

virtual void LangmuirView::LangmuirViewer::preDraw ( )
protectedvirtual

draw on the OpenGL widget before the main draw event

LangmuirCore::Random& LangmuirView::LangmuirViewer::random ( )

get the random number generator

void LangmuirView::LangmuirViewer::reset ( )
slot

reset the current simulation

void LangmuirView::LangmuirViewer::resetCamera ( )
slot

reset the camera to the default position

void LangmuirView::LangmuirViewer::resetSettings ( )
slot

set default colors

Box& LangmuirView::LangmuirViewer::rightBox ( )
inline

get right box object

void LangmuirView::LangmuirViewer::save ( QString  fileName)
slot

save a checkpoint file

Parameters
fileNamename of simulation checkpoint file
void LangmuirView::LangmuirViewer::saveSettings ( QString  fileName)
slot

save settings to a file

Parameters
fileNamename of settings file
void LangmuirView::LangmuirViewer::setBackgroundColor ( QColor  color)
slot

set background color

Parameters
colorcolor to set
void LangmuirView::LangmuirViewer::setCanCalculateIsoSurface ( bool  enabled)
slot

set can calculate isosurface

void LangmuirView::LangmuirViewer::setCheckerSize ( float  size)
slot

set size of checkers on stage

void LangmuirView::LangmuirViewer::setDefectPointMode ( PointCloud::Mode  mode)
slot

set the render mode for points

void LangmuirView::LangmuirViewer::setElectronPointMode ( PointCloud::Mode  mode)
slot

set the render mode for points

void LangmuirView::LangmuirViewer::setHolePointMode ( PointCloud::Mode  mode)
slot

set the render mode for points

void LangmuirView::LangmuirViewer::setIterationsPrint ( int  value)
slot

set the value of iterations.print

Parameters
valuevalue to set
void LangmuirView::LangmuirViewer::setPointMode ( PointCloud::Mode  mode)
slot

set the render mode for points

void LangmuirView::LangmuirViewer::setSettings ( QSettings &  settings)
slot

set the properties of settings object

Parameters
settingssettings object
void LangmuirView::LangmuirViewer::setStageColor2 ( QColor  color)
slot

Change the stage color2.

Parameters
colorcolor to set
void LangmuirView::LangmuirViewer::setTrapColor ( QColor  color)
slot

Change the trap color.

Parameters
colorcolor to set
void LangmuirView::LangmuirViewer::showMessage ( const QString &  message,
int  timeout = 0 
)
signal

show a message in the status bar

Parameters
messagestring to display
timeoutmessage display time in ms
void LangmuirView::LangmuirViewer::showParameters ( )
slot

show parameters in a window

Box& LangmuirView::LangmuirViewer::stageBox ( )
inline

get stage box object

const QColor& LangmuirView::LangmuirViewer::stageColor2 ( ) const
inline

get the stage color

void LangmuirView::LangmuirViewer::stageColor2Changed ( QColor  color)
signal

signal that the stage color2 changed

void LangmuirView::LangmuirViewer::toggleCornerAxisIsVisible ( )
slot

show/hide the corner axis

void LangmuirView::LangmuirViewer::toggleCoulomb ( bool  on = true)
slot

turn Coulomb on and off

Parameters
ontrue if turning Coulomb on
void LangmuirView::LangmuirViewer::toggleGridIsVisible ( )
slot

show/hide the grid

void LangmuirView::LangmuirViewer::toggleOpenCL ( bool  on = true)
slot

turn OpenCL on and off

Parameters
ontrue if turning OpenCL on
void LangmuirView::LangmuirViewer::toggleTrapsShown ( bool  on = true)
slot

turn on the traps texture

Parameters
ontrue is showing traps
Box& LangmuirView::LangmuirViewer::trapBox ( )
inline

get trap box object

const QColor& LangmuirView::LangmuirViewer::trapColor ( ) const
inline

get the trap color

void LangmuirView::LangmuirViewer::trapColorChanged ( QColor  color)
signal

signal that the trap color changed

Mesh& LangmuirView::LangmuirViewer::trapMesh ( )
inline

get trap mesh object

PointCloud& LangmuirView::LangmuirViewer::traps ( )
inline

get traps object

void LangmuirView::LangmuirViewer::unload ( )
slot

unload the current simulation

void LangmuirView::LangmuirViewer::updateDefectCloud ( )
protected

update the defect point cloud

void LangmuirView::LangmuirViewer::updateElectronCloud ( )
protected

update the electron point cloud

void LangmuirView::LangmuirViewer::updateHoleCloud ( )
protected

update the hole point cloud

void LangmuirView::LangmuirViewer::updateTrapCloud ( )
protected

update the defect point cloud

void LangmuirView::LangmuirViewer::updateTrapMesh ( )
slot

update trap mesh

Member Data Documentation

Box* LangmuirView::LangmuirViewer::m_baseBox
protected

base box

double LangmuirView::LangmuirViewer::m_boxThickness
protected

box parameter

bool LangmuirView::LangmuirViewer::m_canCalculateIsoSurface
protected

can calculate isosurface

float LangmuirView::LangmuirViewer::m_checkerSize
protected

size of checkers on stage

CornerAxis* LangmuirView::LangmuirViewer::m_cornerAxis
protected

axis that sits in the corner and doesnt change size

PointCloud* LangmuirView::LangmuirViewer::m_defects
protected

point cloud representing defects

PointCloud* LangmuirView::LangmuirViewer::m_electrons
protected

point cloud representing electrons

QErrorMessage* LangmuirView::LangmuirViewer::m_error
protected

error messages

Grid* LangmuirView::LangmuirViewer::m_grid
protected

grid that outlines sites

float LangmuirView::LangmuirViewer::m_gridHalfX
protected

half of grid.x

float LangmuirView::LangmuirViewer::m_gridHalfY
protected

half of grid.y

float LangmuirView::LangmuirViewer::m_gridHalfZ
protected

half of grid.z

float LangmuirView::LangmuirViewer::m_gridX
protected

grid.x

float LangmuirView::LangmuirViewer::m_gridY
protected

grid.y

float LangmuirView::LangmuirViewer::m_gridZ
protected

grid.z

PointCloud* LangmuirView::LangmuirViewer::m_holes
protected

point cloud representing holes

MarchingCubes::Isosurface* LangmuirView::LangmuirViewer::m_isoSurface
protected

isosurface

Box* LangmuirView::LangmuirViewer::m_lBox
protected

box (left)

Light* LangmuirView::LangmuirViewer::m_light0
protected

main light source

LangmuirCore::Random LangmuirView::LangmuirViewer::m_random
protected

a random number generator instance

Box* LangmuirView::LangmuirViewer::m_rBox
protected

box (right)

float LangmuirView::LangmuirViewer::m_sceneRadius
protected

size of scene

LangmuirCore::Simulation* LangmuirView::LangmuirViewer::m_simulation
protected

the simulation manipulator

Box* LangmuirView::LangmuirViewer::m_stageBox
protected

box (stage)

QColor LangmuirView::LangmuirViewer::m_stageColor2
protected

stage color

float LangmuirView::LangmuirViewer::m_stageExtend
protected

stage size

GLuint LangmuirView::LangmuirViewer::m_textures[2]
protected

texture ids

Box* LangmuirView::LangmuirViewer::m_trapBox
protected

trap box

QColor LangmuirView::LangmuirViewer::m_trapColor
protected

box parameter

Mesh* LangmuirView::LangmuirViewer::m_trapMesh
protected

trap mesh

PointCloud* LangmuirView::LangmuirViewer::m_traps
protected

point cloud representing traps

LangmuirCore::World* LangmuirView::LangmuirViewer::m_world
protected

the simulation data


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