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

The SI_NetSegment class. More...

#include <si_netsegment.h>

+ Inheritance diagram for SI_NetSegment:
+ Collaboration diagram for SI_NetSegment:

Public Member Functions

 SI_NetSegment ()=delete
 
 SI_NetSegment (const SI_NetSegment &other)=delete
 
 SI_NetSegment (Schematic &schematic, const SExpression &node)
 
 SI_NetSegment (Schematic &schematic, NetSignal &signal)
 
 ~SI_NetSegment () noexcept
 
const UuidgetUuid () const noexcept
 
NetSignalgetNetSignal () const noexcept
 
bool isUsed () const noexcept
 
int getNetPointsAtScenePos (const Point &pos, QList< SI_NetPoint * > &points) const noexcept
 
int getNetLinesAtScenePos (const Point &pos, QList< SI_NetLine * > &lines) const noexcept
 
int getNetLabelsAtScenePos (const Point &pos, QList< SI_NetLabel * > &labels) const noexcept
 
QSet< QString > getForcedNetNames () const noexcept
 
QString getForcedNetName () const noexcept
 
Point calcNearestPoint (const Point &p) const noexcept
 
QSet< SI_SymbolPin * > getAllConnectedPins () const noexcept
 
void setNetSignal (NetSignal &netsignal)
 
const QList< SI_NetPoint * > & getNetPoints () const noexcept
 
SI_NetPointgetNetPointByUuid (const Uuid &uuid) const noexcept
 
const QList< SI_NetLine * > & getNetLines () const noexcept
 
SI_NetLinegetNetLineByUuid (const Uuid &uuid) const noexcept
 
void addNetPointsAndNetLines (const QList< SI_NetPoint * > &netpoints, const QList< SI_NetLine * > &netlines)
 
void removeNetPointsAndNetLines (const QList< SI_NetPoint * > &netpoints, const QList< SI_NetLine * > &netlines)
 
const QList< SI_NetLabel * > & getNetLabels () const noexcept
 
SI_NetLabelgetNetLabelByUuid (const Uuid &uuid) const noexcept
 
void addNetLabel (SI_NetLabel &netlabel)
 
void removeNetLabel (SI_NetLabel &netlabel)
 
void updateAllNetLabelAnchors () noexcept
 
void addToSchematic () override
 
void removeFromSchematic () 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
 
QPainterPath getGrabAreaScenePx () const noexceptoverride
 
bool isSelected () const noexceptoverride
 
void setSelected (bool selected) noexceptoverride
 
SI_NetSegmentoperator= (const SI_NetSegment &rhs)=delete
 
bool operator== (const SI_NetSegment &rhs) noexcept
 
bool operator!= (const SI_NetSegment &rhs) noexcept
 
- Public Member Functions inherited from SI_Base
 SI_Base ()=delete
 
 SI_Base (const SI_Base &other)=delete
 
 SI_Base (Schematic &schematic) noexcept
 
virtual ~SI_Base () noexcept
 
ProjectgetProject () const noexcept
 
CircuitgetCircuit () const noexcept
 
SchematicgetSchematic () const noexcept
 
virtual bool isAddedToSchematic () const noexcept
 
SI_Baseoperator= (const SI_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 SI_NetLineAnchor &p, QSet< const SI_SymbolPin * > &pins, QSet< const SI_NetPoint * > &points) const noexcept
 

Private Attributes

Uuid mUuid
 
NetSignalmNetSignal
 
QList< SI_NetPoint * > mNetPoints
 
QList< SI_NetLine * > mNetLines
 
QList< SI_NetLabel * > mNetLabels
 

Additional Inherited Members

- Public Types inherited from SI_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 SI_Base
void addToSchematic (SGI_Base *item) noexcept
 
void removeFromSchematic (SGI_Base *item) noexcept
 
- Protected Attributes inherited from SI_Base
SchematicmSchematic
 

Detailed Description

The SI_NetSegment class.

Todo:
Do not allow to create empty netsegments!

Constructor & Destructor Documentation

SI_NetSegment ( )
delete
SI_NetSegment ( const SI_NetSegment other)
delete
SI_NetSegment ( Schematic schematic,
const SExpression node 
)

+ Here is the call graph for this function:

SI_NetSegment ( Schematic schematic,
NetSignal signal 
)
~SI_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 getNetPointsAtScenePos ( const Point pos,
QList< SI_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,
QList< SI_NetLine * > &  lines 
) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int getNetLabelsAtScenePos ( const Point pos,
QList< SI_NetLabel * > &  labels 
) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QSet< QString > getForcedNetNames ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QString getForcedNetName ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Point calcNearestPoint ( const Point p) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QSet< SI_SymbolPin * > getAllConnectedPins ( ) 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<SI_NetPoint*>& getNetPoints ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

SI_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<SI_NetLine*>& getNetLines ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

SI_NetLine * getNetLineByUuid ( const Uuid uuid) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void addNetPointsAndNetLines ( const QList< SI_NetPoint * > &  netpoints,
const QList< SI_NetLine * > &  netlines 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void removeNetPointsAndNetLines ( const QList< SI_NetPoint * > &  netpoints,
const QList< SI_NetLine * > &  netlines 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const QList<SI_NetLabel*>& getNetLabels ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

SI_NetLabel * getNetLabelByUuid ( const Uuid uuid) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void addNetLabel ( SI_NetLabel netlabel)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void removeNetLabel ( SI_NetLabel netlabel)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void updateAllNetLabelAnchors ( )
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void addToSchematic ( )
overridevirtual

Implements SI_Base.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void removeFromSchematic ( )
overridevirtual

Implements SI_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 SI_Base.

const Point& getPosition ( ) const
inlineoverridevirtualnoexcept

Implements SI_Base.

QPainterPath getGrabAreaScenePx ( ) const
overridevirtualnoexcept

Implements SI_Base.

bool isSelected ( ) const
overridevirtualnoexcept

Reimplemented from SI_Base.

+ Here is the call graph for this function:

void setSelected ( bool  selected)
overridevirtualnoexcept

Reimplemented from SI_Base.

+ Here is the call graph for this function:

SI_NetSegment& operator= ( const SI_NetSegment rhs)
delete
bool operator== ( const SI_NetSegment rhs)
inlinenoexcept
bool operator!= ( const SI_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 SI_NetLineAnchor p,
QSet< const SI_SymbolPin * > &  pins,
QSet< const SI_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<SI_NetPoint*> mNetPoints
private
QList<SI_NetLine*> mNetLines
private
QList<SI_NetLabel*> mNetLabels
private

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