LibrePCB Developers Documentation
BI_NetSegment Class Referencefinal

The BI_NetSegment class. More...

#include <bi_netsegment.h>

+ Inheritance diagram for BI_NetSegment:
+ Collaboration diagram for BI_NetSegment:

Signals

void elementsAdded (const QList< BI_Via *> &vias, const QList< BI_NetPoint *> &netPoints, const QList< BI_NetLine *> &netLines)
 
void elementsRemoved (const QList< BI_Via *> &vias, const QList< BI_NetPoint *> &netPoints, const QList< BI_NetLine *> &netLines)
 

Public Member Functions

 BI_NetSegment ()=delete
 
 BI_NetSegment (const BI_NetSegment &other)=delete
 
 BI_NetSegment (Board &board, const Uuid &uuid, NetSignal *signal)
 
 ~BI_NetSegment () noexcept
 
const UuidgetUuid () const noexcept
 
NetSignalgetNetSignal () const noexcept
 
QString getNetNameToDisplay (bool fallback=false) const noexcept
 
bool isUsed () const noexcept
 
void setNetSignal (NetSignal *netsignal)
 
const QMap< Uuid, BI_Via * > & getVias () const noexcept
 
const QMap< Uuid, BI_NetPoint * > & getNetPoints () const noexcept
 
const QMap< Uuid, BI_NetLine * > & getNetLines () const noexcept
 
void addElements (const QList< BI_Via *> &vias, const QList< BI_NetPoint *> &netpoints, const QList< BI_NetLine *> &netlines)
 
void removeElements (const QList< BI_Via *> &vias, const QList< BI_NetPoint *> &netpoints, const QList< BI_NetLine *> &netlines)
 
void addToBoard () override
 
void removeFromBoard () override
 
void serialize (SExpression &root) const
 Serialize into librepcb::SExpression node. More...
 
BI_NetSegmentoperator= (const BI_NetSegment &rhs)=delete
 
bool operator== (const BI_NetSegment &rhs) noexcept
 
bool operator!= (const BI_NetSegment &rhs) noexcept
 
- Public Member Functions inherited from BI_Base
 BI_Base ()=delete
 
 BI_Base (const BI_Base &other)=delete
 
 BI_Base (Board &board) noexcept
 
virtual ~BI_Base () noexcept
 
ProjectgetProject () const noexcept
 
CircuitgetCircuit () const noexcept
 
BoardgetBoard () const noexcept
 
virtual bool isAddedToBoard () const noexcept
 
BI_Baseoperator= (const BI_Base &rhs)=delete
 

Private Member Functions

bool checkAttributesValidity () const noexcept
 
bool areAllNetPointsConnectedTogether () const noexcept
 
void findAllConnectedNetPoints (const BI_NetLineAnchor &p, QSet< const BI_Via *> &vias, QSet< const BI_FootprintPad *> &pads, QSet< const BI_NetPoint *> &points) const noexcept
 

Private Attributes

Uuid mUuid
 
NetSignalmNetSignal
 
QMap< Uuid, BI_Via * > mVias
 
QMap< Uuid, BI_NetPoint * > mNetPoints
 
QMap< Uuid, BI_NetLine * > mNetLines
 

Additional Inherited Members

- Protected Attributes inherited from BI_Base
BoardmBoard
 

Detailed Description

The BI_NetSegment class.

Constructor & Destructor Documentation

◆ BI_NetSegment() [1/3]

BI_NetSegment ( )
delete

◆ BI_NetSegment() [2/3]

BI_NetSegment ( const BI_NetSegment other)
delete

◆ BI_NetSegment() [3/3]

BI_NetSegment ( Board board,
const Uuid uuid,
NetSignal signal 
)

◆ ~BI_NetSegment()

~BI_NetSegment ( )
noexcept

Member Function Documentation

◆ getUuid()

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

◆ getNetSignal()

NetSignal* getNetSignal ( ) const
inlinenoexcept

Get the net signal this segment belongs to

Note
If the net segment is not connected to any net (which is allowed), nullptr is returned.
Returns
Pointer to the net signal (nullptr if unconnected)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNetNameToDisplay()

QString getNetNameToDisplay ( bool  fallback = false) const
noexcept

Get the net name to display

If connected to a net, the net name is returned. Otherwise a fallback string is returned (either an empty string, or something like "(no net)" in the user's locale). This is just for convenience to avoid implementing exactly the same logic in many different modules.

Parameters
fallbackIf the segment has no net, this determines whether an empty string should be returned (false, default) or something like "(no net)".
Returns
The net name or the fallback.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isUsed()

bool isUsed ( ) const
noexcept
+ Here is the caller graph for this function:

◆ setNetSignal()

void setNetSignal ( NetSignal netsignal)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getVias()

const QMap<Uuid, BI_Via*>& getVias ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getNetPoints()

const QMap<Uuid, BI_NetPoint*>& getNetPoints ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getNetLines()

const QMap<Uuid, BI_NetLine*>& getNetLines ( ) const
inlinenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addElements()

void addElements ( const QList< BI_Via *> &  vias,
const QList< BI_NetPoint *> &  netpoints,
const QList< BI_NetLine *> &  netlines 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeElements()

void removeElements ( const QList< BI_Via *> &  vias,
const QList< BI_NetPoint *> &  netpoints,
const QList< BI_NetLine *> &  netlines 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addToBoard()

void addToBoard ( )
overridevirtual

Reimplemented from BI_Base.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeFromBoard()

void removeFromBoard ( )
overridevirtual

Reimplemented from BI_Base.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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:
+ Here is the caller graph for this function:

◆ operator=()

BI_NetSegment& operator= ( const BI_NetSegment rhs)
delete
+ Here is the caller graph for this function:

◆ operator==()

bool operator== ( const BI_NetSegment rhs)
inlinenoexcept

◆ operator!=()

bool operator!= ( const BI_NetSegment rhs)
inlinenoexcept
+ Here is the call graph for this function:

◆ elementsAdded

void elementsAdded ( const QList< BI_Via *> &  vias,
const QList< BI_NetPoint *> &  netPoints,
const QList< BI_NetLine *> &  netLines 
)
signal
+ Here is the caller graph for this function:

◆ elementsRemoved

void elementsRemoved ( const QList< BI_Via *> &  vias,
const QList< BI_NetPoint *> &  netPoints,
const QList< BI_NetLine *> &  netLines 
)
signal
+ Here is the caller graph for this function:

◆ checkAttributesValidity()

bool checkAttributesValidity ( ) const
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ areAllNetPointsConnectedTogether()

bool areAllNetPointsConnectedTogether ( ) const
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findAllConnectedNetPoints()

void findAllConnectedNetPoints ( const BI_NetLineAnchor p,
QSet< const BI_Via *> &  vias,
QSet< const BI_FootprintPad *> &  pads,
QSet< const BI_NetPoint *> &  points 
) const
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ mUuid

Uuid mUuid
private

◆ mNetSignal

NetSignal* mNetSignal
private

The net signal this segment belongs to

This is nullptr if not connected!

◆ mVias

QMap<Uuid, BI_Via*> mVias
private

◆ mNetPoints

QMap<Uuid, BI_NetPoint*> mNetPoints
private

◆ mNetLines

QMap<Uuid, BI_NetLine*> mNetLines
private

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