2 #include <Curve/CurveModel.hpp>
3 #include <Curve/CurvePresenter.hpp>
4 #include <Curve/CurveView.hpp>
5 #include <Curve/Palette/CurvePalette.hpp>
7 #include <score/statemachine/CommonSelectionState.hpp>
15 QPointF m_initialPoint;
26 , m_parentSM{parentSM}
31 const QPointF& initialPoint()
const {
return m_initialPoint; }
32 const QPointF& movePoint()
const {
return m_movePoint; }
34 void on_pressAreaSelection()
override { m_initialPoint = m_parentSM.scenePoint; }
36 void on_moveAreaSelection()
override
38 m_movePoint = m_parentSM.scenePoint;
40 = QRectF{m_view.mapFromScene(m_initialPoint), m_view.mapFromScene(m_movePoint)}
43 m_view.setSelectionArea(rect);
44 setSelectionArea(rect);
47 void on_releaseAreaSelection()
override
49 if(m_parentSM.scenePoint == m_initialPoint)
51 dispatcher.deselect();
55 m_view.setSelectionArea(QRectF{});
58 void on_deselect()
override
60 dispatcher.deselect();
61 m_view.setSelectionArea(QRectF{});
65 void setSelectionArea(QRectF scene_area)
70 for(
const auto& point : m_parentSM.presenter().points())
72 if(point.shape().translated(point.pos()).intersects(scene_area))
74 sel.append(point.model());
78 for(
const auto& segment : m_parentSM.presenter().segments())
80 if(segment.shape().translated(segment.pos()).intersects(scene_area))
82 sel.append(segment.model());
87 filterSelections(sel, m_parentSM.model().selectedChildren(), multiSelection()));
The CommonSelectionState class.
Definition: CommonSelectionState.hpp:27
Definition: SelectionState.hpp:13
Definition: CurveView.hpp:25
Base class for IdentifiedObject.
Definition: IdentifiedObjectAbstract.hpp:16
Definition: Selection.hpp:12
The SelectionStack class.
Definition: SelectionStack.hpp:24
Utilities and base classes for 1D curves.
Definition: FocusDispatcher.hpp:12