28 #include "../../common/Translator.h"
29 #include "../../common/progress/TaskProgress.h"
30 #include "../core/AbstractGraph.h"
31 #include "../core/Edge.h"
32 #include "../core/Vertex.h"
33 #include "../graphs/BidirectionalGraph.h"
34 #include "../graphs/Graph.h"
35 #include "../iterator/SequenceIterator.h"
36 #include "../Config.h"
37 #include "../Exception.h"
51 outGraph->
add(outVertex);
53 std::set<int> predecessors;
57 std::set<int>::iterator it = predecessors.begin();
59 std::set<int> vertexIdSet;
61 vertexIdSet.insert(vertex->
getId());
63 while(it != predecessors.end())
79 std::set<int>::iterator itSet = vertexIdSet.find(vFrom->
getId());
81 if(itSet == vertexIdSet.end())
83 vertexIdSet.insert(vFrom->
getId());
87 outGraph->
add(outVFrom);
106 std::set<int> predecessors;
110 std::set<int>::iterator it = predecessors.begin();
112 while(it != predecessors.end())
128 std::set<int>::iterator itSet = vertexIdSet.find(vFrom->
getId());
130 if(itSet == vertexIdSet.end())
132 vertexIdSet.insert(vFrom->
getId());
136 outGraph->
add(outVFrom);
138 getPredecessor(vFrom, g, outGraph, vertexIdSet);
std::set< int > & getPredecessors()
Returns the Predecessors vector.
void getPredecessor(te::graph::Vertex *v, te::graph::BidirectionalGraph *g, te::graph::AbstractGraph *outGraph, std::set< int > &vertexIdSet)
Recursive function used to calculate the deep attribute.
GetSubGraph(te::graph::BidirectionalGraph *graph, te::graph::AbstractGraph *outGraph, int vertexId)
Default constructor.
virtual te::graph::Edge * getEdge(int id)
It returns the edge element if it's exist.
virtual void add(Vertex *v)=0
Add a new vertex element to a graph.
From the point of view of graph theory, vertices are treated as featureless and indivisible objects...
Class used to define the edge struct of a graph. Its compose with a identifier, the vertex origin and...
virtual ~GetSubGraph()
Virtual destructor.
Abstract class used to define the main functions of graph struct. All graph implementations must used...
int getIdFrom()
It returns the vertex origin identification.
This class defines a function used to get a sub graph for a graph.
virtual te::graph::Vertex * getVertex(int id)
It returns the vertex element if it's exist.
int getId()
It returns the vertex id.
This is a implementation of a Bidirectional Graph. By convention a bidirectional graph provides acces...