当前位置: 首页>>代码示例>>C++>>正文


C++ Router::processTransaction方法代码示例

本文整理汇总了C++中Router::processTransaction方法的典型用法代码示例。如果您正苦于以下问题:C++ Router::processTransaction方法的具体用法?C++ Router::processTransaction怎么用?C++ Router::processTransaction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Router的用法示例。


在下文中一共展示了Router::processTransaction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(void) {
    Router *router = new Router(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, 105);
    router->setOrthogonalNudgeDistance(25);
    Rectangle rect478845150(Point(50695, 51070), Point(50705, 51080));
    JunctionRef *junctionRef478845150 = new JunctionRef(router, 
		    Point(50700, 51075), 478845150);
    
    Rectangle rect92712048(Point(51246, 50475), Point(51304, 50585));
    new ShapeRef(router, rect92712048, 92712048);
    Rectangle rect23127921(Point(50365, 50766), Point(50485, 50834));
    new ShapeRef(router, rect23127921, 23127921);
    Rectangle rect159957148(Point(51740, 50891), Point(51860, 50959));
    new ShapeRef(router, rect159957148, 159957148);
    Rectangle rect1350214(Point(50375, 51015), Point(50625, 51135));
    new ShapeRef(router, rect1350214, 1350214);
    Rectangle rect247197258(Point(50265, 51046), Point(50375, 51104));
    new ShapeRef(router, rect247197258, 247197258);
    Rectangle rect281096654(Point(50700, 50390), Point(51000, 50610));
    new ShapeRef(router, rect281096654, 281096654);
    ConnEnd srcPt342420237(Point(50425, 50800), 15);
    ConnEnd dstPt342420237(Point(50710, 50450), 4);
    new ConnRef(router, srcPt342420237, dstPt342420237, 342420237);
    ConnEnd srcPt352019675(Point(50990, 50500), 8);
    ConnEnd dstPt352019675(junctionRef478845150);
    //ConnEnd dstPt352019675(Point(50700, 51075), 15);
    new ConnRef(router, srcPt352019675, dstPt352019675, 352019675);
    ConnEnd srcPt42699400(junctionRef478845150);
    //ConnEnd srcPt42699400(Point(50700, 51075), 15);
    ConnEnd dstPt42699400(Point(50615, 51075), 8);
    new ConnRef(router, srcPt42699400, dstPt42699400, 42699400);
    ConnEnd srcPt94712625(Point(50710, 50550), 4);
    ConnEnd dstPt94712625(junctionRef478845150);
    //ConnEnd dstPt94712625(Point(50700, 51075), 15);
    new ConnRef(router, srcPt94712625, dstPt94712625, 94712625);
    
    ConnEnd srcPt92802970(Point(50990, 50450), 8);
    ConnEnd dstPt92802970(Point(51275, 50485), 1);
    ConnRef *conn = new ConnRef(router, srcPt92802970, dstPt92802970, 92802970);
    std::vector<Point> checkpoints;
    checkpoints.push_back(Point(50000, 50000));
    checkpoints.push_back(Point(50200, 50000));
    checkpoints.push_back(Point(50200, 50200));
    conn->setRoutingCheckpoints(checkpoints);
    
    ConnEnd srcPt716502036(Point(50710, 50500), 4);
    ConnEnd dstPt716502036(Point(51800, 50925), 15);
    new ConnRef(router, srcPt716502036, dstPt716502036, 716502036);
    router->processTransaction();
    router->outputInstanceToSVG("test-checkpoints01-1");
    router->moveJunction(junctionRef478845150, 585, 0);
    router->processTransaction();
    router->outputInstanceToSVG("test-checkpoints01-2");
    delete router;
    return 0;
};
开发者ID:amolenaar,项目名称:adaptagrams,代码行数:60,代码来源:checkpoints01.cpp

示例2: main

int main(void) {
    Router *router = new Router(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, 105);
    router->setOrthogonalNudgeDistance(25);
    Rectangle rect478845150(Point(50695, 51070), Point(50705, 51080));
    ShapeRef *shapeRef478845150 = new ShapeRef(router, rect478845150, 478845150);
    ShapeConnectionPin *pin = new Avoid::ShapeConnectionPin(shapeRef478845150, 
	    Avoid::CONNECTIONPIN_CENTRE, Avoid::ATTACH_POS_CENTRE, 
	    Avoid::ATTACH_POS_CENTRE);
    pin->setExclusive(false);
    
    router->addShape(shapeRef478845150);
    Rectangle rect92712048(Point(51246, 50475), Point(51304, 50585));
    ShapeRef *shapeRef92712048 = new ShapeRef(router, rect92712048, 92712048);
    router->addShape(shapeRef92712048);
    Rectangle rect23127921(Point(50365, 50766), Point(50485, 50834));
    ShapeRef *shapeRef23127921 = new ShapeRef(router, rect23127921, 23127921);
    router->addShape(shapeRef23127921);
    Rectangle rect159957148(Point(51740, 50891), Point(51860, 50959));
    ShapeRef *shapeRef159957148 = new ShapeRef(router, rect159957148, 159957148);
    router->addShape(shapeRef159957148);
    Rectangle rect1350214(Point(50375, 51015), Point(50625, 51135));
    ShapeRef *shapeRef1350214 = new ShapeRef(router, rect1350214, 1350214);
    router->addShape(shapeRef1350214);
    Rectangle rect247197258(Point(50265, 51046), Point(50375, 51104));
    ShapeRef *shapeRef247197258 = new ShapeRef(router, rect247197258, 247197258);
    router->addShape(shapeRef247197258);
    Rectangle rect281096654(Point(50700, 50390), Point(51000, 50610));
    ShapeRef *shapeRef281096654 = new ShapeRef(router, rect281096654, 281096654);
    router->addShape(shapeRef281096654);
    ConnEnd srcPt342420237(Point(50425, 50800), 15);
    ConnEnd dstPt342420237(Point(50710, 50450), 4);
    new ConnRef(router, srcPt342420237, dstPt342420237, 342420237);
    ConnEnd srcPt352019675(Point(50990, 50500), 8);
    ConnEnd dstPt352019675(shapeRef478845150, Avoid::CONNECTIONPIN_CENTRE);
    //ConnEnd dstPt352019675(Point(50700, 51075), 15);
    new ConnRef(router, srcPt352019675, dstPt352019675, 352019675);
    ConnEnd srcPt42699400(shapeRef478845150, Avoid::CONNECTIONPIN_CENTRE);
    //ConnEnd srcPt42699400(Point(50700, 51075), 15);
    ConnEnd dstPt42699400(Point(50615, 51075), 8);
    new ConnRef(router, srcPt42699400, dstPt42699400, 42699400);
    ConnEnd srcPt94712625(Point(50710, 50550), 4);
    ConnEnd dstPt94712625(shapeRef478845150, Avoid::CONNECTIONPIN_CENTRE);
    //ConnEnd dstPt94712625(Point(50700, 51075), 15);
    new ConnRef(router, srcPt94712625, dstPt94712625, 94712625);
    ConnEnd srcPt92802970(Point(50990, 50450), 8);
    ConnEnd dstPt92802970(Point(51275, 50485), 1);
    new ConnRef(router, srcPt92802970, dstPt92802970, 92802970);
    ConnEnd srcPt716502036(Point(50710, 50500), 4);
    ConnEnd dstPt716502036(Point(51800, 50925), 15);
    new ConnRef(router, srcPt716502036, dstPt716502036, 716502036);
    router->processTransaction();
    router->outputInstanceToSVG("test-junction01");
    delete router;
    return 0;
};
开发者ID:TheProjecter,项目名称:pockemul,代码行数:60,代码来源:junction01.cpp

