Files
Upsilon/python/port/mod/matplotlib/plot_controller.h
Émilie Feral 4022cdfa60 [python] Matplotlib: plot_controller inherits from
ZoomAndPanCurveViewController to be able to pan
2020-04-01 10:18:08 +02:00

29 lines
1.0 KiB
C++

#ifndef PYTHON_MATPLOTLIB_PLOT_CONTROLLER_H
#define PYTHON_MATPLOTLIB_PLOT_CONTROLLER_H
#include <apps/shared/zoom_and_pan_curve_view_controller.h>
#include <python/port/port.h>
#include "plot_view.h"
#include "plot_store.h"
namespace Matplotlib {
class PlotController : public Shared::ZoomAndPanCurveViewController, public MicroPython::ExecutionViewControllerHelper {
public:
PlotController(PlotStore * store, MicroPython::ExecutionEnvironment * executiveEnvironment) : Shared::ZoomAndPanCurveViewController(nullptr), ExecutionViewControllerHelper(executiveEnvironment), m_store(store), m_view(m_store) {}
void viewWillAppear() override { MicroPython::ExecutionViewControllerHelper::viewWillAppear(this); }
void viewDidDisappear() override { MicroPython::ExecutionViewControllerHelper::viewDidDisappear(this); }
protected:
Shared::CurveView * curveView() override { return &m_view; }
Shared::InteractiveCurveViewRange * interactiveCurveViewRange() override { return m_store; }
private:
PlotStore * m_store;
PlotView m_view;
};
}
#endif