![]() |
LibrePCB Developers Documentation
|
The Schematic class represents one schematic page of a project and is always part of a circuit. More...
#include <schematic.h>
Public Types | |
enum | ItemZValue |
Z Values of all items in a schematic scene (to define the stacking order) More... | |
Signals | |
void | attributesChanged () override |
This signal is emited when the value of attributes has changed. More... | |
![]() | |
virtual void | attributesChanged ()=0 |
This signal is emited when the value of attributes has changed. More... | |
Public Member Functions | |
Schematic ()=delete | |
Schematic (const Schematic &other)=delete | |
Schematic (Project &project, std::unique_ptr< TransactionalDirectory > directory, const Version &fileFormat) | |
~Schematic () noexcept | |
Project & | getProject () const noexcept |
FilePath | getFilePath () const noexcept |
const GridProperties & | getGridProperties () const noexcept |
GraphicsScene & | getGraphicsScene () const noexcept |
bool | isEmpty () const noexcept |
QList< SI_Base * > | getItemsAtScenePos (const Point &pos) const noexcept |
QList< SI_NetPoint * > | getNetPointsAtScenePos (const Point &pos) const noexcept |
QList< SI_NetLine * > | getNetLinesAtScenePos (const Point &pos) const noexcept |
QList< SI_NetLabel * > | getNetLabelsAtScenePos (const Point &pos) const noexcept |
QList< SI_SymbolPin * > | getPinsAtScenePos (const Point &pos) const noexcept |
QList< SI_Text * > | getTextsAtScenePos (const Point &pos) const noexcept |
void | setGridProperties (const GridProperties &grid) noexcept |
const Uuid & | getUuid () const noexcept |
const ElementName & | getName () const noexcept |
const QIcon & | getIcon () const noexcept |
void | setName (const ElementName &name) noexcept |
QList< SI_Symbol * > | getSymbols () const noexcept |
SI_Symbol * | getSymbolByUuid (const Uuid &uuid) const noexcept |
void | addSymbol (SI_Symbol &symbol) |
void | removeSymbol (SI_Symbol &symbol) |
QList< SI_NetSegment * > | getNetSegments () const noexcept |
SI_NetSegment * | getNetSegmentByUuid (const Uuid &uuid) const noexcept |
void | addNetSegment (SI_NetSegment &netsegment) |
void | removeNetSegment (SI_NetSegment &netsegment) |
const QList< SI_Polygon * > & | getPolygons () const noexcept |
SI_Polygon * | getPolygonByUuid (const Uuid &uuid) const noexcept |
void | addPolygon (SI_Polygon &polygon) |
void | removePolygon (SI_Polygon &polygon) |
QList< SI_Text * > | getTexts () const noexcept |
SI_Text * | getTextByUuid (const Uuid &uuid) const noexcept |
void | addText (SI_Text &text) |
void | removeText (SI_Text &text) |
void | addToProject () |
void | removeFromProject () |
void | save () |
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 |
void | updateAllNetLabelAnchors () noexcept |
void | renderToQPainter (QPainter &painter) const noexcept |
std::unique_ptr< SchematicSelectionQuery > | 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... | |
Schematic & | operator= (const Schematic &rhs)=delete |
bool | operator== (const Schematic &rhs) noexcept |
bool | operator!= (const Schematic &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... | |
![]() | |
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 Schematic * | 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 | |
Schematic (Project &project, std::unique_ptr< TransactionalDirectory > directory, const Version &fileFormat, bool create, const QString &newName) | |
void | updateIcon () 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< GridProperties > | mGridProperties |
QRectF | mViewRect |
Uuid | mUuid |
ElementName | mName |
QIcon | mIcon |
QList< SI_Symbol * > | mSymbols |
QList< SI_NetSegment * > | mNetSegments |
QList< SI_Polygon * > | mPolygons |
QList< SI_Text * > | mTexts |
The Schematic class represents one schematic page of a project and is always part of a circuit.
A schematic can contain following items (see librepcb::project::SI_Base and librepcb::project::SGI_Base):
enum ItemZValue |
Z Values of all items in a schematic scene (to define the stacking order)
These values are used for QGraphicsItem::setZValue() to define the stacking order of all items in a schematic 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_Symbols | Z value for librepcb::project::SI_Symbol items. |
ZValue_Polygons | Z value for librepcb::project::SI_Polygon items. |
ZValue_Texts | Z value for librepcb::project::SI_Text items. |
ZValue_NetLabels | Z value for librepcb::project::SI_NetLabel items. |
ZValue_NetLines | Z value for librepcb::project::SI_NetLine items. |
ZValue_HiddenNetPoints | Z value for hidden librepcb::project::SI_NetPoint items |
ZValue_VisibleNetPoints | Z value for visible librepcb::project::SI_NetPoint items |
|
delete |
|
inline |
|
noexcept |
|
private |
|
inlinenoexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
inlinenoexcept |
void addSymbol | ( | SI_Symbol & | symbol | ) |
void removeSymbol | ( | SI_Symbol & | symbol | ) |
|
inlinenoexcept |
|
noexcept |
void addNetSegment | ( | SI_NetSegment & | netsegment | ) |
void removeNetSegment | ( | SI_NetSegment & | netsegment | ) |
|
inlinenoexcept |
|
noexcept |
void addPolygon | ( | SI_Polygon & | polygon | ) |
void removePolygon | ( | SI_Polygon & | polygon | ) |
|
inlinenoexcept |
void addText | ( | SI_Text & | text | ) |
void removeText | ( | SI_Text & | text | ) |
void addToProject | ( | ) |
void removeFromProject | ( | ) |
void save | ( | ) |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
|
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).
|
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 |