ScalarSeries.h
39 lines
| 1.2 KiB
| text/x-c
|
CLexer
|
r118 | #ifndef SCIQLOP_SCALARSERIES_H | ||
#define SCIQLOP_SCALARSERIES_H | ||||
#include <Data/DataSeries.h> | ||||
/** | ||||
* @brief The ScalarSeries class is the implementation for a data series representing a scalar. | ||||
*/ | ||||
class ScalarSeries : public DataSeries<1> { | ||||
public: | ||||
/** | ||||
* Ctor | ||||
* @param size the number of data the series will hold | ||||
* @param xAxisUnit x-axis unit | ||||
* @param valuesUnit values unit | ||||
*/ | ||||
|
r175 | explicit ScalarSeries(int size, const Unit &xAxisUnit, const Unit &valuesUnit); | ||
|
r118 | |||
|
r361 | /** | ||
* Ctor with two vectors. The vectors must have the same size, otherwise a ScalarSeries with no | ||||
* values will be created. | ||||
* @param xAxisData x-axis data | ||||
* @param valuesData values data | ||||
*/ | ||||
explicit ScalarSeries(QVector<double> xAxisData, QVector<double> valuesData, | ||||
const Unit &xAxisUnit, const Unit &valuesUnit); | ||||
|
r118 | /** | ||
* Sets data for a specific index. The index has to be valid to be effective | ||||
* @param index the index to which the data will be set | ||||
* @param x the x-axis data | ||||
* @param value the value data | ||||
*/ | ||||
void setData(int index, double x, double value) noexcept; | ||||
|
r287 | |||
std::unique_ptr<IDataSeries> clone() const; | ||||
|
r118 | }; | ||
#endif // SCIQLOP_SCALARSERIES_H | ||||