Computer Assited Medical Intervention Tool Kit  version 4.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
LoadsManager Class Reference

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...
 
LoadsgetLoads ()
 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

LoadsSimulationgetLoadsSimulation ()
 
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...
 
PMManagerDCgetPMManagerDC ()
 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...
 
LoadsEditorloadsEditor
 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...
 
LoadsmyLoads
 all the managed loads More...
 
PMManagerDCmyPMManagerDC
 the PM manager DC More...
 
LoadsMoviepreviewDialog
 the preview (simulation animation dialog) More...
 
PhysicalModelreferencePM
 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...
 
LoadsSimulationsimulationDialog
 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...
 
PhysicalModelgetReferencePM () const
 return the reference physical model to use for some computations More...
 
void setAtomData (std::AtomDataVector &values, QString name="Add-On Monitor")
 set the new atom data (one scalar per atom), and update display More...
 
std::AtomDataVectorgetAtomData ()
 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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ AtomDataDisplayType

type of atom data display (exclusive)

Enumerator
NONE 

do not display any atom data

ADD_ON 

display add-on atom data (i.e. atom data computed by the add-on)

DISPLACEMENTS 

display total displacements from initial position

DISTANCES 

display distances from the reference PML

RELATIVE_ENERGY_NORM_ERROR 

display the relative energy norm error (as a percentage)

Constructor & Destructor Documentation

◆ LoadsManager()

LoadsManager::LoadsManager ( PMManagerDC pmManagerDC)

Constructor (give it the PMManagerDC it is linked with)

References camitk::Application::getMainWindow().

◆ ~LoadsManager()

LoadsManager::~LoadsManager ( )

Destructor.

References camitk::Application::getMainWindow().

Member Function Documentation

◆ addDecoration()

void LoadsManager::addDecoration ( Atom a,
Load ld,
double  time,
double  defaultSize,
double *  max,
double *  min,
double *  val 
)
private

add a decoration to atom.

Parameters
athe atom on which the decoration will be added
ldthe decoration type is dependent of the type of ld (translation, force, null translation...)
timethe current time
defaultSizesize by default
minminimal value (can be updated)
maxmaximal value (can be updated)
valcurrent value (always updated)

References camitk::GeometricObject::ARROW, Load::getDirection(), Atom::getPosition(), AtomDecoration::getType(), Load::getType(), Load::getValue(), AtomDecoration::setColor(), AtomDecoration::setSize(), AtomDecoration::show(), camitk::GeometricObject::SPHERE, and AtomDecoration::update().

◆ addLoad() [1/2]

void LoadsManager::addLoad ( Load l)

add a load to the list

Referenced by LoadsEditor::apply().

◆ addLoad() [2/2]

void LoadsManager::addLoad ( )

show the add load dialog (add loads on all currently selected AtomDC atoms)

References camitk::Application::getSelectedComponents(), camitk::Component::isInstanceOf(), and LoadsEditor::show().

◆ addSimulationTab()

void LoadsManager::addSimulationTab ( QWidget *  w)

add another widget in the simulation tab

◆ close()

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 camitk::InteractiveViewer::get3DViewer(), camitk::InteractiveViewer::refreshRenderer(), and AtomDecoration::show().

Referenced by PMManagerDCPopup::closeLoads().

◆ deleteAllLoads()

void LoadsManager::deleteAllLoads ( )

delete all current loads

Referenced by LoadsEditor::apply().

◆ displayLoads()

bool LoadsManager::displayLoads ( ) const
inline

return true only if the loads are currently being displayed in 3D

Referenced by PMManagerDCPopup::updateMenuActions().

◆ editLoads()

void LoadsManager::editLoads ( )

show the edit dialog

Referenced by PMManagerDCPopup::editLoads().

◆ getAnimationMotorAddonLocation()

QString LoadsManager::getAnimationMotorAddonLocation ( )

get the animation motor add-onlocation (.dll / .so / .dylib)

Referenced by LoadsSimulation::init().

◆ getAtomData()

std::AtomDataVector & LoadsManager::getAtomData ( )
inline

get the current list of all the atom data

◆ getAtomDataDisplay()

LoadsManager::AtomDataDisplayType LoadsManager::getAtomDataDisplay ( ) const
inline

get current atom display type

Referenced by LoadsSimulation::doOneStep(), and PMManagerDCPopup::updateMenuActions().

◆ getAtomDataScale()

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)

Parameters
minthe min value of the data scale
maxthe max value of the data scale

◆ getLoads()

Loads * LoadsManager::getLoads ( )

◆ getLoadsChangedFlag()

bool LoadsManager::getLoadsChangedFlag ( )
inline

return the loads changed flag value;

◆ getLoadsSimulation()

LoadsSimulation * LoadsManager::getLoadsSimulation ( )
inline

get the current LoadsSimulation

◆ getPMManagerDC()

PMManagerDC * LoadsManager::getPMManagerDC ( )
inline

◆ getReferencePM()

PhysicalModel * LoadsManager::getReferencePM ( ) const
inline

return the reference physical model to use for some computations

Referenced by PMManagerDCPopup::atomDataDisplay().

◆ getUserConstrainedAtomDataScale()

bool LoadsManager::getUserConstrainedAtomDataScale ( )

get the current state of the data scale

Referenced by PMManagerDCPopup::setAtomDataScale().

◆ isModified()

bool LoadsManager::isModified ( ) const
inline

return the current state regarding modification since the last save

Referenced by PMManagerDC::getModified(), and PMManagerDCPopup::updateMenuActions().

◆ open()

