The functions and elements of a MainWindow. More...
#include <MainWindow.h>
Public Member Functions | |
MainWindow (QWidget *parent=0) | |
~MainWindow () | |
Protected Member Functions | |
void | keyPressEvent (QKeyEvent *_event) |
void | keyReleaseEvent (QKeyEvent *_event) |
Private Slots | |
void | setUIBuoyancyValues (float _kRise, float _kFall) |
Signal sent to the UI to set the dissipation values. | |
void | setUIDissipationValues (float _kDensityDiss, float _kTemperDiss) |
Signal sent to the UI to set the dissipation values. | |
void | setUIEmitterValues (ngl::Vec3 _emitterLoc, float _emitterSize, float _emitDensityRate, float _emitTemperatureRate) |
Signal sent to the UI to set the emitter values. | |
void | setUIFluidValues (float _viscosity, float _gravity, float _kVorticity) |
Signal sent to the UI to set the fluid values. | |
void | setUIObstacleValues () |
Signal sent to the UI to set the obstacle values. | |
void | setUIPressureValues (float _absoluteTolerance, float _relaxationRate) |
Signal sent to the UI to set the fluid values. | |
void | setUINoiseValues (float _frequency, float _octaveCount, float _persistence, float _speed, float _magnitude) |
Signal sent to the UI to set the sprite values. | |
void | setUISpriteValues (int _spriteSize, float _opacityStrength, float _shadowStrength) |
Signal sent to the UI to set the sprite values. | |
void | setUITimeValues (float _timeStep, float _maxFPS) |
Signal sent to the UI to set the time values. | |
void | setUIVoxelGridValues (float _gridLengthX, float _gridLengthY, float _gridLengthZ, int _gridBaseRes, int _gridPrecisionX, int _gridPrecisionY, int _gridPrecisionZ, float _h, BOUNDARYCONDITION _condition) |
Signal sent to the UI to set the Voxel Grid UI Values. | |
Private Attributes | |
Ui::MainWindow * | m_ui |
GLWindow * | m_gl |
our openGL widget |
The functions and elements of a MainWindow.
MainWindow::MainWindow | ( | QWidget * | parent = 0 | ) | [explicit] |
1. Connect the signals in GLWindow to the signals in MainWindow.
2. Connect the ui variables to the slots in GLWindow.
1. De-allocate memory.
void MainWindow::keyPressEvent | ( | QKeyEvent * | _event | ) | [protected] |
1. If the escape key is pressed, exit. If the 'a' key is pressed, toggle the pausing of the simulation.
void MainWindow::keyReleaseEvent | ( | QKeyEvent * | _event | ) | [protected] |
1. On the event of a key release event, call the processKeyUp function in the GLWindow instance.
void MainWindow::setUIBuoyancyValues | ( | float | _kRise, |
float | _kFall | ||
) | [private, slot] |
Signal sent to the UI to set the dissipation values.
[in] | _kRise | the value to be set to the k buoyancy rise value |
[in] | _kFall | the value to be set to the k buoyancy fall value |
1. Set the UI buoyancy values.
void MainWindow::setUIDissipationValues | ( | float | _kDensityDiss, |
float | _kTemperDiss | ||
) | [private, slot] |
Signal sent to the UI to set the dissipation values.
[in] | _kDensityDiss | the value to be set to the k density dissipation value |
[in] | _kTemperDiss | the value to be set to the k temperature dissipation value |
1. Set the UI dissipation values.
void MainWindow::setUIEmitterValues | ( | ngl::Vec3 | _emitterLoc, |
float | _emitterSize, | ||
float | _emitDensityRate, | ||
float | _emitTemperatureRate | ||
) | [private, slot] |
Signal sent to the UI to set the emitter values.
[in] | _emitterLoc | the value to be set to the location of the emitter |
[in] | _emitterSize | the value to be set to the size of the emitter |
[in] | _emitDensityRate | the value to be set to the emit rate of the density |
[in] | _emitTemperatureRate | the value to be set to the emit rate of the temperature |
1. Set the UI emitter values.
void MainWindow::setUIFluidValues | ( | float | _viscosity, |
float | _gravity, | ||
float | _kVorticity | ||
) | [private, slot] |
Signal sent to the UI to set the fluid values.
[in] | _viscosity | the value to be set to the viscosity |
[in] | _gravity | the value to be set to the gravity force |
[in] | _kVorticity | the value to be set to vorticity confinement constant |
1. Set the UI fluid values.
void MainWindow::setUINoiseValues | ( | float | _frequency, |
float | _octaveCount, | ||
float | _persistence, | ||
float | _speed, | ||
float | _magnitude | ||
) | [private, slot] |
Signal sent to the UI to set the sprite values.
[in] | _frequency | the value to be set to the frequency of the noise |
[in] | _octaveCount | the value to be set to the octave count of the noise |
[in] | _persistence | the value to be set to the persistence of the noise |
[in] | _speed | the value to be set to the speed of the noise |
[in] | _magnitude | the value to be set to the magnitude of the force the noise |
1. Set the UI noise values.
void MainWindow::setUIObstacleValues | ( | ) | [private, slot] |
Signal sent to the UI to set the obstacle values.
1. Set the UI obstacle values.
void MainWindow::setUIPressureValues | ( | float | _absoluteTolerance, |
float | _relaxationRate | ||
) | [private, slot] |
Signal sent to the UI to set the fluid values.
[in] | _absoluteTolerance | the value to be set to the absolute tolerance of the pressure |
[in] | _relaxationRate | the value to be set to the relaxation rate of the pressure |
1. Set the UI pressure values.
void MainWindow::setUISpriteValues | ( | int | _spriteSize, |
float | _opacityStrength, | ||
float | _shadowStrength | ||
) | [private, slot] |
Signal sent to the UI to set the sprite values.
[in] | _spriteSize | the value to be set to the k sprite size value |
[in] | _opacityStrength | the value to be set to the strength of the opacity |
[in] | _shadowStrength | the value to be set to the strength of the opacity |
1. Set the UI sprite values.
void MainWindow::setUITimeValues | ( | float | _timeStep, |
float | _maxFPS | ||
) | [private, slot] |
Signal sent to the UI to set the time values.
[in] | _timeStep | the value to be set to the time step |
[in] | _maxFPS | the value to be set to the max fps |
1. Set the UI time values.
void MainWindow::setUIVoxelGridValues | ( | float | _gridLengthX, |
float | _gridLengthY, | ||
float | _gridLengthZ, | ||
int | _gridBaseRes, | ||
int | _gridPrecisionX, | ||
int | _gridPrecisionY, | ||
int | _gridPrecisionZ, | ||
float | _h, | ||
BOUNDARYCONDITION | _condition | ||
) | [private, slot] |
Signal sent to the UI to set the Voxel Grid UI Values.
[in] | _gridLengthX | the x length of the voxel grid |
[in] | _gridLengthY | the y length of the voxel grid |
[in] | _gridLengthZ | the z length of the voxel grid |
[in] | _gridBaseRes | the base resolution of the voxel grid |
[in] | _gridPrecisionX | the x precision of the voxel grid |
[in] | _gridPrecisionY | the y precision of the voxel grid |
[in] | _gridPrecisionZ | the z precision of the voxel grid |
[in] | _h | the width of the voxels |
[in] | _condition | the boundary condition |
1. Set the UI voxel grid values.
2. Set the UI boundary condition.