Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / ogdf / energybased / multilevelmixer / SolarMerger.h
blob97b44c5be55f83fb0f2bc6ba2eac435066b87d3c
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 Merges nodes with solar system rules.
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 #include <ogdf/energybased/multilevelmixer/MultilevelBuilder.h>
45 #ifdef _MSC_VER
46 #pragma once
47 #endif
49 #ifndef OGDF_SOLAR_MERGER_H
50 #define OGDF_SOLAR_MERGER_H
53 namespace ogdf {
55 class OGDF_EXPORT SolarMerger : public MultilevelBuilder
57 struct PathData {
58 PathData(int targetSun = 0, double length = 0.0f, int number = 0)
59 : targetSun(targetSun), length(length), number(number) { }
61 int targetSun;
62 double length;
63 int number;
66 bool m_sunSelectionSimple;
67 bool m_massAsNodeRadius;
68 NodeArray<unsigned int> m_mass;
69 NodeArray<double> m_radius;
70 NodeArray<int> m_celestial; // 0 = unknown, 1 = sun, 2 = planet, 3 = moon
71 NodeArray<node> m_orbitalCenter;
72 NodeArray<double> m_distanceToOrbit;
73 NodeArray< std::vector<PathData> > m_pathDistances;
74 std::map< int, std::map<int, PathData> > m_interSystemPaths;
76 node sunOf(node object);
77 double distanceToSun(node object, MultilevelGraph &MLG);
78 void addPath(node sourceSun, node targetSun, double distance);
79 void findInterSystemPaths(Graph &G, MultilevelGraph &MLG);
80 int calcSystemMass(node v);
81 bool collapsSolarSystem(MultilevelGraph &MLG, node sun, int level);
82 bool buildOneLevel(MultilevelGraph &MLG);
83 std::vector<node> selectSuns(MultilevelGraph &MLG);
85 public:
86 SolarMerger(bool simple = false, bool massAsNodeRadius = false);
88 void buildAllLevels(MultilevelGraph &MLG);
91 } // namespace ogdf
93 #endif