Computer Assisted Medical Intervention Tool Kit  version 5.2
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-2024 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, 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;
152  MonitoringManager* monitoringManager;
154  std::string target;
156  PhysicalModel* pml;
159  std::vector<timeStep*> data;
161  int CurrentIndex;
162 
163 };
164 
165 #endif // REFRENCE_REFERENCE_H
A monitor calculate and store followed data (ex:calculation between current position and references) ...
Definition: Monitor.h:49
Manager of the benchmark tests.
Definition: MonitoringManager.h:50
This is the main class of this project.
Definition: PhysicalModel.h:86
A reference is used to compare to simulated data.
Definition: Reference.h:63
virtual ~Reference()
destructor
Definition: Reference.cpp:97
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
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
std::string toString()
return a string relative to Reference type
Definition: Reference.cpp:311
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(mml::Reference reference, MonitoringManager *monitoringManager)
constructor
Definition: Reference.cpp:45