AxisRenderingUtils.h
37 lines
| 1.1 KiB
| text/x-c
|
CLexer
Alexandre Leroux
|
r916 | #ifndef SCIQLOP_AXISRENDERINGUTILS_H | ||
#define SCIQLOP_AXISRENDERINGUTILS_H | ||||
#include <memory> | ||||
Alexandre Leroux
|
r927 | #include <QtCore/QLoggingCategory> | ||
Alexandre Leroux
|
r916 | #include <QtCore/QString> | ||
Alexandre Leroux
|
r927 | Q_DECLARE_LOGGING_CATEGORY(LOG_AxisRenderingUtils) | ||
Alexandre Leroux
|
r916 | class IDataSeries; | ||
class QCPAxis; | ||||
class QCustomPlot; | ||||
Alexandre Leroux
|
r1050 | class SqpColorScale; | ||
Alexandre Leroux
|
r916 | |||
Alexandre Leroux
|
r917 | /// Formats a data value according to the axis on which it is present | ||
QString formatValue(double value, const QCPAxis &axis); | ||||
Alexandre Leroux
|
r916 | /** | ||
* 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 | ||||
Alexandre Leroux
|
r1050 | virtual void setProperties(QCustomPlot &plot, SqpColorScale &colorScale) = 0; | ||
Alexandre Leroux
|
r916 | }; | ||
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 | ||||