#include <canvasmanipulator.h>
Inheritance diagram for ConnectorDraw:


Public Member Functions | |
| ConnectorDraw (ItemDocument *itemDocument, CMManager *cmManager) | |
| virtual | ~ConnectorDraw () |
Static Public Member Functions | |
| static QColor | validConnectionColor () |
Protected Member Functions | |
| Connector * | toConnector (Node *node) |
| void | grabEndStuff (QCanvasItem *endItem, const QPoint &pos, bool posIsExact) |
| QPoint | toValidPos (const QPoint &clickPos, Connector *clickedConnector) const |
Protected Attributes | |
| QGuardedPtr< Node > | p_startNode |
| QGuardedPtr< Connector > | p_startConnector |
| Node * | p_endNode |
| Connector * | p_endConnector |
| QPoint | startConnectorPoint |
Definition at line 274 of file canvasmanipulator.h.
| QColor ConnectorDraw::validConnectionColor | ( | ) | [static] |
Returns the colour used to indicate that the current connection being drawn is valid. Invalid colour is black.
Definition at line 457 of file canvasmanipulator.cpp.
Referenced by CMManualConnector::mouseMoved(), and CMAutoConnector::mouseMoved().
If the node has more than 2 connections, return one of the connectors
Definition at line 488 of file canvasmanipulator.cpp.
References Node::inputConnectorList(), Node::numCon(), and Node::outputConnectorList().
Referenced by grabEndStuff(), CMManualConnector::mousePressedInitial(), and CMAutoConnector::mousePressedInitial().
| void ConnectorDraw::grabEndStuff | ( | QCanvasItem * | endItem, | |
| const QPoint & | pos, | |||
| bool | posIsExact | |||
| ) | [protected] |
Converts the given qcanvasitem to an appropriate node or connector.
| posIsExact | if true, then only gets an appropriate node or connector when the to-be end-point of the new connector will coincide with pos (i.e. auto-connector will call this with posIsExact = false, and manual-connector will call this with posIsExact = true). |
Definition at line 503 of file canvasmanipulator.cpp.
References CNItem::getClosestNode(), Node::numCon(), p_endConnector, p_endNode, and toConnector().
Referenced by CMManualConnector::mouseReleased(), and CMAutoConnector::mouseReleased().
| QPoint ConnectorDraw::toValidPos | ( | const QPoint & | clickPos, | |
| Connector * | clickedConnector | |||
| ) | const [protected] |
Returns the closest point to the clickPos that is on the given connector.
Definition at line 470 of file canvasmanipulator.cpp.
References Connector::connectorPoints().
Referenced by CMManualConnector::mousePressedInitial(), and CMAutoConnector::mousePressedInitial().
1.5.1