Computer Assited Medical Intervention Tool Kit  version 5.0
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-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 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
ValueEvent::operator<<
friend std::ostream & operator<<(std::ostream &, ValueEvent)
print to an output stream in XML format.
Definition: ValueEvent.cpp:74
ValueEvent::ValueEvent
ValueEvent()
default constructor
Definition: ValueEvent.h:71
ValueEvent::~ValueEvent
~ValueEvent()=default
destructor
ValueEvent::getValue
double getValue()
return the scalar value of the event
Definition: ValueEvent.cpp:36
ValueEvent::setDate
void setDate(const double)
set the value event date
Definition: ValueEvent.cpp:84
ValueEvent::xmlPrint
void xmlPrint(std::ostream &)
Print to an ostream.
Definition: ValueEvent.cpp:67
operator<<
std::ostream & operator<<(std::ostream &o, ValueEvent e)
Definition: ValueEvent.cpp:74
ValueEvent::date
double date
actual date
Definition: ValueEvent.h:106
ValueEvent.h
ValueEvent::value
double value
actual value
Definition: ValueEvent.h:104
ValueEvent
A valueEvent of a load is composed of a value and a date.
Definition: ValueEvent.h:41
ValueEvent::getDate
double getDate() const
double get start time
Definition: ValueEvent.cpp:62
ValueEvent::setValue
void setValue(const double)
set the value event value
Definition: ValueEvent.cpp:89
ValueEvent::isActive
bool isActive(const double t) const
return true if the event is active at time t
Definition: ValueEvent.cpp:31