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,
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 const std::pair<node, node>& ends(
const edge e)
const;
66 virtual void setEnds(
const edge,
const node,
const node);
67 virtual void reverse(
const edge e);
68 virtual unsigned int deg(
const node n)
const;
69 virtual unsigned int indeg(
const node n)
const;
70 virtual unsigned int outdeg(
const node n)
const;
71 virtual Graph* getNodeMetaInfo(
const node n)
const;
74 virtual node getOneNode()
const;
75 virtual node getInNode(
const node n,
unsigned int i)
const;
76 virtual node getOutNode(
const node n,
unsigned int i)
const;
77 virtual edge getOneEdge()
const;
79 virtual unsigned int numberOfNodes()
const;
80 virtual unsigned int numberOfEdges()
const;
84 virtual void reserveNodes(
unsigned int nbNodes);
85 virtual void reserveEdges(
unsigned int nbEdges);
88 virtual bool isElement(
const node n)
const;
89 virtual bool isMetaNode(
const node n)
const;
90 virtual bool isElement(
const edge e)
const;
91 virtual bool isMetaEdge(
const edge e)
const;
92 virtual node addNode();
93 virtual void addNodes(
unsigned int nb, std::vector<node>& addedNodes);
94 virtual void addNode(
const node);
95 virtual void addNodes(Iterator<node>* nodes);
96 virtual edge addEdge(
const node n1,
const node n2);
97 virtual void addEdges(
const std::vector<std::pair<node, node> >& edges,
98 std::vector<edge>& addedEdges);
99 virtual void addEdge(
const edge);
100 virtual void addEdges(Iterator<edge>* edges);
101 virtual void delNode(
const tlp::node n,
bool deleteInAllGraphs =
false);
102 virtual void delNodes(Iterator<node>* itN,
bool deleteInAllGraphs);
103 virtual void delEdge(
const tlp::edge e,
bool deleteInAllGraphs =
false);
104 virtual void delEdges(Iterator<edge>* itE,
bool deleteInAllGraphs =
false);
105 virtual void setEdgeOrder(
const node n,
const std::vector<edge> & s);
106 virtual void swapEdgeOrder(
const node n ,
const edge e1,
const edge e2);
108 virtual Iterator<node>* getNodes()
const;
109 virtual Iterator<node>* getInNodes(
const node n)
const;
110 virtual Iterator<node>* getOutNodes(
const node n)
const;
111 virtual Iterator<node>* getInOutNodes(
const node n)
const;
112 virtual Iterator<edge>* getEdges()
const;
113 virtual Iterator<edge>* getOutEdges(
const node n)
const;
114 virtual Iterator<edge>* getInOutEdges(
const node n)
const;
115 virtual Iterator<edge>* getInEdges(
const node n)
const;
116 virtual Iterator<edge>* getEdgeMetaInfo(
const edge)
const;
118 virtual PropertyInterface* getProperty(
const std::string &name)
const;
119 virtual bool existProperty(
const std::string&name)
const;
120 virtual bool existLocalProperty(
const std::string&name)
const;
121 virtual void delLocalProperty(
const std::string&name);
122 virtual void addLocalProperty(
const std::string &name, PropertyInterface *prop);
123 virtual Iterator<std::string>* getLocalProperties()
const;
124 virtual Iterator<std::string>* getInheritedProperties()
const;
125 virtual Iterator<std::string>* getProperties()
const;
126 virtual Iterator<PropertyInterface*>* getLocalObjectProperties()
const;
127 virtual Iterator<PropertyInterface*>* getInheritedObjectProperties()
const;
128 virtual Iterator<PropertyInterface*>* getObjectProperties()
const;
130 virtual void push(
bool unpopAllowed =
true,
131 std::vector<PropertyInterface*>* propertiesToPreserveOnPop= NULL);
132 virtual void pop(
bool unpopAllowed =
true);
133 virtual void unpop();
134 virtual bool canPop();
135 virtual bool canUnpop();
136 virtual bool canPopThenUnpop();
139 virtual void setName(
const std::string &name);
140 virtual std::string getName()
const;
143 virtual DataSet & getNonConstAttributes();
144 Graph* graph_component;
147 virtual node restoreNode(node);
148 virtual edge restoreEdge(edge, node source, node target);
149 virtual void restoreNodes(
const std::vector<node>&);
150 virtual void restoreEdges(
const std::vector<edge>& edges,
151 const std::vector<std::pair<node, node> >& ends);
154 virtual void removeNode(
const node);
155 virtual void removeEdge(
const edge);
157 virtual void removeSubGraph(Graph*);
158 virtual void clearSubGraphs();
159 virtual void restoreSubGraph(Graph*);
160 virtual void setSubGraphToKeep(Graph*);
167 #endif //DOXYGEN_NOTFOR_DEVEL