[apps/graph] GraphView gets the function store through App

instead of passing a pointer at contruction.
This commit is contained in:
Ruben Dashyan
2019-09-09 13:52:33 +02:00
committed by LeaNumworks
parent 9efe1515e8
commit 1908c9c674
5 changed files with 12 additions and 13 deletions

View File

@@ -1,14 +1,14 @@
#include "graph_view.h"
#include "../app.h"
#include <assert.h>
using namespace Shared;
namespace Graph {
GraphView::GraphView(CartesianFunctionStore * functionStore, InteractiveCurveViewRange * graphRange,
CurveViewCursor * cursor, BannerView * bannerView, CursorView * cursorView) :
GraphView::GraphView(InteractiveCurveViewRange * graphRange,
CurveViewCursor * cursor, Shared::BannerView * bannerView, CursorView * cursorView) :
FunctionGraphView(graphRange, cursor, bannerView, cursorView),
m_functionStore(functionStore),
m_tangent(false)
{
}
@@ -23,9 +23,10 @@ void GraphView::reload() {
void GraphView::drawRect(KDContext * ctx, KDRect rect) const {
FunctionGraphView::drawRect(ctx, rect);
for (int i = 0; i < m_functionStore->numberOfActiveFunctions(); i++) {
Ion::Storage::Record record = m_functionStore->activeRecordAtIndex(i);
ExpiringPointer<CartesianFunction> f = m_functionStore->modelForRecord(record);;
CartesianFunctionStore * functionStore = App::app()->functionStore();
for (int i = 0; i < functionStore->numberOfActiveFunctions(); i++) {
Ion::Storage::Record record = functionStore->activeRecordAtIndex(i);
ExpiringPointer<CartesianFunction> f = functionStore->modelForRecord(record);;
Shared::CartesianFunction::PlotType type = f->plotType();
float tmin = f->tMin();
float tmax = f->tMax();