21 #ifndef Tulip_SUPERGRAPHVIEW_H 22 #define Tulip_SUPERGRAPHVIEW_H 24 #include <tulip/GraphAbstract.h> 25 #include <tulip/GraphImpl.h> 26 #include <tulip/MutableContainer.h> 34 class GraphView:
public GraphAbstract {
36 friend class GraphImpl;
38 GraphView(Graph *supergraph, BooleanProperty *filter,
unsigned int id = 0);
42 void addNodes(
unsigned int nb, std::vector<node>& addedNodes);
43 void addNode(
const node);
45 edge addEdge(
const node n1,
const node n2);
46 void addEdges(
const std::vector<std::pair<node, node> >& edges,
47 std::vector<edge>& addedEdges);
48 void addEdge(
const edge);
50 void delNode(
const tlp::node n,
bool deleteInAllGraphs =
false);
51 void delEdge(
const tlp::edge e,
bool deleteInAllGraphs =
false);
52 void setEdgeOrder(
const node,
const std::vector<edge> & );
53 void swapEdgeOrder(
const node,
const edge ,
const edge );
55 bool isElement(
const node )
const;
56 bool isElement(
const edge )
const;
57 edge existEdge(
const node source,
const node target,
59 unsigned int numberOfNodes()
const;
60 unsigned int numberOfEdges()
const;
62 unsigned int deg(
const node)
const;
63 unsigned int indeg(
const node)
const;
64 unsigned int outdeg(
const node)
const;
74 std::vector<edge> getEdges(
const node source,
const node target,
75 bool directed =
true)
const;
78 virtual void reserveNodes(
unsigned int nbNodes);
79 virtual void reserveEdges(
unsigned int nbEdges);
82 virtual void push(
bool unpopAllowed =
true,
83 std::vector<PropertyInterface*>* propertiesToPreserveOnPop= NULL);
84 virtual void pop(
bool unpopAllowed =
true);
86 virtual bool canPop();
87 virtual bool canUnpop();
88 virtual bool canPopThenUnpop();
93 virtual node restoreNode(node);
94 virtual void restoreNodes(
const std::vector<node>&);
95 virtual edge restoreEdge(edge, node source, node target);
96 virtual void restoreEdges(
const std::vector<edge>& edges,
97 const std::vector<std::pair<node, node> >& ends);
100 virtual void removeNode(
const node);
101 virtual void removeEdge(
const edge);
102 void removeNode(
const node n,
const std::vector<edge>& edges);
103 void removeEdges(
const std::vector<edge>& edges);
106 MutableContainer<bool> nodeAdaptativeFilter;
107 MutableContainer<bool> edgeAdaptativeFilter;
108 MutableContainer<unsigned int> outDegree;
109 MutableContainer<unsigned int> inDegree;
112 edge addEdgeInternal(edge);
113 void reverseInternal(
const edge,
const node src,
const node tgt);
114 void setEndsInternal(
const edge,
const node src,
const node tgt,
115 const node newSrc,
const node newTgt);
Interface for Tulip iterators. Allows basic iteration operations only.
The edge struct represents an edge in a Graph object.
The node struct represents a node in a Graph object.