10 FunctionGraphController(parentResponder, header, graphRange, &m_view, cursor, indexFunctionSelectedByCursor, modelVersion, rangeVersion, angleUnitVersion),
12 m_view(sequenceStore, graphRange, m_cursor, &m_bannerView, &m_cursorView),
13 m_graphRange(graphRange),
14 m_curveParameterController(this, graphRange, m_cursor),
15 m_termSumController(this, &m_view, graphRange, m_cursor),
16 m_sequenceStore(sequenceStore)
23 return I18n::Message::NoSequence;
25 return I18n::Message::NoActivatedSequence;
29 return &m_termSumController;
36 bool GraphController::handleEnter() {
38 return FunctionGraphController::handleEnter();
41 bool GraphController::moveCursorHorizontally(
int direction) {
43 if (direction < 0 && xCursorPosition <= 0) {
49 double step =
std::ceil((interactiveCurveViewRange()->xMax()-interactiveCurveViewRange()->xMin())/m_view.
resolution());
50 step = step < 1.0 ? 1.0 : step;
51 double x = direction > 0 ? xCursorPosition + step:
52 xCursorPosition - step;
58 double y = s->evaluateAtAbscissa(x, myApp->
localContext());
64 void GraphController::initCursorParameters() {
65 double x =
std::round((interactiveCurveViewRange()->xMin()+interactiveCurveViewRange()->xMax())/2.0);
68 int functionIndex = 0;
72 y = firstFunction->evaluateAtAbscissa(x, myApp->
localContext());
82 SequenceStore * GraphController::functionStore()
const {
83 return m_sequenceStore;
86 GraphView * GraphController::functionGraphView() {
90 CurveParameterController * GraphController::curveParameterController() {
91 return &m_curveParameterController;
I18n::Message emptyMessage() override
Sequence * activeFunctionAtIndex(int i) override
static constexpr float k_cursorBottomMarginRatio
virtual Poincare::Context * localContext()
static constexpr float k_cursorRightMarginRatio
void moveTo(double x, double y)
TermSumController * termSumController()
void panToMakePointVisible(float x, float y, float topMarginRatio, float rightMarginRatio, float bottomMarginRation, float leftMarginRation)
int numberOfActiveFunctions()
int indexFunctionSelectedByCursor() const
int numberOfDefinedFunctions()
void setFunction(Function *function)
static constexpr float k_cursorLeftMarginRatio
void setDelegate(InteractiveCurveViewRangeDelegate *delegate)
virtual void selectFunctionWithCursor(int functionIndex)
CurveViewCursor * m_cursor
static constexpr float k_cursorTopMarginRatio