1 /** \file 2 * \brief Declaration of interface for hierarchy layout algorithms 3 * (3. phase of Sugiyama) for cluster graphs. 4 * 5 * \author Carsten Gutwenger 6 * 7 * \par License: 8 * This file is part of the Open Graph Drawing Framework (OGDF). 9 * 10 * \par 11 * Copyright (C)<br> 12 * See README.md in the OGDF root directory for details. 13 * 14 * \par 15 * This program is free software; you can redistribute it and/or 16 * modify it under the terms of the GNU General Public License 17 * Version 2 or 3 as published by the Free Software Foundation; 18 * see the file LICENSE.txt included in the packaging of this file 19 * for details. 20 * 21 * \par 22 * This program is distributed in the hope that it will be useful, 23 * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 * GNU General Public License for more details. 26 * 27 * \par 28 * You should have received a copy of the GNU General Public 29 * License along with this program; if not, see 30 * http://www.gnu.org/copyleft/gpl.html 31 */ 32 33 #pragma once 34 35 #include <ogdf/cluster/ClusterGraphCopyAttributes.h> 36 37 38 namespace ogdf { 39 40 41 /** 42 * \brief Interface of hierarchy layout algorithms for cluster graphs. 43 * 44 * \see SugiyamaLayout 45 */ 46 class OGDF_EXPORT HierarchyClusterLayoutModule { 47 public: 48 //! Initializes a hierarchy cluster layout module. HierarchyClusterLayoutModule()49 HierarchyClusterLayoutModule() { } 50 ~HierarchyClusterLayoutModule()51 virtual ~HierarchyClusterLayoutModule() { } 52 53 /** 54 * \brief Computes a hierarchy layout of a clustered hierarchy \p H in \p ACG. 55 * @param H is the input clustered hierarchy. 56 * @param ACG is assigned the cluster hierarchy layout. 57 */ callCluster(const ExtendedNestingGraph & H,ClusterGraphAttributes & ACG)58 void callCluster(const ExtendedNestingGraph& H, ClusterGraphAttributes &ACG) { 59 ClusterGraphCopyAttributes ACGC(H,ACG); 60 doCall(H,ACGC); 61 ACGC.transform(); 62 } 63 64 protected: 65 /** 66 * \brief Implements the actual algorithm call. 67 * 68 * Must be implemented by derived classes. 69 * 70 * @param H is the input clustered hierarchy. 71 * @param ACGC has to be assigned the cluster hierarchy layout. 72 */ 73 virtual void doCall( 74 const ExtendedNestingGraph& H, 75 ClusterGraphCopyAttributes &ACGC) = 0; 76 77 OGDF_MALLOC_NEW_DELETE 78 }; 79 80 } 81