Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
OrthoShaper.h
Go to the documentation of this file.
1
34#pragma once
35
37#include <ogdf/uml/PlanRepUML.h>
38
39namespace ogdf {
40
42public:
44 enum class NetworkNodeType { low, high, inner, outer };
45
46 OrthoShaper() { setDefaultSettings(); }
47
49
50 // Given a planar representation for a UML graph and its planar
51 // combinatorial embedding, call() produces an orthogonal
52 // representation using Tamassias bend minimization algorithm
53 // with a flow network where every flow unit defines 90 degree angle
54 // in traditional mode.
55
57
59
60 //sets the default settings used in the standard constructor
62 m_distributeEdges = true; // true; //try to distribute edges to all node sides
63 m_fourPlanar = true; //do not allow zero degree angles at high degree
64 m_allowLowZero = false; //do allow zero degree at low degree nodes
65 m_multiAlign = true; //true; //start/end side of multi edges match
66 m_traditional = true; //true; //prefer 3/1 flow at degree 2 (false: 2/2)
67 m_deg4free = false; //allow free angle assignment at degree four
68 m_align = false; //align nodes on same hierarchy level
69 m_startBoundBendsPerEdge = 0; //don't use bound on bend number per edge
70 }
71
72 // returns option distributeEdges
73 bool distributeEdges() { return m_distributeEdges; }
74
75 // sets option distributeEdges to b
76 void distributeEdges(bool b) { m_distributeEdges = b; }
77
78 // returns option multiAlign
79 bool multiAlign() { return m_multiAlign; }
80
81 // sets option multiAlign to b
82 void multiAlign(bool b) { m_multiAlign = b; }
83
84 // returns option traditional
85 bool traditional() { return m_traditional; }
86
87 // sets option traditional to b
88 void traditional(bool b) { m_traditional = b; }
89
90 //returns option deg4free
91 bool fixDegreeFourAngles() { return m_deg4free; }
92
93 //sets option deg4free
94 void fixDegreeFourAngles(bool b) { m_deg4free = b; }
95
96 //alignment of brothers in hierarchies
97 void align(bool al) { m_align = al; }
98
99 bool align() { return m_align; }
100
103 void setBendBound(int i) {
104 OGDF_ASSERT(i >= 0);
105 m_startBoundBendsPerEdge = i;
106 }
107
108 int getBendBound() { return m_startBoundBendsPerEdge; }
109
110private:
113
117
121
124
127
136
139
154
158 EdgeArray<edge>& aTwin, bool maxBound = true) {
159 // preliminary
160 OGDF_ASSERT(!m_traditional);
161
162 const int angleId = angle / 90;
163 const edge e2 = aTwin[netArc];
164
165 OGDF_ASSERT(angleId >= 0);
166 OGDF_ASSERT(angleId <= 2);
167
168 if (maxBound) {
169 lowB[netArc] = 2 - angleId;
170 upB[netArc] = 2;
171
172 if (e2) {
173 upB[e2] = lowB[e2] = 0;
174 }
175 } else {
176 upB[netArc] = 2 - angleId;
177 lowB[netArc] = 0;
178
179 if (e2) {
180 upB[e2] = 2;
181 lowB[e2] = 0;
182 }
183 }
184 }
185};
186
187}
Declaration of orthogonal representation of planar graphs.
Declaration of class PlanRepUML.
Combinatorial embeddings of planar graphs with modification functionality.
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Class for the representation of edges.
Definition Graph_d.h:300
Orthogonal representation of an embedded graph.
Definition OrthoRep.h:219
bool m_allowLowZero
allow low degree nodes zero degree (to low for zero...)
void setAngleBound(edge netArc, int angle, EdgeArray< int > &lowB, EdgeArray< int > &upB, EdgeArray< edge > &aTwin, bool maxBound=true)
Set angle boundary. Warning: sets upper AND lower bounds, therefore may interfere with existing bound...
void call(PlanRep &PG, CombinatorialEmbedding &E, OrthoRep &OR, bool fourPlanar=true)
bool m_align
Try to achieve an alignment in hierarchy levels.
void setBendBound(int i)
Set bound for number of bends per edge (none if set to 0). If shape flow computation is unsuccessful,...
bool fixDegreeFourAngles()
Definition OrthoShaper.h:91
void call(PlanRepUML &PG, CombinatorialEmbedding &E, OrthoRep &OR, bool fourPlanar=true)
bool m_deg4free
allow degree four nodes free angle assignment
int m_startBoundBendsPerEdge
Bound on the number of bends per edge for flow.
bool m_fourPlanar
should the input graph be four planar (no zero degree)
void fixDegreeFourAngles(bool b)
Definition OrthoShaper.h:94
NetworkNodeType
Types of network nodes: nodes and faces.
Definition OrthoShaper.h:44
void traditional(bool b)
Definition OrthoShaper.h:88
void align(bool al)
Definition OrthoShaper.h:97
bool m_multiAlign
multi edges aligned on the same side
void distributeEdges(bool b)
Definition OrthoShaper.h:76
void setDefaultSettings()
Definition OrthoShaper.h:61
bool m_traditional
Do not prefer 180-degree angles.
void multiAlign(bool b)
Definition OrthoShaper.h:82
bool m_distributeEdges
distribute edges among all sides if degree > 4
Planarized representations (of a connected component) of a graph.
Definition PlanRep.h:57
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition PlanRepUML.h:48
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition basic.h:41
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.