示例3: main

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, 110);
    router->setRoutingParameter(idealNudgingDistance, 25);

    Polygon poly421433292(4);
    poly421433292.ps[0] = Point(51335, 50215);
    poly421433292.ps[1] = Point(51335, 50385);
    poly421433292.ps[2] = Point(51065, 50385);
    poly421433292.ps[3] = Point(51065, 50215);
    new ShapeRef(router, poly421433292, 421433292);

    Polygon poly174734866(4);
    poly174734866.ps[0] = Point(51335, 50490);
    poly174734866.ps[1] = Point(51335, 50660);
    poly174734866.ps[2] = Point(51065, 50660);
    poly174734866.ps[3] = Point(51065, 50490);
    new ShapeRef(router, poly174734866, 174734866);

    Polygon poly564884274(4);
    poly564884274.ps[0] = Point(50635, 50500);
    poly564884274.ps[1] = Point(50635, 50583);
    poly564884274.ps[2] = Point(50515, 50583);
    poly564884274.ps[3] = Point(50515, 50500);
    new ShapeRef(router, poly564884274, 564884274);

    ConnRef *connRef103176525 = new ConnRef(router, 103176525);
    ConnEnd srcPt103176525(Point(51085, 50550), 4);
    connRef103176525->setSourceEndpoint(srcPt103176525);
    ConnEnd dstPt103176525(Point(50575, 50510), 1);
    connRef103176525->setDestEndpoint(dstPt103176525);
    connRef103176525->setRoutingType((ConnType)2);

    ConnRef *connRef223495632 = new ConnRef(router, 223495632);
    ConnEnd srcPt223495632(Point(51085, 50325), 4);
    connRef223495632->setSourceEndpoint(srcPt223495632);
    ConnEnd dstPt223495632(Point(50575, 50550), 14);
    connRef223495632->setDestEndpoint(dstPt223495632);
    connRef223495632->setRoutingType((ConnType)2);

    router->processTransaction();
    router->outputInstanceToSVG("output/inlineoverlap03");
    bool overlap = router->existsOrthogonalFixedSegmentOverlap();
    delete router;
    return (overlap) ? 1 : 0;
};
开发者ID:AidanDelaney,项目名称:adaptagrams,代码行数:51,代码来源:inlineoverlap03.cpp

示例4: main

int main(void) {
    Router *router = new Router(OrthogonalRouting);
    router->setRoutingPenalty((Avoid::PenaltyType)0, 50);
    router->setRoutingPenalty((Avoid::PenaltyType)1, 0);
    router->setRoutingPenalty((Avoid::PenaltyType)2, 200);
    router->setRoutingPenalty((Avoid::PenaltyType)3, 4000);
    router->setRoutingPenalty((Avoid::PenaltyType)4, 110);
    router->setRoutingParameter(idealNudgingDistance, 25);
    Rectangle rect548374163(Point(51900, 50400), Point(52300, 50900));
    new ShapeRef(router, rect548374163, 548374163);
    Rectangle rect901116812(Point(51131, 49750), Point(51531, 50100));
    new ShapeRef(router, rect901116812, 901116812);
    Rectangle rect335855988(Point(51125, 50175), Point(51525, 50900));
    new ShapeRef(router, rect335855988, 335855988);
    Rectangle rect448725420(Point(52375, 50750), Point(52575, 50900));
    new ShapeRef(router, rect448725420, 448725420);
    Rectangle rect74263573(Point(51900, 49750), Point(52300, 50100));
    new ShapeRef(router, rect74263573, 74263573);
    ConnEnd srcPt463223880(Point(51500, 50275), 8);
    ConnEnd dstPt463223880(Point(51150, 50275), 4);
    ConnEnd srcPt144520410(Point(51150, 49850), 4);
    ConnEnd dstPt144520410(Point(51500, 50350), 8);
    ConnEnd srcPt45398340(Point(52400, 50825), 4);
    ConnEnd dstPt45398340(Point(51500, 49925), 8);
    ConnEnd srcPt29344262(Point(51150, 50500), 4);
    ConnEnd dstPt29344262(Point(51925, 50000), 4);
    new ConnRef(router, srcPt29344262, dstPt29344262, 29344262);
    new ConnRef(router, srcPt45398340, dstPt45398340, 45398340);
    new ConnRef(router, srcPt144520410, dstPt144520410, 144520410);
    new ConnRef(router, srcPt463223880, dstPt463223880, 463223880);
    router->processTransaction();
    router->outputInstanceToSVG("output/nudgeintobug");
    bool overlap = router->existsOrthogonalFixedSegmentOverlap();
    bool touching = router->existsOrthogonalTouchingPaths();
    delete router;
    return (overlap || touching) ? 1 : 0;
};
开发者ID:AidanDelaney,项目名称:adaptagrams,代码行数:37,代码来源:nudgeintobug.cpp

示例5: main

int main(void) {
    Router *router = new Router(OrthogonalRouting);
    router->setRoutingPenalty(segmentPenalty, 50);
    router->setOrthogonalNudgeDistance(10);
    Rectangle rect47(Point(51145, 50195), Point(51145+360, 50195+685));
    new ShapeRef(router, rect47);
    Rectangle rect46(Point(51920, 49770), Point(51920+360, 49770+310));
    new ShapeRef(router, rect46);
    Rectangle rect45(Point(51151, 49770), Point(51151+360, 49770+310));
    new ShapeRef(router, rect45);
    ConnEnd srcPt53(Point(51150,49850), 4);
    ConnEnd dstPt53(Point(51500,50350), 8);
    new ConnRef(router, srcPt53, dstPt53);
    ConnEnd srcPt52(Point(52275,49850), 8);
    ConnEnd dstPt52(Point(51150,49925), 4);
    new ConnRef(router, srcPt52, dstPt52);
    ConnEnd srcPt6(Point(51150,50500), 4);
    ConnEnd dstPt6(Point(51925,50000), 4);
    new ConnRef(router, srcPt6, dstPt6, 6);
    router->processTransaction();
    router->outputInstanceToSVG("test-infinity");
    delete router;
    return 0;
};
开发者ID:amolenaar,项目名称:adaptagrams,代码行数:24,代码来源:infinity.cpp

示例6: main


