#include <DisplayGraphNode.h>
Inheritance diagram for DisplayCallGraph:

Public Slots | |
| void | on_cmdStartTimer_clicked () |
| void | on_cmdStopTimer_clicked () |
| void | on_cmdReset_clicked () |
| void | on_timerEvent () |
Public Member Functions | |
| DisplayCallGraph (QGraphicsScene *sc, QObject *par=0) | |
| void | addCgEdge (int from, int to) |
| Adds an edge, uses callGraphNodeId's instead of displayGraphNodeIds. | |
| void | addCgNode (int callGraphNodeId, SgGraphNode *n=NULL) |
| void | addFunction (SgNode *node, int depth) |
| void | setCg (SgIncidenceDirectedGraph *cg_) |
| set the call graph pointer which is used when addFunction() is called | |
| void | clear () |
| virtual void | deleteNode (DisplayNode *n) |
| QList< DisplayGraphNode * > & | nodes () |
| void | addNode (DisplayGraphNode *n) |
| void | addEdge (int nodeId1, int nodeId2, const QString &label="") |
| void | addEdge (DisplayGraphNode *n1, DisplayGraphNode *n2, const QString &label="") |
| QWidget * | controlWidget () |
| int | addGravityNode () |
| void | addInvisibleEdge (int i1, int i2) |
| void | circleLayout () |
| good starting point for spring embedder | |
| bool | isAdjacentTo (DisplayGraphNode *n1, DisplayGraphNode *n2) const |
| void | setOptimalDistance (qreal dist) |
| void | setDelta (qreal newDelta) |
| qreal | springBasedLayoutIteration (qreal delta) |
Static Public Member Functions | |
| static DisplayGraph * | generateTestGraph (QGraphicsScene *sc, QObject *par=0) |
Protected Member Functions | |
| void | addElements (rose_graph_integer_node_hash_map &nodes, rose_graph_integer_edge_hash_multimap &edges) |
| qreal | getCosBetween (QPointF &a, QPointF &b) |
| qreal | getSinBetween (QPointF &a, QPointF &b) |
| QPointF | repulsiveForce (const QPointF &n1, const QPointF &n2, qreal optDist) |
| QPointF | attractiveForce (const QPointF &n1, const QPointF &n2, qreal optDist) |
| void | updateWidget () |
Static Protected Member Functions | |
| static void | generateCgSubGraph (SgIncidenceDirectedGraph *cg, int nodeId, rose_graph_integer_node_hash_map &nodeMapOut, rose_graph_integer_edge_hash_multimap &edgeMapOut, QSet< int > &visitedNodes, int curDepth) |
Protected Attributes | |
| QColor | colorNode |
| QColor | colorBorderNode |
| QMap< int, DisplayGraphNode * > | callToDisplayNodeMap |
| SgIncidenceDirectedGraph * | cg |
| QGraphicsScene * | scene |
| QVector< QPointF > | forcesList |
| Vector of forces, used in function repulsiveForce(). | |
| QVector< QPointF > | oldForcesList |
| qreal | curDelta |
| int | curIteration |
| Iteration counter. | |
| qreal | optimalDistance |
| QWidget * | uiWidget |
| Members for the Control Widget. | |
| Ui::LayoutControl * | ui |
| QTimer * | timer |
| QList< DisplayGraphNode * > | n |
| List of all nodes. | |
| QMultiMap< DisplayGraphNode *, DisplayGraphNode * > | edgeInfo |
Extends the DisplayGraph class to build display a CallGraph The class is written in a way that partial callgraphs can be displayed i.e. beginning from a node, all nodes are added with have a distance (measured in edges) nearer than a threshold
Definition at line 183 of file DisplayGraphNode.h.
| DisplayCallGraph::DisplayCallGraph | ( | QGraphicsScene * | sc, | |
| QObject * | par = 0 | |||
| ) |
Definition at line 502 of file DisplayGraphNode.cpp.
| void DisplayCallGraph::addCgEdge | ( | int | from, | |
| int | to | |||
| ) |
Adds an edge, uses callGraphNodeId's instead of displayGraphNodeIds.
Definition at line 537 of file DisplayGraphNode.cpp.
Referenced by addElements().
Here is the call graph for this function:

