Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

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 
49 {
50 public:
51 
53  m_grid_dist = 1;
54  // set default module
55  m_upPlanarizer.reset(new SubgraphUpwardPlanarizer());
56 
57  m_angle = Math::degreesToRadians(45.0);
58 
59  }
60 
61  virtual void call(GraphAttributes &GA) override;
62 
63  void layout(GraphAttributes &GA, const UpwardPlanRep &UPROrig);
64 
66  m_upPlanarizer.reset(upPlanarizer);
67  }
68 
69  void setMinGridDistance(int dist) {m_grid_dist = dist;}
70 
71 
72 
73 private:
74 
75  double m_angle; //rotate angle to obtain an upward drawing; default is 45°
76 
81 
82  int m_R;
83  int m_L;
84 
85  // list of nodes sorted by their x and y coordinate.
88 
89  //coordinate in preliminary layout
92 
93  //final coordinate of the nodes of the UPR
96 
97 
98  //min grid distance
100 
101  std::unique_ptr<UpwardPlanarizerModule> m_upPlanarizer; // upward planarizer
102 
103  void labelX(const UpwardPlanRep &UPR, node v, int &count);
104 
105  void labelY(const UpwardPlanRep &UPR, node v, int &count);
106 
107  void compact(const UpwardPlanRep &UPR, GraphAttributes &GA);
108 
109  void findTransitiveEdges(const UpwardPlanRep &UPR, List<edge> &edges);
110 };
111 
112 }
Takes an acyclic connected non-upward-planar graph and planarizes it, i.e., we obtain an upward-plana...
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.
double degreesToRadians(const double &angleInDegrees)
Converts an angle from degrees to radians.
Definition: Math.h:128
NodeArray< edge > firstin
NodeArray< int > yCoord
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:438
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:40
NodeArray< edge > firstout
NodeArray< int > yPreCoord
Declaration of interface for layout algorithms (class LayoutModule)
Class for the representation of nodes.
Definition: Graph_d.h:169
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