Return error message "User Cancelled" when user press cancel in password box
[TortoiseGit.git] / ext / OGDF / ogdf / energybased / CoinTutteLayout.h
blob23f3ebe5d2462eb7cb3ca09a93c817637f4d5a15
1 /*
2 * $Revision: 2614 $
4 * last checkin:
5 * $Author: chimani $
6 * $Date: 2012-07-16 11:30:08 +0200 (Mo, 16. Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Declaration of Tutte's algorithm
12 * The class CoinTutteLayout represents the layout algorithm by
13 * Tutte.
15 * \par
16 * This algorithm draws a planar graph \a G straight-line
17 * without crossings. It can also draw non-planar graphs.
19 * \par
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
25 * \par License:
26 * This file is part of the Open Graph Drawing Framework (OGDF).
28 * \par
29 * Copyright (C)<br>
30 * See README.txt in the root directory of the OGDF installation for details.
32 * \par
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
37 * for details.
39 * \par
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.
45 * \par
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 ***************************************************************/
55 #ifdef _MSC_VER
56 #pragma once
57 #endif
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>
67 #ifdef USE_COIN
68 #include <coin/CoinPackedMatrix.hpp>
69 #endif
71 namespace ogdf {
73 class OGDF_EXPORT TutteLayout : public LayoutModule
75 #ifndef USE_COIN
76 public:
78 void call(GraphAttributes &AG) { THROW_NO_COIN_EXCEPTION; }
79 void call(GraphAttributes &AG, const List<node>& givenNodes) { THROW_NO_COIN_EXCEPTION; }
83 #else // USE_COIN
84 public:
86 TutteLayout();
87 ~TutteLayout() { }
89 DRect bbox () const {
90 return m_bbox;
93 void bbox (const DRect &bb) {
94 m_bbox = bb;
97 void call(GraphAttributes &AG);
98 void call(GraphAttributes &AG, const List<node> &givenNodes);
101 private:
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);
120 DRect m_bbox;
123 #endif // USE_COIN
125 } // end namespace ogdf
127 #endif // OGDF_TUTTE_LAYOUT_H