LibrePCB Developers Documentation
SI_Symbol Class Referencefinal

The SI_Symbol class. More...

#include <si_symbol.h>

+ Inheritance diagram for SI_Symbol:
+ Collaboration diagram for SI_Symbol:

Public Types

enum  Event
 
typedef Slot< SI_Symbol, EventOnEditedSlot
 

Signals

void textAdded (SI_Text &text)
 
void textRemoved (SI_Text &text)
 
void attributesChanged () override
 This signal is emitted when the value of attributes has changed. More...
 
- Signals inherited from AttributeProvider
virtual void attributesChanged ()=0
 This signal is emitted when the value of attributes has changed. More...
 

Public Member Functions

 SI_Symbol ()=delete
 
 SI_Symbol (const SI_Symbol &other)=delete
 
 SI_Symbol (Schematic &schematic, const Uuid &uuid, ComponentInstance &cmpInstance, const Uuid &symbolItem, const Point &position, const Angle &rotation, bool mirrored, bool loadInitialTexts)
 
 ~SI_Symbol () noexcept
 
const UuidgetUuid () const noexcept
 
const PointgetPosition () const noexcept
 
const AnglegetRotation () const noexcept
 
bool getMirrored () const noexcept
 
QString getName () const noexcept
 
SI_SymbolPingetPin (const Uuid &pinUuid) const noexcept
 
const QHash< Uuid, SI_SymbolPin * > & getPins () const noexcept
 
ComponentInstancegetComponentInstance () const noexcept
 
const SymbolgetLibSymbol () const noexcept
 
const ComponentSymbolVariantItemgetCompSymbVarItem () const noexcept
 
void setPosition (const Point &newPos) noexcept
 
void setRotation (const Angle &newRotation) noexcept
 
void setMirrored (bool newMirrored) noexcept
 
TextList getDefaultTexts () const noexcept
 
const QMap< Uuid, SI_Text * > & getTexts () const noexcept
 
void addText (SI_Text &text)
 
void removeText (SI_Text &text)
 
void addToSchematic () override
 
void removeFromSchematic () override
 
void serialize (SExpression &root) const
 Serialize into librepcb::SExpression node. More...
 
QString getBuiltInAttributeValue (const QString &key) const noexcept override
 Get the value of a built-in attribute (if available) More...
 
QVector< const AttributeProvider * > getAttributeProviderParents () const noexcept override
 Get all parent attribute providers (fallback if attribute not found) More...
 
SI_Symboloperator= (const SI_Symbol &rhs)=delete
 
- 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 AttributeProvider
 AttributeProvider () noexcept
 
 AttributeProvider (const AttributeProvider &other)=delete
 
AttributeProvideroperator= (const AttributeProvider &rhs)=delete
 
virtual ~AttributeProvider () noexcept
 
QString getAttributeValue (const QString &key) const noexcept
 Get the value of an attribute which can be used in texts (like "{{NAME}}") More...
 
virtual QString getUserDefinedAttributeValue (const QString &key) const noexcept
 Get the value of a user defined attribute (if available) More...
 

Public Attributes

Signal< SI_Symbol, EventonEdited
 

Private Member Functions

bool checkAttributesValidity () const noexcept
 

Private Attributes

ComponentInstancemComponentInstance
 
const ComponentSymbolVariantItemmSymbVarItem
 
const SymbolmSymbol
 
QHash< Uuid, SI_SymbolPin * > mPins
 key: symbol pin UUID More...
 
QMap< Uuid, SI_Text * > mTexts
 key: text UUID More...
 
Uuid mUuid
 
Point mPosition
 
Angle mRotation
 
bool mMirrored
 

Additional Inherited Members

- Protected Attributes inherited from SI_Base
SchematicmSchematic
 

Detailed Description

The SI_Symbol class.

Member Typedef Documentation

◆ OnEditedSlot

Member Enumeration Documentation

◆ Event

enum Event
strong
Enumerator
PositionChanged 
RotationChanged 
MirroredChanged 

