DisplayGraphNode Class Reference

Display Information for a Graph Node. More...

#include <DisplayGraphNode.h>

Inheritance diagram for DisplayGraphNode:

Inheritance graph
[legend]
List of all members.

Public Types

 DisplayNodeType = UserType + 1
enum  { DisplayNodeType = UserType + 1 }
 Each user defined QGraphicsItem needs a unique constant. More...

Public Member Functions

 DisplayGraphNode (QGraphicsScene *sc=NULL)
 DisplayGraphNode (const QString &caption, QGraphicsScene *scene=NULL)
virtual ~DisplayGraphNode ()
const QList< DisplayEdge * > & getInEdges () const
const QList< DisplayEdge * > & getOutEdges () const
int outEdgeCount () const
int inEdgeCount () const
DisplayEdgegetInEdge (int id)
DisplayEdgegetOutEdge (int id)
void addOutEdge (DisplayNode *to)
void addInEdge (DisplayNode *from)
void deleteAllEdges ()
virtual void setScene (QGraphicsScene *scene)
 Overwritten to set scene of edges.
bool isAdjacentTo (DisplayGraphNode *otherNode) const
int getId () const
void setId (int newId)
virtual const QString & getDisplayName ()
 Display Name is the String which is printed in the node.
virtual void setDisplayName (const QString &n)
virtual void setBgColor (const QColor &c)
 Background color, when not selected.
virtual void setBgColorSelected (const QColor &c)
virtual QColor getBgColor () const
virtual QColor getBgColorSelected () const
virtual SgNode * getSgNode ()
 Returns the Sage Node which corresponds to this DisplayNode.
virtual void setSgNode (SgNode *sgNode)
virtual QRectF boundingRect () const
 Functions required by QGraphicsScene.
virtual QPainterPath shape () const
virtual int type () const
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 Custom Paint Event.
virtual bool isMouseHold () const

Static Public Member Functions

static void addEdge (DisplayEdge *edge)
 Node takes ownership of this edge.

Protected Member Functions

void deleteOutEdge (DisplayEdge *e)
void removeInEdge (DisplayEdge *e)
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value)
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
void init ()

Protected Attributes

QList< DisplayEdge * > inEdges
QList< DisplayEdge * > outEdges
int id
QGraphicsScene * scene
QString caption
 Text which is rendered inside of node.
SgNode * sg
QFont textFont
 The font used for drawing the caption.
QColor bgColor
 Background color if node is not selected.
QColor bgColorSelected
 Background color when node is selected.
bool mouseHold
 True when a mouse button is pressed over this node.

Detailed Description

Display Information for a Graph Node.

This class currently is used to display CallGraphs Every node is responsible for deleting it's outgoing edges, so that a graph can be cleaned up in a clean way without double free's

Definition at line 12 of file DisplayGraphNode.h.


Member Enumeration Documentation

anonymous enum [inherited]

Each user defined QGraphicsItem needs a unique constant.

Enumerator:
DisplayNodeType 

Definition at line 24 of file DisplayNode.h.


Constructor & Destructor Documentation

DisplayGraphNode::DisplayGraphNode ( QGraphicsScene *  sc = NULL  ) 

Definition at line 25 of file DisplayGraphNode.cpp.

DisplayGraphNode::DisplayGraphNode ( const QString &  caption,
QGraphicsScene *  scene = NULL 
)

Definition at line 30 of file DisplayGraphNode.cpp.

DisplayGraphNode::~DisplayGraphNode (  )  [virtual]

Definition at line 37 of file DisplayGraphNode.cpp.


Member Function Documentation

void DisplayGraphNode::addEdge ( DisplayEdge edge  )  [static]

Node takes ownership of this edge.

Definition at line 97 of file DisplayGraphNode.cpp.

Referenced by DisplayGraph::addEdge().

Here is the call graph for this function:

Here is the caller graph for this function:

void DisplayGraphNode::addInEdge ( DisplayNode from  ) 

Definition at line 89 of file DisplayGraphNode.cpp.

void DisplayGraphNode::addOutEdge ( DisplayNode to  ) 

Definition at line 81 of file DisplayGraphNode.cpp.

QRectF DisplayNode::boundingRect (  )  const [virtual, inherited]

Functions required by QGraphicsScene.

Definition at line 61 of file DisplayNode.cpp.

Referenced by DisplayEdge::adjust(), TreeLayoutGenerator::ExtremeInfo::merge(), DisplayNode::paint(), DisplayNode::shape(), and DisplayGraph::springBasedLayoutIteration().

