OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Private Attributes | List of all members
WQtNetworkInputPort Class Reference

This class represents the ports a module have. More...

#include <WQtNetworkInputPort.h>

+ Inheritance diagram for WQtNetworkInputPort:
+ Collaboration diagram for WQtNetworkInputPort:

Public Types

enum  { Type = UserType + 11 }
 This customize the return value of type() More...
 

Public Member Functions

 WQtNetworkInputPort (std::shared_ptr< WModuleInputConnector > connector)
 Constructor. More...
 
 ~WQtNetworkInputPort ()
 Destructor. More...
 
int type () const
 Reimplementation from QGraphicsItem. More...
 
std::shared_ptr< WModuleInputConnectorgetConnector ()
 Returns the WModuleInputConnecter that belongs to this object. More...
 
- Public Member Functions inherited from WQtNetworkPort
virtual void updateArrows ()
 The position of every arrow connected with this port is updating its position in the scene. More...
 
virtual void removeArrow (WQtNetworkArrow *arrow)
 Removes a specific arrow. More...
 
virtual void removeArrows ()
 Removes all connected arrows. More...
 
void alignPosition (int size, int portNumber, QRectF rect, bool outPort)
 Calculates the position inside a item for each port to get a correct alignment. More...
 
virtual void setOutPort (bool type)
 Set the type of the port. More...
 
virtual bool isOutPort ()
 Returns the porttype - true if outputport, false if inputport. More...
 
virtual QString getPortName ()
 Returns the portname. More...
 
virtual void setPortName (QString str)
 Set the Name. More...
 
virtual int getNumberOfArrows ()
 Return the number of connections. More...
 
virtual void addArrow (WQtNetworkArrow *arrow)
 Adds an arrow to the port. More...
 
virtual QList< WQtNetworkArrow * > getArrowList ()
 Get a QList of all arrows connected to this port. More...
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 Actually paints the port. More...
 

Private Attributes

std::shared_ptr< WModuleInputConnectorm_connector
 the related WModuleInputConnector More...
 

Additional Inherited Members

- Static Public Member Functions inherited from WQtNetworkPort
static float getMultiplePortWidth (size_t nbPorts)
 Calculates the spaced needed for the given amount of ports. More...
 
- Protected Member Functions inherited from WQtNetworkPort
void mousePressEvent (QGraphicsSceneMouseEvent *mouseEvent)
 Start drawing an arrow temporary. More...
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *mouseEvent)
 Double click on port. More...
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *mouseEvent)
 Updates the temporary arrows endpoint. More...
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *mouseEvent)
 Send a connect request to kernel when start- and endport are connectable. More...
 
- Protected Attributes inherited from WQtNetworkPort
QList< WQtNetworkArrow * > m_arrows
 the connected arrows More...
 
bool m_isOutPort
 is the port an outport More...
 
QString m_name
 the portname More...
 

Detailed Description

This class represents the ports a module have.

Two ports from different modules can be connected by the corresponding ports.

Definition at line 40 of file WQtNetworkInputPort.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

This customize the return value of type()

Definition at line 58 of file WQtNetworkInputPort.h.

Constructor & Destructor Documentation

◆ WQtNetworkInputPort()

WQtNetworkInputPort::WQtNetworkInputPort ( std::shared_ptr< WModuleInputConnector connector)
explicit

Constructor.

Parameters
connectorthe related WModuleInputConnector

Definition at line 29 of file WQtNetworkInputPort.cpp.

References WQtNetworkPort::getPortName(), WQtNetworkPort::isOutPort(), m_connector, WQtNetworkPort::setOutPort(), and WQtNetworkPort::setPortName().

+ Here is the call graph for this function:

◆ ~WQtNetworkInputPort()

WQtNetworkInputPort::~WQtNetworkInputPort ( )

Destructor.

Definition at line 60 of file WQtNetworkInputPort.cpp.

Member Function Documentation

◆ getConnector()

std::shared_ptr< WModuleInputConnector > WQtNetworkInputPort::getConnector ( )

Returns the WModuleInputConnecter that belongs to this object.

Returns
a WModuleInputConnector

Definition at line 69 of file WQtNetworkInputPort.cpp.

References m_connector.

Referenced by WQtNetworkArrow::doneDrag(), WQtNetworkEditor::event(), WQtNetworkArrow::findNearestCompatibleInput(), and WQtNetworkPort::mouseDoubleClickEvent().

+ Here is the caller graph for this function:

◆ type()

int WQtNetworkInputPort::type ( ) const
virtual

Reimplementation from QGraphicsItem.

Returns
the type of the item as int

Implements WQtNetworkPort.

Definition at line 64 of file WQtNetworkInputPort.cpp.

Member Data Documentation

◆ m_connector

std::shared_ptr<WModuleInputConnector> WQtNetworkInputPort::m_connector
private

the related WModuleInputConnector

Definition at line 76 of file WQtNetworkInputPort.h.

Referenced by getConnector(), and WQtNetworkInputPort().


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