Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

GridLayoutModule.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 #include <ogdf/basic/GridLayout.h>
36 #include <ogdf/planarity/PlanRep.h>
37 
38 namespace ogdf {
39 
54 {
56  friend class PlanarGridLayoutModule;
57 
58 public:
60  GridLayoutModule() : LayoutModule(), m_separation(LayoutStandards::defaultNodeSeparation()) { }
61 
62  virtual ~GridLayoutModule() { }
63 
72  virtual void call(GraphAttributes &GA) override final;
73 
82  void callGrid(const Graph &G, GridLayout &gridLayout);
83 
84 
86 
91  double separation() const { return m_separation; }
92 
94 
99  void separation(double sep) { m_separation = sep; }
100 
101  const IPoint &gridBoundingBox() const { return m_gridBoundingBox; }
102 
103 protected:
116  virtual void doCall(const Graph &G, GridLayout &gridLayout, IPoint &boundingBox) = 0;
117 
119 
120 private:
121  double m_separation;
122 
124  void mapGridLayout(const Graph &G,
125  GridLayout &gridLayout,
126  GraphAttributes &AG);
127 };
128 
129 
139 {
140 public:
143 
145 
155  void callFixEmbed(GraphAttributes &AG, adjEntry adjExternal = nullptr);
156 
167  void callGridFixEmbed(const Graph &G, GridLayout &gridLayout, adjEntry adjExternal = nullptr);
168 
169 protected:
170 
188  virtual void doCall(
189  const Graph &G,
190  adjEntry adjExternal,
191  GridLayout &gridLayout,
192  IPoint &boundingBox,
193  bool fixEmbedding) = 0;
194 
196  virtual void doCall(
197  const Graph &G,
198  GridLayout &gridLayout,
199  IPoint &boundingBox) override
200  {
201  doCall(G,nullptr,gridLayout,boundingBox,false);
202  }
203 
209  bool handleTrivial(const Graph &G, GridLayout &gridLayout, IPoint &boundingBox);
210 };
211 
212 
224 {
225 public:
228 
230 
241  void callGrid(const Graph &G, GridLayout &gridLayout) {
242  PlanarGridLayoutModule::callGrid(G,gridLayout);
243  }
244 
251  void callGrid(PlanRep &PG, GridLayout &gridLayout);
252 
263  void callGridFixEmbed(const Graph &G, GridLayout &gridLayout, adjEntry adjExternal = nullptr) {
264  PlanarGridLayoutModule::callGridFixEmbed(G,gridLayout,adjExternal);
265  }
266 
277  void callGridFixEmbed(PlanRep &PG, GridLayout &gridLayout, adjEntry adjExternal = nullptr);
278 
279 protected:
294  virtual void doCall(
295  PlanRep &PG,
296  adjEntry adjExternal,
297  GridLayout &gridLayout,
298  IPoint &boundingBox,
299  bool fixEmbedding) = 0;
300 
301 
303  void doCall(
304  const Graph &G,
305  adjEntry adjExternal,
306  GridLayout &gridLayout,
307  IPoint &boundingBox,
308  bool fixEmbedding) override;
309 
311 };
312 
313 }
Representation of a graph&#39;s grid layout.
Definition: GridLayout.h:46
Base class for grid layout algorithms.
GridLayoutModule()
Initializes a grid layout module.
double m_separation
The minimum distance between nodes.
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
void callGridFixEmbed(const Graph &G, GridLayout &gridLayout, adjEntry adjExternal=nullptr)
Calls the grid layout algorithm with a fixed planar embedding (call for GridLayout).
Base class for planar grid layout algorithms.
const IPoint & gridBoundingBox() const
Declaration of a base class for planar representations of graphs and cluster graphs.
double separation() const
Returns the current setting of the minimum distance between nodes.
IPoint m_gridBoundingBox
The computed bounding box of the grid layout.
Base class for grid layout algorithms operating on a PlanRep.
void separation(double sep)
Sets the minimum distance between nodes.
void callGridFixEmbed(const Graph &G, GridLayout &gridLayout, adjEntry adjExternal=nullptr)
Calls the grid layout algorithm with a fixed planar embedding (call for GridLayout).
GridLayoutPlanRepModule()
Initializes a plan-rep grid layout module.
Declaration of class GridLayout.
Stores additional attributes of a graph (like layout information).
PlanarGridLayoutModule()
Initializes a planar grid layout module.
Standard values for graphical attributes and layouts.
Declaration of interface for layout algorithms (class LayoutModule)
virtual void doCall(const Graph &G, adjEntry adjExternal, GridLayout &gridLayout, IPoint &boundingBox, bool fixEmbedding)=0
Implements the algorithm call.
Interface of general layout algorithms.
Definition: LayoutModule.h:44
The namespace for all OGDF objects.
void callGrid(const Graph &G, GridLayout &gridLayout)
Calls the grid layout algorithm (call for GridLayout).
virtual void doCall(const Graph &G, GridLayout &gridLayout, IPoint &boundingBox) override
Implements the GridLayoutModule::doCall().
void callGrid(const Graph &G, GridLayout &gridLayout)
Calls the grid layout algorithm (call for GridLayout).
Class for adjacency list elements.
Definition: Graph_d.h:79
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:59