Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
GridLayoutModule.h
Go to the documentation of this file.
1
32#pragma once
33
37
38namespace ogdf {
39
56
57public:
59 GridLayoutModule() : LayoutModule(), m_separation(LayoutStandards::defaultNodeSeparation()) { }
60
61 virtual ~GridLayoutModule() { }
62
71 virtual void call(GraphAttributes& GA) override final;
72
82
84
89 double separation() const { return m_separation; }
90
92
97 void separation(double sep) { m_separation = sep; }
98
99 const IPoint& gridBoundingBox() const { return m_gridBoundingBox; }
100
101protected:
114 virtual void doCall(const Graph& G, GridLayout& gridLayout, IPoint& boundingBox) = 0;
115
117
118private:
120
123};
124
134public:
137
139
150
162
163protected:
182 IPoint& boundingBox, bool fixEmbedding) = 0;
183
185 virtual void doCall(const Graph& G, GridLayout& gridLayout, IPoint& boundingBox) override {
186 doCall(G, nullptr, gridLayout, boundingBox, false);
187 }
188
194 bool handleTrivial(const Graph& G, GridLayout& gridLayout, IPoint& boundingBox);
195};
196
208public:
211
213
225 PlanarGridLayoutModule::callGrid(G, gridLayout);
226 }
227
235
247 PlanarGridLayoutModule::callGridFixEmbed(G, gridLayout, adjExternal);
248 }
249
261
262protected:
278 IPoint& boundingBox, bool fixEmbedding) = 0;
279
280
283 bool fixEmbedding) override;
284
285 using PlanarGridLayoutModule::doCall;
286};
287
288}
Declaration of class GridLayout.
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of a base class for planar representations of graphs and cluster graphs.
Class for adjacency list elements.
Definition Graph_d.h:79
Stores additional attributes of a graph (like layout information).
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:521
Representation of a graph's grid layout.
Definition GridLayout.h:46
Base class for grid layout algorithms.
virtual void doCall(const Graph &G, GridLayout &gridLayout, IPoint &boundingBox)=0
Implements the algorithm call.
virtual void call(GraphAttributes &GA) override final
Calls the grid layout algorithm (general call).
double m_separation
The minimum distance between nodes.
GridLayoutModule()
Initializes a grid layout module.
void callGrid(const Graph &G, GridLayout &gridLayout)
Calls the grid layout algorithm (call for GridLayout).
IPoint m_gridBoundingBox
The computed bounding box of the grid layout.
void mapGridLayout(const Graph &G, GridLayout &gridLayout, GraphAttributes &AG)
Internal transformation of grid coordinates to real coordinates.
double separation() const
Returns the current setting of the minimum distance between nodes.
void separation(double sep)
Sets the minimum distance between nodes.
const IPoint & gridBoundingBox() const
Base class for grid layout algorithms operating on a PlanRep.
void callGrid(const Graph &G, GridLayout &gridLayout)
Calls the grid layout algorithm (call for GridLayout).
void callGrid(PlanRep &PG, GridLayout &gridLayout)
Calls the grid layout algorithm (call for GridLayout of a PlanRep).
void callGridFixEmbed(PlanRep &PG, GridLayout &gridLayout, adjEntry adjExternal=nullptr)
Calls the grid layout algorithm with a fixed planar embedding (call for GridLayout of a PlanRep).
GridLayoutPlanRepModule()
Initializes a plan-rep grid layout module.
void callGridFixEmbed(const Graph &G, GridLayout &gridLayout, adjEntry adjExternal=nullptr)
Calls the grid layout algorithm with a fixed planar embedding (call for GridLayout).
void doCall(const Graph &G, adjEntry adjExternal, GridLayout &gridLayout, IPoint &boundingBox, bool fixEmbedding) override
Implements PlanarGridLayoutModule::doCall().
virtual void doCall(PlanRep &PG, adjEntry adjExternal, GridLayout &gridLayout, IPoint &boundingBox, bool fixEmbedding)=0
Implements the algorithm call.
Interface of general layout algorithms.
Standard values for graphical attributes and layouts.
Planarized representations (of a connected component) of a graph.
Definition PlanRep.h:57
Base class for planar grid layout algorithms.
void callFixEmbed(GraphAttributes &AG, adjEntry adjExternal=nullptr)
Calls the grid layout algorithm with a fixed planar embedding (general call).
virtual void doCall(const Graph &G, GridLayout &gridLayout, IPoint &boundingBox) override
Implements the GridLayoutModule::doCall().
virtual void doCall(const Graph &G, adjEntry adjExternal, GridLayout &gridLayout, IPoint &boundingBox, bool fixEmbedding)=0
Implements the algorithm call.
PlanarGridLayoutModule()
Initializes a planar grid layout module.
bool handleTrivial(const Graph &G, GridLayout &gridLayout, IPoint &boundingBox)
Handles the special cases of graphs with less than 3 nodes.
void callGridFixEmbed(const Graph &G, GridLayout &gridLayout, adjEntry adjExternal=nullptr)
Calls the grid layout algorithm with a fixed planar embedding (call for GridLayout).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.