ConnectorDraw Class Reference

#include <canvasmanipulator.h>

Inheritance diagram for ConnectorDraw:

Inheritance graph
[legend]
Collaboration diagram for ConnectorDraw:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ConnectorDraw (ItemDocument *itemDocument, CMManager *cmManager)
virtual ~ConnectorDraw ()

Static Public Member Functions

static QColor validConnectionColor ()

Protected Member Functions

ConnectortoConnector (Node *node)
void grabEndStuff (QCanvasItem *endItem, const QPoint &pos, bool posIsExact)
QPoint toValidPos (const QPoint &clickPos, Connector *clickedConnector) const

Protected Attributes

QGuardedPtr< Nodep_startNode
QGuardedPtr< Connectorp_startConnector
Nodep_endNode
Connectorp_endConnector
QPoint startConnectorPoint

Detailed Description

Author:
David Saxton

Definition at line 274 of file canvasmanipulator.h.


Member Function Documentation

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().

Connector * ConnectorDraw::toConnector ( Node node  )  [protected]

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.

Parameters:
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().


The documentation for this class was generated from the following files:
Generated on Tue May 8 17:05:37 2007 for KTechLab by  doxygen 1.5.1