Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

OptimalHierarchyLayout.h
Go to the documentation of this file.
1 
33 #pragma once
34 
36 
37 namespace ogdf {
38 
39 
41 
77 {
78 public:
81 
84 
85  // destructor
87 
88 
91 
92 
98  double nodeDistance() const {
100  return m_nodeDistance;
101  }
102 
104  void nodeDistance(double x) {
105  if(x >= 0)
106  m_nodeDistance = x;
107  }
108 
110  double layerDistance() const {
111  return m_layerDistance;
112  }
113 
115  void layerDistance(double x) {
116  if(x >= 0)
117  m_layerDistance = x;
118  }
119 
121 
125  bool fixedLayerDistance() const {
126  return m_fixedLayerDistance;
127  }
128 
130  void fixedLayerDistance(bool b) {
131  m_fixedLayerDistance = b;
132  }
133 
135  double weightSegments() const {
136  return m_weightSegments;
137  }
138 
140  void weightSegments(double w) {
141  if(w > 0.0 && w <= 100.0)
142  m_weightSegments = w;
143  }
144 
146  double weightBalancing() const {
147  return m_weightBalancing;
148  }
149 
151  void weightBalancing(double w) {
152  if(w >= 0.0 && w <= 100.0)
153  m_weightBalancing = w;
154  }
155 
157 
158 protected:
160  virtual void doCall(const HierarchyLevelsBase &levels,GraphAttributes &AGC) override;
161 
162 private:
163  void computeXCoordinates(
164  const HierarchyLevelsBase &levels,
165  GraphAttributes &AGC);
166  void computeYCoordinates(
167  const HierarchyLevelsBase &levels,
168  GraphAttributes &AGC);
169 
170  // options
171  double m_nodeDistance;
174 
177 };
178 
179 }
void weightSegments(double w)
Sets the weight of edge segments connecting to vertical segments to w.
bool m_fixedLayerDistance
Use fixed layer distances?
void nodeDistance(double x)
Sets the minimal allowed x-distance between nodes on a layer to x.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
double m_nodeDistance
The minimal distance between nodes.
double m_weightSegments
The weight of edge segments.
Declaration of interface hierarchy layout algorithms (3.
double layerDistance() const
Returns the minimal allowed y-distance between layers.
double weightSegments() const
Returns the weight of edge segments connecting to vertical segments.
double m_layerDistance
The minimal distance between layers.
void fixedLayerDistance(bool b)
Sets the option fixedLayerDistance to b.
void weightBalancing(double w)
Sets the weight for balancing successors below a node to w; 0.0 means no balancing.
Stores additional attributes of a graph (like layout information).
Interface of hierarchy layout algorithms.
double weightBalancing() const
Returns the weight for balancing successors below a node; 0.0 means no balancing. ...
void layerDistance(double x)
Sets the minimal allowed y-distance between layers to x.
bool fixedLayerDistance() const
Returns the current setting of option fixedLayerDistance.
The namespace for all OGDF objects.
double m_weightBalancing
The weight for balancing.
The LP-based hierarchy layout algorithm.