Files
Upsilon/apps/graph/function.h
Émilie Feral 604e2211ab [apps/graph/function] Add a method to evaluate the function
Change-Id: I54516369bbbde8d65d98ad41d6e94cd3780e6162
2016-10-12 17:39:53 +02:00

38 lines
842 B
C++

#ifndef GRAPH_FUNCTION_H
#define GRAPH_FUNCTION_H
#include <poincare.h>
#include <kandinsky.h>
namespace Graph {
class Function {
public:
static constexpr const char * Parameter = "(x)";
Function(const char * text = nullptr, KDColor color = KDColorBlack);
~Function(); // Delete expression and layout, if needed
const char * text();
const char * name();
KDColor color() const { return m_color; }
Expression * expression();
ExpressionLayout * layout();
bool isActive();
void setActive(bool active);
void setContent(const char * c);
void setColor(KDColor m_color);
float evaluateAtAbscissa(float x);
private:
constexpr static int k_bodyLength = 255;
char m_text[k_bodyLength];
const char * m_name;
KDColor m_color;
Expression * m_expression;
ExpressionLayout * m_layout;
bool m_active;
};
}
#endif