Numworks Epsilon  1.4.1
Graphing Calculator Operating System
graph_controller.h
Go to the documentation of this file.
1 #ifndef REGRESSION_GRAPH_CONTROLLER_H
2 #define REGRESSION_GRAPH_CONTROLLER_H
3 
4 #include <escher.h>
5 #include "banner_view.h"
6 #include "store.h"
7 #include "graph_view.h"
10 #include "../shared/interactive_curve_view_controller.h"
11 #include "../shared/curve_view_cursor.h"
12 #include "../shared/cursor_view.h"
13 #include "../shared/round_cursor_view.h"
14 
15 namespace Regression {
16 
18 
19 public:
20  GraphController(Responder * parentResponder, ButtonRowController * header, Store * store, Shared::CurveViewCursor * cursor, uint32_t * modelVersion, uint32_t * rangeVersion, int * selectedDotIndex);
22  bool isEmpty() const override;
23  I18n::Message emptyMessage() override;
24  void viewWillAppear() override;
25  void selectRegressionCurve();
26 private:
27  constexpr static float k_cursorTopMarginRatio = 0.07f; // (cursorHeight/2)/graphViewHeight
28  constexpr static float k_cursorBottomMarginRatio = 0.3f; // (cursorHeight/2+bannerHeigh)/graphViewHeight
29  constexpr static int k_maxLegendLength = 16;
30  constexpr static int k_maxNumberOfCharacters = 50;
31  Shared::CurveView * curveView() override;
32  Shared::InteractiveCurveViewRange * interactiveCurveViewRange() override;
33  bool handleEnter() override;
34  void reloadBannerView() override;
35  void initRangeParameters() override;
36  void initCursorParameters() override;
37  bool moveCursorHorizontally(int direction) override;
38  bool moveCursorVertically(int direction) override;
39  uint32_t modelVersion() override;
40  uint32_t rangeVersion() override;
41  bool isCursorVisible() override;
42  Shared::CursorView m_crossCursorView;
43  Shared::RoundCursorView m_roundCursorView;
44  BannerView m_bannerView;
45  GraphView m_view;
46  Store * m_store;
47  InitialisationParameterController m_initialisationParameterController;
48  PredictionParameterController m_predictionParameterController;
49  /* The selectedDotIndex is -1 when no dot is selected, m_numberOfPairs when
50  * the mean dot is selected and the dot index otherwise */
51  int * m_selectedDotIndex;
52 };
53 
54 }
55 
56 
57 #endif
GraphController(Responder *parentResponder, ButtonRowController *header, Store *store, Shared::CurveViewCursor *cursor, uint32_t *modelVersion, uint32_t *rangeVersion, int *selectedDotIndex)
Responder * parentResponder() const
Definition: responder.cpp:12
bool isEmpty() const override
ButtonRowController * header()
unsigned int uint32_t
Definition: stdint.h:6
I18n::Message emptyMessage() override
ViewController * initialisationParameterController() override