[apps/shared] Move partial classes from grpah/graph to shared to be used

by sequence

Change-Id: I0e18be96cfaa92b6a51836ae8aa072fa6cf0f1af
This commit is contained in:
Émilie Feral
2017-02-22 18:05:56 +01:00
parent a0b4cc3485
commit 0bd796310c
21 changed files with 464 additions and 337 deletions

View File

@@ -0,0 +1,37 @@
#include "function_graph_view.h"
#include <assert.h>
#include <math.h>
#include <float.h>
using namespace Poincare;
namespace Shared {
FunctionGraphView::FunctionGraphView(InteractiveCurveViewRange * graphRange,
CurveViewCursor * cursor, BannerView * bannerView, View * cursorView) :
CurveView(graphRange, cursor, bannerView, cursorView),
m_context(nullptr)
{
}
void FunctionGraphView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(rect, KDColorWhite);
drawGrid(ctx, rect);
drawAxes(ctx, rect, Axis::Horizontal);
drawAxes(ctx, rect, Axis::Vertical);
drawLabels(ctx, rect, Axis::Horizontal, true);
drawLabels(ctx, rect, Axis::Vertical, true);
}
void FunctionGraphView::setContext(Context * context) {
m_context = context;
}
Context * FunctionGraphView::context() const {
return m_context;
}
char * FunctionGraphView::label(Axis axis, int index) const {
return (axis == Axis::Horizontal ? (char *)m_xLabels[index] : (char *)m_yLabels[index]);
}
}