Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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 
39 namespace ogdf {
40 
41 
56 {
58  friend class PlanarGridLayoutModule;
59 
60 public:
62  GridLayoutModule() : LayoutModule(), m_separation(LayoutStandards::defaultNodeSeparation()) { }
63 
64  virtual ~GridLayoutModule() { }
65 
74  virtual void call(GraphAttributes &GA) override final;
75 
84  void callGrid(const Graph &G, GridLayout &gridLayout);
85 
86 
88 
93  double separation() const { return m_separation; }
94 
96 
101  void separation(double sep) { m_separation = sep; }
102 
103  const IPoint &gridBoundingBox() const { return m_gridBoundingBox; }
104 
105 protected:
118  virtual void doCall(const Graph &G, GridLayout &gridLayout, IPoint &boundingBox) = 0;
119 
121 
122 private:
123  double m_separation;
124 
126  void mapGridLayout(const Graph &G,
127  GridLayout &gridLayout,
128  GraphAttributes &AG);
129 };
130 
131 
141 {
142 public:
145 
147 
157  void callFixEmbed(GraphAttributes &AG, adjEntry adjExternal = nullptr);
158 
169  void callGridFixEmbed(const Graph &G, GridLayout &gridLayout, adjEntry adjExternal = nullptr);
170 
171 protected:
172 
190  virtual void doCall(
191  const Graph &G,
192  adjEntry adjExternal,
193  GridLayout &gridLayout,
194  IPoint &boundingBox,
195  bool fixEmbedding) = 0;
196 
198  virtual void doCall(
199  const Graph &G,
200  GridLayout &gridLayout,
201  IPoint &boundingBox) override
202  {
203  doCall(G,nullptr,gridLayout,boundingBox,false);
204  }
205 
211  bool handleTrivial(const Graph &G, GridLayout &gridLayout, IPoint &boundingBox);
212 };
213 
214 
226 {
227 public:
230 
232 
243  void callGrid(const Graph &G, GridLayout &gridLayout) {
244  PlanarGridLayoutModule::callGrid(G,gridLayout);
245  }
246 
253  void callGrid(PlanRep &PG, GridLayout &gridLayout);
254 
265  void callGridFixEmbed(const Graph &G, GridLayout &gridLayout, adjEntry adjExternal = nullptr) {
266  PlanarGridLayoutModule::callGridFixEmbed(G,gridLayout,adjExternal);
267  }
268 
279  void callGridFixEmbed(PlanRep &PG, GridLayout &gridLayout, adjEntry adjExternal = nullptr);
280 
281 protected:
296  virtual void doCall(
297  PlanRep &PG,
298  adjEntry adjExternal,
299  GridLayout &gridLayout,
300  IPoint &boundingBox,
301  bool fixEmbedding) = 0;
302 
303 
305  void doCall(
306  const Graph &G,
307  adjEntry adjExternal,
308  GridLayout &gridLayout,
309  IPoint &boundingBox,
310  bool fixEmbedding) override;
311 
313 };
314 
315 
316 } // end namespace ogdf
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:472
#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).
Integer points.
Definition: geometry.h:156
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:78
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:60