forked from rpelorosso/pcb-tracer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponent.h
More file actions
46 lines (39 loc) · 1.07 KB
/
Copy pathComponent.h
File metadata and controls
46 lines (39 loc) · 1.07 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
46
#pragma once
#include <QGraphicsItem>
#include <QPointF>
#include <QString>
#include <vector>
#include "Node.h"
#include "enums.h"
class PhantomPad : public Node {
public:
QString m_name;
PhantomPad(const QString& name, const QPointF& position);
};
class Pad : public Node {
public:
Pad(const QString& name, int id, const QPointF& position, int number);
int m_componentId;
int m_id;
QString m_name;
int m_number;
};
class Component : public QGraphicsItem {
public:
Component(const QString& name, int id);
int numberOfPads() const;
QString toString() const;
void addPad(Pad* pad);
void addToScene(QGraphicsScene* scene);
QRectF boundingRect() const override;
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
void remove(QGraphicsScene* scene);
static int genComponentId();
static void setComponentCount(int count);
static int getLastComponentId();
int m_id;
std::vector<Pad*> m_pads;
QString m_name;
private:
static int s_componentCount;
};