-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstick.h
39 lines (28 loc) · 802 Bytes
/
stick.h
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
#ifndef STICK_H
#define STICK_H
#include <QObject>
#include <QOpenGLFunctions>
#include <QtQuick/QQuickItem>
class Stick
{
public:
Stick();
virtual ~Stick() {};
void draw();
qreal getX() const { return _x; }
qreal getY() const { return _y; }
qreal getRotation() const { return _rotation; }
void setX(qreal value) { _x = value; }
void setY(qreal value) { _y = value; }
void setRotation(qreal value) { _rotation = value; }
void setSize(qreal width, qreal height);
void setColor(const QString &colorCode = "#FFFFFF"); // Hex color
void setColor(int red, int green, int blue, int alpha = 255); // RGBA color
private:
qreal _x, _y, _rotation;
qreal _width, _height;
// Color variables
qreal _red, _blue, _green, _alpha = 1.0;
QColor _color;
};
#endif // STICK_H