mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
There was a lot of code duplication.
I removed the initialization of xLabel{} and yLabels{} because those are
scratch buffers that shouldn't be accessed before being written to
anyway.
38 lines
949 B
C++
38 lines
949 B
C++
#ifndef SHARED_LABELED_CURVE_VIEW_H
|
|
#define SHARED_LABELED_CURVE_VIEW_H
|
|
|
|
#include "curve_view.h"
|
|
|
|
/* This CurveView subclass provides label storage for common use cases */
|
|
|
|
namespace Shared {
|
|
|
|
class HorizontallyLabeledCurveView : public CurveView {
|
|
public:
|
|
using CurveView::CurveView;
|
|
private:
|
|
char * label(Axis axis, int index) const override;
|
|
mutable char m_xLabels[k_maxNumberOfXLabels][k_labelBufferMaxSize];
|
|
};
|
|
|
|
class VerticallyLabeledCurveView : public CurveView {
|
|
public:
|
|
using CurveView::CurveView;
|
|
private:
|
|
char * label(Axis axis, int index) const override;
|
|
mutable char m_yLabels[k_maxNumberOfYLabels][k_labelBufferMaxSize];
|
|
};
|
|
|
|
class LabeledCurveView : public CurveView {
|
|
public:
|
|
using CurveView::CurveView;
|
|
private:
|
|
char * label(Axis axis, int index) const override;
|
|
mutable char m_xLabels[k_maxNumberOfXLabels][k_labelBufferMaxSize];
|
|
mutable char m_yLabels[k_maxNumberOfYLabels][k_labelBufferMaxSize];
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|