Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
UpwardPlanarizationLayout.h
Go to the documentation of this file.
1
32#pragma once
33
38
39namespace ogdf {
40
42public:
43 // constructor: sets options to default values
45 m_cr_nr = 0;
46 // set default module
47 m_layout.reset(new LayerBasedUPRLayout());
49 }
50
51 // calls the algorithm for attributed graph GA
52 // returns layout information in GA
53 virtual void call(GraphAttributes& GA) override {
54 if (GA.constGraph().numberOfNodes() > 2) {
56 UPR.createEmpty(GA.constGraph());
58 m_layout->call(UPR, GA);
59 m_cr_nr = UPR.numberOfCrossings();
60 m_numLevels = m_layout->numberOfLevels;
61 }
62 }
63
64 // module option for the computation of the final layout
66
70
71 // returns the number of crossings in the layout after the algorithm
72 // has been applied
73 int numberOfCrossings() const { return m_cr_nr; }
74
75 int numberOfLevels() const { return m_numLevels; }
76
77protected:
80 std::unique_ptr<UpwardPlanarizerModule> m_UpwardPlanarizer;
81 std::unique_ptr<UPRLayoutModule> m_layout;
82};
83
84}
Declaration of upward planarization layout algorithm.
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of class SubgraphUpwardPlanarizer.
Declaration of a base class for planar representations of graphs and cluster graphs.
Stores additional attributes of a graph (like layout information).
void createEmpty(const Graph &G)
Associates the graph copy with G, but does not create any nodes or edges.
Interface of general layout algorithms.
Takes an acyclic connected non-upward-planar graph and planarizes it, i.e., we obtain an upward-plana...
Interface of hierarchy layout algorithms.
Upward planarized representations (of a connected component) of a graph.
std::unique_ptr< UPRLayoutModule > m_layout
void setUpwardPlanarizer(UpwardPlanarizerModule *pUpwardPlanarizer)
virtual void call(GraphAttributes &GA) override
Computes a layout of graph GA.
void setUPRLayout(UPRLayoutModule *pLayout)
std::unique_ptr< UpwardPlanarizerModule > m_UpwardPlanarizer
Interface for upward planarization algorithms.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.