Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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
47namespace ogdf {
48class GraphAttributes;
49class UpwardPlanRep;
50
52public:
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
70private:
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
102};
103
104}
Declaration of CombinatorialEmbedding and face.
Includes declaration of graph class.
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of class SubgraphUpwardPlanarizer.
Declaration of UpwardPlanarizer Module, an interface for upward planarization algorithms.
Basic declarations, included by all source files.
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
Stores additional attributes of a graph (like layout information).
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Interface of general layout algorithms.
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.
virtual void call(GraphAttributes &GA) override
Computes a layout of graph GA.
std::unique_ptr< UpwardPlanarizerModule > m_upPlanarizer
void constructVisibilityRepresentation(const UpwardPlanRep &UPR)
void setUpwardPlanarizer(UpwardPlanarizerModule *upPlanarizer)
void setMinGridDistance(int dist)
EdgeArray< EdgeSegment > edgeToVis
void constructDualGraph(const UpwardPlanRep &UPR, Graph &D, node &s_D, node &t_D, FaceArray< node > &faceToNode, NodeArray< face > &leftFace_node, NodeArray< face > &rightFace_node, EdgeArray< face > &leftFace_edge, EdgeArray< face > &rightFace_edge)
NodeArray< NodeSegment > nodeToVis
void layout(GraphAttributes &GA, const UpwardPlanRep &UPROrig)
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
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.