Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
Component Class Reference

Graphical component representation in schematic. More...

#include <component.h>

Inheritance diagram for Component:
Inheritance graph
[legend]
Collaboration diagram for Component:
Collaboration graph
[legend]

Public Types

enum  { Type = UserType + 1 }
 

Signals

void DoubleClicked (struct ComponentInfo)
 Emitted when component is double-clicked.
 

Public Member Functions

 Component (GraphWidget *graphWidget, ComponentType, double, QMap< QString, QString >, QString ID)
 Component class constructor (individual parameters)
 
 Component (GraphWidget *graphWidget, struct ComponentInfo)
 Construct component from ComponentInfo struct.
 
 ~Component ()
 Class destructor.
 
void addWire (Wire *Wire)
 Add wire connection to component.
 
QList< Wire * > Wires () const
 Get list of connected wires to this component.
 
int type () const
 
QRectF boundingRect () const
 Get component bounding rectangle.
 
QPainterPath shape () const
 Get component selection shape.
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 Paint component on scene.
 
QPoint getPortLocation (int)
 Get port location in component coordinates.
 
QString getID ()
 Get component identifier.
 
void setRotation (double R)
 Set component rotation angle.
 
void setParameters (QMap< QString, QString > val)
 Set component parameters.
 
QMap< QString, QString > getParameters ()
 Get component parameters.
 
void setComponentType (ComponentType CT)
 Set component type.
 
ComponentType getComponentType ()
 Get component type.
 
- Public Member Functions inherited from Symbol
 Symbol ()
 Class constructor.
 

Protected Member Functions

QVariant itemChange (GraphicsItemChange change, const QVariant &value)
 Handle item change events.
 
void mousePressEvent (QGraphicsSceneMouseEvent *event)
 Handle mouse press events.
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 Handle mouse release events.
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
 Handle double click events.
 

Detailed Description

Graphical component representation in schematic.

Schematic editor graphics widget.

Constructor & Destructor Documentation

◆ Component() [1/2]

Component::Component ( GraphWidget graphWidget,
ComponentType  comp,
double  Rot_,
QMap< QString, QString >  val,
QString  ID 
)

Component class constructor (individual parameters)

Parameters
graphWidgetParent graph widget
typeComponent type
rotationRotation angle in degrees
valParameter map
IDComponent identifier

◆ Component() [2/2]

Component::Component ( GraphWidget graphWidget,
struct ComponentInfo  CI 
)

Construct component from ComponentInfo struct.

Parameters
graphWidgetParent graph widget
CIComponent information structure

Member Function Documentation

◆ addWire()

void Component::addWire ( Wire Wire)
virtual

Add wire connection to component.

Parameters
WireWire to connect

Implements Symbol.

◆ boundingRect()

QRectF Component::boundingRect ( ) const
virtual

Get component bounding rectangle.

Returns
Bounding rectangle for painting

Implements Symbol.

◆ DoubleClicked

void Component::DoubleClicked ( struct ComponentInfo  )
signal

Emitted when component is double-clicked.

Parameters
CIComponent information

◆ getComponentType()

ComponentType Component::getComponentType ( )
inline

Get component type.

Returns
Component type

◆ getID()

QString Component::getID ( )
inline

Get component identifier.

Returns
Component ID string

◆ getParameters()

QMap< QString, QString > Component::getParameters ( )
inline

Get component parameters.

Returns
Parameter map

◆ getPortLocation()

QPoint Component::getPortLocation ( int  port_number)
virtual

Get port location in component coordinates.

Parameters
port_numberPort index
Returns
Port position

Implements Symbol.

◆ itemChange()

QVariant Component::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
protectedvirtual

Handle item change events.

Implements Symbol.

◆ mousePressEvent()

void Component::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
inlineprotectedvirtual

Handle mouse press events.

Implements Symbol.

◆ mouseReleaseEvent()

void Component::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
inlineprotectedvirtual

Handle mouse release events.

Implements Symbol.

◆ paint()

void Component::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
virtual

Paint component on scene.

Parameters
painterQPainter instance
optionStyle options
widgetTarget widget

Implements Symbol.

◆ setComponentType()

void Component::setComponentType ( ComponentType  CT)
inline

Set component type.

Parameters
CTComponent type

◆ setParameters()

void Component::setParameters ( QMap< QString, QString >  val)
inline

Set component parameters.

Parameters
valParameter map
Note
All the parameters are QString based, so they are stored as a QMap which relates two strings, keyed by the parameter name

◆ setRotation()

void Component::setRotation ( double  R)
inline

Set component rotation angle.

Parameters
RRotation in degrees

◆ shape()

QPainterPath Component::shape ( ) const
virtual

Get component selection shape.

Returns
Path defining selectable area

Implements Symbol.

◆ Wires()

QList< Wire * > Component::Wires ( ) const
inline

Get list of connected wires to this component.

Returns
List of wire pointers

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