![]() |
Computer Assited Medical Intervention Tool Kit
|
This class manages the applied all loads (see LML), deformation add-on, atom data monitoring and atom decoration. More...
#include <LoadsManager.h>
Public Member Functions | |
LoadsManager (PMManagerDC *) | |
Constructor (give it the PMManagerDC it is linked with) More... | |
~LoadsManager () | |
Destructor. More... | |
Load Management | |
input/output of load for the simulation | |
bool | open (const QString &) |
Load a load file and its loads' list The filename should have the .lml extension (impload file) More... | |
void | save () |
save the current load list in the current file name More... | |
void | saveAs (const QString &) |
save the current load list in a new file More... | |
Loads * | getLoads () |
get the current load list More... | |
void | setLoads (Loads *) |
set the current load list (delete previous if existing) More... | |
void | deleteAllLoads () |
delete all current loads More... | |
void | close () |
close the current load list (means do not save, put the current filename to "" and physicalmodel ptr to NULL (but of course don not delete it!) More... | |
void | addLoad (Load *) |
add a load to the list More... | |
void | editLoads () |
show the edit dialog More... | |
void | previewLoads () |
show the preview dialog More... | |
void | addLoad () |
show the add load dialog (add loads on all currently selected AtomDC atoms) More... | |
Simulation | |
methods that deals with the simulation | |
LoadsSimulation * | getLoadsSimulation () |
void | simulation () |
show the animation motor add-on dialog More... | |
void | addSimulationTab (QWidget *) |
add another widget in the simulation tab More... | |
void | pause () |
stop the current simulation or movie More... | |
void | rewind () |
rewind the current simulation or movie More... | |
3D Display | |
methods in charge of change in the 3D display | |
void | updateTime () |
To update the display of current time using the animation motor add-on (if it exists) actual time. More... | |
void | setDisplayLoads (bool) |
show/unshow the load in 3D More... | |
void | updateLoadsDisplay () |
update the current 3D representation of the loads (arrows...) More... | |
bool | displayLoads () const |
return true only if the loads are currently being displayed in 3D More... | |
Other (Utilities) | |
other methods (generaly utilities) | |
bool | isModified () const |
return the current state regarding modification since the last save More... | |
void | setChangedFlagOff () |
set the Loads changed flag to false; More... | |
bool | getLoadsChangedFlag () |
return the loads changed flag value; More... | |
bool | userWantsToSave () |
ask the user if (s)he wants to save the last changed More... | |
PMManagerDC * | getPMManagerDC () |
get the current physical model More... | |
QString | getAnimationMotorAddonLocation () |
get the animation motor add-onlocation (.dll / .so / .dylib) More... | |
void | setAnimationMotorAddonLocation (QString) |
set the animation motor add-on location More... | |
void | userConstrainedAtomDataScale (bool constrained) |
set the data scale state (user constrained or driven by min/max in the simulution) More... | |
bool | getUserConstrainedAtomDataScale () |
get the current state of the data scale More... | |
void | getAtomDataScale (double *min, double *max) |
get the user constrained values of the data scale (or current min/max in the data scale is not user constrained) More... | |
Private Member Functions | |
void | addDecoration (Atom *a, Load *ld, double time, double defaultSize, double *max, double *min, double *val) |
add a decoration to atom. More... | |
Private Attributes | |
std::AtomDataVector | atomData |
List of atom data values (one value per atom) More... | |
AtomDataDisplayType | atomDataDisplay |
which atom data are to display: none, displacements, distances, ... More... | |
QString | atomDataName |
name of the add-on atom data More... | |
bool | changed |
had the load list been changed since the last time it was saved More... | |
bool | constrainedAtomDataScale |
current state of the data scale More... | |
QString | fileName |
the current name of managed file More... | |
bool | loadsChangedFlag |
has the load list been changed since the last simulation More... | |
LoadsEditor * | loadsEditor |
the dialog where all the loads are shown, and can be modified More... | |
double | max |
current maximum value of the data scale More... | |
double | min |
current minimum value of the data scale More... | |
QString | motorAddonLocation |
the current animation motor add-on location More... | |
Loads * | myLoads |
all the managed loads More... | |
PMManagerDC * | myPMManagerDC |
the PM manager DC More... | |
LoadsMovie * | previewDialog |
the preview (simulation animation dialog) More... | |
PhysicalModel * | referencePM |
the physical model to use as the reference for some atom data display More... | |
QSet< AtomDecoration * > | representation3D |
List of arrow and sphere representing the loads in 3D. More... | |
bool | showLoads |
are the load currently displayed in 3D? More... | |
QDockWidget * | simDock |
the dock widget where the simulation dialog is More... | |
LoadsSimulation * | simulationDialog |
the simulation dialog More... | |
Atom Data Display | |
methods in charge of the atom display (color for each node, interpolated if the representation is surfacic) | |
enum | AtomDataDisplayType { NONE, ADD_ON, DISPLACEMENTS, DISTANCES, RELATIVE_ENERGY_NORM_ERROR } |
void | setAtomDataDisplay (AtomDataDisplayType) |
set the type of atom data display you want to see, for ADD_ON please use setAtomData More... | |
AtomDataDisplayType | getAtomDataDisplay () const |
get current atom display type More... | |
void | setReferencePML (const QString &) |
set the file name for the reference Physical Model More... | |
PhysicalModel * | getReferencePM () const |
return the reference physical model to use for some computations More... | |
void | setAtomData (std::AtomDataVector &, QString name="Add-On Monitor") |
set the new atom data (one scalar per atom), and update display More... | |
std::AtomDataVector & | getAtomData () |
get the current list of all the atom data More... | |
void | updateAtomDataScale (double min, double max) |
update the color scale of the atom data (min and max values) More... | |
This class manages the applied all loads (see LML), deformation add-on, atom data monitoring and atom decoration.
Thanks to contribution from: Pascale Ducloux, Aude Flourens, Jocelyne Mekontso, Christine Oddes.
type of atom data display (exclusive)
LoadsManager::LoadsManager | ( | PMManagerDC * | pmManagerDC | ) |
Constructor (give it the PMManagerDC it is linked with)
References atomDataDisplay, changed, constrainedAtomDataScale, fileName, LoadsSimulation::init(), loadsChangedFlag, loadsEditor, max, min, motorAddonLocation, myLoads, myPMManagerDC, NONE, previewDialog, referencePM, showLoads, simDock, and simulationDialog.
LoadsManager::~LoadsManager | ( | ) |
Destructor.
References close(), NONE, previewDialog, referencePM, setAtomDataDisplay(), simDock, and simulationDialog.
|
private |
add a decoration to atom.
a | the atom on which the decoration will be added |
ld | the decoration type is dependent of the type of ld (translation, force, null translation...) |
References PMManagerDC::getDC(), PMManagerDC::getPhysicalModel(), AtomDecoration::getType(), myPMManagerDC, representation3D, AtomDecoration::setColor(), AtomDecoration::setSize(), AtomDecoration::show(), and AtomDecoration::update().
Referenced by updateLoadsDisplay().
void LoadsManager::addLoad | ( | Load * | l | ) |
add a load to the list
References changed, loadsChangedFlag, and myLoads.
Referenced by LoadsEditor::apply().
void LoadsManager::addLoad | ( | ) |
show the add load dialog (add loads on all currently selected AtomDC atoms)
References camitk::Application::getSelectedComponents(), camitk::Component::isInstanceOf(), loadsChangedFlag, and LoadsEditor::show().
void LoadsManager::addSimulationTab | ( | QWidget * | w | ) |
add another widget in the simulation tab
References LoadsSimulation::addTab(), and simulationDialog.
void LoadsManager::close | ( | ) |
close the current load list (means do not save, put the current filename to "" and physicalmodel ptr to NULL (but of course don not delete it!)
References changed, fileName, loadsEditor, myLoads, representation3D, save(), AtomDecoration::show(), and userWantsToSave().
Referenced by PMManagerDCPopup::closeLoads(), open(), and ~LoadsManager().
void LoadsManager::deleteAllLoads | ( | ) |
delete all current loads
References loadsChangedFlag, and myLoads.
Referenced by LoadsEditor::apply(), and setLoads().
|
inline |
return true only if the loads are currently being displayed in 3D
References showLoads.
Referenced by PMManagerDCPopup::updateMenuActions().
void LoadsManager::editLoads | ( | ) |
show the edit dialog
References loadsChangedFlag, loadsEditor, LoadsEditor::show(), and LoadsEditor::updateLoads().
Referenced by PMManagerDCPopup::editLoads().
QString LoadsManager::getAnimationMotorAddonLocation | ( | ) |
get the animation motor add-onlocation (.dll / .so / .dylib)
References motorAddonLocation.
Referenced by LoadsSimulation::init().
|
inline |
get the current list of all the atom data
References atomData.
Referenced by LoadsSimulationDriver::updateAtomData().
|
inline |
get current atom display type
References atomDataDisplay.
Referenced by LoadsSimulation::doOneStep(), LoadsSimulationDriver::updateAtomData(), and PMManagerDCPopup::updateMenuActions().
void LoadsManager::getAtomDataScale | ( | double * | min, |
double * | max | ||
) |
get the user constrained values of the data scale (or current min/max in the data scale is not user constrained)
min | the min value of the data scale |
max | the max value of the data scale |
Referenced by LoadsSimulationDriver::updateAtomData().
Loads * LoadsManager::getLoads | ( | ) |
get the current load list
References myLoads.
Referenced by LoadsMovie::init(), LoadsMovie::LoadsMovie(), LoadsSimulationDriver::rewind(), LoadsEditor::updateLoads(), and PMManagerDCPopup::updateMenuActions().
|
inline |
return the loads changed flag value;
References loadsChangedFlag.
|
inline |
get the current LoadsSimulation
References simulationDialog.
|
inline |
get the current physical model
References myPMManagerDC.
Referenced by LoadsEditor::applyToReturnPressed(), LoadsSimulation::doOneStep(), LoadsSimulationDriver::init(), LoadsMovie::makeVideo(), LoadsSimulationDriver::resetPositions(), setDisplayLoads(), LoadsSimulationDriver::updateAtomData(), and LoadsSimulationDriver::updatePositions().
|
inline |
return the reference physical model to use for some computations
References referencePM.
Referenced by PMManagerDCPopup::atomDataDisplay(), and LoadsSimulationDriver::updateAtomData().
bool LoadsManager::getUserConstrainedAtomDataScale | ( | ) |
get the current state of the data scale
References constrainedAtomDataScale.
Referenced by PMManagerDCPopup::setAtomDataScale(), and LoadsSimulationDriver::updateAtomData().
|
inline |
return the current state regarding modification since the last save
References changed.
Referenced by PMManagerDC::getModified(), and PMManagerDCPopup::updateMenuActions().
bool LoadsManager::open | ( | const QString & | fileName | ) |
Load a load file and its loads' list The filename should have the .lml extension (impload file)
References changed, close(), fileName, loadsChangedFlag, and myLoads.
Referenced by PMManagerDCPopup::openLoads().
void LoadsManager::pause | ( | ) |
stop the current simulation or movie
References LoadsMovie::pause(), LoadsSimulation::pause(), previewDialog, and simulationDialog.
void LoadsManager::previewLoads | ( | ) |
void LoadsManager::rewind | ( | ) |
rewind the current simulation or movie
References previewDialog, LoadsMovie::reset(), LoadsMovie::rewind(), LoadsSimulation::rewind(), and simulationDialog.
void LoadsManager::save | ( | ) |
void LoadsManager::saveAs | ( | const QString & | fileName | ) |
save the current load list in a new file
References fileName, and save().
Referenced by PMManagerDCPopup::saveAsLoads().
void LoadsManager::setAnimationMotorAddonLocation | ( | QString | mloc | ) |
set the animation motor add-on location
References motorAddonLocation.
Referenced by LoadsSimulation::loadAddon().
void LoadsManager::setAtomData | ( | std::AtomDataVector & | pData, |
QString | name = "Add-On Monitor" |
||
) |
set the new atom data (one scalar per atom), and update display
name | for add-ons, this is the specific atom data name to show on screen |
References ADD_ON, atomData, atomDataName, and setAtomDataDisplay().
void LoadsManager::setAtomDataDisplay | ( | AtomDataDisplayType | adt | ) |
set the type of atom data display you want to see, for ADD_ON please use setAtomData
References ADD_ON, atomDataDisplay, atomDataName, PMManagerDC::createPointData(), PMManagerDC::destroyPointData(), DISPLACEMENTS, DISTANCES, myPMManagerDC, NONE, previewDialog, RELATIVE_ENERGY_NORM_ERROR, simulationDialog, LoadsMovie::updateDisplay(), and LoadsSimulation::updateDisplay().
Referenced by PMManagerDCPopup::atomDataDisplay(), LoadsSimulation::doOneStep(), setAtomData(), and ~LoadsManager().
|
inline |
set the Loads changed flag to false;
References loadsChangedFlag.
void LoadsManager::setDisplayLoads | ( | bool | s | ) |
show/unshow the load in 3D
References getPMManagerDC(), camitk::Component::refresh(), representation3D, AtomDecoration::show(), showLoads, and updateLoadsDisplay().
Referenced by PMManagerDCPopup::displayLoads().
void LoadsManager::setLoads | ( | Loads * | loads | ) |
set the current load list (delete previous if existing)
References deleteAllLoads(), and myLoads.
Referenced by MMLComponent::MMLComponent().
void LoadsManager::setReferencePML | ( | const QString & | fileName | ) |
set the file name for the reference Physical Model
References referencePM.
Referenced by PMManagerDCPopup::openReferencePML().
void LoadsManager::simulation | ( | ) |
show the animation motor add-on dialog
References simDock.
Referenced by PMManagerDCPopup::simulation().
void LoadsManager::updateAtomDataScale | ( | double | min, |
double | max | ||
) |
update the color scale of the atom data (min and max values)
References constrainedAtomDataScale, max, and min.
Referenced by PMManagerDCPopup::setAtomDataScale(), and LoadsSimulationDriver::updateAtomData().
void LoadsManager::updateLoadsDisplay | ( | ) |
update the current 3D representation of the loads (arrows...)
References addDecoration(), PMManagerDC::getBoundingRadius(), PMManagerDC::getPhysicalModel(), LoadsMovie::getTime(), LoadsSimulation::getTime(), AtomDecoration::getType(), max, min, myLoads, myPMManagerDC, previewDialog, representation3D, AtomDecoration::setSize(), showLoads, and simulationDialog.
Referenced by LoadsEditor::apply(), PMManagerDCPopup::openLoads(), setDisplayLoads(), and LoadsSimulationDriver::updateDisplay().
void LoadsManager::updateTime | ( | ) |
To update the display of current time using the animation motor add-on (if it exists) actual time.
References simulationDialog, and LoadsSimulation::updateTime().
void LoadsManager::userConstrainedAtomDataScale | ( | bool | constrained | ) |
set the data scale state (user constrained or driven by min/max in the simulution)
References constrainedAtomDataScale.
Referenced by PMManagerDCPopup::setAtomDataScale().
bool LoadsManager::userWantsToSave | ( | ) |
ask the user if (s)he wants to save the last changed
Referenced by close().
|
private |
List of atom data values (one value per atom)
Referenced by getAtomData(), and setAtomData().
|
private |
which atom data are to display: none, displacements, distances, ...
Referenced by getAtomDataDisplay(), LoadsManager(), and setAtomDataDisplay().
|
private |
name of the add-on atom data
Referenced by setAtomData(), and setAtomDataDisplay().
|
private |
had the load list been changed since the last time it was saved
Referenced by addLoad(), close(), isModified(), LoadsManager(), open(), and save().
|
private |
current state of the data scale
Referenced by getUserConstrainedAtomDataScale(), LoadsManager(), updateAtomDataScale(), and userConstrainedAtomDataScale().
|
private |
the current name of managed file
Referenced by close(), LoadsManager(), open(), save(), and saveAs().
|
private |
has the load list been changed since the last simulation
Referenced by addLoad(), deleteAllLoads(), editLoads(), getLoadsChangedFlag(), LoadsManager(), open(), and setChangedFlagOff().
|
private |
the dialog where all the loads are shown, and can be modified
Referenced by close(), editLoads(), and LoadsManager().
|
private |
current maximum value of the data scale
Referenced by getAtomDataScale(), LoadsManager(), updateAtomDataScale(), and updateLoadsDisplay().
|
private |
current minimum value of the data scale
Referenced by getAtomDataScale(), LoadsManager(), updateAtomDataScale(), and updateLoadsDisplay().
|
private |
the current animation motor add-on location
Referenced by getAnimationMotorAddonLocation(), LoadsManager(), and setAnimationMotorAddonLocation().
|
private |
all the managed loads
Referenced by addLoad(), close(), deleteAllLoads(), getLoads(), LoadsManager(), open(), save(), setLoads(), and updateLoadsDisplay().
|
private |
the PM manager DC
Referenced by addDecoration(), getPMManagerDC(), LoadsManager(), setAtomDataDisplay(), and updateLoadsDisplay().
|
private |
the preview (simulation animation dialog)
Referenced by LoadsManager(), pause(), previewLoads(), rewind(), setAtomDataDisplay(), updateLoadsDisplay(), and ~LoadsManager().
|
private |
the physical model to use as the reference for some atom data display
Referenced by getReferencePM(), LoadsManager(), setReferencePML(), and ~LoadsManager().
|
private |
List of arrow and sphere representing the loads in 3D.
Referenced by addDecoration(), close(), setDisplayLoads(), and updateLoadsDisplay().
|
private |
are the load currently displayed in 3D?
Referenced by displayLoads(), LoadsManager(), setDisplayLoads(), and updateLoadsDisplay().
|
private |
the dock widget where the simulation dialog is
Referenced by LoadsManager(), simulation(), and ~LoadsManager().
|
private |
the simulation dialog
Referenced by addSimulationTab(), getLoadsSimulation(), LoadsManager(), pause(), rewind(), setAtomDataDisplay(), updateLoadsDisplay(), updateTime(), and ~LoadsManager().