20#ifndef LIBREPCB_CORE_NETLINE_H
21#define LIBREPCB_CORE_NETLINE_H
26#include "../qtcompat.h"
27#include "../serialization/serializableobjectlist.h"
28#include "../types/length.h"
54 return (
symbol == rhs.symbol) && (
pin == rhs.pin);
68 const tl::optional<PinAnchor>&
tryGetPin() const noexcept {
return mPin; }
82 return !(*
this == rhs);
92 const tl::optional<PinAnchor>&
pin)
noexcept;
96 tl::optional<PinAnchor>
mPin;
110 Q_DECLARE_TR_FUNCTIONS(
NetLine)
170 static constexpr const char*
tagname =
"line";
183 s += anchor->toStr();
185 if (tl::optional<NetLineAnchor::PinAnchor> anchor = key.
tryGetPin()) {
186 s += anchor->symbol.toStr();
187 s += anchor->pin.toStr();
189 Q_ASSERT(!s.isEmpty());
The NetLineAnchor class.
Definition: netline.h:44
const tl::optional< PinAnchor > & tryGetPin() const noexcept
Definition: netline.h:68
const tl::optional< Uuid > & tryGetJunction() const noexcept
Definition: netline.h:65
bool operator!=(const NetLineAnchor &rhs) const noexcept
Definition: netline.h:81
NetLineAnchor & operator=(const NetLineAnchor &rhs) noexcept
Definition: netline.cpp:73
static NetLineAnchor pin(const Uuid &symbol, const Uuid &pin) noexcept
Definition: netline.cpp:83
~NetLineAnchor() noexcept
Definition: netline.cpp:55
tl::optional< PinAnchor > mPin
Definition: netline.h:96
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition: netline.cpp:58
bool operator==(const NetLineAnchor &rhs) const noexcept
Definition: netline.cpp:69
tl::optional< Uuid > mJunction
Definition: netline.h:95
static NetLineAnchor junction(const Uuid &junction) noexcept
Definition: netline.cpp:79
The NetLine class represents a net line within a schematic.
Definition: netline.h:109
~NetLine() noexcept
Definition: netline.cpp:117
const NetLineAnchor & getEndPoint() const noexcept
Definition: netline.h:136
Signal< NetLine, Event > onEdited
Definition: netline.h:120
bool operator==(const NetLine &rhs) const noexcept
Definition: netline.cpp:182
bool setWidth(const UnsignedLength &width) noexcept
Definition: netline.cpp:134
Uuid mUuid
Definition: netline.h:159
bool operator!=(const NetLine &rhs) const noexcept
Definition: netline.h:155
Event
Definition: netline.h:114
NetLine & operator=(const NetLine &rhs) noexcept
Definition: netline.cpp:190
bool setEndPoint(const NetLineAnchor &end) noexcept
Definition: netline.cpp:154
UnsignedLength mWidth
Definition: netline.h:160
const UnsignedLength & getWidth() const noexcept
Definition: netline.h:134
NetLineAnchor mStart
Definition: netline.h:161
Slot< NetLine, Event > OnEditedSlot
Definition: netline.h:121
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition: netline.cpp:168
const Uuid & getUuid() const noexcept
Definition: netline.h:133
bool setStartPoint(const NetLineAnchor &start) noexcept
Definition: netline.cpp:144
const NetLineAnchor & getStartPoint() const noexcept
Definition: netline.h:135
bool setUuid(const Uuid &uuid) noexcept
Definition: netline.cpp:124
NetLineAnchor mEnd
Definition: netline.h:162
uint Hash
Return type of Qt's qHash() function.
Definition: qtcompat.h:58
The SExpression class.
Definition: sexpression.h:69
The Signal class is used to emit signals on non-QObject derived classes.
Definition: signalslot.h:65
The Slot class is used to receive signals from non-QObject derived classes.
Definition: signalslot.h:170
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
Definition: occmodel.cpp:77
QtCompat::Hash qHash(const NetLineAnchor &key, QtCompat::Hash seed=0) noexcept
Definition: netline.h:179
QtCompat::Hash qHash(const AttributeKey &key, QtCompat::Hash seed=0) noexcept
Definition: attributekey.h:119
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:696
Uuid pin
Definition: netline.h:51
Uuid symbol
Definition: netline.h:50
bool operator==(const PinAnchor &rhs) const noexcept
Definition: netline.h:53
Definition: netline.h:169
static constexpr const char * tagname
Definition: netline.h:170