mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps/shared/cartesian_function] Function symbol depends on its plot type
This commit is contained in:
committed by
Léa Saviot
parent
a2dcad069f
commit
ee1cdea837
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
CartesianFunction(Ion::Storage::Record record = Record()) :
|
||||
Function(record)
|
||||
{}
|
||||
CodePoint symbol() const override { return 'x'; }
|
||||
CodePoint symbol() const override;
|
||||
|
||||
enum class PlotType {
|
||||
Cartesian = 0,
|
||||
|
||||
@@ -32,6 +32,7 @@ static constexpr CodePoint UCodePointRightSystemParenthesis = 0x13; // Used fo
|
||||
|
||||
static constexpr CodePoint UCodePointMiddleDot = 0xb7; // ·
|
||||
static constexpr CodePoint UCodePointMultiplicationSign = 0xd7; // ×
|
||||
static constexpr CodePoint UCodePointGreekSmallLetterTheta = 0x3b8; // θ
|
||||
static constexpr CodePoint UCodePointGreekSmallLetterPi = 0x3c0; // π
|
||||
static constexpr CodePoint UCodePointLatinLetterSmallCapitalE = 0x1d07; // ᴇ
|
||||
static constexpr CodePoint UCodePointScriptSmallE = 0x212f; // ℯ
|
||||
|
||||
Reference in New Issue
Block a user