21 #ifndef TULIP_SUPERGRAPHABSTRACT_H
22 #define TULIP_SUPERGRAPHABSTRACT_H
24 #ifndef DOXYGEN_NOTFOR_USER
28 #include <tulip/Graph.h>
29 #include <tulip/DataSet.h>
33 #define GRAPH_SEQ std::vector<Graph *>
35 template<
class C>
struct Iterator;
36 class PropertyManager;
40 class TLP_SCOPE GraphAbstract:
public Graph {
41 friend class PropertyManager;
43 GraphAbstract(Graph *supergraph,
unsigned int id);
45 virtual ~GraphAbstract();
47 virtual Graph *addSubGraph(BooleanProperty *selection=NULL,
48 const std::string& name =
"unnamed");
51 Graph *addSubGraph(
unsigned int id,
52 BooleanProperty *selection=NULL,
53 const std::string& name =
"");
54 virtual void delSubGraph(Graph *);
55 virtual void delAllSubGraphs(Graph *);
56 virtual Graph* getSuperGraph()
const;
57 virtual Graph* getRoot()
const;
58 virtual Iterator<Graph *>* getSubGraphs()
const;
59 virtual bool isSubGraph(
const Graph* sg)
const;
60 virtual bool isDescendantGraph(
const Graph* sg)
const;
61 virtual Graph* getSubGraph(
unsigned int id)
const;
62 virtual Graph* getSubGraph(
const std::string& name)
const;
63 virtual Graph* getDescendantGraph(
unsigned int id)
const;
64 virtual Graph* getDescendantGraph(
const std::string &name)
const;
65 virtual Graph *getNthSubGraph(
unsigned int n)
const;
66 virtual unsigned int numberOfSubGraphs()
const;
67 virtual unsigned int numberOfDescendantGraphs()
const;
70 virtual unsigned int deg(
const node)
const;
71 virtual unsigned int indeg(
const node)
const;
72 virtual unsigned int outdeg(
const node)
const;
73 virtual bool isMetaNode(
const node)
const;
74 virtual Graph* getNodeMetaInfo(
const node)
const;
75 virtual void delNodes(Iterator<node>* itN,
bool deleteInAllGraphs);
76 virtual node source(
const edge)
const;
77 virtual void setSource(
const edge,
const node);
78 virtual node target(
const edge)
const;
79 virtual void setTarget(
const edge,
const node);
80 virtual const std::pair<node, node>& ends(
const edge)
const;
81 virtual void setEnds(
const edge,
const node,
const node);
82 virtual node opposite(
const edge,
const node)
const;
83 virtual void reverse(
const edge);
84 virtual bool isMetaEdge(
const edge)
const;
85 virtual Iterator<edge>* getEdgeMetaInfo(
const edge)
const;
86 virtual void delEdges(Iterator<edge>* itE,
bool deleteInAllGraphs =
false);
88 virtual node getOneNode()
const;
89 virtual node getInNode(
const node,
unsigned int )
const;
90 virtual node getOutNode(
const node,
unsigned int )
const;
91 virtual edge getOneEdge()
const;
92 virtual unsigned int numberOfNodes()
const;
93 virtual unsigned int numberOfEdges()
const;
95 bool existProperty(
const std::string&)
const;
96 bool existLocalProperty(
const std::string&)
const;
97 void delLocalProperty(
const std::string&);
98 void addLocalProperty(
const std::string &name, PropertyInterface *prop);
99 Iterator<std::string>* getLocalProperties()
const;
100 Iterator<std::string>* getInheritedProperties()
const;
101 Iterator<std::string>* getProperties()
const;
102 Iterator<PropertyInterface*>* getLocalObjectProperties()
const;
103 Iterator<PropertyInterface*>* getInheritedObjectProperties()
const;
104 Iterator<PropertyInterface*>* getObjectProperties()
const;
105 PropertyInterface* getProperty(
const std::string &)
const;
108 GraphProperty* getMetaGraphProperty();
110 virtual void setName(
const std::string &name);
111 virtual std::string getName()
const;
113 virtual Iterator<node>* bfs(
const node root = node())
const;
114 virtual Iterator<node>* dfs(
const node root = node())
const;
117 DataSet& getNonConstAttributes();
118 void setSuperGraph(Graph *);
119 PropertyManager *propertyContainer;
120 const std::set<edge>& getReferencedEdges(
const edge)
const;
122 virtual bool renameLocalProperty(PropertyInterface *prop,
123 const std::string& newName);
126 virtual void clearSubGraphs();
127 virtual void removeSubGraph(Graph*);
128 virtual void restoreSubGraph(Graph*);
129 virtual void setSubGraphToKeep(Graph*);
136 Graph* subGraphToKeep;
138 GraphProperty* metaGraphProperty;
140 void notifyBeforeAddInheritedProperty(
const std::string& prop);
141 void notifyAddInheritedProperty(
const std::string& prop);
142 void notifyBeforeDelInheritedProperty(
const std::string& prop);
143 void notifyAfterDelInheritedProperty(
const std::string& prop);
145 void notifyBeforeRenameLocalProperty(PropertyInterface* prop,
146 const std::string& newName);
147 void notifyAfterRenameLocalProperty(PropertyInterface* prop,
148 const std::string& oldName);
152 #endif // DOXYGEN_NOTFOR_USER