Numworks Epsilon  1.4.1
Graphing Calculator Operating System
function_graph_controller.h
Go to the documentation of this file.
1 #ifndef SHARED_FUNCTION_GRAPH_CONTROLLER_H
2 #define SHARED_FUNCTION_GRAPH_CONTROLLER_H
3 
4 #include <escher.h>
8 #include "function_store.h"
9 #include "function_graph_view.h"
11 
12 namespace Shared {
13 
15 public:
17  bool isEmpty() const override;
19  void viewWillAppear() override;
20 protected:
21  constexpr static float k_cursorTopMarginRatio = 0.068f; // (cursorHeight/2)/graphViewHeight
22  constexpr static float k_cursorBottomMarginRatio = 0.15f; // (cursorHeight/2+bannerHeigh)/graphViewHeight
23  void reloadBannerView() override;
24  bool handleEnter() override;
26  return *m_indexFunctionSelectedByCursor;
27  }
28  virtual void selectFunctionWithCursor(int functionIndex);
29 private:
30  /* When y auto is ticked, we use a display margin to be ensure that the user
31  * can move the cursor along the curve without panning the window */
32  constexpr static float k_displayTopMarginRatio = 0.09f;
33  constexpr static float k_displayBottomMarginRatio = 0.2f;
34 
36  float addMargin(float x, float range, bool isMin) override;
37 
38  void initRangeParameters() override;
39  bool moveCursorVertically(int direction) override;
40  CurveView * curveView() override;
41  uint32_t modelVersion() override;
42  uint32_t rangeVersion() override;
43  bool isCursorVisible() override;
44  virtual FunctionGraphView * functionGraphView() = 0;
45  virtual View * cursorView() = 0;
46  virtual FunctionStore * functionStore() const = 0;
47  virtual FunctionCurveParameterController * curveParameterController() = 0;
48  InitialisationParameterController m_initialisationParameterController;
49  Poincare::Expression::AngleUnit * m_angleUnitVersion;
50  int * m_indexFunctionSelectedByCursor;
51 };
52 
53 }
54 
55 #endif
ViewController * initialisationParameterController() override
Responder * parentResponder() const
Definition: responder.cpp:12
FunctionGraphController(Responder *parentResponder, ButtonRowController *header, InteractiveCurveViewRange *interactiveRange, CurveView *curveView, CurveViewCursor *cursor, int *indexFunctionSelectedByCursor, uint32_t *modelVersion, uint32_t *rangeVersion, Poincare::Expression::AngleUnit *angleUnitVersion)
static constexpr float k_cursorBottomMarginRatio
ButtonRowController * header()
unsigned int uint32_t
Definition: stdint.h:6
Definition: view.h:23
virtual InteractiveCurveViewRange * interactiveCurveViewRange()=0
virtual void selectFunctionWithCursor(int functionIndex)
static constexpr float k_cursorTopMarginRatio