Blame view

build3/apps/graph/cartesian_function_store.h 1.18 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
38
  #ifndef GRAPH_CARTESIAN_FUNCTION_STORE_H
  #define GRAPH_CARTESIAN_FUNCTION_STORE_H
  
  #include "cartesian_function.h"
  #include "../shared/function_store.h"
  #include <stdint.h>
  #include <escher.h>
  
  namespace Graph {
  
  class CartesianFunctionStore : public Shared::FunctionStore {
  public:
    CartesianFunctionStore();
    uint32_t storeChecksum() override;
    CartesianFunction * functionAtIndex(int i) override;
    CartesianFunction * activeFunctionAtIndex(int i) override;
    CartesianFunction * definedFunctionAtIndex(int i) override;
    CartesianFunction * addEmptyFunction() override;
    void removeFunction(Shared::Function * f) override;
    int maxNumberOfFunctions() override;
    char symbol() const override;
    void removeAll() override;
    static constexpr int k_maxNumberOfFunctions = 4;
  private:
    const char * firstAvailableName() override;
    const KDColor firstAvailableColor() override;
    static constexpr KDColor k_defaultColors[k_maxNumberOfFunctions] = {
      Palette::Red, Palette::Blue,  Palette::Green, Palette::YellowDark,
    };
    static constexpr const char * k_functionNames[k_maxNumberOfFunctions] = {
      "f", "g", "h", "p",
    };
    CartesianFunction m_functions[k_maxNumberOfFunctions];
  };
  
  }
  
  #endif