Files
Upsilon/apps/graph/graph/graph_view.cpp
Émilie Feral 0bd796310c [apps/shared] Move partial classes from grpah/graph to shared to be used
by sequence

Change-Id: I0e18be96cfaa92b6a51836ae8aa072fa6cf0f1af
2017-03-03 09:38:46 +01:00

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());
}
}