Loading...
Searching...
No Matches
Minimap.hpp
1#pragma once
2
3#include <Process/TimeValue.hpp>
4
5#include <QGraphicsItem>
6
7#include <score_plugin_scenario_export.h>
8
9#include <verdigris>
10namespace Scenario
11{
12class SCORE_PLUGIN_SCENARIO_EXPORT Minimap final
13 : public QObject
14 , public QGraphicsItem
15{
16 W_OBJECT(Minimap)
17 Q_INTERFACES(QGraphicsItem)
18public:
19 Minimap();
20 void setWidth(double);
21 double width() const { return m_width; }
22 double leftHandle() const { return m_leftHandle; }
23 double rightHandle() const { return m_rightHandle; }
24
25 // These do not send notification
26 void setMinDistance(double);
27 void setLeftHandle(double);
28 void setRightHandle(double);
29 void setHandles(double l, double r);
30
31 // This one sends visibleRectChanged
32 void modifyHandles(double l, double r);
33
34 // Used when reloading because we don't want clamping to apply
35 void restoreHandles(double l, double r);
36
37 void setLargeView();
38 void zoomIn();
39 void zoomOut();
40 void zoom(double z);
41
42public:
43 void rescale() W_SIGNAL(rescale);
44 void visibleRectChanged(double l, double r) W_SIGNAL(visibleRectChanged, l, r);
45
46private:
47 QRectF boundingRect() const override;
48 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
49 override;
50
51 void mousePressEvent(QGraphicsSceneMouseEvent*) override;
52 void mouseMoveEvent(QGraphicsSceneMouseEvent*) override;
53 void mouseReleaseEvent(QGraphicsSceneMouseEvent*) override;
54 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*) final override;
55
56 void hoverEnterEvent(QGraphicsSceneHoverEvent*) override;
57 void hoverMoveEvent(QGraphicsSceneHoverEvent*) override;
58 void hoverLeaveEvent(QGraphicsSceneHoverEvent*) override;
59
60 QCursor cursorFor(double pos_x) const;
61
62 static const constexpr double m_height{20.};
63
64 double m_leftHandle{};
65 double m_rightHandle{};
66 double m_width{100.};
67 double m_minDist{10.};
68
69 bool m_hidCursor{false};
70 bool m_gripLeft{false};
71 bool m_gripRight{false};
72 bool m_gripMid{false};
73 bool m_setCursor{false};
74};
75}
Definition Minimap.hpp:15
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13