Lagrangian Liquid Simulation
Master Thesis project on simulation of liquids using Lagrangian approach and SPH
MainApp Class Reference

contains all the UI extended from MainWindow.ui and our GLWindow More...

#include <MainApp.h>

Collaboration diagram for MainApp:

List of all members.

Public Member Functions

 MainApp (QWidget *_parent=0)
 ctor
 ~MainApp ()
 dtor

Private Slots

void on_cmd_injectParticle_clicked ()
void on_cmd_flushCache_clicked ()
void on_cmd_autoMove_clicked ()
void on_spin_fluid_interfaceColorPlus_clicked (bool checked)
void on_spin_fluid_interfaceColorMinus_clicked (bool checked)
void on_spin_fluid_interfaceThreshold_valueChanged (double)
void on_spin_fluid_interfaceCoefficient_valueChanged (double)
void on_spin_fluid_surfaceThreshold_valueChanged (double)
void on_spin_fluid_surfaceCoefficient_valueChanged (double)
void on_spin_fluid_viscosityConstant_valueChanged (double)
void on_spin_fluid_gasConstant_valueChanged (double)
void on_spin_fluid_restDensity_valueChanged (double)
void on_cmb_fluid_currentFluid_currentIndexChanged (int index)
void on_spin_solver_smoothingLength_valueChanged (double)
void on_cmb_solver_integrationMethod_currentIndexChanged (int index)
void on_spin_solver_timestep_valueChanged (double)
void on_spin_environment_capsule_centre_z_valueChanged (double)
void on_spin_environment_capsule_centre_y_valueChanged (double)
void on_spin_environment_capsule_centre_x_valueChanged (double)
void on_spin_environment_capsule_incrementAngle_valueChanged (int)
void on_chk_environment_capsule_isStatic_clicked (bool checked)
void on_spin_environment_capsule_radius_valueChanged (double)
void on_chk_environment_sphere_isStatic_clicked (bool checked)
void on_spin_environment_sphere_radius_valueChanged (double)
void on_spin_environment_sphere_velocity_z_valueChanged (int)
void on_spin_environment_sphere_velocity_y_valueChanged (int)
void on_spin_environment_sphere_velocity_x_valueChanged (int)
void on_spin_environment_sphere_centre_z_valueChanged (int)
void on_spin_environment_sphere_centre_y_valueChanged (int)
void on_spin_environment_sphere_centre_x_valueChanged (int)
void on_cmb_environment_capsule_currentIndexChanged (int index)
void on_cmb_environment_sphere_currentIndexChanged (int index)
void on_spin_environment_boundary_size_z_valueChanged (int)
void on_spin_environment_boundary_size_y_valueChanged (int)
void on_spin_environment_boundary_size_x_valueChanged (int)
void on_spin_environment_boundary_periodicWall_angleIncrement_valueChanged (int)
void on_spin_environment_boundary_periodicWall_speed_valueChanged (double)
void on_spin_environment_boundary_periodicWall_maxAmplitude_valueChanged (int)
void on_chk_environment_boundary_enablePeriodicWall_clicked (bool checked)
void on_spin_environment_boundary_restitutionForRBD_valueChanged (double)
void on_spin_environment_boundary_restitutionForFluid_valueChanged (double)
void on_checkBox_clicked (bool checked)
void on_spin_environment_boundary_centre_z_valueChanged (int)
void on_spin_environment_boundary_centre_y_valueChanged (int)
void on_spin_environment_boundary_centre_x_valueChanged (int)
void on_spin_environment_capsule_resolution_valueChanged (int)
void on_spin_environment_rbd_restitution_valueChanged (double)
void on_spin_hose_velocity_z_valueChanged (int)
void on_spin_hose_velocity_y_valueChanged (int)
void on_spin_hose_velocity_x_valueChanged (int)
void on_spin_hose_centre_z_valueChanged (int)
void on_spin_hose_centre_y_valueChanged (int)
void on_spin_hose_centre_x_valueChanged (int)
void on_chk_fluid_hose_waitUntilRBD_clicked (bool checked)
void on_chk_fluid_hose_waitUntilBoundary_clicked (bool checked)
void on_chk_fluid_hose_drawMarker_clicked (bool checked)
void on_spin_cache_automaticFlushInterval_valueChanged (int)
void on_chk_cache_automaticFlush_clicked (bool checked)
void on_chk_cache_exportBoundary_clicked (bool checked)
void on_chk_cache_exportRBD_clicked (bool checked)
void on_spin_cache_samplingInterval_valueChanged (int)
void on_chk_cache_enable_clicked (bool checked)
void on_cmd_singleStep_clicked ()
void on_cmd_2DFrontView_clicked ()
void on_cmd_2DTopView_clicked ()

Private Member Functions

void setupConnections ()
 setup up the UI intial values and connects signals/slots
void keyPressEvent (QKeyEvent *_event)
 override the keyPressEvent inherited from QObject so we can handle key presses.
void refreshControlsFromSphere (const int _sphereId)
 updates the gui with the parameters of a newly selected sphere
void refreshControlsFromCapsule (const int _capsuleId)
 updates the gui with the parameters of a newly selected capsule
void refreshControlsFromFluid (const int _fluidId)
 updates the gui with the parameters of a newly selected fluid

Private Attributes

Ui::MainWindow * m_ui
 the handle to the main GUI window, used for creating all the UI and the gl window
Simulationm_simulation
 the main gl context that is used for drawing and creation of the simulation

Detailed Description

