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

The SI_Symbol class. More...

#include <si_symbol.h>

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

Signals

void attributesChanged () override
 This signal is emited when the value of attributes has changed. More...
 
- Signals inherited from AttributeProvider
virtual void attributesChanged ()=0
 This signal is emited 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 SExpression &node)
 
 SI_Symbol (Schematic &schematic, ComponentInstance &cmpInstance, const Uuid &symbolItem, const Point &position=Point(), const Angle &rotation=Angle(), bool mirrored=false)
 
 ~SI_Symbol () noexcept
 
const UuidgetUuid () 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 library::SymbolgetLibSymbol () const noexcept
 
const
library::ComponentSymbolVariantItem
getCompSymbVarItem () const noexcept
 
void setPosition (const Point &newPos) noexcept
 
void setRotation (const Angle &newRotation) noexcept
 
void setMirrored (bool newMirrored) noexcept
 
void addToSchematic () override
 
void removeFromSchematic () override
 
void serialize (SExpression &root) const override
 Serialize the object into an existing S-Expression node. More...
 
Point mapToScene (const Point &relativePos) const noexcept
 
QString getBuiltInAttributeValue (const QString &key) const noexceptoverride
 Get the value of a built-in attribute (if available) More...
 
QVector< const
AttributeProvider * > 
getAttributeProviderParents () const noexceptoverride
 Get all parent attribute providers (fallback if attribute not found) More...
 
Type_t getType () const noexceptoverride
 
const PointgetPosition () const noexceptoverride
 
QPainterPath getGrabAreaScenePx () const noexceptoverride
 
void setSelected (bool selected) noexceptoverride
 
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
 
virtual bool isSelected () 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...
 
- 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...
 

Private Slots

void schematicOrComponentAttributesChanged ()
 

Private Member Functions

void init (const Uuid &symbVarItemUuid)
 
void updateGraphicsItemTransform () noexcept
 
bool checkAttributesValidity () const noexcept
 

Private Attributes

ComponentInstancemComponentInstance
 
const
library::ComponentSymbolVariantItem
mSymbVarItem
 
const library::SymbolmSymbol
 
QHash< Uuid, SI_SymbolPin * > mPins
 key: symbol pin UUID More...
 
QScopedPointer< SGI_SymbolmGraphicsItem
 
Uuid mUuid
 
Point mPosition
 
Angle mRotation
 
bool mMirrored
 

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_Symbol class.

Author
ubruhin
Date
2014-08-23

Constructor & Destructor Documentation

SI_Symbol ( )
delete
SI_Symbol ( const SI_Symbol other)
delete
SI_Symbol ( Schematic schematic,
const SExpression node 
)
explicit

+ Here is the call graph for this function:

SI_Symbol ( Schematic schematic,
ComponentInstance cmpInstance,
const Uuid symbolItem,
const Point position = Point(),
const Angle rotation = Angle(),
bool  mirrored = false 
)
explicit

+ Here is the call graph for this function:

~SI_Symbol ( )
noexcept

Member Function Documentation

const Uuid& getUuid ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const Angle& getRotation ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

bool getMirrored ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

QString getName ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SI_SymbolPin* getPin ( const Uuid pinUuid) const
inlinenoexcept

+ Here is the caller graph for this function:

const QHash<Uuid, SI_SymbolPin*>& getPins ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

ComponentInstance& getComponentInstance ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const library::Symbol& getLibSymbol ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const library::ComponentSymbolVariantItem& getCompSymbVarItem ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

void setPosition ( const Point newPos)
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void setRotation ( const Angle newRotation)
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void setMirrored ( bool  newMirrored)
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 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:

Point mapToScene ( const Point relativePos) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

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.

Type_t getType ( ) const
inlineoverridevirtualnoexcept

Implements SI_Base.

const Point& getPosition ( ) const
inlineoverridevirtualnoexcept

Implements SI_Base.

+ Here is the caller graph for this function:

QPainterPath getGrabAreaScenePx ( ) const
overridevirtualnoexcept

Implements SI_Base.

+ Here is the caller graph for this function:

void setSelected ( bool  selected)
overridevirtualnoexcept

Reimplemented from SI_Base.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SI_Symbol& operator= ( const SI_Symbol rhs)
delete
void schematicOrComponentAttributesChanged ( )
privateslot

+ Here is the caller graph for this function:

void attributesChanged ( )
overridesignal

This signal is emited 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).

void init ( const Uuid symbVarItemUuid)
private

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void updateGraphicsItemTransform ( )
privatenoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool checkAttributesValidity ( ) const
privatenoexcept

+ Here is the caller graph for this function:

Member Data Documentation

ComponentInstance* mComponentInstance
private
const library::ComponentSymbolVariantItem* mSymbVarItem
private
const library::Symbol* mSymbol
private
QHash<Uuid, SI_SymbolPin*> mPins
private

key: symbol pin UUID

QScopedPointer<SGI_Symbol> mGraphicsItem
private
Uuid mUuid
private
Point mPosition
private
Angle mRotation
private
bool mMirrored
private

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