|
graph_analysis
|
An object containing a libgraph graph and its associated nodes and edges. More...
#include <GVGraph.hpp>
Public Member Functions | |
| GVGraph (const BaseGraph::Ptr &baseGraph, const std::string &name, double node_size=0) | |
| Construct a Graphviz graph object. More... | |
| ~GVGraph () | |
| int | setGraphAttribute (const std::string &name, const std::string &value) |
| std::string | getGraphAttribute (const std::string &name, const std::string &defaultValue=std::string()) const |
| void | setNodeAttribute (const std::string &name, const std::string &value) |
| void | setEdgeAttribute (const std::string &name, const std::string &value) |
| bool | setAttribute (const graph_analysis::Vertex::Ptr &vertex, const std::string &name, const std::string &value) |
| bool | setAttribute (const graph_analysis::Edge::Ptr &edge, const std::string &name, const std::string &value) |
| void | clear () |
| void | initializeFromBaseGraph () |
| Add and remove nodes. More... | |
| GraphElementId | addNode (const graph_analysis::Vertex::Ptr &vertex) |
| void | addNodes (const std::vector< Vertex::Ptr > &vertices) |
| void | removeNode (const graph_analysis::Vertex::Ptr &vertex) |
| void | removeNode (GraphElementId id) |
| void | clearNodes () |
| GraphElementId | addEdge (const Edge::Ptr &edge) |
| Add and remove edges. More... | |
| void | addEdges (const std::vector< Edge::Ptr > &edges) |
| void | removeEdge (const Edge::Ptr &edge) |
| void | removeEdge (GraphElementId id) |
| void | clearEdges () |
| void | setFont (const std::string &fontname, uint16_t fontsizeInPt) |
| Set the font to use in all the labels. More... | |
| void | applyLayout (const std::string &layout="dot") |
| void | renderToFile (const std::string &filename, const std::string &layout="dot", const std::string &renderer="dot", bool forced=false) |
| boxf | boundingRect () const |
| void | setRootNode (const Vertex::Ptr &vertex) |
| std::vector< GVNode > | nodes () const |
| std::vector< GVEdge > | edges () const |
| GraphElementId | getId (Agnode_t *node) const |
| GraphElementId | getId (Agedge_t *edge) const |
| std::string | getUniqueName (const Vertex::Ptr &vertex) const |
| std::string | getUniqueName (const Edge::Ptr &edge) const |
Static Public Member Functions | |
| static std::set< std::string > | getSupportedLayouts () |
Static Public Attributes | |
| static const double | DotDefaultDPI =72.0 |
| Default DPI value used by dot (which uses points instead of pixels for coordinates) More... | |
An object containing a libgraph graph and its associated nodes and edges.
The GVGraph (GV for graphviz) allows to compute the layout for a given graph – however after initialization the nodes and edges have to be added explicitely using
| graph_analysis::io::GVGraph::GVGraph | ( | const BaseGraph::Ptr & | baseGraph, |
| const std::string & | name, | ||
| double | node_size = 0 |
||
| ) |
Construct a Graphviz graph object.
| baseGraph | Pointer to the base graph to visualize |
| name | The name of the graph, must be unique in the application |
| node_size | The size in pixels of each node |
| graph_analysis::io::GVGraph::~GVGraph | ( | ) |
| GraphElementId graph_analysis::io::GVGraph::addEdge | ( | const Edge::Ptr & | edge | ) |
Add and remove edges.
| void graph_analysis::io::GVGraph::addEdges | ( | const std::vector< Edge::Ptr > & | edges | ) |
| GraphElementId graph_analysis::io::GVGraph::addNode | ( | const graph_analysis::Vertex::Ptr & | vertex | ) |
| void graph_analysis::io::GVGraph::addNodes | ( | const std::vector< Vertex::Ptr > & | vertices | ) |
| void graph_analysis::io::GVGraph::applyLayout | ( | const std::string & | layout = "dot" | ) |
Apply a layout to the graph layouts: circo, dot, fdp, neato, osage, sfdp, twopi
| boxf graph_analysis::io::GVGraph::boundingRect | ( | ) | const |
| void graph_analysis::io::GVGraph::clear | ( | ) |
| void graph_analysis::io::GVGraph::clearEdges | ( | ) |
| void graph_analysis::io::GVGraph::clearNodes | ( | ) |
| std::vector< GVEdge > graph_analysis::io::GVGraph::edges | ( | ) | const |
| std::string graph_analysis::io::GVGraph::getGraphAttribute | ( | const std::string & | name, |
| const std::string & | defaultValue = std::string() |
||
| ) | const |
Get the graphviz based graph attribute
| name | Name of attribute |
| defaultValue | The return value will be this if the attribute has not been set for the graph |
| GraphElementId graph_analysis::io::GVGraph::getId | ( | Agedge_t * | edge | ) | const |
| GraphElementId graph_analysis::io::GVGraph::getId | ( | Agnode_t * | node | ) | const |
|
inlinestatic |
| std::string graph_analysis::io::GVGraph::getUniqueName | ( | const Edge::Ptr & | edge | ) | const |
| std::string graph_analysis::io::GVGraph::getUniqueName | ( | const Vertex::Ptr & | vertex | ) | const |
| void graph_analysis::io::GVGraph::initializeFromBaseGraph | ( | ) |
Add and remove nodes.
| std::vector< GVNode > graph_analysis::io::GVGraph::nodes | ( | ) | const |
| void graph_analysis::io::GVGraph::removeEdge | ( | const Edge::Ptr & | edge | ) |
| void graph_analysis::io::GVGraph::removeEdge | ( | GraphElementId | id | ) |
| void graph_analysis::io::GVGraph::removeNode | ( | const graph_analysis::Vertex::Ptr & | vertex | ) |
| void graph_analysis::io::GVGraph::removeNode | ( | GraphElementId | id | ) |
| void graph_analysis::io::GVGraph::renderToFile | ( | const std::string & | filename, |
| const std::string & | layout = "dot", |
||
| const std::string & | renderer = "dot", |
||
| bool | forced = false |
||
| ) |
Render graph to file using a particular layout
| filename | Name of the output file |
| layout | define the layout of the graph: circo, dot, fdp, neato, osage, sfdp, twopi |
| renderer | define the output format for this file, e.g., dot, pdf, svn, png |
| forced | apply a relayouting |
| bool graph_analysis::io::GVGraph::setAttribute | ( | const graph_analysis::Edge::Ptr & | edge, |
| const std::string & | name, | ||
| const std::string & | value | ||
| ) |
Set the attribute for an edge
| bool graph_analysis::io::GVGraph::setAttribute | ( | const graph_analysis::Vertex::Ptr & | vertex, |
| const std::string & | name, | ||
| const std::string & | value | ||
| ) |
Set the attribute for a vertex
| void graph_analysis::io::GVGraph::setEdgeAttribute | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
Set a edge attribute by name
| name | Name of edge's attribute |
| value | Value to set |
| void graph_analysis::io::GVGraph::setFont | ( | const std::string & | fontname, |
| uint16_t | fontsizeInPt | ||
| ) |
Set the font to use in all the labels.
| int graph_analysis::io::GVGraph::setGraphAttribute | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
Set the graphviz based graph attribute by name and value
| name | Name of attribute |
| value | Value for this attribute |
| void graph_analysis::io::GVGraph::setNodeAttribute | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
Set a node attribute by name
| name | Name of node's attribute |
| value | Value to set |
| void graph_analysis::io::GVGraph::setRootNode | ( | const Vertex::Ptr & | vertex | ) |
|
static |
Default DPI value used by dot (which uses points instead of pixels for coordinates)
Dot uses a 72 DPI value for converting it's position coordinates from points to pixels while we display at 96 DPI on most operating systems.
1.8.17