summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/adaptagrams/libavoid/tests/inlineoverlap06.cpp
blob: 8319c295fe72dfda1b0a5285898d025d4ab82d63 (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
// From Routing_2a-broken_libavoid-debug.
#include "libavoid/libavoid.h"
using namespace Avoid;
int main(void) {
    Router *router = new Router(
            PolyLineRouting | OrthogonalRouting);
    router->setRoutingPenalty((PenaltyType)0, 50);
    router->setRoutingPenalty((PenaltyType)1, 0);
    router->setRoutingPenalty((PenaltyType)2, 0);
    router->setRoutingPenalty((PenaltyType)3, 4000);
    router->setRoutingPenalty((PenaltyType)4, 210);
    router->setRoutingParameter(idealNudgingDistance, 25);

    Polygon poly170253204(4);
    poly170253204.ps[0] = Point(50450, 50190);
    poly170253204.ps[1] = Point(50450, 50360);
    poly170253204.ps[2] = Point(50265, 50360);
    poly170253204.ps[3] = Point(50265, 50190);
    new ShapeRef(router, poly170253204, 170253204);

    Polygon poly285103539(4);
    poly285103539.ps[0] = Point(51385, 50390);
    poly285103539.ps[1] = Point(51385, 50560);
    poly285103539.ps[2] = Point(51200, 50560);
    poly285103539.ps[3] = Point(51200, 50390);
    new ShapeRef(router, poly285103539, 285103539);

    Polygon poly252459412(4);
    poly252459412.ps[0] = Point(51360, 50190);
    poly252459412.ps[1] = Point(51360, 50360);
    poly252459412.ps[2] = Point(51175, 50360);
    poly252459412.ps[3] = Point(51175, 50190);
    new ShapeRef(router, poly252459412, 252459412);

    Polygon poly914700248(4);
    poly914700248.ps[0] = Point(50800, 50390);
    poly914700248.ps[1] = Point(50800, 50560);
    poly914700248.ps[2] = Point(50615, 50560);
    poly914700248.ps[3] = Point(50615, 50390);
    new ShapeRef(router, poly914700248, 914700248);

    ConnRef *connRef214207623 = new ConnRef(router, 214207623);
    ConnEnd srcPt214207623(Point(51210, 50475), 4);
    connRef214207623->setSourceEndpoint(srcPt214207623);
    ConnEnd dstPt214207623(Point(50440, 50275), 8);
    connRef214207623->setDestEndpoint(dstPt214207623);
    connRef214207623->setRoutingType((ConnType)2);

    ConnRef *connRef573390636 = new ConnRef(router, 573390636);
    ConnEnd srcPt573390636(Point(50790, 50475), 8);
    connRef573390636->setSourceEndpoint(srcPt573390636);
    ConnEnd dstPt573390636(Point(51185, 50275), 4);
    connRef573390636->setDestEndpoint(dstPt573390636);
    connRef573390636->setRoutingType((ConnType)2);

    router->processTransaction();
    router->outputDiagram("output/inlineoverlap06");
    bool overlap = router->existsOrthogonalFixedSegmentOverlap();
    delete router;
    return (overlap) ? 1 : 0;
};