Loading...
Searching...
No Matches
PenCommandObject.hpp
1#pragma once
2#include <Curve/Commands/UpdateCurve.hpp>
3#include <Curve/Palette/CommandObjects/CurveCommandObjectBase.hpp>
4#include <Curve/Segment/PointArray/PointArraySegment.hpp>
5
6#include <score/command/Dispatchers/SingleOngoingCommandDispatcher.hpp>
7#include <score/tools/std/Optional.hpp>
8
9#include <QPoint>
10
11namespace Curve
12{
13class Model;
14class Presenter;
15class StateBase;
16class SCORE_PLUGIN_CURVE_EXPORT PenCommandObject final : public CommandObjectBase
17{
18public:
20
21 void setCurveState(Curve::StateBase* stateBase) { m_state = stateBase; }
22
23 void on_press() override;
24
25 void move();
26
27 void release();
28
29 void cancel();
30
31private:
32 struct FilteredSegments
33 {
34 std::optional<Id<Curve::SegmentModel>> id_before_middleBegin;
35 std::optional<Id<Curve::SegmentModel>> id_after_middleEnd;
36 std::optional<SegmentData> middleBegin;
37 std::optional<SegmentData> middleEnd;
38 std::vector<SegmentData> segments;
39 };
40
41 void release_n(FilteredSegments&&);
42 FilteredSegments filterSegments();
43 PointArraySegment m_segment;
44
45 Curve::StateBase* m_state{};
46 QPointF m_originalPress;
47 QPointF m_minPress{}, m_maxPress{};
48};
49}
Definition CurveCommandObjectBase.hpp:56
Definition PenCommandObject.hpp:17
Definition CurvePresenter.hpp:32
Definition CurvePaletteBaseStates.hpp:20
A small abstraction layer over the score::CommandStack.
Definition CommandStackFacade.hpp:20
Utilities and base classes for 1D curves.
Definition FocusDispatcher.hpp:12