//.........这里部分代码省略.........
    router->setRoutingOption((RoutingOption)2, true);
    router->setRoutingOption(improveHyperedgeRoutesMovingJunctions, false);
    router->setRoutingOption(improveHyperedgeRoutesMovingAddingAndDeletingJunctions, true);
    router->setRoutingParameter(idealNudgingDistance, 25);

    Polygon poly2(4);
    poly2.ps[0] = Point(50354, 50975);
    poly2.ps[1] = Point(50354, 51060);
    poly2.ps[2] = Point(50296, 51060);
    poly2.ps[3] = Point(50296, 50975);
    ShapeRef *shapeRef2 = new ShapeRef(router, poly2, 2);
    new ShapeConnectionPin(shapeRef2, 1, 0.5, 1, true, 10, (ConnDirFlags) 1);

    Polygon poly39761567(4);
    poly39761567.ps[0] = Point(50754, 50975);
    poly39761567.ps[1] = Point(50754, 51060);
    poly39761567.ps[2] = Point(50696, 51060);
    poly39761567.ps[3] = Point(50696, 50975);
    ShapeRef *shapeRef39761567 = new ShapeRef(router, poly39761567, 39761567);
    new ShapeConnectionPin(shapeRef39761567, 1, 0.5, 0, true, 10, (ConnDirFlags) 1);

    Polygon poly115776716(4);
    poly115776716.ps[0] = Point(51504, 50975);
    poly115776716.ps[1] = Point(51504, 51060);
    poly115776716.ps[2] = Point(51446, 51060);
    poly115776716.ps[3] = Point(51446, 50975);
    ShapeRef *shapeRef115776716 = new ShapeRef(router, poly115776716, 115776716);
    new ShapeConnectionPin(shapeRef115776716, 1, 0.5, 0, true, 10, (ConnDirFlags) 1);

    Polygon poly238475293(4);
    poly238475293.ps[0] = Point(50554, 50975);
    poly238475293.ps[1] = Point(50554, 51060);
    poly238475293.ps[2] = Point(50496, 51060);
    poly238475293.ps[3] = Point(50496, 50975);
    ShapeRef *shapeRef238475293 = new ShapeRef(router, poly238475293, 238475293);
    new ShapeConnectionPin(shapeRef238475293, 1, 0.5, 0, true, 10, (ConnDirFlags) 1);

    Polygon poly430971008(4);
    poly430971008.ps[0] = Point(51004, 50975);
    poly430971008.ps[1] = Point(51004, 51060);
    poly430971008.ps[2] = Point(50946, 51060);
    poly430971008.ps[3] = Point(50946, 50975);
    ShapeRef *shapeRef430971008 = new ShapeRef(router, poly430971008, 430971008);
    new ShapeConnectionPin(shapeRef430971008, 1, 0.5, 0, true, 10, (ConnDirFlags) 1);

    JunctionRef *junctionRef513246008 = new JunctionRef(router, Point(50925, 50700), 513246008);
    /*
    // This may be useful if junction pins are modified.
    new ShapeConnectionPin(junctionRef513246008, 2147483646, (ConnDirFlags) 15);
    */
    JunctionRef *junctionRef4 = new JunctionRef(router, Point(50725, 50725), 4);

    ConnRef *connRef3 = new ConnRef(router, 3);
    ConnEnd srcPt3(shapeRef2, 1);
    connRef3->setSourceEndpoint(srcPt3);
    ConnEnd dstPt3(junctionRef513246008);
    connRef3->setDestEndpoint(dstPt3);
    connRef3->setRoutingType((ConnType)2);
    
    ConnRef *connRef5 = new ConnRef(router, 5);
    ConnEnd srcPt5(junctionRef4);
    connRef5->setSourceEndpoint(srcPt5);
    ConnEnd dstPt5(junctionRef513246008);
    connRef5->setDestEndpoint(dstPt5);
    connRef5->setRoutingType((ConnType)2);

    ConnRef *connRef513246009 = new ConnRef(router, 513246009);
    ConnEnd srcPt513246009(shapeRef39761567, 1);
    connRef513246009->setSourceEndpoint(srcPt513246009);
    ConnEnd dstPt513246009(junctionRef4);
    connRef513246009->setDestEndpoint(dstPt513246009);
    connRef513246009->setRoutingType((ConnType)2);

    ConnRef *connRef513246010 = new ConnRef(router, 513246010);
    ConnEnd srcPt513246010(junctionRef513246008);
    connRef513246010->setSourceEndpoint(srcPt513246010);
    ConnEnd dstPt513246010(shapeRef430971008, 1);
    connRef513246010->setDestEndpoint(dstPt513246010);
    connRef513246010->setRoutingType((ConnType)2);

    ConnRef *connRef513246011 = new ConnRef(router, 513246011);
    ConnEnd srcPt513246011(junctionRef4);
    connRef513246011->setSourceEndpoint(srcPt513246011);
    ConnEnd dstPt513246011(shapeRef238475293, 1);
    connRef513246011->setDestEndpoint(dstPt513246011);
    connRef513246011->setRoutingType((ConnType)2);

    ConnRef *connRef513246012 = new ConnRef(router, 513246012);
    ConnEnd srcPt513246012(shapeRef115776716, 1);
    connRef513246012->setSourceEndpoint(srcPt513246012);
    ConnEnd dstPt513246012(junctionRef513246008);
    connRef513246012->setDestEndpoint(dstPt513246012);
    connRef513246012->setRoutingType((ConnType)2);
    router->processTransaction();
    router->outputInstanceToSVG("output/improveHyperedge04");

    bool overlaps = router->existsOrthogonalSegmentOverlap(true);
    delete router;
    return (overlaps) ? 1 : 0;
};
开发者ID:AidanDelaney,项目名称:adaptagrams,代码行数:101,代码来源:improveHyperedge04.cpp

示例7: main

int main(void) {
    Router *router = new Router(
            PolyLineRouting | OrthogonalRouting);
    router->setRoutingPenalty((PenaltyType)0, 50);
    router->setRoutingPenalty((PenaltyType)1, 0);
    router->setRoutingPenalty((PenaltyType)2, 200);
    router->setRoutingPenalty((PenaltyType)3, 4000);
    router->setRoutingPenalty((PenaltyType)4, 110);
    router->setRoutingPenalty((PenaltyType)5, 100);
    router->setOrthogonalNudgeDistance(25);

    Polygon poly186982048(4);
    poly186982048.ps[0] = Point(52660, 50490);
    poly186982048.ps[1] = Point(52660, 50960);
    poly186982048.ps[2] = Point(52100, 50960);
    poly186982048.ps[3] = Point(52100, 50490);
    ShapeRef *shapeRef186982048 = new ShapeRef(router, poly186982048, 186982048);
    router->addShape(shapeRef186982048);

    Polygon poly193989760(4);
    poly193989760.ps[0] = Point(51850, 50665);
    poly193989760.ps[1] = Point(51850, 50835);
    poly193989760.ps[2] = Point(51590, 50835);
    poly193989760.ps[3] = Point(51590, 50665);
    ShapeRef *shapeRef193989760 = new ShapeRef(router, poly193989760, 193989760);
    router->addShape(shapeRef193989760);

    Polygon poly276825384(4);
    poly276825384.ps[0] = Point(51825, 51040);
    poly276825384.ps[1] = Point(51825, 51210);
    poly276825384.ps[2] = Point(51565, 51210);
    poly276825384.ps[3] = Point(51565, 51040);
    ShapeRef *shapeRef276825384 = new ShapeRef(router, poly276825384, 276825384);
    router->addShape(shapeRef276825384);

    Polygon poly190150804(4);
    poly190150804.ps[0] = Point(50460, 51340);
    poly190150804.ps[1] = Point(50460, 51510);
    poly190150804.ps[2] = Point(50290, 51510);
    poly190150804.ps[3] = Point(50290, 51340);
    ShapeRef *shapeRef190150804 = new ShapeRef(router, poly190150804, 190150804);
    router->addShape(shapeRef190150804);

    ConnRef *connRef562170592 = new ConnRef(router, 562170592);
    ConnEnd srcPt562170592(Point(52110, 50800), 4);
    connRef562170592->setSourceEndpoint(srcPt562170592);
    ConnEnd dstPt562170592(Point(51815, 51100), 8);
    connRef562170592->setDestEndpoint(dstPt562170592);
    connRef562170592->setRoutingType((ConnType)2);

    ConnRef *connRef171593006 = new ConnRef(router, 171593006);
    ConnEnd srcPt171593006(Point(52110, 50750), 4);
    connRef171593006->setSourceEndpoint(srcPt171593006);
    ConnEnd dstPt171593006(Point(51840, 50725), 8);
    connRef171593006->setDestEndpoint(dstPt171593006);
    connRef171593006->setRoutingType((ConnType)2);

    ConnRef *connRef172593160 = new ConnRef(router, 172593160);
    ConnEnd srcPt172593160(Point(51815, 51150), 8);
    connRef172593160->setSourceEndpoint(srcPt172593160);
    ConnEnd dstPt172593160(Point(52110, 50900), 4);
    connRef172593160->setDestEndpoint(dstPt172593160);
    connRef172593160->setRoutingType((ConnType)2);

    ConnRef *connRef116944564 = new ConnRef(router, 116944564);
    ConnEnd srcPt116944564(Point(51840, 50775), 8);
    connRef116944564->setSourceEndpoint(srcPt116944564);
    ConnEnd dstPt116944564(Point(52110, 50850), 4);
    connRef116944564->setDestEndpoint(dstPt116944564);
    connRef116944564->setRoutingType((ConnType)2);

    router->processTransaction();
    router->outputInstanceToSVG("test-inlineoverlap-07");
    delete router;
    return 0;
};
开发者ID:TheProjecter,项目名称:pockemul,代码行数:76,代码来源:inlineoverlap07.cpp

