31 const Curve::Style& style,
const Model_T& lm, LayerView_T* view,
33 : LayerPresenter{lm, view, ctx, parent}
34 , m_view{
static_cast<LayerView_T*
>(view)}
35 , m_curve{ctx, style, lm.curve(),
new View{m_view},
this}
36 , m_commandDispatcher{ctx.commandStack}
37 , m_sm{m_context, m_curve}
39 con(lm, &CurveProcessModel::curveChanged,
this,
40 &CurveProcessPresenter::parentGeometryChanged);
42 con(m_curve, &Presenter::contextMenuRequested,
this,
43 &LayerPresenter::contextMenuRequested);
45 connect(&m_curve.view(), &View::doubleClick,
this, [
this](QPointF pt) {
49 parentGeometryChanged();
50 m_view->setCurveView(&m_curve.view());
55 void on_focusChanged()
final override
62 m_curve.enableActions(b);
64 m_curve.editionSettings().setTool(Curve::Tool::Select);
67 void setWidth(qreal width, qreal defaultWidth)
final override
69 m_view->setWidth(width);
70 m_curve.view().setRect(m_view->boundingRect());
71 m_curve.view().setDefaultWidth(defaultWidth);
74 void setHeight(qreal height)
final override
76 m_view->setHeight(height);
77 m_curve.view().setRect(m_view->boundingRect());
80 void putToFront()
final override
86 void putBehind()
final override
92 void on_zoomRatioChanged(ZoomRatio val)
final override
95 parentGeometryChanged();
98 void parentGeometryChanged()
override
101 QRectF rect = m_view->boundingRect();
102 m_curve.view().setRect(rect);
104 const auto dw = m_process.duration().toPixels(m_zoomRatio);
105 m_curve.view().setDefaultWidth(dw);
107 m_curve.setRect(rect);
110 void fillContextMenu(
111 QMenu& menu, QPoint pos, QPointF scenepos,
114 m_curve.fillContextMenu(menu, pos, scenepos);
117 LayerView_T* view() {
return m_view.impl; }
118 const Model_T& model()
const {
return static_cast<const Model_T&
>(m_process); }
127 ZoomRatio m_zoomRatio{};
Definition ProcessContext.hpp:12