Overview | Modules | Class Hierarchy | Classes | Members

# tlp::Graph Class Reference
[Graphs]

`#include <Graph.h>`

Inherits tlp::Observable, and tlp::ObservableGraph.

Inheritance diagram for tlp::Graph:

[legend]
Collaboration diagram for tlp::Graph:

[legend]
List of all members.

## Detailed Description

Interface for a graph.

The class Graph is the interface of a Graph in the Tulip Library.

## Public Member Functions

- Graph ()
- virtual ~Graph ()
- virtual void clear ()=0
- virtual Graph * addSubGraph (BooleanProperty *selection=0, unsigned int id=0)=0
- Graph * inducedSubGraph (const std::set< node > &nodeSet)
- virtual void delSubGraph (Graph *)=0
- virtual void delAllSubGraphs (Graph *)=0
- virtual Graph * getSuperGraph () const =0
- Graph * getFather () const
- virtual Graph * getRoot () const =0
- virtual void setSuperGraph (Graph *)=0
- void setFather (Graph *sg)
- virtual Iterator< Graph * > * getSubGraphs () const =0
- virtual bool isSubGraph (Graph *sg) const =0
- virtual bool isDescendantGraph (Graph *sg) const =0
- virtual Graph * getSubGraph (unsigned int id) const =0
- virtual Graph * getDescendantGraph (unsigned int id) const =0
- virtual node addNode ()=0
- virtual void addNode (const node)=0
- virtual void delNode (const node)=0
- virtual void delAllNode (const node)=0
- virtual edge addEdge (const node, const node)=0
- virtual void addEdge (const edge)=0
- virtual void delEdge (const edge)=0
- virtual void delAllEdge (const edge)=0
- virtual void setEdgeOrder (const node, const std::vector< edge > &)=0
- virtual void swapEdgeOrder (const node, const edge, const edge)=0
- virtual void reverse (const edge)=0
- virtual node getOneNode () const =0
    Return an existing node of the graph.
- virtual Iterator< node > * getNodes () const =0
    Return an iterator on the nodes.
- virtual node getInNode (const node, unsigned int) const =0
    Return the ith successor of a node.
- virtual Iterator< node > * getInNodes (const node) const =0
    Return an iterator on the predecessors of a node.
- virtual node getOutNode (const node, unsigned int) const =0
    Return the ith predecessor of a node.
- virtual Iterator< node > * getOutNodes (const node) const =0
    Return an iterator on the successors of a node.
- virtual Iterator< node > * getInOutNodes (const node) const =0
    Return an iterator on the neighbours of a node.
- virtual Graph * getNodeMetaInfo (const node) const =0
    Returns the underlying graph of a meta node.
- virtual Iterator< edge > * getEdges () const =0
    Return an iterator on the edges.
- virtual edge getOneEdge () const =0
    Return an existing edge of the graph.
- virtual Iterator< edge > * getOutEdges (const node) const =0
    Return an iterator on the out-edges of a node.
- virtual Iterator< edge > * getInOutEdges (const node) const =0
    Return an iterator on the in-out-edges of a node.
- virtual Iterator< edge > * getInEdges (const node) const =0
    Return an iterator on the in--edges of a node.
- virtual Iterator< edge > * getEdgeMetaInfo (const edge) const =0
    Return an iterator on the underlying edges of a meta edge.
- unsigned int getId () const
    Return the graph's id, this id is unique.
- virtual unsigned int numberOfNodes () const =0
    Return the number of nodes in the graph.
- virtual unsigned int numberOfEdges () const =0
    Return the number of edges in the graph.
- virtual unsigned int deg (const node) const =0
    Return degree of a node.
- virtual unsigned int indeg (const node) const =0
    Return indegree of a node.
- virtual unsigned int outdeg (const node) const =0
    Return outdegree of a node.
- virtual node source (const edge) const =0
    Return the source of the edge.
- virtual node target (const edge) const =0
    Return the target of the edge.
- virtual const std::pair< node,
  node > & ends (const edge) const =0
- virtual node opposite (const edge, const node) const =0
    Return the opposite node for s in the edge e.
- virtual bool isElement (const node) const =0
    Return true if the node is element of the graph.
