Files
Upsilon/apps/graph/cartesian_function_store.h
Émilie Feral 6d47bc0073 [apps/shared] Add a method symbol in function store
Change-Id: I9f85f815d3ab28425d4df77b6ff4880efde17909
2017-03-02 18:15:48 +01:00

40 lines
1.3 KiB
C++

#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;
static constexpr int k_maxNumberOfFunctions = 8;
private:
const char * firstAvailableName() override;
const KDColor firstAvailableColor() override;
static constexpr int k_numberOfDefaultColors = 8;
static constexpr KDColor k_defaultColors[k_numberOfDefaultColors] = {
Palette::Red, Palette::Blue, Palette::YellowDark, Palette::Magenta,
Palette::Pink, Palette::Turquoise, Palette::Orange, Palette::Green
};
static constexpr const char * k_functionNames[k_maxNumberOfFunctions] = {
"f", "g", "h", "p", "q", "r", "s", "t"
};
CartesianFunction m_functions[k_maxNumberOfFunctions];
};
}
#endif