1/** \file
2 * \brief Tests for several planar layouts
3 *
4 * \author Tilo Wiedera
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#include <ogdf/basic/PreprocessorLayout.h>
33#include <ogdf/energybased/FMMMLayout.h>
34#include <ogdf/misclayout/BalloonLayout.h>
35#include <ogdf/misclayout/BertaultLayout.h>
36#include <ogdf/misclayout/CircularLayout.h>
37#include <ogdf/misclayout/LinearLayout.h>
38#include <ogdf/misclayout/ProcrustesSubLayout.h>
39#include <ogdf/packing/ComponentSplitterLayout.h>
40#include <ogdf/packing/SimpleCCPacker.h>
41#include <ogdf/planarlayout/MixedModelLayout.h>
42#include <ogdf/tree/RadialTreeLayout.h>
43#include <ogdf/tree/TreeLayout.h>
44#include <ogdf/upward/DominanceLayout.h>
45#include <ogdf/upward/VisibilityLayout.h>
46
47#include "layout_helpers.h"
48
49go_bandit([] { describe("Miscellaneous layouts", [] {
50 GraphSizes smallSizes = GraphSizes(16, 32, 16);
51
52 PreprocessorLayout preProc;
53 // CircularLayout requires simple graphs
54 preProc.setLayoutModule(new CircularLayout);
55 describeLayout("PreprocessorLayout with CircularLayout", preProc, 0);
56
57 TEST_LAYOUT(BalloonLayout, GraphProperty::connected);
58
59 describeLayout<BertaultLayout>("BertaultLayout", 0, {GraphProperty::sparse, GraphProperty::simple}, false, smallSizes);
60 TEST_LAYOUT(CircularLayout, GraphProperty::simple);
61 TEST_LAYOUT(LinearLayout);
62
63 ProcrustesSubLayout procrustesLayout(new FMMMLayout);
64 describeLayout("ProcrustesSubLayout", procrustesLayout);
65
66 TEST_LAYOUT(ComponentSplitterLayout);
67
68 // BalloonLayout requires connectivity
69 SimpleCCPacker packerLayout(new BalloonLayout);
70 describeLayout("SimpleCCPacker with BalloonLayout", packerLayout);
71
72 TEST_LAYOUT(RadialTreeLayout, GraphProperty::arborescenceForest, GraphProperty::connected);
73 TEST_LAYOUT(TreeLayout, GraphProperty::arborescenceForest);
74
75 // skip iteration with maximum number of nodes as it takes too long
76 describeLayout<DominanceLayout>("DominanceLayout", 0, {GraphProperty::connected, GraphProperty::simple, GraphProperty::sparse}, false, smallSizes);
77 describeLayout<VisibilityLayout>("VisibilityLayout", 0, {GraphProperty::connected, GraphProperty::simple, GraphProperty::sparse}, false, smallSizes);
78}); });
79