Here is the caller graph for this function:

| void DisplayCallGraph::addCgNode | ( | int | callGraphNodeId, | |
| SgGraphNode * | n = NULL | |||
| ) |
Definition at line 511 of file DisplayGraphNode.cpp.
Referenced by addElements().
Here is the call graph for this function:

Here is the caller graph for this function:

| void DisplayGraph::addEdge | ( | DisplayGraphNode * | n1, | |
| DisplayGraphNode * | n2, | |||
| const QString & | label = "" | |||
| ) | [inherited] |
| void DisplayGraph::addEdge | ( | int | nodeId1, | |
| int | nodeId2, | |||
| const QString & | label = "" | |||
| ) | [inherited] |
Definition at line 268 of file DisplayGraphNode.cpp.
Referenced by addCgEdge(), and DisplayGraph::addEdge().
Here is the call graph for this function:

Here is the caller graph for this function:

| void DisplayCallGraph::addElements | ( | rose_graph_integer_node_hash_map & | nodes, | |
| rose_graph_integer_edge_hash_multimap & | edges | |||
| ) | [protected] |
Definition at line 613 of file DisplayGraphNode.cpp.
Referenced by addFunction().
Here is the call graph for this function:

Here is the caller graph for this function:

| void DisplayCallGraph::addFunction | ( | SgNode * | node, | |
| int | depth | |||
| ) |
Adds a function-node from the call graph to the display graph and all connected nodes with distance <= depth if node is not a function declaration or definition the function does nothing
Definition at line 548 of file DisplayGraphNode.cpp.
Referenced by CallGraphWidget::updateGraph().
Here is the call graph for this function:

Here is the caller graph for this function:

| int DisplayGraph::addGravityNode | ( | ) | [inherited] |
Adds a node representing a center of gravity returns the index of the gravity node
Definition at line 299 of file DisplayGraphNode.cpp.
Here is the call graph for this function:

| void DisplayGraph::addInvisibleEdge | ( | int | i1, | |
| int | i2 | |||
| ) | [inherited] |
Definition at line 283 of file DisplayGraphNode.cpp.
Referenced by DisplayGraph::addEdge().
Here is the caller graph for this function:

| void DisplayGraph::addNode | ( | DisplayGraphNode * | n | ) | [inherited] |
Definition at line 291 of file DisplayGraphNode.cpp.
Referenced by addCgNode().
Here is the call graph for this function:

Here is the caller graph for this function:

| QPointF DisplayGraph::attractiveForce | ( | const QPointF & | n1, | |
| const QPointF & | n2, | |||
| qreal | optDist | |||
| ) | [protected, inherited] |
Definition at line 470 of file DisplayGraphNode.cpp.
Referenced by DisplayGraph::springBasedLayoutIteration().
Here is the caller graph for this function:

| void DisplayGraph::circleLayout | ( | ) | [inherited] |
good starting point for spring embedder
Definition at line 485 of file DisplayGraphNode.cpp.
Referenced by DisplayGraph::on_cmdReset_clicked().
| void DisplayCallGraph::clear | ( | ) |
Definition at line 579 of file DisplayGraphNode.cpp.
Referenced by setCg().
Here is the caller graph for this function:

| QWidget* DisplayGraph::controlWidget | ( | ) | [inline, inherited] |
Definition at line 96 of file DisplayGraphNode.h.
Referenced by CallGraphWidget::CallGraphWidget().
Here is the caller graph for this function:

| void DisplayCallGraph::deleteNode | ( | DisplayNode * | n | ) | [virtual] |
Reimplemented from DisplayGraph.
Definition at line 638 of file DisplayGraphNode.cpp.
Referenced by CallGraphWidget::mouseReleaseEvent().
Here is the call graph for this function:

Here is the caller graph for this function:

| void DisplayCallGraph::generateCgSubGraph | ( | SgIncidenceDirectedGraph * | cg, | |
| int | nodeId, | |||
| rose_graph_integer_node_hash_map & | nodeMapOut, | |||
| rose_graph_integer_edge_hash_multimap & | edgeMapOut, | |||
| QSet< int > & | visitedNodes, | |||
| int | curDepth | |||
| ) | [static, protected] |
Definition at line 653 of file DisplayGraphNode.cpp.
Referenced by addFunction().
Here is the call graph for this function:

