-
Notifications
You must be signed in to change notification settings - Fork 0
/
Edge.h
56 lines (40 loc) · 876 Bytes
/
Edge.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef EDGE_H
#define EDGE_H
#include <QPoint>
#include "Serializable.h"
enum class EdgeType {
STRAIGHT,
BEZIER,
STEP
};
#include "Socket.h"
class GraphicsEdge;
class Edge : public Serializable
{
public:
Edge();
~Edge();
Edge(Socket*, Socket*);
QPoint source;
QPoint dest;
void setRenderer(GraphicsEdge *gEdge);
GraphicsEdge *getRenderer();
void updateWorldPosition();
GraphicsEdge *graphicsEdge;
void detachEdgesFromSockets() {
if (A) A->clearEdges();
if (B) B->clearEdges();
}
Socket *getInputSocket() {
return B;
}
Socket *getOutputSocket() {
return A;
}
Socket *A = nullptr;
Socket *B = nullptr;
virtual QJsonObject serialize() override;
virtual Edge* deserialize(QJsonObject, NodeScene*) override;
QString id;
};
#endif // EDGE_H