Computer Assited Medical Intervention Tool Kit  version 5.0
Reference Class Reference

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

#include <Reference.h>

+ Collaboration diagram for Reference:

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 ref[3])
 get the nearest reference point in the "target" using "Position" monitor of the PML Reference. 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...
 
 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:

  • a MMLout (xml type MonitoringOut)
  • a target to consider inside the MMLout

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

  • the path to a PML document, this is managed by the pml private attribute.
  • vector of timestep that contains (time, vector values), this is managed by inner struct timeStep.

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 
)

constructor

◆ ~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(), Atom::getPosition(), Cell::getProperties(), StructuralComponent::getStructure(), StructureProperties::getType(), AtomIterator::next(), pml, target, and StructureProperties::TRIANGLE.

+ Here is the call graph for this function:

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

+ Here is the caller graph for this function:

◆ 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  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.

+ Here is the call graph for this function:

◆ getNearest() [2/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.

+ Here is the call graph for this function:

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

◆ data

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

vector which contain alls monitors for each time step

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

◆ mmlOut

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

Object in the file generated by xsdcxx.

◆ mmlOutFile

std::string Reference::mmlOutFile
private

the mmlOut document

Referenced by toString().

◆ monitoringManager

MonitoringManager* Reference::monitoringManager
private

monitoring manager

◆ pml

PhysicalModel* Reference::pml
private

pml of the reference

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

◆ target

std::string Reference::target
private

target

Referenced by getDistanceToTriangularMesh(), and getNearest().


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