/* * EpochAxis.cc * * Created on: 16 jan. 2015 * Author: AKKA */ #include "EpochAxis.hh" #include #include namespace plot { /** * @overrides Axis::getComputedValues */ double* EpochAxis::getComputedValues(double* originalValues_, int size_, double min, double max) { double *computedValues = new double [size_]; // Duplicates data std::memcpy (computedValues, originalValues_, size_ * sizeof (double)); for (int i = 0; i < size_; ++i) { if (_normalized) { if (computedValues[i] < _crtCenterTime) computedValues[i] = (_crtCenterTime - computedValues[i])/(min - _crtCenterTime); else computedValues[i] = (computedValues[i] - _crtCenterTime)/(max - _crtCenterTime); } else computedValues[i] -= _crtCenterTime; } return computedValues; } } /* namespace plot */