21 #ifndef TULIP_SUPERGRAPHABSTRACT_H
22 #define TULIP_SUPERGRAPHABSTRACT_H
24 #ifndef DOXYGEN_NOTFOR_USER
27 #include <tulip/Graph.h>
28 #include <tulip/DataSet.h>
32 #define GRAPH_SEQ std::vector<Graph *>
34 template<
class C>
struct Iterator;
35 class PropertyManager;
39 class GraphAbstract:
public Graph {
40 friend class PropertyManager;
42 GraphAbstract(Graph *supergraph,
unsigned int id);
44 virtual ~GraphAbstract();
46 virtual Graph *addSubGraph(BooleanProperty *selection=0,
48 virtual void delSubGraph(Graph *);
49 virtual void delAllSubGraphs(Graph *);
50 virtual Graph* getSuperGraph()
const;
51 virtual Graph* getRoot()
const;
52 virtual Iterator<Graph *>* getSubGraphs()
const;
53 virtual bool isSubGraph(
const Graph* sg)
const;
54 virtual bool isDescendantGraph(
const Graph* sg)
const;
55 virtual Graph* getSubGraph(
unsigned int id)
const;
56 virtual Graph* getSubGraph(
const std::string &name)
const;
57 virtual Graph* getDescendantGraph(
unsigned int id)
const;
58 virtual Graph* getDescendantGraph(
const std::string &name)
const;
59 virtual Graph *getNthSubGraph(
unsigned int n)
const;
60 virtual unsigned int numberOfSubGraphs()
const;
61 virtual unsigned int numberOfDescendantGraphs()
const;
64 virtual unsigned int deg(
const node)
const;
65 virtual unsigned int indeg(
const node)
const;
66 virtual unsigned int outdeg(
const node)
const;
67 virtual bool isMetaNode(
const node)
const;
68 virtual Graph* getNodeMetaInfo(
const node)
const;
69 virtual void delNodes(Iterator<node>* itN,
bool deleteInAllGraphs);
70 virtual node source(
const edge)
const;
71 virtual void setSource(
const edge,
const node);
72 virtual node target(
const edge)
const;
73 virtual void setTarget(
const edge,
const node);
74 virtual const std::pair<node, node>& ends(
const edge)
const;
75 virtual void setEnds(
const edge,
const node,
const node);
76 virtual node opposite(
const edge,
const node)
const;
77 virtual edge existEdge(
const node ,
const node,
bool)
const;
78 virtual void reverse(
const edge);
79 virtual bool isMetaEdge(
const edge)
const;
80 virtual Iterator<edge>* getEdgeMetaInfo(
const edge)
const;
81 virtual void delEdges(Iterator<edge>* itE,
bool deleteInAllGraphs =
false);
83 virtual node getOneNode()
const;
84 virtual node getInNode(
const node,
unsigned int )
const;
85 virtual node getOutNode(
const node,
unsigned int )
const;
86 virtual edge getOneEdge()
const;
87 virtual unsigned int numberOfNodes()
const;
88 virtual unsigned int numberOfEdges()
const;
90 bool existProperty(
const std::string&)
const;
91 bool existLocalProperty(
const std::string&)
const;
92 void delLocalProperty(
const std::string&);
93 void addLocalProperty(
const std::string &name, PropertyInterface *prop);
94 Iterator<std::string>* getLocalProperties()
const;
95 Iterator<std::string>* getInheritedProperties()
const;
96 Iterator<std::string>* getProperties()
const;
97 Iterator<PropertyInterface*>* getLocalObjectProperties()
const;
98 Iterator<PropertyInterface*>* getInheritedObjectProperties()
const;
99 Iterator<PropertyInterface*>* getObjectProperties()
const;
100 PropertyInterface* getProperty(
const std::string &)
const;
103 GraphProperty* getMetaGraphProperty();
105 virtual void setName(
const std::string &name);
106 virtual std::string getName()
const;
109 DataSet& getNonConstAttributes();
110 void setSuperGraph(Graph *);
111 PropertyManager *propertyContainer;
112 const std::set<edge>& getReferencedEdges(
const edge)
const;
115 virtual void clearSubGraphs();
116 virtual void removeSubGraph(Graph*);
117 virtual void restoreSubGraph(Graph*);
118 virtual void setSubGraphToKeep(Graph*);
125 Graph* subGraphToKeep;
127 GraphProperty* metaGraphProperty;
129 void notifyBeforeAddInheritedProperty(
const std::string& prop);
130 void notifyAddInheritedProperty(
const std::string& prop);
131 void notifyBeforeDelInheritedProperty(
const std::string& prop);
132 void notifyAfterDelInheritedProperty(
const std::string& prop);
136 #endif // DOXYGEN_NOTFOR_USER