Constructor & Destructor Documentation

◆ SI_Symbol() [1/3]

SI_Symbol ( )
delete

◆ SI_Symbol() [2/3]

SI_Symbol ( const SI_Symbol other)
delete

◆ SI_Symbol() [3/3]

SI_Symbol ( Schematic schematic,
const Uuid uuid,
ComponentInstance cmpInstance,
const Uuid symbolItem,
const Point position,
const Angle rotation,
bool  mirrored,
bool  loadInitialTexts 
)
+ Here is the call graph for this function:

◆ ~SI_Symbol()

~SI_Symbol ( )
noexcept

Member Function Documentation

◆ getUuid()

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

◆ getPosition()

const Point& getPosition ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getRotation()

const Angle& getRotation ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getMirrored()

bool getMirrored ( ) const
inlinenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getName()

QString getName ( ) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPin()

SI_SymbolPin* getPin ( const Uuid pinUuid) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getPins()

const QHash<Uuid, SI_SymbolPin*>& getPins ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getComponentInstance()

ComponentInstance& getComponentInstance ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getLibSymbol()

const Symbol& getLibSymbol ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getCompSymbVarItem()

const ComponentSymbolVariantItem& getCompSymbVarItem ( ) const
inlinenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPosition()

void setPosition ( const Point newPos)
noexcept
+ Here is the caller graph for this function:

◆ setRotation()

void setRotation ( const Angle newRotation)
noexcept
+ Here is the caller graph for this function:

◆ setMirrored()

void setMirrored ( bool  newMirrored)
noexcept
+ Here is the caller graph for this function:

◆ getDefaultTexts()

TextList getDefaultTexts ( ) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTexts()

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

◆ addText()

void addText ( SI_Text text)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeText()

void removeText ( SI_Text text)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addToSchematic()

void addToSchematic ( )
overridevirtual

Reimplemented from SI_Base.

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

◆ removeFromSchematic()

void removeFromSchematic ( )
overridevirtual

Reimplemented from SI_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:

◆ getBuiltInAttributeValue()

QString getBuiltInAttributeValue ( const QString &  key) const
overridevirtualnoexcept

Get the value of a built-in attribute (if available)

Parameters
keyThe attribute name (e.g. "NAME" for "{{NAME}}")
Returns
The value of the attribute (empty string if not found)

Reimplemented from AttributeProvider.

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

◆ getAttributeProviderParents()

QVector< const AttributeProvider * > getAttributeProviderParents ( ) const
overridevirtualnoexcept

Get all parent attribute providers (fallback if attribute not found)

Returns
All parent attribute provider objects (empty and nullptr are allowed)

Reimplemented from AttributeProvider.

+ Here is the caller graph for this function:

◆ operator=()

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

◆ textAdded

void textAdded ( SI_Text text)
signal
+ Here is the caller graph for this function:

◆ textRemoved

void textRemoved ( SI_Text text)
signal
+ Here is the caller graph for this function:

◆ attributesChanged

void attributesChanged ( )
overridesignal

This signal is emitted when the value of attributes has changed.

All derived classes must emit this signal when some attributes have changed their values (only attributes which can be fetched with getAttributeValue(), inclusive all attributes from all "parent" classes).

+ Here is the caller graph for this function:

◆ checkAttributesValidity()

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

Member Data Documentation

◆ onEdited

Signal<SI_Symbol, Event> onEdited

◆ mComponentInstance

ComponentInstance& mComponentInstance
private

◆ mSymbVarItem

const ComponentSymbolVariantItem* mSymbVarItem
private

◆ mSymbol

const Symbol* mSymbol
private

◆ mPins

QHash<Uuid, SI_SymbolPin*> mPins
private

key: symbol pin UUID

◆ mTexts

QMap<Uuid, SI_Text*> mTexts
private

key: text UUID

◆ mUuid

Uuid mUuid
private

◆ mPosition

Point mPosition
private

◆ mRotation

Angle mRotation
private

◆ mMirrored

bool mMirrored
private

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