mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 22:30:30 +01:00
28 lines
839 B
C++
28 lines
839 B
C++
#include "graph_view.h"
|
|
|
|
using namespace Shared;
|
|
|
|
namespace Graph {
|
|
|
|
GraphView::GraphView(CartesianFunctionStore * functionStore, InteractiveCurveViewRange * graphRange,
|
|
CurveViewCursor * cursor, BannerView * bannerView, View * cursorView) :
|
|
FunctionGraphView(graphRange, cursor, bannerView, cursorView),
|
|
m_functionStore(functionStore)
|
|
{
|
|
}
|
|
|
|
void GraphView::drawRect(KDContext * ctx, KDRect rect) const {
|
|
FunctionGraphView::drawRect(ctx, rect);
|
|
for (int i = 0; i < m_functionStore->numberOfActiveFunctions(); i++) {
|
|
CartesianFunction * f = m_functionStore->activeFunctionAtIndex(i);
|
|
drawCurve(ctx, rect, f, f->color());
|
|
}
|
|
}
|
|
|
|
float GraphView::evaluateModelWithParameter(Model * curve, float abscissa) const {
|
|
CartesianFunction * f = (CartesianFunction *)curve;
|
|
return f->evaluateAtAbscissa(abscissa, context());
|
|
}
|
|
|
|
}
|