![]() |
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, const FilePath &filepath, bool restore, bool readOnly) | |
~Schematic () noexcept | |
Project & | getProject () const noexcept |
const 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 |
void | setGridProperties (const GridProperties &grid) noexcept |
const Uuid & | getUuid () const noexcept |
const ElementName & | getName () const noexcept |
const QIcon & | getIcon () const 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) |
SI_NetSegment * | getNetSegmentByUuid (const Uuid &uuid) const noexcept |
void | addNetSegment (SI_NetSegment &netsegment) |
void | removeNetSegment (SI_NetSegment &netsegment) |
void | addToProject () |
void | removeFromProject () |
bool | save (bool toOriginal, QStringList &errors) noexcept |
void | showInView (GraphicsView &view) noexcept |
void | saveViewSceneRect (const QRectF &rect) noexcept |
const QRectF & | restoreViewSceneRect () const 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 noexceptoverride |
Get the value of a built-in attribute (if available) More... | |
QVector< const AttributeProvider * > | getAttributeProviderParents () const noexceptoverride |
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, const FilePath &filepath, 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, const FilePath &filepath, bool restore, bool readOnly, 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... | |
FilePath | mFilePath |
the filepath of the schematic *.lp file (from the ctor) More... | |
QScopedPointer< SmartSExprFile > | mFile |
bool | mIsAddedToProject |
QScopedPointer< GraphicsScene > | mGraphicsScene |
QScopedPointer< GridProperties > | mGridProperties |
QRectF | mViewRect |
Uuid | mUuid |
ElementName | mName |
QIcon | mIcon |
QList< SI_Symbol * > | mSymbols |
QList< SI_NetSegment * > | mNetSegments |
The Schematic class represents one schematic page of a project and is always part of a circuit.
A schematic can contain following items (see #project#SI_Base and #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
|
delete |
|
noexcept |
|
private |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
void addSymbol | ( | SI_Symbol & | symbol | ) |
void removeSymbol | ( | SI_Symbol & | symbol | ) |
|
noexcept |
void addNetSegment | ( | SI_NetSegment & | netsegment | ) |
void removeNetSegment | ( | SI_NetSegment & | netsegment | ) |
void addToProject | ( | ) |
void removeFromProject | ( | ) |
|
noexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
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 |
the filepath of the schematic *.lp file (from the ctor)
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |