Loading...
Searching...
No Matches
MovePointCommandObject.hpp
1#pragma once
2#include "CurveCommandObjectBase.hpp"
3
4#include <Curve/Segment/CurveSegmentData.hpp>
5
6#include <ossia/detail/small_vector.hpp>
7
8namespace Curve
9{
10class Presenter;
11class SCORE_PLUGIN_CURVE_EXPORT MovePointCommandObject final : public CommandObjectBase
12{
13public:
15 const Model& model, Presenter* presenter, const score::CommandStackFacade& stack);
17
18 void on_press() override;
19
20 void move();
21
22 void release();
23
24 void cancel();
25
26private:
27 bool crosses(double x) const;
28 void setCurrentPoint(std::vector<SegmentData>& segments);
29 bool suppressOverlapped(std::vector<SegmentData>& segments) const;
30 bool crossOverlapped(std::vector<SegmentData>& segments) const;
31 void setTooltip(const Curve::Point& p);
32 void unsetTooltip();
33
34 bool m_pressed{};
35 // In m_startSegments, found at press.
36 int64_t m_prevIndex{-1}, m_follIndex{-1};
37 // Where m_segments differs from m_startSegments after a plain move.
38 ossia::small_vector<int64_t, 2> m_touched;
39 // The nearest points on each side at press, whatever the locking.
40 double m_innerMin{}, m_innerMax{};
41};
42}
Definition CurveCommandObjectBase.hpp:67
Definition CurveModel.hpp:26
Definition MovePointCommandObject.hpp:12
Definition CurvePresenter.hpp:34
A small abstraction layer over the score::CommandStack.
Definition CommandStackFacade.hpp:21
Utilities and base classes for 1D curves.
Definition FocusDispatcher.hpp:12