Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

DominanceLayout.h
Go to the documentation of this file.
1 
32 //***
33 // Dominance Drawing Method. see "Graph Drawing" by Di Battista et al.
34 //***
35 
36 #pragma once
37 
39 #include <memory>
40 #include <ogdf/basic/Math.h>
45 
46 namespace ogdf {
47 
48 
50 {
51 public:
52 
54  m_grid_dist = 1;
55  // set default module
56  m_upPlanarizer.reset(new SubgraphUpwardPlanarizer());
57 
58  m_angle = 45.0 / 180.0 * Math::pi;
59 
60  }
61 
62  virtual void call(GraphAttributes &GA) override;
63 
64  void layout(GraphAttributes &GA, const UpwardPlanRep &UPROrig);
65 
67  m_upPlanarizer.reset(upPlanarizer);
68  }
69 
70  void setMinGridDistance(int dist) {m_grid_dist = dist;}
71 
72 
73 
74 private:
75 
76  double m_angle; //rotate angle to obtain an upward drawing; default is 45°
77 
82 
83  int m_R;
84  int m_L;
85 
86  // list of nodes sorted by their x and y coordinate.
89 
90  //coordinate in preliminary layout
93 
94  //final coordinate of the nodes of the UPR
97 
98 
99  //min grid distance
101 
102  std::unique_ptr<UpwardPlanarizerModule> m_upPlanarizer; // upward planarizer
103 
104  void labelX(const UpwardPlanRep &UPR, node v, int &count);
105 
106  void labelY(const UpwardPlanRep &UPR, node v, int &count);
107 
108  void compact(const UpwardPlanRep &UPR, GraphAttributes &GA);
109 
110  void findTransitiveEdges(const UpwardPlanRep &UPR, List<edge> &edges);
111 
112 };
113 
114 
115 }//namespace
static const double pi
The constant .
Definition: Math.h:46
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Interface for upward planarization algorithms.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
Declaration of a base class for planar representations of graphs and cluster graphs.
Upward planarized representations (of a connected component) of a graph.
Definition: UpwardPlanRep.h:51
Declaration of UpwardPlanarizer Module, an interface for upward planarization algorithms.
NodeArray< edge > firstin
NodeArray< int > yCoord
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:423
NodeArray< int > xCoord
void setMinGridDistance(int dist)
Declaration of class SubgraphUpwardPlanarizer.
Mathematical Helpers.
NodeArray< edge > lastout
Stores additional attributes of a graph (like layout information).
Doubly linked lists (maintaining the length of the list).
Definition: List.h:39
NodeArray< edge > firstout
NodeArray< int > yPreCoord
Declaration of interface for layout algorithms (class LayoutModule)
Class for the representation of nodes.
Definition: Graph_d.h:167
Interface of general layout algorithms.
Definition: LayoutModule.h:44
void setUpwardPlanarizer(UpwardPlanarizerModule *upPlanarizer)
std::unique_ptr< UpwardPlanarizerModule > m_upPlanarizer
NodeArray< int > xPreCoord
The namespace for all OGDF objects.
NodeArray< edge > lastin