Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

OptimalHierarchyLayout.h
Go to the documentation of this file.
1 
33 #pragma once
34 
36 
37 
38 namespace ogdf {
39 
40 
42 
78 {
79 public:
82 
85 
86  // destructor
88 
89 
92 
93 
99  double nodeDistance() const {
101  return m_nodeDistance;
102  }
103 
105  void nodeDistance(double x) {
106  if(x >= 0)
107  m_nodeDistance = x;
108  }
109 
111  double layerDistance() const {
112  return m_layerDistance;
113  }
114 
116  void layerDistance(double x) {
117  if(x >= 0)
118  m_layerDistance = x;
119  }
120 
122 
126  bool fixedLayerDistance() const {
127  return m_fixedLayerDistance;
128  }
129 
131  void fixedLayerDistance(bool b) {
132  m_fixedLayerDistance = b;
133  }
134 
136  double weightSegments() const {
137  return m_weightSegments;
138  }
139 
141  void weightSegments(double w) {
142  if(w > 0.0 && w <= 100.0)
143  m_weightSegments = w;
144  }
145 
147  double weightBalancing() const {
148  return m_weightBalancing;
149  }
150 
152  void weightBalancing(double w) {
153  if(w >= 0.0 && w <= 100.0)
154  m_weightBalancing = w;
155  }
156 
158 
159 protected:
161  virtual void doCall(const HierarchyLevelsBase &levels,GraphCopyAttributes &AGC) override;
162 
163 private:
164  void computeXCoordinates(
165  const HierarchyLevelsBase &levels,
166  GraphCopyAttributes &AGC);
167  void computeYCoordinates(
168  const HierarchyLevelsBase &levels,
169  GraphCopyAttributes &AGC);
170 
171  // options
172  double m_nodeDistance;
175 
178 };
179 
180 }
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.
Helper class for accessing graph attributes from a copy of the graph.
void weightBalancing(double w)
Sets the weight for balancing successors below a node to w; 0.0 means no balancing.
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.