Computer Assisted Medical Intervention Tool Kit  version 5.2
ValueEvent.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 VALUEEVENT_H
27 #define VALUEEVENT_H
28 
29 #include <iostream>
30 
41 class ValueEvent {
42 
43 public:
45  ValueEvent(const double v, const double d): value(v), date(d) {};
46 
48  ValueEvent() {};
49 
51  ~ValueEvent() = default;
52 
54  bool isActive(const double t) const;
55 
57  double getValue() ;
59  double getValue(const double t) ;
61  double getValue(const double t, ValueEvent* nextE) ;
62 
64  void setDate(const double);
66  void setValue(const double);
67 
69  double getDate() const;
70 
74  friend std::ostream& operator << (std::ostream&, ValueEvent);
75 
77  void xmlPrint(std::ostream&);
78 
79 private:
81  double value{0.0};
83  double date{0.0};
84 
85 };
86 
87 #endif //VALUEEVENT_H
A valueEvent of a load is composed of a value and a date.
Definition: ValueEvent.h:41
void setDate(const double)
set the value event date
Definition: ValueEvent.cpp:84
ValueEvent()
default constructor
Definition: ValueEvent.h:48
bool isActive(const double t) const
return true if the event is active at time t
Definition: ValueEvent.cpp:31
void xmlPrint(std::ostream &)
Print to an ostream.
Definition: ValueEvent.cpp:67
void setValue(const double)
set the value event value
Definition: ValueEvent.cpp:89
double getValue()
return the scalar value of the event
Definition: ValueEvent.cpp:36
double getDate() const
double get start time
Definition: ValueEvent.cpp:62
~ValueEvent()=default
destructor
friend std::ostream & operator<<(std::ostream &, ValueEvent)
print to an output stream in XML format.
Definition: ValueEvent.cpp:74
ValueEvent(const double v, const double d)
constructor with initial values
Definition: ValueEvent.h:45