Here is the caller graph for this function:

| static DisplayGraph* DisplayGraph::generateTestGraph | ( | QGraphicsScene * | sc, | |
| QObject * | par = 0 | |||
| ) | [static, inherited] |
| qreal DisplayGraph::getCosBetween | ( | QPointF & | a, | |
| QPointF & | b | |||
| ) | [protected, inherited] |
Definition at line 429 of file DisplayGraphNode.cpp.
| qreal DisplayGraph::getSinBetween | ( | QPointF & | a, | |
| QPointF & | b | |||
| ) | [protected, inherited] |
Definition at line 443 of file DisplayGraphNode.cpp.
| bool DisplayGraph::isAdjacentTo | ( | DisplayGraphNode * | n1, | |
| DisplayGraphNode * | n2 | |||
| ) | const [inherited] |
Definition at line 326 of file DisplayGraphNode.cpp.
| QList<DisplayGraphNode*>& DisplayGraph::nodes | ( | ) | [inline, inherited] |
Definition at line 90 of file DisplayGraphNode.h.
Referenced by generateCgSubGraph().
Here is the caller graph for this function:

| void DisplayGraph::on_cmdReset_clicked | ( | ) | [slot, inherited] |
| void DisplayGraph::on_cmdStartTimer_clicked | ( | ) | [slot, inherited] |
Definition at line 206 of file DisplayGraphNode.cpp.
Referenced by DisplayGraph::DisplayGraph(), and CallGraphWidget::updateGraph().
| void DisplayGraph::on_cmdStopTimer_clicked | ( | ) | [slot, inherited] |
| void DisplayGraph::on_timerEvent | ( | ) | [slot, inherited] |
| QPointF DisplayGraph::repulsiveForce | ( | const QPointF & | n1, | |
| const QPointF & | n2, | |||
| qreal | optDist | |||
| ) | [protected, inherited] |
Definition at line 456 of file DisplayGraphNode.cpp.
Referenced by DisplayGraph::springBasedLayoutIteration().
Here is the caller graph for this function:

| void DisplayCallGraph::setCg | ( | SgIncidenceDirectedGraph * | cg_ | ) |
set the call graph pointer which is used when addFunction() is called
Definition at line 587 of file DisplayGraphNode.cpp.
Referenced by CallGraphWidget::updateGraph().
Here is the call graph for this function:

Here is the caller graph for this function:

| void DisplayGraph::setDelta | ( | qreal | newDelta | ) | [inline, inherited] |
Definition at line 117 of file DisplayGraphNode.h.
| void DisplayGraph::setOptimalDistance | ( | qreal | dist | ) | [inline, inherited] |
Definition at line 116 of file DisplayGraphNode.h.
Referenced by CallGraphWidget::CallGraphWidget().
Here is the caller graph for this function:

| qreal DisplayGraph::springBasedLayoutIteration | ( | qreal | delta | ) | [inherited] |
Definition at line 334 of file DisplayGraphNode.cpp.
Referenced by DisplayGraph::on_timerEvent().
Here is the call graph for this function:

| void DisplayGraph::updateWidget | ( | ) | [protected, inherited] |
Definition at line 201 of file DisplayGraphNode.cpp.
Referenced by DisplayGraph::DisplayGraph(), DisplayGraph::on_cmdReset_clicked(), and DisplayGraph::on_timerEvent().
Here is the caller graph for this function:

