-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhighlight.h
More file actions
45 lines (39 loc) · 1.15 KB
/
highlight.h
File metadata and controls
45 lines (39 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef HIGHLIGHT_H
#define HIGHLIGHT_H
#include <QtCore>
#include <QtGui>
#include <QGraphicsEllipseItem>
#include <QVector>
//class Highlight : public QGraphicsObject, public QGraphicsEllipseItem
class Highlight : public QGraphicsObject
{
Q_OBJECT
public:
//Highlight();
Highlight(QGraphicsItem *parent = nullptr);
QRectF boundingRect() const Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
void setDiameter(qreal dia);
void setTotalTime(qreal t);
/*
struct Ring{
qreal v0=0.0; //can't really think of anything else...
};
*/
QVector<qreal> rings; //to store ring's "time of birth" v0
qreal frequency = 2.0; //hertz
qreal velocity = 120.0; // m/s
qreal total_time;
qreal done_ratio;
qreal time;
void setTime(qreal time);
qreal getTime();
Q_PROPERTY(qreal time READ getTime WRITE setTime)
//QGraphicsEllipseItem *ellipse;
QPen pen;
QBrush brush;
qreal diameter=0;//initial innermost ring
qreal outerDiameter=0; //including the outermost ring
qreal numRings=5;
};
#endif // HIGHLIGHT_H