示例8: main

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, 110);
    router->setOrthogonalNudgeDistance(25);

    Polygon poly231469760(4);
    poly231469760.ps[0] = Point(6385, 9390);
    poly231469760.ps[1] = Point(6385, 9560);
    poly231469760.ps[2] = Point(6200, 9560);
    poly231469760.ps[3] = Point(6200, 9390);
    ShapeRef *shapeRef231469760 = new ShapeRef(router, poly231469760, 231469760);
    router->addShape(shapeRef231469760);

    Polygon poly7136376(4);
    poly7136376.ps[0] = Point(6560, 9290);
    poly7136376.ps[1] = Point(6560, 9460);
    poly7136376.ps[2] = Point(6375, 9460);
    poly7136376.ps[3] = Point(6375, 9290);
    ShapeRef *shapeRef7136376 = new ShapeRef(router, poly7136376, 7136376);
    router->addShape(shapeRef7136376);

    Polygon poly215821749(4);
    poly215821749.ps[0] = Point(6510, 9540);
    poly215821749.ps[1] = Point(6510, 9710);
    poly215821749.ps[2] = Point(6325, 9710);
    poly215821749.ps[3] = Point(6325, 9540);
    ShapeRef *shapeRef215821749 = new ShapeRef(router, poly215821749, 215821749);
    router->addShape(shapeRef215821749);

    Polygon poly83086994(4);
    poly83086994.ps[0] = Point(5925, 9240);
    poly83086994.ps[1] = Point(5925, 10085);
    poly83086994.ps[2] = Point(5575, 10085);
    poly83086994.ps[3] = Point(5575, 9240);
    ShapeRef *shapeRef83086994 = new ShapeRef(router, poly83086994, 83086994);
    router->addShape(shapeRef83086994);

    ConnRef *connRef292408794 = new ConnRef(router, 292408794);
    ConnEnd srcPt292408794(Point(5915, 9625), 8);
    connRef292408794->setSourceEndpoint(srcPt292408794);
    ConnEnd dstPt292408794(Point(6210, 9475), 4);
    connRef292408794->setDestEndpoint(dstPt292408794);
    connRef292408794->setRoutingType((ConnType)2);

    ConnRef *connRef40917776 = new ConnRef(router, 40917776);
    ConnEnd srcPt40917776(Point(5915, 9550), 8);
    connRef40917776->setSourceEndpoint(srcPt40917776);
    ConnEnd dstPt40917776(Point(6385, 9375), 4);
    connRef40917776->setDestEndpoint(dstPt40917776);
    connRef40917776->setRoutingType((ConnType)2);

    ConnRef *connRef629564142 = new ConnRef(router, 629564142);
    ConnEnd srcPt629564142(Point(5915, 9475), 8);
    connRef629564142->setSourceEndpoint(srcPt629564142);
    ConnEnd dstPt629564142(Point(6335, 9625), 4);
    connRef629564142->setDestEndpoint(dstPt629564142);
    connRef629564142->setRoutingType((ConnType)2);

    router->processTransaction();
    router->outputInstanceToSVG("test-inlineoverlap-05");
    bool overlap = router->existsOrthogonalPathOverlap();
    delete router;
    return (overlap) ? 1 : 0;
};
开发者ID:TheProjecter,项目名称:pockemul,代码行数:69,代码来源:inlineoverlap05.cpp

示例9: main

