20#ifndef LIBREPCB_CORE_NETLINE_H
21#define LIBREPCB_CORE_NETLINE_H
26#include "../serialization/serializableobjectlist.h"
27#include "../types/length.h"
53 return (
symbol == rhs.symbol) && (
pin == rhs.pin);
67 const std::optional<PinAnchor>&
tryGetPin() const noexcept {
return mPin; }
81 return !(*
this == rhs);
91 const std::optional<PinAnchor>&
pin)
noexcept;
95 std::optional<PinAnchor>
mPin;
109 Q_DECLARE_TR_FUNCTIONS(
NetLine)
169 static constexpr const char*
tagname =
"line";
179 std::size_t seed = 0) noexcept {
182 s += anchor->toStr();
184 if (std::optional<NetLineAnchor::PinAnchor> anchor = key.
tryGetPin()) {
185 s += anchor->symbol.toStr();
186 s += anchor->pin.toStr();
188 Q_ASSERT(!s.isEmpty());
190 return ::qHash(s, seed);
The NetLineAnchor class.
Definition netline.h:43
bool operator!=(const NetLineAnchor &rhs) const noexcept
Definition netline.h:80
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
std::optional< Uuid > mJunction
Definition netline.h:94
const std::optional< PinAnchor > & tryGetPin() const noexcept
Definition netline.h:67
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
std::optional< PinAnchor > mPin
Definition netline.h:95
const std::optional< Uuid > & tryGetJunction() const noexcept
Definition netline.h:64
static NetLineAnchor junction(const Uuid &junction) noexcept
Definition netline.cpp:79
The NetLine class represents a net line within a schematic.
Definition netline.h:108
~NetLine() noexcept
Definition netline.cpp:117
const NetLineAnchor & getEndPoint() const noexcept
Definition netline.h:135
Signal< NetLine, Event > onEdited
Definition netline.h:119
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:158
bool operator!=(const NetLine &rhs) const noexcept
Definition netline.h:154
Event
Definition netline.h:113
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:159
const UnsignedLength & getWidth() const noexcept
Definition netline.h:133
NetLineAnchor mStart
Definition netline.h:160
Slot< NetLine, Event > OnEditedSlot
Definition netline.h:120
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition netline.cpp:168
const Uuid & getUuid() const noexcept
Definition netline.h:132
bool setStartPoint(const NetLineAnchor &start) noexcept
Definition netline.cpp:144
const NetLineAnchor & getStartPoint() const noexcept
Definition netline.h:134
bool setUuid(const Uuid &uuid) noexcept
Definition netline.cpp:124
NetLineAnchor mEnd
Definition netline.h:161
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:56
Definition occmodel.cpp:76
std::size_t qHash(const AttributeKey &key, std::size_t seed=0) noexcept
Definition attributekey.h:118
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition length.h:694
Uuid pin
Definition netline.h:50
Uuid symbol
Definition netline.h:49
bool operator==(const PinAnchor &rhs) const noexcept
Definition netline.h:52
static constexpr const char * tagname
Definition netline.h:169