Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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 
41 namespace ogdf {
42 
52 
53 public:
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 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::ClusterGraphCopyAttributes::getHeight
double getHeight(node v) const
Returns height of node v.
Definition: ClusterGraphCopyAttributes.h:70
ogdf::ClusterGraphAttributes::height
double height(cluster c) const
Returns the height of cluster c.
Definition: ClusterGraphAttributes.h:223
ogdf::ClusterGraphCopyAttributes::x
double & x(node v)
Returns reference to x-coord. of node v.
Definition: ClusterGraphCopyAttributes.h:79
ogdf::ClusterGraphCopyAttributes::y
const double & y(node v) const
Returns reference to y-coord. of node v.
Definition: ClusterGraphCopyAttributes.h:82
ogdf::ClusterGraphCopyAttributes::m_pACG
ClusterGraphAttributes * m_pACG
Definition: ClusterGraphCopyAttributes.h:50
ogdf::ClusterGraphCopyAttributes::ClusterGraphCopyAttributes
ClusterGraphCopyAttributes(const ExtendedNestingGraph &H, ClusterGraphAttributes &ACG)
Initializes instance of class ClusterGraphCopyAttributes.
Definition: ClusterGraphCopyAttributes.h:55
ogdf::ClusterGraphCopyAttributes::getClusterGraphAttributes
const ClusterGraphAttributes & getClusterGraphAttributes() const
Returns corresponding ClusterGraphAttributes.
Definition: ClusterGraphCopyAttributes.h:61
ogdf::ClusterGraphCopyAttributes::m_pH
const ExtendedNestingGraph * m_pH
Definition: ClusterGraphCopyAttributes.h:49
ogdf::ClusterElement
Representation of clusters in a clustered graph.
Definition: ClusterGraph.h:62
ogdf::ClusterGraphAttributes
Stores additional attributes of a clustered graph (like layout information).
Definition: ClusterGraphAttributes.h:52
ogdf::ExtendedNestingGraph::origNode
node origNode(node v) const
Definition: ExtendedNestingGraph.h:325
ogdf::ClusterGraphAttributes::y
double y(cluster c) const
Returns the y-position of cluster c's cage (lower left corner).
Definition: ClusterGraphAttributes.h:187
ogdf::ClusterGraphCopyAttributes::m_y
NodeArray< double > m_y
Definition: ClusterGraphCopyAttributes.h:51
ogdf::ClusterGraphCopyAttributes::bottom
double bottom(cluster cOrig) const
Returns coordinate of lower cluster boundary of original cluster cOrig.
Definition: ClusterGraphCopyAttributes.h:91
ogdf::ClusterGraphCopyAttributes
Manages access on copy of an attributed clustered graph.
Definition: ClusterGraphCopyAttributes.h:48
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::ClusterGraphCopyAttributes::setClusterTopBottom
void setClusterTopBottom(cluster cOrig, double top, double bottom)
Definition: ClusterGraphCopyAttributes.h:106
ogdf::ClusterGraphCopyAttributes::x
const double & x(node v) const
Returns reference to x-coord. of node v.
Definition: ClusterGraphCopyAttributes.h:76
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:94
ogdf::ClusterGraphAttributes::width
double width(cluster c) const
Returns the width of cluster c.
Definition: ClusterGraphAttributes.h:205
ogdf::ClusterGraphAttributes::x
double x(cluster c) const
Returns the x-position of cluster c's cage (lower left corner).
Definition: ClusterGraphAttributes.h:169
basic.h
Basic declarations, included by all source files.
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:58
ClusterGraphAttributes.h
Declares ClusterGraphAttributes, an extension of class GraphAttributes, to store clustergraph layout ...
ClusterGraph.h
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
ogdf::ClusterGraphCopyAttributes::y
double & y(node v)
Returns reference to y-coord. of node v.
Definition: ClusterGraphCopyAttributes.h:85
ogdf::ClusterGraphCopyAttributes::top
double top(cluster cOrig) const
Returns coordinate of upper cluster boundary of original cluster cOrig.
Definition: ClusterGraphCopyAttributes.h:88
ogdf::ExtendedNestingGraph
Definition: ExtendedNestingGraph.h:302
ogdf::ClusterGraphCopyAttributes::getWidth
double getWidth(node v) const
Returns width of node v.
Definition: ClusterGraphCopyAttributes.h:64
ExtendedNestingGraph.h
Declaration of ExtendedNestingGraph.
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::ClusterGraphCopyAttributes::setClusterLeftRight
void setClusterLeftRight(cluster cOrig, double left, double right)
Definition: ClusterGraphCopyAttributes.h:101