Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / ogdf / decomposition / StaticSkeleton.h
blob1e2fec2ba4f501debb9043b9f97ef8d22d89719d
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 StaticSkeleton.
12 * \author Carsten Gutwenger
14 * \par License:
15 * This file is part of the Open Graph Drawing Framework (OGDF).
17 * \par
18 * Copyright (C)<br>
19 * See README.txt in the root directory of the OGDF installation for details.
21 * \par
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
26 * for details.
28 * \par
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * \par
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
44 #ifdef _MSC_VER
45 #pragma once
46 #endif
49 #ifndef OGDF_STATIC_SKELETON_H
50 #define OGDF_STATIC_SKELETON_H
53 #include <ogdf/decomposition/Skeleton.h>
56 namespace ogdf {
58 class OGDF_EXPORT StaticSPQRTree;
61 //! %Skeleton graphs of nodes in a static SPQR-tree.
62 /**
63 * The class StaticSkeleton maintains the skeleton \a S of a node \a vT in a static SPQR-tree
64 * \a T. We call \a T the owner tree of \a S and \a vT the corresponding tree node. Let
65 * \a G be the original graph of \a T.
67 * \a S consists of an undirected multi-graph \a M. If the owner tree of \a S is
68 * a PlanarSPQRTree, then \a M represents a combinatorial embedding.
69 * The vertices in \a M correspond to vertices in \a G. The edges in \a M are of
70 * two types: Real edges correspond to edges in \a G and virtual edges correspond
71 * to tree-edges in \a T having \a vT as an endpoint.
73 * Let \a e in \a M be a virtual edge and \a eT be the corresponding tree-edge.
74 * Then there exists exactly one edge \a e' in another skeleton \a S' of \a T that
75 * corresponds to \a eT as well. We call \a e' the twin edge of \a e.
77 class OGDF_EXPORT StaticSkeleton : public Skeleton
79 friend class OGDF_EXPORT StaticSPQRTree;
81 public:
83 // constructor
85 //! Creates a skeleton \a S with owner tree \a T and corresponding node \a vT.
86 /**
87 * \pre \a vT is a node in \a T
89 * \remarks Skeletons are created by the constructor of SPQRTree
90 * and can be accessed with the skeleton() function of SPQRTree.
92 StaticSkeleton(const StaticSPQRTree *T, node vT);
95 // destructor
96 ~StaticSkeleton() { }
99 //! Returns the owner tree \a T.
100 const SPQRTree &owner() const;
102 //! Returns the vertex in the original graph \a G that corresponds to \a v.
104 * \pre \a v is a node in \a M.
106 node original (node v) const {
107 return m_orig[v];
110 //! Returns true iff \a e is a virtual edge.
112 * \pre \a e is an edge in \a M
114 bool isVirtual (edge e) const {
115 return (m_real[e] == 0);
118 //! Returns the real edge that corresponds to skeleton edge \a e
120 * If \a e is virtual edge, then 0 is returned.
121 * \pre \a e is an edge in \a M
123 edge realEdge (edge e) const {
124 return m_real[e];
127 //! Returns the twin edge of skeleton edge \a e.
129 * If \a e is not a virtual edge, then 0 is returned.
130 * \pre \a e is an edge in \a M
132 edge twinEdge (edge e) const;
134 //! Returns the tree node in T containing the twin edge of skeleton edge \a e.
136 * If \a e is not a virtual edge, then 0 is returned.
137 * \pre \a e is an edge in \a M
139 node twinTreeNode (edge e) const;
141 //! Returns the tree edge which is associated with skeleton edge \a e.
143 * If \a e is not a virtual edge, then 0 is retuned.
144 * \pre \a e is an edge in \a M
146 edge treeEdge (edge e) const {
147 return m_treeEdge[e];
150 OGDF_MALLOC_NEW_DELETE
152 protected:
153 const StaticSPQRTree *m_owner; //!< owner tree
154 NodeArray<node> m_orig; //!< corresp. original node
155 EdgeArray<edge> m_real; //!< corresp. original edge (0 if virtual)
156 EdgeArray<edge> m_treeEdge; //!< corresp. tree edge (0 if real)
160 } // end namespace ogdf
163 #endif