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 <ossia/detail/hash_map.hpp>
10
11#include <QPoint>
12
13namespace Curve
14{
15class Model;
16class Presenter;
17class StateBase;
18class SCORE_PLUGIN_CURVE_EXPORT PenCommandObject final : public CommandObjectBase
19{
20public:
22
23 void setCurveState(Curve::StateBase* stateBase) { m_state = stateBase; }
24
25 void on_press() override;
26
27 void move();
28
29 void release();
30
31 void cancel();
32
33private:
34 struct FilteredSegments
35 {
36 std::optional<Id<Curve::SegmentModel>> id_before_middleBegin;
37 std::optional<Id<Curve::SegmentModel>> id_after_middleEnd;
38 std::optional<SegmentData> middleBegin;
39 std::optional<SegmentData> middleEnd;
40 std::vector<SegmentData> segments;
41 };
42
43 void release_n(FilteredSegments&);
44 FilteredSegments& filterSegments();
45 PointArraySegment m_segment;
47 FilteredSegments m_filtered;
48 ossia::hash_set<int32_t> m_filteredIds;
50 Id<SegmentModel> m_splitId;
51
52 Curve::StateBase* m_state{};
53 QPointF m_originalPress;
54 QPointF m_minPress{}, m_maxPress{};
55};
56}
Definition CurveCommandObjectBase.hpp:67
Definition PenCommandObject.hpp:19
Definition CurvePresenter.hpp:34
Definition CurvePaletteBaseStates.hpp:20
The id_base_t class.
Definition Identifier.hpp:59
A small abstraction layer over the score::CommandStack.
Definition CommandStackFacade.hpp:21
Utilities and base classes for 1D curves.
Definition FocusDispatcher.hpp:12