mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 08:47:28 +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.
33 lines
984 B
C++
33 lines
984 B
C++
#ifndef CALCULATION_ADDITIONAL_OUTPUTS_COMPLEX_GRAPH_CELL_H
|
|
#define CALCULATION_ADDITIONAL_OUTPUTS_COMPLEX_GRAPH_CELL_H
|
|
|
|
#include "../../shared/labeled_curve_view.h"
|
|
#include "complex_model.h"
|
|
#include "illustration_cell.h"
|
|
|
|
namespace Calculation {
|
|
|
|
class ComplexGraphView : public Shared::LabeledCurveView {
|
|
public:
|
|
ComplexGraphView(ComplexModel * complexModel);
|
|
void drawRect(KDContext * ctx, KDRect rect) const override;
|
|
private:
|
|
// '-' + significant digits + ".E-" + 2 digits (the represented dot is a float, so it is bounded by 1E38 and 1E-38
|
|
size_t labelMaxGlyphLengthSize() const override { return 1 + Poincare::Preferences::VeryShortNumberOfSignificantDigits + 3 + 2; }
|
|
ComplexModel * m_complex;
|
|
};
|
|
|
|
class ComplexGraphCell : public IllustrationCell {
|
|
public:
|
|
ComplexGraphCell(ComplexModel * complexModel) : m_view(complexModel) {}
|
|
void reload() { m_view.reload(); }
|
|
private:
|
|
View * view() override { return &m_view; }
|
|
ComplexGraphView m_view;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|
|
|