GraphTool  1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
ForceLayout.h
1 #ifndef FORCE_DIRECTED_LAYOUT_H
2 #define FORCE_DIRECTED_LAYOUT_H
3 
4 #include <vector>
5 #include <utility> // pair
6 
7 #include "AdjacencyList.h"
8 
9 namespace Layout {
10 
11  namespace {
12  struct Node {
13  // node index
14  int index;
15 
16  // position
17  double x;
18  double y;
19 
20  // movement
21  double dx;
22  double dy;
23  };
24 
25  struct Edge {
26  int from;
27  int to;
28 
29  double equilibrium_length;
30  double stiffness;
31  };
32  }
33 
34  // force directed layout
35  std::vector< std::pair<int, int> >* layout(AdjacencyList& g, int steps, int width, int height);
36 }
37 
38 #endif
Definition: AdjacencyList.h:9