QMap<int,DisplayGraphNode*> DisplayCallGraph::callToDisplayNodeMap [protected] |
Definition at line 222 of file DisplayGraphNode.h.
Referenced by addCgEdge(), addCgNode(), clear(), and deleteNode().
SgIncidenceDirectedGraph* DisplayCallGraph::cg [protected] |
Definition at line 224 of file DisplayGraphNode.h.
Referenced by addCgNode(), addElements(), addFunction(), clear(), and setCg().
QColor DisplayCallGraph::colorBorderNode [protected] |
QColor DisplayCallGraph::colorNode [protected] |
qreal DisplayGraph::curDelta [protected, inherited] |
The bigger the delta the more a force changes the position called curDelta, because it may be decremented each iteration
Definition at line 146 of file DisplayGraphNode.h.
Referenced by DisplayGraph::DisplayGraph(), DisplayGraph::on_cmdReset_clicked(), DisplayGraph::on_cmdStartTimer_clicked(), DisplayGraph::on_timerEvent(), and DisplayGraph::setDelta().
int DisplayGraph::curIteration [protected, inherited] |
Iteration counter.
Definition at line 149 of file DisplayGraphNode.h.
Referenced by DisplayGraph::on_cmdReset_clicked(), DisplayGraph::on_cmdStartTimer_clicked(), and DisplayGraph::on_timerEvent().
QMultiMap<DisplayGraphNode*, DisplayGraphNode *> DisplayGraph::edgeInfo [protected, inherited] |
Multimap of (undirected) edges, edges are stored in nodes too but with the multimap the lookup of adjacency info is faster and invisible edges are supported i.e. edges considered in layouter but not in display to keep this data structure consistent don't use DisplayGraphNode-pointer outside of this class
Definition at line 170 of file DisplayGraphNode.h.
Referenced by DisplayGraph::addEdge(), DisplayGraph::addInvisibleEdge(), clear(), DisplayGraph::deleteNode(), DisplayGraph::isAdjacentTo(), and DisplayGraph::springBasedLayoutIteration().
QVector<QPointF> DisplayGraph::forcesList [protected, inherited] |
Vector of forces, used in function repulsiveForce().
Definition at line 141 of file DisplayGraphNode.h.
Referenced by DisplayGraph::springBasedLayoutIteration().
QList<DisplayGraphNode * > DisplayGraph::n [protected, inherited] |
List of all nodes.
Definition at line 162 of file DisplayGraphNode.h.
Referenced by DisplayGraph::addEdge(), DisplayGraph::addGravityNode(), DisplayGraph::addInvisibleEdge(), DisplayGraph::addNode(), DisplayGraph::circleLayout(), clear(), deleteNode(), DisplayGraph::deleteNode(), DisplayGraph::nodes(), DisplayGraph::springBasedLayoutIteration(), and DisplayGraph::~DisplayGraph().
QVector<QPointF> DisplayGraph::oldForcesList [protected, inherited] |
Definition at line 142 of file DisplayGraphNode.h.
Referenced by DisplayGraph::springBasedLayoutIteration().
qreal DisplayGraph::optimalDistance [protected, inherited] |
Parameter for force calculation, optimal distance between two adjacent nodes
Definition at line 153 of file DisplayGraphNode.h.
Referenced by DisplayGraph::circleLayout(), DisplayGraph::DisplayGraph(), DisplayGraph::on_timerEvent(), DisplayGraph::setOptimalDistance(), and DisplayGraph::springBasedLayoutIteration().
QGraphicsScene* DisplayGraph::scene [protected, inherited] |
Definition at line 138 of file DisplayGraphNode.h.
Referenced by DisplayGraph::addGravityNode(), DisplayGraph::addNode(), and DisplayGraph::springBasedLayoutIteration().
QTimer* DisplayGraph::timer [protected, inherited] |
Definition at line 158 of file DisplayGraphNode.h.
Referenced by DisplayGraph::DisplayGraph(), DisplayGraph::on_cmdStartTimer_clicked(), DisplayGraph::on_cmdStopTimer_clicked(), and DisplayGraph::on_timerEvent().
Ui::LayoutControl* DisplayGraph::ui [protected, inherited] |
Definition at line 157 of file DisplayGraphNode.h.
Referenced by DisplayGraph::DisplayGraph(), DisplayGraph::on_cmdReset_clicked(), DisplayGraph::on_cmdStartTimer_clicked(), DisplayGraph::on_cmdStopTimer_clicked(), DisplayGraph::on_timerEvent(), DisplayGraph::springBasedLayoutIteration(), and DisplayGraph::~DisplayGraph().
QWidget* DisplayGraph::uiWidget [protected, inherited] |
Members for the Control Widget.
Definition at line 156 of file DisplayGraphNode.h.
Referenced by DisplayGraph::controlWidget(), and DisplayGraph::DisplayGraph().
1.4.7