Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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 
48 
50 {
51 public:
52 
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 
71 private:
72 
73  //min grid distance
75 
76  Graph D; // the dual graph of the UPR
77  node s_D; // super source of D
78  node t_D; // super sink f D
79 
80  //node segment of the visibility representation
81  struct NodeSegment {
82  int y; //y coordinate
83  int x_l; // left x coordinate
84  int x_r; // right x coordiante
85  };
86 
87  // edge segment of the visibility representation
88  struct EdgeSegment {
89  int y_b; // bottom y coordinate
90  int y_t; // top y coordinate
91  int x; // x coordiante
92  };
93 
94  //mapping node to node segment of visibility presentation
96 
97  //mapping edge to edge segment of visibility presentation
99 
105 
106  std::unique_ptr<UpwardPlanarizerModule> m_upPlanarizer; // upward planarizer
107 
108  void constructDualGraph(UpwardPlanRep &UPR);
109 
110  void constructVisibilityRepresentation(UpwardPlanRep &UPR);
111 
112 
113 };
114 
115 
116 }//namespace
std::unique_ptr< UpwardPlanarizerModule > m_upPlanarizer
Declaration of class GraphAttributes which extends a Graph by additional attributes.
EdgeArray< face > rightFace_edge
Interface for upward planarization algorithms.
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:472
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
NodeArray< face > rightFace_node
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
EdgeArray< face > leftFace_edge
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
FaceArray< node > faceToNode
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:423
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:167
Interface of general layout algorithms.
Definition: LayoutModule.h:44
The namespace for all OGDF objects.
EdgeArray< EdgeSegment > edgeToVis
void setMinGridDistance(int dist)
NodeArray< face > leftFace_node