summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/adaptagrams/libavoid/tests/inlineOverlap11.cpp
blob: 46cdd87bacefb612bc79a5e92ea8a56b7b26726d (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
// From endpointOverlap.cpp
#include "libavoid/libavoid.h"
#include <sstream>

extern "C" int main(void)
{
	// The contents of this function can be replaced by the automatically generated test code from the debug svg file
	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, 50115));
	poly0.setPoint(1, Avoid::Point(50410, 51860));
	poly0.setPoint(2, Avoid::Point(50050, 51860));
	poly0.setPoint(3, Avoid::Point(50050, 50115));
	Avoid::ShapeRef * shape0_288069558 = new Avoid::ShapeRef(router0, poly0, 288069558);
	Avoid::ShapeConnectionPin * pin0_288069558_0 = new Avoid::ShapeConnectionPin(shape0_288069558, 1, 0, 85, false, 10, 4);
	pin0_288069558_0->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_1 = new Avoid::ShapeConnectionPin(shape0_288069558, 2, 0, 160, false, 10, 4);
	pin0_288069558_1->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_2 = new Avoid::ShapeConnectionPin(shape0_288069558, 3, 0, 235, false, 10, 4);
	pin0_288069558_2->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_3 = new Avoid::ShapeConnectionPin(shape0_288069558, 4, 0, 310, false, 10, 4);
	pin0_288069558_3->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_4 = new Avoid::ShapeConnectionPin(shape0_288069558, 5, 0, 385, false, 10, 4);
	pin0_288069558_4->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_5 = new Avoid::ShapeConnectionPin(shape0_288069558, 6, 0, 460, false, 10, 4);
	pin0_288069558_5->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_6 = new Avoid::ShapeConnectionPin(shape0_288069558, 7, 0, 535, false, 10, 4);
	pin0_288069558_6->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_7 = new Avoid::ShapeConnectionPin(shape0_288069558, 8, 0, 610, false, 10, 4);
	pin0_288069558_7->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_8 = new Avoid::ShapeConnectionPin(shape0_288069558, 9, 0, 685, false, 10, 4);
	pin0_288069558_8->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_9 = new Avoid::ShapeConnectionPin(shape0_288069558, 10, 0, 760, false, 10, 4);
	pin0_288069558_9->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_10 = new Avoid::ShapeConnectionPin(shape0_288069558, 11, 0, 835, false, 10, 4);
	pin0_288069558_10->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_11 = new Avoid::ShapeConnectionPin(shape0_288069558, 12, 0, 910, false, 10, 4);
	pin0_288069558_11->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_12 = new Avoid::ShapeConnectionPin(shape0_288069558, 13, 0, 985, false, 10, 4);
	pin0_288069558_12->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_13 = new Avoid::ShapeConnectionPin(shape0_288069558, 14, 0, 1060, false, 10, 4);
	pin0_288069558_13->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_14 = new Avoid::ShapeConnectionPin(shape0_288069558, 15, 0, 1135, false, 10, 4);
	pin0_288069558_14->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_15 = new Avoid::ShapeConnectionPin(shape0_288069558, 16, 0, 1210, false, 10, 4);
	pin0_288069558_15->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_16 = new Avoid::ShapeConnectionPin(shape0_288069558, 17, 0, 1285, false, 10, 4);
	pin0_288069558_16->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_17 = new Avoid::ShapeConnectionPin(shape0_288069558, 18, 0, 1360, false, 10, 4);
	pin0_288069558_17->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_18 = new Avoid::ShapeConnectionPin(shape0_288069558, 19, 0, 1435, false, 10, 4);
	pin0_288069558_18->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_19 = new Avoid::ShapeConnectionPin(shape0_288069558, 20, 0, 1510, false, 10, 4);
	pin0_288069558_19->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_20 = new Avoid::ShapeConnectionPin(shape0_288069558, 21, 0, 1585, false, 10, 4);
	pin0_288069558_20->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_21 = new Avoid::ShapeConnectionPin(shape0_288069558, 22, 0, 1660, false, 10, 4);
	pin0_288069558_21->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_22 = new Avoid::ShapeConnectionPin(shape0_288069558, 23, 350, 85, false, 10, 8);
	pin0_288069558_22->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_23 = new Avoid::ShapeConnectionPin(shape0_288069558, 24, 350, 160, false, 10, 8);
	pin0_288069558_23->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_24 = new Avoid::ShapeConnectionPin(shape0_288069558, 25, 350, 235, false, 10, 8);
	pin0_288069558_24->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_25 = new Avoid::ShapeConnectionPin(shape0_288069558, 26, 350, 310, false, 10, 8);
	pin0_288069558_25->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_26 = new Avoid::ShapeConnectionPin(shape0_288069558, 27, 350, 385, false, 10, 8);
	pin0_288069558_26->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_27 = new Avoid::ShapeConnectionPin(shape0_288069558, 28, 350, 460, false, 10, 8);
	pin0_288069558_27->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_28 = new Avoid::ShapeConnectionPin(shape0_288069558, 29, 350, 535, false, 10, 8);
	pin0_288069558_28->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_29 = new Avoid::ShapeConnectionPin(shape0_288069558, 30, 350, 610, false, 10, 8);
	pin0_288069558_29->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_30 = new Avoid::ShapeConnectionPin(shape0_288069558, 31, 350, 685, false, 10, 8);
	pin0_288069558_30->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_31 = new Avoid::ShapeConnectionPin(shape0_288069558, 32, 350, 760, false, 10, 8);
	pin0_288069558_31->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_32 = new Avoid::ShapeConnectionPin(shape0_288069558, 33, 350, 835, false, 10, 8);
	pin0_288069558_32->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_33 = new Avoid::ShapeConnectionPin(shape0_288069558, 34, 350, 910, false, 10, 8);
	pin0_288069558_33->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_34 = new Avoid::ShapeConnectionPin(shape0_288069558, 35, 350, 985, false, 10, 8);
	pin0_288069558_34->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_35 = new Avoid::ShapeConnectionPin(shape0_288069558, 36, 350, 1060, false, 10, 8);
	pin0_288069558_35->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_36 = new Avoid::ShapeConnectionPin(shape0_288069558, 37, 350, 1135, false, 10, 8);
	pin0_288069558_36->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_37 = new Avoid::ShapeConnectionPin(shape0_288069558, 38, 350, 1210, false, 10, 8);
	pin0_288069558_37->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_38 = new Avoid::ShapeConnectionPin(shape0_288069558, 39, 350, 1285, false, 10, 8);
	pin0_288069558_38->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_39 = new Avoid::ShapeConnectionPin(shape0_288069558, 40, 350, 1360, false, 10, 8);
	pin0_288069558_39->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_40 = new Avoid::ShapeConnectionPin(shape0_288069558, 41, 350, 1435, false, 10, 8);
	pin0_288069558_40->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_41 = new Avoid::ShapeConnectionPin(shape0_288069558, 42, 350, 1510, false, 10, 8);
	pin0_288069558_41->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_288069558_42 = new Avoid::ShapeConnectionPin(shape0_288069558, 43, 350, 1585, false, 10, 8);
	pin0_288069558_42->setExclusive(true);
	poly0 = Avoid::Polygon(4);
	poly0.setPoint(0, Avoid::Point(49500, 50920));
	poly0.setPoint(1, Avoid::Point(49500, 50980));
	poly0.setPoint(2, Avoid::Point(49340, 50980));
	poly0.setPoint(3, Avoid::Point(49340, 50920));
	Avoid::ShapeRef * shape0_59726400 = new Avoid::ShapeRef(router0, poly0, 59726400);
	Avoid::ShapeConnectionPin * pin0_59726400_0 = new Avoid::ShapeConnectionPin(shape0_59726400, 1, 10, 30, false, 10, 4);
	pin0_59726400_0->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_59726400_1 = new Avoid::ShapeConnectionPin(shape0_59726400, 2, -1, 30, false, 10, 8);
	pin0_59726400_1->setExclusive(true);
	poly0 = Avoid::Polygon(4);
	poly0.setPoint(0, Avoid::Point(49500, 50845));
	poly0.setPoint(1, Avoid::Point(49500, 50905));
	poly0.setPoint(2, Avoid::Point(49340, 50905));
	poly0.setPoint(3, Avoid::Point(49340, 50845));
	Avoid::ShapeRef * shape0_574489840 = new Avoid::ShapeRef(router0, poly0, 574489840);
	Avoid::ShapeConnectionPin * pin0_574489840_0 = new Avoid::ShapeConnectionPin(shape0_574489840, 1, 10, 30, false, 10, 4);
	pin0_574489840_0->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_574489840_1 = new Avoid::ShapeConnectionPin(shape0_574489840, 2, -1, 30, false, 10, 8);
	pin0_574489840_1->setExclusive(true);
	poly0 = Avoid::Polygon(4);
	poly0.setPoint(0, Avoid::Point(49500, 50695));
	poly0.setPoint(1, Avoid::Point(49500, 50755));
	poly0.setPoint(2, Avoid::Point(49340, 50755));
	poly0.setPoint(3, Avoid::Point(49340, 50695));
	Avoid::ShapeRef * shape0_482418284 = new Avoid::ShapeRef(router0, poly0, 482418284);
	Avoid::ShapeConnectionPin * pin0_482418284_0 = new Avoid::ShapeConnectionPin(shape0_482418284, 1, 10, 30, false, 10, 4);
	pin0_482418284_0->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_482418284_1 = new Avoid::ShapeConnectionPin(shape0_482418284, 2, -1, 30, false, 10, 8);
	pin0_482418284_1->setExclusive(true);
	poly0 = Avoid::Polygon(4);
	poly0.setPoint(0, Avoid::Point(49500, 50770));
	poly0.setPoint(1, Avoid::Point(49500, 50830));
	poly0.setPoint(2, Avoid::Point(49340, 50830));
	poly0.setPoint(3, Avoid::Point(49340, 50770));
	Avoid::ShapeRef * shape0_100128936 = new Avoid::ShapeRef(router0, poly0, 100128936);
	Avoid::ShapeConnectionPin * pin0_100128936_0 = new Avoid::ShapeConnectionPin(shape0_100128936, 1, 10, 30, false, 10, 4);
	pin0_100128936_0->setExclusive(true);
	Avoid::ShapeConnectionPin * pin0_100128936_1 = new Avoid::ShapeConnectionPin(shape0_100128936, 2, -1, 30, false, 10, 8);
	pin0_100128936_1->setExclusive(true);
	end1_0 = Avoid::ConnEnd(shape0_100128936, 2);
	end2_0 = Avoid::ConnEnd(shape0_288069558, 12);
	new Avoid::ConnRef(router0, end1_0, end2_0, 105958336);
	end1_0 = Avoid::ConnEnd(shape0_574489840, 2);
	end2_0 = Avoid::ConnEnd(shape0_288069558, 13);
	new Avoid::ConnRef(router0, end1_0, end2_0, 377294085);
	end1_0 = Avoid::ConnEnd(shape0_59726400, 2);
	end2_0 = Avoid::ConnEnd(shape0_288069558, 14);
	new Avoid::ConnRef(router0, end1_0, end2_0, 870686312);
	router0->processTransaction();

	poly0 = Avoid::Polygon(4);
	poly0.setPoint(0, Avoid::Point(49518, 50707));
	poly0.setPoint(1, Avoid::Point(49518, 50743));
	poly0.setPoint(2, Avoid::Point(49482, 50743));
	poly0.setPoint(3, Avoid::Point(49482, 50707));
	Avoid::ShapeRef * shape0_91346832 = new Avoid::ShapeRef(router0, poly0, 91346832);
	Avoid::ShapeConnectionPin * pin0_91346832_0 = new Avoid::ShapeConnectionPin(shape0_91346832, 2147483646, 18, 18, false, 0, 15);
	pin0_91346832_0->setExclusive(false);
	end1_0 = Avoid::ConnEnd(shape0_91346832, Avoid::CONNECTIONPIN_CENTRE);
	end2_0 = Avoid::ConnEnd(shape0_288069558, 11);
	new Avoid::ConnRef(router0, end1_0, end2_0, 214417907);
	router0->processTransaction();

	router0->outputDiagram("output/inlineOverlap11");

	bool optimisedForConnectorType = false;
	int crossings = router0->existsCrossings(optimisedForConnectorType);
	delete router0;
	return (crossings > 0) ? 1 : 0;
}