diff --git a/apps/graph/app.h b/apps/graph/app.h index eda5de0de..75fa24765 100644 --- a/apps/graph/app.h +++ b/apps/graph/app.h @@ -25,14 +25,14 @@ public: App * unpack(Container * container) override; void reset() override; Descriptor * descriptor() override; - CartesianFunctionStore * functionStore() override { return &m_functionStore; } + ContinuousFunctionStore * functionStore() override { return &m_functionStore; } Shared::InteractiveCurveViewRange * graphRange() { return &m_graphRange; } Shared::Interval * intervalForType(Shared::CartesianFunction::PlotType plotType) { return m_interval + static_cast(plotType); } private: void tidy() override; - CartesianFunctionStore m_functionStore; + ContinuousFunctionStore m_functionStore; Shared::InteractiveCurveViewRange m_graphRange; Shared::Interval m_interval[Shared::CartesianFunction::k_numberOfPlotTypes]; }; @@ -45,7 +45,7 @@ public: bool XNTCanBeOverriden() const override { return false; } CodePoint XNT() override; NestedMenuController * variableBoxForInputEventHandler(InputEventHandler * textInput) override; - CartesianFunctionStore * functionStore() override { return snapshot()->functionStore(); } + ContinuousFunctionStore * functionStore() override { return snapshot()->functionStore(); } Shared::Interval * intervalForType(Shared::CartesianFunction::PlotType plotType) { return snapshot()->intervalForType(plotType); } diff --git a/apps/graph/cartesian_function_store.cpp b/apps/graph/cartesian_function_store.cpp index 06d20aab6..175e7896e 100644 --- a/apps/graph/cartesian_function_store.cpp +++ b/apps/graph/cartesian_function_store.cpp @@ -9,7 +9,7 @@ using namespace Shared; namespace Graph { -int CartesianFunctionStore::numberOfActiveFunctionsOfType(CartesianFunction::PlotType plotType) const { +int ContinuousFunctionStore::numberOfActiveFunctionsOfType(CartesianFunction::PlotType plotType) const { int count = 0; for (int i = 0; i < numberOfActiveFunctions(); i++) { Ion::Storage::Record record = activeRecordAtIndex(i); @@ -19,7 +19,7 @@ int CartesianFunctionStore::numberOfActiveFunctionsOfType(CartesianFunction::Plo return count; } -Ion::Storage::Record CartesianFunctionStore::activeRecordOfTypeAtIndex(CartesianFunction::PlotType plotType, int index) const { +Ion::Storage::Record ContinuousFunctionStore::activeRecordOfTypeAtIndex(CartesianFunction::PlotType plotType, int index) const { int count = 0; Ion::Storage::Record record; for (int i = 0; i < numberOfActiveFunctions(); i++) { @@ -35,19 +35,19 @@ Ion::Storage::Record CartesianFunctionStore::activeRecordOfTypeAtIndex(Cartesian return record; } -Ion::Storage::Record::ErrorStatus CartesianFunctionStore::addEmptyModel() { +Ion::Storage::Record::ErrorStatus ContinuousFunctionStore::addEmptyModel() { Ion::Storage::Record::ErrorStatus error; CartesianFunction newModel = CartesianFunction::NewModel(&error); return error; } -ExpressionModelHandle * CartesianFunctionStore::setMemoizedModelAtIndex(int cacheIndex, Ion::Storage::Record record) const { +ExpressionModelHandle * ContinuousFunctionStore::setMemoizedModelAtIndex(int cacheIndex, Ion::Storage::Record record) const { assert(cacheIndex >= 0 && cacheIndex < maxNumberOfMemoizedModels()); m_functions[cacheIndex] = CartesianFunction(record); return &m_functions[cacheIndex]; } -ExpressionModelHandle * CartesianFunctionStore::memoizedModelAtIndex(int cacheIndex) const { +ExpressionModelHandle * ContinuousFunctionStore::memoizedModelAtIndex(int cacheIndex) const { assert(cacheIndex >= 0 && cacheIndex < maxNumberOfMemoizedModels()); return &m_functions[cacheIndex]; } diff --git a/apps/graph/cartesian_function_store.h b/apps/graph/cartesian_function_store.h index 94f4d9e61..f88a8000a 100644 --- a/apps/graph/cartesian_function_store.h +++ b/apps/graph/cartesian_function_store.h @@ -8,7 +8,7 @@ namespace Graph { -class CartesianFunctionStore : public Shared::FunctionStore { +class ContinuousFunctionStore : public Shared::FunctionStore { public: Shared::ExpiringPointer modelForRecord(Ion::Storage::Record record) const { return Shared::ExpiringPointer(static_cast(privateModelForRecord(record))); } int numberOfActiveFunctionsOfType(Shared::CartesianFunction::PlotType plotType) const; diff --git a/apps/graph/graph/calculation_graph_controller.cpp b/apps/graph/graph/calculation_graph_controller.cpp index 58cfc649e..ac04eac1c 100644 --- a/apps/graph/graph/calculation_graph_controller.cpp +++ b/apps/graph/graph/calculation_graph_controller.cpp @@ -53,7 +53,7 @@ Coordinate2D CalculationGraphController::computeNewPointOfInterestFromAb return computeNewPointOfInterest(start, step, max, textFieldDelegateApp()->localContext()); } -CartesianFunctionStore * CalculationGraphController::functionStore() const { +ContinuousFunctionStore * CalculationGraphController::functionStore() const { return App::app()->functionStore(); } diff --git a/apps/graph/graph/calculation_graph_controller.h b/apps/graph/graph/calculation_graph_controller.h index 95eae8ba3..73fb59f8d 100644 --- a/apps/graph/graph/calculation_graph_controller.h +++ b/apps/graph/graph/calculation_graph_controller.h @@ -21,7 +21,7 @@ protected: BannerView * bannerView() override { return m_bannerView; } void reloadBannerView() override; Poincare::Coordinate2D computeNewPointOfInterestFromAbscissa(double start, int direction); - CartesianFunctionStore * functionStore() const; + ContinuousFunctionStore * functionStore() const; virtual Poincare::Coordinate2D computeNewPointOfInterest(double start, double step, double max, Poincare::Context * context) = 0; GraphView * m_graphView; BannerView * m_bannerView; diff --git a/apps/graph/graph/calculation_parameter_controller.cpp b/apps/graph/graph/calculation_parameter_controller.cpp index b2ffbeb59..addedf669 100644 --- a/apps/graph/graph/calculation_parameter_controller.cpp +++ b/apps/graph/graph/calculation_parameter_controller.cpp @@ -117,7 +117,7 @@ void CalculationParameterController::setRecord(Ion::Storage::Record record) { } bool CalculationParameterController::shouldDisplayIntersection() const { - CartesianFunctionStore * store = App::app()->functionStore(); + ContinuousFunctionStore * store = App::app()->functionStore(); int numberOfCartesianFunctions = store->numberOfActiveFunctionsOfType(Shared::CartesianFunction::PlotType::Cartesian); // Intersection row is displayed when all functions are cartesian and there are least two of them // TODO: compute intersections between polar/parametric/cartesian functions? diff --git a/apps/graph/graph/graph_controller.cpp b/apps/graph/graph/graph_controller.cpp index eeba09afc..106543460 100644 --- a/apps/graph/graph/graph_controller.cpp +++ b/apps/graph/graph/graph_controller.cpp @@ -112,7 +112,7 @@ void GraphController::interestingRanges(float * xm, float * xM, float * ym, floa float GraphController::interestingXHalfRange() const { float characteristicRange = 0.0f; Poincare::Context * context = textFieldDelegateApp()->localContext(); - CartesianFunctionStore * store = functionStore(); + ContinuousFunctionStore * store = functionStore(); for (int i = 0; i < store->numberOfActiveFunctions(); i++) { ExpiringPointer f = store->modelForRecord(store->activeRecordAtIndex(i)); float fRange = f->expressionReduced(context).characteristicXRange(context, Poincare::Preferences::sharedPreferences()->angleUnit()); @@ -164,7 +164,7 @@ double GraphController::defaultCursorT(Ion::Storage::Record record) { } bool GraphController::displaysNonCartesianFunctions() const { - CartesianFunctionStore * store = functionStore(); + ContinuousFunctionStore * store = functionStore(); return store->numberOfActiveFunctionsOfType(CartesianFunction::PlotType::Polar) > 0 || store->numberOfActiveFunctionsOfType(CartesianFunction::PlotType::Parametric) > 0; } diff --git a/apps/graph/graph/graph_controller.h b/apps/graph/graph/graph_controller.h index d5fd35799..9c746eccb 100644 --- a/apps/graph/graph/graph_controller.h +++ b/apps/graph/graph/graph_controller.h @@ -33,7 +33,7 @@ private: Shared::InteractiveCurveViewRange * interactiveCurveViewRange() override { return m_graphRange; } GraphView * functionGraphView() override { return &m_view; } CurveParameterController * curveParameterController() override { return &m_curveParameterController; } - CartesianFunctionStore * functionStore() const override { return static_cast(Shared::FunctionGraphController::functionStore()); } + ContinuousFunctionStore * functionStore() const override { return static_cast(Shared::FunctionGraphController::functionStore()); } bool displaysNonCartesianFunctions() const; bool defautRangeIsNormalized() const override { return displaysNonCartesianFunctions(); } void interestingFunctionRange(Shared::ExpiringPointer f, float tMin, float tMax, float step, float * xm, float * xM, float * ym, float * yM) const; diff --git a/apps/graph/graph/graph_view.cpp b/apps/graph/graph/graph_view.cpp index 5f57ac34c..7fd5640b0 100644 --- a/apps/graph/graph/graph_view.cpp +++ b/apps/graph/graph/graph_view.cpp @@ -23,7 +23,7 @@ void GraphView::reload() { void GraphView::drawRect(KDContext * ctx, KDRect rect) const { FunctionGraphView::drawRect(ctx, rect); - CartesianFunctionStore * functionStore = App::app()->functionStore(); + ContinuousFunctionStore * functionStore = App::app()->functionStore(); for (int i = 0; i < functionStore->numberOfActiveFunctions(); i++) { Ion::Storage::Record record = functionStore->activeRecordAtIndex(i); ExpiringPointer f = functionStore->modelForRecord(record);; diff --git a/apps/graph/list/list_controller.cpp b/apps/graph/list/list_controller.cpp index 5b8416c4c..61ef591c9 100644 --- a/apps/graph/list/list_controller.cpp +++ b/apps/graph/list/list_controller.cpp @@ -189,7 +189,7 @@ void ListController::setFunctionNameInTextField(ExpiringPointersetText(bufferName); } -CartesianFunctionStore * ListController::modelStore() { +ContinuousFunctionStore * ListController::modelStore() { return App::app()->functionStore(); } diff --git a/apps/graph/list/list_controller.h b/apps/graph/list/list_controller.h index f7ffdde8a..81764bf07 100644 --- a/apps/graph/list/list_controller.h +++ b/apps/graph/list/list_controller.h @@ -30,7 +30,7 @@ private: void willDisplayTitleCellAtIndex(HighlightCell * cell, int j) override; void willDisplayExpressionCellAtIndex(HighlightCell * cell, int j) override; void setFunctionNameInTextField(Shared::ExpiringPointer function, TextField * textField); - CartesianFunctionStore * modelStore() override; + ContinuousFunctionStore * modelStore() override; TextFieldFunctionTitleCell m_functionTitleCells[k_maxNumberOfDisplayableRows]; Shared::FunctionExpressionCell m_expressionCells[k_maxNumberOfDisplayableRows]; ListParameterController m_parameterController; diff --git a/apps/graph/values/derivative_parameter_controller.cpp b/apps/graph/values/derivative_parameter_controller.cpp index 6ec2516ee..dbd53bd80 100644 --- a/apps/graph/values/derivative_parameter_controller.cpp +++ b/apps/graph/values/derivative_parameter_controller.cpp @@ -81,7 +81,7 @@ KDCoordinate DerivativeParameterController::cellHeight() { return Metric::ParameterCellHeight; } -CartesianFunctionStore * DerivativeParameterController::functionStore() { +ContinuousFunctionStore * DerivativeParameterController::functionStore() { return App::app()->functionStore(); } diff --git a/apps/graph/values/derivative_parameter_controller.h b/apps/graph/values/derivative_parameter_controller.h index 0aed8df16..eb13bb443 100644 --- a/apps/graph/values/derivative_parameter_controller.h +++ b/apps/graph/values/derivative_parameter_controller.h @@ -25,7 +25,7 @@ public: m_record = record; } private: - CartesianFunctionStore * functionStore(); + ContinuousFunctionStore * functionStore(); #if COPY_COLUMN constexpr static int k_totalNumberOfCell = 2; #else diff --git a/apps/graph/values/values_controller.h b/apps/graph/values/values_controller.h index 4f34ee37e..b7c4bf760 100644 --- a/apps/graph/values/values_controller.h +++ b/apps/graph/values/values_controller.h @@ -46,7 +46,7 @@ private: int maxNumberOfCells() override; int maxNumberOfFunctions() override; double evaluationOfAbscissaAtColumn(double abscissa, int columnIndex) override; - CartesianFunctionStore * functionStore() const override { return static_cast(Shared::ValuesController::functionStore()); } + ContinuousFunctionStore * functionStore() const override { return static_cast(Shared::ValuesController::functionStore()); } Shared::BufferFunctionTitleCell * functionTitleCells(int j) override; EvenOddBufferTextCell * floatCells(int j) override; int abscissaCellsCount() const override { return k_maxNumberOfAbscissaCells; }