Computer Assited Medical Intervention Tool Kit  version 5.0
Reference.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef REFRENCE_REFERENCE_H
27 #define REFRENCE_REFERENCE_H
28 
29 #include <string>
30 // Monitor includes
31 #include "MonitoringManager.h"
32 
33 class Monitor;
34 
63 class Reference {
64 
65 public:
67  Reference(mml::Reference reference, MonitoringManager* monitoringManager);
69  virtual ~Reference();
70 
78  bool getNearest(double pos[3], double time, double ref[3]);
79 
88  bool getNearest(double pos[3], double ref[3]);
89 
104  bool getDistanceToTriangularMesh(double pos[3], double& dist);
105 
112  bool getMonitoredData(std::string type, double ref[]);
113 
123  bool getMonitoredData(std::string type, double time, double& realTime, double ref[]);
124 
134  bool getMonitoredData(std::string type, double time, int index, double& realTime, double ref[]);
135 
137  std::string toString();
138 
139 private:
140 
142  struct timeStep {
143  double time;
144  std::multimap<std::string, Monitor*> monitorsMap;
145  };
146 
148  std::string mmlOutFile;
150  std::unique_ptr<mml::MonitoringOut> mmlOut;
154  std::string target;
159  std::vector<timeStep*> data;
162 
163 };
164 
165 #endif // REFRENCE_REFERENCE_H
Reference::timeStep::monitorsMap
std::multimap< std::string, Monitor * > monitorsMap
Definition: Reference.h:144
Reference::getMonitoredData
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.
Definition: Reference.cpp:166
Reference::mmlOutFile
std::string mmlOutFile
the mmlOut document
Definition: Reference.h:148
Reference::data
std::vector< timeStep * > data
vector which contain alls monitors for each time step
Definition: Reference.h:159
AtomIterator.h
Atom::getPosition
void getPosition(double pos[3]) const
get the position of the atom (array of 3 doubles)
Definition: Atom.h:121
Atom
An atom has an unique index in the physical model object, a 3D position, and different basic properti...
Definition: Atom.h:49
Reference::getNearest
bool getNearest(double pos[3], double time, double ref[3])
get the nearest reference point in the "target" using "Position" monitor at given time
Definition: Reference.cpp:115
distance
double distance(double pos[3], double pos2[3])
compute euclidian distance
Definition: Tools.h:61
CellProperties.h
Cell::getProperties
CellProperties * getProperties()
return the property
Definition: Cell.cpp:226
a
#define a
MonitoringManager.h
Reference::timeStep
private structure with monitors for a time step
Definition: Reference.h:142
Structure::getIndex
unsigned int getIndex() const
get the structure unique index (stored in its property)
Definition: Structure.cpp:30
Reference::~Reference
virtual ~Reference()
destructor
Definition: Reference.cpp:97
StructuralComponent
A structural component is composed either by cell or by atoms.
Definition: StructuralComponent.h:52
Reference::target
std::string target
target
Definition: Reference.h:154
Reference::toString
std::string toString()
return a string relative to Reference type
Definition: Reference.cpp:311
Monitor::SCALAR
@ SCALAR
Definition: Monitor.h:107
PhysicalModel
This is the main class of this project. Following a nice concept, a physical model is able to represe...
Definition: PhysicalModel.h:86
Reference::timeStep::time
double time
Definition: Reference.h:143
Cell
A cell has an unique index in the physical model object, is composed by atoms, and different basic pr...
Definition: Cell.h:46
distanceToTrianglePlane
double distanceToTrianglePlane(double point[3], double tri1[3], double tri2[3], double tri3[3])
compute the distance of a point to the plane defined by a 3D triangle.
Definition: Tools.cpp:32
Reference::getDistanceToTriangularMesh
bool getDistanceToTriangularMesh(double pos[3], double &dist)
get distance to a triangular mesh, the target of the reference must contain triangles.
Definition: Reference.cpp:262
Reference
A reference is used to compare to simulated data.
Definition: Reference.h:63
Reference::mmlOut
std::unique_ptr< mml::MonitoringOut > mmlOut
Object in the file generated by xsdcxx.
Definition: Reference.h:150
AtomIterator::next
void next()
if iteration is not finished, advance to next atom
Definition: AtomIterator.cpp:72
MonitorFactory::createMonitor
static Monitor * createMonitor(mml::Monitor *m, MonitoringManager *monitoringManager)
create a monitor according to the xsdcxx object monitor
Definition: MonitorFactory.cpp:37
MonitorFactory.h
MonitoringManager
Manager of the benchmark tests. Do simulation loop and tests.
Definition: MonitoringManager.h:50
StructureProperties::TRIANGLE
@ TRIANGLE
the structure is a triangle, i.e it must be a cell composed of 3 atoms
Definition: StructureProperties.h:157
StructuralComponent::getStructure
Structure * getStructure(const unsigned int) const
get a structure by its index (fisrt structure is at index 0)
Definition: StructuralComponent.h:220
Monitor::getTypeName
virtual std::string getTypeName()=0
AtomIterator::currentAtom
Atom * currentAtom()
return current atom
Definition: AtomIterator.cpp:79
Reference.h
AtomIterator::end
bool end()
return true if iterator is over the last atom
Definition: AtomIterator.cpp:67
AtomIterator
Allow iteration over a set of atoms given by a target list (component name or index list)
Definition: AtomIterator.h:40
Monitor
A monitor calculate and store followed data (ex:calculation between current position and references) ...
Definition: Monitor.h:49
Tools.h
Reference::Reference
Reference(mml::Reference reference, MonitoringManager *monitoringManager)
constructor
Definition: Reference.cpp:45
StructureProperties::getType
GeometricType getType() const
Return the type of force.
Definition: StructureProperties.h:160
Reference::monitoringManager
MonitoringManager * monitoringManager
monitoring manager
Definition: Reference.h:152
AtomIterator::begin
void begin()
place iterator on first atom
Definition: AtomIterator.cpp:62
Reference::pml
PhysicalModel * pml
pml of the reference
Definition: Reference.h:156
Reference::CurrentIndex
int CurrentIndex
current data index, stored to avoid search from beginning in the data vector
Definition: Reference.h:161