Here is the caller graph for this function:

void DisplayGraphNode::deleteAllEdges (  ) 

Definition at line 43 of file DisplayGraphNode.cpp.

Referenced by DisplayGraph::deleteNode().

Here is the call graph for this function:

Here is the caller graph for this function:

void DisplayGraphNode::deleteOutEdge ( DisplayEdge e  )  [protected]

Definition at line 62 of file DisplayGraphNode.cpp.

Referenced by deleteAllEdges().

Here is the caller graph for this function:

virtual QColor DisplayNode::getBgColor (  )  const [inline, virtual, inherited]

Definition at line 42 of file DisplayNode.h.

virtual QColor DisplayNode::getBgColorSelected (  )  const [inline, virtual, inherited]

Definition at line 43 of file DisplayNode.h.

virtual const QString& DisplayNode::getDisplayName (  )  [inline, virtual, inherited]

Display Name is the String which is printed in the node.

Definition at line 34 of file DisplayNode.h.

int DisplayGraphNode::getId (  )  const [inline]

Definition at line 45 of file DisplayGraphNode.h.

Referenced by DisplayGraph::springBasedLayoutIteration().

Here is the caller graph for this function:

DisplayEdge* DisplayGraphNode::getInEdge ( int  id  )  [inline]

Definition at line 27 of file DisplayGraphNode.h.

const QList<DisplayEdge *>& DisplayGraphNode::getInEdges (  )  const [inline]

Definition at line 21 of file DisplayGraphNode.h.

DisplayEdge* DisplayGraphNode::getOutEdge ( int  id  )  [inline]

Definition at line 28 of file DisplayGraphNode.h.

const QList<DisplayEdge *>& DisplayGraphNode::getOutEdges (  )  const [inline]

Definition at line 22 of file DisplayGraphNode.h.

virtual SgNode* DisplayNode::getSgNode (  )  [inline, virtual, inherited]

Returns the Sage Node which corresponds to this DisplayNode.

Definition at line 47 of file DisplayNode.h.

Referenced by DisplayCallGraph::deleteNode(), RoseGraphicsView::mouseMoveEvent(), and RoseGraphicsView::mousePressEvent().

Here is the caller graph for this function:

int DisplayGraphNode::inEdgeCount (  )  const [inline]

Definition at line 25 of file DisplayGraphNode.h.

void DisplayNode::init (  )  [protected, inherited]

Definition at line 31 of file DisplayNode.cpp.

Referenced by DisplayNode::DisplayNode().

Here is the call graph for this function:

Here is the caller graph for this function:

bool DisplayGraphNode::isAdjacentTo ( DisplayGraphNode otherNode  )  const

True if there is a incoming or outgoing edge to/from the other node has to search in two list -> rather slow

Definition at line 150 of file DisplayGraphNode.cpp.

Here is the call graph for this function:

virtual bool DisplayNode::isMouseHold (  )  const [inline, virtual, inherited]

Definition at line 67 of file DisplayNode.h.

QVariant DisplayGraphNode::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
) [protected, virtual]

Needed to listen on selection-changes node is drawn differently when selected)

Reimplemented from DisplayNode.

Definition at line 114 of file DisplayGraphNode.cpp.

Here is the call graph for this function:

void DisplayNode::mousePressEvent ( QGraphicsSceneMouseEvent *  event  )  [protected, virtual, inherited]

Definition at line 125 of file DisplayNode.cpp.

void DisplayNode::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event  )  [protected, virtual, inherited]

Definition at line 131 of file DisplayNode.cpp.

int DisplayGraphNode::outEdgeCount (  )  const [inline]

Definition at line 24 of file DisplayGraphNode.h.

void DisplayNode::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
) [virtual, inherited]

Custom Paint Event.

Definition at line 79 of file DisplayNode.cpp.

Here is the call graph for this function:

void DisplayGraphNode::removeInEdge ( DisplayEdge e  )  [protected]

Definition at line 72 of file DisplayGraphNode.cpp.

Referenced by deleteAllEdges().

Here is the caller graph for this function:

void DisplayNode::setBgColor ( const QColor &  c  )  [virtual, inherited]

Background color, when not selected.

Definition at line 48 of file DisplayNode.cpp.

Referenced by DisplayGraph::addGravityNode().

Here is the caller graph for this function:

void DisplayNode::setBgColorSelected ( const QColor &  c  )  [virtual, inherited]

