Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

OptimalHierarchyLayout.h
Go to the documentation of this file.
1 
33 #pragma once
34 
36 
37 namespace ogdf {
38 
39 
41 
77 public:
80 
83 
84  // destructor
86 
89 
95  double nodeDistance() const { return m_nodeDistance; }
97 
99  void nodeDistance(double x) {
100  if (x >= 0) {
101  m_nodeDistance = x;
102  }
103  }
104 
106  double layerDistance() const { return m_layerDistance; }
107 
109  void layerDistance(double x) {
110  if (x >= 0) {
111  m_layerDistance = x;
112  }
113  }
114 
116 
120  bool fixedLayerDistance() const { return m_fixedLayerDistance; }
121 
123  void fixedLayerDistance(bool b) { m_fixedLayerDistance = b; }
124 
126  double weightSegments() const { return m_weightSegments; }
127 
129  void weightSegments(double w) {
130  if (w > 0.0 && w <= 100.0) {
131  m_weightSegments = w;
132  }
133  }
134 
136  double weightBalancing() const { return m_weightBalancing; }
137 
139  void weightBalancing(double w) {
140  if (w >= 0.0 && w <= 100.0) {
141  m_weightBalancing = w;
142  }
143  }
144 
146 
147 protected:
149  virtual void doCall(const HierarchyLevelsBase& levels, GraphAttributes& AGC) override;
150 
151 private:
152  void computeXCoordinates(const HierarchyLevelsBase& levels, GraphAttributes& AGC);
153  void computeYCoordinates(const HierarchyLevelsBase& levels, GraphAttributes& AGC);
154 
155  // options
156  double m_nodeDistance;
159 
162 };
163 
164 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:66
ogdf::OptimalHierarchyLayout::weightBalancing
void weightBalancing(double w)
Sets the weight for balancing successors below a node to w; 0.0 means no balancing.
Definition: OptimalHierarchyLayout.h:139
ogdf::OptimalHierarchyLayout::weightSegments
void weightSegments(double w)
Sets the weight of edge segments connecting to vertical segments to w.
Definition: OptimalHierarchyLayout.h:129
ogdf::OptimalHierarchyLayout::layerDistance
void layerDistance(double x)
Sets the minimal allowed y-distance between layers to x.
Definition: OptimalHierarchyLayout.h:109
ogdf::OptimalHierarchyLayout::weightSegments
double weightSegments() const
Returns the weight of edge segments connecting to vertical segments.
Definition: OptimalHierarchyLayout.h:126
ogdf::HierarchyLayoutModule
Interface of hierarchy layout algorithms.
Definition: HierarchyLayoutModule.h:47
ogdf::OptimalHierarchyLayout::fixedLayerDistance
bool fixedLayerDistance() const
Returns the current setting of option fixedLayerDistance.
Definition: OptimalHierarchyLayout.h:120
ogdf::OptimalHierarchyLayout::layerDistance
double layerDistance() const
Returns the minimal allowed y-distance between layers.
Definition: OptimalHierarchyLayout.h:106
ogdf::HierarchyLevelsBase
Definition: CrossingMinInterfaces.h:61
ogdf::OptimalHierarchyLayout::m_fixedLayerDistance
bool m_fixedLayerDistance
Use fixed layer distances?
Definition: OptimalHierarchyLayout.h:158
ogdf::OptimalHierarchyLayout::weightBalancing
double weightBalancing() const
Returns the weight for balancing successors below a node; 0.0 means no balancing.
Definition: OptimalHierarchyLayout.h:136
ogdf::OptimalHierarchyLayout::m_layerDistance
double m_layerDistance
The minimal distance between layers.
Definition: OptimalHierarchyLayout.h:157
ogdf::OptimalHierarchyLayout::~OptimalHierarchyLayout
~OptimalHierarchyLayout()
Definition: OptimalHierarchyLayout.h:85
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
HierarchyLayoutModule.h
Declaration of interface hierarchy layout algorithms (3. phase of Sugiyama).
ogdf::OptimalHierarchyLayout::fixedLayerDistance
void fixedLayerDistance(bool b)
Sets the option fixedLayerDistance to b.
Definition: OptimalHierarchyLayout.h:123
ogdf::OptimalHierarchyLayout::nodeDistance
void nodeDistance(double x)
Sets the minimal allowed x-distance between nodes on a layer to x.
Definition: OptimalHierarchyLayout.h:99
ogdf::OptimalHierarchyLayout::m_weightSegments
double m_weightSegments
The weight of edge segments.
Definition: OptimalHierarchyLayout.h:160
ogdf::OptimalHierarchyLayout::m_weightBalancing
double m_weightBalancing
The weight for balancing.
Definition: OptimalHierarchyLayout.h:161
ogdf::OptimalHierarchyLayout::m_nodeDistance
double m_nodeDistance
The minimal distance between nodes.
Definition: OptimalHierarchyLayout.h:156
ogdf::OptimalHierarchyLayout
The LP-based hierarchy layout algorithm.
Definition: OptimalHierarchyLayout.h:76