20#ifndef LIBREPCB_CORE_TRACE_H
21#define LIBREPCB_CORE_TRACE_H
26#include "../qtcompat.h"
27#include "../serialization/serializableobjectlist.h"
28#include "../types/length.h"
56 return (
device == rhs.device) && (
pad == rhs.pad);
71 const tl::optional<PadAnchor>&
tryGetPad() const noexcept {
return mPad; }
85 return !(*
this == rhs);
96 const tl::optional<PadAnchor>&
pad)
noexcept;
114 Q_DECLARE_TR_FUNCTIONS(
Trace)
178 static constexpr const char*
tagname =
"trace";
191 s += anchor->toStr();
193 if (tl::optional<Uuid> anchor = key.
tryGetVia()) {
194 s += anchor->toStr();
196 if (tl::optional<TraceAnchor::PadAnchor> anchor = key.
tryGetPad()) {
197 s += anchor->device.toStr();
198 s += anchor->pad.toStr();
200 Q_ASSERT(!s.isEmpty());
The Layer class provides all supported geometry layers.
Definition: layer.h:42
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 TraceAnchor class.
Definition: trace.h:46
const tl::optional< Uuid > & tryGetJunction() const noexcept
Definition: trace.h:67
tl::optional< PadAnchor > mPad
Definition: trace.h:101
~TraceAnchor() noexcept
Definition: trace.cpp:60
bool operator!=(const TraceAnchor &rhs) const noexcept
Definition: trace.h:84
bool operator==(const TraceAnchor &rhs) const noexcept
Definition: trace.cpp:76
const tl::optional< PadAnchor > & tryGetPad() const noexcept
Definition: trace.h:71
static TraceAnchor pad(const Uuid &device, const Uuid &pad) noexcept
Definition: trace.cpp:96
tl::optional< Uuid > mVia
Definition: trace.h:100
static TraceAnchor via(const Uuid &via) noexcept
Definition: trace.cpp:92
static TraceAnchor junction(const Uuid &junction) noexcept
Definition: trace.cpp:88
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition: trace.cpp:63
TraceAnchor & operator=(const TraceAnchor &rhs) noexcept
Definition: trace.cpp:81
const tl::optional< Uuid > & tryGetVia() const noexcept
Definition: trace.h:70
tl::optional< Uuid > mJunction
Definition: trace.h:99
The Trace class represents a trace within a board.
Definition: trace.h:113
Signal< Trace, Event > onEdited
Definition: trace.h:125
const TraceAnchor & getStartPoint() const noexcept
Definition: trace.h:141
const PositiveLength & getWidth() const noexcept
Definition: trace.h:140
bool setEndPoint(const TraceAnchor &end) noexcept
Definition: trace.cpp:183
Uuid mUuid
Definition: trace.h:166
Event
Definition: trace.h:118
~Trace() noexcept
Definition: trace.cpp:136
bool operator!=(const Trace &rhs) const noexcept
Definition: trace.h:162
const Layer & getLayer() const noexcept
Definition: trace.h:139
bool operator==(const Trace &rhs) const noexcept
Definition: trace.cpp:212
const TraceAnchor & getEndPoint() const noexcept
Definition: trace.h:142
bool setLayer(const Layer &layer) noexcept
Definition: trace.cpp:153
Trace & operator=(const Trace &rhs) noexcept
Definition: trace.cpp:221
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition: trace.cpp:197
Slot< Trace, Event > OnEditedSlot
Definition: trace.h:126
const Uuid & getUuid() const noexcept
Definition: trace.h:138
bool setWidth(const PositiveLength &width) noexcept
Definition: trace.cpp:163
const Layer * mLayer
Definition: trace.h:167
TraceAnchor mStart
Definition: trace.h:169
bool setUuid(const Uuid &uuid) noexcept
Definition: trace.cpp:143
PositiveLength mWidth
Definition: trace.h:168
bool setStartPoint(const TraceAnchor &start) noexcept
Definition: trace.cpp:173
TraceAnchor mEnd
Definition: trace.h:170
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
QtCompat::Hash qHash(const AttributeKey &key, QtCompat::Hash seed=0) noexcept
Definition: attributekey.h:119
QtCompat::Hash qHash(const TraceAnchor &key, QtCompat::Hash seed=0) noexcept
Definition: trace.h:187
Uuid device
Definition: trace.h:52
bool operator==(const PadAnchor &rhs) const noexcept
Definition: trace.h:55
Uuid pad
Definition: trace.h:53
static constexpr const char * tagname
Definition: trace.h:178