LibrePCB Developers Documentation
Loading...
Searching...
No Matches
Trace Class Referencefinal

The Trace class represents a trace within a board. More...

#include <trace.h>

+ Collaboration diagram for Trace:

Public Types

enum class  Event
 
typedef Slot< Trace, EventOnEditedSlot
 

Public Member Functions

 Trace ()=delete
 
 Trace (const Trace &other) noexcept
 
 Trace (const Uuid &uuid, const Trace &other) noexcept
 
 Trace (const Uuid &uuid, const Layer &layer, const PositiveLength &width, const TraceAnchor &a, const TraceAnchor &b) noexcept
 
 Trace (const SExpression &node)
 
 ~Trace () noexcept
 
const UuidgetUuid () const noexcept
 
const LayergetLayer () const noexcept
 
const PositiveLengthgetWidth () const noexcept
 
const TraceAnchorgetP1 () const noexcept
 
const TraceAnchorgetP2 () const noexcept
 
bool setUuid (const Uuid &uuid) noexcept
 
bool setLayer (const Layer &layer) noexcept
 
bool setWidth (const PositiveLength &width) noexcept
 
bool setAnchors (TraceAnchor a, TraceAnchor b) noexcept
 
void serialize (SExpression &root) const
 Serialize into librepcb::SExpression node.
 
bool operator== (const Trace &rhs) const noexcept
 
bool operator!= (const Trace &rhs) const noexcept
 
Traceoperator= (const Trace &rhs) noexcept
 

Public Attributes

Signal< Trace, EventonEdited
 

Static Private Member Functions

static void normalizeAnchors (TraceAnchor &start, TraceAnchor &end) noexcept
 

Private Attributes

Uuid mUuid
 
const LayermLayer
 
PositiveLength mWidth
 
TraceAnchor mP1
 
TraceAnchor mP2
 

Detailed Description

The Trace class represents a trace within a board.

The main purpose of this class is to serialize and deserialize traces.

Note
The order of anchors (P1 & P2) is deterministic (sorted) to ensure a canonical file format & behavior. The constructor and setAnchors() will automatically swap the passed anchors if needed.

Member Typedef Documentation

◆ OnEditedSlot

Member Enumeration Documentation

◆ Event

enum class Event
strong
Enumerator
UuidChanged 
LayerChanged 
WidthChanged 
AnchorsChanged 

Constructor & Destructor Documentation

◆ Trace() [1/5]

Trace ( )
delete

◆ Trace() [2/5]

Trace ( const Trace other)
noexcept

◆ Trace() [3/5]

Trace ( const Uuid uuid,
const Trace other 
)
noexcept

◆ Trace() [4/5]

Trace ( const Uuid uuid,
const Layer layer,
const PositiveLength width,
const TraceAnchor a,
const TraceAnchor b 
)
noexcept

◆ Trace() [5/5]

Trace ( const SExpression node)
explicit
+ Here is the call graph for this function:

◆ ~Trace()

~Trace ( )
noexcept

Member Function Documentation

◆ getUuid()

const Uuid & getUuid ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getLayer()

const Layer & getLayer ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getWidth()

const PositiveLength & getWidth ( ) const
inlinenoexcept

◆ getP1()

const TraceAnchor & getP1 ( ) const
inlinenoexcept

◆ getP2()

const TraceAnchor & getP2 ( ) const
inlinenoexcept

◆ setUuid()

bool setUuid ( const Uuid uuid)
noexcept

◆ setLayer()

bool setLayer ( const Layer layer)
noexcept
+ Here is the caller graph for this function:

◆ setWidth()

bool setWidth ( const PositiveLength width)
noexcept

◆ setAnchors()

bool setAnchors ( TraceAnchor  a,
TraceAnchor  b 
)
noexcept

◆ serialize()

void serialize ( SExpression root) const

Serialize into librepcb::SExpression node.

Parameters
rootRoot node to serialize into.
+ Here is the call graph for this function:

◆ operator==()

bool operator== ( const Trace rhs) const
noexcept

◆ operator!=()

bool operator!= ( const Trace rhs) const
inlinenoexcept

◆ operator=()

Trace & operator= ( const Trace rhs)
noexcept

◆ normalizeAnchors()

void normalizeAnchors ( TraceAnchor start,
TraceAnchor end 
)
staticprivatenoexcept
+ Here is the caller graph for this function:

Member Data Documentation

◆ onEdited

Signal<Trace, Event> onEdited

◆ mUuid

Uuid mUuid
private

◆ mLayer

const Layer* mLayer
private

◆ mWidth

PositiveLength mWidth
private

◆ mP1

TraceAnchor mP1
private

◆ mP2

TraceAnchor mP2
private

The documentation for this class was generated from the following files: