##// END OF EJS Templates
Handles rendering of plottables (1)...
Handles rendering of plottables (1) As for the axes properties, we create a helper used to set rendering properties of the plottables depending on the type of the data series used to create these plottables. Rendering properties will be, for example: - the color of each component for a scalar or a vector - the color scale management for a spectrogram

File last commit:

r917:3bf91527f27d
r918:8264fa4b2aa2
Show More
AxisRenderingUtils.h
34 lines | 991 B | text/x-c | CLexer
#ifndef SCIQLOP_AXISRENDERINGUTILS_H
#define SCIQLOP_AXISRENDERINGUTILS_H
#include <memory>
#include <QtCore/QString>
class IDataSeries;
class QCPAxis;
class QCPColorScale;
class QCustomPlot;
/// Formats a data value according to the axis on which it is present
QString formatValue(double value, const QCPAxis &axis);
/**
* Helper used to handle axes rendering
*/
struct IAxisHelper {
virtual ~IAxisHelper() noexcept = default;
/// Set properties of the plot's axes and the color scale associated to plot passed as
/// parameters
/// @param plot the plot for which to set axe properties
/// @param colorScale the color scale for which to set properties
virtual void setProperties(QCustomPlot &plot, QCPColorScale &colorScale) = 0;
};
struct IAxisHelperFactory {
/// Creates IAxisHelper according to a data series
static std::unique_ptr<IAxisHelper> create(std::shared_ptr<IDataSeries> dataSeries) noexcept;
};
#endif // SCIQLOP_AXISRENDERINGUTILS_H