Tulip  5.6.0
Large graphs analysis and drawing
Graph model

Classes

class  tlp::AbstractProperty< Tnode, Tedge, Tprop >
 
class  tlp::BooleanProperty
 
class  tlp::BooleanVectorProperty
 
class  tlp::ColorProperty
 
class  tlp::ColorVectorProperty
 
class  tlp::CoordVectorProperty
 
class  tlp::DoubleProperty
 
class  tlp::DoubleVectorProperty
 
struct  tlp::edge
 
class  tlp::Graph
 
class  tlp::GraphProperty
 
class  tlp::IntegerProperty
 
class  tlp::IntegerVectorProperty
 
class  tlp::LayoutProperty
 
struct  tlp::node
 
class  tlp::PropertyInterface
 
class  tlp::SizeProperty
 
class  tlp::SizeVectorProperty
 
class  tlp::StringProperty
 
class  tlp::StringVectorProperty
 
class  tlp::VectorPropertyInterface
 

Functions

void tlp::copyToGraph (Graph *outG, const Graph *inG, BooleanProperty *inSelection=nullptr, BooleanProperty *outSelection=nullptr)
 
bool tlp::exportGraph (Graph *graph, std::ostream &outputStream, const std::string &format, DataSet &dataSet, PluginProgress *progress=nullptr)
 
Iterator< Graph * > * tlp::getRootGraphs ()
 
Graphtlp::importGraph (const std::string &format, DataSet &dataSet, PluginProgress *progress=nullptr, Graph *newGraph=nullptr)
 
Graphtlp::loadGraph (const std::string &filename, tlp::PluginProgress *progress=nullptr)
 
Graphtlp::newGraph ()
 
void tlp::removeFromGraph (Graph *ioG, BooleanProperty *inSelection=nullptr)
 
bool tlp::saveGraph (Graph *graph, const std::string &filename, tlp::PluginProgress *progress=nullptr, tlp::DataSet *data=nullptr)
 

Detailed Description

Tulip graphs manipulation system Classes in this group are related to the core system of Graph manipulation.

Function Documentation

◆ copyToGraph()

void tlp::copyToGraph ( Graph outG,
const Graph inG,
BooleanProperty inSelection = nullptr,
BooleanProperty outSelection = nullptr 
)

Appends the selected part of the graph inG (properties, nodes and edges) into the graph outG. If no selection is done (inSel=nullptr), the whole inG graph is appended. The output selection is used to select the appended nodes & edges

Warning
The input selection is extended to all selected edge ends.

◆ exportGraph()

bool tlp::exportGraph ( Graph graph,
std::ostream &  outputStream,
const std::string &  format,
DataSet dataSet,
PluginProgress progress = nullptr 
)

Exports a graph using the specified export plugin with parameters stored in the DataSet.

You determine the destination, whether by using a fstream, or by saving the contents of the stream to the destination of your choice.

Parameters
graphThe graph to export.
outputStreamThe stream to export to. Can be a standard ostream, an ofstream, or even a gzipped ostream.
formatThe format to use to export the Graph.
dataSetParameters to pass to the export plugin (e.g. additional data, options for the format)
progressA PluginProgress to report the progress of the operation, as well as final state. Defaults to nullptr.
Returns
bool Whether the export was successful or not.

◆ getRootGraphs()

Iterator<Graph *>* tlp::getRootGraphs ( )

Gets an iterator over the root graphs. That is all the currently existing graphs which have been created using the tlp::newGraph, tlp::loadGraph or tlp::importGraph functions and are the root graphs of an existing graph hierarchy.

Returns
An iterator over all the root graphs. The caller of this function is responsible of the deletion of the returned iterator.

◆ importGraph()

Graph* tlp::importGraph ( const std::string &  format,
DataSet dataSet,
PluginProgress progress = nullptr,
Graph newGraph = nullptr 
)

Imports a graph using the specified import plugin with the parameters stored in the DataSet.

If no graph is passed, then a new graph will be created. You can pass a graph in order to import data into it. Returns the graph with imported data, or nullptr if the import failed. In this case, the Pluginprogress should have an error that can be displayed.

Parameters
formatThe format to use to import the graph.
dataSetThe parameters to pass to the import plugin (file to read, ...)
progressA PluginProgress to report the progress of the operation, as well as final state. Defaults to nullptr.
newGraphThe graph to import the data into. This can be useful to import data into a subgraph. Defaults to nullptr.
Returns
:Graph* The graph containing the imported data, or nullptr in case of failure.
Examples
clique_import/cliqueimport.cpp.

◆ loadGraph()

Graph* tlp::loadGraph ( const std::string &  filename,
tlp::PluginProgress progress = nullptr 
)

Loads a graph from a file (extension can be any of the Tulip supported input graph file format).

This function loads a graph serialized in a file trough the available Tulip import plugins. Since Tulip 4.8, the selection of the import plugin is based on the provided filename extension. The import will fail if the selected import plugin is not loaded. The graph file formats that can currently be imported are : TLP (*.tlp, *.tlp.gz, *.tlpz), TLP Binary (*.tlpb, *.tlpb.gz, *.tlpbz), TLP JSON (*.json), Gephi (*.gexf), Pajek (*.net, *.paj), GML (*.gml), Graphviz (*.dot) and UCINET (*.txt)

Before Tulip 4.8 and as a fallback, the function uses the "TLP Import" import plugin (always loaded as it is linked into the tulip-core library).

If the import fails (no such file, parse error, ...) nullptr is returned.

Parameters
filenamethe file in one of the supported formats to parse.
Returns
Graph* the imported Graph, nullptr if the import failed.
Examples
graph_display/graph_display.cpp.

◆ newGraph()

Graph* tlp::newGraph ( )

Creates a new, empty graph.

This is a simple method factory to create a Graph implementation (remember, Graph is only an interface).

This is the recommended way to create a new Graph.

Returns
:Graph* A new, empty graph.
Examples
graph_display/graph_display.cpp.

◆ removeFromGraph()

void tlp::removeFromGraph ( Graph ioG,
BooleanProperty inSelection = nullptr 
)

Removes the selected part of the graph ioG (properties values, nodes and edges). If no selection is done (inSel=nullptr), the whole graph is reset to default value.

Warning
The selection is extended to all selected edge ends.

◆ saveGraph()

bool tlp::saveGraph ( Graph graph,
const std::string &  filename,
tlp::PluginProgress progress = nullptr,
tlp::DataSet data = nullptr 
)

Saves the corresponding graph to a file (extension can be any of the Tulip supported output graph file format)..

This function serializes the corresponding graph and all its subgraphs (depending on the format) to a file through the available Tulip export plugins. Since Tulip 4.8, the selection of the export plugin is based on the provided filename extension. The export will fail if the selected export plugin is not loaded.

Before Tulip 4.8 and as a fallback, this function uses the "TLP Export" export plugin (always loaded as it is linked into the tulip-core library).

Parameters
graphthe graph to save.
filenamethe file to save the graph to.
progressPluginProgress to report the progress of the operation, as well as final state. Defaults to nullptr.
dataParameters to pass to the export plugin (e.g. additional data, options for the format)
Returns
bool whether the export was successful or not.