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

The NetLine class represents a net line within a schematic. More...

#include <netline.h>

+ Collaboration diagram for NetLine:

Public Types

enum class  Event
 
typedef Slot< NetLine, EventOnEditedSlot
 

Public Member Functions

 NetLine ()=delete
 
 NetLine (const NetLine &other) noexcept
 
 NetLine (const Uuid &uuid, const NetLine &other) noexcept
 
 NetLine (const Uuid &uuid, const UnsignedLength &width, const NetLineAnchor &a, const NetLineAnchor &b) noexcept
 
 NetLine (const SExpression &node)
 
 ~NetLine () noexcept
 
const UuidgetUuid () const noexcept
 
const UnsignedLengthgetWidth () const noexcept
 
const NetLineAnchorgetP1 () const noexcept
 
const NetLineAnchorgetP2 () const noexcept
 
bool setUuid (const Uuid &uuid) noexcept
 
bool setWidth (const UnsignedLength &width) noexcept
 
bool setAnchors (NetLineAnchor a, NetLineAnchor b) noexcept
 
void serialize (SExpression &root) const
 Serialize into librepcb::SExpression node.
 
bool operator== (const NetLine &rhs) const noexcept
 
bool operator!= (const NetLine &rhs) const noexcept
 
NetLineoperator= (const NetLine &rhs) noexcept
 

Public Attributes

Signal< NetLine, EventonEdited
 

Static Private Member Functions

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

Private Attributes

Uuid mUuid
 
UnsignedLength mWidth
 
NetLineAnchor mP1
 
NetLineAnchor mP2
 

Detailed Description

The NetLine class represents a net line within a schematic.

The main purpose of this class is to serialize and deserialize schematic net lines.

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 
WidthChanged 
AnchorsChanged 

Constructor & Destructor Documentation

◆ NetLine() [1/5]

NetLine ( )
delete

◆ NetLine() [2/5]

NetLine ( const NetLine other)
noexcept

◆ NetLine() [3/5]

NetLine ( const Uuid uuid,
const NetLine other 
)
noexcept

◆ NetLine() [4/5]

NetLine ( const Uuid uuid,
const UnsignedLength width,
const NetLineAnchor a,
const NetLineAnchor b 
)
noexcept

◆ NetLine() [5/5]

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

◆ ~NetLine()

~NetLine ( )
noexcept

Member Function Documentation

◆ getUuid()

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

◆ getWidth()

const UnsignedLength & getWidth ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getP1()

const NetLineAnchor & getP1 ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getP2()

const NetLineAnchor & getP2 ( ) const
inlinenoexcept

◆ setUuid()

bool setUuid ( const Uuid uuid)
noexcept

◆ setWidth()

bool setWidth ( const UnsignedLength width)
noexcept

◆ setAnchors()

bool setAnchors ( NetLineAnchor  a,
NetLineAnchor  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 NetLine rhs) const
noexcept

◆ operator!=()

bool operator!= ( const NetLine rhs) const
inlinenoexcept

◆ operator=()

NetLine & operator= ( const NetLine rhs)
noexcept

◆ normalizeAnchors()

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

Member Data Documentation

◆ onEdited

Signal<NetLine, Event> onEdited

◆ mUuid

Uuid mUuid
private

◆ mWidth

UnsignedLength mWidth
private

◆ mP1

NetLineAnchor mP1
private

◆ mP2

NetLineAnchor mP2
private

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