[apps/shared/cartesian_function] Function symbol depends on its plot type

This commit is contained in:
Ruben Dashyan
2019-07-24 18:02:07 +02:00
committed by Léa Saviot
parent a2dcad069f
commit ee1cdea837
3 changed files with 16 additions and 1 deletions

View File

@@ -78,11 +78,25 @@ int CartesianFunction::derivativeNameWithArgument(char * buffer, size_t bufferSi
return numberOfChars + derivativeSize;
}
CodePoint CartesianFunction::symbol() const {
switch (plotType()) {
case PlotType::Cartesian:
return 'x';
case PlotType::Polar:
return UCodePointGreekSmallLetterTheta;
default:
assert(plotType() == PlotType::Parametric);
return 't';
}
}
CartesianFunction::PlotType CartesianFunction::plotType() const {
return recordData()->plotType();
}
void CartesianFunction::setPlotType(PlotType plotType) {
/* Reset memoized layout. */
m_model.tidy();
return recordData()->setPlotType(plotType);
}