6 * $Date: 2012-07-16 11:30:08 +0200 (Mo, 16. Jul 2012) $
7 ***************************************************************/
10 * \brief Declaration of Tutte's algorithm
12 * The class CoinTutteLayout represents the layout algorithm by
16 * This algorithm draws a planar graph \a G straight-line
17 * without crossings. It can also draw non-planar graphs.
20 * The idea of the algorithm is to place every vertex into the
21 * center of gravity by its neighbours.
23 * \author David Alberts and Andrea Wagner
26 * This file is part of the Open Graph Drawing Framework (OGDF).
30 * See README.txt in the root directory of the OGDF installation for details.
33 * This program is free software; you can redistribute it and/or
34 * modify it under the terms of the GNU General Public License
35 * Version 2 or 3 as published by the Free Software Foundation;
36 * see the file LICENSE.txt included in the packaging of this file
40 * This program is distributed in the hope that it will be useful,
41 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43 * GNU General Public License for more details.
46 * You should have received a copy of the GNU General Public
47 * License along with this program; if not, write to the Free
48 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
49 * Boston, MA 02110-1301, USA.
51 * \see http://www.gnu.org/copyleft/gpl.html
52 ***************************************************************/
60 #ifndef OGDF_TUTTE_LAYOUT_H
61 #define OGDF_TUTTE_LAYOUT_H
63 #include <ogdf/module/LayoutModule.h>
64 #include <ogdf/basic/geometry.h>
65 #include <ogdf/external/coin.h>
68 #include <coin/CoinPackedMatrix.hpp>
73 class OGDF_EXPORT TutteLayout
: public LayoutModule
78 void call(GraphAttributes
&AG
) { THROW_NO_COIN_EXCEPTION
; }
79 void call(GraphAttributes
&AG
, const List
<node
>& givenNodes
) { THROW_NO_COIN_EXCEPTION
; }
93 void bbox (const DRect
&bb
) {
97 void call(GraphAttributes
&AG
);
98 void call(GraphAttributes
&AG
, const List
<node
> &givenNodes
);
103 void setFixedNodes(const Graph
&G
, List
<node
> &nodes
,
104 List
<DPoint
> &pos
, double radius
= 1.0);
105 /*! sets the positions of the nodes in a largest face of $G$ in the
106 * form of a regular $k$-gon with the prescribed radius. The
107 * corresponding nodes and their positions are stored in nodes
108 * and pos, respectively. $G$ does not have to be planar!
111 void setFixedNodes(const Graph
&G
, List
<node
> &nodes
, const List
<node
> &givenNodes
,
112 List
<DPoint
> &pos
, double radius
= 1.0);
113 /*! the method is overloaded for a given set of nodes.
116 bool doCall(GraphAttributes
&AG
,
117 const List
<node
> &fixedNodes
,
118 List
<DPoint
> &fixedPositions
);
125 } // end namespace ogdf
127 #endif // OGDF_TUTTE_LAYOUT_H