iVS3D v2.0.0
Loading...
Searching...
No Matches
timelinelabel.h
1#ifndef TIMELINELABEL_H
2#define TIMELINELABEL_H
3
4#include <QLabel>
5#include <QWidget>
6#include <QPainter>
7#include <QMouseEvent>
8#include <QtMath>
9#include <QColor>
10
11// color definitions
12#define INBOUND_COLOR Qt::red
13#define OUTOFBOUND_COLOR QColor(72, 74, 73)
14#define TIMESTAMP_COLOR Qt::black
15#define BOUNDARY_COLOR Qt::black
16
28class TimelineLabel : public QLabel
29{
30 Q_OBJECT
31public:
36 explicit TimelineLabel(QWidget *parent = 0);
37
46 void updateTimelinelabel(std::vector<uint> *keyframes, QPointF indexBounds, bool drawTimestamps, QPoint boundaries = QPoint(-1,-1));
47
53 float relPosToIndex(int relativePosition);
54
60 uint indexToRelPos(float index);
61
66 uint getFirstIndex();
67
72 uint getLastIndex();
73
79 void redraw(QPoint boundaries = QPoint(-1, -1));
80
85 void mousePressEvent(QMouseEvent *ev);
86
87signals:
88 void sig_clicked(QPoint pos);
89
90private:
91 std::vector<uint> *m_keyframes = nullptr;
92 uint m_firstIndex = 0;
93 uint m_lastIndex = 0;
94 float m_firstIndex_offset = 0.f;
95 float m_lastIndex_offset = 0.f;
96 float m_frameSize = 0.f;
97 bool m_drawTimestamps = true;
98
99 QPixmap drawPixmap(bool timeStamps, QPoint boundaries);
100 QVector<QLine> boundaryLines(QPoint boundaries);
101};
102
103#endif // TIMELINELABEL_H
The TimelineLabel class is the background of the timeline, it displays positions of frames and keyfra...
Definition timelinelabel.h:29
uint indexToRelPos(float index)
indexToRelPos returns the relative position which correspondes to the global index (firstIndex comput...
Definition timelinelabel.cpp:37
uint getLastIndex()
getLastIndexgets the index of the last diplayed frame
Definition timelinelabel.cpp:58
void redraw(QPoint boundaries=QPoint(-1, -1))
redraw redraws entire label
Definition timelinelabel.cpp:63
float relPosToIndex(int relativePosition)
relPosToIndex returns the respective index as float number to the relative position the timelinelabel
Definition timelinelabel.cpp:25
uint getFirstIndex()
getFirstIndex gets the index of the first diplayed frame
Definition timelinelabel.cpp:53
void mousePressEvent(QMouseEvent *ev)
mousePressEvent signals a mousepress event
Definition timelinelabel.cpp:68
void updateTimelinelabel(std::vector< uint > *keyframes, QPointF indexBounds, bool drawTimestamps, QPoint boundaries=QPoint(-1,-1))
adjustTimeline sets atributtes and redraws TimelineLabel
Definition timelinelabel.cpp:7