GraphTool  1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Member Functions | List of all members
GraphScene Class Reference

#include <graph_scene.h>

Inheritance diagram for GraphScene:
Inheritance graph
[legend]
Collaboration diagram for GraphScene:
Collaboration graph
[legend]

Public Member Functions

 GraphScene (GraphModel *graph, QObject *parent=0)
 
virtual ~GraphScene ()
 
void set_model (GraphModel *model)
 
GraphModelmodel ()
 
void set_node_label_column (int column_idx)
 
void set_xy_columns (int x_idx, int y_idx)
 
void set_color_column (int color)
 
void populateScene ()
 
NodeWidgetget_node_widget (std::string item_name)
 
NodeWidgetget_node_widget (QString item_name)
 
NodeWidgetget_node_widget (QModelIndex item_index)
 
NodeWidgetadd_node_widget (QModelIndex item_index)
 
void del_node_widget (QModelIndex item_index)
 
int nodes ()
 
std::vector< std::string > get_names_of_all_nodes ()
 

Detailed Description

GraphScene inherits QGraphicsScene and is used to render all nodes and edges as a graph

See Also
http://qt-project.org/doc/qt-4.8/qgraphicsscene.html

Constructor & Destructor Documentation

GraphScene::GraphScene ( GraphModel graph,
QObject *  parent = 0 
)

Constructor for the GraphScene

Parameters
graphThe model to be used by the graph
parentThe parent QGraphicsView for this GraphScene, default is null
GraphScene::~GraphScene ( )
virtual

Default destructor for the GraphScene

Member Function Documentation

NodeWidget * GraphScene::add_node_widget ( QModelIndex  item_index)

Add a widget belonging to a specific itemindex

Parameters
item_indexThe index of the item to be added
Returns
A reference to the widget for the newly added index
void GraphScene::del_node_widget ( QModelIndex  item_index)

Remove a specifc widget belonging to a specific itemindex

Parameters
item_indexThe index of the item to be removed
std::vector< std::string > GraphScene::get_names_of_all_nodes ( )

The names of all nodes added to the scene

Returns
A vector of all the names of the nodes added to the scene
NodeWidget * GraphScene::get_node_widget ( std::string  item_name)

Get the widget belonging to a specific node

Parameters
item_nameThe name of the widget
Returns
A reference to the widget for the requested node
NodeWidget * GraphScene::get_node_widget ( QString  item_name)

Get the widget belonging to a specific item

Parameters
item_nameThe name of the item
Returns
A reference to the widget for the requested item
NodeWidget * GraphScene::get_node_widget ( QModelIndex  item_index)

Get the widget belonging to a specific itemindex

Parameters
item_indexThe index of the item
Returns
A reference to the widget for the requested item
GraphModel * GraphScene::model ( )

Get the model used by the GraphScene

Returns
The model used by the GraphScene
int GraphScene::nodes ( )

The number of nodes added to the scene

Returns
The number of nodes added to the scene
void GraphScene::populateScene ( )

Method for populating the GraphScene with items(rendering them) from the model set for the GraphScene

void GraphScene::set_color_column ( int  color)

Set the index for the color column for the nodes

Parameters
colorThe color column index for the nodes
void GraphScene::set_model ( GraphModel model)

Set the model to be used for the GraphScene

Parameters
modelThe model to be used for the GraphScene
void GraphScene::set_node_label_column ( int  column_idx)

Set index for the label column for the node

Parameters
column_idxThe label column for the node
void GraphScene::set_xy_columns ( int  x_idx,
int  y_idx 
)

Set the indexes for the the x and y columns for the nodes

Parameters
x_idxThe x column index for the nodes
y_idxThe y column index for the nodes

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