int main(void) {
    Router *router = new Router(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, 0);
    router->setOrthogonalNudgeDistance(4);

    Polygon poly1(4);
    poly1.ps[0] = Point(52, 188);
    poly1.ps[1] = Point(52, 292);
    poly1.ps[2] = Point(-52, 292);
    poly1.ps[3] = Point(-52, 188);
    ShapeRef *shapeRef1 = new ShapeRef(router, poly1, 1);
    router->addShape(shapeRef1);
    new ShapeConnectionPin(shapeRef1, 544, 0.5, 0.5, 10, (ConnDirFlags) 0);

    Polygon poly2(4);
    poly2.ps[0] = Point(52, -52);
    poly2.ps[1] = Point(52, 52);
    poly2.ps[2] = Point(-52, 52);
    poly2.ps[3] = Point(-52, -52);
    ShapeRef *shapeRef2 = new ShapeRef(router, poly2, 2);
    router->addShape(shapeRef2);
    new ShapeConnectionPin(shapeRef2, 544, 0.5, 0.5, 10, (ConnDirFlags) 0);

    Polygon poly3(4);
    poly3.ps[0] = Point(52, 428);
    poly3.ps[1] = Point(52, 532);
    poly3.ps[2] = Point(-52, 532);
    poly3.ps[3] = Point(-52, 428);
    ShapeRef *shapeRef3 = new ShapeRef(router, poly3, 3);
    router->addShape(shapeRef3);
    new ShapeConnectionPin(shapeRef3, 544, 0.5, 0.5, 10, (ConnDirFlags) 0);

    Polygon poly4(4);
    poly4.ps[0] = Point(52, 68);
    poly4.ps[1] = Point(52, 172);
    poly4.ps[2] = Point(-52, 172);
    poly4.ps[3] = Point(-52, 68);
    ShapeRef *shapeRef4 = new ShapeRef(router, poly4, 4);
    router->addShape(shapeRef4);
    new ShapeConnectionPin(shapeRef4, 544, 0.5, 0.5, 10, (ConnDirFlags) 0);

    Polygon poly5(4);
    poly5.ps[0] = Point(52, 308);
    poly5.ps[1] = Point(52, 412);
    poly5.ps[2] = Point(-52, 412);
    poly5.ps[3] = Point(-52, 308);
    ShapeRef *shapeRef5 = new ShapeRef(router, poly5, 5);
    router->addShape(shapeRef5);
    new ShapeConnectionPin(shapeRef5, 544, 0.5, 0.5, 10, (ConnDirFlags) 0);

    ConnRef *connRef6 = new ConnRef(router, 6);
    ConnEnd srcPt6(shapeRef2, 544);
    connRef6->setSourceEndpoint(srcPt6);
    ConnEnd dstPt6(shapeRef5, 544);
    connRef6->setDestEndpoint(dstPt6);
    connRef6->setRoutingType((ConnType)2);

    ConnRef *connRef7 = new ConnRef(router, 7);
    ConnEnd srcPt7(shapeRef5, 544);
    connRef7->setSourceEndpoint(srcPt7);
    ConnEnd dstPt7(shapeRef4, 544);
    connRef7->setDestEndpoint(dstPt7);
    connRef7->setRoutingType((ConnType)2);

    ConnRef *connRef8 = new ConnRef(router, 8);
    ConnEnd srcPt8(shapeRef1, 544);
    connRef8->setSourceEndpoint(srcPt8);
    ConnEnd dstPt8(shapeRef5, 544);
    connRef8->setDestEndpoint(dstPt8);
    connRef8->setRoutingType((ConnType)2);

    ConnRef *connRef9 = new ConnRef(router, 9);
    ConnEnd srcPt9(shapeRef2, 544);
    connRef9->setSourceEndpoint(srcPt9);
    ConnEnd dstPt9(shapeRef3, 544);
    connRef9->setDestEndpoint(dstPt9);
    connRef9->setRoutingType((ConnType)2);

    ConnRef *connRef10 = new ConnRef(router, 10);
    ConnEnd srcPt10(shapeRef3, 544);
    connRef10->setSourceEndpoint(srcPt10);
    ConnEnd dstPt10(shapeRef4, 544);
    connRef10->setDestEndpoint(dstPt10);
    connRef10->setRoutingType((ConnType)2);

    ConnRef *connRef11 = new ConnRef(router, 11);
    ConnEnd srcPt11(shapeRef1, 544);
    connRef11->setSourceEndpoint(srcPt11);
    ConnEnd dstPt11(shapeRef3, 544);
    connRef11->setDestEndpoint(dstPt11);
    connRef11->setRoutingType((ConnType)2);
    
    router->processTransaction();
    router->outputInstanceToSVG("test-inlineShapes");
    delete router;
    return 0;
//.........这里部分代码省略.........
开发者ID:TheProjecter,项目名称:pockemul,代码行数:101,代码来源:inlineShapes.cpp

示例10: main


//.........这里部分代码省略.........
    poly134604636.ps[3] = Point(29675, 26720);
    new ShapeRef(router, poly134604636, 134604636);
    
    Polygon poly14353632(4);
    poly14353632.ps[0] = Point(29600, 26590);
    poly14353632.ps[1] = Point(29600, 27660);
    poly14353632.ps[2] = Point(28440, 27660);
    poly14353632.ps[3] = Point(28440, 26590);
    new ShapeRef(router, poly14353632, 14353632);
    
    ConnRef *connRef70269732 = new ConnRef(router, 70269732);
    ConnEnd srcPt70269732(Point(29590, 26700), 8);
    connRef70269732->setSourceEndpoint(srcPt70269732);
    ConnEnd dstPt70269732(Point(29915, 26750), 8);
    connRef70269732->setDestEndpoint(dstPt70269732);
    connRef70269732->setRoutingType((ConnType)2);

    ConnRef *connRef371572709 = new ConnRef(router, 371572709);
    ConnEnd srcPt371572709(Point(29590, 26800), 8);
    connRef371572709->setSourceEndpoint(srcPt371572709);
    ConnEnd dstPt371572709(Point(29915, 26850), 8);
    connRef371572709->setDestEndpoint(dstPt371572709);
    connRef371572709->setRoutingType((ConnType)2);

    ConnRef *connRef876797766 = new ConnRef(router, 876797766);
    ConnEnd srcPt876797766(Point(29590, 26900), 8);
    connRef876797766->setSourceEndpoint(srcPt876797766);
    ConnEnd dstPt876797766(Point(29940, 26950), 8);
    connRef876797766->setDestEndpoint(dstPt876797766);
    connRef876797766->setRoutingType((ConnType)2);

    ConnRef *connRef134423590 = new ConnRef(router, 134423590);
    ConnEnd srcPt134423590(Point(29590, 27000), 8);
    connRef134423590->setSourceEndpoint(srcPt134423590);
    ConnEnd dstPt134423590(Point(29940, 27050), 8);
    connRef134423590->setDestEndpoint(dstPt134423590);
    connRef134423590->setRoutingType((ConnType)2);

    ConnRef *connRef872586669 = new ConnRef(router, 872586669);
    ConnEnd srcPt872586669(Point(29590, 27100), 8);
    connRef872586669->setSourceEndpoint(srcPt872586669);
    ConnEnd dstPt872586669(Point(29940, 27150), 8);
    connRef872586669->setDestEndpoint(dstPt872586669);
    connRef872586669->setRoutingType((ConnType)2);

    ConnRef *connRef23601612 = new ConnRef(router, 23601612);
    ConnEnd srcPt23601612(Point(29590, 27200), 8);
    connRef23601612->setSourceEndpoint(srcPt23601612);
    ConnEnd dstPt23601612(Point(29940, 27250), 8);
    connRef23601612->setDestEndpoint(dstPt23601612);
    connRef23601612->setRoutingType((ConnType)2);

    ConnRef *connRef737483980 = new ConnRef(router, 737483980);
    ConnEnd srcPt737483980(Point(29685, 26750), 4);
    connRef737483980->setSourceEndpoint(srcPt737483980);
    ConnEnd dstPt737483980(Point(29590, 26650), 8);
    connRef737483980->setDestEndpoint(dstPt737483980);
    connRef737483980->setRoutingType((ConnType)2);

    ConnRef *connRef410784855 = new ConnRef(router, 410784855);
    ConnEnd srcPt410784855(Point(29685, 26850), 4);
    connRef410784855->setSourceEndpoint(srcPt410784855);
    ConnEnd dstPt410784855(Point(29590, 26750), 8);
    connRef410784855->setDestEndpoint(dstPt410784855);
    connRef410784855->setRoutingType((ConnType)2);

    ConnRef *connRef15771480 = new ConnRef(router, 15771480);
    ConnEnd srcPt15771480(Point(29710, 26950), 4);
    connRef15771480->setSourceEndpoint(srcPt15771480);
    ConnEnd dstPt15771480(Point(29590, 26850), 8);
    connRef15771480->setDestEndpoint(dstPt15771480);
    connRef15771480->setRoutingType((ConnType)2);

    ConnRef *connRef34657402 = new ConnRef(router, 34657402);
    ConnEnd srcPt34657402(Point(29710, 27050), 4);
    connRef34657402->setSourceEndpoint(srcPt34657402);
    ConnEnd dstPt34657402(Point(29590, 26950), 8);
    connRef34657402->setDestEndpoint(dstPt34657402);
    connRef34657402->setRoutingType((ConnType)2);

    ConnRef *connRef98191218 = new ConnRef(router, 98191218);
    ConnEnd srcPt98191218(Point(29710, 27150), 4);
    connRef98191218->setSourceEndpoint(srcPt98191218);
    ConnEnd dstPt98191218(Point(29590, 27050), 8);
    connRef98191218->setDestEndpoint(dstPt98191218);
    connRef98191218->setRoutingType((ConnType)2);

    ConnRef *connRef23433311 = new ConnRef(router, 23433311);
    ConnEnd srcPt23433311(Point(29710, 27250), 4);
    connRef23433311->setSourceEndpoint(srcPt23433311);
    ConnEnd dstPt23433311(Point(29590, 27150), 8);
    connRef23433311->setDestEndpoint(dstPt23433311);
    connRef23433311->setRoutingType((ConnType)2);

    router->processTransaction();
    router->outputInstanceToSVG("output/orneroverlap01");
    bool touching = router->existsOrthogonalTouchingPaths();
    delete router;
    return (touching) ? 1 : 0;
};
开发者ID:AidanDelaney,项目名称:adaptagrams,代码行数:101,代码来源:corneroverlap01.cpp

