![]() |
LibrePCB Developers Documentation
|
The Board class represents a PCB of a project and is always part of a circuit. More...
#include <board.h>
Public Types | |
enum | ItemZValue |
Z Values of all items in a board scene (to define the stacking order) More... | |
Signals | |
void | attributesChanged () override |
This signal is emited when the value of attributes has changed. More... | |
void | deviceAdded (BI_Device &comp) |
void | deviceRemoved (BI_Device &comp) |
![]() | |
virtual void | attributesChanged ()=0 |
This signal is emited when the value of attributes has changed. More... | |
Public Member Functions | |
Board ()=delete | |
Board (const Board &other)=delete | |
Board (const Board &other, std::unique_ptr< TransactionalDirectory > directory, const ElementName &name) | |
Board (Project &project, std::unique_ptr< TransactionalDirectory > directory, const Version &fileFormat) | |
~Board () noexcept | |
Project & | getProject () const noexcept |
FilePath | getFilePath () const noexcept |
const GridProperties & | getGridProperties () const noexcept |
GraphicsScene & | getGraphicsScene () const noexcept |
BoardLayerStack & | getLayerStack () noexcept |
const BoardLayerStack & | getLayerStack () const noexcept |
BoardDesignRules & | getDesignRules () noexcept |
const BoardDesignRules & | getDesignRules () const noexcept |
BoardFabricationOutputSettings & | getFabricationOutputSettings () noexcept |
const BoardFabricationOutputSettings & | getFabricationOutputSettings () const noexcept |
bool | isEmpty () const noexcept |
QList< BI_Base * > | getItemsAtScenePos (const Point &pos) const noexcept |
QList< BI_Via * > | getViasAtScenePos (const Point &pos, const NetSignal *netsignal=nullptr) const noexcept |
QList< BI_NetPoint * > | getNetPointsAtScenePos (const Point &pos, const GraphicsLayer *layer=nullptr, const NetSignal *netsignal=nullptr) const noexcept |
QList< BI_NetLine * > | getNetLinesAtScenePos (const Point &pos, const GraphicsLayer *layer=nullptr, const NetSignal *netsignal=nullptr) const noexcept |
QList< BI_FootprintPad * > | getPadsAtScenePos (const Point &pos, const GraphicsLayer *layer=nullptr, const NetSignal *netsignal=nullptr) const noexcept |
BI_NetPoint * | getNetPointNextToScenePos (const Point &pos, UnsignedLength &maxDistance, const GraphicsLayer *layer=nullptr, const NetSignal *netsignal=nullptr) const |
BI_Via * | getViaNextToScenePos (const Point &pos, UnsignedLength &maxDistance, const NetSignal *netsignal=nullptr) const |
BI_FootprintPad * | getPadNextToScenePos (const Point &pos, UnsignedLength &maxDistance, const GraphicsLayer *layer=nullptr, const NetSignal *netsignal=nullptr) const |
QList< BI_Base * > | getAllItems () const noexcept |
void | setGridProperties (const GridProperties &grid) noexcept |
const Uuid & | getUuid () const noexcept |
const ElementName & | getName () const noexcept |
const QIcon & | getIcon () const noexcept |
const QString & | getDefaultFontName () const noexcept |
const QMap< Uuid, BI_Device * > & | getDeviceInstances () const noexcept |
BI_Device * | getDeviceInstanceByComponentUuid (const Uuid &uuid) const noexcept |
void | addDeviceInstance (BI_Device &instance) |
void | removeDeviceInstance (BI_Device &instance) |
const QList< BI_NetSegment * > & | getNetSegments () const noexcept |
BI_NetSegment * | getNetSegmentByUuid (const Uuid &uuid) const noexcept |
void | addNetSegment (BI_NetSegment &netsegment) |
void | removeNetSegment (BI_NetSegment &netsegment) |
const QList< BI_Plane * > & | getPlanes () const noexcept |
void | addPlane (BI_Plane &plane) |
void | removePlane (BI_Plane &plane) |
void | rebuildAllPlanes () noexcept |
const QList< BI_Polygon * > & | getPolygons () const noexcept |
void | addPolygon (BI_Polygon &polygon) |
void | removePolygon (BI_Polygon &polygon) |
const QList< BI_StrokeText * > & | getStrokeTexts () const noexcept |
void | addStrokeText (BI_StrokeText &text) |
void | removeStrokeText (BI_StrokeText &text) |
const QList< BI_Hole * > & | getHoles () const noexcept |
void | addHole (BI_Hole &hole) |
void | removeHole (BI_Hole &hole) |
QList< BI_AirWire * > | getAirWires () const noexcept |
void | scheduleAirWiresRebuild (NetSignal *netsignal) noexcept |
void | triggerAirWiresRebuild () noexcept |
void | forceAirWiresRebuild () noexcept |
void | addToProject () |
void | removeFromProject () |
void | save () |
void | print (QPrinter &printer) |
Print board to a QPrinter (printer or file) More... | |
void | renderToQPainter (QPainter &painter, int dpi) const |
void | showInView (GraphicsView &view) noexcept |
void | saveViewSceneRect (const QRectF &rect) noexcept |
const QRectF & | restoreViewSceneRect () const noexcept |
void | selectAll () noexcept |
void | setSelectionRect (const Point &p1, const Point &p2, bool updateItems) noexcept |
void | clearSelection () const noexcept |
std::unique_ptr< BoardSelectionQuery > | createSelectionQuery () const noexcept |
QString | getBuiltInAttributeValue (const QString &key) const noexcept override |
Get the value of a built-in attribute (if available) More... | |
QVector< const AttributeProvider * > | getAttributeProviderParents () const noexcept override |
Get all parent attribute providers (fallback if attribute not found) More... | |
Board & | operator= (const Board &rhs)=delete |
bool | operator== (const Board &rhs) noexcept |
bool | operator!= (const Board &rhs) noexcept |
![]() | |
AttributeProvider () noexcept | |
AttributeProvider (const AttributeProvider &other)=delete | |
AttributeProvider & | operator= (const AttributeProvider &rhs)=delete |
virtual | ~AttributeProvider () noexcept |
QString | getAttributeValue (const QString &key) const noexcept |
Get the value of an attribute which can be used in texts (like "{{NAME}}") More... | |
virtual QString | getUserDefinedAttributeValue (const QString &key) const noexcept |
Get the value of a user defined attribute (if available) More... | |
![]() | |
IF_ErcMsgProvider () | |
virtual | ~IF_ErcMsgProvider () |
virtual const char * | getErcMsgOwnerClassName () const noexcept=0 |
![]() | |
SerializableObject () noexcept | |
virtual | ~SerializableObject () noexcept |
SExpression | serializeToDomElement (const QString &name) const |
Serialize the object to a new S-Expression node. More... | |
Static Public Member Functions | |
static Board * | create (Project &project, std::unique_ptr< TransactionalDirectory > directory, const ElementName &name) |
![]() | |
template<typename T > | |
static void | serializeObjectContainer (SExpression &root, const T &container, const QString &itemName) |
template<typename T > | |
static void | serializePointerContainer (SExpression &root, const T &container, const QString &itemName) |
template<typename T > | |
static void | serializePointerContainerUuidSorted (SExpression &root, const T &container, const QString &itemName) |
Private Member Functions | |
Board (Project &project, std::unique_ptr< TransactionalDirectory > directory, const Version &fileFormat, bool create, const QString &newName) | |
void | updateIcon () noexcept |
void | updateErcMessages () noexcept |
void | serialize (SExpression &root) const override |
Serialize the object into an existing S-Expression node. More... | |
Private Attributes | |
Project & | mProject |
A reference to the Project object (from the ctor) More... | |
std::unique_ptr< TransactionalDirectory > | mDirectory |
bool | mIsAddedToProject |
QScopedPointer< GraphicsScene > | mGraphicsScene |
QScopedPointer< BoardLayerStack > | mLayerStack |
QScopedPointer< GridProperties > | mGridProperties |
QScopedPointer< BoardDesignRules > | mDesignRules |
QScopedPointer< BoardFabricationOutputSettings > | mFabricationOutputSettings |
QScopedPointer< BoardUserSettings > | mUserSettings |
QRectF | mViewRect |
QSet< NetSignal * > | mScheduledNetSignalsForAirWireRebuild |
Uuid | mUuid |
ElementName | mName |
QIcon | mIcon |
QString | mDefaultFontFileName |
QMap< Uuid, BI_Device * > | mDeviceInstances |
QList< BI_NetSegment * > | mNetSegments |
QList< BI_Plane * > | mPlanes |
QList< BI_Polygon * > | mPolygons |
QList< BI_StrokeText * > | mStrokeTexts |
QList< BI_Hole * > | mHoles |
QMultiHash< NetSignal *, BI_AirWire * > | mAirWires |
QHash< Uuid, ErcMsg * > | mErcMsgListUnplacedComponentInstances |
The Board class represents a PCB of a project and is always part of a circuit.
enum ItemZValue |
Z Values of all items in a board scene (to define the stacking order)
These values are used for QGraphicsItem::setZValue() to define the stacking order of all items in a board QGraphicsScene. We use integer values, even if the z-value of QGraphicsItem is a qreal attribute...
Low number = background, high number = foreground
Enumerator | |
---|---|
ZValue_Default | this is the default value (behind all other items) |
ZValue_TextsBottom | Z value for librepcb::project::BI_StrokeText items. |
ZValue_FootprintsBottom | Z value for librepcb::project::BI_Footprint items |
ZValue_FootprintPadsBottom | Z value for librepcb::project::BI_FootprintPad items |
ZValue_CopperBottom | |
ZValue_CopperTop | |
ZValue_FootprintPadsTop | Z value for librepcb::project::BI_FootprintPad items |
ZValue_FootprintsTop | Z value for librepcb::project::BI_Footprint items |
ZValue_TextsTop | Z value for librepcb::project::BI_StrokeText items. |
ZValue_Vias | Z value for librepcb::project::BI_Via items. |
ZValue_Texts | Z value for librepcb::project::BI_StrokeText items. |
ZValue_AirWires | Z value for librepcb::project::BI_AirWire items. |
|
delete |
Board | ( | const Board & | other, |
std::unique_ptr< TransactionalDirectory > | directory, | ||
const ElementName & | name | ||
) |
|
inline |
|
noexcept |
|
private |
|
inlinenoexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
BI_NetPoint * getNetPointNextToScenePos | ( | const Point & | pos, |
UnsignedLength & | maxDistance, | ||
const GraphicsLayer * | layer = nullptr , |
||
const NetSignal * | netsignal = nullptr |
||
) | const |
BI_Via * getViaNextToScenePos | ( | const Point & | pos, |
UnsignedLength & | maxDistance, | ||
const NetSignal * | netsignal = nullptr |
||
) | const |
BI_FootprintPad * getPadNextToScenePos | ( | const Point & | pos, |
UnsignedLength & | maxDistance, | ||
const GraphicsLayer * | layer = nullptr , |
||
const NetSignal * | netsignal = nullptr |
||
) | const |
|
noexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
void addDeviceInstance | ( | BI_Device & | instance | ) |
void removeDeviceInstance | ( | BI_Device & | instance | ) |
|
inlinenoexcept |
|
noexcept |
void addNetSegment | ( | BI_NetSegment & | netsegment | ) |
void removeNetSegment | ( | BI_NetSegment & | netsegment | ) |
|
inlinenoexcept |
void addPlane | ( | BI_Plane & | plane | ) |
void removePlane | ( | BI_Plane & | plane | ) |
|
noexcept |
|
inlinenoexcept |
void addPolygon | ( | BI_Polygon & | polygon | ) |
void removePolygon | ( | BI_Polygon & | polygon | ) |
|
inlinenoexcept |
void addStrokeText | ( | BI_StrokeText & | text | ) |
void removeStrokeText | ( | BI_StrokeText & | text | ) |
|
inlinenoexcept |
void addHole | ( | BI_Hole & | hole | ) |
void removeHole | ( | BI_Hole & | hole | ) |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
void addToProject | ( | ) |
void removeFromProject | ( | ) |
void save | ( | ) |
void print | ( | QPrinter & | printer | ) |
Print board to a QPrinter (printer or file)
This is a helper function to print the board into w QPrinter. It does following:
printer | The QPrinter where to print the board |
Exception | On error |
void renderToQPainter | ( | QPainter & | painter, |
int | dpi | ||
) | const |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
overridevirtualnoexcept |
Get the value of a built-in attribute (if available)
key | The attribute name (e.g. "NAME" for "{{NAME}}") |
Reimplemented from AttributeProvider.
|
overridevirtualnoexcept |
Get all parent attribute providers (fallback if attribute not found)
Reimplemented from AttributeProvider.
|
inlinenoexcept |
|
inlinenoexcept |
|
static |
|
overridesignal |
This signal is emited when the value of attributes has changed.
All derived classes must emit this signal when some attributes have changed their values (only attributes which can be fetched with getAttributeValue(), inclusive all attributes from all "parent" classes).
|
signal |
|
signal |
|
privatenoexcept |
|
privatenoexcept |
|
overrideprivatevirtual |
Serialize the object into an existing S-Expression node.
This method inserts/appends all attributes and childs of the object to an existing S-Expression node. The content which already exists in the given S-Expression node will not be removed.
root | The target DOM root node |
Exception | This method throws an exception if an error occurs. |
Implements SerializableObject.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |