TemporalIntervalPresenter.hpp
1 #pragma once
2 #include <Scenario/Document/Interval/IntervalPresenter.hpp>
3 
4 #include <score_plugin_scenario_export.h>
5 
6 #include <verdigris>
7 class QGraphicsItem;
8 class QObject;
9 namespace Process
10 {
11 class ProcessModel;
12 class GraphicsShapeItem;
13 }
14 namespace Scenario
15 {
16 class EventModel;
17 class SlotHeader;
18 class DefaultHeaderDelegate;
19 class TemporalIntervalHeader;
20 class TemporalIntervalView;
21 struct SlotPresenter;
22 class NodalIntervalView;
23 class SCORE_PLUGIN_SCENARIO_EXPORT TemporalIntervalPresenter final
24  : public IntervalPresenter
25 {
27 
28 public:
30  const auto& id() const
31  {
32  return IntervalPresenter::id();
33  } // To please boost::const_mem_fun
34 
36  ZoomRatio zoom, const IntervalModel& viewModel, const Process::Context& ctx,
37  bool handles, QGraphicsItem* parentobject, QObject* parent);
38 
39  ~TemporalIntervalPresenter() override;
40 
41  void updateScaling() override;
42  void updateHeight();
43 
44  void on_zoomRatioChanged(ZoomRatio val) override;
45 
46  void changeRackState();
47  void selectedSlot(int) const override;
48  TemporalIntervalView* view() const;
49  TemporalIntervalHeader* header() const;
50 
51  void requestSlotMenu(int slot, QPoint pos, QPointF sp) const override;
52  void requestProcessSelectorMenu(int slot, QPoint pos, QPointF sp) const;
53 
54 public:
55  void intervalHoverEnter() E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, intervalHoverEnter)
56  void intervalHoverLeave() E_SIGNAL(SCORE_PLUGIN_SCENARIO_EXPORT, intervalHoverLeave)
57 
58 private:
59  double rackHeight() const;
60  double collapsedRackHeight() const;
61 
62  void createSlot(int pos, const Slot& slt);
63  void createCollapsedSlot(int pos, const Slot& aSlt);
64 
65  void createLayer(int slot, const Process::ProcessModel& proc);
66 
67  void updateProcessShape(int slot, const LayerData& data);
68  void removeLayer(const Process::ProcessModel& proc);
69  void on_slotRemoved(int pos);
70  void updateProcessesShape();
71  void updatePositions();
72  void on_layerModelPutToFront(int slot, const Process::ProcessModel& proc);
73  void on_layerModelPutToBack(int slot, const Process::ProcessModel& proc);
74  void on_rackChanged();
75  void on_processesChanged(const Process::ProcessModel&);
76  void on_requestOverlayMenu(QPointF);
77  void on_rackVisibleChanged(bool);
78  void on_defaultDurationChanged(const TimeVal&);
79 
80  void on_doubleClick();
81 
82  void startSlotDrag(int slot, QPointF) const override;
83  void stopSlotDrag() const override;
84 
85  void setHeaderWidth(const LayerSlotPresenter& slot, double w);
86  void setHeaderWidth(const NodalSlotPresenter& slot, double w);
87  void createNodalSlot();
88 
89  bool m_handles{true};
90 };
91 }
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
Definition: IntervalModel.hpp:50
Definition: IntervalPresenter.hpp:30
Definition: LayerData.hpp:55
Definition: TemporalIntervalHeader.hpp:25
Definition: TemporalIntervalPresenter.hpp:25
Definition: TemporalIntervalView.hpp:24
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
Definition: ProcessContext.hpp:12
Definition: SlotPresenter.hpp:15
Definition: SlotPresenter.hpp:43
Definition: Slot.hpp:8
Definition: TimeValue.hpp:21