Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / ogdf / basic / GraphCopyAttributes.h
blobdebe0cdbc615d873f2a009be70b021e65a39d059
1 /*
2 * $Revision: 2523 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-02 20:59:27 +0200 (Mon, 02 Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Declaration of class GraphCopy Attributes which manages
11 * access on a copy of an attributed graph.
13 * \author Carsten Gutwenger
15 * \par License:
16 * This file is part of the Open Graph Drawing Framework (OGDF).
18 * \par
19 * Copyright (C)<br>
20 * See README.txt in the root directory of the OGDF installation for details.
22 * \par
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
27 * for details.
29 * \par
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.
35 * \par
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 ***************************************************************/
45 #ifdef _MSC_VER
46 #pragma once
47 #endif
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>
58 namespace ogdf {
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;
70 public:
71 // construction
72 GraphCopyAttributes(const GraphCopy &GC, GraphAttributes &AG) :
73 m_pGC(&GC), m_pAG(&AG), m_x(GC,0), m_y(GC,0) { }
75 // destruction
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 {
90 return m_x[v];
93 // returns reference to x-coord. of node v
94 double &x(node v) {
95 return m_x[v];
98 // returns reference to y-coord. of node v
99 const double &y(node v) const {
100 return m_y[v];
103 // returns reference to y-coord. of node v
104 double &y(node v) {
105 return m_y[v];
108 // sets attributes for the original graph in AG
109 void transform();
113 } // end namespace ogdf
116 #endif