Delete unnecessary code
[TortoiseGit.git] / ext / OGDF / ogdf / packing / ComponentSplitterLayout.h
blob6202522a74b8163e63bfd672028c96601bf10f71
1 /*
2 * $Revision: 2523 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-02 20:59:27 +0200 (Mon, 02 Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Splits and packs the components of a Graph.
12 * \author Gereon Bartel
14 * \par License:
15 * This file is part of the Open Graph Drawing Framework (OGDF).
17 * \par
18 * Copyright (C)<br>
19 * See README.txt in the root directory of the OGDF installation for details.
21 * \par
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
26 * for details.
28 * \par
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * \par
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
43 #ifdef _MSC_VER
44 #pragma once
45 #endif
47 #ifndef OGDF_COMPONENT_SPLITTER_LAYOUT_H
48 #define OGDF_COMPONENT_SPLITTER_LAYOUT_H
50 #include <ogdf/basic/ModuleOption.h>
51 #include <ogdf/internal/energybased/MultilevelGraph.h>
52 #include <ogdf/module/CCLayoutPackModule.h>
53 #include <ogdf/module/LayoutModule.h>
54 #include <ogdf/basic/geometry.h>
55 #include <ogdf/basic/GraphAttributes.h>
56 #include <vector>
59 namespace ogdf {
61 class OGDF_EXPORT ComponentSplitterLayout : public LayoutModule
63 private:
64 ModuleOption<LayoutModule> m_secondaryLayout;
65 ModuleOption<CCLayoutPackModule> m_packer;
67 // keeps a list of nodes for each connected component,
68 // up to date only in call method
69 Array<List<node> > nodesInCC;
70 int m_numberOfComponents;
71 double m_targetRatio;
72 int m_minDistCC;
73 int m_rotatingSteps;
74 int m_border;
76 //! Combines drawings of connected components to
77 //! a single drawing by rotating components and packing
78 //! the result (optimizes area of axis-parallel rectangle).
79 void reassembleDrawings(GraphAttributes &GA);
81 public:
82 ComponentSplitterLayout();
84 void call(GraphAttributes &GA);
86 void setLayoutModule(LayoutModule *layout) {
87 m_secondaryLayout.set(layout);
90 void setPacker(CCLayoutPackModule *packer) {
91 m_packer.set(packer);
95 } // namespace ogdf
97 #endif