diff --git a/apps/shared/cartesian_function.cpp b/apps/shared/cartesian_function.cpp index 823b5e8cc..5909796d1 100644 --- a/apps/shared/cartesian_function.cpp +++ b/apps/shared/cartesian_function.cpp @@ -78,6 +78,14 @@ int CartesianFunction::derivativeNameWithArgument(char * buffer, size_t bufferSi return numberOfChars + derivativeSize; } +CartesianFunction::PlotType CartesianFunction::plotType() const { + return recordData()->plotType(); +} + +void CartesianFunction::setPlotType(PlotType plotType) { + return recordData()->setPlotType(plotType); +} + bool CartesianFunction::displayDerivative() const { return recordData()->displayDerivative(); } diff --git a/apps/shared/cartesian_function.h b/apps/shared/cartesian_function.h index 2ccea10d5..671921a24 100644 --- a/apps/shared/cartesian_function.h +++ b/apps/shared/cartesian_function.h @@ -16,6 +16,14 @@ public: {} CodePoint symbol() const override { return 'x'; } + enum class PlotType { + Cartesian = 0, + Polar = 1, + Parametric = 2 + }; + PlotType plotType() const; + void setPlotType(PlotType plotType); + // Evaluation float evaluateAtAbscissa(float x, Poincare::Context * context) const override { return templatedApproximateAtAbscissa(x, context); @@ -37,11 +45,15 @@ private: public: CartesianFunctionRecordDataBuffer(KDColor color) : FunctionRecordDataBuffer(color), + m_plotType(PlotType::Cartesian), m_displayDerivative(false) {} + PlotType plotType() const { return m_plotType; } + void setPlotType(PlotType plotType) { m_plotType = plotType; } bool displayDerivative() const { return m_displayDerivative; } void setDisplayDerivative(bool display) { m_displayDerivative = display; } private: + PlotType m_plotType; bool m_displayDerivative; /* In the record, after the boolean flag about displayDerivative, there is * the expression of the function, directly copied from the pool. */