示例11: main


//.........这里部分代码省略.........
    ConnEnd dstPt39(Point(318, 384), 8);
    connRef39->setDestEndpoint(dstPt39);
    connRef39->setRoutingType((ConnType)2);

    ConnRef *connRef40 = new ConnRef(router, 40);
    ConnEnd srcPt40(Point(376, 508), 4);
    connRef40->setSourceEndpoint(srcPt40);
    ConnEnd dstPt40(Point(318, 508), 8);
    connRef40->setDestEndpoint(dstPt40);
    connRef40->setRoutingType((ConnType)2);

    ConnRef *connRef41 = new ConnRef(router, 41);
    ConnEnd srcPt41(Point(376, 645), 4);
    connRef41->setSourceEndpoint(srcPt41);
    ConnEnd dstPt41(Point(318, 645), 8);
    connRef41->setDestEndpoint(dstPt41);
    connRef41->setRoutingType((ConnType)2);

    ConnRef *connRef42 = new ConnRef(router, 42);
    ConnEnd srcPt42(Point(495.857, 268), 2);
    connRef42->setSourceEndpoint(srcPt42);
    ConnEnd dstPt42(Point(495.857, 318), 1);
    connRef42->setDestEndpoint(dstPt42);
    connRef42->setRoutingType((ConnType)2);

    ConnRef *connRef43 = new ConnRef(router, 43);
    ConnEnd srcPt43(Point(566.357, 645), 4);
    connRef43->setSourceEndpoint(srcPt43);
    ConnEnd dstPt43(Point(508.357, 645), 8);
    connRef43->setDestEndpoint(dstPt43);
    connRef43->setRoutingType((ConnType)2);

    ConnRef *connRef44 = new ConnRef(router, 44);
    ConnEnd srcPt44(Point(89.5, 442), 8);
    connRef44->setSourceEndpoint(srcPt44);
    ConnEnd dstPt44(Point(147.5, 442), 4);
    connRef44->setDestEndpoint(dstPt44);
    connRef44->setRoutingType((ConnType)2);

    ConnRef *connRef45 = new ConnRef(router, 45);
    ConnEnd srcPt45(Point(318, 318), 15);
    connRef45->setSourceEndpoint(srcPt45);
    ConnEnd dstPt45(Point(318, 369), 1);
    connRef45->setDestEndpoint(dstPt45);
    connRef45->setRoutingType((ConnType)2);
    */

    ConnRef *connRef46 = new ConnRef(router, 46);
    ConnEnd srcPt46(Point(609.857, 367), 15);
    connRef46->setSourceEndpoint(srcPt46);
    ConnEnd dstPt46(Point(318, 369), 1);
    connRef46->setDestEndpoint(dstPt46);
    connRef46->setRoutingType((ConnType)2);

    /*
    ConnRef *connRef47 = new ConnRef(router, 47);
    ConnEnd srcPt47(Point(318, 583), 15);
    connRef47->setSourceEndpoint(srcPt47);
    ConnEnd dstPt47(Point(318, 630), 1);
    connRef47->setDestEndpoint(dstPt47);
    connRef47->setRoutingType((ConnType)2);

    ConnRef *connRef48 = new ConnRef(router, 48);
    ConnEnd srcPt48(Point(318, 318), 15);
    connRef48->setSourceEndpoint(srcPt48);
    ConnEnd dstPt48(Point(378.357, 271.5), 2);
    connRef48->setDestEndpoint(dstPt48);
    connRef48->setRoutingType((ConnType)2);

    ConnRef *connRef49 = new ConnRef(router, 49);
    ConnEnd srcPt49(Point(318, 318), 15);
    connRef49->setSourceEndpoint(srcPt49);
    ConnEnd dstPt49(Point(551.357, 240.5), 4);
    connRef49->setDestEndpoint(dstPt49);
    connRef49->setRoutingType((ConnType)2);
    */

    ConnRef *connRef50 = new ConnRef(router, 50);
    ConnEnd srcPt50(Point(609.857, 367), 15);
    connRef50->setSourceEndpoint(srcPt50);
    ConnEnd dstPt50(Point(577.857, 439.5), 4);
    connRef50->setDestEndpoint(dstPt50);
    connRef50->setRoutingType((ConnType)2);

    /*
    ConnRef *connRef51 = new ConnRef(router, 51);
    ConnEnd srcPt51(Point(318, 583), 15);
    connRef51->setSourceEndpoint(srcPt51);
    ConnEnd dstPt51(Point(271.5, 628.155), 8);
    connRef51->setDestEndpoint(dstPt51);
    connRef51->setRoutingType((ConnType)2);
    */

    router->processTransaction();
    router->outputDiagram("output/finalSegmentNudging2");
    bool atEnds = true;
    bool overlap = router->existsOrthogonalFixedSegmentOverlap(atEnds);
    delete router;
    return (overlap) ? 1 : 0;
};
开发者ID:P-N-L,项目名称:adaptagrams,代码行数:101,代码来源:finalSegmentNudging2.cpp

示例12: main

int main(void) {
    Router *router = new Router(
        PolyLineRouting | OrthogonalRouting);
    router->setRoutingPenalty((PenaltyType)0, 50);
    router->setRoutingPenalty((PenaltyType)1, 0);
    router->setRoutingPenalty((PenaltyType)2, 200);
    router->setRoutingPenalty((PenaltyType)3, 4000);
    router->setRoutingPenalty((PenaltyType)4, 110);
    router->setRoutingParameter(idealNudgingDistance, 25);

    Polygon poly282634758(4);
    poly282634758.ps[0] = Point(51360, 50215);
    poly282634758.ps[1] = Point(51360, 50460);
    poly282634758.ps[2] = Point(51075, 50460);
    poly282634758.ps[3] = Point(51075, 50215);
    new ShapeRef(router, poly282634758, 282634758);

    Polygon poly69386928(4);
    poly69386928.ps[0] = Point(51050, 50415);
    poly69386928.ps[1] = Point(51050, 50735);
    poly69386928.ps[2] = Point(50690, 50735);
    poly69386928.ps[3] = Point(50690, 50415);
    new ShapeRef(router, poly69386928, 69386928);

    Polygon poly11958280(4);
    poly11958280.ps[0] = Point(50460, 50490);
    poly11958280.ps[1] = Point(50460, 50660);
    poly11958280.ps[2] = Point(50290, 50660);
    poly11958280.ps[3] = Point(50290, 50490);
    new ShapeRef(router, poly11958280, 11958280);

    Polygon poly50591298(4);
    poly50591298.ps[0] = Point(51260, 50015);
    poly50591298.ps[1] = Point(51260, 50185);
    poly50591298.ps[2] = Point(51075, 50185);
    poly50591298.ps[3] = Point(51075, 50015);
    new ShapeRef(router, poly50591298, 50591298);

    ConnRef *connRef355676284 = new ConnRef(router, 355676284);
    ConnEnd srcPt355676284(Point(51040, 50575), 8);
    connRef355676284->setSourceEndpoint(srcPt355676284);
    ConnEnd dstPt355676284(Point(51085, 50300), 4);
    connRef355676284->setDestEndpoint(dstPt355676284);
    connRef355676284->setRoutingType((ConnType)2);

    ConnRef *connRef33653259 = new ConnRef(router, 33653259);
    ConnEnd srcPt33653259(Point(51040, 50650), 8);
    connRef33653259->setSourceEndpoint(srcPt33653259);
    ConnEnd dstPt33653259(Point(51085, 50375), 4);
    connRef33653259->setDestEndpoint(dstPt33653259);
    connRef33653259->setRoutingType((ConnType)2);

    ConnRef *connRef421608980 = new ConnRef(router, 421608980);
    ConnEnd srcPt421608980(Point(51040, 50500), 8);
    connRef421608980->setSourceEndpoint(srcPt421608980);
    ConnEnd dstPt421608980(Point(51085, 50100), 4);
    connRef421608980->setDestEndpoint(dstPt421608980);
    connRef421608980->setRoutingType((ConnType)2);

    router->processTransaction();
    router->outputDiagram("output/restrictedNudging");

    bool overlap = router->existsOrthogonalTouchingPaths();
    delete router;
    return (overlap) ? 1 : 0;
};
开发者ID:jtiai,项目名称:adaptagrams,代码行数:66,代码来源:restrictedNudging.cpp

