Classes
Functions
- tlp::Graph::Graph ()
- virtual tlp::Graph::~Graph ()
- bool tlp::Graph::applyAlgorithm (const std::string &algorithm, std::string &errorMessage, DataSet *dataSet=NULL, PluginProgress *progress=NULL)
- Applies an algorithm plugin, identified by its name. Algorithm plugins are subclasses of the tlp::Algorithm interface. Parameters are transmitted to the algorithm trough the DataSet. To determine a plugin's parameters, you can either:
- virtual void tlp::Graph::clear ()=0
- Removes all nodes, edges and sub-graphs of the supergraph.
- virtual Graph * tlp::Graph::addSubGraph (BooleanProperty *selection=NULL, unsigned int id=0, std::string name="unnamed")=0
- Creates and returns a new sub-graph of this graph.
- Graph * tlp::Graph::addSubGraph (std::string name)
- Creates and returns a new named sub-graph of this graph.
- Graph * tlp::Graph::addCloneSubGraph (std::string name="unnamed")
- Creates and returns a subgraph of this graph that contains all its elements.
- Graph * tlp::Graph::inducedSubGraph (const std::set< node > &nodeSet, Graph *parentSubGraph=NULL)
- virtual void tlp::Graph::delSubGraph (Graph *)=0
- virtual void tlp::Graph::delAllSubGraphs (Graph *)=0
- virtual Graph * tlp::Graph::getSuperGraph () const =0
- virtual Graph * tlp::Graph::getRoot () const =0
- virtual void tlp::Graph::setSuperGraph (Graph *)=0
- virtual Iterator< Graph * > * tlp::Graph::getSubGraphs () const =0
- virtual bool tlp::Graph::isSubGraph (const Graph *sg) const =0
- virtual bool tlp::Graph::isDescendantGraph (const Graph *sg) const =0
- virtual Graph * tlp::Graph::getSubGraph (unsigned int id) const =0
- virtual Graph * tlp::Graph::getSubGraph (const std::string &name) const =0
- virtual Graph * tlp::Graph::getDescendantGraph (unsigned int id) const =0
- virtual Graph * tlp::Graph::getDescendantGraph (const std::string &name) const =0
- virtual node tlp::Graph::addNode ()=0
- virtual void tlp::Graph::addNodes (unsigned int nbNodes, std::vector< node > &addedNodes)=0
- virtual void tlp::Graph::addNode (const node)=0
- virtual void tlp::Graph::addNodes (Iterator< node > *nodes)=0
- virtual void tlp::Graph::delNode (const node n, bool deleteInAllGraphs=false)=0
- virtual void tlp::Graph::delNodes (Iterator< node > *itN, bool deleteInAllGraphs=false)=0
- virtual edge tlp::Graph::addEdge (const node, const node)=0
- virtual void tlp::Graph::addEdges (const std::vector< std::pair< node, node > > &edges, std::vector< edge > &addedEdges)=0
- virtual void tlp::Graph::addEdge (const edge)=0
- virtual void tlp::Graph::addEdges (Iterator< edge > *edges)=0
- virtual void tlp::Graph::delEdge (const edge e, bool deleteInAllGraphs=false)=0
- virtual void tlp::Graph::delEdges (Iterator< edge > *itE, bool deleteInAllGraphs=false)=0
- virtual void tlp::Graph::setEdgeOrder (const node, const std::vector< edge > &)=0
- virtual void tlp::Graph::swapEdgeOrder (const node, const edge, const edge)=0
- virtual void tlp::Graph::setSource (const edge, const node)=0
- Sets the source of an existing edge.
- virtual void tlp::Graph::setTarget (const edge, const node)=0
- Sets the target of an existing edge.
- virtual void tlp::Graph::setEnds (const edge, const node source, const node target)=0
- Sets both the source and target of an existing edge.
- virtual void tlp::Graph::reverse (const edge)=0
- virtual void tlp::Graph::reserveNodes (unsigned int nbNodes)=0
- virtual void tlp::Graph::reserveEdges (unsigned int nbEdges)=0
- virtual tlp::node tlp::Graph::getSource () const
- Finds the first node whose input degree equals 0.
- virtual node tlp::Graph::getOneNode () const =0
- Returns an existing node of the graph.
- virtual Iterator< node > * tlp::Graph::getNodes () const =0
- Returns an iterator on the nodes.
- virtual node tlp::Graph::getInNode (const node, unsigned int) const =0
- Returns the ith predecessor of a node.
- virtual Iterator< node > * tlp::Graph::getInNodes (const node) const =0
- Returns an iterator on the predecessors of a node.
- virtual node tlp::Graph::getOutNode (const node, unsigned int) const =0
- Returns the ith successor of a node.
- virtual Iterator< node > * tlp::Graph::getOutNodes (const node) const =0
- Returns an iterator on the successors of a node.
- virtual Iterator< node > * tlp::Graph::getInOutNodes (const node) const =0
- Returns an iterator on the neighbours of a node.
- virtual Graph * tlp::Graph::getNodeMetaInfo (const node) const =0
- Returns the underlying graph of a meta node.
- virtual Iterator< edge > * tlp::Graph::getEdges () const =0
- Returns an iterator on the edges.
- virtual edge tlp::Graph::getOneEdge () const =0
- Returns an existing edge of the graph.
- virtual Iterator< edge > * tlp::Graph::getOutEdges (const node) const =0
- Returns an iterator on the outgoing edges of a node.
- virtual Iterator< edge > * tlp::Graph::getInOutEdges (const node) const =0
- Returns an iterator on the incoming and outgoing edges of a node.
- virtual Iterator< edge > * tlp::Graph::getInEdges (const node) const =0
- Returns an iterator on the incoming edges of a node.
- virtual Iterator< edge > * tlp::Graph::getEdgeMetaInfo (const edge) const =0
- Returns an iterator on the underlying edges of a meta edge.
- unsigned int tlp::Graph::getId () const
- Returns the graph's id. This id is unique.
- virtual unsigned int tlp::Graph::numberOfNodes () const =0
- Returns the number of nodes in the graph.
- virtual unsigned int tlp::Graph::numberOfEdges () const =0
- Returns the number of edges in the graph.
- virtual unsigned int tlp::Graph::deg (const node) const =0
- Returns the degree of a node.
- virtual unsigned int tlp::Graph::indeg (const node) const =0
- Returns the incoming degree of a node.
- virtual unsigned int tlp::Graph::outdeg (const node) const =0
- Returns the outgoing degree of a node.
- virtual node tlp::Graph::source (const edge) const =0
- Returns the source of the edge.
- virtual node tlp::Graph::target (const edge) const =0
- Returns the target of the edge.
- virtual const std::pair< node,
node > & tlp::Graph::ends (const edge) const =0
- virtual node tlp::Graph::opposite (const edge, const node) const =0
- Returns the opposite node for n in the edge e.
- virtual bool tlp::Graph::isElement (const node) const =0
- Returns true if the node is an element of the graph.
- virtual bool tlp::Graph::isMetaNode (const node) const =0
- Returns true if the node is a meta node.
- virtual bool tlp::Graph::isElement (const edge) const =0
- Returns true if the edge is an element of the graph.
- virtual bool tlp::Graph::isMetaEdge (const edge) const =0
- Returns true if the edge is a meta edge.
- virtual edge tlp::Graph::existEdge (const node source, const node target, bool directed=true) const =0
- const DataSet & tlp::Graph::getAttributes () const
- Returns graph attributes.
- template<typename ATTRIBUTETYPE > bool tlp::Graph::getAttribute (const std::string &name, ATTRIBUTETYPE &value) const
- template<typename ATTRIBUTETYPE > _DEPRECATED ATTRIBUTETYPE tlp::Graph::getAttribute (const std::string &name) const
- Deprecated version of the previous method.
- template<typename ATTRIBUTETYPE > void tlp::Graph::setAttribute (const std::string &name, const ATTRIBUTETYPE &value)
- Sets an attribute of the graph.
- void tlp::Graph::setAttribute (const std::string &name, const DataType *value)
- Sets attritute from an untyped value.
- void tlp::Graph::removeAttribute (const std::string &name)
- Removes an existing attribute.
- bool tlp::Graph::attributeExist (const std::string &name)
- Returns if the attribute exist.
- virtual void tlp::Graph::addLocalProperty (const std::string &name, PropertyInterface *prop)=0
- template<typename PropertyType > PropertyType * tlp::Graph::getLocalProperty (const std::string &name)
- PropertyInterface * tlp::Graph::getLocalProperty (const std::string &propertyName, const std::string &propertyType)
- bool tlp::Graph::applyPropertyAlgorithm (const std::string &algorithm, PropertyInterface *result, std::string &msg, PluginProgress *progress=NULL, DataSet *data=NULL)
- template<typename PropertyType > _DEPRECATED bool tlp::Graph::computeProperty (const std::string &algorithm, PropertyType *result, std::string &msg, PluginProgress *progress=NULL, DataSet *data=NULL)
- template<typename PropertyType > PropertyType * tlp::Graph::getProperty (const std::string &name)
- virtual PropertyInterface * tlp::Graph::getProperty (const std::string &name) const =0
- PropertyInterface * tlp::Graph::getProperty (const std::string &propertyName, const std::string &propertyType)
- virtual bool tlp::Graph::existProperty (const std::string &name) const =0
- virtual bool tlp::Graph::existLocalProperty (const std::string &name) const =0
- virtual void tlp::Graph::delLocalProperty (const std::string &name)=0
- virtual Iterator< std::string > * tlp::Graph::getLocalProperties () const =0
- virtual Iterator< std::string > * tlp::Graph::getInheritedProperties () const =0
- virtual Iterator< std::string > * tlp::Graph::getProperties () const =0
- virtual Iterator
< PropertyInterface * > * tlp::Graph::getLocalObjectProperties () const =0
- virtual Iterator
< PropertyInterface * > * tlp::Graph::getInheritedObjectProperties () const =0
- virtual Iterator
< PropertyInterface * > * tlp::Graph::getObjectProperties () const =0
- void tlp::Graph::addGraphObserver (GraphObserver *) const
- unsigned int tlp::Graph::countGraphObservers () const
- void tlp::Graph::removeGraphObserver (GraphObserver *) const
- virtual void tlp::Graph::push (bool unpopAllowed=true, std::vector< PropertyInterface * > *propertiesToPreserveOnPop=NULL)=0
- virtual void tlp::Graph::pop (bool unpopAllowed=true)=0
- virtual void tlp::Graph::unpop ()=0
- virtual bool tlp::Graph::canPop ()=0
- virtual bool tlp::Graph::canUnpop ()=0
- virtual bool tlp::Graph::canPopThenUnpop ()=0
- node tlp::Graph::createMetaNode (const std::set< node > &nodeSet, bool multiEdges=true, bool delAllEdge=true)
- void tlp::Graph::createMetaNodes (Iterator< Graph * > *itS, Graph *quotientGraph, std::vector< node > &metaNodes)
- node tlp::Graph::createMetaNode (Graph *subGraph, bool multiEdges=true, bool delAllEdge=true)
- void tlp::Graph::openMetaNode (node n, bool updateProperties=true)
- virtual DataSet & tlp::Graph::getNonConstAttributes ()=0
- virtual node tlp::Graph::restoreNode (node)=0
- virtual void tlp::Graph::restoreNodes (const std::vector< node > &nodes)=0
- virtual edge tlp::Graph::restoreEdge (edge, node source, node target)=0
- virtual void tlp::Graph::restoreEdges (const std::vector< edge > &edges, const std::vector< std::pair< node, node > > &ends)=0
- virtual void tlp::Graph::removeNode (const node)=0
- virtual void tlp::Graph::removeEdge (const edge)=0
- virtual bool tlp::Graph::canDeleteProperty (Graph *g, PropertyInterface *prop)
- virtual void tlp::Graph::removeSubGraph (Graph *)=0
- virtual void tlp::Graph::clearSubGraphs ()=0
- virtual void tlp::Graph::restoreSubGraph (Graph *)=0
- virtual void tlp::Graph::setSubGraphToKeep (Graph *)=0
- void tlp::Graph::notifyAddNode (const node n)
- void tlp::Graph::notifyAddNode (Graph *, const node n)
- void tlp::Graph::notifyAddEdge (const edge e)
- void tlp::Graph::notifyAddEdge (Graph *, const edge e)
- void tlp::Graph::notifyBeforeSetEnds (const edge e)
- void tlp::Graph::notifyBeforeSetEnds (Graph *, const edge e)
- void tlp::Graph::notifyAfterSetEnds (const edge e)
- void tlp::Graph::notifyAfterSetEnds (Graph *, const edge e)
- void tlp::Graph::notifyDelNode (const node n)
- void tlp::Graph::notifyDelNode (Graph *, const node n)
- void tlp::Graph::notifyDelEdge (const edge e)
- void tlp::Graph::notifyDelEdge (Graph *, const edge e)
- void tlp::Graph::notifyReverseEdge (const edge e)
- void tlp::Graph::notifyReverseEdge (Graph *, const edge e)
- void tlp::Graph::notifyAddSubGraph (const Graph *)
- void tlp::Graph::notifyAddSubGraph (Graph *, const Graph *sg)
- void tlp::Graph::notifyDelSubGraph (const Graph *)
- void tlp::Graph::notifyDelSubGraph (Graph *, const Graph *sg)
- void tlp::Graph::notifyAddLocalProperty (const std::string &)
- void tlp::Graph::notifyAddLocalProperty (Graph *, const std::string &name)
- void tlp::Graph::notifyBeforeDelLocalProperty (const std::string &)
- void tlp::Graph::notifyAfterDelLocalProperty (const std::string &)
- void tlp::Graph::notifyDelLocalProperty (Graph *, const std::string &name)
- void tlp::Graph::notifyBeforeSetAttribute (const std::string &)
- void tlp::Graph::notifyBeforeSetAttribute (Graph *, const std::string &name)
- void tlp::Graph::notifyAfterSetAttribute (const std::string &)
- void tlp::Graph::notifyAfterSetAttribute (Graph *, const std::string &name)
- void tlp::Graph::notifyRemoveAttribute (const std::string &)
- void tlp::Graph::notifyRemoveAttribute (Graph *, const std::string &name)
- void tlp::Graph::notifyDestroy ()
- void tlp::Graph::notifyDestroy (Graph *)
- virtual Graph * tlp::Graph::getNthSubGraph (unsigned int n) const
- virtual unsigned int tlp::Graph::numberOfSubGraphs () const =0
- virtual unsigned int tlp::Graph::numberOfDescendantGraphs () const =0
- virtual void tlp::Graph::setName (const std::string &name)=0
- virtual std::string tlp::Graph::getName () const =0
- tlp::GraphEvent::GraphEvent (const Graph &g, GraphEventType graphEvtType, unsigned int id, Event::EventType evtType=Event::TLP_MODIFICATION)
- tlp::GraphEvent::GraphEvent (const Graph &g, GraphEventType graphEvtType, const std::vector< node > &nodes, Event::EventType evtType=Event::TLP_MODIFICATION)
- tlp::GraphEvent::GraphEvent (const Graph &g, GraphEventType graphEvtType, const std::vector< edge > &edges, Event::EventType evtType=Event::TLP_MODIFICATION)
- tlp::GraphEvent::GraphEvent (const Graph &g, GraphEventType graphEvtType, const Graph *sg)
- tlp::GraphEvent::GraphEvent (const Graph &g, GraphEventType graphEvtType, const std::string &str, Event::EventType evtType=Event::TLP_MODIFICATION)
- tlp::GraphEvent::~GraphEvent ()
- Graph * tlp::GraphEvent::getGraph () const
- node tlp::GraphEvent::getNode () const
- edge tlp::GraphEvent::getEdge () const
- const std::vector< node > & tlp::GraphEvent::getNodes () const
- const std::vector< edge > & tlp::GraphEvent::getEdges () const
- const Graph * tlp::GraphEvent::getSubGraph () const
- const std::string & tlp::GraphEvent::getAttributeName () const
- const std::string & tlp::GraphEvent::getPropertyName () const
- GraphEventType tlp::GraphEvent::getType () const
Variables
Friends
Detailed Description
This file is part of Tulip (www.tulip-software.org)
Authors: David Auber and the Tulip development Team from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
Tulip is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Tulip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Function Documentation
Graph* tlp::Graph::addCloneSubGraph |
( |
std::string |
name = "unnamed" | ) |
|
Creates and returns a subgraph of this graph that contains all its elements.
- Parameters:
-
name | The name of the newly created subgraph. Defaults to "unnamed". |
- Returns:
- :Graph* The newly created clone subgraph.
virtual edge tlp::Graph::addEdge |
( |
const node |
, |
|
|
const node |
|
|
) |
| [pure virtual] |
Adds a new edge in the graph and returns it. This edge is also added in all the super-graph of the graph to maintain the sub-graph relation between graphs.
virtual void tlp::Graph::addEdge |
( |
const edge |
| ) |
[pure virtual] |
Adds an existing edge in the graph. This edge is also added in all the graph's ancestors to maintain the sub-graph relation between graphs. Warning, the edge must be an element of the graph hierarchy, thus it must be an element of the root graph. Warning : One can't add an existing edge to the root graph.
virtual void tlp::Graph::addEdges |
( |
const std::vector< std::pair< node, node > > & |
edges, |
|
|
std::vector< edge > & |
addedEdges |
|
) |
| [pure virtual] |
Adds new edges in the graph and returns them the addedNodes vector. The new nodes are also added in all the graph ancestors to maintain the sub-graph relation between graphs. Warning : the addedEdges vector is cleared before adding edges
virtual void tlp::Graph::addEdges |
( |
Iterator< edge > * |
edges | ) |
[pure virtual] |
Adds existing edges in the graph. The edges are also added in all the graph ancestors to maintain the sub-graph relation between graphs. Warning, the added edges must be elements of the graph hierarchy, thus they must be elements of the root graph. Warning : One can't add existing edges to the root graph.
virtual void tlp::Graph::addLocalProperty |
( |
const std::string & |
name, |
|
|
PropertyInterface * |
prop |
|
) |
| [pure virtual] |
Adds a property to the graph. Be aware that the PropertyInterface will now belong to the graph object; and so it will be deleted automatically. Using of delete on that property will cause a segmentation violation (use delLocalProperty instead).
virtual node tlp::Graph::addNode |
( |
| ) |
[pure virtual] |
Adds a new node in the graph and returns it. This node is also added in all the graph ancestors to maintain the sub-graph relation between graphs.
virtual void tlp::Graph::addNode |
( |
const node |
| ) |
[pure virtual] |
Adds an existing node in the graph. This node is also added in all the graph ancestors to maintain the sub-graph relation between graphs. Warning, the node must be an element of the graph hierarchy, thus it must be an element of the root graph. Warning : One can't add an existing node to the root graph.
virtual void tlp::Graph::addNodes |
( |
unsigned int |
nbNodes, |
|
|
std::vector< node > & |
addedNodes |
|
) |
| [pure virtual] |
Adds new nodes in the graph and returns them the addedNodes vector. The new nodes are also added in all the graph ancestors to maintain the sub-graph relation between graphs. Warning the addedNodes vector is cleared before adding nodes
virtual void tlp::Graph::addNodes |
( |
Iterator< node > * |
nodes | ) |
[pure virtual] |
Adds existing nodes in the graph. The nodes are also added in all the graph ancestors to maintain the sub-graph relation between graphs. Warning, the added nodes must be elements of the graph hierarchy, thus they must be elements of the root graph. Warning : One can't add existing nodes to the root graph.
virtual Graph* tlp::Graph::addSubGraph |
( |
BooleanProperty * |
selection = NULL , |
|
|
unsigned int |
id = 0 , |
|
|
std::string |
name = "unnamed" |
|
) |
| [pure virtual] |
Creates and returns a new sub-graph of this graph.
If a BooleanProperty is provided, all the nodes and edges for which it is true will be added to the subgraph. If none is provided, then the subgraph will be empty.
The id parameter should only be provided if you know exactly what you are doing; as Tulip will manage the subgraphs IDs when left to 0. It is only used by the Graph loading as subgraphs ids are preserved when saving/loading a Graph.
- Parameters:
-
selection | The elements to add to the new subgraph. Defaults to 0. |
id | The ID you wish to assign to the Graph. Defaults to 0. It is strongly advised to keep this as default and let Tulip manage subgraph IDs. |
name | The name of the newly created subgraph. Defaults to "unnamed". |
- Returns:
- :Graph* The newly created subgraph.
Graph* tlp::Graph::addSubGraph |
( |
std::string |
name | ) |
|
Creates and returns a new named sub-graph of this graph.
- Parameters:
-
name | The name of the newly created subgraph. Defaults to "unnamed". |
- Returns:
- :Graph* The newly created subgraph.
bool tlp::Graph::applyAlgorithm |
( |
const std::string & |
algorithm, |
|
|
std::string & |
errorMessage, |
|
|
DataSet * |
dataSet = NULL , |
|
|
PluginProgress * |
progress = NULL |
|
) |
| |
Applies an algorithm plugin, identified by its name. Algorithm plugins are subclasses of the tlp::Algorithm interface. Parameters are transmitted to the algorithm trough the DataSet. To determine a plugin's parameters, you can either:
* refer to its documentation
* use buildDefaultDataSet on the plugin object if you have an instance of it
* call getPluginParameters() with the name of the plugin on the right PluginLister (there cannot be a static method that directly returns this from the plugin name as a name can be used for plugins of different types).
If an error occurs, a message describing the error should be stored in errorMessage.
- Parameters:
-
algorithm | The algorithm to apply. |
errorMessage | A string that will be modified to contain an error message should an error occur. |
dataSet | The parameters to the algorithm. Defaults to NULL. |
progress | A PluginProgress to report the progress of the operation, as well as final state. Defaults to NULL. |
- Returns:
- bool Whether the algorithm was successfully applied.
Computes a property on the current graph using an external named algorithm (plug-in). The computed values will be stored in result. Warning: previous values stored in result will be deleted. If the function returns false, an error message is stored in msg. One can give a PluginProgress to the algorithm in order to have some feedback or to stop the algorithm during its computation. One can give parameters to the algorithm using the DataSet. In some cases algorithms can use this DataSet in order to return some external information (not stored in result).
bool tlp::Graph::attributeExist |
( |
const std::string & |
name | ) |
[inline] |
Returns if the attribute exist.
virtual bool tlp::Graph::canDeleteProperty |
( |
Graph * |
g, |
|
|
PropertyInterface * |
prop |
|
) |
| [inline, protected, virtual] |
virtual bool tlp::Graph::canPop |
( |
| ) |
[pure virtual] |
virtual bool tlp::Graph::canPopThenUnpop |
( |
| ) |
[pure virtual] |
virtual bool tlp::Graph::canUnpop |
( |
| ) |
[pure virtual] |
virtual void tlp::Graph::clear |
( |
| ) |
[pure virtual] |
Removes all nodes, edges and sub-graphs of the supergraph.
virtual void tlp::Graph::clearSubGraphs |
( |
| ) |
[protected, pure virtual] |
template<typename PropertyType >
_DEPRECATED bool tlp::Graph::computeProperty |
( |
const std::string & |
algorithm, |
|
|
PropertyType * |
result, |
|
|
std::string & |
msg, |
|
|
PluginProgress * |
progress = NULL , |
|
|
DataSet * |
data = NULL |
|
) |
| |
obsolete version of the previous one
unsigned int tlp::Graph::countGraphObservers |
( |
| ) |
const [inline] |
Returns the number of observers
node tlp::Graph::createMetaNode |
( |
const std::set< node > & |
nodeSet, |
|
|
bool |
multiEdges = true , |
|
|
bool |
delAllEdge = true |
|
) |
| |
Closes a set of existing nodes into a metanode and returns it. Edges from nodes in the set to other nodes are replaced with edges from the metanode to the other nodes. Warning: this method will failed when called on the root graph.
- Parameters:
-
nodeSet,: | a set of existing nodes |
multiEdges,: | indicates if a meta edge will be created for each underlying edge |
delAllEdge,: | indicates if the underlying edges will be removed from the entire hierarchy |
node tlp::Graph::createMetaNode |
( |
Graph * |
subGraph, |
|
|
bool |
multiEdges = true , |
|
|
bool |
delAllEdge = true |
|
) |
| |
Closes an existing subgraph into a metanode. Edges from nodes in the subgraph to nodes outside the subgraph are replaced with edges from the metanode to the nodes outside the subgraph. Warning: this method will failed when called on the root graph.
- Parameters:
-
subGraph,: | an existing subgraph |
multiEdges,: | indicates if a meta edge will be created for each underlying edge |
delAllEdge,: | indicates if the underlying edges will be removed from the entire hierarchy |
void tlp::Graph::createMetaNodes |
( |
Iterator< Graph * > * |
itS, |
|
|
Graph * |
quotientGraph, |
|
|
std::vector< node > & |
metaNodes |
|
) |
| |
Populates a quotient graph with one meta node for each iterated graph.
- Parameters:
-
itS,: | a Graph iterator, (typically a subgraph iterator) |
quotientGraph,: | the graph that will contain the meta nodes |
metaNodes,: | will contains all the added meta nodes after the call |
virtual unsigned int tlp::Graph::deg |
( |
const node |
| ) |
const [pure virtual] |
Returns the degree of a node.
virtual void tlp::Graph::delAllSubGraphs |
( |
Graph * |
| ) |
[pure virtual] |
Deletes a sub-graph of this graph and all its sub-graphs.
virtual void tlp::Graph::delEdge |
( |
const edge |
e, |
|
|
bool |
deleteInAllGraphs = false |
|
) |
| [pure virtual] |
Deletes an edge in the graph. The edge is also removed in the sub-graphs hierarchy of the current graph to maintain the sub-graph relation between graphs. If deleteInAllGraphs is true, the edge is deleted in the whole hierarchy of graphs. The ordering of remaining edges is preserved.
virtual void tlp::Graph::delEdges |
( |
Iterator< edge > * |
itE, |
|
|
bool |
deleteInAllGraphs = false |
|
) |
| [pure virtual] |
Deletes edges in the graph. These edges are also removed in the sub-graphs hierarchy of the current graph to maintain the sub-graph relation between graphs. If deleteInAllGraphs is true, the edges are deleted in the whole hierarchy of graphs. The ordering of remaining edges is preserved. It is the responsibility of the caller to delete the iterator.
virtual void tlp::Graph::delLocalProperty |
( |
const std::string & |
name | ) |
[pure virtual] |
Removes and deletes the property associated to name in the graph properties pool.
virtual void tlp::Graph::delNode |
( |
const node |
n, |
|
|
bool |
deleteInAllGraphs = false |
|
) |
| [pure virtual] |
Deletes a node in the graph. This node is also removed in the sub-graphs hierarchy of the current graph to maintain the sub-graph relation between graphs. If deleteInAllGraphs is true, the node is deleted in the whole hierarchy of graphs.
virtual void tlp::Graph::delNodes |
( |
Iterator< node > * |
itN, |
|
|
bool |
deleteInAllGraphs = false |
|
) |
| [pure virtual] |
Deletes nodes in the graph. These nodes are also removed in the sub-graphs hierarchy of the current graph to maintain the sub-graph relation between graphs. If deleteInAllGraphs is true, these nodes are deleted in the whole hierarchy of graphs. It is the responsibility of the caller to delete the iterator.
virtual void tlp::Graph::delSubGraph |
( |
Graph * |
| ) |
[pure virtual] |
Deletes a sub-graph of this graph. The sub-graph's sub-graphs become sub-graphs of the graph.
virtual const std::pair<node, node>& tlp::Graph::ends |
( |
const edge |
| ) |
const [pure virtual] |
Returns the source and target of the edge as the first and second of the returned pair.
virtual edge tlp::Graph::existEdge |
( |
const node |
source, |
|
|
const node |
target, |
|
|
bool |
directed = true |
|
) |
| const [pure virtual] |
Returns the edge if it exists an edge between two nodes. The 'directed' flag indicates if the direction of the edge (from source to target) must be taken in to account. If no edge is found, returns an invalid edge.
virtual bool tlp::Graph::existLocalProperty |
( |
const std::string & |
name | ) |
const [pure virtual] |
Returns true if a property of that name exists in the graph properties pool.
virtual bool tlp::Graph::existProperty |
( |
const std::string & |
name | ) |
const [pure virtual] |
Returns true if a property of that name exists in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy.
template<typename ATTRIBUTETYPE >
_DEPRECATED ATTRIBUTETYPE tlp::Graph::getAttribute |
( |
const std::string & |
name | ) |
const |
Deprecated version of the previous method.
template<typename ATTRIBUTETYPE >
bool tlp::Graph::getAttribute |
( |
const std::string & |
name, |
|
|
ATTRIBUTETYPE & |
value |
|
) |
| const |
Get an attribute of the graph; returns true if a value was found false if not.
const std::string& tlp::GraphEvent::getAttributeName |
( |
| ) |
const [inline] |
const DataSet& tlp::Graph::getAttributes |
( |
| ) |
const [inline] |
Returns graph attributes.
virtual Graph* tlp::Graph::getDescendantGraph |
( |
unsigned int |
id | ) |
const [pure virtual] |
Returns a pointer on the descendant with the corresponding id or NULL if there is no descendant with that id.
virtual Graph* tlp::Graph::getDescendantGraph |
( |
const std::string & |
name | ) |
const [pure virtual] |
Returns a pointer on the first descendant graph with the corresponding name or NULL if there is no descendant graph with that name.
edge tlp::GraphEvent::getEdge |
( |
| ) |
const [inline] |
virtual Iterator<edge>* tlp::Graph::getEdgeMetaInfo |
( |
const edge |
| ) |
const [pure virtual] |
Returns an iterator on the underlying edges of a meta edge.
const std::vector<edge>& tlp::GraphEvent::getEdges |
( |
| ) |
const [inline] |
virtual Iterator<edge>* tlp::Graph::getEdges |
( |
| ) |
const [pure virtual] |
Returns an iterator on the edges.
Graph* tlp::GraphEvent::getGraph |
( |
| ) |
const [inline] |
unsigned int tlp::Graph::getId |
( |
| ) |
const [inline] |
Returns the graph's id. This id is unique.
virtual Iterator<edge>* tlp::Graph::getInEdges |
( |
const node |
| ) |
const [pure virtual] |
Returns an iterator on the incoming edges of a node.
virtual Iterator<PropertyInterface*>* tlp::Graph::getInheritedObjectProperties |
( |
| ) |
const [pure virtual] |
Returns an iterator on the properties inherited from the graph���s ancestors.
virtual Iterator<std::string>* tlp::Graph::getInheritedProperties |
( |
| ) |
const [pure virtual] |
Returns an iterator on the names of the properties inherited from the graph���s ancestors.
virtual node tlp::Graph::getInNode |
( |
const node |
, |
|
|
unsigned |
int |
|
) |
| const [pure virtual] |
Returns the ith predecessor of a node.
virtual Iterator<node>* tlp::Graph::getInNodes |
( |
const node |
| ) |
const [pure virtual] |
Returns an iterator on the predecessors of a node.
virtual Iterator<edge>* tlp::Graph::getInOutEdges |
( |
const node |
| ) |
const [pure virtual] |
Returns an iterator on the incoming and outgoing edges of a node.
virtual Iterator<node>* tlp::Graph::getInOutNodes |
( |
const node |
| ) |
const [pure virtual] |
Returns an iterator on the neighbours of a node.
virtual Iterator<PropertyInterface*>* tlp::Graph::getLocalObjectProperties |
( |
| ) |
const [pure virtual] |
Returns an iterator on the properties local to the graph.
virtual Iterator<std::string>* tlp::Graph::getLocalProperties |
( |
| ) |
const [pure virtual] |
Returns an iterator on the names of the properties local to the graph.
template<typename PropertyType >
PropertyType* tlp::Graph::getLocalProperty |
( |
const std::string & |
name | ) |
|
Returns a pointer to a PropertyInterface which is in the graph properties pool. The real type of the PropertyInterface is tested with the template parameter. If the PropertyInterface is not in the pool, a new one is created and returned. Using of delete on that property will cause an abort of the program (use delLocalProperty instead).
PropertyInterface* tlp::Graph::getLocalProperty |
( |
const std::string & |
propertyName, |
|
|
const std::string & |
propertyType |
|
) |
| |
Try to returns a pointer to a PropertyInterface PropertyInterface which is in the graph properties pool. The real type of the PropertyInterface is tested with the propertyType string parameter. If the PropertyInterface is not in the pool, a new one is created and returned. If the type parameter is not a valid property type this function returns a NULL pointer. Using of delete on that property will cause an abort of the program (use delLocalProperty instead).
virtual std::string tlp::Graph::getName |
( |
| ) |
const [pure virtual] |
Returns the string identifier of the graph
node tlp::GraphEvent::getNode |
( |
| ) |
const [inline] |
virtual Graph* tlp::Graph::getNodeMetaInfo |
( |
const node |
| ) |
const [pure virtual] |
Returns the underlying graph of a meta node.
const std::vector<node>& tlp::GraphEvent::getNodes |
( |
| ) |
const [inline] |
virtual Iterator<node>* tlp::Graph::getNodes |
( |
| ) |
const [pure virtual] |
Returns an iterator on the nodes.
virtual DataSet& tlp::Graph::getNonConstAttributes |
( |
| ) |
[protected, pure virtual] |
virtual Graph* tlp::Graph::getNthSubGraph |
( |
unsigned int |
n | ) |
const [virtual] |
This method returns the nth subgraph. Since order cannot be ensured in every implementation, this method should be equivalent to: int i=0; Iterator<Graph *> *it = g->getSubGraphs(); while (it->hasNext()) { Graph *result = it->next(); if (i++ == n) { delete it; return result; } } delete it; return NULL;
virtual Iterator<PropertyInterface*>* tlp::Graph::getObjectProperties |
( |
| ) |
const [pure virtual] |
Returns an iterator on all the properties attached to the graph.
virtual edge tlp::Graph::getOneEdge |
( |
| ) |
const [pure virtual] |
Returns an existing edge of the graph.
virtual node tlp::Graph::getOneNode |
( |
| ) |
const [pure virtual] |
Returns an existing node of the graph.
virtual Iterator<edge>* tlp::Graph::getOutEdges |
( |
const node |
| ) |
const [pure virtual] |
Returns an iterator on the outgoing edges of a node.
virtual node tlp::Graph::getOutNode |
( |
const node |
, |
|
|
unsigned |
int |
|
) |
| const [pure virtual] |
Returns the ith successor of a node.
virtual Iterator<node>* tlp::Graph::getOutNodes |
( |
const node |
| ) |
const [pure virtual] |
Returns an iterator on the successors of a node.
virtual Iterator<std::string>* tlp::Graph::getProperties |
( |
| ) |
const [pure virtual] |
Returns an iterator on the name of all the properties attached to the graph.
PropertyInterface* tlp::Graph::getProperty |
( |
const std::string & |
propertyName, |
|
|
const std::string & |
propertyType |
|
) |
| |
Try to returns a pointer to a PropertyInterface PropertyInterface which is in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. The real type of the PropertyInterface is tested with the propertyType string parameter. If the PropertyInterface is not in the pool, a new one is created and returned. If the type parameter is not a valid property type this function returns a NULL pointer. Using of delete on that property will cause an abort of the program (use delLocalProperty instead).
template<typename PropertyType >
PropertyType* tlp::Graph::getProperty |
( |
const std::string & |
name | ) |
|
Returns a pointer to a PropertyInterface which is in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. The real type of the PropertyInterface is tested with the template parameter. If the PropertyInterface is not in the pool, it creates a new one and returns it. Using of delete on that property will cause a segmentation violation (use delLocalProperty instead).
virtual PropertyInterface* tlp::Graph::getProperty |
( |
const std::string & |
name | ) |
const [pure virtual] |
Returns a pointer on an existing property. If the property does not exist return NULL. In DEBUG the existence of a property is checked using an assertion.
const std::string& tlp::GraphEvent::getPropertyName |
( |
| ) |
const [inline] |
virtual Graph* tlp::Graph::getRoot |
( |
| ) |
const [pure virtual] |
Returns the root graph of the graph hierarchy.
virtual tlp::node tlp::Graph::getSource |
( |
| ) |
const [virtual] |
Finds the first node whose input degree equals 0.
- Returns:
- tlp::node The first encountered node with input degree of 0, or an invalid node if none was found.
virtual Graph* tlp::Graph::getSubGraph |
( |
unsigned int |
id | ) |
const [pure virtual] |
Returns a pointer on the sub-graph with the corresponding id or NULL if there is no sub-graph with that id.
virtual Graph* tlp::Graph::getSubGraph |
( |
const std::string & |
name | ) |
const [pure virtual] |
Returns a pointer on the sub-graph with the corresponding name or NULL if there is no sub-graph with that name.
const Graph* tlp::GraphEvent::getSubGraph |
( |
| ) |
const [inline] |
virtual Iterator<Graph *>* tlp::Graph::getSubGraphs |
( |
| ) |
const [pure virtual] |
Returns an iterator on all the sub-graphs of the graph.
virtual Graph* tlp::Graph::getSuperGraph |
( |
| ) |
const [pure virtual] |
Returns the parent of the graph, if it has no parent (is the root graph), it returns itself.
GraphEventType tlp::GraphEvent::getType |
( |
| ) |
const [inline] |
tlp::Graph::Graph |
( |
| ) |
[inline] |
virtual unsigned int tlp::Graph::indeg |
( |
const node |
| ) |
const [pure virtual] |
Returns the incoming degree of a node.
Graph* tlp::Graph::inducedSubGraph |
( |
const std::set< node > & |
nodeSet, |
|
|
Graph * |
parentSubGraph = NULL |
|
) |
| |
Creates and returns a new sub-graph of the graph induced by a set of nodes. The sub-graph contains all the nodes of the set and all the existing edges between two nodes of the set including self-loops. If the parentSubGraph argument is not null, it will be the parent of the induced sub-graph instead of this.
virtual bool tlp::Graph::isDescendantGraph |
( |
const Graph * |
sg | ) |
const [pure virtual] |
Indicates if the graph argument is a descendant of this graph.
virtual bool tlp::Graph::isElement |
( |
const node |
| ) |
const [pure virtual] |
Returns true if the node is an element of the graph.
virtual bool tlp::Graph::isElement |
( |
const edge |
| ) |
const [pure virtual] |
Returns true if the edge is an element of the graph.
virtual bool tlp::Graph::isMetaEdge |
( |
const edge |
| ) |
const [pure virtual] |
Returns true if the edge is a meta edge.
virtual bool tlp::Graph::isMetaNode |
( |
const node |
| ) |
const [pure virtual] |
Returns true if the node is a meta node.
virtual bool tlp::Graph::isSubGraph |
( |
const Graph * |
sg | ) |
const [pure virtual] |
Indicates if the graph argument is a direct sub-graph.
void tlp::Graph::notifyAddEdge |
( |
Graph * |
, |
|
|
const edge |
e |
|
) |
| [inline, protected] |
void tlp::Graph::notifyAddEdge |
( |
const edge |
e | ) |
[protected] |
void tlp::Graph::notifyAddLocalProperty |
( |
const std::string & |
| ) |
[protected] |
void tlp::Graph::notifyAddLocalProperty |
( |
Graph * |
, |
|
|
const std::string & |
name |
|
) |
| [inline, protected] |
void tlp::Graph::notifyAddNode |
( |
const node |
n | ) |
[protected] |
void tlp::Graph::notifyAddNode |
( |
Graph * |
, |
|
|
const node |
n |
|
) |
| [inline, protected] |
void tlp::Graph::notifyAddSubGraph |
( |
const Graph * |
| ) |
[protected] |
void tlp::Graph::notifyAddSubGraph |
( |
Graph * |
, |
|
|
const Graph * |
sg |
|
) |
| [inline, protected] |
void tlp::Graph::notifyAfterDelLocalProperty |
( |
const std::string & |
| ) |
[protected] |
void tlp::Graph::notifyAfterSetAttribute |
( |
const std::string & |
| ) |
[protected] |
void tlp::Graph::notifyAfterSetAttribute |
( |
Graph * |
, |
|
|
const std::string & |
name |
|
) |
| [inline, protected] |
void tlp::Graph::notifyAfterSetEnds |
( |
const edge |
e | ) |
[protected] |
void tlp::Graph::notifyAfterSetEnds |
( |
Graph * |
, |
|
|
const edge |
e |
|
) |
| [inline, protected] |
void tlp::Graph::notifyBeforeDelLocalProperty |
( |
const std::string & |
| ) |
[protected] |
void tlp::Graph::notifyBeforeSetAttribute |
( |
const std::string & |
| ) |
[protected] |
void tlp::Graph::notifyBeforeSetAttribute |
( |
Graph * |
, |
|
|
const std::string & |
name |
|
) |
| [inline, protected] |
void tlp::Graph::notifyBeforeSetEnds |
( |
Graph * |
, |
|
|
const edge |
e |
|
) |
| [inline, protected] |
void tlp::Graph::notifyBeforeSetEnds |
( |
const edge |
e | ) |
[protected] |
void tlp::Graph::notifyDelEdge |
( |
const edge |
e | ) |
[protected] |
void tlp::Graph::notifyDelEdge |
( |
Graph * |
, |
|
|
const edge |
e |
|
) |
| [inline, protected] |
void tlp::Graph::notifyDelLocalProperty |
( |
Graph * |
, |
|
|
const std::string & |
name |
|
) |
| [inline, protected] |
void tlp::Graph::notifyDelNode |
( |
const node |
n | ) |
[protected] |
void tlp::Graph::notifyDelNode |
( |
Graph * |
, |
|
|
const node |
n |
|
) |
| [inline, protected] |
void tlp::Graph::notifyDelSubGraph |
( |
const Graph * |
| ) |
[protected] |
void tlp::Graph::notifyDelSubGraph |
( |
Graph * |
, |
|
|
const Graph * |
sg |
|
) |
| [inline, protected] |
void tlp::Graph::notifyDestroy |
( |
| ) |
[protected] |
void tlp::Graph::notifyDestroy |
( |
Graph * |
| ) |
[inline, protected] |
void tlp::Graph::notifyRemoveAttribute |
( |
Graph * |
, |
|
|
const std::string & |
name |
|
) |
| [inline, protected] |
void tlp::Graph::notifyRemoveAttribute |
( |
const std::string & |
| ) |
[protected] |
void tlp::Graph::notifyReverseEdge |
( |
const edge |
e | ) |
[protected] |
void tlp::Graph::notifyReverseEdge |
( |
Graph * |
, |
|
|
const edge |
e |
|
) |
| [inline, protected] |
virtual unsigned int tlp::Graph::numberOfDescendantGraphs |
( |
| ) |
const [pure virtual] |
Return the number of descendant graphs
virtual unsigned int tlp::Graph::numberOfEdges |
( |
| ) |
const [pure virtual] |
Returns the number of edges in the graph.
virtual unsigned int tlp::Graph::numberOfNodes |
( |
| ) |
const [pure virtual] |
Returns the number of nodes in the graph.
virtual unsigned int tlp::Graph::numberOfSubGraphs |
( |
| ) |
const [pure virtual] |
Return the number of direct sub-graphs
void tlp::Graph::openMetaNode |
( |
node |
n, |
|
|
bool |
updateProperties = true |
|
) |
| |
Opens a metanode and replaces all edges between that meta node and other nodes in the graph.
- Parameters:
-
updateProperties | If set to true, open meta node will update inner nodes layout, color, size, etc Warning: this method will failed when called on the root graph. |
virtual node tlp::Graph::opposite |
( |
const edge |
, |
|
|
const node |
|
|
) |
| const [pure virtual] |
Returns the opposite node for n in the edge e.
virtual unsigned int tlp::Graph::outdeg |
( |
const node |
| ) |
const [pure virtual] |
Returns the outgoing degree of a node.
virtual void tlp::Graph::pop |
( |
bool |
unpopAllowed = true | ) |
[pure virtual] |
virtual void tlp::Graph::push |
( |
bool |
unpopAllowed = true , |
|
|
std::vector< PropertyInterface * > * |
propertiesToPreserveOnPop = NULL |
|
) |
| [pure virtual] |
void tlp::Graph::removeAttribute |
( |
const std::string & |
name | ) |
[inline] |
Removes an existing attribute.
virtual void tlp::Graph::removeEdge |
( |
const edge |
| ) |
[protected, pure virtual] |
virtual void tlp::Graph::removeNode |
( |
const node |
| ) |
[protected, pure virtual] |
virtual void tlp::Graph::removeSubGraph |
( |
Graph * |
| ) |
[protected, pure virtual] |
virtual void tlp::Graph::reserveEdges |
( |
unsigned int |
nbEdges | ) |
[pure virtual] |
virtual void tlp::Graph::reserveNodes |
( |
unsigned int |
nbNodes | ) |
[pure virtual] |
virtual edge tlp::Graph::restoreEdge |
( |
edge |
, |
|
|
node |
source, |
|
|
node |
target |
|
) |
| [protected, pure virtual] |
virtual void tlp::Graph::restoreEdges |
( |
const std::vector< edge > & |
edges, |
|
|
const std::vector< std::pair< node, node > > & |
ends |
|
) |
| [protected, pure virtual] |
virtual node tlp::Graph::restoreNode |
( |
node |
| ) |
[protected, pure virtual] |
virtual void tlp::Graph::restoreNodes |
( |
const std::vector< node > & |
nodes | ) |
[protected, pure virtual] |
virtual void tlp::Graph::restoreSubGraph |
( |
Graph * |
| ) |
[protected, pure virtual] |
virtual void tlp::Graph::reverse |
( |
const edge |
| ) |
[pure virtual] |
Reverses the direction of an edge, the source becomes the target and the target becomes the source. Warning : The ordering is global to the entire graph hierarchy. Thus, by changing the ordering of a graph you change the ordering of the hierarchy.
template<typename ATTRIBUTETYPE >
void tlp::Graph::setAttribute |
( |
const std::string & |
name, |
|
|
const ATTRIBUTETYPE & |
value |
|
) |
| |
Sets an attribute of the graph.
void tlp::Graph::setAttribute |
( |
const std::string & |
name, |
|
|
const DataType * |
value |
|
) |
| |
Sets attritute from an untyped value.
virtual void tlp::Graph::setEdgeOrder |
( |
const node |
, |
|
|
const std::vector< edge > & |
|
|
) |
| [pure virtual] |
Sets the order of the edges around a node. This operation ensures that adjacent edges of a node will be ordered as they are in the vector of edges given in parameter.
virtual void tlp::Graph::setEnds |
( |
const edge |
, |
|
|
const node |
source, |
|
|
const node |
target |
|
) |
| [pure virtual] |
Sets both the source and target of an existing edge.
virtual void tlp::Graph::setName |
( |
const std::string & |
name | ) |
[pure virtual] |
Sets the string identifier of the graph
virtual void tlp::Graph::setSource |
( |
const edge |
, |
|
|
const node |
|
|
) |
| [pure virtual] |
Sets the source of an existing edge.
virtual void tlp::Graph::setSubGraphToKeep |
( |
Graph * |
| ) |
[protected, pure virtual] |
virtual void tlp::Graph::setSuperGraph |
( |
Graph * |
| ) |
[pure virtual] |
Sets the parent of the graph (use very carefully) Standard users should never use this function.
virtual void tlp::Graph::setTarget |
( |
const edge |
, |
|
|
const node |
|
|
) |
| [pure virtual] |
Sets the target of an existing edge.
virtual node tlp::Graph::source |
( |
const edge |
| ) |
const [pure virtual] |
Returns the source of the edge.
virtual void tlp::Graph::swapEdgeOrder |
( |
const node |
, |
|
|
const edge |
, |
|
|
const edge |
|
|
) |
| [pure virtual] |
Swaps two edges in the adjacency list of a node.
virtual node tlp::Graph::target |
( |
const edge |
| ) |
const [pure virtual] |
Returns the target of the edge.
virtual void tlp::Graph::unpop |
( |
| ) |
[pure virtual] |
virtual tlp::Graph::~Graph |
( |
| ) |
[inline, virtual] |
tlp::GraphEvent::~GraphEvent |
( |
| ) |
[inline] |
Variable Documentation
std::string* { ... } ::name |
Friends
friend class GraphDecorator [friend] |
friend class GraphUpdatesRecorder [friend] |
friend class PropertyManager [friend] |
|