[apps] Graph: create an IntersectionGraphController

This commit is contained in:
Émilie Feral
2018-01-22 14:26:56 +01:00
committed by EmilieNumworks
parent 7d69e59562
commit 89c201a7f7
10 changed files with 92 additions and 13 deletions

View File

@@ -7,7 +7,7 @@ using namespace Shared;
namespace Graph {
CalculationParameterController::CalculationParameterController(Responder * parentResponder, GraphView * graphView, BannerView * bannerView, InteractiveCurveViewRange * range, CurveViewCursor * cursor) :
CalculationParameterController::CalculationParameterController(Responder * parentResponder, GraphView * graphView, BannerView * bannerView, InteractiveCurveViewRange * range, CurveViewCursor * cursor, CartesianFunctionStore * functionStore) :
ViewController(parentResponder),
m_selectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin,
Metric::CommonBottomMargin, Metric::CommonLeftMargin, this),
@@ -16,7 +16,8 @@ CalculationParameterController::CalculationParameterController(Responder * paren
m_integralGraphController(nullptr, graphView, range, cursor),
m_minimumGraphController(nullptr, graphView, bannerView, range, cursor),
m_maximumGraphController(nullptr, graphView, bannerView, range, cursor),
m_rootGraphController(nullptr, graphView, bannerView, range, cursor)
m_rootGraphController(nullptr, graphView, bannerView, range, cursor),
m_intersectionGraphController(nullptr, graphView, bannerView, range, cursor, functionStore)
{
}
@@ -37,6 +38,10 @@ bool CalculationParameterController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::OK || event == Ion::Events::EXE) {
ViewController * controller = nullptr;
switch(selectedRow()) {
case 0:
m_intersectionGraphController.setFunction(m_function);
controller = &m_intersectionGraphController;
break;
case 1:
m_maximumGraphController.setFunction(m_function);
controller = &m_maximumGraphController;
@@ -60,10 +65,6 @@ bool CalculationParameterController::handleEvent(Ion::Events::Event event) {
default:
return false;
}
// This is temporary (until the end of development of calculation menu)
if (controller == nullptr) {
return false;
}
StackViewController * stack = static_cast<StackViewController *>(parentResponder());
stack->pop();
stack->pop();