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

This class manages the display of a simulation (either an already made simulation opened in a single lml file by LoadsMovie, or a simple step given by a simulation motor). More...

#include <LoadsSimulationDriver.h>

+ Inheritance diagram for LoadsSimulationDriver:

Classes

struct  Position
 private struct to store the initial positions More...
 

Public Slots

void play ()
 Slot called when at each timer tick (i.e. after the same interval of time) More...
 

Signals

void doOneStep ()
 signal call when one step is to be performed More...
 

Public Member Functions

double getDt () const
 get delta-t More...
 
double getNextRefreshTime ()
 get the next planed time when the 3D will be refreshed More...
 
double getRefreshDt () const
 get delta-t between 3d view refresh More...
 
double getTime () const
 get time More...
 
double getTMax () const
 get tmax More...
 
double getTMin () const
 get tmin More...
 
bool isTimerActive ()
 is the timer currently running More...
 
 LoadsSimulationDriver (LoadsManager *, Loads *)
 Constructor. More...
 
void maxSpeed ()
 set the timer interval to maxSpeed (1000Hz) More...
 
void quicker ()
 decrease the timer interval by 5ms, thus calling doOneStep more often More...
 
void resetPositions ()
 reset the 3D positions to the initial value (stored in the map during init), (do not update the display) More...
 
void resetTMaxToDefault ()
 set default tmax (using the current loads last event) More...
 
void resetTMinToDefault ()
 set default tmin (using the current loads first event) More...
 
void resetToDefault ()
 set tmin, tmax and dt to default More...
 
void rewind ()
 rewind time to tMin (do not update the display) More...
 
void setDt (double dt)
 set the delta-t (default is 0.1) More...
 
void setLoads (Loads *)
 set the current loads to be displayed More...
 
void setRefreshDt (double)
 set delta-t between 3d view refresh (default 0.1) More...
 
void setTime (double)
 set the time to a different value ("jump" to a given time) More...
 
void setTMax (double)
 set the new tMax More...
 
void setTMin (double)
 set the new tMin More...
 
void slower ()
 increase the timer interval by 5ms, thus calling doOneStep less often More...
 
void startTimer ()
 starts the timer that will repeatedly call play and emit doOneStep More...
 
void stopTimer ()
 stop the timer More...
 
void updateDisplay (bool force)
 update the display using the current loads (and refresh the 3D viewers if parameter is true) More...
 
virtual ~LoadsSimulationDriver ()
 Destructor. More...
 

Private Member Functions

void getInitialPosition (unsigned int, double[3])
 get an initial position using the key (i.e. targetId) More...
 
void init ()
 init display and initial positions. More...
 
void updateAtomData ()
 update Atom data More...
 
void updatePositions (bool force)
 update the positions depending on the current loads (and refresh the DCs position if parameter is true) More...
 

Private Attributes

LoadscurrentLoads
 the current loads More...
 
double dt
 the delta-t used to change t More...
 
QMap< unsigned int, PositioninitialPositionMap
 initial positions of all the targets More...
 
int interval
 timer interval in ms More...
 
double lastRefreshTime
 last time the display was refresh More...
 
double lastUpdateTime
 last time we updated the display More...
 
LoadsManagermyLM
 the load manager More...
 
QMap< unsigned int, PositionreferencePositionMap
 the reference pm positions (used to display the distances, ...) More...
 
double refreshDt
 the delta-t between two refresh of the 3D view More...
 
double t
 simulation time More...
 
QTimer * timer
 the simulation timer More...
 
double tMax
 last event time More...
 
double tMin
 first event time More...
 

Detailed Description

This class manages the display of a simulation (either an already made simulation opened in a single lml file by LoadsMovie, or a simple step given by a simulation motor).

It is just a utility class for handling the display of loads a given time, using a timer.

Constructor & Destructor Documentation

LoadsSimulationDriver::LoadsSimulationDriver ( LoadsManager ,
Loads  
)

Constructor.

Set the load manager, and (initial) current loads (if the loads ptr is null, then all atoms initial positions will be stored; just in case they have to move in the future)

virtual LoadsSimulationDriver::~LoadsSimulationDriver ( )
virtual

Destructor.

Member Function Documentation

void LoadsSimulationDriver::doOneStep ( )
signal

