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 
38 #include <ogdf/basic/Graph.h>
40 #include <ogdf/basic/List.h>
41 #include <ogdf/basic/Math.h>
42 #include <ogdf/basic/basic.h>
45 
46 #include <memory>
47 
48 namespace ogdf {
49 class GraphAttributes;
50 class UpwardPlanRep;
51 
53 public:
55  m_grid_dist = 1;
56  // set default module
57  m_upPlanarizer.reset(new SubgraphUpwardPlanarizer());
58 
59  m_angle = Math::degreesToRadians(45.0);
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 private:
74  double m_angle; //rotate angle to obtain an upward drawing; default is 45°
75 
80 
81  int m_R;
82  int m_L;
83 
84  // list of nodes sorted by their x and y coordinate.
87 
88  //coordinate in preliminary layout
91 
92  //final coordinate of the nodes of the UPR
95 
96 
97  //min grid distance
99 
100  std::unique_ptr<UpwardPlanarizerModule> m_upPlanarizer; // upward planarizer
101 
102  void labelX(const UpwardPlanRep& UPR, node v, int& count);
103 
104  void labelY(const UpwardPlanRep& UPR, node v, int& count);
105 
106  void compact(const UpwardPlanRep& UPR, GraphAttributes& GA);
107 
108  void findTransitiveEdges(const UpwardPlanRep& UPR, List<edge>& edges);
109 };
110 
111 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
Graph.h
Includes declaration of graph class.
ogdf::SubgraphUpwardPlanarizer
Takes an acyclic connected non-upward-planar graph and planarizes it, i.e., we obtain an upward-plana...
Definition: SubgraphUpwardPlanarizer.h:70
ogdf::DominanceLayout::m_R
int m_R
Definition: DominanceLayout.h:81
ogdf::DominanceLayout::firstin
NodeArray< edge > firstin
Definition: DominanceLayout.h:78
ogdf::DominanceLayout::DominanceLayout
DominanceLayout()
Definition: DominanceLayout.h:54
ogdf::DominanceLayout::yCoord
NodeArray< int > yCoord
Definition: DominanceLayout.h:94
ogdf::DominanceLayout::yPreCoord
NodeArray< int > yPreCoord
Definition: DominanceLayout.h:90
LayoutModule.h
Declaration of interface for layout algorithms (class LayoutModule)
ogdf::DominanceLayout::lastout
NodeArray< edge > lastout
Definition: DominanceLayout.h:77
ogdf::DominanceLayout::setUpwardPlanarizer
void setUpwardPlanarizer(UpwardPlanarizerModule *upPlanarizer)
Definition: DominanceLayout.h:66
SubgraphUpwardPlanarizer.h
Declaration of class SubgraphUpwardPlanarizer.
ogdf::DominanceLayout::yNodes
List< node > yNodes
Definition: DominanceLayout.h:86
ogdf::DominanceLayout::xCoord
NodeArray< int > xCoord
Definition: DominanceLayout.h:93
ogdf::DominanceLayout::setMinGridDistance
void setMinGridDistance(int dist)
Definition: DominanceLayout.h:70
ogdf::DominanceLayout::m_L
int m_L
Definition: DominanceLayout.h:82
ogdf::DominanceLayout::m_angle
double m_angle
Definition: DominanceLayout.h:74
ogdf::Math::degreesToRadians
double degreesToRadians(const double &angleInDegrees)
Converts an angle from degrees to radians.
Definition: Math.h:129
ogdf::DominanceLayout::firstout
NodeArray< edge > firstout
Definition: DominanceLayout.h:76
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::DominanceLayout::lastin
NodeArray< edge > lastin
Definition: DominanceLayout.h:79
Math.h
Mathematical Helpers.
ogdf::DominanceLayout::m_grid_dist
int m_grid_dist
Definition: DominanceLayout.h:98
basic.h
Basic declarations, included by all source files.
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:85
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:100
List.h
Declaration of doubly linked lists and iterators.
ogdf::UpwardPlanarizerModule
Interface for upward planarization algorithms.
Definition: UpwardPlanarizerModule.h:46
ogdf::DominanceLayout::xPreCoord
NodeArray< int > xPreCoord
Definition: DominanceLayout.h:89
ogdf::UpwardPlanRep
Upward planarized representations (of a connected component) of a graph.
Definition: UpwardPlanRep.h:57
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::LayoutModule
Interface of general layout algorithms.
Definition: LayoutModule.h:45
ogdf::DominanceLayout
Definition: DominanceLayout.h:52