mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 14:50:44 +01:00
[apps/graph] Add a boolean in function to indicate wheter to display
derivative Change-Id: I0565de1645952007347cf3aee5f1a70f8280e0f3
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user