contains all the UI extended from MainWindow.ui and our GLWindow

Definition at line 23 of file MainApp.h.


Constructor & Destructor Documentation

MainApp::MainApp ( QWidget *  _parent = 0)

ctor

Parameters:
[in]_parentthe main application window for the GUI

Definition at line 13 of file MainApp.cpp.

                 :
                QMainWindow(_parent),
                m_ui(new Ui::MainWindow)
{
    // setup the user interface
    m_ui->setupUi(this);

    //create a new instance of the world and give it an initial aspect ratio
    m_simulation = new Simulation(this);

    m_ui->s_mainGridLayout->addWidget(m_simulation, 0, 0, 4, 2);

    //setup signals/slots
    setupConnections();
}
MainApp::~MainApp ( )

dtor

Definition at line 31 of file MainApp.cpp.

References m_ui.

{
    delete m_ui;
}

Member Function Documentation

void MainApp::keyPressEvent ( QKeyEvent *  _event) [private]

override the keyPressEvent inherited from QObject so we can handle key presses.

Parameters:
[in]_eventthe event to process

Definition at line 219 of file MainApp.cpp.

References Simulation::keyPress(), and m_simulation.

{
    // this method is called every time the main window recives a key event.
    this->setFocus(Qt::ActiveWindowFocusReason);

    switch (_event->key())
    {
        case Qt::Key_Escape : QApplication::exit(EXIT_SUCCESS); break;

        case Qt::Key_M : showFullScreen(); break;
        case Qt::Key_N : showNormal(); break;

        default : break;
    }

    m_simulation->keyPress(_event);
}

Here is the call graph for this function:

void MainApp::on_checkBox_clicked ( bool  checked) [private, slot]

Definition at line 373 of file MainApp.cpp.

References Simulation::getEnvironment(), m_simulation, and Environment::setBoundaryBoundTop().

Here is the call graph for this function:

void MainApp::on_chk_cache_automaticFlush_clicked ( bool  checked) [private, slot]

Definition at line 274 of file MainApp.cpp.

References m_simulation, Simulation::setCacheAutomaticFlushEnabled(), and Simulation::toggleCache().

Here is the call graph for this function:

void MainApp::on_chk_cache_enable_clicked ( bool  checked) [private, slot]

Definition at line 252 of file MainApp.cpp.

References m_simulation, Simulation::setCacheEnabled(), and Simulation::toggleCache().

Here is the call graph for this function:

void MainApp::on_chk_cache_exportBoundary_clicked ( bool  checked) [private, slot]

Definition at line 269 of file MainApp.cpp.

References m_simulation, and Simulation::setCacheExportBoundaryEnabled().

Here is the call graph for this function:

void MainApp::on_chk_cache_exportRBD_clicked ( bool  checked) [private, slot]

Definition at line 264 of file MainApp.cpp.

References m_simulation, and Simulation::setCacheExportRBDEnabled().

Here is the call graph for this function:

void MainApp::on_chk_environment_boundary_enablePeriodicWall_clicked ( bool  checked) [private, slot]

Definition at line 388 of file MainApp.cpp.

References Simulation::getEnvironment(), m_simulation, and Environment::setPeriodicWallEnabled().

Here is the call graph for this function:

void MainApp::on_chk_environment_capsule_isStatic_clicked ( bool  checked) [private, slot]

Definition at line 554 of file MainApp.cpp.

References Environment::getCapsuleObstacleList(), Simulation::getEnvironment(), m_simulation, and m_ui.

{
    //get currently selected capsule id
    int id = m_ui->cmb_environment_capsule->currentIndex();

    //update currently selected object
    m_simulation->getEnvironment()->getCapsuleObstacleList()[id].setMoveable(!checked);
}

Here is the call graph for this function:

void MainApp::on_chk_environment_sphere_isStatic_clicked ( bool  checked) [private, slot]

Definition at line 534 of file MainApp.cpp.

References Simulation::getEnvironment(), Environment::getSphereObstacleList(), m_simulation, and m_ui.

{
    //get currently selected sphere id
    int id = m_ui->cmb_environment_sphere->currentIndex();

    //update currently selected object
    m_simulation->getEnvironment()->getSphereObstacleList()[id].setMoveable(!checked);
}

Here is the call graph for this function:

void MainApp::on_chk_fluid_hose_drawMarker_clicked ( bool  checked) [private, slot]

Definition at line 286 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, and Solver::setDrawHoseMarker().

