Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
LayoutStandards.h
Go to the documentation of this file.
1
33#pragma once
34
35#include <ogdf/basic/basic.h>
36#include <ogdf/basic/graphics.h>
37
38namespace ogdf {
39
41
45 static double s_defNodeWidth;
46 static double s_defNodeHeight;
50
53
56
57 static double s_defNodeSeparation;
58 static double s_defCCSeparation;
59
60public:
66
68 static double defaultNodeWidth() { return s_defNodeWidth; }
69
71
74 static void setDefaultNodeWidth(double w) {
75 if (w > 0.0) {
76 s_defNodeWidth = w;
77 }
78 }
79
81 static double defaultNodeHeight() { return s_defNodeHeight; }
82
84
87 static void setDefaultNodeHeight(double h) {
88 if (h > 0.0) {
89 s_defNodeHeight = h;
90 }
91 }
92
94 static Shape defaultNodeShape() { return s_defNodeShape; }
95
97 static void setDefaultNodeShape(Shape s) { s_defNodeShape = s; }
98
100 static Stroke defaultNodeStroke() { return s_defNodeStroke; }
101
103 static Color defaultNodeStrokeColor() { return s_defNodeStroke.m_color; }
104
106 static float defaultNodeStrokeWidth() { return s_defNodeStroke.m_width; }
107
109 static void setDefaultNodeStroke(Stroke stroke) { s_defNodeStroke = stroke; }
110
112 static Fill defaultNodeFill() { return s_defNodeFill; }
113
115 static Color defaultNodeFillColor() { return s_defNodeFill.m_color; }
116
118 static void setDefaultNodeFill(Fill fill) { s_defNodeFill = fill; }
119
121
126
128 static Stroke defaultEdgeStroke() { return s_defEdgeStroke; }
129
131 static Color defaultEdgeStrokeColor() { return s_defEdgeStroke.m_color; }
132
134 static float defaultEdgeStrokeWidth() { return s_defEdgeStroke.m_width; }
135
137 static void setDefaultEdgeStroke(Stroke stroke) { s_defEdgeStroke = stroke; }
138
140 static EdgeArrow defaultEdgeArrow() { return s_defEdgeArrow; }
141
143 static void setDefaultEdgeArrow(EdgeArrow arrow) { s_defEdgeArrow = arrow; }
144
146
151
153 static Stroke defaultClusterStroke() { return s_defClusterStroke; }
154
156 static Color defaultClusterStrokeColor() { return s_defClusterStroke.m_color; }
157
159 static float defaultClusterStrokeWidth() { return s_defClusterStroke.m_width; }
160
162 static void setDefaultClusterStroke(Stroke stroke) { s_defClusterStroke = stroke; }
163
165 static Fill defaultClusterFill() { return s_defClusterFill; }
166
168 static Color defaultClusterFillColor() { return s_defClusterFill.m_color; }
169
171 static void setDefaultClusterFill(Fill fill) { s_defClusterFill = fill; }
172
174
179
181 static double defaultNodeSeparation() { return s_defNodeSeparation; }
182
184
187 static void setDefaultNodeSeparation(double d) {
188 if (d > 0.0) {
189 s_defNodeSeparation = d;
190 }
191 }
192
194 static double defaultCCSeparation() { return s_defCCSeparation; }
195
197
200 static void setDefaultCCSeparation(double d) {
201 if (d > 0.0) {
202 s_defCCSeparation = d;
203 }
204 }
205
207};
208
209}
Basic declarations, included by all source files.
Colors represented as RGBA values.
Definition graphics.h:164
Standard values for graphical attributes and layouts.
static void setDefaultNodeStroke(Stroke stroke)
Sets the global default stroke for nodes to stroke.
static Color defaultClusterStrokeColor()
Returns the global default stroke color for clusters.
static void setDefaultNodeShape(Shape s)
Sets the global default shape for nodes to s.
static Stroke s_defClusterStroke
the default cluster stroke.
static double defaultNodeSeparation()
Returns the global default node separation.
static Stroke s_defEdgeStroke
the default stroke of an edge.
static Fill defaultClusterFill()
Returns the global default fill for clusters.
static void setDefaultNodeFill(Fill fill)
Sets the global default fill for nodes to fill.
static float defaultEdgeStrokeWidth()
Returns the global default stroke width for edges.
static void setDefaultNodeHeight(double h)
Sets the global default height for nodes to h.
static void setDefaultNodeSeparation(double d)
Sets the global default node separation to d.
static void setDefaultCCSeparation(double d)
Sets the global default separation between connected components to d.
static Stroke s_defNodeStroke
the default stroke of a node.
static float defaultNodeStrokeWidth()
Returns the global default stroke width for nodes.
static EdgeArrow defaultEdgeArrow()
Returns the global default arrow type for edges.
static Shape s_defNodeShape
the default shape of a node.
static double s_defNodeSeparation
the default node separation (for layout algorithms) (must be positive).
static Color defaultNodeStrokeColor()
Returns the global default stroke color for nodes.
static void setDefaultNodeWidth(double w)
Sets the global default width for nodes to w.
static Color defaultClusterFillColor()
Returns the global default fill color for clusters.
static Shape defaultNodeShape()
Returns the global default shape for nodes.
static Fill defaultNodeFill()
Returns the global default fill for nodes.
static float defaultClusterStrokeWidth()
Returns the global default stroke width for clusters.
static Fill s_defNodeFill
the default fill of a node.
static double s_defNodeHeight
the default height of a node (must be positive).
static void setDefaultClusterStroke(Stroke stroke)
Sets the global default stroke for cluster to stroke.
static Color defaultNodeFillColor()
Returns the global default fill color for nodes.
static Stroke defaultEdgeStroke()
Returns the global default stroke for edges.
static double defaultNodeWidth()
Returns the global default width for nodes.
static double defaultNodeHeight()
Returns the global default height for nodes.
static Color defaultEdgeStrokeColor()
Returns the global default stroke color for edges.
static Stroke defaultClusterStroke()
Returns the global default stroke for clusters.
static Stroke defaultNodeStroke()
Returns the global default stroke for nodes.
static void setDefaultClusterFill(Fill fill)
Sets the global default fill for clusters to fill.
static void setDefaultEdgeStroke(Stroke stroke)
Sets the global default stroke for edges to stroke.
static double s_defCCSeparation
the default separation between connected components (for layout algorithms) (must be positive).
static void setDefaultEdgeArrow(EdgeArrow arrow)
Sets the global default arrow type for edges to arrow.
static EdgeArrow s_defEdgeArrow
the default arrow type of an edge .
static Fill s_defClusterFill
the default cluster fill.
static double s_defNodeWidth
the default width of a node (must be positive).
static double defaultCCSeparation()
Returns the global default separation between connected components.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
Declaration of basic types for graphics.
Shape
Types for node shapes.
Definition graphics.h:120
EdgeArrow
Types for edge arrows.
Definition graphics.h:145
The namespace for all OGDF objects.
Properties of fills.
Definition graphics.h:422
Color m_color
fill color
Definition graphics.h:423
Properties of strokes.
Definition graphics.h:396
float m_width
stroke width
Definition graphics.h:398
Color m_color
stroke color
Definition graphics.h:397