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 
38 #include <ogdf/basic/FaceArray.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 
57  virtual void call(GraphAttributes& GA) override;
58 
59  void layout(GraphAttributes& GA, const UpwardPlanRep& UPROrig);
60 
62  m_upPlanarizer.reset(upPlanarizer);
63  }
64 
65  void setMinGridDistance(int dist) { m_grid_dist = dist; }
66 
67 
68 private:
69  //min grid distance
71 
72  //node segment of the visibility representation
73  struct NodeSegment {
74  int y; //y coordinate
75  int x_l; // left x coordinate
76  int x_r; // right x coordiante
77  };
78 
79  // edge segment of the visibility representation
80  struct EdgeSegment {
81  int y_b; // bottom y coordinate
82  int y_t; // top y coordinate
83  int x; // x coordiante
84  };
85 
86  //mapping node to node segment of visibility presentation
88 
89  //mapping edge to edge segment of visibility presentation
91 
92  std::unique_ptr<UpwardPlanarizerModule> m_upPlanarizer; // upward planarizer
93 
94  void constructDualGraph(const UpwardPlanRep& UPR, Graph& D, node& s_D, node& t_D,
95  FaceArray<node>& faceToNode, NodeArray<face>& leftFace_node,
96  NodeArray<face>& rightFace_node, EdgeArray<face>& leftFace_edge,
97  EdgeArray<face>& rightFace_edge);
98 
99  void constructVisibilityRepresentation(const UpwardPlanRep& UPR);
100 };
101 
102 }
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::VisibilityLayout::EdgeSegment
Definition: VisibilityLayout.h:80
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::VisibilityLayout::NodeSegment::x_l
int x_l
Definition: VisibilityLayout.h:75
ogdf::VisibilityLayout::EdgeSegment::x
int x
Definition: VisibilityLayout.h:83
ogdf::VisibilityLayout::NodeSegment::y
int y
Definition: VisibilityLayout.h:74
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::VisibilityLayout::NodeSegment
Definition: VisibilityLayout.h:73
FaceArray.h
declaration and implementation of FaceArray class
SubgraphUpwardPlanarizer.h
Declaration of class SubgraphUpwardPlanarizer.
ogdf::VisibilityLayout::EdgeSegment::y_t
int y_t
Definition: VisibilityLayout.h:82
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::FaceArrayBase
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
Definition: CombinatorialEmbedding.h:172
ogdf::VisibilityLayout::setMinGridDistance
void setMinGridDistance(int dist)
Definition: VisibilityLayout.h:65
ogdf::VisibilityLayout::edgeToVis
EdgeArray< EdgeSegment > edgeToVis
Definition: VisibilityLayout.h:90
ogdf::VisibilityLayout::nodeToVis
NodeArray< NodeSegment > nodeToVis
Definition: VisibilityLayout.h:87
ogdf::VisibilityLayout::VisibilityLayout
VisibilityLayout()
Definition: VisibilityLayout.h:51
ogdf::VisibilityLayout::setUpwardPlanarizer
void setUpwardPlanarizer(UpwardPlanarizerModule *upPlanarizer)
Definition: VisibilityLayout.h:61
ogdf::VisibilityLayout
Definition: VisibilityLayout.h:49
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:76
UpwardPlanarizerModule.h
Declaration of UpwardPlanarizer Module, an interface for upward planarization algorithms.
ogdf::UpwardPlanarizerModule
Interface for upward planarization algorithms.
Definition: UpwardPlanarizerModule.h:43
ogdf::UpwardPlanRep
Upward planarized representations (of a connected component) of a graph.
Definition: UpwardPlanRep.h:50
ogdf::VisibilityLayout::m_upPlanarizer
std::unique_ptr< UpwardPlanarizerModule > m_upPlanarizer
Definition: VisibilityLayout.h:92
ogdf::VisibilityLayout::EdgeSegment::y_b
int y_b
Definition: VisibilityLayout.h:81
ogdf::VisibilityLayout::m_grid_dist
int m_grid_dist
Definition: VisibilityLayout.h:70
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:709
ogdf::LayoutModule
Interface of general layout algorithms.
Definition: LayoutModule.h:44