Monitor
Public Types | Public Member Functions | Protected Member Functions
Edge Class Reference

#include <edge.h>

List of all members.

Public Types

enum  { Type = UserType + 2 }

Public Member Functions

 Edge (Node *sourceNode, Node *destNode, CommModel *comm, MainWindow *mw, bool highlight)
NodesourceNode () const
NodedestNode () const
void adjust ()
int type () const
bool tooShort ()

Protected Member Functions

QRectF boundingRect () const
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)

Detailed Description

Graphical representation of an link between two model nodes

Definition at line 58 of file edge.h.


Member Enumeration Documentation

anonymous enum

The user type

Definition at line 71 of file edge.h.


Constructor & Destructor Documentation

Edge::Edge ( Node sourceNode,
Node destNode,
CommModel *  comm,
MainWindow mw,
bool  highlight 
)

A graphical edge represents a link between two nodes

Parameters:
sourceNodesource node
destNodedestination node
commreference to the CommModel
mwthe main window
highlighttrue when the edge should be highlighted

Definition at line 59 of file edge.cpp.


Member Function Documentation

void Edge::adjust ( )

Adjusts the length of the line used to represent the edge

Definition at line 114 of file edge.cpp.

QRectF Edge::boundingRect ( ) const [protected]

Calculates the bounding rectangle box for this edge

Returns:
bouding rectangle

Definition at line 137 of file edge.cpp.

Node * Edge::destNode ( ) const

Returns the destination node of this edge

Returns:
destination node

Definition at line 106 of file edge.cpp.

void Edge::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
) [protected]

Uses a painter to draw this line

Parameters:
painterthe painter used

Definition at line 155 of file edge.cpp.

Node * Edge::sourceNode ( ) const

Returns the source node of this edge

Returns:
source node

Definition at line 97 of file edge.cpp.

bool Edge::tooShort ( )

Determines if two points are two close (less than 100 pixels apart)

Returns:
true if too close

Definition at line 82 of file edge.cpp.


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