Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ClusterOrthoLayout.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/Graph.h>
36 #include <ogdf/basic/basic.h>
38 
39 namespace ogdf {
40 class ClusterPlanRep;
41 class Layout;
42 enum class OrthoDir;
43 template<class E>
44 class List;
45 
47 
51 public:
54 
55 
62  void call(ClusterPlanRep& PG, adjEntry adjExternal, Layout& drawing);
63 
65  virtual void call(ClusterPlanRep& PG, adjEntry adjExternal, Layout& drawing,
66  List<edge>& origEdges, Graph& originalGraph) override;
67 
68  //
69  // options
70 
72  virtual double separation() const override { return m_separation; }
73 
75  virtual void separation(double sep) override { m_separation = sep; }
76 
78  //distance between the glue point of an edge and a corner of the vertex boundary
79  double cOverhang() const { return m_cOverhang; }
80 
82  void cOverhang(double c) { m_cOverhang = c; }
83 
85  double margin() const { return m_margin; }
86 
88  void margin(double m) { m_margin = m; }
89 
91  OrthoDir preferedDir() const { return m_preferedDir; }
92 
94  void preferedDir(OrthoDir dir) { m_preferedDir = dir; }
95 
97  int costAssoc() const { return m_costAssoc; }
98 
100  void costAssoc(int c) { m_costAssoc = c; }
101 
103  int costGen() const { return m_costGen; }
104 
106  void costGen(int c) { m_costGen = c; }
107 
109  void optionProfile(int i) { m_optionProfile = i; }
110 
112  void align(bool b) { m_align = b; }
113 
115  void scaling(bool b) { m_useScalingCompaction = b; }
116 
118  //Necessary to allow setting over base class pointer
119  //bit 0 = alignment
120  //bit 1 = scaling
121  //bit 2 = progressive/traditional
122  //=> 0 is standard
123  virtual void setOptions(int optionField) override {
124  m_align = (optionField & 1) != 0;
125  m_useScalingCompaction = (optionField & 2) != 0;
126  m_orthoStyle = (optionField & 4) != 0;
127  // m_orthoStyle = 0 is traditional
128  }
129 
130 
131 private:
132  // compute bounding box and move final drawing such that it is 0 aligned
133  // respecting margins
134  void computeBoundingBox(const ClusterPlanRep& PG, Layout& drawing);
135 
136 
137  // options
138  double m_separation;
139  double m_cOverhang;
140  double m_margin;
144  int m_costGen;
145  //align merger sons on same level
146  bool m_align;
147  //settings for scaling compaction
151 };
152 
153 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::ClusterOrthoLayout::costAssoc
void costAssoc(int c)
Sets cost of associations which is used in the compactions step.
Definition: ClusterOrthoLayout.h:100
Graph.h
Includes declaration of graph class.
ogdf::OrthoDir
OrthoDir
Definition: OrthoRep.h:56
ogdf::ClusterOrthoLayout::cOverhang
void cOverhang(double c)
Sets cOverhang value.
Definition: ClusterOrthoLayout.h:82
ogdf::ClusterPlanRep
Planarized representations for clustered graphs.
Definition: ClusterPlanRep.h:56
ogdf::ClusterOrthoLayout::m_optionProfile
int m_optionProfile
Definition: ClusterOrthoLayout.h:142
ogdf::ClusterOrthoLayout::m_margin
double m_margin
Distance between bounding box and drawing boundary.
Definition: ClusterOrthoLayout.h:140
ogdf::ClusterOrthoLayout::margin
double margin() const
Returns the distance from the tight bounding box to the boundary of the drawing.
Definition: ClusterOrthoLayout.h:85
ogdf::ClusterOrthoLayout::separation
virtual void separation(double sep) override
Sets the minimum distance between edges and vertices.
Definition: ClusterOrthoLayout.h:75
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:142
ogdf::ClusterOrthoLayout::setOptions
virtual void setOptions(int optionField) override
Sets generic options by setting field bits.
Definition: ClusterOrthoLayout.h:123
ogdf::ClusterOrthoLayout::scaling
void scaling(bool b)
Sets scaling option for compaction step.
Definition: ClusterOrthoLayout.h:115
ogdf::Layout
Stores a layout of a graph (coordinates of nodes, bend points of edges).
Definition: Layout.h:49
ogdf::ClusterOrthoLayout::m_costGen
int m_costGen
Compaction cost of generalizations type edges.
Definition: ClusterOrthoLayout.h:144
ogdf::ClusterOrthoLayout
Represents a planar orthogonal drawing algorithm for c-planar, c-connected clustered graphs.
Definition: ClusterOrthoLayout.h:50
ogdf::ClusterOrthoLayout::m_separation
double m_separation
Minimum distance between edges and vertices.
Definition: ClusterOrthoLayout.h:138
ogdf::ClusterOrthoLayout::m_cOverhang
double m_cOverhang
Factor for minimum distance between vertex corner an adjacent edges.
Definition: ClusterOrthoLayout.h:139
ogdf::ClusterOrthoLayout::optionProfile
void optionProfile(int i)
Sets the option profile, thereby fixing a set of drawing options.
Definition: ClusterOrthoLayout.h:109
ogdf::ClusterOrthoLayout::costGen
int costGen() const
Returns cost of generalizations.
Definition: ClusterOrthoLayout.h:103
ogdf::ClusterOrthoLayout::m_costAssoc
int m_costAssoc
Compaction cost of association type edges.
Definition: ClusterOrthoLayout.h:143
ogdf::ClusterOrthoLayout::separation
virtual double separation() const override
Returns the minimum distance between edges and vertices.
Definition: ClusterOrthoLayout.h:72
ogdf::ClusterOrthoLayout::m_scalingSteps
int m_scalingSteps
Number of scaling steps during compaction.
Definition: ClusterOrthoLayout.h:149
ogdf::ClusterOrthoLayout::margin
void margin(double m)
Sets the distance from the tight bounding box to the boundary of the drawing.
Definition: ClusterOrthoLayout.h:88
ogdf::List< edge >
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::ClusterOrthoLayout::cOverhang
double cOverhang() const
Returns cOverhang, where cOverhang * separation defines the minimum.
Definition: ClusterOrthoLayout.h:79
ogdf::ClusterOrthoLayout::m_align
bool m_align
Horizontal alignment option.
Definition: ClusterOrthoLayout.h:146
ogdf::ClusterOrthoLayout::m_orthoStyle
int m_orthoStyle
Type of style (traditional/progressive) used for shape step.
Definition: ClusterOrthoLayout.h:150
ogdf::ClusterOrthoLayout::costAssoc
int costAssoc() const
Returns cost of associations which is used in the compactions step.
Definition: ClusterOrthoLayout.h:97
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
LayoutClusterPlanRepModule.h
Declaration of interface for planar layout algorithms for UML diagrams (used in planarization approac...
ogdf::ClusterOrthoLayout::align
void align(bool b)
Sets alignment option.
Definition: ClusterOrthoLayout.h:112
ogdf::ClusterOrthoLayout::costGen
void costGen(int c)
Sets cost of generalizations.
Definition: ClusterOrthoLayout.h:106
ogdf::ClusterOrthoLayout::m_useScalingCompaction
bool m_useScalingCompaction
Switches scaling improvement during compaction.
Definition: ClusterOrthoLayout.h:148
ogdf::ClusterOrthoLayout::preferedDir
void preferedDir(OrthoDir dir)
Sets the preferred direction of generalizations.
Definition: ClusterOrthoLayout.h:94
ogdf::LayoutClusterPlanRepModule
Interface for planar cluster layout algorithms.
Definition: LayoutClusterPlanRepModule.h:52
ogdf::ClusterOrthoLayout::preferedDir
OrthoDir preferedDir() const
Returns the preferred direction of generalizations.
Definition: ClusterOrthoLayout.h:91
ogdf::ClusterOrthoLayout::m_preferedDir
OrthoDir m_preferedDir
Preferred direction of generalizations (obsolete).
Definition: ClusterOrthoLayout.h:141