1 #include "libavoid/libavoid.h"
2 #include <sstream>
3 using namespace Avoid;
4 
outputDiagram(Avoid::Router * router)5 void outputDiagram(Avoid::Router * router)
6 {
7 	static int counter = 0;
8 	std::ostringstream os;
9 	os << (++counter);
10 	router->outputDiagram(os.str());
11 }
12 
test()13 void test()
14 {
15 	// The contents of this function can be replaced by the automatically generated test code from the debug svg file
16 	Avoid::ConnEnd end1_0;
17 	Avoid::ConnEnd end2_0;
18 	Avoid::Polygon poly0;
19 	std::vector<Avoid::Checkpoint> checkpoints_0;
20 	Avoid::Router * router0 = new Avoid::Router(Avoid::OrthogonalRouting);
21 	Avoid::HyperedgeNewAndDeletedObjectLists newanddeletedobjects_0;
22 	Avoid::ConnRefList::const_iterator connit_0;
23 	Avoid::JunctionRefList::const_iterator junctionit_0;
24 	router0->setTransactionUse(true);
25 	router0->setRoutingPenalty(Avoid::segmentPenalty);
26 	router0->setRoutingPenalty(Avoid::crossingPenalty);
27 	router0->setRoutingPenalty(Avoid::fixedSharedPathPenalty, 9000);
28 	router0->setRoutingOption(Avoid::penaliseOrthogonalSharedPathsAtConnEnds, true);
29 	router0->setRoutingParameter(Avoid::idealNudgingDistance, 25);
30 	router0->setRoutingOption(Avoid::improveHyperedgeRoutesMovingAddingAndDeletingJunctions, true);
31 
32 	poly0 = Avoid::Polygon(4);
33 	poly0.setPoint(0, Avoid::Point(50700, 50615));
34 	poly0.setPoint(1, Avoid::Point(50700, 51185));
35 	poly0.setPoint(2, Avoid::Point(50365, 51185));
36 	poly0.setPoint(3, Avoid::Point(50365, 50615));
37 	Avoid::ShapeRef * shape0_355243155 = new Avoid::ShapeRef(router0, poly0, 355243155);
38 	Avoid::ShapeConnectionPin * pin0_355243155_0 = new Avoid::ShapeConnectionPin(shape0_355243155, 1, 1, 0.149122807018, true, 10, 8);
39 	pin0_355243155_0->setExclusive(true);
40 	Avoid::ShapeConnectionPin * pin0_355243155_1 = new Avoid::ShapeConnectionPin(shape0_355243155, 2, 1, 0.675438596491, true, 10, 8);
41 	pin0_355243155_1->setExclusive(true);
42 	Avoid::ShapeConnectionPin * pin0_355243155_2 = new Avoid::ShapeConnectionPin(shape0_355243155, 3, 1, 0.80701754386, true, 10, 8);
43 	pin0_355243155_2->setExclusive(true);
44 	Avoid::ShapeConnectionPin * pin0_355243155_3 = new Avoid::ShapeConnectionPin(shape0_355243155, 4, 1, 0.543859649123, true, 10, 8);
45 	pin0_355243155_3->setExclusive(true);
46 	Avoid::ShapeConnectionPin * pin0_355243155_4 = new Avoid::ShapeConnectionPin(shape0_355243155, 5, 1, 0.280701754386, true, 10, 8);
47 	pin0_355243155_4->setExclusive(true);
48 	Avoid::ShapeConnectionPin * pin0_355243155_5 = new Avoid::ShapeConnectionPin(shape0_355243155, 6, 1, 0.412280701754, true, 10, 8);
49 	pin0_355243155_5->setExclusive(true);
50 	Avoid::ShapeConnectionPin * pin0_355243155_6 = new Avoid::ShapeConnectionPin(shape0_355243155, 7, 0.477611940299, 0.982456140351, true, 10, 2);
51 	pin0_355243155_6->setExclusive(true);
52 	Avoid::ShapeConnectionPin * pin0_355243155_7 = new Avoid::ShapeConnectionPin(shape0_355243155, 8, 0.253731343284, 0.982456140351, true, 10, 2);
53 	pin0_355243155_7->setExclusive(true);
54 	poly0 = Avoid::Polygon(4);
55 	poly0.setPoint(0, Avoid::Point(51060, 50816));
56 	poly0.setPoint(1, Avoid::Point(51060, 50884));
57 	poly0.setPoint(2, Avoid::Point(50940, 50884));
58 	poly0.setPoint(3, Avoid::Point(50940, 50816));
59 	Avoid::ShapeRef * shape0_35177560 = new Avoid::ShapeRef(router0, poly0, 35177560);
60 	Avoid::ShapeConnectionPin * pin0_35177560_0 = new Avoid::ShapeConnectionPin(shape0_35177560, 1, 0.5, 0.5, true, 0, 15);
61 	pin0_35177560_0->setExclusive(true);
62 	poly0 = Avoid::Polygon(4);
63 	poly0.setPoint(0, Avoid::Point(51060, 50966));
64 	poly0.setPoint(1, Avoid::Point(51060, 51034));
65 	poly0.setPoint(2, Avoid::Point(50940, 51034));
66 	poly0.setPoint(3, Avoid::Point(50940, 50966));
67 	Avoid::ShapeRef * shape0_214253640 = new Avoid::ShapeRef(router0, poly0, 214253640);
68 	Avoid::ShapeConnectionPin * pin0_214253640_0 = new Avoid::ShapeConnectionPin(shape0_214253640, 1, 0.5, 0.5, true, 0, 15);
69 	pin0_214253640_0->setExclusive(true);
70 	Avoid::JunctionRef * junction0_636368600 = new Avoid::JunctionRef(router0, Avoid::Point(50875, 50850), 636368600);
71 	Avoid::JunctionRef * junction0_503331836 = new Avoid::JunctionRef(router0, Avoid::Point(50875, 51000), 503331836);
72 	Avoid::JunctionRef * junction0_46074711 = new Avoid::JunctionRef(router0, Avoid::Point(50775, 51000), 46074711);
73 	Avoid::JunctionRef * junction0_390996481 = new Avoid::JunctionRef(router0, Avoid::Point(50775, 50850), 390996481);
74 	end1_0 = Avoid::ConnEnd(junction0_636368600);
75 	end2_0 = Avoid::ConnEnd(shape0_35177560, 1);
76 	Avoid::ConnRef * conn0_929108568 = new Avoid::ConnRef(router0, end1_0, end2_0, 929108568);
77 	end1_0 = Avoid::ConnEnd(junction0_503331836);
78 	end2_0 = Avoid::ConnEnd(shape0_214253640, 1);
79 	Avoid::ConnRef * conn0_627671070 = new Avoid::ConnRef(router0, end1_0, end2_0, 627671070);
80 	end1_0 = Avoid::ConnEnd(junction0_636368600);
81 	end2_0 = Avoid::ConnEnd(junction0_503331836);
82 	Avoid::ConnRef * conn0_510680660 = new Avoid::ConnRef(router0, end1_0, end2_0, 510680660);
83 	end1_0 = Avoid::ConnEnd(shape0_355243155, 2);
84 	end2_0 = Avoid::ConnEnd(junction0_46074711);
85 	Avoid::ConnRef * conn0_175131537 = new Avoid::ConnRef(router0, end1_0, end2_0, 175131537);
86 	end1_0 = Avoid::ConnEnd(junction0_46074711);
87 	end2_0 = Avoid::ConnEnd(junction0_503331836);
88 	Avoid::ConnRef * conn0_545568780 = new Avoid::ConnRef(router0, end1_0, end2_0, 545568780);
89 	end1_0 = Avoid::ConnEnd(shape0_355243155, 6);
90 	end2_0 = Avoid::ConnEnd(junction0_390996481);
91 	Avoid::ConnRef * conn0_17788857 = new Avoid::ConnRef(router0, end1_0, end2_0, 17788857);
92 	end1_0 = Avoid::ConnEnd(junction0_390996481);
93 	end2_0 = Avoid::ConnEnd(junction0_636368600);
94 	Avoid::ConnRef * conn0_160581511 = new Avoid::ConnRef(router0, end1_0, end2_0, 160581511);
95 	end1_0 = Avoid::ConnEnd(junction0_46074711);
96 	end2_0 = Avoid::ConnEnd(junction0_390996481);
97 	Avoid::ConnRef * conn0_92116728 = new Avoid::ConnRef(router0, end1_0, end2_0, 92116728);
98 	router0->processTransaction();
99 
100 	newanddeletedobjects_0 = router0->newAndDeletedObjectListsFromHyperedgeImprovement();
101 	outputDiagram(router0);
102 	router0->deleteConnector(conn0_92116728);
103 	conn0_92116728 = nullptr;
104 	router0->deleteConnector(conn0_160581511);
105 	conn0_160581511 = nullptr;
106 	router0->deleteConnector(conn0_17788857);
107 	conn0_17788857 = nullptr;
108 	router0->deleteJunction(junction0_390996481);
109 	junction0_390996481 = nullptr;
110 	router0->deleteConnector(conn0_545568780);
111 	conn0_545568780 = nullptr;
112 	router0->deleteConnector(conn0_175131537);
113 	conn0_175131537 = nullptr;
114 	router0->deleteJunction(junction0_46074711);
115 	junction0_46074711 = nullptr;
116 	router0->deleteConnector(conn0_510680660);
117 	conn0_510680660 = nullptr;
118 	router0->deleteConnector(conn0_627671070);
119 	conn0_627671070 = nullptr;
120 	router0->deleteJunction(junction0_503331836);
121 	junction0_503331836 = nullptr;
122 	router0->deleteConnector(conn0_929108568);
123 	conn0_929108568 = nullptr;
124 	router0->deleteJunction(junction0_636368600);
125 	junction0_636368600 = nullptr;
126 	router0->deleteShape(shape0_214253640);
127 	shape0_214253640 = nullptr;
128 	router0->deleteShape(shape0_35177560);
129 	shape0_35177560 = nullptr;
130 	router0->deleteShape(shape0_355243155);
131 	shape0_355243155 = nullptr;
132 
133 	router0->processTransaction();
134 
135 	delete router0;
136 }
137 
main(void)138 extern "C" int main(void)
139 {
140 	test();
141 	return 0;
142 }
143