22 #ifndef Tulip_SUPERGRAPHVIEW_H
23 #define Tulip_SUPERGRAPHVIEW_H
25 #ifndef DOXYGEN_NOTFOR_USER
27 #include <tulip/GraphAbstract.h>
28 #include <tulip/GraphImpl.h>
29 #include <tulip/MutableContainer.h>
37 class GraphView:
public GraphAbstract {
39 friend class GraphImpl;
41 GraphView(Graph *supergraph, BooleanProperty *filter,
unsigned int id = 0);
45 void addNodes(
unsigned int nb, std::vector<node>& addedNodes);
46 void addNode(
const node);
47 void addNodes(Iterator<node>* nodes);
48 edge addEdge(
const node n1,
const node n2);
49 void addEdges(
const std::vector<std::pair<node, node> >& edges,
50 std::vector<edge>& addedEdges);
51 void addEdge(
const edge);
52 void addEdges(Iterator<edge>* edges);
53 void delNode(
const tlp::node n,
bool deleteInAllGraphs =
false);
54 void delEdge(
const tlp::edge e,
bool deleteInAllGraphs =
false);
55 void setEdgeOrder(
const node,
const std::vector<edge> & );
56 void swapEdgeOrder(
const node,
const edge ,
const edge );
58 bool isElement(
const node )
const;
59 bool isElement(
const edge )
const;
60 edge existEdge(
const node source,
const node target,
62 unsigned int numberOfNodes()
const;
63 unsigned int numberOfEdges()
const;
65 unsigned int deg(
const node)
const;
66 unsigned int indeg(
const node)
const;
67 unsigned int outdeg(
const node)
const;
69 Iterator<node>* getNodes()
const;
70 Iterator<node>* getInNodes(
const node)
const;
71 Iterator<node>* getOutNodes(
const node)
const;
72 Iterator<node>* getInOutNodes(
const node)
const;
73 Iterator<edge>* getEdges()
const;
74 Iterator<edge>* getInEdges(
const node)
const;
75 Iterator<edge>* getOutEdges(
const node)
const;
76 Iterator<edge>* getInOutEdges(
const node)
const;
77 std::vector<edge> getEdges(
const node source,
const node target,
78 bool directed =
true)
const;
81 virtual void reserveNodes(
unsigned int nbNodes);
82 virtual void reserveEdges(
unsigned int nbEdges);
85 virtual void push(
bool unpopAllowed =
true,
86 std::vector<PropertyInterface*>* propertiesToPreserveOnPop= NULL);
87 virtual void pop(
bool unpopAllowed =
true);
89 virtual bool canPop();
90 virtual bool canUnpop();
91 virtual bool canPopThenUnpop();
96 virtual node restoreNode(node);
97 virtual void restoreNodes(
const std::vector<node>&);
98 virtual edge restoreEdge(edge, node source, node target);
99 virtual void restoreEdges(
const std::vector<edge>& edges,
100 const std::vector<std::pair<node, node> >& ends);
103 virtual void removeNode(
const node);
104 virtual void removeEdge(
const edge);
105 void removeNode(
const node n,
const std::vector<edge>& edges);
106 void removeEdges(
const std::vector<edge>& edges);
109 MutableContainer<bool> nodeAdaptativeFilter;
110 MutableContainer<bool> edgeAdaptativeFilter;
111 MutableContainer<unsigned int> outDegree;
112 MutableContainer<unsigned int> inDegree;
115 edge addEdgeInternal(edge);
116 void delEdgeInternal(
const edge);
117 void delNodeInternal(
const node);
118 void reverseInternal(
const edge,
const node src,
const node tgt);
119 void setEndsInternal(
const edge,
const node src,
const node tgt,
120 const node newSrc,
const node newTgt);
The edge struct represents an edge in a Graph object.
The node struct represents a node in a Graph object.