- virtual bool isMetaNode (const node) const =0
    Return true if the node is a meta node.
- virtual bool isElement (const edge) const =0
    Return true if the edge is element of the graph.
- virtual bool isMetaEdge (const edge) const =0
    Return true if the edge is a meta edge.
- virtual edge existEdge (const node source, const node target, bool directed=true) const =0
- const DataSet & getAttributes () const
    Return graph attributes.
- template<typename ATTRIBUTETYPE> bool getAttribute (const std::string &name, ATTRIBUTETYPE &value) const
- template<typename ATTRIBUTETYPE> ATTRIBUTETYPE getAttribute (const std::string &name) const
    deprecated version of the previous method
- DataType * getAttribute (const std::string &name) const
    Untyped accessor returning a copy.
- template<typename ATTRIBUTETYPE> void setAttribute (const std::string &name, const ATTRIBUTETYPE &value)
    Set an attribute of the graph.
- void setAttribute (const std::string &name, const DataType *value)
    set attritute from an untyped value
- void removeAttribute (const std::string &name)
    remove an existing attribute
- bool attributeExist (const std::string &name)
    return if the attribute exist
- virtual void addLocalProperty (const std::string &name, PropertyInterface *prop)=0
- template<typename PropertyType> PropertyType * getLocalProperty (const std::string &name)
- template<typename PropertyType> bool computeProperty (const std::string &algorithm, PropertyType *result, std::string &msg, PluginProgress *progress=0, DataSet *data=0)
- template<typename PropertyType> PropertyType * getProperty (const std::string &name)
- virtual PropertyInterface * getProperty (const std::string &name)=0
- virtual bool existProperty (const std::string &name)=0
- virtual bool existLocalProperty (const std::string &name)=0
- virtual void delLocalProperty (const std::string &name)=0
- virtual Iterator< std::string > * getLocalProperties ()=0
- virtual Iterator< std::string > * getInheritedProperties ()=0
- virtual Iterator< std::string > * getProperties ()=0
- virtual Iterator< PropertyInterface * > * getLocalObjectProperties ()=0
- virtual Iterator< PropertyInterface * > * getInheritedObjectProperties ()=0
- virtual Iterator< PropertyInterface * > * getObjectProperties ()=0
- virtual void push (bool unpopAllowed=true)=0
- virtual void pop (bool unpopAllowed=true)=0
- virtual bool nextPopKeepPropertyUpdates (PropertyInterface *prop)=0
- virtual void unpop ()=0
- virtual bool canPop ()=0
- virtual bool canUnpop ()=0
- node createMetaNode (const std::set< node > &nodeSet, bool multiEdges=true, bool delAllEdge=true)
- void createMetaNodes (Iterator< Graph * > *itS, Graph *quotientGraph, std::vector< node > &metaNodes)
- node createMetaNode (Graph *subGraph, bool multiEdges=true, bool delAllEdge=true)
- void openMetaNode (node n)

## Protected Member Functions

- virtual DataSet & getNonConstAttributes ()=0
- virtual node restoreNode (node)=0
- virtual edge restoreEdge (edge, node source, node target)=0
- virtual void removeNode (const node)=0
- virtual void removeEdge (const edge, const node=node())=0
- virtual bool canDeleteProperty (Graph *g, PropertyInterface *prop)
- virtual void removeSubGraph (Graph *, bool notify=false)=0
- virtual void clearSubGraphs ()=0
- virtual void restoreSubGraph (Graph *, bool undoOrRedo=false)=0
- virtual void setSubGraphToKeep (Graph *)=0
- void notifyDestroy ()
- void notifyAddSubGraph (Graph *)

## Protected Attributes

- unsigned int id
- std::set< tlp::PropertyInterface * > circularCalls

## Friends

- class GraphAbstract
- class GraphUpdatesRecorder
- class GraphDecorator
- class PropertyManager

## Member Function Documentation

DataType* tlp::Graph::getAttribute | ( | const std::string & | name | ) | const

| Untyped accessor returning a copy.

virtual PropertyInterface* tlp::Graph::getProperty | ( | const std::string & | name | ) | `[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.

## Friends And Related Function Documentation

friend class GraphAbstract`[friend]`

Tulip Software by LaBRI Visualization Team 2001 - 2010