-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPort.hpp
73 lines (49 loc) · 1.33 KB
/
Port.hpp
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef QNEPORT_H
#define QNEPORT_H
#include <QGraphicsPathItem>
#include "Pin.hpp"
namespace nts {
class Block;
class Connection;
class Port : public QGraphicsPathItem {
public:
enum {
Type = QGraphicsItem::UserType + 1
};
enum {
NamePort = 1, TypePort = 2
};
Port(QGraphicsItem *parent = 0);
~Port();
void setNEBlock(Block *);
void setName(const QString &n);
void setIsOutput(bool o);
int radius();
bool isOutput();
QVector<Connection *> &connections();
void setPortFlags(int);
const QString &portName() const { return name; }
int portFlags() const { return m_portFlags; }
int type() const { return Type; }
Block *block();
quint64 ptr();
void setPtr(quint64);
bool isConnected(Port *);
void setPin(Pin* pin);
Pin *getPin();
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
private:
Block *m_block;
QString name;
bool isOutput_;
QGraphicsTextItem *label;
int radius_;
int margin;
QVector<Connection *> m_connections;
int m_portFlags;
quint64 m_ptr;
Pin *pin;
};
}
#endif // QNEPORT_H