EpochAxis.hh
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* EpochAxis.hh
*
* Created on: 16 jan. 2015
* Author: AKKA
*/
#ifndef EPOCHAXIS_HH_
#define EPOCHAXIS_HH_
#include "TimeAxis.hh"
namespace plot {
/**
* @brief Axis implementation for epoch time (ie relative time to a reference time)
*/
class EpochAxis: public plot::TimeAxis {
public:
EpochAxis() :
TimeAxis(), _crtCenterTime(0), _normalized(false) {
}
EpochAxis(const EpochAxis& axis) :
TimeAxis(axis), _crtCenterTime(0), _normalized(false) {
}
virtual ~EpochAxis() {
}
/*
* @brief Set the center time to use with the function getComputedValues
*/
void setCrtCenterTime(double crtCenterTime)
{
_crtCenterTime = crtCenterTime;
}
/*
* @brief Set normalize option
*/
void setNormalized(bool normalized)
{
_normalized = normalized;
}
/*
* @brief Get if it's a normalized axis
*/
bool isNormalized()
{
return _normalized;
}
/**
* @brief Dump axis properties
*/
void dump(std::ostream& out) {
Axis::dump(out);
}
/**
* @overrides Axis::getComputedValues
*/
virtual double* getComputedValues(double* values_, int size_, double min, double max);
private :
double _crtCenterTime;
bool _normalized;
};
inline std::ostream& operator <<(std::ostream& out, const EpochAxis& /*axis*/) {
return out;
}
} /* namespace plot */
#endif /* EPOCHAXIS_HH_ */