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
35#include <ogdf/basic/Graph.h>
36#include <ogdf/basic/basic.h>
40
41namespace ogdf {
42
52
53public:
56 : m_pH(&H), m_pACG(&ACG), m_x(H, 0), m_y(H, 0) { }
57
59
61 const ClusterGraphAttributes& getClusterGraphAttributes() const { return *m_pACG; }
62
64 double getWidth(node v) const {
65 node vOrig = m_pH->origNode(v);
66 return (vOrig == nullptr) ? 0.0 : m_pACG->width(vOrig);
67 }
68
70 double getHeight(node v) const {
71 node vOrig = m_pH->origNode(v);
72 return (vOrig == nullptr) ? 0.0 : m_pACG->height(vOrig);
73 }
74
76 const double& x(node v) const { return m_x[v]; }
77
79 double& x(node v) { return m_x[v]; }
80
82 const double& y(node v) const { return m_y[v]; }
83
85 double& y(node v) { return m_y[v]; }
86
88 double top(cluster cOrig) const { return m_pACG->y(cOrig); }
89
91 double bottom(cluster cOrig) const { return m_pACG->y(cOrig) + m_pACG->height(cOrig); }
92
94 void setClusterRect(cluster cOrig, double left, double right, double top, double bottom) {
95 m_pACG->x(cOrig) = left;
96 m_pACG->y(cOrig) = top;
97 m_pACG->width(cOrig) = right - left;
98 m_pACG->height(cOrig) = bottom - top;
99 }
100
101 void setClusterLeftRight(cluster cOrig, double left, double right) {
102 m_pACG->x(cOrig) = left;
103 m_pACG->width(cOrig) = right - left;
104 }
105
106 void setClusterTopBottom(cluster cOrig, double top, double bottom) {
107 m_pACG->y(cOrig) = top;
108 m_pACG->height(cOrig) = bottom - top;
109 }
110
112 void transform();
113};
114
115}
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
Declares ClusterGraphAttributes, an extension of class GraphAttributes, to store clustergraph layout ...
Declaration of ExtendedNestingGraph.
Includes declaration of graph class.
Basic declarations, included by all source files.
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.
Class for the representation of nodes.
Definition Graph_d.h:241
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.