Loading...
Searching...
No Matches
NodalIntervalView.hpp
1#pragma once
2#include <Process/Dataflow/NodeItem.hpp>
3
4#include <Scenario/Application/Drops/ScenarioDropHandler.hpp>
5#include <Scenario/Document/Interval/IntervalModel.hpp>
6#include <Scenario/Document/Interval/IntervalPresenter.hpp>
7
8#include <score/graphics/RectItem.hpp>
9#include <score/tools/Bind.hpp>
10
11#include <ossia/detail/math.hpp>
12
13#include <nano_observer.hpp>
14
15namespace Scenario
16{
19 , public Nano::Observer
20{
21public:
22 enum ItemsToShow
23 {
24 AllItems,
25 OnlyEffects
26 };
28 ItemsToShow sh, const IntervalModel& model, const Process::Context& ctx,
29 QGraphicsItem* parent);
30
32
33 void on_drop(QPointF pos, const QMimeData* data);
34 void on_playPercentageChanged(double t, TimeVal parent_dur);
35
36 void recenter();
37 void recenterRelativeToView();
38 void rescale();
39 QRectF enclosingRect() const noexcept;
40
41 QGraphicsItem& nodeContainer() const noexcept { return *m_container; }
42
43private:
44 void on_processAdded(const Process::ProcessModel& proc);
45 void on_processRemoving(const Process::ProcessModel& model);
46 void on_zoomRatioChanged(ZoomRatio ratio);
47
48 void dragEnterEvent(QGraphicsSceneDragDropEvent* event) override;
49 void dragLeaveEvent(QGraphicsSceneDragDropEvent* event) override;
50 void dragMoveEvent(QGraphicsSceneDragDropEvent* event) override;
51 void dropEvent(QGraphicsSceneDragDropEvent* event) override;
52
53 void mousePressEvent(QGraphicsSceneMouseEvent* event) override;
54 void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
55 void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
56 void contextMenuEvent(QGraphicsSceneContextMenuEvent* event) override;
57
58 const IntervalModel& m_model;
59 const Process::Context& m_context;
60 ItemsToShow m_itemsToShow{};
61 std::vector<Process::NodeItem*> m_nodeItems;
62 QGraphicsItem* m_container{};
63 QPointF m_pressedPos{};
64};
65
66}
The Process class.
Definition score-lib-process/Process/Process.hpp:61
Definition IntervalModel.hpp:50
Definition NodalIntervalView.hpp:20
Definition RectItem.hpp:64
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
Definition ProcessContext.hpp:12
Definition TimeValue.hpp:21