Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00054 #ifdef _MSC_VER
00055 #pragma once
00056 #endif
00057
00058 #ifndef OGDF_A_CLUSTER_GRAPH_COPY_H
00059 #define OGDF_A_CLUSTER_GRAPH_COPY_H
00060
00061
00062
00063 #include <ogdf/layered/ExtendedNestingGraph.h>
00064 #include <ogdf/cluster/ClusterGraphAttributes.h>
00065
00066
00067 namespace ogdf {
00068
00072 class OGDF_EXPORT ClusterGraphCopyAttributes {
00073
00074 const ExtendedNestingGraph *m_pH;
00075 ClusterGraphAttributes *m_pACG;
00076 NodeArray<double> m_x, m_y;
00077
00078 public:
00080 ClusterGraphCopyAttributes(
00081 const ExtendedNestingGraph &H,
00082 ClusterGraphAttributes &ACG) :
00083 m_pH(&H), m_pACG(&ACG), m_x(H,0), m_y(H,0) { }
00084
00085 ~ClusterGraphCopyAttributes() { }
00086
00088 const ClusterGraphAttributes &getClusterGraphAttributes() const { return *m_pACG; }
00089
00091 double getWidth(node v) const {
00092 node vOrig = m_pH->origNode(v);
00093 return (vOrig == 0) ? 0.0 : m_pACG->width(vOrig);
00094 }
00095
00097 double getHeight(node v) const {
00098 node vOrig = m_pH->origNode(v);
00099 return (vOrig == 0) ? 0.0 : m_pACG->height(vOrig);
00100 }
00101
00103 const double &x(node v) const {
00104 return m_x[v];
00105 }
00106
00108 double &x(node v) {
00109 return m_x[v];
00110 }
00111
00113 const double &y(node v) const {
00114 return m_y[v];
00115 }
00116
00118 double &y(node v) {
00119 return m_y[v];
00120 }
00121
00123 double top(cluster cOrig) const {
00124 return m_pACG->clusterYPos(cOrig);
00125 }
00127 double bottom(cluster cOrig) const {
00128 return m_pACG->clusterYPos(cOrig) + m_pACG->clusterHeight(cOrig);
00129 }
00130
00132 void setClusterRect(
00133 cluster cOrig,
00134 double left,
00135 double right,
00136 double top,
00137 double bottom)
00138 {
00139 m_pACG->clusterXPos (cOrig) = left;
00140 m_pACG->clusterYPos (cOrig) = top;
00141 m_pACG->clusterWidth (cOrig) = right-left;
00142 m_pACG->clusterHeight(cOrig) = bottom-top;
00143 }
00144
00145 void setClusterLeftRight(
00146 cluster cOrig,
00147 double left,
00148 double right)
00149 {
00150 m_pACG->clusterXPos (cOrig) = left;
00151 m_pACG->clusterWidth (cOrig) = right-left;
00152 }
00153
00154 void setClusterTopBottom(
00155 cluster cOrig,
00156 double top,
00157 double bottom)
00158 {
00159 m_pACG->clusterYPos (cOrig) = top;
00160 m_pACG->clusterHeight(cOrig) = bottom-top;
00161 }
00162
00164 void transform();
00165 };
00166
00167
00168 }
00169
00170
00171 #endif