{
    m_simulation->getSolver()->setDrawHoseMarker(checked);

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_chk_fluid_hose_waitUntilBoundary_clicked ( bool  checked) [private, slot]

Definition at line 293 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, and Solver::setHoseWaitUntilHitBoundary().

Here is the call graph for this function:

void MainApp::on_chk_fluid_hose_waitUntilRBD_clicked ( bool  checked) [private, slot]

Definition at line 298 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, and Solver::setHoseWaitUntilHitRBD().

Here is the call graph for this function:

void MainApp::on_cmb_environment_capsule_currentIndexChanged ( int  index) [private, slot]

Definition at line 434 of file MainApp.cpp.

References refreshControlsFromCapsule().

Here is the call graph for this function:

void MainApp::on_cmb_environment_sphere_currentIndexChanged ( int  index) [private, slot]

Definition at line 429 of file MainApp.cpp.

References refreshControlsFromSphere().

Here is the call graph for this function:

void MainApp::on_cmb_fluid_currentFluid_currentIndexChanged ( int  index) [private, slot]

Definition at line 629 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, refreshControlsFromFluid(), and Solver::setCurrentHoseableFluid().

Here is the call graph for this function:

void MainApp::on_cmb_solver_integrationMethod_currentIndexChanged ( int  index) [private, slot]

Definition at line 619 of file MainApp.cpp.

References Simulation::getIntegration(), m_simulation, and Integration::setIntegrationType().

Here is the call graph for this function:

void MainApp::on_cmd_2DFrontView_clicked ( ) [private, slot]

Definition at line 246 of file MainApp.cpp.

References m_simulation, and Simulation::setup2DFrontView().

{
    //setup front view
    m_simulation->setup2DFrontView();
}

Here is the call graph for this function:

void MainApp::on_cmd_2DTopView_clicked ( ) [private, slot]

Definition at line 240 of file MainApp.cpp.

References m_simulation, and Simulation::setup2DTopView().

{
    //setup top view
    m_simulation->setup2DTopView();
}

Here is the call graph for this function:

void MainApp::on_cmd_autoMove_clicked ( ) [private, slot]

Definition at line 735 of file MainApp.cpp.

References Solver::getEnableAutoFluidUpdate(), Simulation::getSolver(), m_simulation, m_ui, Solver::toggleEnableAutoFluidUpdate(), and Simulation::updateFPSTimer().

{
    m_ui->cmd_autoMove->setText(!m_simulation->getSolver()->getEnableAutoFluidUpdate() ? "AutoMove Stop" : "AutoMove Start");

    m_simulation->getSolver()->toggleEnableAutoFluidUpdate();
    m_simulation->updateFPSTimer();

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_cmd_flushCache_clicked ( ) [private, slot]

Definition at line 745 of file MainApp.cpp.

References Simulation::flushCache(), and m_simulation.

Here is the call graph for this function:

void MainApp::on_cmd_injectParticle_clicked ( ) [private, slot]

Definition at line 750 of file MainApp.cpp.

References Simulation::getSolver(), Solver::injectParticles(), and m_simulation.

Here is the call graph for this function:

void MainApp::on_cmd_singleStep_clicked ( ) [private, slot]
void MainApp::on_spin_cache_automaticFlushInterval_valueChanged ( int  value) [private, slot]

Definition at line 280 of file MainApp.cpp.

References m_simulation, Simulation::setCacheAutomaticFlushInterval(), and Simulation::toggleAutomaticCacheFlush().

Here is the call graph for this function:

void MainApp::on_spin_cache_samplingInterval_valueChanged ( int  value) [private, slot]

Definition at line 258 of file MainApp.cpp.

References m_simulation, Simulation::setCacheSamplingInterval(), and Simulation::toggleCache().

Here is the call graph for this function:

void MainApp::on_spin_environment_boundary_centre_x_valueChanged ( int  value) [private, slot]
void MainApp::on_spin_environment_boundary_centre_y_valueChanged ( int  value) [private, slot]
void MainApp::on_spin_environment_boundary_centre_z_valueChanged ( int  value) [private, slot]
void MainApp::on_spin_environment_boundary_periodicWall_angleIncrement_valueChanged ( int  value) [private, slot]

Definition at line 403 of file MainApp.cpp.

References Simulation::getEnvironment(), m_simulation, and Environment::setPeriodicWallAngleIncrement().

Here is the call graph for this function:

void MainApp::on_spin_environment_boundary_periodicWall_maxAmplitude_valueChanged ( int  value) [private, slot]

Definition at line 393 of file MainApp.cpp.

References Simulation::getEnvironment(), m_simulation, and Environment::setPeriodicWallMaxAmplitude().

Here is the call graph for this function:

void MainApp::on_spin_environment_boundary_periodicWall_speed_valueChanged ( double  value) [private, slot]

Definition at line 398 of file MainApp.cpp.

References Simulation::getEnvironment(), m_simulation, and Environment::setPeriodicWallSpeed().

Here is the call graph for this function:

void MainApp::on_spin_environment_boundary_restitutionForFluid_valueChanged ( double  value) [private, slot]
void MainApp::on_spin_environment_boundary_restitutionForRBD_valueChanged ( double  value) [private, slot]
void MainApp::on_spin_environment_boundary_size_x_valueChanged ( int  value) [private, slot]
void MainApp::on_spin_environment_boundary_size_y_valueChanged ( int  value) [private, slot]
void MainApp::on_spin_environment_boundary_size_z_valueChanged ( int  value) [private, slot]
void MainApp::on_spin_environment_capsule_centre_x_valueChanged ( double  value) [private, slot]

Definition at line 572 of file MainApp.cpp.

References Environment::getCapsuleObstacleList(), Simulation::getEnvironment(), m_simulation, and m_ui.

{
    //get currently selected capsule id
    int id = m_ui->cmb_environment_capsule->currentIndex();

    //get position
    ngl::Vector pos = m_simulation->getEnvironment()->getCapsuleObstacleList()[id].getPosition();

    //update currently selected object
    m_simulation->getEnvironment()->getCapsuleObstacleList()[id].updatePosition(ngl::Vector(value, pos.m_y, pos.m_z));

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_spin_environment_capsule_centre_y_valueChanged ( double  value) [private, slot]

Definition at line 586 of file MainApp.cpp.

References Environment::getCapsuleObstacleList(), Simulation::getEnvironment(), m_simulation, and m_ui.

{
    //get currently selected capsule id
    int id = m_ui->cmb_environment_capsule->currentIndex();

    //get position
    ngl::Vector pos = m_simulation->getEnvironment()->getCapsuleObstacleList()[id].getPosition();

    //update currently selected object
    m_simulation->getEnvironment()->getCapsuleObstacleList()[id].updatePosition(ngl::Vector(pos.m_x, value, pos.m_z));

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_spin_environment_capsule_centre_z_valueChanged ( double  value) [private, slot]

Definition at line 600 of file MainApp.cpp.

References Environment::getCapsuleObstacleList(), Simulation::getEnvironment(), m_simulation, and m_ui.

{
    //get currently selected capsule id
    int id = m_ui->cmb_environment_capsule->currentIndex();

    //get position
    ngl::Vector pos = m_simulation->getEnvironment()->getCapsuleObstacleList()[id].getPosition();

    //update currently selected object
    m_simulation->getEnvironment()->getCapsuleObstacleList()[id].updatePosition(ngl::Vector(pos.m_x, pos.m_y, value));

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_spin_environment_capsule_incrementAngle_valueChanged ( int  value) [private, slot]

Definition at line 563 of file MainApp.cpp.

References Environment::getCapsuleObstacleList(), Simulation::getEnvironment(), m_simulation, and m_ui.

{
    //get currently selected capsule id
    int id = m_ui->cmb_environment_capsule->currentIndex();

    //update currently selected object
    m_simulation->getEnvironment()->getCapsuleObstacleList()[id].setIncrementAngle(value);
}

Here is the call graph for this function:

void MainApp::on_spin_environment_capsule_radius_valueChanged ( double  value) [private, slot]

Definition at line 543 of file MainApp.cpp.

References Environment::getCapsuleObstacleList(), Simulation::getEnvironment(), m_simulation, and m_ui.

{
    //get currently selected capsule id
    int id = m_ui->cmb_environment_capsule->currentIndex();

    //update currently selected object
    m_simulation->getEnvironment()->getCapsuleObstacleList()[id].setRadius(value);

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_spin_environment_capsule_resolution_valueChanged ( int  value) [private, slot]

Definition at line 344 of file MainApp.cpp.

References Simulation::getEnvironment(), m_simulation, and Environment::setCapsuleResolution().

Here is the call graph for this function:

void MainApp::on_spin_environment_rbd_restitution_valueChanged ( double  value) [private, slot]

Definition at line 339 of file MainApp.cpp.

References Simulation::getEnvironment(), m_simulation, and Environment::setObstacleRestitutionCoefficient().

Here is the call graph for this function:

void MainApp::on_spin_environment_sphere_centre_x_valueChanged ( int  value) [private, slot]

Definition at line 439 of file MainApp.cpp.

References Simulation::getEnvironment(), Environment::getSphereObstacleList(), m_simulation, and m_ui.

{
    //get currently selected sphere id
    int id = m_ui->cmb_environment_sphere->currentIndex();

    //get position
    ngl::Vector pos = m_simulation->getEnvironment()->getSphereObstacleList()[id].getPosition();

    //update currently selected object
    m_simulation->getEnvironment()->getSphereObstacleList()[id].updatePosition(ngl::Vector(value, pos.m_y, pos.m_z));

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_spin_environment_sphere_centre_y_valueChanged ( int  value) [private, slot]

Definition at line 453 of file MainApp.cpp.

References Simulation::getEnvironment(), Environment::getSphereObstacleList(), m_simulation, and m_ui.

{
    //get currently selected sphere id
    int id = m_ui->cmb_environment_sphere->currentIndex();

    //get position
    ngl::Vector pos = m_simulation->getEnvironment()->getSphereObstacleList()[id].getPosition();

    //update currently selected object
    m_simulation->getEnvironment()->getSphereObstacleList()[id].updatePosition(ngl::Vector(pos.m_x, value, pos.m_z));

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_spin_environment_sphere_centre_z_valueChanged ( int  value) [private, slot]

Definition at line 467 of file MainApp.cpp.

References Simulation::getEnvironment(), Environment::getSphereObstacleList(), m_simulation, and m_ui.

{
    //get currently selected sphere id
    int id = m_ui->cmb_environment_sphere->currentIndex();

    //get position
    ngl::Vector pos = m_simulation->getEnvironment()->getSphereObstacleList()[id].getPosition();

    //update currently selected object
    m_simulation->getEnvironment()->getSphereObstacleList()[id].updatePosition(ngl::Vector(pos.m_x, pos.m_y, value));

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_spin_environment_sphere_radius_valueChanged ( double  value) [private, slot]

Definition at line 523 of file MainApp.cpp.

References Simulation::getEnvironment(), Environment::getSphereObstacleList(), m_simulation, and m_ui.

{
    //get currently selected sphere id
    int id = m_ui->cmb_environment_sphere->currentIndex();

    //update currently selected object
    m_simulation->getEnvironment()->getSphereObstacleList()[id].setRadius(value);

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_spin_environment_sphere_velocity_x_valueChanged ( int  value) [private, slot]

Definition at line 481 of file MainApp.cpp.

References Simulation::getEnvironment(), Environment::getSphereObstacleList(), m_simulation, and m_ui.

{
    //get currently selected sphere id
    int id = m_ui->cmb_environment_sphere->currentIndex();

    //get velocity
    ngl::Vector pos = m_simulation->getEnvironment()->getSphereObstacleList()[id].getVelocity();

    //update currently selected object
    m_simulation->getEnvironment()->getSphereObstacleList()[id].updateVelocity(ngl::Vector(value, pos.m_y, pos.m_z));

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_spin_environment_sphere_velocity_y_valueChanged ( int  value) [private, slot]

Definition at line 495 of file MainApp.cpp.

References Simulation::getEnvironment(), Environment::getSphereObstacleList(), m_simulation, and m_ui.

{
    //get currently selected sphere id
    int id = m_ui->cmb_environment_sphere->currentIndex();

    //get position
    ngl::Vector pos = m_simulation->getEnvironment()->getSphereObstacleList()[id].getVelocity();

    //update currently selected object
    m_simulation->getEnvironment()->getSphereObstacleList()[id].updateVelocity(ngl::Vector(pos.m_x, value, pos.m_z));

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_spin_environment_sphere_velocity_z_valueChanged ( int  value) [private, slot]

Definition at line 509 of file MainApp.cpp.

References Simulation::getEnvironment(), Environment::getSphereObstacleList(), m_simulation, and m_ui.

{
    //get currently selected sphere id
    int id = m_ui->cmb_environment_sphere->currentIndex();

    //get position
    ngl::Vector pos = m_simulation->getEnvironment()->getSphereObstacleList()[id].getVelocity();

    //update currently selected object
    m_simulation->getEnvironment()->getSphereObstacleList()[id].updateVelocity(ngl::Vector(pos.m_x, pos.m_y, value));

    m_simulation->updateGL();
}

Here is the call graph for this function:

void MainApp::on_spin_fluid_gasConstant_valueChanged ( double  value) [private, slot]

Definition at line 645 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, m_ui, and Solver::updateGasConstantForFluid().

{
    //get currently selected fluid id
    int id = m_ui->cmb_fluid_currentFluid->currentIndex();

    //update currently selected object
    m_simulation->getSolver()->updateGasConstantForFluid(id, value);
}

Here is the call graph for this function:

void MainApp::on_spin_fluid_interfaceCoefficient_valueChanged ( double  value) [private, slot]

Definition at line 681 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, m_ui, and Solver::updateInterfaceCoefficientForFluid().

{
    //get currently selected fluid id
    int id = m_ui->cmb_fluid_currentFluid->currentIndex();

    //update currently selected object
    m_simulation->getSolver()->updateInterfaceCoefficientForFluid(id, value);
}

Here is the call graph for this function:

void MainApp::on_spin_fluid_interfaceColorMinus_clicked ( bool  checked) [private, slot]

Definition at line 699 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, m_ui, and Solver::updateInterfaceColorForFluid().

{
    //get currently selected fluid id
    int id = m_ui->cmb_fluid_currentFluid->currentIndex();


    if (checked)
        //update currently selected object
        m_simulation->getSolver()->updateInterfaceColorForFluid(id, -0.5);
    else
        //update currently selected object
        m_simulation->getSolver()->updateInterfaceColorForFluid(id, 0.5);

}

Here is the call graph for this function:

void MainApp::on_spin_fluid_interfaceColorPlus_clicked ( bool  checked) [private, slot]

Definition at line 714 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, m_ui, and Solver::updateInterfaceColorForFluid().

{
    //get currently selected fluid id
    int id = m_ui->cmb_fluid_currentFluid->currentIndex();


    if (checked)
        //update currently selected object
        m_simulation->getSolver()->updateInterfaceColorForFluid(id, 0.5);
    else
        //update currently selected object
        m_simulation->getSolver()->updateInterfaceColorForFluid(id, -0.5);
}

Here is the call graph for this function:

void MainApp::on_spin_fluid_interfaceThreshold_valueChanged ( double  value) [private, slot]

Definition at line 690 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, m_ui, and Solver::updateInterfaceThresholdForFluid().

{
    //get currently selected fluid id
    int id = m_ui->cmb_fluid_currentFluid->currentIndex();

    //update currently selected object
    m_simulation->getSolver()->updateInterfaceThresholdForFluid(id, value);
}

Here is the call graph for this function:

void MainApp::on_spin_fluid_restDensity_valueChanged ( double  value) [private, slot]

Definition at line 636 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, m_ui, and Solver::updateRestDensityForFluid().

{
    //get currently selected fluid id
    int id = m_ui->cmb_fluid_currentFluid->currentIndex();

    //update currently selected object
    m_simulation->getSolver()->updateRestDensityForFluid(id, value);
}

Here is the call graph for this function:

void MainApp::on_spin_fluid_surfaceCoefficient_valueChanged ( double  value) [private, slot]

Definition at line 663 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, m_ui, and Solver::updateSurfaceCoefficientForFluid().

{
    //get currently selected fluid id
    int id = m_ui->cmb_fluid_currentFluid->currentIndex();

    //update currently selected object
    m_simulation->getSolver()->updateSurfaceCoefficientForFluid(id, value);
}

Here is the call graph for this function:

void MainApp::on_spin_fluid_surfaceThreshold_valueChanged ( double  value) [private, slot]

Definition at line 672 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, m_ui, and Solver::updateSurfaceThresholdForFluid().

{
    //get currently selected fluid id
    int id = m_ui->cmb_fluid_currentFluid->currentIndex();

    //update currently selected object
    m_simulation->getSolver()->updateSurfaceThresholdForFluid(id, value);
}

Here is the call graph for this function:

void MainApp::on_spin_fluid_viscosityConstant_valueChanged ( double  value) [private, slot]

Definition at line 654 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, m_ui, and Solver::updateViscosityConstantForFluid().

{
    //get currently selected fluid id
    int id = m_ui->cmb_fluid_currentFluid->currentIndex();

    //update currently selected object
    m_simulation->getSolver()->updateViscosityConstantForFluid(id, value);
}

Here is the call graph for this function:

void MainApp::on_spin_hose_centre_x_valueChanged ( int  value) [private, slot]

Definition at line 303 of file MainApp.cpp.

References Solver::getHoseCenter(), Simulation::getSolver(), m_simulation, and Solver::setHoseCenter().

Here is the call graph for this function:

void MainApp::on_spin_hose_centre_y_valueChanged ( int  value) [private, slot]

Definition at line 310 of file MainApp.cpp.

References Solver::getHoseCenter(), Simulation::getSolver(), m_simulation, and Solver::setHoseCenter().

Here is the call graph for this function:

void MainApp::on_spin_hose_centre_z_valueChanged ( int  value) [private, slot]

Definition at line 317 of file MainApp.cpp.

References Solver::getHoseCenter(), Simulation::getSolver(), m_simulation, and Solver::setHoseCenter().

Here is the call graph for this function:

void MainApp::on_spin_hose_velocity_x_valueChanged ( int  value) [private, slot]

Definition at line 324 of file MainApp.cpp.

References Solver::getHoseVelocity(), Simulation::getSolver(), m_simulation, and Solver::setHoseVelocity().

Here is the call graph for this function:

void MainApp::on_spin_hose_velocity_y_valueChanged ( int  value) [private, slot]

Definition at line 329 of file MainApp.cpp.

References Solver::getHoseVelocity(), Simulation::getSolver(), m_simulation, and Solver::setHoseVelocity().

Here is the call graph for this function:

void MainApp::on_spin_hose_velocity_z_valueChanged ( int  value) [private, slot]

Definition at line 334 of file MainApp.cpp.

References Solver::getHoseVelocity(), Simulation::getSolver(), m_simulation, and Solver::setHoseVelocity().

Here is the call graph for this function:

void MainApp::on_spin_solver_smoothingLength_valueChanged ( double  value) [private, slot]

Definition at line 624 of file MainApp.cpp.

References Simulation::getSolver(), m_simulation, and Solver::setSmoothingLength().

Here is the call graph for this function:

void MainApp::on_spin_solver_timestep_valueChanged ( double  value) [private, slot]

Definition at line 614 of file MainApp.cpp.

References Simulation::getIntegration(), m_simulation, and Integration::setTimestep().

Here is the call graph for this function:

void MainApp::refreshControlsFromCapsule ( const int  _capsuleId) [private]

updates the gui with the parameters of a newly selected capsule

Parameters:
[in]_capsuleIdthe capsule id selected

Definition at line 202 of file MainApp.cpp.

References Environment::getCapsuleObstacleList(), Simulation::getEnvironment(), m_simulation, and m_ui.

{
    //centre
    m_ui->spin_environment_capsule_centre_x->setValue(m_simulation->getEnvironment()->getCapsuleObstacleList()[_capsuleId].getPosition().m_x);
    m_ui->spin_environment_capsule_centre_y->setValue(m_simulation->getEnvironment()->getCapsuleObstacleList()[_capsuleId].getPosition().m_y);
    m_ui->spin_environment_capsule_centre_z->setValue(m_simulation->getEnvironment()->getCapsuleObstacleList()[_capsuleId].getPosition().m_z);

    //angle
    m_ui->spin_environment_capsule_incrementAngle->setValue(m_simulation->getEnvironment()->getCapsuleObstacleList()[_capsuleId].getIncrementAngle());

    //radius
    m_ui->spin_environment_capsule_radius->setValue(m_simulation->getEnvironment()->getCapsuleObstacleList()[_capsuleId].getRadius());

    //static
    m_ui->chk_environment_capsule_isStatic->setChecked(!m_simulation->getEnvironment()->getCapsuleObstacleList()[_capsuleId].getMoveable());
}

Here is the call graph for this function:

Here is the caller graph for this function:

void MainApp::refreshControlsFromFluid ( const int  _fluidId) [private]

updates the gui with the parameters of a newly selected fluid

Parameters:
[in]_fluidIdthe fluid id selected

Definition at line 158 of file MainApp.cpp.

References Solver::getHoseParticlePrototypeList(), Simulation::getSolver(), m_simulation, and m_ui.

{
    //density
    m_ui->spin_fluid_restDensity->setValue(m_simulation->getSolver()->getHoseParticlePrototypeList()[_fluidId].getMaterialRestDensity());

    //gas constant
    m_ui->spin_fluid_gasConstant->setValue(m_simulation->getSolver()->getHoseParticlePrototypeList()[_fluidId].getGasConstant());

    //viscosity constant
    m_ui->spin_fluid_viscosityConstant->setValue(m_simulation->getSolver()->getHoseParticlePrototypeList()[_fluidId].getViscosityConstant());

    //surface tension
    m_ui->spin_fluid_surfaceCoefficient->setValue(m_simulation->getSolver()->getHoseParticlePrototypeList()[_fluidId].getSurfaceTensionCoefficient());
    m_ui->spin_fluid_surfaceThreshold->setValue(m_simulation->getSolver()->getHoseParticlePrototypeList()[_fluidId].getSurfaceTensionThreshold());

    //interface tension
    m_ui->spin_fluid_interfaceCoefficient->setValue(m_simulation->getSolver()->getHoseParticlePrototypeList()[_fluidId].getInterfaceTensionCoefficient());
    m_ui->spin_fluid_interfaceThreshold->setValue(m_simulation->getSolver()->getHoseParticlePrototypeList()[_fluidId].getInterfaceTensionThreshold());

    //interface color
    bool minus = m_simulation->getSolver()->getHoseParticlePrototypeList()[_fluidId].getInterfaceColorCoefficient() < 0;
    m_ui->spin_fluid_interfaceColorMinus->setChecked(minus);
    m_ui->spin_fluid_interfaceColorPlus->setChecked(!minus);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void MainApp::refreshControlsFromSphere ( const int  _sphereId) [private]

updates the gui with the parameters of a newly selected sphere

Parameters:
[in]_sphereIdthe sphere id selected

Definition at line 183 of file MainApp.cpp.

References Simulation::getEnvironment(), Environment::getSphereObstacleList(), m_simulation, and m_ui.

{
    //position
    m_ui->spin_environment_sphere_centre_x->setValue(m_simulation->getEnvironment()->getSphereObstacleList()[_sphereId].getPosition().m_x);
    m_ui->spin_environment_sphere_centre_y->setValue(m_simulation->getEnvironment()->getSphereObstacleList()[_sphereId].getPosition().m_y);
    m_ui->spin_environment_sphere_centre_z->setValue(m_simulation->getEnvironment()->getSphereObstacleList()[_sphereId].getPosition().m_z);

    //velocity
    m_ui->spin_environment_sphere_velocity_x->setValue(m_simulation->getEnvironment()->getSphereObstacleList()[_sphereId].getVelocity().m_x);
    m_ui->spin_environment_sphere_velocity_y->setValue(m_simulation->getEnvironment()->getSphereObstacleList()[_sphereId].getVelocity().m_y);
    m_ui->spin_environment_sphere_velocity_z->setValue(m_simulation->getEnvironment()->getSphereObstacleList()[_sphereId].getVelocity().m_z);

    //radius
    m_ui->spin_environment_sphere_radius->setValue(m_simulation->getEnvironment()->getSphereObstacleList()[_sphereId].getRadius());

    //static
    m_ui->chk_environment_sphere_isStatic->setChecked(!m_simulation->getEnvironment()->getSphereObstacleList()[_sphereId].getMoveable());
}

Here is the call graph for this function:

Here is the caller graph for this function:

void MainApp::setupConnections ( ) [private]

setup up the UI intial values and connects signals/slots

build fluid name list

Definition at line 36 of file MainApp.cpp.

References Environment::getBoundaryDimension(), Environment::getBoundaryPosition(), Environment::getBoundaryRestitutionCoefficientForFluid(), Environment::getBoundaryRestitutionCoefficientForRBD(), Simulation::getCacheAutomaticFlushEnabled(), Simulation::getCacheAutomaticFlushInterval(), Simulation::getCacheEnabled(), Simulation::getCacheExportBoundaryEnabled(), Simulation::getCacheExportRBDEnabled(), Simulation::getCacheSamplingInterval(), Environment::getCapsuleNameList(), Environment::getCapsuleResolution(), Solver::getDrawHoseMarker(), Solver::getEnableAutoFluidUpdate(), Simulation::getEnvironment(), Solver::getHoseCenter(), Solver::getHoseVelocity(), Solver::getHoseWaitUntilHitBoundary(), Solver::getHoseWaitUntilHitRBD(), Simulation::getIntegration(), Solver::getNameList(), Environment::getObstacleRestitutionCoefficient(), Environment::getPeriodicWallAngleIncrement(), Environment::getPeriodicWallEnabled(), Environment::getPeriodicWallMaxAmplitude(), Environment::getPeriodicWallSpeed(), Solver::getSmoothingLength(), Simulation::getSolver(), Environment::getSphereNameList(), Integration::getTimestep(), Configuration::initialiseCamera(), m_simulation, m_ui, refreshControlsFromCapsule(), refreshControlsFromFluid(), and refreshControlsFromSphere().

{
    //read from simulation objects and initialise states of controls

    //---------------------------------------------------------------------------------------------------------------------
    //TAB : SOLVER
    //timestep
    m_ui->spin_solver_timestep->setValue(m_simulation->getIntegration()->getTimestep());

    //smoothing length
    m_ui->spin_solver_smoothingLength->setValue(m_simulation->getSolver()->getSmoothingLength());


    //---------------------------------------------------------------------------------------------------------------------
    //TAB : FLUID
    for (int i = 0; i < m_simulation->getSolver()->getNameList().size(); ++i)
    {
        m_ui->cmb_fluid_currentFluid->addItems(QStringList(QString(m_simulation->getSolver()->getNameList()[i].c_str())));
    }

    //update controls for the first fluid
    if (m_simulation->getSolver()->getNameList().size() >= 1) refreshControlsFromFluid(0);

    //toggle hose marker drawing
    m_ui->chk_fluid_hose_drawMarker->setChecked(m_simulation->getSolver()->getDrawHoseMarker());

    //hose centre
    m_ui->spin_hose_centre_x->setValue(m_simulation->getSolver()->getHoseCenter().m_x);
    m_ui->spin_hose_centre_y->setValue(m_simulation->getSolver()->getHoseCenter().m_y);
    m_ui->spin_hose_centre_z->setValue(m_simulation->getSolver()->getHoseCenter().m_z);

    //hose velocity
    m_ui->spin_hose_velocity_x->setValue(m_simulation->getSolver()->getHoseVelocity().m_x);
    m_ui->spin_hose_velocity_y->setValue(m_simulation->getSolver()->getHoseVelocity().m_y);
    m_ui->spin_hose_velocity_z->setValue(m_simulation->getSolver()->getHoseVelocity().m_z);

    //wait until first time properties
    m_ui->chk_fluid_hose_waitUntilBoundary->setChecked(m_simulation->getSolver()->getHoseWaitUntilHitBoundary());
    m_ui->chk_fluid_hose_waitUntilRBD->setChecked(m_simulation->getSolver()->getHoseWaitUntilHitRBD());


    //---------------------------------------------------------------------------------------------------------------------
    //TAB : CACHE
    //cache toggle
    m_ui->chk_cache_enable->setChecked(m_simulation->getCacheEnabled());

    //cache sampling interval
    m_ui->spin_cache_samplingInterval->setValue(m_simulation->getCacheSamplingInterval());

    //cache automatic sampling
    m_ui->chk_cache_automaticFlush->setChecked(m_simulation->getCacheAutomaticFlushEnabled());
    m_ui->spin_cache_automaticFlushInterval->setValue(m_simulation->getCacheAutomaticFlushInterval() / 1000);   //ms -> s

    //cache rbd and boundary
    m_ui->chk_cache_exportRBD->setChecked(m_simulation->getCacheExportRBDEnabled());
    m_ui->chk_cache_exportBoundary->setChecked(m_simulation->getCacheExportBoundaryEnabled());


    //---------------------------------------------------------------------------------------------------------------------
    //TAB : ENVIRONMENT

    //SUBTAB : BOUNDARY
    //boundary centre
    m_ui->spin_environment_boundary_centre_x->setValue(m_simulation->getEnvironment()->getBoundaryPosition().m_x);
    m_ui->spin_environment_boundary_centre_y->setValue(m_simulation->getEnvironment()->getBoundaryPosition().m_y);
    m_ui->spin_environment_boundary_centre_z->setValue(m_simulation->getEnvironment()->getBoundaryPosition().m_z);

    //boundary dimension
    m_ui->spin_environment_boundary_size_x->setValue(m_simulation->getEnvironment()->getBoundaryDimension().m_x);
    m_ui->spin_environment_boundary_size_y->setValue(m_simulation->getEnvironment()->getBoundaryDimension().m_x);
    m_ui->spin_environment_boundary_size_z->setValue(m_simulation->getEnvironment()->getBoundaryDimension().m_x);

    //restitution coefficients
    m_ui->spin_environment_boundary_restitutionForFluid->setValue(m_simulation->getEnvironment()->getBoundaryRestitutionCoefficientForFluid());
    m_ui->spin_environment_boundary_restitutionForRBD->setValue(m_simulation->getEnvironment()->getBoundaryRestitutionCoefficientForRBD());

    //periodic wall
    m_ui->chk_environment_boundary_enablePeriodicWall->setChecked(m_simulation->getEnvironment()->getPeriodicWallEnabled());
    m_ui->spin_environment_boundary_periodicWall_speed->setValue(m_simulation->getEnvironment()->getPeriodicWallSpeed());
    m_ui->spin_environment_boundary_periodicWall_angleIncrement->setValue(m_simulation->getEnvironment()->getPeriodicWallAngleIncrement());
    m_ui->spin_environment_boundary_periodicWall_maxAmplitude->setValue(m_simulation->getEnvironment()->getPeriodicWallMaxAmplitude());


    //SUBTAB : RBD
    //restitution coefficients
    m_ui->spin_environment_rbd_restitution->setValue(m_simulation->getEnvironment()->getObstacleRestitutionCoefficient());

    //capsule resolution
    m_ui->spin_environment_capsule_resolution->setValue(m_simulation->getEnvironment()->getCapsuleResolution());

    //build sphere combo list
    for (int i = 0; i < m_simulation->getEnvironment()->getSphereNameList().size(); ++i)
    {
        m_ui->cmb_environment_sphere->addItems(QStringList(QString(m_simulation->getEnvironment()->getSphereNameList()[i].c_str())));
    }

    //update controls for the first sphere
    if (m_simulation->getEnvironment()->getSphereNameList().size() >= 1) refreshControlsFromSphere(0);

    //build sphere combo list
    for (int i = 0; i < m_simulation->getEnvironment()->getCapsuleNameList().size(); ++i)
    {
        m_ui->cmb_environment_capsule->addItems(QStringList(QString(m_simulation->getEnvironment()->getCapsuleNameList()[i].c_str())));
    }

    //update controls for the first capsule
    if (m_simulation->getEnvironment()->getCapsuleNameList().size() >= 1) refreshControlsFromCapsule(0);


    //OUTSIDE BUTTONS
    m_ui->cmd_autoMove->setText(m_simulation->getSolver()->getEnableAutoFluidUpdate() ? "AutoMove Stop" : "AutoMove Start");


    //GLOBAL CAMERA
    //setup camera zoom control and signal here
    //read camera z value from config file and set it to the slider
    ngl::Camera m_camera = Configuration::initialiseCamera(1.0);
    m_ui->sld_cameraZoom->setValue(-m_camera.getEye().m_z);
    connect(m_ui->sld_cameraZoom, SIGNAL(valueChanged(int)), m_simulation, SLOT(updateCameraZoom(int)));
}

Here is the call graph for this function:


Member Data Documentation

the main gl context that is used for drawing and creation of the simulation

Definition at line 43 of file MainApp.h.

Ui::MainWindow* MainApp::m_ui [private]

the handle to the main GUI window, used for creating all the UI and the gl window

Definition at line 40 of file MainApp.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator