Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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
48namespace ogdf {
49class GraphAttributes;
50class UpwardPlanRep;
51
53public:
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
73private:
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
109};
110
111}
Includes declaration of graph class.
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of doubly linked lists and iterators.
Declaration of class SubgraphUpwardPlanarizer.
Declaration of UpwardPlanarizer Module, an interface for upward planarization algorithms.
Mathematical Helpers.
Basic declarations, included by all source files.
NodeArray< edge > lastout
NodeArray< edge > lastin
NodeArray< int > yPreCoord
std::unique_ptr< UpwardPlanarizerModule > m_upPlanarizer
void labelX(const UpwardPlanRep &UPR, node v, int &count)
NodeArray< edge > firstout
virtual void call(GraphAttributes &GA) override
Computes a layout of graph GA.
void compact(const UpwardPlanRep &UPR, GraphAttributes &GA)
NodeArray< int > xPreCoord
NodeArray< int > yCoord
void setUpwardPlanarizer(UpwardPlanarizerModule *upPlanarizer)
NodeArray< edge > firstin
void layout(GraphAttributes &GA, const UpwardPlanRep &UPROrig)
void setMinGridDistance(int dist)
void labelY(const UpwardPlanRep &UPR, node v, int &count)
NodeArray< int > xCoord
void findTransitiveEdges(const UpwardPlanRep &UPR, List< edge > &edges)
Stores additional attributes of a graph (like layout information).
Interface of general layout algorithms.
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Class for the representation of nodes.
Definition Graph_d.h:241
Takes an acyclic connected non-upward-planar graph and planarizes it, i.e., we obtain an upward-plana...
Upward planarized representations (of a connected component) of a graph.
Interface for upward planarization algorithms.
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.