示例13: main

int main(void) {
    Router *router = new Router(OrthogonalRouting);
    router->setRoutingParameter((RoutingParameter)0, 50);
    router->setRoutingParameter((RoutingParameter)1, 0);
    router->setRoutingParameter((RoutingParameter)2, 0);
    router->setRoutingParameter((RoutingParameter)3, 4000);
    router->setRoutingParameter((RoutingParameter)4, 0);
    router->setRoutingParameter((RoutingParameter)5, 100);
    router->setRoutingParameter((RoutingParameter)6, 0);
    router->setRoutingParameter((RoutingParameter)7, 4);
    router->setRoutingOption((RoutingOption)0, true);
    router->setRoutingOption((RoutingOption)1, true);
    router->setRoutingOption((RoutingOption)2, false);
    router->setRoutingOption((RoutingOption)3, false);
    
    Polygon poly5(4);
    poly5.ps[0] = Point(365.3425124847556, 152.0752314071785);
    poly5.ps[1] = Point(365.3425124847556, 214.0752314071785);
    poly5.ps[2] = Point(303.3425124847556, 214.0752314071785);
    poly5.ps[3] = Point(303.3425124847556, 152.0752314071785);
    new ShapeRef(router, poly5, 5);
    
    Polygon poly7(4);
    poly7.ps[0] = Point(365.3425124847556, 24.07523140617849);
    poly7.ps[1] = Point(365.3425124847556, 86.07523140617849);
    poly7.ps[2] = Point(303.3425124847556, 86.07523140617849);
    poly7.ps[3] = Point(303.3425124847556, 24.07523140617849);
    new ShapeRef(router, poly7, 7);

    Polygon poly8(4);
    poly8.ps[0] = Point(541.6758458190889, 24.07523140617849);
    poly8.ps[1] = Point(541.6758458190889, 44.07523140617849);
    poly8.ps[2] = Point(509.6758458190889, 44.07523140617849);
    poly8.ps[3] = Point(509.6758458190889, 24.07523140617849);
    new ShapeRef(router, poly8, 8);

    Polygon poly10(4);
    poly10.ps[0] = Point(541.6758458190889, 66.07523140617849);
    poly10.ps[1] = Point(541.6758458190889, 86.07523140617849);
    poly10.ps[2] = Point(509.6758458190889, 86.07523140617849);
    poly10.ps[3] = Point(509.6758458190889, 66.07523140617849);
    new ShapeRef(router, poly10, 10);

    Polygon poly61(4);
    poly61.ps[0] = Point(420.3425124847556, 101.0752314061785);
    poly61.ps[1] = Point(420.3425124847556, 141.0752314061785);
    poly61.ps[2] = Point(344.3425124847556, 141.0752314061785);
    poly61.ps[3] = Point(344.3425124847556, 101.0752314061785);
    new ShapeRef(router, poly61, 61);

    Polygon poly92(4);
    poly92.ps[0] = Point(563.5758458190888, 34.07523140617849);
    poly92.ps[1] = Point(563.5758458190888, 76.07523140617849);
    poly92.ps[2] = Point(487.7758458190889, 76.07523140617849);
    poly92.ps[3] = Point(487.7758458190889, 34.07523140617849);
    new ShapeRef(router, poly92, 92);

    ConnRef *connRef109 = new ConnRef(router, 109);
    ConnEnd srcPt109(Point(510.6758458190889, 34.07523140617849), 4);
    connRef109->setSourceEndpoint(srcPt109);
    ConnEnd dstPt109(Point(334.3425124847556, 183.0752314071785), 15);
    connRef109->setDestEndpoint(dstPt109);
    connRef109->setRoutingType((ConnType)2);
    std::vector<Checkpoint> checkpoints109(1);
    checkpoints109[0] = Checkpoint(Point(487.6758458190889, 55.07523140617849), (ConnDirFlags) 15, (ConnDirFlags) 4);
    connRef109->setRoutingCheckpoints(checkpoints109);

    ConnRef *connRef110 = new ConnRef(router, 110);
    ConnEnd srcPt110(Point(510.6758458190889, 76.07523140617849), 4);
    connRef110->setSourceEndpoint(srcPt110);
    ConnEnd dstPt110(Point(334.3425124847556, 183.0752314071785), 15);
    connRef110->setDestEndpoint(dstPt110);
    connRef110->setRoutingType((ConnType)2);
    std::vector<Checkpoint> checkpoints110(1);
    checkpoints110[0] = Checkpoint(Point(487.6758458190889, 55.07523140617849), (ConnDirFlags) 15, (ConnDirFlags) 4);
    connRef110->setRoutingCheckpoints(checkpoints110);

    router->processTransaction();
    router->outputDiagram("output/checkpoints02");

    bool succeeded = true;
    double checkpointY = 55.07523140617849;
    Avoid::PolyLine route109 = connRef109->displayRoute();
    if (fabs(route109.ps[route109.size() - 3].y - checkpointY) < 2)
    {
        succeeded = false;
    }

    Avoid::PolyLine route110 = connRef110->displayRoute();
    if (fabs(route110.ps[route110.size() - 3].y - checkpointY) < 2)
    {
        succeeded = false;
    }

    delete router;
    return (succeeded) ? 0 : 1;
};
开发者ID:P-N-L,项目名称:adaptagrams,代码行数:97,代码来源:checkpoints02.cpp

