summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/adaptagrams/libavoid/tests/treeRootCrash02.cpp
blob: 5f26b3e8d7155604b81289fb25a5e4db42cbab8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
// Based on constructInterleavedCrash bug report.
//
#include "libavoid/libavoid.h"
#include <sstream>

void test()
{
	Avoid::ConnEnd end1_0;
	Avoid::ConnEnd end2_0;
	Avoid::Polygon poly0;
	Avoid::Router * router0 = new Avoid::Router(Avoid::OrthogonalRouting);
	Avoid::HyperedgeNewAndDeletedObjectLists newanddeletedobjects_0;
	Avoid::ConnRefList::const_iterator connit_0;
	Avoid::JunctionRefList::const_iterator junctionit_0;
	router0->setTransactionUse(true);
	router0->setRoutingPenalty(Avoid::segmentPenalty);
	router0->setRoutingParameter(Avoid::portDirectionPenalty, 100);
	router0->setRoutingParameter(Avoid::idealNudgingDistance, 25);
	router0->setRoutingOption(Avoid::improveHyperedgeRoutesMovingAddingAndDeletingJunctions, true);
	router0->setRoutingPenalty(Avoid::fixedSharedPathPenalty, 9000);
	router0->setRoutingOption(Avoid::penaliseOrthogonalSharedPathsAtConnEnds, true);
	router0->setRoutingParameter(Avoid::crossingPenalty);
	router0->setRoutingOption(Avoid::performUnifyingNudgingPreprocessingStep, true);
	poly0 = Avoid::Polygon(4);
	poly0.setPoint(0, Avoid::Point(50410, 49975));
	poly0.setPoint(1, Avoid::Point(50410, 50710));
	poly0.setPoint(2, Avoid::Point(49975, 50710));
	poly0.setPoint(3, Avoid::Point(49975, 49975));
	Avoid::ShapeRef * shape0_1023802233 = new Avoid::ShapeRef(router0, poly0, 1023802233);
	Avoid::ShapeConnectionPin * pin0_1023802233_0 = new Avoid::ShapeConnectionPin(shape0_1023802233, 1, 0, 100, false, 10, 4);
	pin0_1023802233_0->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_1 = new Avoid::ShapeConnectionPin(shape0_1023802233, 2, 0, 250, false, 10, 4);
	pin0_1023802233_1->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_2 = new Avoid::ShapeConnectionPin(shape0_1023802233, 3, 0, 550, false, 10, 4);
	pin0_1023802233_2->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_3 = new Avoid::ShapeConnectionPin(shape0_1023802233, 4, 425, 100, false, 10, 8);
	pin0_1023802233_3->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_4 = new Avoid::ShapeConnectionPin(shape0_1023802233, 5, 250, 0, false, 10, 1);
	pin0_1023802233_4->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_5 = new Avoid::ShapeConnectionPin(shape0_1023802233, 6, 425, 250, false, 10, 8);
	pin0_1023802233_5->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_6 = new Avoid::ShapeConnectionPin(shape0_1023802233, 7, 250, 725, false, 10, 2);
	pin0_1023802233_6->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_7 = new Avoid::ShapeConnectionPin(shape0_1023802233, 8, 100, 725, false, 10, 2);
	pin0_1023802233_7->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_8 = new Avoid::ShapeConnectionPin(shape0_1023802233, 9, 100, 0, false, 10, 1);
	pin0_1023802233_8->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_9 = new Avoid::ShapeConnectionPin(shape0_1023802233, 10, 0, 400, false, 10, 4);
	pin0_1023802233_9->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_10 = new Avoid::ShapeConnectionPin(shape0_1023802233, 11, 0, 175, false, 10, 4);
	pin0_1023802233_10->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_11 = new Avoid::ShapeConnectionPin(shape0_1023802233, 12, 0, 325, false, 10, 4);
	pin0_1023802233_11->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_12 = new Avoid::ShapeConnectionPin(shape0_1023802233, 13, 0, 625, false, 10, 4);
	pin0_1023802233_12->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_13 = new Avoid::ShapeConnectionPin(shape0_1023802233, 14, 425, 175, false, 10, 8);
	pin0_1023802233_13->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_14 = new Avoid::ShapeConnectionPin(shape0_1023802233, 15, 325, 0, false, 10, 1);
	pin0_1023802233_14->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_15 = new Avoid::ShapeConnectionPin(shape0_1023802233, 16, 425, 325, false, 10, 8);
	pin0_1023802233_15->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_16 = new Avoid::ShapeConnectionPin(shape0_1023802233, 17, 325, 725, false, 10, 2);
	pin0_1023802233_16->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_17 = new Avoid::ShapeConnectionPin(shape0_1023802233, 18, 175, 725, false, 10, 2);
	pin0_1023802233_17->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_18 = new Avoid::ShapeConnectionPin(shape0_1023802233, 19, 175, 0, false, 10, 1);
	pin0_1023802233_18->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_1023802233_19 = new Avoid::ShapeConnectionPin(shape0_1023802233, 20, 0, 475, false, 10, 4);
	pin0_1023802233_19->setExclusive(true);
	poly0 = Avoid::Polygon(4);
	poly0.setPoint(0, Avoid::Point(49535, 50540));
	poly0.setPoint(1, Avoid::Point(49535, 50650));
	poly0.setPoint(2, Avoid::Point(49415, 50650));
	poly0.setPoint(3, Avoid::Point(49415, 50540));
	Avoid::ShapeRef * shape0_145706592 = new Avoid::ShapeRef(router0, poly0, 145706592);
	Avoid::ShapeConnectionPin * pin0_145706592_0 = new Avoid::ShapeConnectionPin(shape0_145706592, 1, 60, 10, false, 10, 1);
	pin0_145706592_0->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_145706592_1 = new Avoid::ShapeConnectionPin(shape0_145706592, 2, 60, -1, false, 10, 2);
	pin0_145706592_1->setExclusive(true);
	poly0 = Avoid::Polygon(4);
	poly0.setPoint(0, Avoid::Point(49504, 50775));
	poly0.setPoint(1, Avoid::Point(49504, 50860));
	poly0.setPoint(2, Avoid::Point(49446, 50860));
	poly0.setPoint(3, Avoid::Point(49446, 50775));
	Avoid::ShapeRef * shape0_368159034 = new Avoid::ShapeRef(router0, poly0, 368159034);
	Avoid::ShapeConnectionPin * pin0_368159034_0 = new Avoid::ShapeConnectionPin(shape0_368159034, 1, 29, 0, false, 10, 1);
	pin0_368159034_0->setExclusive(true);
	Avoid::JunctionRef * junction0_144230940 = new Avoid::JunctionRef(router0, Avoid::Point(49475, 50725), 144230940);
	junction0_144230940->setPositionFixed(true);
	Avoid::JunctionRef * junction0_526491597 = new Avoid::JunctionRef(router0, Avoid::Point(49600, 50525), 526491597);
	junction0_526491597->setPositionFixed(true);
	Avoid::JunctionRef * junction0_30828132 = new Avoid::JunctionRef(router0, Avoid::Point(49600, 50650), 30828132);
	junction0_30828132->setPositionFixed(true);
	poly0 = Avoid::Polygon(4);
	poly0.setPoint(0, Avoid::Point(50485, 49265));
	poly0.setPoint(1, Avoid::Point(50485, 49550));
	poly0.setPoint(2, Avoid::Point(50190, 49550));
	poly0.setPoint(3, Avoid::Point(50190, 49265));
	Avoid::ShapeRef * shape0_59732242 = new Avoid::ShapeRef(router0, poly0, 59732242);
	Avoid::ShapeConnectionPin * pin0_59732242_0 = new Avoid::ShapeConnectionPin(shape0_59732242, 1, 110, 10, false, 10, 1);
	pin0_59732242_0->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_59732242_1 = new Avoid::ShapeConnectionPin(shape0_59732242, 2, 10, 110, false, 10, 4);
	pin0_59732242_1->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_59732242_2 = new Avoid::ShapeConnectionPin(shape0_59732242, 3, 110, -1, false, 10, 2);
	pin0_59732242_2->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_59732242_3 = new Avoid::ShapeConnectionPin(shape0_59732242, 4, 285, 110, false, 10, 8);
	pin0_59732242_3->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_59732242_4 = new Avoid::ShapeConnectionPin(shape0_59732242, 5, 285, 185, false, 10, 8);
	pin0_59732242_4->setExclusive(true);
	poly0 = Avoid::Polygon(4);
	poly0.setPoint(0, Avoid::Point(50610, 49646));
	poly0.setPoint(1, Avoid::Point(50610, 49704));
	poly0.setPoint(2, Avoid::Point(50525, 49704));
	poly0.setPoint(3, Avoid::Point(50525, 49646));
	Avoid::ShapeRef * shape0_152071508 = new Avoid::ShapeRef(router0, poly0, 152071508);
	Avoid::ShapeConnectionPin * pin0_152071508_0 = new Avoid::ShapeConnectionPin(shape0_152071508, 1, 0, 29, false, 10, 4);
	pin0_152071508_0->setExclusive(true);
	Avoid::JunctionRef * junction0_24560921 = new Avoid::JunctionRef(router0, Avoid::Point(50300, 49675), 24560921);
	junction0_24560921->setPositionFixed(true);
	end1_0 = Avoid::ConnEnd(shape0_145706592, 2);
	end2_0 = Avoid::ConnEnd(junction0_144230940);
	Avoid::ConnRef * conn0_61425638 = new Avoid::ConnRef(router0, end1_0, end2_0, 61425638);
	end1_0 = Avoid::ConnEnd(junction0_144230940);
	end2_0 = Avoid::ConnEnd(shape0_368159034, 1);
	Avoid::ConnRef * conn0_378385232 = new Avoid::ConnRef(router0, end1_0, end2_0, 378385232);
	end1_0 = Avoid::ConnEnd(Avoid::Point(49975, 50450), 15);
	end2_0 = Avoid::ConnEnd(Avoid::Point(49600, 50525), 15);
	Avoid::ConnRef * conn0_117136925 = new Avoid::ConnRef(router0, end1_0, end2_0, 117136925);
	poly0 = Avoid::PolyLine(3);
	poly0.setPoint(0, Avoid::Point(49975, 50450));
	poly0.setPoint(1, Avoid::Point(49600, 50450));
	poly0.setPoint(2, Avoid::Point(49600, 50525));
	conn0_117136925->setFixedRoute(poly0);
	conn0_117136925->setSourceEndpoint(end1_0);
	conn0_117136925->setDestEndpoint(end2_0);
	end1_0 = Avoid::ConnEnd(shape0_1023802233, 3);
	end2_0 = Avoid::ConnEnd(junction0_526491597);
	Avoid::ConnRef * conn0_224626788 = new Avoid::ConnRef(router0, end1_0, end2_0, 224626788);
	end1_0 = Avoid::ConnEnd(Avoid::Point(49600, 50525), 15);
	end2_0 = Avoid::ConnEnd(Avoid::Point(49600, 50650), 15);
	Avoid::ConnRef * conn0_446423927 = new Avoid::ConnRef(router0, end1_0, end2_0, 446423927);
	poly0 = Avoid::PolyLine(3);
	poly0.setPoint(0, Avoid::Point(49600, 50525));
	poly0.setPoint(1, Avoid::Point(49600, 50587));
	poly0.setPoint(2, Avoid::Point(49600, 50650));
	conn0_446423927->setFixedRoute(poly0);
	conn0_446423927->setSourceEndpoint(end1_0);
	conn0_446423927->setDestEndpoint(end2_0);
	end1_0 = Avoid::ConnEnd(Avoid::Point(49600, 50650), 15);
	end2_0 = Avoid::ConnEnd(Avoid::Point(49475, 50725), 15);
	Avoid::ConnRef * conn0_880789055 = new Avoid::ConnRef(router0, end1_0, end2_0, 880789055);
	poly0 = Avoid::PolyLine(3);
	poly0.setPoint(0, Avoid::Point(49600, 50650));
	poly0.setPoint(1, Avoid::Point(49600, 50725));
	poly0.setPoint(2, Avoid::Point(49475, 50725));
	conn0_880789055->setFixedRoute(poly0);
	conn0_880789055->setSourceEndpoint(end1_0);
	conn0_880789055->setDestEndpoint(end2_0);
	end1_0 = Avoid::ConnEnd(Avoid::Point(49975, 50600), 15);
	end2_0 = Avoid::ConnEnd(Avoid::Point(49600, 50650), 15);
	Avoid::ConnRef * conn0_11189244 = new Avoid::ConnRef(router0, end1_0, end2_0, 11189244);
	poly0 = Avoid::PolyLine(3);
	poly0.setPoint(0, Avoid::Point(49975, 50600));
	poly0.setPoint(1, Avoid::Point(49600, 50600));
	poly0.setPoint(2, Avoid::Point(49600, 50650));
	conn0_11189244->setFixedRoute(poly0);
	conn0_11189244->setSourceEndpoint(end1_0);
	conn0_11189244->setDestEndpoint(end2_0);
	end1_0 = Avoid::ConnEnd(shape0_59732242, 3);
	end2_0 = Avoid::ConnEnd(junction0_24560921);
	Avoid::ConnRef * conn0_605306624 = new Avoid::ConnRef(router0, end1_0, end2_0, 605306624);
	end1_0 = Avoid::ConnEnd(junction0_24560921);
	end2_0 = Avoid::ConnEnd(shape0_1023802233, 15);
	Avoid::ConnRef * conn0_61198110 = new Avoid::ConnRef(router0, end1_0, end2_0, 61198110);
	end1_0 = Avoid::ConnEnd(shape0_1023802233, 19);
	end2_0 = Avoid::ConnEnd(junction0_24560921);
	Avoid::ConnRef * conn0_323306544 = new Avoid::ConnRef(router0, end1_0, end2_0, 323306544);
	end1_0 = Avoid::ConnEnd(shape0_152071508, 1);
	end2_0 = Avoid::ConnEnd(junction0_24560921);
	Avoid::ConnRef * conn0_2415000 = new Avoid::ConnRef(router0, end1_0, end2_0, 2415000);
	router0->processTransaction();

	newanddeletedobjects_0 = router0->newAndDeletedObjectListsFromHyperedgeImprovement();
	router0->outputDiagram("output/treeRootCrash02-1");
	end2_0 = Avoid::ConnEnd(junction0_144230940);
	conn0_61425638->setDestEndpoint(end2_0);
	conn0_61425638->makePathInvalid();
	conn0_378385232->makePathInvalid();
	end1_0 = Avoid::ConnEnd(shape0_1023802233, 20);
	end2_0 = Avoid::ConnEnd(junction0_526491597);
	conn0_117136925->setSourceEndpoint(end1_0);
	conn0_117136925->setDestEndpoint(end2_0);
	conn0_117136925->clearFixedRoute();
	conn0_224626788->makePathInvalid();
	end2_0 = Avoid::ConnEnd(junction0_30828132);
	conn0_446423927->setDestEndpoint(end2_0);
	conn0_446423927->clearFixedRoute();
	conn0_880789055->clearFixedRoute();
	end1_0 = Avoid::ConnEnd(shape0_1023802233, 13);
	conn0_11189244->setSourceEndpoint(end1_0);
	conn0_11189244->clearFixedRoute();
	conn0_605306624->makePathInvalid();
	conn0_61198110->makePathInvalid();
	conn0_323306544->makePathInvalid();
	conn0_2415000->makePathInvalid();
	junction0_144230940->setPositionFixed(false);
	junction0_30828132->setPositionFixed(false);
	junction0_526491597->setPositionFixed(false);
	end2_0 = Avoid::ConnEnd(junction0_144230940);
	conn0_61425638->setDestEndpoint(end2_0);
	conn0_61425638->makePathInvalid();
	conn0_378385232->makePathInvalid();
	end2_0 = Avoid::ConnEnd(junction0_526491597);
	conn0_117136925->setDestEndpoint(end2_0);
	conn0_117136925->makePathInvalid();
	conn0_224626788->makePathInvalid();
	end2_0 = Avoid::ConnEnd(junction0_30828132);
	conn0_446423927->setDestEndpoint(end2_0);
	conn0_446423927->makePathInvalid();
	conn0_880789055->makePathInvalid();
	conn0_11189244->makePathInvalid();
	junction0_24560921->setPositionFixed(false);
	end2_0 = Avoid::ConnEnd(junction0_24560921);
	conn0_605306624->setDestEndpoint(end2_0);
	conn0_605306624->makePathInvalid();
	conn0_61198110->makePathInvalid();
	conn0_323306544->makePathInvalid();
	conn0_2415000->makePathInvalid();
	router0->hyperedgeRerouter()->registerHyperedgeForRerouting(junction0_24560921);
	router0->hyperedgeRerouter()->registerHyperedgeForRerouting(junction0_526491597);
	router0->processTransaction();

	newanddeletedobjects_0 = router0->newAndDeletedObjectListsFromHyperedgeImprovement();
	router0->outputDiagram("output/treeRootCrash02-2");

	delete router0;
}

extern "C" int main(int argc, char* argv[])
{
	test();
	return 0;
}