Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ClusterGraphCopyAttributes.h
Go to the documentation of this file.
1
33#pragma once
34
37
38namespace ogdf {
39
49
50public:
53 : m_pH(&H), m_pACG(&ACG), m_x(H, 0), m_y(H, 0) { }
54
56
58 const ClusterGraphAttributes& getClusterGraphAttributes() const { return *m_pACG; }
59
61 double getWidth(node v) const {
62 node vOrig = m_pH->origNode(v);
63 return (vOrig == nullptr) ? 0.0 : m_pACG->width(vOrig);
64 }
65
67 double getHeight(node v) const {
68 node vOrig = m_pH->origNode(v);
69 return (vOrig == nullptr) ? 0.0 : m_pACG->height(vOrig);
70 }
71
73 const double& x(node v) const { return m_x[v]; }
74
76 double& x(node v) { return m_x[v]; }
77
79 const double& y(node v) const { return m_y[v]; }
80
82 double& y(node v) { return m_y[v]; }
83
85 double top(cluster cOrig) const { return m_pACG->y(cOrig); }
86
88 double bottom(cluster cOrig) const { return m_pACG->y(cOrig) + m_pACG->height(cOrig); }
89
91 void setClusterRect(cluster cOrig, double left, double right, double top, double bottom) {
92 m_pACG->x(cOrig) = left;
93 m_pACG->y(cOrig) = top;
94 m_pACG->width(cOrig) = right - left;
95 m_pACG->height(cOrig) = bottom - top;
96 }
97
98 void setClusterLeftRight(cluster cOrig, double left, double right) {
99 m_pACG->x(cOrig) = left;
100 m_pACG->width(cOrig) = right - left;
101 }
102
103 void setClusterTopBottom(cluster cOrig, double top, double bottom) {
104 m_pACG->y(cOrig) = top;
105 m_pACG->height(cOrig) = bottom - top;
106 }
107
109 void transform();
110};
111
112}
Declares ClusterGraphAttributes, an extension of class GraphAttributes, to store clustergraph layout ...
Declaration of ExtendedNestingGraph.
Representation of clusters in a clustered graph.
Stores additional attributes of a clustered graph (like layout information).
double x(cluster c) const
Returns the x-position of cluster c's cage (lower left corner).
double width(cluster c) const
Returns the width of cluster c.
double y(cluster c) const
Returns the y-position of cluster c's cage (lower left corner).
double height(cluster c) const
Returns the height of cluster c.
Manages access on copy of an attributed clustered graph.
double & y(node v)
Returns reference to y-coord. of node v.
double bottom(cluster cOrig) const
Returns coordinate of lower cluster boundary of original cluster cOrig.
void setClusterLeftRight(cluster cOrig, double left, double right)
double getWidth(node v) const
Returns width of node v.
const double & x(node v) const
Returns reference to x-coord. of node v.
ClusterGraphCopyAttributes(const ExtendedNestingGraph &H, ClusterGraphAttributes &ACG)
Initializes instance of class ClusterGraphCopyAttributes.
void setClusterTopBottom(cluster cOrig, double top, double bottom)
double & x(node v)
Returns reference to x-coord. of node v.
double top(cluster cOrig) const
Returns coordinate of upper cluster boundary of original cluster cOrig.
void transform()
Sets attributes for the original graph in attributed graph.
const ClusterGraphAttributes & getClusterGraphAttributes() const
Returns corresponding ClusterGraphAttributes.
const double & y(node v) const
Returns reference to y-coord. of node v.
double getHeight(node v) const
Returns height of node v.
void setClusterRect(cluster cOrig, double left, double right, double top, double bottom)
Sets the position of the cluster rectangle for original cluster cOrig.
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Class for the representation of nodes.
Definition Graph_d.h:177
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.