Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

HierarchyLayoutModule.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/layered/Hierarchy.h>
38 
39 namespace ogdf {
40 
41 
48 public:
51 
52  virtual ~HierarchyLayoutModule() { }
53 
59  void call(const HierarchyLevelsBase &levels, GraphAttributes &GA) {
60  GraphAttributes AGC(levels.hierarchy());
61  doCall(levels,AGC);
62  AGC.transferToOriginal(GA);
63  }
64 
65 #if 0
66 
71  void call(Hierarchy& H, GraphAttributes &AG) {
72  GraphAttributes AGC(H);
73  doCall(H,AGC);
75  HierarchyLayoutModule::addBends(AGC, H);
76  AGC.transferToOriginal(AG);
77  }
78 
85  void call(const Hierarchy& H, GraphAttributes &, GraphAttributes &AGC) {
86  doCall(H,AGC);
87  }
88 
90  static void addBends(GraphAttributes &AGC, HierarchyLevels &levels);
91 #endif
92 
93  static void dynLayerDistance(GraphAttributes &AGC, HierarchyLevelsBase &levels);
94 
95 private:
96 
98  static void overlap(GraphAttributes &AGC, HierarchyLevelsBase &levels, node s, node t, int i, int &ci, int &cj);
99 
100 protected:
102  static inline double getWidth(const GraphAttributes &GA, const HierarchyLevelsBase &levels, node v) {
103  const GraphCopy &GC = levels.hierarchy();
104  return GC.isDummy(v) ? 0.0 : GA.width(v);
105  }
106 
108  static inline double getHeight(const GraphAttributes &GA, const HierarchyLevelsBase &levels, node v) {
109  const GraphCopy &GC = levels.hierarchy();
110  return GC.isDummy(v) ? 0.0 : GA.height(v);
111  }
112 
121  virtual void doCall(const HierarchyLevelsBase &levels, GraphAttributes &AGC) = 0;
122 
124 
125 };
126 
127 }
static double getHeight(const GraphAttributes &GA, const HierarchyLevelsBase &levels, node v)
Returns the GA height of node v or 0 if it is a dummy node in the hierarchy of levels.
double width(node v) const
Returns the width of the bounding box of node v.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Representation of proper hierarchies used by Sugiyama-layout.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
Definition: memory.h:91
Declaration of interfaces used in Sugiyama framework.
Declaration of Hierarchy class.
double height(node v) const
Returns the height of the bounding box of node v.
static void dynLayerDistance(GraphAttributes &AGC, HierarchyLevelsBase &levels)
void transferToOriginal(GraphAttributes &origAttr) const
Copies attributes of this to origAttr.
Stores additional attributes of a graph (like layout information).
Interface of hierarchy layout algorithms.
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:249
Class for the representation of nodes.
Definition: Graph_d.h:169
static double getWidth(const GraphAttributes &GA, const HierarchyLevelsBase &levels, node v)
Returns the GA width of node v or 0 if it is a dummy node in the hierarchy of levels.
HierarchyLayoutModule()
Initializes a hierarchy layout module.
virtual const Hierarchy & hierarchy() const =0
The namespace for all OGDF objects.
bool isDummy(node v) const
Returns true iff v has no corresponding node in the original graph.
Definition: GraphCopy.h:377
Representation of proper hierarchies used by Sugiyama-layout.
Definition: Hierarchy.h:44
void call(const HierarchyLevelsBase &levels, GraphAttributes &GA)
Computes a hierarchy layout of levels in GA.