Computer Assisted Medical Intervention Tool Kit  version 5.2
Monitor.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 MONITOR_MONITOR_H
27 #define MONITOR_MONITOR_H
28 
29 #include "MMLAPI.h"
30 
31 #include <string>
32 #include <vector>
33 
34 // Monitor includes
35 #include "MonitoringManager.h"
36 #include <MonitorIn.hxx>
37 
38 // Reference includes
39 #include "Reference.h"
50 
51 public:
52 
60  enum type {
64  MATRIX_33SET
65  };
67  static const unsigned int typeCount = 4;
68 
73  Monitor(mml::Monitor* m, MonitoringManager* monitoringManager, Monitor::type type);
75  virtual ~Monitor();
76 
78  virtual void calculate() = 0;
80  virtual void write();
81 
82  int getIndex();
83  double getStartAt();
84  double getStopAt();
85  std::string getReferenceName();
86  std::string getTargetName();
87  Monitor::type getValueType();
88  virtual std::string getTypeName() = 0;
89 
91  bool getValuesOfIndex(int i, double values[]);
93  int getIndexOfValues(const unsigned int i);
95  double getValue(const unsigned int i);
97  unsigned int getNumberOfIndex();
99  unsigned int getNumberOfValues();
100 
101 protected:
103  int index;
105  double startAt;
107  double stopAt;
109  std::vector<Reference*> references;
111  std::string target;
113  std::map<int, std::vector<double> > indexToValuesMap;
115  mml::Monitor* mappedObject;
123  double dx;
125  double dy;
127  double dz;
129  std::vector<double> values;
131  std::vector<int> indexes;
132 };
133 
134 #endif // MONITOR_MONITOR_H
135 
#define MML_API
Definition: MMLAPI.h:43
A monitor calculate and store followed data (ex:calculation between current position and references) ...
Definition: Monitor.h:49
double dx
offset in x direction (if reference is not aligned)
Definition: Monitor.h:123
int dimension
dimension of data stored
Definition: Monitor.h:121
Monitor::type valueType
type of the values stored
Definition: Monitor.h:119
double dz
offset in z direction (if reference is not aligned)
Definition: Monitor.h:127
mml::Monitor * mappedObject
the xsdcxx object representing monitor, used for serialization
Definition: Monitor.h:115
std::vector< int > indexes
vector which contains target's atoms index (in same order that values associate with)
Definition: Monitor.h:131
type
type of the values stored (please update typeCount and doc if you update the enum) SCALAR: the monito...
Definition: Monitor.h:60
@ SCALARSET
Definition: Monitor.h:62
@ SCALAR
Definition: Monitor.h:61
@ VECTORSET
Definition: Monitor.h:63
std::map< int, std::vector< double > > indexToValuesMap
map between indexes and values
Definition: Monitor.h:113
double dy
offset in y direction (if reference is not aligned)
Definition: Monitor.h:125
int index
index of monitor
Definition: Monitor.h:103
double stopAt
time to stop monitoring
Definition: Monitor.h:107
virtual void calculate()=0
calculate current followed data and store them in values vector
MonitoringManager * monitoringManager
monitoring manager
Definition: Monitor.h:117
double startAt
time to start monitoring
Definition: Monitor.h:105
virtual std::string getTypeName()=0
std::vector< double > values
the vector which contains data monitored
Definition: Monitor.h:129
std::string target
the name of the component targeted by the monitor
Definition: Monitor.h:111
std::vector< Reference * > references
references used when monitor need references
Definition: Monitor.h:109
Manager of the benchmark tests.
Definition: MonitoringManager.h:50
static Value getValue(const QMap< const QtProperty *, PrivateData > &propertyMap, const QtProperty *property, const Value &defaultValue=Value())
Definition: qtpropertymanager.cpp:222