[apps/graph] Add a boolean in function to indicate wheter to display

derivative

Change-Id: I0565de1645952007347cf3aee5f1a70f8280e0f3
This commit is contained in:
Émilie Feral
2016-10-19 16:01:14 +02:00
parent 816a9587d6
commit 529a06131d
2 changed files with 13 additions and 1 deletions

View File

@@ -8,7 +8,8 @@ Function::Function(const char * text, KDColor color) :
m_color(color),
m_expression(nullptr),
m_layout(nullptr),
m_active(true)
m_active(true),
m_displayDerivative(false)
{
}
@@ -57,10 +58,18 @@ bool Function::isActive() {
return m_active;
}
bool Function::displayDerivative() {
return m_displayDerivative;
}
void Function::setActive(bool active) {
m_active = active;
}
void Function::setDisplayDerivative(bool display) {
m_displayDerivative = display;
}
float Function::evaluateAtAbscissa(float x, EvaluateContext * context) const {
context->setOverridenValueForSymbolX(x);
return m_expression->approximate(*context);