signal call when one step is to be performed

double LoadsSimulationDriver::getDt ( ) const

get delta-t

void LoadsSimulationDriver::getInitialPosition ( unsigned int  targetId,
double  pos[3] 
)
inlineprivate

get an initial position using the key (i.e. targetId)

References initialPositionMap.

double LoadsSimulationDriver::getNextRefreshTime ( )

get the next planed time when the 3D will be refreshed

double LoadsSimulationDriver::getRefreshDt ( ) const

get delta-t between 3d view refresh

double LoadsSimulationDriver::getTime ( ) const

get time

double LoadsSimulationDriver::getTMax ( ) const

get tmax

double LoadsSimulationDriver::getTMin ( ) const

get tmin

void LoadsSimulationDriver::init ( )
private

init display and initial positions.

stores all the initial position of the atoms implied in the loads. if current loads is NULL, then all the atoms will have their initial positions stored.

bool LoadsSimulationDriver::isTimerActive ( )

is the timer currently running

void LoadsSimulationDriver::maxSpeed ( )

set the timer interval to maxSpeed (1000Hz)

void LoadsSimulationDriver::play ( )
slot

Slot called when at each timer tick (i.e. after the same interval of time)

void LoadsSimulationDriver::quicker ( )

decrease the timer interval by 5ms, thus calling doOneStep more often

void LoadsSimulationDriver::resetPositions ( )

reset the 3D positions to the initial value (stored in the map during init), (do not update the display)

void LoadsSimulationDriver::resetTMaxToDefault ( )

set default tmax (using the current loads last event)

void LoadsSimulationDriver::resetTMinToDefault ( )

set default tmin (using the current loads first event)

void LoadsSimulationDriver::resetToDefault ( )

set tmin, tmax and dt to default

void LoadsSimulationDriver::rewind ( )

rewind time to tMin (do not update the display)

void LoadsSimulationDriver::setDt ( double  dt)

set the delta-t (default is 0.1)

void LoadsSimulationDriver::setLoads ( Loads )

set the current loads to be displayed

void LoadsSimulationDriver::setRefreshDt ( double  )

set delta-t between 3d view refresh (default 0.1)

void LoadsSimulationDriver::setTime ( double  )

set the time to a different value ("jump" to a given time)

void LoadsSimulationDriver::setTMax ( double  )

set the new tMax

void LoadsSimulationDriver::setTMin ( double  )

set the new tMin

void LoadsSimulationDriver::slower ( )

increase the timer interval by 5ms, thus calling doOneStep less often

void LoadsSimulationDriver::startTimer ( )

starts the timer that will repeatedly call play and emit doOneStep

void LoadsSimulationDriver::stopTimer ( )

stop the timer

void LoadsSimulationDriver::updateAtomData ( )
private

update Atom data

void LoadsSimulationDriver::updateDisplay ( bool  force)

update the display using the current loads (and refresh the 3D viewers if parameter is true)

Parameters
forceif true force display update independantly from refresh dt (default is false)
void LoadsSimulationDriver::updatePositions ( bool  force)
private

update the positions depending on the current loads (and refresh the DCs position if parameter is true)

Member Data Documentation

Loads* LoadsSimulationDriver::currentLoads
private

the current loads

double LoadsSimulationDriver::dt
private

the delta-t used to change t

QMap<unsigned int, Position> LoadsSimulationDriver::initialPositionMap
private

initial positions of all the targets

Referenced by getInitialPosition().

int LoadsSimulationDriver::interval
private

timer interval in ms

double LoadsSimulationDriver::lastRefreshTime
private

last time the display was refresh

double LoadsSimulationDriver::lastUpdateTime
private

last time we updated the display

LoadsManager* LoadsSimulationDriver::myLM
private

the load manager

QMap<unsigned int, Position> LoadsSimulationDriver::referencePositionMap
private

the reference pm positions (used to display the distances, ...)

double LoadsSimulationDriver::refreshDt
private

the delta-t between two refresh of the 3D view

double LoadsSimulationDriver::t
private

simulation time

QTimer* LoadsSimulationDriver::timer
private

the simulation timer

double LoadsSimulationDriver::tMax
private

last event time

double LoadsSimulationDriver::tMin
private

first event time


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