IDataSeries.h
47 lines
| 1.1 KiB
| text/x-c
|
CLexer
Alexandre Leroux
|
r117 | #ifndef SCIQLOP_IDATASERIES_H | ||
#define SCIQLOP_IDATASERIES_H | ||||
#include <QString> | ||||
#include <memory> | ||||
template <int Dim> | ||||
class ArrayData; | ||||
Alexandre Leroux
|
r164 | struct Unit { | ||
explicit Unit(const QString &name = {}, bool timeUnit = false) | ||||
: m_Name{name}, m_TimeUnit{timeUnit} | ||||
{ | ||||
} | ||||
QString m_Name; ///< Unit name | ||||
bool m_TimeUnit; ///< The unit is a unit of time | ||||
}; | ||||
Alexandre Leroux
|
r117 | /** | ||
* @brief The IDataSeries aims to declare a data series. | ||||
* | ||||
* A data series is an entity that contains at least : | ||||
* - one dataset representing the x-axis | ||||
* - one dataset representing the values | ||||
* | ||||
* Each dataset is represented by an ArrayData, and is associated with a unit. | ||||
* | ||||
* An ArrayData can be unidimensional or two-dimensional, depending on the implementation of the | ||||
* IDataSeries. The x-axis dataset is always unidimensional. | ||||
* | ||||
* @sa ArrayData | ||||
*/ | ||||
class IDataSeries { | ||||
public: | ||||
virtual ~IDataSeries() noexcept = default; | ||||
/// Returns the x-axis dataset | ||||
virtual std::shared_ptr<ArrayData<1> > xAxisData() = 0; | ||||
Alexandre Leroux
|
r164 | virtual Unit xAxisUnit() const = 0; | ||
Alexandre Leroux
|
r117 | |||
Alexandre Leroux
|
r164 | virtual Unit valuesUnit() const = 0; | ||
Alexandre Leroux
|
r117 | }; | ||
#endif // SCIQLOP_IDATASERIES_H | ||||