mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 08:47:28 +01:00
56 lines
2.3 KiB
C++
56 lines
2.3 KiB
C++
#ifndef SHARED_FUNCTION_GRAPH_CONTROLLER_H
|
|
#define SHARED_FUNCTION_GRAPH_CONTROLLER_H
|
|
|
|
#include <escher.h>
|
|
#include "initialisation_parameter_controller.h"
|
|
#include "function_banner_delegate.h"
|
|
#include "interactive_curve_view_controller.h"
|
|
#include "function_store.h"
|
|
#include "function_graph_view.h"
|
|
#include "function_curve_parameter_controller.h"
|
|
|
|
namespace Shared {
|
|
|
|
class FunctionGraphController : public InteractiveCurveViewController, public FunctionBannerDelegate {
|
|
public:
|
|
FunctionGraphController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, ButtonRowController * header, InteractiveCurveViewRange * interactiveRange, CurveView * curveView, CurveViewCursor * cursor, int * indexFunctionSelectedByCursor, uint32_t * modelVersion, uint32_t * rangeVersion, Poincare::Preferences::AngleUnit * angleUnitVersion);
|
|
bool isEmpty() const override;
|
|
ViewController * initialisationParameterController() override;
|
|
void viewWillAppear() override;
|
|
|
|
protected:
|
|
float cursorTopMarginRatio() override { return 0.068f; }
|
|
void reloadBannerView() override;
|
|
bool handleEnter() override;
|
|
int indexFunctionSelectedByCursor() const { return *m_indexFunctionSelectedByCursor; }
|
|
virtual void selectFunctionWithCursor(int functionIndex);
|
|
virtual double defaultCursorAbscissa();
|
|
virtual FunctionStore * functionStore() const;
|
|
|
|
private:
|
|
virtual FunctionGraphView * functionGraphView() = 0;
|
|
virtual FunctionCurveParameterController * curveParameterController() = 0;
|
|
|
|
// InteractiveCurveViewRangeDelegate
|
|
InteractiveCurveViewRangeDelegate::Range computeYRange(InteractiveCurveViewRange * interactiveCurveViewRange) override;
|
|
|
|
// InteractiveCurveViewController
|
|
void initCursorParameters() override;
|
|
bool moveCursorVertically(int direction) override;
|
|
CurveView * curveView() override;
|
|
uint32_t modelVersion() override;
|
|
uint32_t rangeVersion() override;
|
|
int selectedCurveIndex() const override { return *m_indexFunctionSelectedByCursor; }
|
|
bool closestCurveIndexIsSuitable(int newIndex, int currentIndex) const override;
|
|
double yValue(int curveIndex, double x, Poincare::Context * context) const override;
|
|
int numberOfCurves() const override;
|
|
|
|
InitialisationParameterController m_initialisationParameterController;
|
|
Poincare::Preferences::AngleUnit * m_angleUnitVersion;
|
|
int * m_indexFunctionSelectedByCursor;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|