GraphScene Class Reference

A scene of 2D graph nodes and edges. More...

#include <GraphScene.hh>

Inherits QGVScene.

Public Member Functions

 GraphScene (QWidget *_parent=0)
 Constructor. More...
 
virtual ~GraphScene ()=default
 Destructor. More...
 
QGVEdge * AddEdge (const std::string &_id, const std::string &_node1, const std::string &_node2)
 Add an edge to connect two nodes. More...
 
QGVNode * AddNode (const std::string &_name)
 Add a node to the scene. More...
 
QGVNode * GetNode (const std::string &_name)
 Get a node from the scene. More...
 
bool HasNode (const std::string &_name)
 Check if a node exists in the scene. More...
 
void RemoveEdge (const std::string &_id)
 Remove an edge between two nodes. More...
 
void RemoveNode (const std::string &_name)
 Remove a node from the scene. More...
 
void SetEdgeColor (const std::string &_id, const ignition::math::Color &_color)
 Set the color of an edge. More...
 

Detailed Description

A scene of 2D graph nodes and edges.

Constructor & Destructor Documentation

GraphScene ( QWidget *  _parent = 0)
explicit

Constructor.

Parameters
[in]_parentParent Widget.
virtual ~GraphScene ( )
virtualdefault

Destructor.

Member Function Documentation

QGVEdge* AddEdge ( const std::string &  _id,
const std::string &  _node1,
const std::string &  _node2 
)

Add an edge to connect two nodes.

Parameters
[in]_idEdge ID.
[in]_node1Name of the first node.
[in]_node2Name of the second node.
Returns
the Edge created.
QGVNode* AddNode ( const std::string &  _name)

Add a node to the scene.

Parameters
[in]_nameName of the node.
Returns
the Node created.
QGVNode* GetNode ( const std::string &  _name)

Get a node from the scene.

Parameters
[in]_nameName of the name.
Returns
Pointer to the node, NULL if it does not exist.
bool HasNode ( const std::string &  _name)

Check if a node exists in the scene.

Parameters
[in]_nameName of the node.
Returns
True if the node exists.
void RemoveEdge ( const std::string &  _id)

Remove an edge between two nodes.

Parameters
[in]_idEdge ID.
void RemoveNode ( const std::string &  _name)

Remove a node from the scene.

Parameters
[in]_nameName of the name.
void SetEdgeColor ( const std::string &  _id,
const ignition::math::Color &  _color 
)

Set the color of an edge.

Parameters
[in]_idEdge ID.
[in]_colorColor to set the edge to.

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