score-plugin-spline/Spline/View.hpp
1 #pragma once
2 #include <Process/LayerView.hpp>
3 
4 #include <Spline/Model.hpp>
5 
6 #include <verdigris>
7 namespace Process
8 {
9 struct Context;
10 }
11 
12 namespace Spline
13 {
14 class CurveItem;
15 class View final : public Process::LayerView
16 {
17  W_OBJECT(View)
18 public:
19  View(const ProcessModel& m, const Process::Context& ctx, QGraphicsItem* parent);
20 
21  void setSpline(ossia::spline_data d);
22  const ossia::spline_data& spline() const noexcept;
23 
24  void setPlayPercentage(float p);
25 
26  void enable();
27  void disable();
28 
29  void recenter();
30 
31  void changed() W_SIGNAL(changed);
32 
33 private:
34  void paint_impl(QPainter*) const override;
35 
36  void mousePressEvent(QGraphicsSceneMouseEvent* event) override;
37  void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
38  void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
39  void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) override;
40 
41  void moveControlPoint(QPointF mouse);
42 
43  CurveItem* m_impl{};
44  QPointF m_pressedPos{};
45 };
46 }
Definition: LayerView.hpp:21
Definition: score-plugin-spline/Spline/View.cpp:34
Definition: score-plugin-spline/Spline/Model.hpp:19
Definition: score-plugin-spline/Spline/View.hpp:16
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Definition: ProcessContext.hpp:12