OpenWalnut
1.5.0dev
|
This class represents the ports a module have. More...
#include <WQtNetworkOutputPort.h>
Public Types | |
enum | { Type = UserType + 12 } |
This customize the return value of type() More... | |
Public Member Functions | |
WQtNetworkOutputPort (std::shared_ptr< WModuleOutputConnector > connector) | |
Constructor. More... | |
~WQtNetworkOutputPort () | |
Destructor. More... | |
int | type () const |
Reimplementation from QGraphicsItem. More... | |
std::shared_ptr< WModuleOutputConnector > | getConnector () |
Returns the WModuleOutputConnecter 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< WModuleOutputConnector > | m_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... | |
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 WQtNetworkOutputPort.h.
anonymous enum |
This customize the return value of type()
Definition at line 58 of file WQtNetworkOutputPort.h.
|
explicit |
Constructor.
connector | a WModuleOutputConnector |
Definition at line 29 of file WQtNetworkOutputPort.cpp.
References WQtNetworkPort::getPortName(), WQtNetworkPort::isOutPort(), m_connector, WQtNetworkPort::setOutPort(), and WQtNetworkPort::setPortName().
WQtNetworkOutputPort::~WQtNetworkOutputPort | ( | ) |
Destructor.
Definition at line 60 of file WQtNetworkOutputPort.cpp.
std::shared_ptr< WModuleOutputConnector > WQtNetworkOutputPort::getConnector | ( | ) |
Returns the WModuleOutputConnecter that belongs to this object.
Definition at line 69 of file WQtNetworkOutputPort.cpp.
References m_connector.
Referenced by WQtNetworkArrow::doneDrag(), WQtNetworkEditor::event(), WQtNetworkArrow::findNearestCompatibleInput(), WQtNetworkArrow::mouseDoubleClickEvent(), and WQtNetworkPort::mouseDoubleClickEvent().
|
virtual |
Reimplementation from QGraphicsItem.
Implements WQtNetworkPort.
Definition at line 64 of file WQtNetworkOutputPort.cpp.
|
private |
the related WModuleInputConnector
Definition at line 76 of file WQtNetworkOutputPort.h.
Referenced by getConnector(), and WQtNetworkOutputPort().