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

A reference is used to compare to simulated data. More...

#include <Reference.h>

Classes

struct  timeStep
 private structure with monitors for a time step More...
 

Public Member Functions

bool getDistanceToTriangularMesh (double pos[3], double &dist)
 get distance to a triangular mesh, the target of the reference must contain triangles. More...
 
bool getMonitoredData (std::string type, double ref[])
 get the the values of a given monitor which do not depend of time or an atom (e.g. More...
 
bool getMonitoredData (std::string type, double time, double &realTime, double ref[])
 get the the values of a given monitor at a given time which do not depend an atom (e.g. More...
 
bool getMonitoredData (std::string type, double time, int index, double &realTime, double ref[])
 get the the values of a given monitor at a given time and a given atom's index (e.g. More...
 
bool getNearest (double pos[3], double time, double ref[3])
 get the nearest reference point in the "target" using "Position" monitor at given time More...
 
bool getNearest (double pos[3], double ref[3])
 get the nearest reference point in the "target" using "Position" monitor of the PML Reference. More...
 
 Reference (mml::Reference reference, MonitoringManager *monitoringManager)
 constructor More...
 
std::string toString ()
 return a string relative to Reference type More...
 
virtual ~Reference ()
 destructor More...
 

Private Attributes

int CurrentIndex
 current data index, stored to avoid search from beginning in the data vector More...
 
std::vector< timeStep * > data
 vector which contain alls monitors for each time step More...
 
std::unique_ptr< mml::MonitoringOut > mmlOut
 Object in the file generated by xsdcxx. More...
 
std::string mmlOutFile
 the mmlOut document More...
 
MonitoringManagermonitoringManager
 monitoring manager More...
 
PhysicalModelpml
 pml of the reference More...
 
std::string target
 target More...
 

Detailed Description

A reference is used to compare to simulated data.

An instance of this class corresponds to the data-binding for type Reference of MonitoringModel.xsd.

A reference therefore contains:

All MonitoringOut data is also managed by this class. A MonitoringOut contains:

The PML document given in the MMLout is called the PML Reference.

The PML Reference can either be at any state (beginning, rest shape, final step...etc...) It is mainly used to get the list of Structure/Component to be used in correlation with the target field of the reference.

Note
Some monitors are directly using the position of the atoms given in the PML Reference to compute their values. Therefore it is STONGLY advised to give a PML Reference that corresponds to the FINAL step of the simulation (position at the end of the simulation/experiments).

Constructor & Destructor Documentation

◆ Reference()

Reference::Reference ( mml::Reference  reference,
MonitoringManager monitoringManager 
)

◆ ~Reference()

Reference::~Reference ( )
virtual

destructor

References data, Reference::timeStep::monitorsMap, and pml.

Member Function Documentation

◆ getDistanceToTriangularMesh()

bool Reference::getDistanceToTriangularMesh ( double  pos[3],
double &  dist 
)

get distance to a triangular mesh, the target of the reference must contain triangles.

This is a fast method that gives the distance relatively to the triangles in the PML Reference.

Note
This is a heuristic version, which means, it does not test all triangles to find the lowest. It first look for the nearest atom in the PML Reference and then only check the triangles around this nearest atom.
This is not the exact distance to the nearest triangle, but an approximation given by the function distanceToTrianglePlane().
Parameters
posatom's position (with eventual offset)
distthe distance
Returns
true if method succeded (a triangular mesh was found)

References a, AtomIterator::begin(), AtomIterator::currentAtom(), distance(), distanceToTrianglePlane(), AtomIterator::end(), Structure::getAllStructuralComponents(), Atom::getPosition(), Cell::getProperties(), StructuralComponent::getStructure(), StructureProperties::getType(), AtomIterator::next(), pml, target, and StructureProperties::TRIANGLE.

◆ getMonitoredData() [1/3]

bool Reference::getMonitoredData ( std::string  type,
double  ref[] 
)

get the the values of a given monitor which do not depend of time or an atom (e.g.

geometrical data)

Parameters
typename of the monitor, must be a existing monitor in the mmlOut document
refa table where data will be stored
Returns
true if method succeded (an existing monitor named "type" was found)

Referenced by getNearest().

◆ getMonitoredData() [2/3]

bool Reference::getMonitoredData ( std::string  type,
double  time,
double &  realTime,
double  ref[] 
)

get the the values of a given monitor at a given time which do not depend an atom (e.g.

volume) if there is no corresponding time in reference, it return data for the first higher time.

Parameters
typename of the monitor, must be a existing monitor in the mmlOut document
timetime to get the values
realTimethe nearest time found if realTime=infinity, the nearest is the final state
refa table where data will be stored
Returns
true if method succeded

References CurrentIndex, data, and Monitor::SCALAR.

◆ getMonitoredData() [3/3]

bool Reference::getMonitoredData ( std::string  type,
double  time,
int  index,
double &  realTime,
double  ref[] 
)

get the the values of a given monitor at a given time and a given atom's index (e.g.

position)

Parameters
typename of the monitor, must be a existing monitor in the mmlOut document
timetime to get the values
indexatom's index
realTimethe nearest time found if realTime=infinity, the nearest is the final state
refa table where data will be stored
Returns
true if method succeded

References CurrentIndex, and data.

◆ getNearest() [1/2]

bool Reference::getNearest ( double  pos[3],
double  time,
double  ref[3] 
)

get the nearest reference point in the "target" using "Position" monitor at given time

Parameters
posatom's position (with eventual offset)
timetime to get the Position
refa table where positon of the nearest atom in reference will be stored
Returns
true if method succeded (a nearest atom was found in reference)

References AtomIterator::begin(), AtomIterator::currentAtom(), distance(), AtomIterator::end(), Structure::getIndex(), getMonitoredData(), AtomIterator::next(), pml, and target.

◆ getNearest() [2/2]

bool Reference::getNearest ( double  pos[3],
double  ref[3] 
)

get the nearest reference point in the "target" using "Position" monitor of the PML Reference.

This is a fast method that gives the nearest position relatively to the PML Reference.

Parameters
posatom's position (with eventual offset)
refa table where positon of the nearest atom in reference will be stored
Returns
true if method succeded (a nearest atom was found in reference)

References AtomIterator::begin(), AtomIterator::currentAtom(), distance(), AtomIterator::end(), Atom::getPosition(), AtomIterator::next(), pml, and target.

◆ toString()

std::string Reference::toString ( )

return a string relative to Reference type

References mmlOutFile.

Member Data Documentation

◆ CurrentIndex

int Reference::CurrentIndex
private

current data index, stored to avoid search from beginning in the data vector

Referenced by getMonitoredData(), and Reference().

◆ data

std::vector<timeStep*> Reference::data
private

vector which contain alls monitors for each time step

Referenced by getMonitoredData(), Reference(), and ~Reference().

◆ mmlOut

std::unique_ptr<mml::MonitoringOut> Reference::mmlOut
private

Object in the file generated by xsdcxx.

Referenced by Reference().

◆ mmlOutFile

std::string Reference::mmlOutFile
private

the mmlOut document

Referenced by Reference(), and toString().

◆ monitoringManager

MonitoringManager* Reference::monitoringManager
private

monitoring manager

Referenced by Reference().

◆ pml

PhysicalModel* Reference::pml
private

pml of the reference

Referenced by getDistanceToTriangularMesh(), getNearest(), Reference(), and ~Reference().

◆ target

std::string Reference::target
private

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