1 /** \file
2  * \brief Declaration of Fast Multipole Multilevel Method (FM^3) options.
3  *
4  * \author Stefan Hachul, Stephan Beyer
5  *
6  * \par License:
7  * This file is part of the Open Graph Drawing Framework (OGDF).
8  *
9  * \par
10  * Copyright (C)<br>
11  * See README.md in the OGDF root directory for details.
12  *
13  * \par
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * Version 2 or 3 as published by the Free Software Foundation;
17  * see the file LICENSE.txt included in the packaging of this file
18  * for details.
19  *
20  * \par
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * \par
27  * You should have received a copy of the GNU General Public
28  * License along with this program; if not, see
29  * http://www.gnu.org/copyleft/gpl.html
30  */
31 
32 #pragma once
33 
34 namespace ogdf {
35 
36 class FMMMOptions {
37 public:
38 	//! Possible page formats.
39 	enum class PageFormatType {
40 		Portrait,  //!< A4 portrait page.
41 		Landscape, //!< A4 landscape page.
42 		Square     //!< Square format.
43 	};
44 
45 	//! Trade-off between run-time and quality.
46 	enum class QualityVsSpeed {
47 		GorgeousAndEfficient,  //!< Best quality.
48 		BeautifulAndFast,      //!< Medium quality and speed.
49 		NiceAndIncredibleSpeed //!< Best speed.
50 	};
51 
52 	//! Specifies how the length of an edge is measured.
53 	enum class EdgeLengthMeasurement {
54 		Midpoint,      //!< Measure from center point of edge end points.
55 		BoundingCircle //!< Measure from border of circle s surrounding edge end points.
56 	};
57 
58 	//! Specifies which positions for a node are allowed.
59 	enum class AllowedPositions {
60 		//! Every position is allowed
61 		All,
62 
63 		//! Only integer positions are allowed that are in a range
64 		//! depending on the number of nodes and the average ideal edge length.
65 		Integer,
66 
67 		//! Only integer positions in a range of -2^MaxIntPosExponent to
68 		//! 2^MaxIntPosExponent are alllowed
69 		Exponent
70 	};
71 
72 	//! Specifies in which case it is allowed to tip over drawings of connected components.
73 	enum class TipOver {
74 		None,         //!< not allowed at all
75 		NoGrowingRow, //!< only if the height of the packing row does not grow
76 		Always        //!< always allowed
77 	};
78 
79 	//! Specifies how connected components are sorted before the packing algorithm is applied.
80 	enum class PreSort {
81 		None,             //!< Do not presort.
82 		DecreasingHeight, //!< Presort by decreasing height of components.
83 		DecreasingWidth   //!< Presort by decreasing width of components.
84 	};
85 
86 	//! Specifies how sun nodes of galaxies are selected.
87 	enum class GalaxyChoice {
88 		UniformProb,             //!< selecting by uniform random probability
89 		NonUniformProbLowerMass, //!< selecting by non-uniform probability depending on the star masses (prefering nodes with lower star mass)
90 		NonUniformProbHigherMass //!< as above but prefering nodes with higher star mass
91 	};
92 
93 	//! Specifies how MaxIterations is changed in subsequent multilevels.
94 	enum class MaxIterChange {
95 		Constant,           //!< kept constant at the force calculation step at every level
96 		LinearlyDecreasing, //!< linearly decreasing from MaxIterFactor*FixedIterations to FixedIterations
97 		RapidlyDecreasing   //!< rapdily decreasing from MaxIterFactor*FixedIterations to FixedIterations
98 	};
99 
100 	//! Specifies how the initial placement is generated.
101 	enum class InitialPlacementMult {
102 		Simple,  //!< only using information about placement of nodes on higher levels
103 		Advanced //!< using additional information about the placement of all inter solar system nodes
104 	};
105 
106 	//! Specifies the force model.
107 	enum class ForceModel {
108 		FruchtermanReingold, //!< The force-model by Fruchterman, Reingold.
109 		Eades,               //!< The force-model by Eades.
110 		New                  //!< The new force-model.
111 	};
112 
113 	//! Specifies how to calculate repulsive forces.
114 	enum class RepulsiveForcesMethod {
115 		Exact,             //!< Exact calculation (slow).
116 		GridApproximation, //!< Grid approximation (inaccurate).
117 		NMM                //!< Calculation as for new multipole method (fast and accurate).
118 	};
119 
120 	//! Specifies the stop criterion.
121 	enum class StopCriterion {
122 		FixedIterations,           //!< Stop if fixedIterations() is reached.
123 		Threshold,                 //!< Stop if threshold() is reached.
124 		FixedIterationsOrThreshold //!< Stop if fixedIterations() or threshold() is reached.
125 	};
126 
127 	//! Specifies how the initial placement is done.
128 	enum class InitialPlacementForces {
129 		UniformGrid,      //!< Uniform placement on a grid.
130 		RandomTime,       //!< Random placement (based on current time).
131 		RandomRandIterNr, //!< Random placement (based on randIterNr()).
132 		KeepPositions     //!< No change in placement.
133 	};
134 
135 	//! Specifies how the reduced bucket quadtree is constructed.
136 	enum class ReducedTreeConstruction {
137 		PathByPath,      //!< Path-by-path construction.
138 		SubtreeBySubtree //!< Subtree-by-subtree construction.
139 	};
140 
141 	//! Specifies how to calculate the smallest quadratic cell that surrounds
142 	//! the particles of a node in the reduced bucket quadtree.
143 	enum class SmallestCellFinding {
144 		Iteratively, //!< Iteratively (in constant time).
145 		Aluru        //!< According to formula by Aluru et al. (in constant time).
146 	};
147 };
148 
149 }
150