32 #ifndef Tulip_SUPERGRAPHVIEW_H
33 #define Tulip_SUPERGRAPHVIEW_H
35 #ifndef DOXYGEN_NOTFOR_USER
37 #include <tulip/GraphAbstract.h>
38 #include <tulip/GraphImpl.h>
39 #include <tulip/MutableContainer.h>
47 class GraphView:
public GraphAbstract {
49 friend class GraphImpl;
51 GraphView(Graph *supergraph, BooleanProperty *filter,
unsigned int id = 0);
55 void addNodes(
unsigned int nb, std::vector<node>& addedNodes);
56 void addNode(
const node);
57 void addNodes(Iterator<node>* nodes);
58 edge addEdge(
const node n1,
const node n2);
59 void addEdges(
const std::vector<std::pair<node, node> >& edges,
60 std::vector<edge>& addedEdges);
61 void addEdge(
const edge);
62 void addEdges(Iterator<edge>* edges);
63 void delNode(
const tlp::node n,
bool deleteInAllGraphs =
false);
64 void delEdge(
const tlp::edge e,
bool deleteInAllGraphs =
false);
65 void setEdgeOrder(
const node,
const std::vector<edge> & );
66 void swapEdgeOrder(
const node,
const edge ,
const edge );
68 bool isElement(
const node )
const;
69 bool isElement(
const edge )
const;
70 edge existEdge(
const node source,
const node target,
72 unsigned int numberOfNodes()
const;
73 unsigned int numberOfEdges()
const;
75 unsigned int deg(
const node)
const;
76 unsigned int indeg(
const node)
const;
77 unsigned int outdeg(
const node)
const;
79 Iterator<node>* getNodes()
const;
80 Iterator<node>* getInNodes(
const node)
const;
81 Iterator<node>* getOutNodes(
const node)
const;
82 Iterator<node>* getInOutNodes(
const node)
const;
83 Iterator<edge>* getEdges()
const;
84 Iterator<edge>* getInEdges(
const node)
const;
85 Iterator<edge>* getOutEdges(
const node)
const;
86 Iterator<edge>* getInOutEdges(
const node)
const;
87 std::vector<edge> getEdges(
const node source,
const node target,
88 bool directed =
true)
const;
91 virtual void reserveNodes(
unsigned int nbNodes);
92 virtual void reserveEdges(
unsigned int nbEdges);
95 virtual void push(
bool unpopAllowed =
true,
96 std::vector<PropertyInterface*>* propertiesToPreserveOnPop= NULL);
97 virtual void pop(
bool unpopAllowed =
true);
99 virtual bool canPop();
100 virtual bool canUnpop();
101 virtual bool canPopThenUnpop();
106 virtual node restoreNode(node);
107 virtual void restoreNodes(
const std::vector<node>&);
108 virtual edge restoreEdge(edge, node source, node target);
109 virtual void restoreEdges(
const std::vector<edge>& edges,
110 const std::vector<std::pair<node, node> >& ends);
113 virtual void removeNode(
const node);
114 virtual void removeEdge(
const edge);
115 void removeNode(
const node n,
const std::vector<edge>& edges);
116 void removeEdges(
const std::vector<edge>& edges);
119 MutableContainer<bool> nodeAdaptativeFilter;
120 MutableContainer<bool> edgeAdaptativeFilter;
121 MutableContainer<unsigned int> outDegree;
122 MutableContainer<unsigned int> inDegree;
125 edge addEdgeInternal(edge);
126 void delEdgeInternal(
const edge);
127 void delNodeInternal(
const node);
128 void reverseInternal(
const edge,
const node src,
const node tgt);
129 void setEndsInternal(
const edge,
const node src,
const node tgt,
130 const node newSrc,
const node newTgt);