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