2#include <Curve/Palette/CurveEditionSettings.hpp>
3#include <Curve/Point/CurvePointModel.hpp>
4#include <Curve/Point/CurvePointView.hpp>
5#include <Curve/Segment/CurveSegmentModel.hpp>
6#include <Curve/Segment/CurveSegmentView.hpp>
8#include <score/command/Dispatchers/CommandDispatcher.hpp>
9#include <score/document/DocumentContext.hpp>
10#include <score/graphics/GraphicsItem.hpp>
11#include <score/model/IdentifiedObjectMap.hpp>
12#include <score/selection/SelectionDispatcher.hpp>
20#include <score_plugin_curve_export.h>
33class SCORE_PLUGIN_CURVE_EXPORT
Presenter final :
public QObject
45 return m_commandDispatcher.stack().context();
48 const auto& points()
const noexcept {
return m_points; }
49 const auto& segments()
const noexcept {
return m_segments; }
54 const Model& model()
const noexcept {
return m_model; }
55 View& view()
const noexcept {
return *m_view; }
57 void setRect(
const QRectF& rect);
59 void enableActions(
bool);
67 void fillContextMenu(QMenu&,
const QPoint&,
const QPointF&);
69 void removeSelection();
73 void convertSamplesToPoints();
76 bool boundedMove()
const noexcept {
return m_boundedMove; }
77 void setBoundedMove(
bool b)
noexcept { m_boundedMove = b; }
79 QRectF rect()
const noexcept {
return m_localRect; }
85 m_magnetism = std::move(f);
87 double magnetic(
double x)
const {
return m_magnetism ? m_magnetism(x) : x; }
90 void contextMenuRequested(
const QPoint& arg_1,
const QPointF& arg_2)
91 E_SIGNAL(SCORE_PLUGIN_CURVE_EXPORT, contextMenuRequested, arg_1, arg_2)
98 void setPos(PointView&);
99 void setPos(SegmentView&);
102 void setupStateMachine();
105 void addPoint(PointView*);
106 void addSegment(SegmentView*);
108 void addPoint_impl(PointView*);
109 void addSegment_impl(SegmentView*);
111 void setupPointConnections(PointView*);
112 void setupSegmentConnections(SegmentView*);
115 const SegmentList& m_curveSegments;
117 std::function<double(
double)> m_magnetism;
119 const Model& m_model;
131 QMenu* m_contextMenu{};
133 bool m_enabled =
true;
134 bool m_boundedMove =
true;
The CommandDispatcher class.
Definition CommandDispatcher.hpp:13
Definition CurveEditionSettings.hpp:34
Definition CurveModel.hpp:26
Definition CurvePresenter.hpp:34
void setMagnetism(std::function< double(double)> f) noexcept
Definition CurvePresenter.hpp:83
Definition CurveView.hpp:28
A map to access child objects through their id.
Definition IdentifiedObjectMap.hpp:17
Definition UuidKey.hpp:345
Utilities and base classes for 1D curves.
Definition FocusDispatcher.hpp:12
Definition CurveStyle.hpp:14
Definition GraphicsItem.hpp:73
Definition DocumentContext.hpp:18