mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph][graph/sequence][graph/shared] Change constant names: add
"displayable" when adequate
This commit is contained in:
committed by
LeaNumworks
parent
a19edb4460
commit
b40c89cae8
@@ -37,7 +37,7 @@ ValuesController::ValuesController(Responder * parentResponder, InputEventHandle
|
||||
return true;
|
||||
}, this), k_font)
|
||||
{
|
||||
for (int i = 0; i < k_maxNumberOfFunctions; i++) {
|
||||
for (int i = 0; i < k_maxNumberOfDisplayableFunctions; i++) {
|
||||
m_functionTitleCells[i].setOrientation(FunctionTitleCell::Orientation::HorizontalIndicator);
|
||||
m_functionTitleCells[i].setFont(KDFont::SmallFont);
|
||||
}
|
||||
@@ -326,12 +326,12 @@ Shared::Hideable * ValuesController::hideableCellFromType(HighlightCell * cell,
|
||||
}
|
||||
|
||||
Shared::BufferFunctionTitleCell * ValuesController::functionTitleCells(int j) {
|
||||
assert(j >= 0 && j < k_maxNumberOfFunctions);
|
||||
assert(j >= 0 && j < k_maxNumberOfDisplayableFunctions);
|
||||
return &m_functionTitleCells[j];
|
||||
}
|
||||
|
||||
EvenOddBufferTextCell * ValuesController::floatCells(int j) {
|
||||
assert(j >= 0 && j < k_maxNumberOfCells);
|
||||
assert(j >= 0 && j < k_maxNumberOfDisplayableCells);
|
||||
return &m_floatCells[j];
|
||||
}
|
||||
|
||||
|
||||
@@ -46,14 +46,14 @@ public:
|
||||
private:
|
||||
static constexpr KDCoordinate k_abscissaCellWidth = k_cellWidth + Metric::TableSeparatorThickness;
|
||||
static constexpr KDCoordinate k_parametricCellWidth = (2*Poincare::PrintFloat::glyphLengthForFloatWithPrecision(Poincare::Preferences::LargeNumberOfSignificantDigits)+3) * 7 + 2*Metric::CellMargin; // The largest cell is holding "(-1.234567E-123;-1.234567E-123)" and KDFont::SmallFont->glyphSize().width() = 7
|
||||
static constexpr int k_maxNumberOfFunctions = 4;
|
||||
static constexpr int k_maxNumberOfAbscissaCells = Shared::ContinuousFunction::k_numberOfPlotTypes * k_maxNumberOfRows;
|
||||
static constexpr int k_maxNumberOfCells = k_maxNumberOfFunctions * k_maxNumberOfRows;
|
||||
static constexpr int k_maxNumberOfDisplayableFunctions = 4;
|
||||
static constexpr int k_maxNumberOfDisplayableAbscissaCells = Shared::ContinuousFunction::k_numberOfPlotTypes * k_maxNumberOfDisplayableRows;
|
||||
static constexpr int k_maxNumberOfDisplayableCells = k_maxNumberOfDisplayableFunctions * k_maxNumberOfDisplayableRows;
|
||||
|
||||
// Values controller
|
||||
void setStartEndMessages(Shared::IntervalParameterController * controller, int column) override;
|
||||
int maxNumberOfCells() override { return k_maxNumberOfCells; }
|
||||
int maxNumberOfFunctions() override { return k_maxNumberOfFunctions; }
|
||||
int maxNumberOfCells() override { return k_maxNumberOfDisplayableCells; }
|
||||
int maxNumberOfFunctions() override { return k_maxNumberOfDisplayableFunctions; }
|
||||
|
||||
// Number of columns memoization
|
||||
void updateNumberOfColumns() const override;
|
||||
@@ -74,11 +74,11 @@ private:
|
||||
// Function evaluation memoization
|
||||
static constexpr int k_valuesCellBufferSize = 2*Poincare::PrintFloat::charSizeForFloatsWithPrecision(Poincare::Preferences::LargeNumberOfSignificantDigits)+3; // The largest buffer holds (-1.234567E-123;-1.234567E-123)
|
||||
char * memoizedBufferAtIndex(int i) override {
|
||||
assert(i >= 0 && i < k_maxNumberOfCells);
|
||||
assert(i >= 0 && i < k_maxNumberOfDisplayableCells);
|
||||
return m_memoizedBuffer[i];
|
||||
}
|
||||
int valuesCellBufferSize() const override { return k_valuesCellBufferSize; }
|
||||
int numberOfMemoizedColumn() override { return k_maxNumberOfFunctions; }
|
||||
int numberOfMemoizedColumn() override { return k_maxNumberOfDisplayableFunctions; }
|
||||
/* The conversion of column coordinates from the absolute table to the table
|
||||
* on only values cell depends on the number of abscissa columns which depends
|
||||
* on the number of different plot types in the table. */
|
||||
@@ -96,8 +96,8 @@ private:
|
||||
Shared::Hideable * hideableCellFromType(HighlightCell * cell, int type);
|
||||
Shared::BufferFunctionTitleCell * functionTitleCells(int j) override;
|
||||
EvenOddBufferTextCell * floatCells(int j) override;
|
||||
int abscissaCellsCount() const override { return k_maxNumberOfAbscissaCells; }
|
||||
EvenOddEditableTextCell * abscissaCells(int j) override { assert (j >= 0 && j < k_maxNumberOfAbscissaCells); return &m_abscissaCells[j]; }
|
||||
int abscissaCellsCount() const override { return k_maxNumberOfDisplayableAbscissaCells; }
|
||||
EvenOddEditableTextCell * abscissaCells(int j) override { assert (j >= 0 && j < k_maxNumberOfDisplayableAbscissaCells); return &m_abscissaCells[j]; }
|
||||
int abscissaTitleCellsCount() const override { return Shared::ContinuousFunction::k_numberOfPlotTypes; }
|
||||
EvenOddMessageTextCell * abscissaTitleCells(int j) override { assert (j >= 0 && j < abscissaTitleCellsCount()); return &m_abscissaTitleCells[j]; }
|
||||
SelectableTableView * selectableTableView() override { return &m_selectableTableView; }
|
||||
@@ -116,17 +116,17 @@ private:
|
||||
|
||||
ValuesSelectableTableView m_selectableTableView;
|
||||
mutable int m_numberOfValuesColumnsForType[Shared::ContinuousFunction::k_numberOfPlotTypes];
|
||||
Shared::BufferFunctionTitleCell m_functionTitleCells[k_maxNumberOfFunctions];
|
||||
Shared::HideableEvenOddBufferTextCell m_floatCells[k_maxNumberOfCells];
|
||||
Shared::BufferFunctionTitleCell m_functionTitleCells[k_maxNumberOfDisplayableFunctions];
|
||||
Shared::HideableEvenOddBufferTextCell m_floatCells[k_maxNumberOfDisplayableCells];
|
||||
AbscissaTitleCell m_abscissaTitleCells[Shared::ContinuousFunction::k_numberOfPlotTypes];
|
||||
Shared::StoreCell m_abscissaCells[k_maxNumberOfAbscissaCells];
|
||||
Shared::StoreCell m_abscissaCells[k_maxNumberOfDisplayableAbscissaCells];
|
||||
FunctionParameterController m_functionParameterController;
|
||||
Shared::IntervalParameterController m_intervalParameterController;
|
||||
IntervalParameterSelectorController m_intervalParameterSelectorController;
|
||||
DerivativeParameterController m_derivativeParameterController;
|
||||
Button m_setIntervalButton;
|
||||
// TODO specialize buffer size as well
|
||||
mutable char m_memoizedBuffer[k_maxNumberOfCells][k_valuesCellBufferSize];
|
||||
mutable char m_memoizedBuffer[k_maxNumberOfDisplayableCells][k_valuesCellBufferSize];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ ValuesController::ValuesController(Responder * parentResponder, InputEventHandle
|
||||
return true;
|
||||
}, this), k_font)
|
||||
{
|
||||
for (int i = 0; i < k_maxNumberOfSequences; i++) {
|
||||
for (int i = 0; i < k_maxNumberOfDisplayableSequences; i++) {
|
||||
m_sequenceTitleCells[i].setOrientation(Shared::FunctionTitleCell::Orientation::HorizontalIndicator);
|
||||
}
|
||||
setupSelectableTableViewAndCells(inputEventHandlerDelegate);
|
||||
|
||||
@@ -29,14 +29,14 @@ public:
|
||||
return &m_intervalParameterController;
|
||||
}
|
||||
private:
|
||||
constexpr static int k_maxNumberOfSequences = 3;
|
||||
constexpr static int k_maxNumberOfCells = k_maxNumberOfSequences * k_maxNumberOfRows;
|
||||
constexpr static int k_maxNumberOfDisplayableSequences = 3;
|
||||
constexpr static int k_maxNumberOfDisplayableCells = k_maxNumberOfDisplayableSequences * k_maxNumberOfDisplayableRows;
|
||||
|
||||
// ValuesController
|
||||
void setStartEndMessages(Shared::IntervalParameterController * controller, int column) override;
|
||||
I18n::Message valuesParameterMessageAtColumn(int columnIndex) const override;
|
||||
int maxNumberOfCells() override { return k_maxNumberOfCells; }
|
||||
int maxNumberOfFunctions() override { return k_maxNumberOfSequences; }
|
||||
int maxNumberOfCells() override { return k_maxNumberOfDisplayableCells; }
|
||||
int maxNumberOfFunctions() override { return k_maxNumberOfDisplayableSequences; }
|
||||
|
||||
// EditableCellViewController
|
||||
bool setDataAtLocation(double floatBody, int columnIndex, int rowIndex) override;
|
||||
@@ -48,11 +48,11 @@ private:
|
||||
// Function evaluation memoization
|
||||
static constexpr int k_valuesCellBufferSize = Poincare::PrintFloat::charSizeForFloatsWithPrecision(Poincare::Preferences::LargeNumberOfSignificantDigits);
|
||||
char * memoizedBufferAtIndex(int i) override {
|
||||
assert(i >= 0 && i < k_maxNumberOfCells);
|
||||
assert(i >= 0 && i < k_maxNumberOfDisplayableCells);
|
||||
return m_memoizedBuffer[i];
|
||||
}
|
||||
int valuesCellBufferSize() const override{ return k_valuesCellBufferSize; }
|
||||
int numberOfMemoizedColumn() override { return k_maxNumberOfSequences; }
|
||||
int numberOfMemoizedColumn() override { return k_maxNumberOfDisplayableSequences; }
|
||||
void fillMemoizedBuffer(int i, int j, int index) override;
|
||||
|
||||
|
||||
@@ -61,9 +61,9 @@ private:
|
||||
|
||||
// Cells & view
|
||||
SelectableTableView * selectableTableView() override { return &m_selectableTableView; }
|
||||
int abscissaCellsCount() const override { return k_maxNumberOfRows; }
|
||||
int abscissaCellsCount() const override { return k_maxNumberOfDisplayableRows; }
|
||||
EvenOddEditableTextCell * abscissaCells(int j) override {
|
||||
assert (j >= 0 && j < k_maxNumberOfRows);
|
||||
assert (j >= 0 && j < k_maxNumberOfDisplayableRows);
|
||||
return &m_abscissaCells[j];
|
||||
}
|
||||
int abscissaTitleCellsCount() const override { return 1; }
|
||||
@@ -72,25 +72,25 @@ private:
|
||||
return &m_abscissaTitleCell;
|
||||
}
|
||||
SequenceTitleCell * functionTitleCells(int j) override {
|
||||
assert(j >= 0 && j < k_maxNumberOfSequences);
|
||||
assert(j >= 0 && j < k_maxNumberOfDisplayableSequences);
|
||||
return &m_sequenceTitleCells[j];
|
||||
}
|
||||
EvenOddBufferTextCell * floatCells(int j) override {
|
||||
assert(j >= 0 && j < k_maxNumberOfCells);
|
||||
assert(j >= 0 && j < k_maxNumberOfDisplayableCells);
|
||||
return &m_floatCells[j];
|
||||
}
|
||||
|
||||
SelectableTableView m_selectableTableView;
|
||||
SequenceTitleCell m_sequenceTitleCells[k_maxNumberOfSequences];
|
||||
EvenOddBufferTextCell m_floatCells[k_maxNumberOfCells];
|
||||
SequenceTitleCell m_sequenceTitleCells[k_maxNumberOfDisplayableSequences];
|
||||
EvenOddBufferTextCell m_floatCells[k_maxNumberOfDisplayableCells];
|
||||
EvenOddMessageTextCell m_abscissaTitleCell;
|
||||
EvenOddEditableTextCell m_abscissaCells[k_maxNumberOfRows];
|
||||
EvenOddEditableTextCell m_abscissaCells[k_maxNumberOfDisplayableRows];
|
||||
#if COPY_COLUMN
|
||||
Shared::ValuesFunctionParameterController m_sequenceParameterController;
|
||||
#endif
|
||||
IntervalParameterController m_intervalParameterController;
|
||||
Button m_setIntervalButton;
|
||||
mutable char m_memoizedBuffer[k_maxNumberOfCells][k_valuesCellBufferSize];
|
||||
mutable char m_memoizedBuffer[k_maxNumberOfDisplayableCells][k_valuesCellBufferSize];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ void ValuesController::didChangeRow(int row) {
|
||||
/* Update the row memoization if it exists */
|
||||
// Conversion of coordinates from absolute table to values table
|
||||
int valuesRow = valuesRowForAbsoluteRow(row);
|
||||
if (m_firstMemoizedRow > valuesRow || valuesRow >= m_firstMemoizedRow + k_maxNumberOfRows) {
|
||||
if (m_firstMemoizedRow > valuesRow || valuesRow >= m_firstMemoizedRow + k_maxNumberOfDisplayableRows) {
|
||||
// The changed row is out of the memoized table
|
||||
return;
|
||||
}
|
||||
@@ -300,8 +300,8 @@ char * ValuesController::memoizedBufferForCell(int i, int j) {
|
||||
}
|
||||
if (valuesJ < m_firstMemoizedRow) {
|
||||
offsetJ = valuesJ - m_firstMemoizedRow;
|
||||
} else if (valuesJ >= m_firstMemoizedRow + k_maxNumberOfRows) {
|
||||
offsetJ = valuesJ - k_maxNumberOfRows - m_firstMemoizedRow + 1;
|
||||
} else if (valuesJ >= m_firstMemoizedRow + k_maxNumberOfDisplayableRows) {
|
||||
offsetJ = valuesJ - k_maxNumberOfDisplayableRows - m_firstMemoizedRow + 1;
|
||||
}
|
||||
|
||||
// Apply the offset
|
||||
@@ -312,16 +312,16 @@ char * ValuesController::memoizedBufferForCell(int i, int j) {
|
||||
int maxI = numberOfValuesColumns() - m_firstMemoizedColumn;
|
||||
for (int ii = offsetI > 0 ? 0 : minInt(nbOfMemoizedColumns, maxI)-1; offsetI > 0 ? ii < minInt(-offsetI + nbOfMemoizedColumns, maxI) : ii >= -offsetI; ii += offsetI > 0 ? 1 : -1) {
|
||||
int maxJ = numberOfElementsInColumn(absoluteColumnForValuesColumn(ii+m_firstMemoizedColumn)) - m_firstMemoizedRow;
|
||||
for (int jj = offsetJ > 0 ? 0 : minInt(k_maxNumberOfRows, maxJ)-1; offsetJ > 0 ? jj < minInt(-offsetJ+k_maxNumberOfRows, maxJ) : jj >= -offsetJ; jj += offsetJ > 0 ? 1 : -1) {
|
||||
for (int jj = offsetJ > 0 ? 0 : minInt(k_maxNumberOfDisplayableRows, maxJ)-1; offsetJ > 0 ? jj < minInt(-offsetJ+k_maxNumberOfDisplayableRows, maxJ) : jj >= -offsetJ; jj += offsetJ > 0 ? 1 : -1) {
|
||||
moveMemoizedBuffer(ii, jj, ii+offsetI, jj+offsetJ);
|
||||
}
|
||||
}
|
||||
// Compute the buffer of the new cells of the memoized table
|
||||
for (int ii = 0; ii < minInt(nbOfMemoizedColumns, maxI); ii++) {
|
||||
int maxJ = numberOfElementsInColumn(absoluteColumnForValuesColumn(ii+m_firstMemoizedColumn)) - m_firstMemoizedRow;
|
||||
for (int jj = 0; jj < minInt(k_maxNumberOfRows, maxJ); jj++) {
|
||||
for (int jj = 0; jj < minInt(k_maxNumberOfDisplayableRows, maxJ); jj++) {
|
||||
// Escape if already filled
|
||||
if (ii >= -offsetI && ii < -offsetI + nbOfMemoizedColumns && jj >= -offsetJ && jj < -offsetJ + k_maxNumberOfRows) {
|
||||
if (ii >= -offsetI && ii < -offsetI + nbOfMemoizedColumns && jj >= -offsetJ && jj < -offsetJ + k_maxNumberOfDisplayableRows) {
|
||||
continue;
|
||||
}
|
||||
fillMemoizedBuffer(absoluteColumnForValuesColumn(m_firstMemoizedColumn + ii),
|
||||
|
||||
@@ -49,7 +49,7 @@ protected:
|
||||
static constexpr int k_functionTitleCellType = 1;
|
||||
static constexpr int k_editableValueCellType = 2;
|
||||
static constexpr int k_notEditableValueCellType = 3;
|
||||
static constexpr int k_maxNumberOfRows = 10;
|
||||
static constexpr int k_maxNumberOfDisplayableRows = 10;
|
||||
static constexpr const KDFont * k_font = KDFont::SmallFont;
|
||||
|
||||
// EditableCellTableViewController
|
||||
|
||||
Reference in New Issue
Block a user