1 /** \file 2 * \brief Declaration of interface for layout algorithms (class 3 * LayoutModule) 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/basic/GraphAttributes.h> 36 37 namespace ogdf { 38 39 40 /** 41 * \brief Interface of general layout algorithms. 42 * 43 */ 44 class OGDF_EXPORT LayoutModule { 45 public: 46 //! Initializes a layout module. LayoutModule()47 LayoutModule() { } 48 ~LayoutModule()49 virtual ~LayoutModule() { } 50 51 /** 52 * \brief Computes a layout of graph \p GA. 53 * 54 * This method is the actual algorithm call and must be implemented by 55 * derived classes. 56 * @param GA is the input graph and will also be assigned the layout information. 57 */ 58 virtual void call(GraphAttributes &GA) = 0; 59 60 /** 61 * \brief Computes a layout of graph \p GA. 62 * 63 * @param GA is the input graph and will also be assigned the layout information. 64 */ operator()65 void operator()(GraphAttributes &GA) { call(GA); } 66 67 OGDF_MALLOC_NEW_DELETE 68 }; 69 70 } 71