graph_analysis
QBaseGraph.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_GUI_QBASEGRAPH_H
2 #define GRAPH_ANALYSIS_GUI_QBASEGRAPH_H
3 
4 #include <QObject>
5 #include "../BaseGraph.hpp"
6 #include "../BaseGraphObserver.hpp"
7 
8 namespace graph_analysis
9 {
10 namespace gui
11 {
12 
22 class QBaseGraph : public QObject, public BaseGraphObserver
23 {
24  Q_OBJECT
25 
26 public:
27  QBaseGraph(QObject* parent = NULL);
28  QBaseGraph(graph_analysis::BaseGraph::Ptr graph, QObject* parent = NULL);
29 
30  ~QBaseGraph();
31 
32  virtual QString getClassName() const
33  {
34  return "graph_analysis::gui::QBaseGraph";
35  }
36 
38  {
39  return mpGraph;
40  }
41 
42 private:
44 
45  // Implemented virtual functions
46  void notify(const Vertex::Ptr& vertex, const EventType& event,
47  const GraphId& origin);
48  void notify(const Edge::Ptr& edge, const EventType& event,
49  const GraphId& origin);
50 
51 
52 signals:
53  void graphChanged();
54 };
55 
56 } // end namespace gui
57 } // end namespace graph_analysis
58 #endif
graph_analysis::GraphId
uint32_t GraphId
Definition: GraphElement.hpp:22
graph_analysis::gui::QBaseGraph::getClassName
virtual QString getClassName() const
Definition: QBaseGraph.hpp:32
graph_analysis::gui::QBaseGraph::QBaseGraph
QBaseGraph(QObject *parent=NULL)
Definition: QBaseGraph.cpp:13
graph_analysis
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
graph_analysis::BaseGraph::Ptr
shared_ptr< BaseGraph > Ptr
Definition: BaseGraph.hpp:34
graph_analysis::Edge::Ptr
shared_ptr< Edge > Ptr
Definition: Edge.hpp:21
graph_analysis::gui::QBaseGraph::~QBaseGraph
~QBaseGraph()
Definition: QBaseGraph.cpp:27
graph_analysis::gui::QBaseGraph
This class converts the callback based interface to the base graph into a Qt signal It implements a v...
Definition: QBaseGraph.hpp:22
graph_analysis::gui::QBaseGraph::graphChanged
void graphChanged()
graph_analysis::Vertex::Ptr
shared_ptr< Vertex > Ptr
Definition: Vertex.hpp:22
graph_analysis::EventType
EventType
Types of events for the observer. Example: notify(vertex, EVENT_TYPE_ADDED, ...) is called whenever a...
Definition: BaseGraphObserver.hpp:15
graph_analysis::gui::QBaseGraph::getBaseGraph
graph_analysis::BaseGraph::Ptr getBaseGraph() const
Definition: QBaseGraph.hpp:37
graph_analysis::BaseGraphObserver
Virtual interface class for observing a base graph.
Definition: BaseGraphObserver.hpp:36