6 * $Date: 2012-07-02 20:59:27 +0200 (Mon, 02 Jul 2012) $
7 ***************************************************************/
10 * \brief Declaration of class GraphCopy Attributes which manages
11 * access on a copy of an attributed graph.
13 * \author Carsten Gutwenger
16 * This file is part of the Open Graph Drawing Framework (OGDF).
20 * See README.txt in the root directory of the OGDF installation for details.
23 * This program is free software; you can redistribute it and/or
24 * modify it under the terms of the GNU General Public License
25 * Version 2 or 3 as published by the Free Software Foundation;
26 * see the file LICENSE.txt included in the packaging of this file
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU General Public License for more details.
36 * You should have received a copy of the GNU General Public
37 * License along with this program; if not, write to the Free
38 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
39 * Boston, MA 02110-1301, USA.
41 * \see http://www.gnu.org/copyleft/gpl.html
42 ***************************************************************/
49 #ifndef OGDF_A_GRAPH_COPY_H
50 #define OGDF_A_GRAPH_COPY_H
54 #include <ogdf/basic/GraphCopy.h>
55 #include <ogdf/basic/GraphAttributes.h>
60 //---------------------------------------------------------
61 // GraphCopyAttributes
62 // manages access on copy of an attributed graph
63 //---------------------------------------------------------
64 class OGDF_EXPORT GraphCopyAttributes
{
66 const GraphCopy
*m_pGC
;
67 GraphAttributes
*m_pAG
;
68 NodeArray
<double> m_x
, m_y
;
72 GraphCopyAttributes(const GraphCopy
&GC
, GraphAttributes
&AG
) :
73 m_pGC(&GC
), m_pAG(&AG
), m_x(GC
,0), m_y(GC
,0) { }
76 ~GraphCopyAttributes() { }
78 // returns width of node v
79 double getWidth(node v
) const {
80 return (m_pGC
->isDummy(v
) ? 0.0 : m_pAG
->width(m_pGC
->original(v
)));
83 // returns height of node v
84 double getHeight(node v
) const {
85 return (m_pGC
->isDummy(v
) ? 0.0 : m_pAG
->height(m_pGC
->original(v
)));
88 // returns reference to x-coord. of node v
89 const double &x(node v
) const {
93 // returns reference to x-coord. of node v
98 // returns reference to y-coord. of node v
99 const double &y(node v
) const {
103 // returns reference to y-coord. of node v
108 // sets attributes for the original graph in AG
113 } // end namespace ogdf