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 unsigned int numberOfNodes()
const;
71 unsigned int numberOfEdges()
const;
73 unsigned int deg(
const node)
const;
74 unsigned int indeg(
const node)
const;
75 unsigned int outdeg(
const node)
const;
77 Iterator<node>* getNodes()
const;
78 Iterator<node>* getInNodes(
const node)
const;
79 Iterator<node>* getOutNodes(
const node)
const;
80 Iterator<node>* getInOutNodes(
const node)
const;
81 Iterator<edge>* getEdges()
const;
82 Iterator<edge>* getInEdges(
const node)
const;
83 Iterator<edge>* getOutEdges(
const node)
const;
84 Iterator<edge>* getInOutEdges(
const node)
const;
87 virtual void reserveNodes(
unsigned int nbNodes);
88 virtual void reserveEdges(
unsigned int nbEdges);
91 virtual void push(
bool unpopAllowed =
true,
92 std::vector<PropertyInterface*>* propertiesToPreserveOnPop= NULL);
93 virtual void pop(
bool unpopAllowed =
true);
95 virtual bool canPop();
96 virtual bool canUnpop();
97 virtual bool canPopThenUnpop();
102 virtual node restoreNode(node);
103 virtual void restoreNodes(
const std::vector<node>&);
104 virtual edge restoreEdge(edge, node source, node target);
105 virtual void restoreEdges(
const std::vector<edge>& edges,
106 const std::vector<std::pair<node, node> >& ends);
109 virtual void removeNode(
const node);
110 virtual void removeEdge(
const edge);
111 void removeNode(
const node n,
const std::vector<edge>& edges);
112 void removeEdges(
const std::vector<edge>& edges);
115 MutableContainer<bool> nodeAdaptativeFilter;
116 MutableContainer<bool> edgeAdaptativeFilter;
117 MutableContainer<unsigned int> outDegree;
118 MutableContainer<unsigned int> inDegree;
121 edge addEdgeInternal(edge);
122 void delEdgeInternal(
const edge);
123 void delNodeInternal(
const node);
124 void reverse(
const edge,
const node src,
const node tgt);
125 void setEnds(
const edge,
const node src,
const node tgt,
126 const node newSrc,
const node newTgt);