6 * $Date: 2012-07-12 01:02:21 +0200 (Do, 12. Jul 2012) $
7 ***************************************************************/
10 * \brief Declaration of interface hierarchy layout algorithms
11 * (3. phase of Sugiyama).
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_HIER_LAYOUT_MODULE_H
50 #define OGDF_HIER_LAYOUT_MODULE_H
54 #include <ogdf/layered/Hierarchy.h>
55 #include <ogdf/basic/GraphCopyAttributes.h>
62 * \brief Interface of hierarchy layout algorithms.
66 class OGDF_EXPORT HierarchyLayoutModule
{
68 //! Initializes a hierarchy layout module.
69 HierarchyLayoutModule() { }
71 virtual ~HierarchyLayoutModule() { }
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
);
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.
89 //void call(Hierarchy& H, GraphAttributes &AG) {
90 // GraphCopyAttributes AGC(H,AG);
92 // HierarchyLayoutModule::dynLayerDistance(AGC, H);
93 // HierarchyLayoutModule::addBends(AGC, H);
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
104 //void call(const Hierarchy& H, GraphAttributes &, GraphCopyAttributes &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
);
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
);
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