GraphTool  1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
swu_graph_model.h
1 #ifndef GUI_SWU_GRAPH_MODEL_H_
2 #define GUI_SWU_GRAPH_MODEL_H_
3 
4 #include "grapher.h" // Grapher
5 #include "linkler.h" // CompareSWUByName
6 #include "swu.h" // SWU
7 #include "graph_model_item.h"
8 #include "graph_filter_list.h"
9 #include "graph_properties.h"
10 #include <QDebug>
11 #include <QColor>
12 #include <queue>
13 #include <algorithm>
14 #include "algorithms.h"
15 #include "graph_model.h"
16 
17 
18 class SWUGraphModelItem;
19 
24 class SWUGraphModel : public GraphModel {
25  public:
27  typedef SWU NodeType;
28 
31 
34 
36  SWUGraphModel(GraphType* g, QObject* parent = 0);
37  ~SWUGraphModel();
38 
40  void buildTree(SWU* root, bool dependents, bool dependencies, GraphFilterList<GraphType>* filter = 0, GraphProperties<GraphType>* properties = 0);
41 
43  void buildGraph(GraphFilterList<GraphType>* filter_ = 0, GraphProperties<GraphType>* properties = 0);
44 
45  // Access the internal grapher object
46  GraphType* grapher();
47 
48  private:
49  GraphType* g_;
50 
52  void add_node(std::pair<GraphType::index_type_t,
54 
56  void add_edge(std::pair<std::pair<GraphType::index_type_t,
59 
64  SWUGraphModelItem* add_node(NodeType* item, SWUGraphModelItem* parent = 0, EdgeType* incoming_edge = 0, bool add_existing = true);
65 
67  GraphProperties<GraphType>* properties_;
68 
69 };
70 
71 #endif
A class representing a single SWU in the QT graph model.
Definition: swu_graph_model_item.h:14
Grapher< NodeType *, EdgeType *, CompareSWUByName, CompareSWUDependency > GraphType
Typedef for the graph type that this model supports.
Definition: swu_graph_model.h:33
Definition: graph_model.h:36
void buildTree(SWU *root, bool dependents, bool dependencies, GraphFilterList< GraphType > *filter=0, GraphProperties< GraphType > *properties=0)
This builds the internal data model with the root as a specific SWU.
Definition: swu_graph_model.cc:21
Dependency< SWU, SWU > EdgeType
Typedef to provide information about which edge this graph stores.
Definition: swu_graph_model.h:30
QModelIndex parent(const QModelIndex &index) const
Provides the parent for a given index.
Definition: graph_model.cc:44
Forward declarations for functors.
Definition: defines.h:32
Definition: graph_filter_list.h:16
E_type edge_value_type
Accessor for the type of value stored in the edges.
Definition: grapher.h:58
Definition: graph_properties.h:7
Definition: grapher.h:30
Definition: swu.h:27
V_type node_value_type
Accessor for the type of value stored in the nodes.
Definition: grapher.h:55
SWUGraphModel(GraphType *g, QObject *parent=0)
Constructor, provide a graph from which to construct this Graph Model with.
Definition: swu_graph_model.cc:3
SWU NodeType
Typedef to provide information about which node this graph stores.
Definition: swu_graph_model.h:27
void buildGraph(GraphFilterList< GraphType > *filter_=0, GraphProperties< GraphType > *properties=0)
This builds the internal data model as an adjacency list (used for graph representations) ...
Definition: swu_graph_model.cc:74
Definition: swu_graph_model.h:24
unsigned int index_type_t
The type of index used for the nodes in the graph.
Definition: grapher.h:52