Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ClusterGraphCopyAttributes.h
Go to the documentation of this file.
1 
33 #pragma once
34 
37 
38 
39 namespace ogdf {
40 
47 
51 
52 public:
55  const ExtendedNestingGraph &H,
57  m_pH(&H), m_pACG(&ACG), m_x(H,0), m_y(H,0) { }
58 
60 
62  const ClusterGraphAttributes &getClusterGraphAttributes() const { return *m_pACG; }
63 
65  double getWidth(node v) const {
66  node vOrig = m_pH->origNode(v);
67  return (vOrig == nullptr) ? 0.0 : m_pACG->width(vOrig);
68  }
69 
71  double getHeight(node v) const {
72  node vOrig = m_pH->origNode(v);
73  return (vOrig == nullptr) ? 0.0 : m_pACG->height(vOrig);
74  }
75 
77  const double &x(node v) const {
78  return m_x[v];
79  }
80 
82  double &x(node v) {
83  return m_x[v];
84  }
85 
87  const double &y(node v) const {
88  return m_y[v];
89  }
90 
92  double &y(node v) {
93  return m_y[v];
94  }
95 
97  double top(cluster cOrig) const {
98  return m_pACG->y(cOrig);
99  }
101  double bottom(cluster cOrig) const {
102  return m_pACG->y(cOrig) + m_pACG->height(cOrig);
103  }
104 
107  cluster cOrig,
108  double left,
109  double right,
110  double top,
111  double bottom)
112  {
113  m_pACG->x (cOrig) = left;
114  m_pACG->y (cOrig) = top;
115  m_pACG->width (cOrig) = right-left;
116  m_pACG->height(cOrig) = bottom-top;
117  }
118 
120  cluster cOrig,
121  double left,
122  double right)
123  {
124  m_pACG->x (cOrig) = left;
125  m_pACG->width (cOrig) = right-left;
126  }
127 
129  cluster cOrig,
130  double top,
131  double bottom)
132  {
133  m_pACG->y (cOrig) = top;
134  m_pACG->height(cOrig) = bottom-top;
135  }
136 
138  void transform();
139 };
140 
141 
142 } // end namespace ogdf
void setClusterLeftRight(cluster cOrig, double left, double right)
double getWidth(node v) const
Returns width of node v.
Manages access on copy of an attributed clustered graph.
void setClusterRect(cluster cOrig, double left, double right, double top, double bottom)
Sets the position of the cluster rectangle for original cluster cOrig.
const double & y(node v) const
Returns reference to y-coord. of node v.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
double top(cluster cOrig) const
Returns coordinate of upper cluster boundary of original cluster cOrig.
double & x(node v)
Returns reference to x-coord. of node v.
double bottom(cluster cOrig) const
Returns coordinate of lower cluster boundary of original cluster cOrig.
double width(cluster c) const
Returns the width of cluster c.
const double & x(node v) const
Returns reference to x-coord. of node v.
double height(cluster c) const
Returns the height of cluster c.
double x(cluster c) const
Returns the x-position of cluster c's cage (lower left corner).
Stores additional attributes of a clustered graph (like layout information).
Class for the representation of nodes.
Definition: Graph_d.h:167
void setClusterTopBottom(cluster cOrig, double top, double bottom)
Declares ClusterGraphAttributes, an extension of class GraphAttributes, to store clustergraph layout ...
Representation of clusters in a clustered graph.
Definition: ClusterGraph.h:53
double & y(node v)
Returns reference to y-coord. of node v.
const ClusterGraphAttributes & getClusterGraphAttributes() const
Returns corresponding ClusterGraphAttributes.
double y(cluster c) const
Returns the y-position of cluster c's cage (lower left corner).
ClusterGraphCopyAttributes(const ExtendedNestingGraph &H, ClusterGraphAttributes &ACG)
Initializes instance of class ClusterGraphCopyAttributes.
The namespace for all OGDF objects.
double getHeight(node v) const
Returns height of node v.
Declaration of ExtendedNestingGraph.