Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ClusterGraphCopyAttributes.h
Go to the documentation of this file.
1 
33 #pragma once
34 
37 
38 namespace ogdf {
39 
49 
50 public:
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 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::ClusterGraphCopyAttributes::getHeight
double getHeight(node v) const
Returns height of node v.
Definition: ClusterGraphCopyAttributes.h:67
ogdf::ClusterGraphAttributes::height
double height(cluster c) const
Returns the height of cluster c.
Definition: ClusterGraphAttributes.h:217
ogdf::ClusterGraphCopyAttributes::x
double & x(node v)
Returns reference to x-coord. of node v.
Definition: ClusterGraphCopyAttributes.h:76
ogdf::ClusterGraphCopyAttributes::y
const double & y(node v) const
Returns reference to y-coord. of node v.
Definition: ClusterGraphCopyAttributes.h:79
ogdf::ClusterGraphCopyAttributes::m_pACG
ClusterGraphAttributes * m_pACG
Definition: ClusterGraphCopyAttributes.h:47
ogdf::ClusterGraphCopyAttributes::ClusterGraphCopyAttributes
ClusterGraphCopyAttributes(const ExtendedNestingGraph &H, ClusterGraphAttributes &ACG)
Initializes instance of class ClusterGraphCopyAttributes.
Definition: ClusterGraphCopyAttributes.h:52
ogdf::ClusterGraphCopyAttributes::getClusterGraphAttributes
const ClusterGraphAttributes & getClusterGraphAttributes() const
Returns corresponding ClusterGraphAttributes.
Definition: ClusterGraphCopyAttributes.h:58
ogdf::ClusterGraphCopyAttributes::m_pH
const ExtendedNestingGraph * m_pH
Definition: ClusterGraphCopyAttributes.h:46
ogdf::ClusterElement
Representation of clusters in a clustered graph.
Definition: ClusterGraph.h:55
ogdf::ClusterGraphAttributes
Stores additional attributes of a clustered graph (like layout information).
Definition: ClusterGraphAttributes.h:46
ogdf::ExtendedNestingGraph::origNode
node origNode(node v) const
Definition: ExtendedNestingGraph.h:318
ogdf::ClusterGraphAttributes::y
double y(cluster c) const
Returns the y-position of cluster c's cage (lower left corner).
Definition: ClusterGraphAttributes.h:181
ogdf::ClusterGraphCopyAttributes::m_y
NodeArray< double > m_y
Definition: ClusterGraphCopyAttributes.h:48
ogdf::ClusterGraphCopyAttributes::bottom
double bottom(cluster cOrig) const
Returns coordinate of lower cluster boundary of original cluster cOrig.
Definition: ClusterGraphCopyAttributes.h:88
ogdf::ClusterGraphCopyAttributes
Manages access on copy of an attributed clustered graph.
Definition: ClusterGraphCopyAttributes.h:45
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::ClusterGraphCopyAttributes::setClusterTopBottom
void setClusterTopBottom(cluster cOrig, double top, double bottom)
Definition: ClusterGraphCopyAttributes.h:103
ogdf::ClusterGraphCopyAttributes::x
const double & x(node v) const
Returns reference to x-coord. of node v.
Definition: ClusterGraphCopyAttributes.h:73
ogdf::ClusterGraphCopyAttributes::setClusterRect
void setClusterRect(cluster cOrig, double left, double right, double top, double bottom)
Sets the position of the cluster rectangle for original cluster cOrig.
Definition: ClusterGraphCopyAttributes.h:91
ogdf::ClusterGraphAttributes::width
double width(cluster c) const
Returns the width of cluster c.
Definition: ClusterGraphAttributes.h:199
ogdf::ClusterGraphAttributes::x
double x(cluster c) const
Returns the x-position of cluster c's cage (lower left corner).
Definition: ClusterGraphAttributes.h:163
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::ClusterGraphCopyAttributes::~ClusterGraphCopyAttributes
~ClusterGraphCopyAttributes()
Definition: ClusterGraphCopyAttributes.h:55
ClusterGraphAttributes.h
Declares ClusterGraphAttributes, an extension of class GraphAttributes, to store clustergraph layout ...
ogdf::ClusterGraphCopyAttributes::y
double & y(node v)
Returns reference to y-coord. of node v.
Definition: ClusterGraphCopyAttributes.h:82
ogdf::ClusterGraphCopyAttributes::top
double top(cluster cOrig) const
Returns coordinate of upper cluster boundary of original cluster cOrig.
Definition: ClusterGraphCopyAttributes.h:85
ogdf::ExtendedNestingGraph
Definition: ExtendedNestingGraph.h:295
ogdf::ClusterGraphCopyAttributes::getWidth
double getWidth(node v) const
Returns width of node v.
Definition: ClusterGraphCopyAttributes.h:61
ExtendedNestingGraph.h
Declaration of ExtendedNestingGraph.
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::ClusterGraphCopyAttributes::setClusterLeftRight
void setClusterLeftRight(cluster cOrig, double left, double right)
Definition: ClusterGraphCopyAttributes.h:98