mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 13:50:28 +01:00
26 lines
674 B
C++
26 lines
674 B
C++
#include "complex_graph_view.h"
|
|
|
|
using namespace Shared;
|
|
|
|
namespace Calculation {
|
|
|
|
ComplexGraphView::ComplexGraphView(ComplexModel * complexModel) :
|
|
CurveView(complexModel),
|
|
m_complex(complexModel)
|
|
{
|
|
}
|
|
|
|
void ComplexGraphView::drawRect(KDContext * ctx, KDRect rect) const {
|
|
ctx->fillRect(rect, KDColorWhite);
|
|
drawAxes(ctx, rect);
|
|
drawDot(ctx, rect, m_complex->x(), m_complex->y(), KDColorBlack);
|
|
drawLabel(ctx, rect, Axis::Horizontal, m_complex->x());
|
|
drawLabel(ctx, rect, Axis::Vertical, m_complex->y());
|
|
drawAxisLabel(ctx, rect, Axis::Horizontal, "Re", m_complex->x() > 0.0f);
|
|
drawAxisLabel(ctx, rect, Axis::Vertical, "Im", m_complex->y() > 0.0f);
|
|
|
|
|
|
}
|
|
|
|
}
|