Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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 
40 #include <ogdf/basic/Math.h>
44 
45 #include <memory>
46 
47 namespace ogdf {
48 
50 public:
52  m_grid_dist = 1;
53  // set default module
54  m_upPlanarizer.reset(new SubgraphUpwardPlanarizer());
55 
56  m_angle = Math::degreesToRadians(45.0);
57  }
58 
59  virtual void call(GraphAttributes& GA) override;
60 
61  void layout(GraphAttributes& GA, const UpwardPlanRep& UPROrig);
62 
64  m_upPlanarizer.reset(upPlanarizer);
65  }
66 
67  void setMinGridDistance(int dist) { m_grid_dist = dist; }
68 
69 
70 private:
71  double m_angle; //rotate angle to obtain an upward drawing; default is 45°
72 
77 
78  int m_R;
79  int m_L;
80 
81  // list of nodes sorted by their x and y coordinate.
84 
85  //coordinate in preliminary layout
88 
89  //final coordinate of the nodes of the UPR
92 
93 
94  //min grid distance
96 
97  std::unique_ptr<UpwardPlanarizerModule> m_upPlanarizer; // upward planarizer
98 
99  void labelX(const UpwardPlanRep& UPR, node v, int& count);
100 
101  void labelY(const UpwardPlanRep& UPR, node v, int& count);
102 
103  void compact(const UpwardPlanRep& UPR, GraphAttributes& GA);
104 
105  void findTransitiveEdges(const UpwardPlanRep& UPR, List<edge>& edges);
106 };
107 
108 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:66
GraphAttributes.h
Declaration of class GraphAttributes which extends a Graph by additional attributes.
ogdf::SubgraphUpwardPlanarizer
Takes an acyclic connected non-upward-planar graph and planarizes it, i.e., we obtain an upward-plana...
Definition: SubgraphUpwardPlanarizer.h:67
ogdf::DominanceLayout::m_R
int m_R
Definition: DominanceLayout.h:78
ogdf::DominanceLayout::firstin
NodeArray< edge > firstin
Definition: DominanceLayout.h:75
ogdf::DominanceLayout::DominanceLayout
DominanceLayout()
Definition: DominanceLayout.h:51
ogdf::DominanceLayout::yCoord
NodeArray< int > yCoord
Definition: DominanceLayout.h:91
ogdf::DominanceLayout::yPreCoord
NodeArray< int > yPreCoord
Definition: DominanceLayout.h:87
UpwardPlanRep.h
Declaration of a base class for planar representations of graphs and cluster graphs.
LayoutModule.h
Declaration of interface for layout algorithms (class LayoutModule)
ogdf::DominanceLayout::lastout
NodeArray< edge > lastout
Definition: DominanceLayout.h:74
ogdf::DominanceLayout::setUpwardPlanarizer
void setUpwardPlanarizer(UpwardPlanarizerModule *upPlanarizer)
Definition: DominanceLayout.h:63
SubgraphUpwardPlanarizer.h
Declaration of class SubgraphUpwardPlanarizer.
ogdf::DominanceLayout::yNodes
List< node > yNodes
Definition: DominanceLayout.h:83
ogdf::DominanceLayout::xCoord
NodeArray< int > xCoord
Definition: DominanceLayout.h:90
ogdf::DominanceLayout::setMinGridDistance
void setMinGridDistance(int dist)
Definition: DominanceLayout.h:67
ogdf::DominanceLayout::m_L
int m_L
Definition: DominanceLayout.h:79
ogdf::DominanceLayout::m_angle
double m_angle
Definition: DominanceLayout.h:71
ogdf::Math::degreesToRadians
double degreesToRadians(const double &angleInDegrees)
Converts an angle from degrees to radians.
Definition: Math.h:125
ogdf::DominanceLayout::firstout
NodeArray< edge > firstout
Definition: DominanceLayout.h:73
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:42
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::DominanceLayout::lastin
NodeArray< edge > lastin
Definition: DominanceLayout.h:76
Math.h
Mathematical Helpers.
ogdf::DominanceLayout::m_grid_dist
int m_grid_dist
Definition: DominanceLayout.h:95
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::DominanceLayout::xNodes
List< node > xNodes
Definition: DominanceLayout.h:82
UpwardPlanarizerModule.h
Declaration of UpwardPlanarizer Module, an interface for upward planarization algorithms.
ogdf::DominanceLayout::m_upPlanarizer
std::unique_ptr< UpwardPlanarizerModule > m_upPlanarizer
Definition: DominanceLayout.h:97
ogdf::UpwardPlanarizerModule
Interface for upward planarization algorithms.
Definition: UpwardPlanarizerModule.h:43
ogdf::DominanceLayout::xPreCoord
NodeArray< int > xPreCoord
Definition: DominanceLayout.h:86
ogdf::UpwardPlanRep
Upward planarized representations (of a connected component) of a graph.
Definition: UpwardPlanRep.h:50
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::LayoutModule
Interface of general layout algorithms.
Definition: LayoutModule.h:44
ogdf::DominanceLayout
Definition: DominanceLayout.h:49