Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

VisibilityLayout.h
Go to the documentation of this file.
1 
32 //***
33 // Visibility Layout Method. see "Graph Drawing" by Di Battista et al.
34 //***
35 
36 #pragma once
37 
39 #include <ogdf/basic/Graph.h>
41 #include <ogdf/basic/basic.h>
44 
45 #include <memory>
46 
47 namespace ogdf {
48 class GraphAttributes;
49 class UpwardPlanRep;
50 
52 public:
54  m_grid_dist = 1;
55  // set default module
56  m_upPlanarizer.reset(new SubgraphUpwardPlanarizer());
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  //min grid distance
73 
74  //node segment of the visibility representation
75  struct NodeSegment {
76  int y; //y coordinate
77  int x_l; // left x coordinate
78  int x_r; // right x coordiante
79  };
80 
81  // edge segment of the visibility representation
82  struct EdgeSegment {
83  int y_b; // bottom y coordinate
84  int y_t; // top y coordinate
85  int x; // x coordiante
86  };
87 
88  //mapping node to node segment of visibility presentation
90 
91  //mapping edge to edge segment of visibility presentation
93 
94  std::unique_ptr<UpwardPlanarizerModule> m_upPlanarizer; // upward planarizer
95 
96  void constructDualGraph(const UpwardPlanRep& UPR, Graph& D, node& s_D, node& t_D,
97  FaceArray<node>& faceToNode, NodeArray<face>& leftFace_node,
98  NodeArray<face>& rightFace_node, EdgeArray<face>& leftFace_edge,
99  EdgeArray<face>& rightFace_edge);
100 
101  void constructVisibilityRepresentation(const UpwardPlanRep& UPR);
102 };
103 
104 }
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::VisibilityLayout::EdgeSegment
Definition: VisibilityLayout.h:82
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::VisibilityLayout::NodeSegment::x_l
int x_l
Definition: VisibilityLayout.h:77
ogdf::VisibilityLayout::EdgeSegment::x
int x
Definition: VisibilityLayout.h:85
ogdf::VisibilityLayout::NodeSegment::y
int y
Definition: VisibilityLayout.h:76
LayoutModule.h
Declaration of interface for layout algorithms (class LayoutModule)
ogdf::VisibilityLayout::NodeSegment
Definition: VisibilityLayout.h:75
SubgraphUpwardPlanarizer.h
Declaration of class SubgraphUpwardPlanarizer.
ogdf::VisibilityLayout::EdgeSegment::y_t
int y_t
Definition: VisibilityLayout.h:84
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::FaceArrayBase
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
Definition: CombinatorialEmbedding.h:181
ogdf::VisibilityLayout::setMinGridDistance
void setMinGridDistance(int dist)
Definition: VisibilityLayout.h:67
ogdf::VisibilityLayout::edgeToVis
EdgeArray< EdgeSegment > edgeToVis
Definition: VisibilityLayout.h:92
ogdf::VisibilityLayout::nodeToVis
NodeArray< NodeSegment > nodeToVis
Definition: VisibilityLayout.h:89
ogdf::VisibilityLayout::VisibilityLayout
VisibilityLayout()
Definition: VisibilityLayout.h:53
ogdf::VisibilityLayout::setUpwardPlanarizer
void setUpwardPlanarizer(UpwardPlanarizerModule *upPlanarizer)
Definition: VisibilityLayout.h:63
ogdf::VisibilityLayout
Definition: VisibilityLayout.h:51
basic.h
Basic declarations, included by all source files.
CombinatorialEmbedding.h
Declaration of CombinatorialEmbedding and face.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::VisibilityLayout::NodeSegment::x_r
int x_r
Definition: VisibilityLayout.h:78
UpwardPlanarizerModule.h
Declaration of UpwardPlanarizer Module, an interface for upward planarization algorithms.
ogdf::UpwardPlanarizerModule
Interface for upward planarization algorithms.
Definition: UpwardPlanarizerModule.h:46
ogdf::UpwardPlanRep
Upward planarized representations (of a connected component) of a graph.
Definition: UpwardPlanRep.h:57
ogdf::VisibilityLayout::m_upPlanarizer
std::unique_ptr< UpwardPlanarizerModule > m_upPlanarizer
Definition: VisibilityLayout.h:94
ogdf::VisibilityLayout::EdgeSegment::y_b
int y_b
Definition: VisibilityLayout.h:83
ogdf::VisibilityLayout::m_grid_dist
int m_grid_dist
Definition: VisibilityLayout.h:72
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::LayoutModule
Interface of general layout algorithms.
Definition: LayoutModule.h:45