Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

OptimalHierarchyLayout.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/basic.h>
37 
38 namespace ogdf {
39 class GraphAttributes;
40 class HierarchyLevelsBase;
41 
43 
79 public:
82 
85 
86  // destructor
88 
91 
97  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 
149 protected:
151  virtual void doCall(const HierarchyLevelsBase& levels, GraphAttributes& AGC) override;
152 
153 private:
154  void computeXCoordinates(const HierarchyLevelsBase& levels, GraphAttributes& AGC);
155  void computeYCoordinates(const HierarchyLevelsBase& levels, GraphAttributes& AGC);
156 
157  // options
158  double m_nodeDistance;
161 
164 };
165 
166 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
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:141
ogdf::OptimalHierarchyLayout::weightSegments
void weightSegments(double w)
Sets the weight of edge segments connecting to vertical segments to w.
Definition: OptimalHierarchyLayout.h:131
ogdf::OptimalHierarchyLayout::layerDistance
void layerDistance(double x)
Sets the minimal allowed y-distance between layers to x.
Definition: OptimalHierarchyLayout.h:111
ogdf::OptimalHierarchyLayout::weightSegments
double weightSegments() const
Returns the weight of edge segments connecting to vertical segments.
Definition: OptimalHierarchyLayout.h:128
ogdf::HierarchyLayoutModule
Interface of hierarchy layout algorithms.
Definition: HierarchyLayoutModule.h:52
ogdf::OptimalHierarchyLayout::fixedLayerDistance
bool fixedLayerDistance() const
Returns the current setting of option fixedLayerDistance.
Definition: OptimalHierarchyLayout.h:122
ogdf::OptimalHierarchyLayout::layerDistance
double layerDistance() const
Returns the minimal allowed y-distance between layers.
Definition: OptimalHierarchyLayout.h:108
ogdf::HierarchyLevelsBase
Definition: CrossingMinInterfaces.h:63
ogdf::OptimalHierarchyLayout::m_fixedLayerDistance
bool m_fixedLayerDistance
Use fixed layer distances?
Definition: OptimalHierarchyLayout.h:160
ogdf::OptimalHierarchyLayout::weightBalancing
double weightBalancing() const
Returns the weight for balancing successors below a node; 0.0 means no balancing.
Definition: OptimalHierarchyLayout.h:138
ogdf::OptimalHierarchyLayout::m_layerDistance
double m_layerDistance
The minimal distance between layers.
Definition: OptimalHierarchyLayout.h:159
ogdf::OptimalHierarchyLayout::~OptimalHierarchyLayout
~OptimalHierarchyLayout()
Definition: OptimalHierarchyLayout.h:87
basic.h
Basic declarations, included by all source files.
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:125
ogdf::OptimalHierarchyLayout::nodeDistance
void nodeDistance(double x)
Sets the minimal allowed x-distance between nodes on a layer to x.
Definition: OptimalHierarchyLayout.h:101
ogdf::OptimalHierarchyLayout::m_weightSegments
double m_weightSegments
The weight of edge segments.
Definition: OptimalHierarchyLayout.h:162
ogdf::OptimalHierarchyLayout::m_weightBalancing
double m_weightBalancing
The weight for balancing.
Definition: OptimalHierarchyLayout.h:163
ogdf::OptimalHierarchyLayout::m_nodeDistance
double m_nodeDistance
The minimal distance between nodes.
Definition: OptimalHierarchyLayout.h:158
ogdf::OptimalHierarchyLayout
The LP-based hierarchy layout algorithm.
Definition: OptimalHierarchyLayout.h:78