You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
794 B
44 lines
794 B
#ifndef CIRCUITBUFFER_H |
|
#define CIRCUITBUFFER_H |
|
|
|
#include <QList> |
|
#include <QPointF> |
|
|
|
#include "ePartType.h" |
|
|
|
class Part; |
|
class Wire; |
|
class Scene; |
|
|
|
class CircuitBuffer |
|
{ |
|
public: |
|
struct PartData |
|
{ |
|
PartType::PartType type; |
|
QPointF pos; |
|
QString icFilename; |
|
}; |
|
|
|
struct WireData |
|
{ |
|
PartData* inputPart; |
|
int inputPartConnectorIdx; |
|
PartData* outputPart; |
|
int outputPartConnectorIdx; |
|
}; |
|
|
|
CircuitBuffer(); |
|
|
|
void addFromScene(const QList<Part*>& parts, const QList<Wire*>& wires); |
|
QPair<QList<Part*>, QList<Wire*>> addIntoScene(Scene* scene, QPointF posOffset) const; |
|
QPointF getAvgPartPos(); |
|
|
|
void clear(); |
|
|
|
private: |
|
QList<PartData> m_parts; |
|
QList<WireData> m_wires; |
|
}; |
|
|
|
#endif // CIRCUITBUFFER_H
|
|
|