Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

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 
40 #include <memory>
42 #include <ogdf/basic/FaceArray.h>
45 
46 namespace ogdf {
47 
49 {
50 public:
51 
53  m_grid_dist = 1;
54  // set default module
55  m_upPlanarizer.reset(new SubgraphUpwardPlanarizer());
56  }
57 
58  virtual void call(GraphAttributes &GA) override;
59 
60  void layout(GraphAttributes &GA, const UpwardPlanRep &UPROrig);
61 
63  m_upPlanarizer.reset(upPlanarizer);
64  }
65 
66  void setMinGridDistance(int dist) {m_grid_dist = dist;}
67 
68 
69 
70 private:
71 
72  //min grid distance
74 
75  //node segment of the visibility representation
76  struct NodeSegment {
77  int y; //y coordinate
78  int x_l; // left x coordinate
79  int x_r; // right x coordiante
80  };
81 
82  // edge segment of the visibility representation
83  struct EdgeSegment {
84  int y_b; // bottom y coordinate
85  int y_t; // top y coordinate
86  int x; // x coordiante
87  };
88 
89  //mapping node to node segment of visibility presentation
91 
92  //mapping edge to edge segment of visibility presentation
94 
95  std::unique_ptr<UpwardPlanarizerModule> m_upPlanarizer; // upward planarizer
96 
97  void constructDualGraph(
98  const UpwardPlanRep& UPR,
99  Graph& D,
100  node& s_D,
101  node& t_D,
102  FaceArray<node>& faceToNode,
103  NodeArray<face>& leftFace_node,
104  NodeArray<face>& rightFace_node,
105  EdgeArray<face>& leftFace_edge,
106  EdgeArray<face>& rightFace_edge);
107 
108  void constructVisibilityRepresentation(const UpwardPlanRep& UPR);
109 };
110 
111 }
std::unique_ptr< UpwardPlanarizerModule > m_upPlanarizer
Takes an acyclic connected non-upward-planar graph and planarizes it, i.e., we obtain an upward-plana...
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Interface for upward planarization algorithms.
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
Declaration of a base class for planar representations of graphs and cluster graphs.
Upward planarized representations (of a connected component) of a graph.
Definition: UpwardPlanRep.h:51
Declaration of UpwardPlanarizer Module, an interface for upward planarization algorithms.
declaration and implementation of FaceArray class
Dynamic arrays indexed with edges.
Definition: EdgeArray.h:112
void setUpwardPlanarizer(UpwardPlanarizerModule *upPlanarizer)
NodeArray< NodeSegment > nodeToVis
Dynamic arrays indexed with faces of a combinatorial embedding.
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:438
Declaration of class SubgraphUpwardPlanarizer.
Stores additional attributes of a graph (like layout information).
Declaration of interface for layout algorithms (class LayoutModule)
Class for the representation of nodes.
Definition: Graph_d.h:169
Interface of general layout algorithms.
Definition: LayoutModule.h:44
The namespace for all OGDF objects.
EdgeArray< EdgeSegment > edgeToVis
void setMinGridDistance(int dist)