21 #ifndef DOXYGEN_NOTFOR_DEVEL
23 #ifndef Tulip_GraphDecorator_H
24 #define Tulip_GraphDecorator_H
26 #include <tulip/Graph.h>
30 class TLP_SCOPE GraphDecorator :
public Graph {
32 GraphDecorator(Graph* s) {
36 virtual ~GraphDecorator() {
41 virtual Graph *addSubGraph(BooleanProperty *selection=0,
42 std::string name =
"unnamed");
43 virtual void delSubGraph(Graph * s);
44 virtual void delAllSubGraphs(Graph *s);
45 virtual Graph* getSuperGraph()
const;
46 virtual void setSuperGraph(Graph* s);
47 virtual Graph* getRoot()
const;
48 virtual Iterator<Graph *> * getSubGraphs()
const;
49 virtual bool isSubGraph(
const Graph* sg)
const;
50 virtual bool isDescendantGraph(
const Graph* sg)
const;
51 virtual Graph* getSubGraph(
unsigned int id)
const;
52 virtual Graph* getSubGraph(
const std::string &name)
const;
53 virtual Graph* getDescendantGraph(
unsigned int id)
const;
54 virtual Graph* getDescendantGraph(
const std::string &name)
const;
55 virtual unsigned int numberOfSubGraphs()
const;
56 virtual unsigned int numberOfDescendantGraphs()
const;
59 virtual node source(
const edge e)
const;
60 virtual void setSource(
const edge,
const node);
61 virtual node target(
const edge e)
const;
62 virtual void setTarget(
const edge,
const node);
63 virtual node opposite(
const edge e,
const node n)
const;
64 virtual edge existEdge(
const node n,
const node m,
bool directed =
true)
const;
65 virtual bool hasEdge(
const node source,
const node target,
66 bool directed =
true)
const;
67 virtual std::vector<edge> getEdges(
const node source,
const node target,
68 bool directed =
true)
const;
69 virtual const std::pair<node, node>& ends(
const edge e)
const;
70 virtual void setEnds(
const edge,
const node,
const node);
71 virtual void reverse(
const edge e);
72 virtual unsigned int deg(
const node n)
const;
73 virtual unsigned int indeg(
const node n)
const;
74 virtual unsigned int outdeg(
const node n)
const;
75 virtual Graph* getNodeMetaInfo(
const node n)
const;
78 virtual node getOneNode()
const;
79 virtual node getInNode(
const node n,
unsigned int i)
const;
80 virtual node getOutNode(
const node n,
unsigned int i)
const;
81 virtual edge getOneEdge()
const;
83 virtual unsigned int numberOfNodes()
const;
84 virtual unsigned int numberOfEdges()
const;
88 virtual void reserveNodes(
unsigned int nbNodes);
89 virtual void reserveEdges(
unsigned int nbEdges);
92 virtual bool isElement(
const node n)
const;
93 virtual bool isMetaNode(
const node n)
const;
94 virtual bool isElement(
const edge e)
const;
95 virtual bool isMetaEdge(
const edge e)
const;
96 virtual node addNode();
97 virtual void addNodes(
unsigned int nb, std::vector<node>& addedNodes);
98 virtual void addNode(
const node);
99 virtual void addNodes(Iterator<node>* nodes);
100 virtual edge addEdge(
const node n1,
const node n2);
101 virtual void addEdges(
const std::vector<std::pair<node, node> >& edges,
102 std::vector<edge>& addedEdges);
103 virtual void addEdge(
const edge);
104 virtual void addEdges(Iterator<edge>* edges);
105 virtual void delNode(
const tlp::node n,
bool deleteInAllGraphs =
false);
106 virtual void delNodes(Iterator<node>* itN,
bool deleteInAllGraphs);
107 virtual void delEdge(
const tlp::edge e,
bool deleteInAllGraphs =
false);
108 virtual void delEdges(Iterator<edge>* itE,
bool deleteInAllGraphs =
false);
109 virtual void setEdgeOrder(
const node n,
const std::vector<edge> & s);
110 virtual void swapEdgeOrder(
const node n ,
const edge e1,
const edge e2);
112 virtual Iterator<node>* getNodes()
const;
113 virtual Iterator<node>* getInNodes(
const node n)
const;
114 virtual Iterator<node>* getOutNodes(
const node n)
const;
115 virtual Iterator<node>* getInOutNodes(
const node n)
const;
116 virtual Iterator<node>* bfs(
const node root = node())
const;
117 virtual Iterator<node>* dfs(
const node root = node())
const;
118 virtual Iterator<edge>* getEdges()
const;
119 virtual Iterator<edge>* getOutEdges(
const node n)
const;
120 virtual Iterator<edge>* getInOutEdges(
const node n)
const;
121 virtual Iterator<edge>* getInEdges(
const node n)
const;
122 virtual Iterator<edge>* getEdgeMetaInfo(
const edge)
const;
124 virtual PropertyInterface* getProperty(
const std::string &name)
const;
125 virtual bool existProperty(
const std::string&name)
const;
126 virtual bool existLocalProperty(
const std::string&name)
const;
127 virtual void delLocalProperty(
const std::string&name);
128 virtual void addLocalProperty(
const std::string &name, PropertyInterface *prop);
129 virtual Iterator<std::string>* getLocalProperties()
const;
130 virtual Iterator<std::string>* getInheritedProperties()
const;
131 virtual Iterator<std::string>* getProperties()
const;
132 virtual Iterator<PropertyInterface*>* getLocalObjectProperties()
const;
133 virtual Iterator<PropertyInterface*>* getInheritedObjectProperties()
const;
134 virtual Iterator<PropertyInterface*>* getObjectProperties()
const;
136 virtual void push(
bool unpopAllowed =
true,
137 std::vector<PropertyInterface*>* propertiesToPreserveOnPop= NULL);
138 virtual void pop(
bool unpopAllowed =
true);
139 virtual void unpop();
140 virtual bool canPop();
141 virtual bool canUnpop();
142 virtual bool canPopThenUnpop();
145 virtual void setName(
const std::string &name);
146 virtual std::string getName()
const;
149 virtual DataSet & getNonConstAttributes();
150 Graph* graph_component;
153 virtual node restoreNode(node);
154 virtual edge restoreEdge(edge, node source, node target);
155 virtual void restoreNodes(
const std::vector<node>&);
156 virtual void restoreEdges(
const std::vector<edge>& edges,
157 const std::vector<std::pair<node, node> >& ends);
160 virtual void removeNode(
const node);
161 virtual void removeEdge(
const edge);
163 virtual void removeSubGraph(Graph*);
164 virtual void clearSubGraphs();
165 virtual void restoreSubGraph(Graph*);
166 virtual void setSubGraphToKeep(Graph*);
173 #endif //DOXYGEN_NOTFOR_DEVEL