LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BI_NetSegment Class Referencefinal

The BI_NetSegment class. More...

#include <bi_netsegment.h>

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

Public Member Functions

 BI_NetSegment ()=delete
 
 BI_NetSegment (const BI_NetSegment &other)=delete
 
 BI_NetSegment (Board &board, const BI_NetSegment &other, const QHash< const BI_Device *, BI_Device * > &devMap)
 
 BI_NetSegment (Board &board, const SExpression &node)
 
 BI_NetSegment (Board &board, NetSignal &signal)
 
 ~BI_NetSegment () noexcept
 
const UuidgetUuid () const noexcept
 
NetSignalgetNetSignal () const noexcept
 
bool isUsed () const noexcept
 
int getViasAtScenePos (const Point &pos, QList< BI_Via * > &vias) const noexcept
 
int getNetPointsAtScenePos (const Point &pos, const GraphicsLayer *layer, QList< BI_NetPoint * > &points) const noexcept
 
int getNetLinesAtScenePos (const Point &pos, const GraphicsLayer *layer, QList< BI_NetLine * > &lines) const noexcept
 
void setNetSignal (NetSignal &netsignal)
 
const QList< BI_Via * > & getVias () const noexcept
 
BI_ViagetViaByUuid (const Uuid &uuid) const noexcept
 
const QList< BI_NetPoint * > & getNetPoints () const noexcept
 
BI_NetPointgetNetPointByUuid (const Uuid &uuid) const noexcept
 
const QList< BI_NetLine * > & getNetLines () const noexcept
 
BI_NetLinegetNetLineByUuid (const Uuid &uuid) 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 setSelectionRect (const QRectF rectPx) noexcept
 
void clearSelection () const noexcept
 
void serialize (SExpression &root) const override
 Serialize the object into an existing S-Expression node. More...
 
Type_t getType () const noexceptoverride
 
const PointgetPosition () const noexceptoverride
 
bool getIsMirrored () const noexceptoverride
 
QPainterPath getGrabAreaScenePx () const noexceptoverride
 
bool isSelectable () const noexceptoverride
 
bool isSelected () const noexceptoverride
 
void setSelected (bool selected) noexceptoverride
 
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
 
- Public Member Functions inherited from SerializableObject
 SerializableObject () noexcept
 
virtual ~SerializableObject () noexcept
 
SExpression serializeToDomElement (const QString &name) const
 Serialize the object to a new S-Expression node. More...
 

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
 
QList< BI_Via * > mVias
 
QList< BI_NetPoint * > mNetPoints
 
QList< BI_NetLine * > mNetLines
 

Additional Inherited Members

- Public Types inherited from BI_Base
enum  Type_t
 
- Static Public Member Functions inherited from SerializableObject
template<typename T >
static void serializeObjectContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainerUuidSorted (SExpression &root, const T &container, const QString &itemName)
 
- Protected Member Functions inherited from BI_Base
void addToBoard (QGraphicsItem *item) noexcept
 
void removeFromBoard (QGraphicsItem *item) noexcept
 
- Protected Attributes inherited from BI_Base
BoardmBoard
 

Detailed Description

The BI_NetSegment class.

Todo:
Do not allow to create empty netsegments!

Constructor & Destructor Documentation

BI_NetSegment ( )
delete
BI_NetSegment ( const BI_NetSegment other)
delete
BI_NetSegment ( Board board,
const BI_NetSegment other,
const QHash< const BI_Device *, BI_Device * > &  devMap 
)

+ Here is the call graph for this function:

BI_NetSegment ( Board board,
const SExpression node 
)

+ Here is the call graph for this function:

BI_NetSegment ( Board board,
NetSignal signal 
)
~BI_NetSegment ( )
noexcept

Member Function Documentation

const Uuid& getUuid ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

NetSignal& getNetSignal ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

bool isUsed ( ) const
noexcept

+ Here is the caller graph for this function:

int getViasAtScenePos ( const Point pos,
QList< BI_Via * > &  vias 
) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int getNetPointsAtScenePos ( const Point pos,
const GraphicsLayer layer,
QList< BI_NetPoint * > &  points 
) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int getNetLinesAtScenePos ( const Point pos,
const GraphicsLayer layer,
QList< BI_NetLine * > &  lines 
) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void setNetSignal ( NetSignal netsignal)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const QList<BI_Via*>& getVias ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

BI_Via * getViaByUuid ( const Uuid uuid) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const QList<BI_NetPoint*>& getNetPoints ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

BI_NetPoint * getNetPointByUuid ( const Uuid uuid) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const QList<BI_NetLine*>& getNetLines ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

BI_NetLine * getNetLineByUuid ( const Uuid uuid) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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:

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:

void addToBoard ( )
overridevirtual

Implements BI_Base.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void removeFromBoard ( )
overridevirtual

Implements BI_Base.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void setSelectionRect ( const QRectF  rectPx)
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void clearSelection ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize ( SExpression root) const
overridevirtual

Serialize the object into an existing S-Expression node.

This method inserts/appends all attributes and childs of the object to an existing S-Expression node. The content which already exists in the given S-Expression node will not be removed.

Note
The generated S-Expression node has always the format of the application's major version (it's not possible to generate DOMs of older versions).
Parameters
rootThe target DOM root node
Exceptions
ExceptionThis method throws an exception if an error occurs.

Implements SerializableObject.

+ Here is the call graph for this function:

Type_t getType ( ) const
inlineoverridevirtualnoexcept

Implements BI_Base.

const Point& getPosition ( ) const
inlineoverridevirtualnoexcept

Implements BI_Base.

bool getIsMirrored ( ) const
inlineoverridevirtualnoexcept

Implements BI_Base.

QPainterPath getGrabAreaScenePx ( ) const
overridevirtualnoexcept

Implements BI_Base.

bool isSelectable ( ) const
inlineoverridevirtualnoexcept

Implements BI_Base.

bool isSelected ( ) const
overridevirtualnoexcept

Reimplemented from BI_Base.

+ Here is the call graph for this function:

void setSelected ( bool  selected)
overridevirtualnoexcept

Reimplemented from BI_Base.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BI_NetSegment& operator= ( const BI_NetSegment rhs)
delete
bool operator== ( const BI_NetSegment rhs)
inlinenoexcept
bool operator!= ( const BI_NetSegment rhs)
inlinenoexcept
bool checkAttributesValidity ( ) const
privatenoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool areAllNetPointsConnectedTogether ( ) const
privatenoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Uuid mUuid
private
NetSignal* mNetSignal
private
QList<BI_Via*> mVias
private
QList<BI_NetPoint*> mNetPoints
private
QList<BI_NetLine*> mNetLines
private

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