Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
LoadsSimulation Class Reference

This dialog allows to run a simulation using a simulation motor. More...

#include <LoadsSimulation.h>

Public Slots

virtual void addAnimationMotorAddon ()
 adding a animation motor add-on (in the 2nd tab)
virtual void chooseOutputDir ()
bool doOneStep ()
 do one step of simulation
virtual void dtChanged ()
virtual void dtModified ()
void init ()
 init display
void pause ()
 Slot called when the button Pause is clicked.
virtual void refreshDtChanged ()
virtual void refreshDtModified ()
virtual void reject ()
 dialog is closed
void rewind ()
 Slot called when the button Rewind is clicked.
void simulate ()
 Slot called when the button Play is clicked.
void simulateOneStep ()
 Slot called when the next step is clicked.
virtual void tMaxChanged ()
virtual void tMaxModified ()
virtual void videoToggled (bool)

Public Member Functions

void addTab (QWidget *)
 add a tabulation (will be remove when the current animation motor add-on will be removed
double getTime () const
 get the actual time
 LoadsSimulation (LoadsManager *myLoadsManager, QWidget *parent=0)
 Default Constructor.
void updateDisplay (bool force)
 update the display (the boolean indicates if the scene3d has to be refresh or not)
void updateTime (bool getMotorTime=false)
 update time display
virtual ~LoadsSimulation ()
 Destructor.

Private Member Functions

void enableButtons (bool enable)
 set the rew,play,pause,step buttons enable or not
void loadAddon (QString)
 load a animation motor add-on using a filename (shared lib location)

Private Attributes

QString addonFilename
QColor bgColor
 the initial bg color
double elapsed
 total elapsed time (to calculate simulator frequency)
unsigned int imageId
 the number of screenshots
double iterationCount
 total nr of iteration computed (to calculate simulator frequency)
LoadsManagermyLM
 the load manager
AnimationMotorAddonmyMotor
 the motor
bool output
 if there is no output directory we can't make video
QString outputDir
 the output directory name for making videos
QString outputDirName
 the output directory name for making videos
QAction * pauseToolbar
QAction * playOneStepToolbar
QAction * playToolbar
QAction * rewindToolbar
 toolbar buttons
LoadsSimulationDriversimDriver
 the code core for the display of a loads
QToolBar * simulationToolBar
 the tool bar
QLineEdit * tLineEditToolbar
 toolbar t line edit
Ui::AnimationMotorDialog ui
 the ui dialog designed in qtdesigner
bool video
 record video or not?

Detailed Description

This dialog allows to run a simulation using a simulation motor.

It plays the impload, allowing the user to see the evolution of translations along time.

Constructor & Destructor Documentation

LoadsSimulation::LoadsSimulation ( LoadsManager myLoadsManager,
QWidget *  parent = 0 
)
LoadsSimulation::~LoadsSimulation ( )
virtual

Destructor.

References myMotor, output, simDriver, simulationToolBar, and video.

Member Function Documentation

void LoadsSimulation::addAnimationMotorAddon ( )
virtualslot

adding a animation motor add-on (in the 2nd tab)

References loadAddon().

Referenced by LoadsSimulation().

void LoadsSimulation::addTab ( QWidget *  w)

add a tabulation (will be remove when the current animation motor add-on will be removed

References ui.

Referenced by LoadsManager::addSimulationTab(), and loadAddon().

void LoadsSimulation::chooseOutputDir ( )
virtualslot

References output, outputDir, and ui.

Referenced by LoadsSimulation().

bool LoadsSimulation::doOneStep ( )
slot
void LoadsSimulation::dtChanged ( )
virtualslot
void LoadsSimulation::dtModified ( )
virtualslot

References ui.

Referenced by LoadsSimulation().

void LoadsSimulation::enableButtons ( bool  enable)
private

set the rew,play,pause,step buttons enable or not

References pauseToolbar, playOneStepToolbar, playToolbar, rewindToolbar, tLineEditToolbar, and ui.

Referenced by init(), and loadAddon().

double LoadsSimulation::getTime ( ) const

get the actual time

References LoadsSimulationDriver::getTime(), and simDriver.

Referenced by LoadsManager::updateLoadsDisplay().

void LoadsSimulation::init ( )
slot
void LoadsSimulation::loadAddon ( QString  addonFile)
private
void LoadsSimulation::pause ( )
slot
void LoadsSimulation::refreshDtChanged ( )
virtualslot
void LoadsSimulation::refreshDtModified ( )
virtualslot

References ui.

Referenced by LoadsSimulation().

void LoadsSimulation::reject ( )
virtualslot

dialog is closed

References simDriver, and LoadsSimulationDriver::stopTimer().

void LoadsSimulation::rewind ( )
slot
void LoadsSimulation::simulate ( )
slot
void LoadsSimulation::simulateOneStep ( )
slot

Slot called when the next step is clicked.

References doOneStep().

Referenced by LoadsSimulation().

void LoadsSimulation::tMaxChanged ( )
virtualslot
void LoadsSimulation::tMaxModified ( )
virtualslot

References ui.

Referenced by LoadsSimulation().

void LoadsSimulation::updateDisplay ( bool  force)

update the display (the boolean indicates if the scene3d has to be refresh or not)

Parameters
forceif true force display update independantly from refresh dt (default is false)

References simDriver, LoadsSimulationDriver::updateDisplay(), and updateTime().

Referenced by doOneStep(), init(), LoadsSimulation(), pause(), rewind(), and LoadsManager::setAtomDataDisplay().

void LoadsSimulation::updateTime ( bool  getMotorTime = false)

update time display

Parameters
getMotorTimeif force is true, then the time taken by the method is not the simulation driver time, but the animation motor add-on time.

References LoadsSimulationDriver::getTime(), AnimationMotorAddon::getTime(), myMotor, LoadsSimulationDriver::setTime(), simDriver, tLineEditToolbar, and ui.

Referenced by updateDisplay(), and LoadsManager::updateTime().

void LoadsSimulation::videoToggled ( bool  state)
virtualslot

References output, outputDir, ui, and video.

Referenced by LoadsSimulation().

Member Data Documentation

QString LoadsSimulation::addonFilename
private

Referenced by loadAddon().

QColor LoadsSimulation::bgColor
private

the initial bg color

Referenced by dtChanged(), LoadsSimulation(), refreshDtChanged(), and tMaxChanged().

double LoadsSimulation::elapsed
private

total elapsed time (to calculate simulator frequency)

Referenced by doOneStep(), LoadsSimulation(), and rewind().

unsigned int LoadsSimulation::imageId
private

the number of screenshots

Referenced by doOneStep(), LoadsSimulation(), and rewind().

double LoadsSimulation::iterationCount
private

total nr of iteration computed (to calculate simulator frequency)

Referenced by doOneStep(), LoadsSimulation(), and rewind().

LoadsManager* LoadsSimulation::myLM
private

the load manager

Referenced by doOneStep(), init(), loadAddon(), and LoadsSimulation().

AnimationMotorAddon* LoadsSimulation::myMotor
private
bool LoadsSimulation::output
private

if there is no output directory we can't make video

Referenced by chooseOutputDir(), LoadsSimulation(), videoToggled(), and ~LoadsSimulation().

QString LoadsSimulation::outputDir
private

the output directory name for making videos

Referenced by chooseOutputDir(), doOneStep(), and videoToggled().

QString LoadsSimulation::outputDirName
private

the output directory name for making videos

QAction* LoadsSimulation::pauseToolbar
private

Referenced by enableButtons(), and LoadsSimulation().

QAction* LoadsSimulation::playOneStepToolbar
private

Referenced by enableButtons(), and LoadsSimulation().

QAction* LoadsSimulation::playToolbar
private

Referenced by enableButtons(), and LoadsSimulation().

QAction* LoadsSimulation::rewindToolbar
private

toolbar buttons

Referenced by enableButtons(), and LoadsSimulation().

LoadsSimulationDriver* LoadsSimulation::simDriver
private
QToolBar* LoadsSimulation::simulationToolBar
private

the tool bar

Referenced by LoadsSimulation(), and ~LoadsSimulation().

QLineEdit* LoadsSimulation::tLineEditToolbar
private

toolbar t line edit

Referenced by enableButtons(), LoadsSimulation(), and updateTime().

Ui::AnimationMotorDialog LoadsSimulation::ui
private
bool LoadsSimulation::video
private

record video or not?

Referenced by doOneStep(), LoadsSimulation(), videoToggled(), and ~LoadsSimulation().


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