示例14: main

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, 110);
    router->setRoutingParameter(idealNudgingDistance, 25);

    Polygon poly143407352(4);
    poly143407352.ps[0] = Point(6035, 4390);
    poly143407352.ps[1] = Point(6035, 5085);
    poly143407352.ps[2] = Point(5675, 5085);
    poly143407352.ps[3] = Point(5675, 4390);
    new ShapeRef(router, poly143407352, 143407352);
    
    Polygon poly124950386(4);
    poly124950386.ps[0] = Point(4900, 4090);
    poly124950386.ps[1] = Point(4900, 4785);
    poly124950386.ps[2] = Point(4540, 4785);
    poly124950386.ps[3] = Point(4540, 4090);
    new ShapeRef(router, poly124950386, 124950386);
    
    ConnRef *connRef373967044 = new ConnRef(router, 373967044);
    ConnEnd srcPt373967044(Point(4890, 4250), 8);
    connRef373967044->setSourceEndpoint(srcPt373967044);
    ConnEnd dstPt373967044(Point(5685, 4550), 4);
    connRef373967044->setDestEndpoint(dstPt373967044);
    connRef373967044->setRoutingType((ConnType)2);

    ConnRef *connRef681881486 = new ConnRef(router, 681881486);
    ConnEnd srcPt681881486(Point(4890, 4325), 8);
    connRef681881486->setSourceEndpoint(srcPt681881486);
    ConnEnd dstPt681881486(Point(5685, 4625), 4);
    connRef681881486->setDestEndpoint(dstPt681881486);
    connRef681881486->setRoutingType((ConnType)2);

    ConnRef *connRef829752 = new ConnRef(router, 829752);
    ConnEnd srcPt829752(Point(4890, 4400), 8);
    connRef829752->setSourceEndpoint(srcPt829752);
    ConnEnd dstPt829752(Point(5685, 4700), 4);
    connRef829752->setDestEndpoint(dstPt829752);
    connRef829752->setRoutingType((ConnType)2);

    ConnRef *connRef17625739 = new ConnRef(router, 17625739);
    ConnEnd srcPt17625739(Point(4890, 4475), 8);
    connRef17625739->setSourceEndpoint(srcPt17625739);
    ConnEnd dstPt17625739(Point(5685, 4775), 4);
    connRef17625739->setDestEndpoint(dstPt17625739);
    connRef17625739->setRoutingType((ConnType)2);

    ConnRef *connRef223864175 = new ConnRef(router, 223864175);
    ConnEnd srcPt223864175(Point(4890, 4550), 8);
    connRef223864175->setSourceEndpoint(srcPt223864175);
    ConnEnd dstPt223864175(Point(5685, 4850), 4);
    connRef223864175->setDestEndpoint(dstPt223864175);
    connRef223864175->setRoutingType((ConnType)2);

    ConnRef *connRef98144280 = new ConnRef(router, 98144280);
    ConnEnd srcPt98144280(Point(4890, 4625), 8);
    connRef98144280->setSourceEndpoint(srcPt98144280);
    ConnEnd dstPt98144280(Point(5685, 4925), 4);
    connRef98144280->setDestEndpoint(dstPt98144280);
    connRef98144280->setRoutingType((ConnType)2);

    ConnRef *connRef283100856 = new ConnRef(router, 283100856);
    ConnEnd srcPt283100856(Point(4890, 4700), 8);
    connRef283100856->setSourceEndpoint(srcPt283100856);
    ConnEnd dstPt283100856(Point(5685, 5000), 4);
    connRef283100856->setDestEndpoint(dstPt283100856);
    connRef283100856->setRoutingType((ConnType)2);

    ConnRef *connRef387080925 = new ConnRef(router, 387080925);
    ConnEnd srcPt387080925(Point(5685, 4475), 4);
    connRef387080925->setSourceEndpoint(srcPt387080925);
    ConnEnd dstPt387080925(Point(4890, 4175), 8);
    connRef387080925->setDestEndpoint(dstPt387080925);
    connRef387080925->setRoutingType((ConnType)2);

    router->processTransaction();
    router->outputInstanceToSVG("output/orthordering-02");
    
    int crossings = router->existsCrossings();

    delete router;
    return (crossings > 0) ? 1 : 0;
};
开发者ID:AidanDelaney,项目名称:adaptagrams,代码行数:88,代码来源:orthordering02.cpp

示例15: main

int main(void) {
    Router *router = new Router(
            PolyLineRouting | OrthogonalRouting);
    router->setRoutingParameter((RoutingParameter)0, 50);
    router->setRoutingParameter((RoutingParameter)1, 0);
    router->setRoutingParameter((RoutingParameter)2, 0);
    router->setRoutingParameter((RoutingParameter)3, 4000);
    router->setRoutingParameter((RoutingParameter)4, 0);
    router->setRoutingParameter((RoutingParameter)5, 100);
    router->setRoutingParameter((RoutingParameter)6, 0);
    router->setRoutingParameter((RoutingParameter)7, 4);
    router->setRoutingOption((RoutingOption)0, true);
    router->setRoutingOption((RoutingOption)1, true);
    router->setRoutingOption((RoutingOption)2, false);
    router->setRoutingOption((RoutingOption)3, false);

    Polygon poly41(4);
    poly41.ps[0] = Point(918.6758458220888, 441.0752314081785);
    poly41.ps[1] = Point(918.6758458220888, 503.0752314081785);
    poly41.ps[2] = Point(856.6758458220888, 503.0752314081785);
    poly41.ps[3] = Point(856.6758458220888, 441.0752314081785);
    new ShapeRef(router, poly41, 41);


    Polygon poly43(4);
    poly43.ps[0] = Point(710.6758458200889, 441.0752314081785);
    poly43.ps[1] = Point(710.6758458200889, 461.0752314081785);
    poly43.ps[2] = Point(678.6758458200889, 461.0752314081785);
    poly43.ps[3] = Point(678.6758458200889, 441.0752314081785);
    new ShapeRef(router, poly43, 43);

    Polygon poly44(4);
    poly44.ps[0] = Point(710.6758458200889, 483.0752314081785);
    poly44.ps[1] = Point(710.6758458200889, 503.0752314081785);
    poly44.ps[2] = Point(678.6758458200889, 503.0752314081785);
    poly44.ps[3] = Point(678.6758458200889, 483.0752314081785);
    new ShapeRef(router, poly44, 44);

    ConnRef *connRef149 = new ConnRef(router, 149);
    ConnEnd srcPt149(Point(709.6758458200889, 451.0752314081785), 8);
    connRef149->setSourceEndpoint(srcPt149);
    ConnEnd dstPt149(Point(887.6758458220888, 472.0752314081786), 15);
    connRef149->setDestEndpoint(dstPt149);
    connRef149->setRoutingType((ConnType)2);
    std::vector<Checkpoint> checkpoints149(1);
    checkpoints149[0] = Checkpoint(Point(732.6758458200889, 472.0752314081785), (ConnDirFlags) 15, (ConnDirFlags) 8);
    connRef149->setRoutingCheckpoints(checkpoints149);

    ConnRef *connRef150 = new ConnRef(router, 150);
    ConnEnd srcPt150(Point(709.6758458200889, 493.0752314081785), 8);
    connRef150->setSourceEndpoint(srcPt150);
    ConnEnd dstPt150(Point(887.6758458220888, 472.0752314081786), 15);
    connRef150->setDestEndpoint(dstPt150);
    connRef150->setRoutingType((ConnType)2);
    std::vector<Checkpoint> checkpoints150(1);
    checkpoints150[0] = Checkpoint(Point(732.6758458200889, 472.0752314081785), (ConnDirFlags) 15, (ConnDirFlags) 8);
    connRef150->setRoutingCheckpoints(checkpoints150);

    router->processTransaction();
    router->outputDiagram("output/checkpoints03");

    bool succeeded = true;
    Avoid::PolyLine route149 = connRef149->displayRoute();
    Avoid::PolyLine route150 = connRef150->displayRoute();
    if (route149.size() > 4 || route150.size() > 4)
    {
	// Five segments weren't merged into three.  The segments in the shape
	// on right weren't shifted to align with the segments going through
	// the checkpoint.
	succeeded = false;
    }
    if (succeeded == true)
    {
	    // The segments were merged by were not centred around the 
	    // checkpoint.
	    double checkpointY = 472.0752314081785;
	    if (fabs(route149.ps[route149.size() - 1].y - checkpointY) < 2)
	    {
		succeeded = false;
	    }

	    if (fabs(route150.ps[route150.size() - 1].y - checkpointY) < 2)
	    {
		succeeded = false;
	    }
    }
    delete router;
    return (succeeded) ? 0 : 1;
};
开发者ID:P-N-L,项目名称:adaptagrams,代码行数:89,代码来源:checkpoints03.cpp


注:本文中的Router::processTransaction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。