Definition at line 54 of file DisplayNode.cpp.

virtual void DisplayNode::setDisplayName ( const QString &  n  )  [inline, virtual, inherited]

Definition at line 35 of file DisplayNode.h.

Referenced by DisplayTreeNode::addChild(), and DisplayTreeNode::mergeTrees().

Here is the caller graph for this function:

void DisplayGraphNode::setId ( int  newId  )  [inline]

Definition at line 46 of file DisplayGraphNode.h.

Referenced by DisplayGraph::addGravityNode(), and DisplayGraph::addNode().

Here is the caller graph for this function:

void DisplayGraphNode::setScene ( QGraphicsScene *  scene  )  [virtual]

Overwritten to set scene of edges.

Reimplemented from DisplayNode.

Definition at line 127 of file DisplayGraphNode.cpp.

Referenced by DisplayGraph::addNode().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void DisplayNode::setSgNode ( SgNode *  sgNode  )  [inline, virtual, inherited]

Definition at line 48 of file DisplayNode.h.

Referenced by DisplayCallGraph::addCgNode(), and DisplayTreeNode::addChild().

Here is the caller graph for this function:

QPainterPath DisplayNode::shape (  )  const [virtual, inherited]

Definition at line 71 of file DisplayNode.cpp.

Here is the call graph for this function:

virtual int DisplayNode::type (  )  const [inline, virtual, inherited]

Definition at line 53 of file DisplayNode.h.


Member Data Documentation

QColor DisplayNode::bgColor [protected, inherited]

Background color if node is not selected.

Definition at line 96 of file DisplayNode.h.

Referenced by DisplayNode::getBgColor(), DisplayNode::init(), DisplayNode::paint(), and DisplayNode::setBgColor().

QColor DisplayNode::bgColorSelected [protected, inherited]

Background color when node is selected.

Definition at line 98 of file DisplayNode.h.

Referenced by DisplayNode::getBgColorSelected(), DisplayNode::init(), DisplayNode::paint(), and DisplayNode::setBgColorSelected().

QString DisplayNode::caption [protected, inherited]

Text which is rendered inside of node.

Definition at line 86 of file DisplayNode.h.

Referenced by DisplayNode::boundingRect(), DisplayTreeGenerator::generateTree(), DisplayNode::paint(), and DisplayTreeNode::simplifyTree().

int DisplayGraphNode::id [protected]

Definition at line 59 of file DisplayGraphNode.h.

Referenced by getId().

QList<DisplayEdge *> DisplayGraphNode::inEdges [protected]

Definition at line 55 of file DisplayGraphNode.h.

Referenced by addInEdge(), deleteAllEdges(), getInEdge(), getInEdges(), inEdgeCount(), isAdjacentTo(), itemChange(), removeInEdge(), and setScene().

bool DisplayNode::mouseHold [protected, inherited]

True when a mouse button is pressed over this node.

Definition at line 101 of file DisplayNode.h.

Referenced by DisplayNode::init(), DisplayNode::isMouseHold(), DisplayNode::mousePressEvent(), and DisplayNode::mouseReleaseEvent().

QList<DisplayEdge *> DisplayGraphNode::outEdges [protected]

Definition at line 56 of file DisplayGraphNode.h.

Referenced by addEdge(), addInEdge(), addOutEdge(), deleteAllEdges(), deleteOutEdge(), getOutEdge(), getOutEdges(), isAdjacentTo(), itemChange(), outEdgeCount(), setScene(), and ~DisplayGraphNode().

QGraphicsScene* DisplayNode::scene [protected, inherited]

GraphicsScene where this node is rendered, or NULL if in no scene the scene takes ownership of nodes

Definition at line 83 of file DisplayNode.h.

Referenced by DisplayTreeNode::addChild(), addEdge(), addInEdge(), addOutEdge(), DisplayNode::init(), DisplayTreeNode::registerAdditionalEdge(), DisplayTreeNode::setScene(), DisplayNode::setScene(), and setScene().

SgNode* DisplayNode::sg [protected, inherited]

SgNode associated with this DisplayNode not used internally

Definition at line 90 of file DisplayNode.h.

Referenced by DisplayTreeGenerator::generateTree(), DisplayNode::getSgNode(), and DisplayNode::setSgNode().

QFont DisplayNode::textFont [protected, inherited]

The font used for drawing the caption.

Definition at line 93 of file DisplayNode.h.

Referenced by DisplayNode::boundingRect().


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