bool LoadsManager::open ( const QString &  fileName)

Load a load file and its loads' list The filename should have the .lml extension (impload file)

Returns
true if the file was succesfully read,
false otherwise (problem or unknown extension).

Referenced by PMManagerDCPopup::openLoads().

◆ pause()

void LoadsManager::pause ( )

stop the current simulation or movie

◆ previewLoads()

void LoadsManager::previewLoads ( )

show the preview dialog

Referenced by PMManagerDCPopup::previewLoads().

◆ rewind()

void LoadsManager::rewind ( )

rewind the current simulation or movie

◆ save()

void LoadsManager::save ( )

save the current load list in the current file name

Referenced by PMManagerDCPopup::saveLoads().

◆ saveAs()

void LoadsManager::saveAs ( const QString &  fileName)

save the current load list in a new file

Referenced by PMManagerDCPopup::saveAsLoads().

◆ setAnimationMotorAddonLocation()

void LoadsManager::setAnimationMotorAddonLocation ( QString  mloc)

set the animation motor add-on location

Referenced by LoadsSimulation::loadAddon().

◆ setAtomData()

void LoadsManager::setAtomData ( std::AtomDataVector values,
QString  name = "Add-On Monitor" 
)

set the new atom data (one scalar per atom), and update display

Parameters
valuesvalues to show
namefor add-ons, this is the specific atom data name to show on screen

◆ setAtomDataDisplay()

void LoadsManager::setAtomDataDisplay ( AtomDataDisplayType  adt)

set the type of atom data display you want to see, for ADD_ON please use setAtomData

References camitk::InteractiveViewer::get3DViewer(), camitk::InteractiveViewer::setColorScale(), and camitk::InteractiveViewer::setColorScaleTitle().

Referenced by PMManagerDCPopup::atomDataDisplay(), and LoadsSimulation::doOneStep().

◆ setChangedFlagOff()

void LoadsManager::setChangedFlagOff ( )
inline

set the Loads changed flag to false;

◆ setDisplayLoads()

void LoadsManager::setDisplayLoads ( bool  s)

show/unshow the load in 3D

References AtomDecoration::show().

Referenced by PMManagerDCPopup::displayLoads().

◆ setLoads()

void LoadsManager::setLoads ( Loads loads)

set the current load list (delete previous if existing)

◆ setReferencePML()

void LoadsManager::setReferencePML ( const QString &  fileName)

set the file name for the reference Physical Model

Referenced by PMManagerDCPopup::openReferencePML().

◆ simulation()

void LoadsManager::simulation ( )

show the animation motor add-on dialog

Referenced by PMManagerDCPopup::simulation().

◆ updateAtomDataScale()

void LoadsManager::updateAtomDataScale ( double  min,
double  max 
)

update the color scale of the atom data (min and max values)

References camitk::InteractiveViewer::get3DViewer(), and camitk::InteractiveViewer::setColorScaleMinMax().

Referenced by PMManagerDCPopup::setAtomDataScale().

◆ updateLoadsDisplay()

void LoadsManager::updateLoadsDisplay ( )

◆ updateTime()

void LoadsManager::updateTime ( )

To update the display of current time using the animation motor add-on (if it exists) actual time.

◆ userConstrainedAtomDataScale()

void LoadsManager::userConstrainedAtomDataScale ( bool  constrained)

set the data scale state (user constrained or driven by min/max in the simulution)

Referenced by PMManagerDCPopup::setAtomDataScale().

◆ userWantsToSave()

bool LoadsManager::userWantsToSave ( )

ask the user if (s)he wants to save the last changed

Member Data Documentation

◆ atomData

std::AtomDataVector LoadsManager::atomData
private

List of atom data values (one value per atom)

◆ atomDataDisplay

AtomDataDisplayType LoadsManager::atomDataDisplay
private

which atom data are to display: none, displacements, distances, ...

◆ atomDataName

QString LoadsManager::atomDataName
private

name of the add-on atom data

◆ changed

bool LoadsManager::changed
private

had the load list been changed since the last time it was saved

◆ constrainedAtomDataScale

bool LoadsManager::constrainedAtomDataScale
private

current state of the data scale

◆ fileName

QString LoadsManager::fileName
private

the current name of managed file

◆ loadsChangedFlag

bool LoadsManager::loadsChangedFlag
private

has the load list been changed since the last simulation

◆ loadsEditor

LoadsEditor* LoadsManager::loadsEditor
private

the dialog where all the loads are shown, and can be modified

◆ max

double LoadsManager::max
private

current maximum value of the data scale

◆ min

double LoadsManager::min
private

current minimum value of the data scale

◆ motorAddonLocation

QString LoadsManager::motorAddonLocation
private

the current animation motor add-on location

◆ myLoads

Loads* LoadsManager::myLoads
private

all the managed loads

◆ myPMManagerDC

PMManagerDC* LoadsManager::myPMManagerDC
private

the PM manager DC

◆ previewDialog

LoadsMovie* LoadsManager::previewDialog
private

the preview (simulation animation dialog)

◆ referencePM

PhysicalModel* LoadsManager::referencePM
private

the physical model to use as the reference for some atom data display

◆ representation3D

QSet<AtomDecoration *> LoadsManager::representation3D
private

List of arrow and sphere representing the loads in 3D.

◆ showLoads

bool LoadsManager::showLoads
private

are the load currently displayed in 3D?

◆ simDock

QDockWidget* LoadsManager::simDock
private

the dock widget where the simulation dialog is

◆ simulationDialog

LoadsSimulation* LoadsManager::simulationDialog
private

the simulation dialog


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