GraphIntervalPresenter.hpp
1 #pragma once
2 #include <Scenario/Document/ScenarioDocument/ScenarioDocumentViewConstants.hpp>
3 
4 #include <score/model/ColorInterpolator.hpp>
5 #include <score/model/Identifier.hpp>
6 
7 #include <QGraphicsItem>
8 #include <QObject>
9 #include <QPainterPath>
10 
11 #include <score_plugin_scenario_export.h>
12 
13 #include <verdigris>
14 namespace score
15 {
16 struct Brush;
17 }
18 namespace Process
19 {
20 struct Context;
21 struct Style;
22 }
23 namespace Scenario
24 {
25 class IntervalModel;
26 class StateView;
28  : public QObject
29  , public QGraphicsItem
30 {
31  W_OBJECT(GraphalIntervalPresenter)
32 
33 public:
35  const IntervalModel& model, const StateView& start, const StateView& end,
36  const Process::Context& ctx, QGraphicsItem* parent = nullptr);
37 
38  const Id<IntervalModel>& id() const;
39  const IntervalModel& model() const;
40 
41  static const constexpr int Type = ItemType::GraphInterval;
42  int type() const final override { return Type; }
43 
44  void pressed(QPointF arg_1) const
45  E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, pressed, arg_1)
46  void moved(QPointF arg_1) const E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, moved, arg_1)
47  void released(QPointF arg_1) const
48  E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, released, arg_1)
49 
50  QRectF boundingRect() const override;
51 
52  void resize();
53 
54  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
55  override;
56  QPainterPath shape() const override;
57  QPainterPath opaqueArea() const override;
58  bool contains(const QPointF& point) const override;
59 
60  void mousePressEvent(QGraphicsSceneMouseEvent* event) override;
61  void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
62  void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
63  const score::Brush& intervalColor(const Process::Style& skin) noexcept;
64 
65  const IntervalModel& m_model;
66  const StateView& m_start;
67  const StateView& m_end;
68  const Process::Context& m_context;
69  QPainterPath m_path;
70  score::ColorBang m_execPing;
71 };
72 }
Definition: GraphIntervalPresenter.hpp:30
Definition: IntervalModel.hpp:50
Definition: StateView.hpp:29
The id_base_t class.
Definition: Identifier.hpp:57
Definition: ColorInterpolator.hpp:9
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: ProcessContext.hpp:12
Definition: ScenarioStyle.hpp:13
Definition: Skin.hpp:55