Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
OptimalHierarchyLayout.h
Go to the documentation of this file.
1
33#pragma once
34
35#include <ogdf/basic/basic.h>
37
38namespace ogdf {
39class GraphAttributes;
40class HierarchyLevelsBase;
41
43
79public:
82
85
86 // destructor
88
91
98 double nodeDistance() const { return m_nodeDistance; }
99
101 void nodeDistance(double x) {
102 if (x >= 0) {
103 m_nodeDistance = x;
104 }
105 }
106
108 double layerDistance() const { return m_layerDistance; }
109
111 void layerDistance(double x) {
112 if (x >= 0) {
113 m_layerDistance = x;
114 }
115 }
116
118
122 bool fixedLayerDistance() const { return m_fixedLayerDistance; }
123
125 void fixedLayerDistance(bool b) { m_fixedLayerDistance = b; }
126
128 double weightSegments() const { return m_weightSegments; }
129
131 void weightSegments(double w) {
132 if (w > 0.0 && w <= 100.0) {
133 m_weightSegments = w;
134 }
135 }
136
138 double weightBalancing() const { return m_weightBalancing; }
139
141 void weightBalancing(double w) {
142 if (w >= 0.0 && w <= 100.0) {
143 m_weightBalancing = w;
144 }
145 }
146
148
149protected:
151 virtual void doCall(const HierarchyLevelsBase& levels, GraphAttributes& AGC) override;
152
153private:
156
157 // options
161
164};
165
166}
Declaration of interface hierarchy layout algorithms (3.
Basic declarations, included by all source files.
Stores additional attributes of a graph (like layout information).
Interface of hierarchy layout algorithms.
The LP-based hierarchy layout algorithm.
void weightBalancing(double w)
Sets the weight for balancing successors below a node to w; 0.0 means no balancing.
OptimalHierarchyLayout & operator=(const OptimalHierarchyLayout &)
Assignment operator.
bool m_fixedLayerDistance
Use fixed layer distances?
bool fixedLayerDistance() const
Returns the current setting of option fixedLayerDistance.
void computeYCoordinates(const HierarchyLevelsBase &levels, GraphAttributes &AGC)
double weightSegments() const
Returns the weight of edge segments connecting to vertical segments.
double m_nodeDistance
The minimal distance between nodes.
void layerDistance(double x)
Sets the minimal allowed y-distance between layers to x.
double layerDistance() const
Returns the minimal allowed y-distance between layers.
double m_weightBalancing
The weight for balancing.
OptimalHierarchyLayout(const OptimalHierarchyLayout &)
Copy constructor.
OptimalHierarchyLayout()
Creates an instance of optimal hierarchy layout.
void fixedLayerDistance(bool b)
Sets the option fixedLayerDistance to b.
double m_layerDistance
The minimal distance between layers.
void weightSegments(double w)
Sets the weight of edge segments connecting to vertical segments to w.
double weightBalancing() const
Returns the weight for balancing successors below a node; 0.0 means no balancing.
virtual void doCall(const HierarchyLevelsBase &levels, GraphAttributes &AGC) override
Implements the algorithm call.
double nodeDistance() const
Returns the minimal allowed x-distance between nodes on a layer.
void nodeDistance(double x)
Sets the minimal allowed x-distance between nodes on a layer to x.
double m_weightSegments
The weight of edge segments.
void computeXCoordinates(const HierarchyLevelsBase &levels, GraphAttributes &AGC)
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.