Blame view

build3/apps/shared/function_graph_view.h 1.26 KB
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  #ifndef SHARED_FUNCTION_GRAPH_VIEW_H
  #define SHARED_FUNCTION_GRAPH_VIEW_H
  
  #include <escher.h>
  #include "curve_view.h"
  #include "function.h"
  #include "../constant.h"
  #include "interactive_curve_view_range.h"
  
  namespace Shared {
  
  class FunctionGraphView : public CurveView {
  public:
    FunctionGraphView(InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor,
      BannerView * bannerView, View * cursorView);
    void drawRect(KDContext * ctx, KDRect rect) const override;
    void setContext(Poincare::Context * context);
    Poincare::Context * context() const;
    void selectFunction(Function * function);
    void setAreaHighlight(float start, float end);
    virtual void setAreaHighlightColor(bool highlightColor);
  protected:
    void reloadBetweenBounds(float start, float end);
    Function * m_selectedFunction;
    float m_highlightedStart;
    float m_highlightedEnd;
    bool m_shouldColorHighlighted;
  private:
    char * label(Axis axis, int index) const override;
    char m_xLabels[k_maxNumberOfXLabels][Poincare::PrintFloat::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
    char m_yLabels[k_maxNumberOfYLabels][Poincare::PrintFloat::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
    Poincare::Context * m_context;
  };
  
  }
  
  #endif