Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / ogdf / module / HierarchyLayoutModule.h
blob1ad53ae28bd7e1a948aac2b91c5910e0baff3d15
1 /*
2 * $Revision: 2583 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-12 01:02:21 +0200 (Do, 12. Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Declaration of interface hierarchy layout algorithms
11 * (3. phase of Sugiyama).
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_HIER_LAYOUT_MODULE_H
50 #define OGDF_HIER_LAYOUT_MODULE_H
54 #include <ogdf/layered/Hierarchy.h>
55 #include <ogdf/basic/GraphCopyAttributes.h>
58 namespace ogdf {
61 /**
62 * \brief Interface of hierarchy layout algorithms.
64 * \see SugiyamaLayout
66 class OGDF_EXPORT HierarchyLayoutModule {
67 public:
68 //! Initializes a hierarchy layout module.
69 HierarchyLayoutModule() { }
71 virtual ~HierarchyLayoutModule() { }
73 /**
74 * \brief Computes a hierarchy layout of \a H in \a AGA
75 * @param H is the input hierarchy.
76 * @param GA is assigned the hierarchy layout.
78 void call(const Hierarchy& H, GraphAttributes &GA) {
79 GraphCopyAttributes AGC(H,GA);
80 doCall(H,AGC);
81 AGC.transform();
85 // * \brief Computes a hierarchy layout of \a H in \a AG.
86 // * @param H is the input hierarchy.
87 // * @param AG is assigned the hierarchy layout.
88 // */
89 //void call(Hierarchy& H, GraphAttributes &AG) {
90 // GraphCopyAttributes AGC(H,AG);
91 // doCall(H,AGC);
92 // HierarchyLayoutModule::dynLayerDistance(AGC, H);
93 // HierarchyLayoutModule::addBends(AGC, H);
94 // AGC.transform();
95 //}
99 // * \brief Computes a hierarchy layout of \a H in \a AG.
100 // * @param H is the input hierarchy.
101 // * @param AG is assigned the hierarchy layout.
102 // * @param AGC is GraphCopyAttribute init. with H and AG
103 // */
104 //void call(const Hierarchy& H, GraphAttributes &, GraphCopyAttributes &AGC) {
105 // doCall(H,AGC);
109 //! Adds bends to edges for avoiding crossings with nodes.
110 static void addBends(GraphCopyAttributes &AGC, Hierarchy &H);
112 static void dynLayerDistance(GraphCopyAttributes &AGC, Hierarchy &H);
114 private:
116 //! after calling, ci (cj) contains the number of nodes of level i (j=i-1) which overlap the edge (s,t)
117 static void overlap(GraphCopyAttributes &AGC, Hierarchy &H, node s, node t, int i, int &ci, int &cj);
119 protected:
121 * \brief Implements the actual algorithm call.
123 * Must be implemented by derived classes.
125 * @param H is the input hierarchy.
126 * @param AGC has to be assigned the hierarchy layout.
128 virtual void doCall(const Hierarchy& H, GraphCopyAttributes &AGC) = 0;
130 OGDF_MALLOC_NEW_DELETE
135 } // end namespace ogdf
138 #endif