DisplayEdge Class Reference

Display information for an edge. More...

#include <DisplayEdge.h>

List of all members.

Public Types

 EdgeType = UserType + 2
 STRAIGHT
 rendered as straight line between nodes
 RECTANGULAR
 edge is splitted up into two lines, which are parallel to x/y axis, (half of a rectangle)
 BEZIER_QUAD
 quadratic bezier curve
 BEZIER_CUBIC
 cubic bezier curve
enum  { EdgeType = UserType + 2 }
enum  PaintMode { STRAIGHT, RECTANGULAR, BEZIER_QUAD, BEZIER_CUBIC }

Public Member Functions

 DisplayEdge (DisplayNode *from, DisplayNode *to)
virtual ~DisplayEdge ()
DisplayNodesourceNode () const
DisplayNodedestNode () const
void adjust ()
 Call this function after the position of a node changed.
int type () const
void setColor (const QColor &c)
 Changes the edge color.
void setWidth (double width)
 Changes edge width.
void setPaintMode (PaintMode m)
 Changes the painting mode.
void setEdgeLabel (const QString &label)
const QString & getEdgeLabel () const

Protected Member Functions

void setSourceNode (DisplayNode *node)
void setDestNode (DisplayNode *node)
QRectF boundingRect () const
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)

Private Member Functions

bool intersectPolyWithLine (QPointF &res, const QPolygonF &poly, const QLineF &l)

Private Attributes

DisplayNodesource
DisplayNodedest
QPointF sourcePoint
QPointF destPoint
PaintMode paintMode
QString edgeLabel
double arrowSize
double penWidth
QColor color


Detailed Description

Display information for an edge.

used to render a edge, each edge has a source and destination node The nodes notifiy the edge when they have changed position Each edge may have a caption which is printed at the "center" of the edge

Definition at line 18 of file DisplayEdge.h.


Member Enumeration Documentation

anonymous enum

Each user defined QGraphicsItem needs a unique constant UserType+1 is the DisplayNode

Enumerator:
EdgeType 

Definition at line 32 of file DisplayEdge.h.

enum DisplayEdge::PaintMode

Enumerator:
STRAIGHT  rendered as straight line between nodes
RECTANGULAR  edge is splitted up into two lines, which are parallel to x/y axis, (half of a rectangle)
BEZIER_QUAD  quadratic bezier curve
BEZIER_CUBIC  cubic bezier curve

Definition at line 40 of file DisplayEdge.h.


Constructor & Destructor Documentation

DisplayEdge::DisplayEdge ( DisplayNode from,
DisplayNode to 
)

Definition at line 16 of file DisplayEdge.cpp.

Here is the call graph for this function:

virtual DisplayEdge::~DisplayEdge (  )  [inline, virtual]

Definition at line 22 of file DisplayEdge.h.


Member Function Documentation

void DisplayEdge::adjust (  ) 

Call this function after the position of a node changed.

Definition at line 29 of file DisplayEdge.cpp.

Referenced by DisplayEdge(), DisplayTreeNode::itemChange(), DisplayGraphNode::itemChange(), setDestNode(), and setSourceNode().

Here is the call graph for this function:

Here is the caller graph for this function:

QRectF DisplayEdge::boundingRect (  )  const [protected]

Definition at line 60 of file DisplayEdge.cpp.

DisplayNode* DisplayEdge::destNode (  )  const [inline]

Definition at line 25 of file DisplayEdge.h.

Referenced by DisplayGraphNode::addEdge(), DisplayGraphNode::deleteAllEdges(), and DisplayTreeNode::~DisplayTreeNode().

Here is the caller graph for this function:

const QString& DisplayEdge::getEdgeLabel (  )  const [inline]

Definition at line 51 of file DisplayEdge.h.

bool DisplayEdge::intersectPolyWithLine ( QPointF &  res,
const QPolygonF &  poly,
const QLineF &  l 
) [private]

Definition at line 151 of file DisplayEdge.cpp.

Referenced by adjust().

Here is the caller graph for this function:

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

Definition at line 91 of file DisplayEdge.cpp.

void DisplayEdge::setColor ( const QColor &  c  )  [inline]

Changes the edge color.

Definition at line 36 of file DisplayEdge.h.

Referenced by TreeLayoutGenerator::paintThreadTraversal().

Here is the caller graph for this function:

void DisplayEdge::setDestNode ( DisplayNode node  )  [inline, protected]

Definition at line 55 of file DisplayEdge.h.

Here is the call graph for this function:

void DisplayEdge::setEdgeLabel ( const QString &  label  ) 

Definition at line 84 of file DisplayEdge.cpp.

Referenced by DisplayGraph::addEdge(), and TreeLayoutGenerator::paintThreadTraversal().

Here is the caller graph for this function:

void DisplayEdge::setPaintMode ( PaintMode  m  )  [inline]

Changes the painting mode.

Definition at line 47 of file DisplayEdge.h.

Referenced by DisplayGraph::addEdge(), and TreeLayoutGenerator::paintThreadTraversal().

Here is the caller graph for this function:

void DisplayEdge::setSourceNode ( DisplayNode node  )  [inline, protected]

Definition at line 54 of file DisplayEdge.h.

Here is the call graph for this function:

void DisplayEdge::setWidth ( double  width  )  [inline]

Changes edge width.

Definition at line 38 of file DisplayEdge.h.

Referenced by TreeLayoutGenerator::paintThreadTraversal().

Here is the caller graph for this function:

DisplayNode* DisplayEdge::sourceNode (  )  const [inline]

Definition at line 24 of file DisplayEdge.h.

Referenced by DisplayGraphNode::addEdge(), DisplayGraphNode::deleteAllEdges(), DisplayTreeNode::getParent(), DisplayGraphNode::isAdjacentTo(), and DisplayTreeNode::~DisplayTreeNode().

Here is the caller graph for this function:

int DisplayEdge::type (  )  const [inline]

Definition at line 33 of file DisplayEdge.h.


Member Data Documentation

double DisplayEdge::arrowSize [private]

Definition at line 76 of file DisplayEdge.h.

Referenced by boundingRect(), and paint().

QColor DisplayEdge::color [private]

Definition at line 80 of file DisplayEdge.h.

Referenced by paint(), and setColor().

DisplayNode* DisplayEdge::dest [private]

Definition at line 67 of file DisplayEdge.h.

Referenced by adjust(), boundingRect(), destNode(), paint(), and setDestNode().

QPointF DisplayEdge::destPoint [private]

Definition at line 70 of file DisplayEdge.h.

Referenced by adjust(), boundingRect(), and paint().

QString DisplayEdge::edgeLabel [private]

Definition at line 74 of file DisplayEdge.h.

Referenced by boundingRect(), getEdgeLabel(), paint(), and setEdgeLabel().

PaintMode DisplayEdge::paintMode [private]

Definition at line 72 of file DisplayEdge.h.

Referenced by paint(), and setPaintMode().

double DisplayEdge::penWidth [private]

Definition at line 78 of file DisplayEdge.h.

Referenced by boundingRect(), paint(), and setWidth().

DisplayNode* DisplayEdge::source [private]

Definition at line 66 of file DisplayEdge.h.

Referenced by adjust(), boundingRect(), paint(), setSourceNode(), and sourceNode().

QPointF DisplayEdge::sourcePoint [private]

Definition at line 69 of file DisplayEdge.h.

Referenced by adjust(), boundingRect(), and paint().


The documentation for this class was generated from the following files:
Generated on Tue Sep 15 14:48:49 2009 for RoseQtWidgets by  doxygen 1.4.7