Files
Upsilon/apps/sequence/graph/graph_controller.h
Gabriel Ozouf 8970e294aa [apps] Remove modelVersion from curves apps
The graph range used to be reset to default whenever all functions were
modified. As we no longer want to reset the range without the user's
input, we do not need to track whether the functions changed at all.

/!\ As of this commit, there is no longer a way to restore the default
zoom, until a new automatic zoom button is added.

Change-Id: Ie74e8fd61e13055fa6ce2b2d1e883182d4ecffce
2020-11-04 15:58:09 +01:00

46 lines
2.1 KiB
C++

#ifndef SEQUENCE_GRAPH_CONTROLLER_H
#define SEQUENCE_GRAPH_CONTROLLER_H
#include "graph_view.h"
#include "../../shared/xy_banner_view.h"
#include "curve_parameter_controller.h"
#include "curve_view_range.h"
#include "term_sum_controller.h"
#include "../../shared/function_graph_controller.h"
#include "../../shared/cursor_view.h"
#include "../../shared/sequence_store.h"
namespace Sequence {
class GraphController final : public Shared::FunctionGraphController {
public:
GraphController(Responder * parentResponder, ::InputEventHandlerDelegate * inputEventHandlerDelegate, Shared::SequenceStore * sequenceStore, CurveViewRange * graphRange, Shared::CurveViewCursor * cursor, int * indexFunctionSelectedByCursor, uint32_t * rangeVersion, Poincare::Preferences::AngleUnit * angleUnitVersion, ButtonRowController * header);
I18n::Message emptyMessage() override;
void viewWillAppear() override;
TermSumController * termSumController() { return &m_termSumController; }
// InteractiveCurveViewRangeDelegate
float interestingXMin() const override;
void interestingRanges(Shared::InteractiveCurveViewRange * range) const override;
bool textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) override;
private:
Shared::XYBannerView * bannerView() override { return &m_bannerView; }
bool handleEnter() override;
bool moveCursorHorizontally(int direction, int scrollSpeed = 1) override;
double defaultCursorT(Ion::Storage::Record record) override;
CurveViewRange * interactiveCurveViewRange() override { return m_graphRange; }
Shared::SequenceStore * functionStore() const override { return static_cast<Shared::SequenceStore *>(Shared::FunctionGraphController::functionStore()); }
GraphView * functionGraphView() override { return &m_view; }
CurveParameterController * curveParameterController() override { return &m_curveParameterController; }
Shared::CursorView m_cursorView;
Shared::XYBannerView m_bannerView;
GraphView m_view;
CurveViewRange * m_graphRange;
CurveParameterController m_curveParameterController;
TermSumController m_termSumController;
};
}
#endif