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


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

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


在下文中一共展示了Router::setRoutingParameter方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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->setRoutingParameter(idealNudgingDistance, 25);

    JunctionRef *junction478845150 = new JunctionRef(router, Point(50700, 51075));
    
    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(junction478845150);
    //ConnEnd dstPt352019675(Point(50700, 51075), 15);
    new ConnRef(router, srcPt352019675, dstPt352019675, 352019675);
    ConnEnd srcPt42699400(junction478845150);
    //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(junction478845150);
    //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("output/junction02-1");
    router->moveJunction(junction478845150, 585, 0);
    router->processTransaction();
    router->outputInstanceToSVG("output/junction02-2");
    delete router;
    return 0;
};
开发者ID:AidanDelaney,项目名称:adaptagrams,代码行数:52,代码来源:junction02.cpp

示例2: 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

示例3: 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

示例4: 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

示例5: main

int main(void) {
    Router *router = new Router(OrthogonalRouting);
    router->setRoutingParameter((RoutingParameter)0, 10);
    router->setRoutingParameter((RoutingParameter)1, 0);
    router->setRoutingParameter((RoutingParameter)2, 1000);
    router->setRoutingParameter((RoutingParameter)3, 4000);
    router->setRoutingParameter((RoutingParameter)4, 0);
    router->setRoutingParameter((RoutingParameter)5, 100);
    router->setRoutingParameter((RoutingParameter)6, 1);
    router->setRoutingParameter((RoutingParameter)7, 10);
    router->setRoutingParameter(reverseDirectionPenalty, 500);
    router->setRoutingOption((RoutingOption)0, false);
    router->setRoutingOption((RoutingOption)1, true);
    router->setRoutingOption((RoutingOption)2, false);
    router->setRoutingOption((RoutingOption)3, false);
    router->setRoutingOption((RoutingOption)4, true);
    router->setRoutingOption((RoutingOption)5, true);
    Polygon polygon;
    ConnRef *connRef = NULL;
    ConnEnd srcPt;
    ConnEnd dstPt;
    PolyLine newRoute;
    // shapeRef1
    polygon = Polygon(4);
    polygon.ps[0] = Point(0, 0);
    polygon.ps[1] = Point(0, 0);
    polygon.ps[2] = Point(0, 0);
    polygon.ps[3] = Point(0, 0);
    new ShapeRef(router, polygon, 1);

    // shapeRef2
    polygon = Polygon(4);
    polygon.ps[0] = Point(0, 0);
    polygon.ps[1] = Point(0, 0);
    polygon.ps[2] = Point(0, 0);
    polygon.ps[3] = Point(0, 0);
    new ShapeRef(router, polygon, 2);

    // shapeRef3
    polygon = Polygon(4);
    polygon.ps[0] = Point(0, 0);
    polygon.ps[1] = Point(0, 0);
    polygon.ps[2] = Point(0, 0);
    polygon.ps[3] = Point(0, 0);
    new ShapeRef(router, polygon, 3);

    // shapeRef4
    polygon = Polygon(4);
    polygon.ps[0] = Point(0, 0);
    polygon.ps[1] = Point(0, 0);
    polygon.ps[2] = Point(0, 0);
    polygon.ps[3] = Point(0, 0);
    new ShapeRef(router, polygon, 4);

    // shapeRef5
    polygon = Polygon(4);
    polygon.ps[0] = Point(501, 345);
    polygon.ps[1] = Point(501, 404);
    polygon.ps[2] = Point(421, 404);
    polygon.ps[3] = Point(421, 345);
    ShapeRef *shapeRef5 = new ShapeRef(router, polygon, 5);
    new ShapeConnectionPin(shapeRef5, 5, 1, 0.652542, true, 0, (ConnDirFlags) 8);
    new ShapeConnectionPin(shapeRef5, 6, 0, 0.79096, true, 0, (ConnDirFlags) 4);
    new ShapeConnectionPin(shapeRef5, 7, 0, 0.514124, true, 0, (ConnDirFlags) 4);

    // shapeRef6
    polygon = Polygon(4);
    polygon.ps[0] = Point(94, 251.5);
    polygon.ps[1] = Point(94, 315.5);
    polygon.ps[2] = Point(12, 315.5);
    polygon.ps[3] = Point(12, 251.5);
    ShapeRef *shapeRef6 = new ShapeRef(router, polygon, 6);
    new ShapeConnectionPin(shapeRef6, 8, 1, 0.640625, true, 0, (ConnDirFlags) 8);
    new ShapeConnectionPin(shapeRef6, 9, 0, 0.640625, true, 0, (ConnDirFlags) 4);

    // shapeRef7
    polygon = Polygon(4);
    polygon.ps[0] = Point(634.366, 262);
    polygon.ps[1] = Point(634.366, 305);
    polygon.ps[2] = Point(416.366, 305);
    polygon.ps[3] = Point(416.366, 262);
    ShapeRef *shapeRef7 = new ShapeRef(router, polygon, 7);
    new ShapeConnectionPin(shapeRef7, 10, 1, 0.709302, true, 0, (ConnDirFlags) 8);
    new ShapeConnectionPin(shapeRef7, 11, 0, 0.709302, true, 0, (ConnDirFlags) 4);

    // shapeRef8
    polygon = Polygon(4);
    polygon.ps[0] = Point(324, 147.167);
    polygon.ps[1] = Point(324, 206.167);
    polygon.ps[2] = Point(236, 206.167);
    polygon.ps[3] = Point(236, 147.167);
    ShapeRef *shapeRef8 = new ShapeRef(router, polygon, 8);
    new ShapeConnectionPin(shapeRef8, 12, 1, 0.652542, true, 0, (ConnDirFlags) 8);
    new ShapeConnectionPin(shapeRef8, 13, 0, 0.79096, true, 0, (ConnDirFlags) 4);
    new ShapeConnectionPin(shapeRef8, 14, 0, 0.514124, true, 0, (ConnDirFlags) 4);

    // shapeRef9
    polygon = Polygon(4);
    polygon.ps[0] = Point(816, 353.167);
    polygon.ps[1] = Point(816, 412.167);
//.........这里部分代码省略.........
开发者ID:P-N-L,项目名称:adaptagrams,代码行数:101,代码来源:forwardFlowingConnectors01.cpp

示例6: 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

示例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, 9000);
    router->setRoutingPenalty((PenaltyType)5, 100);
    router->setRoutingOption((RoutingOption)0, false);
    router->setRoutingOption((RoutingOption)1, true);
    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);
//.........这里部分代码省略.........
开发者ID:AidanDelaney,项目名称:adaptagrams,代码行数:101,代码来源:improveHyperedge04.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, 200);
    router->setRoutingPenalty((PenaltyType)3, 4000);
    router->setRoutingPenalty((PenaltyType)4, 110);
    router->setRoutingPenalty((PenaltyType)5, 100);
    router->setRoutingOption((RoutingOption)0, false);
    router->setRoutingOption((RoutingOption)1, true);
    router->setRoutingParameter(idealNudgingDistance, 25);

    Polygon poly3075375(4);
    poly3075375.ps[0] = Point(51925, 52070);
    poly3075375.ps[1] = Point(51925, 52130);
    poly3075375.ps[2] = Point(51725, 52130);
    poly3075375.ps[3] = Point(51725, 52070);
    new ShapeRef(router, poly3075375, 3075375);

    Polygon poly101599344(4);
    poly101599344.ps[0] = Point(50275, 52410);
    poly101599344.ps[1] = Point(50275, 52490);
    poly101599344.ps[2] = Point(50075, 52490);
    poly101599344.ps[3] = Point(50075, 52410);
    new ShapeRef(router, poly101599344, 101599344);

    Polygon poly127957550(4);
    poly127957550.ps[0] = Point(52010, 51617);
    poly127957550.ps[1] = Point(52010, 51683);
    poly127957550.ps[2] = Point(51890, 51683);
    poly127957550.ps[3] = Point(51890, 51617);
    ShapeRef *shapeRef127957550 = new ShapeRef(router, poly127957550, 127957550);
    new ShapeConnectionPin(shapeRef127957550, 2147483646, 0.5, 0.5, true, 0, (ConnDirFlags) 1);
    new ShapeConnectionPin(shapeRef127957550, 2147483646, 0.5, 0.5, true, 0, (ConnDirFlags) 2);
    new ShapeConnectionPin(shapeRef127957550, 2147483646, 0.5, 0.5, true, 0, (ConnDirFlags) 4);
    new ShapeConnectionPin(shapeRef127957550, 2147483646, 0.5, 0.5, true, 0, (ConnDirFlags) 8);

    Polygon poly129612347(4);
    poly129612347.ps[0] = Point(51900, 51696);
    poly129612347.ps[1] = Point(51900, 51754);
    poly129612347.ps[2] = Point(51815, 51754);
    poly129612347.ps[3] = Point(51815, 51696);
    new ShapeRef(router, poly129612347, 129612347);

    Polygon poly203389050(4);
    poly203389050.ps[0] = Point(51825, 52260);
    poly203389050.ps[1] = Point(51825, 52340);
    poly203389050.ps[2] = Point(51625, 52340);
    poly203389050.ps[3] = Point(51625, 52260);
    new ShapeRef(router, poly203389050, 203389050);

    Polygon poly208676910(4);
    poly208676910.ps[0] = Point(51950, 51760);
    poly208676910.ps[1] = Point(51950, 51840);
    poly208676910.ps[2] = Point(51750, 51840);
    poly208676910.ps[3] = Point(51750, 51760);
    new ShapeRef(router, poly208676910, 208676910);

    Polygon poly219117032(4);
    poly219117032.ps[0] = Point(50225, 52070);
    poly219117032.ps[1] = Point(50225, 52130);
    poly219117032.ps[2] = Point(50025, 52130);
    poly219117032.ps[3] = Point(50025, 52070);
    new ShapeRef(router, poly219117032, 219117032);

    Polygon poly258454350(4);
    poly258454350.ps[0] = Point(50185, 51617);
    poly258454350.ps[1] = Point(50185, 51683);
    poly258454350.ps[2] = Point(50065, 51683);
    poly258454350.ps[3] = Point(50065, 51617);
    ShapeRef *shapeRef258454350 = new ShapeRef(router, poly258454350, 258454350);
    new ShapeConnectionPin(shapeRef258454350, 2147483646, 0.5, 0.5, true, 0, (ConnDirFlags) 1);
    new ShapeConnectionPin(shapeRef258454350, 2147483646, 0.5, 0.5, true, 0, (ConnDirFlags) 2);
    new ShapeConnectionPin(shapeRef258454350, 2147483646, 0.5, 0.5, true, 0, (ConnDirFlags) 4);
    new ShapeConnectionPin(shapeRef258454350, 2147483646, 0.5, 0.5, true, 0, (ConnDirFlags) 8);

    Polygon poly274504590(4);
    poly274504590.ps[0] = Point(51400, 52470);
    poly274504590.ps[1] = Point(51400, 52530);
    poly274504590.ps[2] = Point(51150, 52530);
    poly274504590.ps[3] = Point(51150, 52470);
    new ShapeRef(router, poly274504590, 274504590);

    Polygon poly320957826(4);
    poly320957826.ps[0] = Point(50275, 51910);
    poly320957826.ps[1] = Point(50275, 51990);
    poly320957826.ps[2] = Point(50075, 51990);
    poly320957826.ps[3] = Point(50075, 51910);
    new ShapeRef(router, poly320957826, 320957826);

    Polygon poly368436384(4);
    poly368436384.ps[0] = Point(50325, 51696);
    poly368436384.ps[1] = Point(50325, 51754);
    poly368436384.ps[2] = Point(50240, 51754);
    poly368436384.ps[3] = Point(50240, 51696);
    new ShapeRef(router, poly368436384, 368436384);

    Polygon poly381499178(4);
    poly381499178.ps[0] = Point(51850, 51345);
//.........这里部分代码省略.........
开发者ID:P-N-L,项目名称:adaptagrams,代码行数:101,代码来源:validPaths01.cpp

示例9: 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

示例10: main

int main(void) {
    Router *router = new Router(OrthogonalRouting);
    router->setRoutingParameter((RoutingParameter)0, 2);
    router->setRoutingParameter((RoutingParameter)1, 0);
    router->setRoutingParameter((RoutingParameter)2, 0);
    router->setRoutingParameter((RoutingParameter)3, 4000);
    router->setRoutingParameter((RoutingParameter)4, 9000);
    router->setRoutingParameter((RoutingParameter)5, 0);
    router->setRoutingParameter((RoutingParameter)6, 0);
    router->setRoutingParameter((RoutingParameter)7, 16);
    router->setRoutingParameter((RoutingParameter)8, 0);
    router->setRoutingOption((RoutingOption)0, false);
    router->setRoutingOption((RoutingOption)1, true);
    router->setRoutingOption((RoutingOption)2, false);
    router->setRoutingOption((RoutingOption)3, false);
    router->setRoutingOption((RoutingOption)4, true);
    router->setRoutingOption((RoutingOption)5, false);
    router->setRoutingOption((RoutingOption)6, true);
    Polygon polygon;
    ConnEnd srcPt;
    ConnEnd dstPt;
    ConnEnd heConnPt;
    PolyLine newRoute;
    ShapeConnectionPin *connPin = NULL;

    // shapeRef1
    polygon = Polygon(4);
    polygon.ps[0] = Point(450, 330);
    polygon.ps[1] = Point(490, 330);
    polygon.ps[2] = Point(490, 450);
    polygon.ps[3] = Point(450, 450);
    ShapeRef *shapeRef1 = new ShapeRef(router, polygon, 1);
    connPin = new ShapeConnectionPin(shapeRef1, 1, 0, 0.333333, true, 10, (ConnDirFlags) 0);
    connPin->setExclusive(false);
    connPin = new ShapeConnectionPin(shapeRef1, 2, 0, 0.666667, true, 10, (ConnDirFlags) 0);
    connPin->setExclusive(false);
    connPin = new ShapeConnectionPin(shapeRef1, 3, 1, 0.5, true, 10, (ConnDirFlags) 0);
    connPin->setExclusive(false);
    connPin = new ShapeConnectionPin(shapeRef1, 4, 0.5, 0, true, 10, (ConnDirFlags) 0);
    connPin->setExclusive(false);

    // shapeRef8
    polygon = Polygon(4);
    polygon.ps[0] = Point(502, 237.5);
    polygon.ps[1] = Point(502, 262.5);
    polygon.ps[2] = Point(438, 262.5);
    polygon.ps[3] = Point(438, 237.5);
    ShapeRef *shapeRef8 = new ShapeRef(router, polygon, 8);
    connPin = new ShapeConnectionPin(shapeRef8, 1, 0, 0.5, true, 1, (ConnDirFlags) 0);
    connPin = new ShapeConnectionPin(shapeRef8, 2, 1, 0.5, true, 1, (ConnDirFlags) 0);
    connPin = new ShapeConnectionPin(shapeRef8, 3, 0.5, 1, true, 1, (ConnDirFlags) 0);
    connPin = new ShapeConnectionPin(shapeRef8, 4, 0.5, 0, true, 1, (ConnDirFlags) 0);

    JunctionRef *junctionRef6 = new JunctionRef(router, Point(470, 300), 6);
    /*
    // This may be useful if junction pins are modified.
    connPin = new ShapeConnectionPin(junctionRef6, 2147483646, (ConnDirFlags) 15);
    */

    // connRef9
    ConnRef *connRef9 = new ConnRef(router, 9);
    srcPt = ConnEnd(junctionRef6);
    connRef9->setSourceEndpoint(srcPt);
    dstPt = ConnEnd(shapeRef8, 3);
    connRef9->setDestEndpoint(dstPt);
    connRef9->setRoutingType((ConnType)2);

#if 1
    // connRef10 - WITH BUG
    ConnRef *connRef10 = new ConnRef(router, 10);
    srcPt = ConnEnd(junctionRef6);
    connRef10->setSourceEndpoint(srcPt);
    dstPt = ConnEnd(shapeRef1, 4);
    connRef10->setDestEndpoint(dstPt);
    connRef10->setRoutingType((ConnType)2);
#else
    // connRef10 - WITHOUT BUG
    ConnRef *connRef10 = new ConnRef(router, 10);
    srcPt = ConnEnd(shapeRef1, 4);
    connRef10->setSourceEndpoint(srcPt);
    dstPt = ConnEnd(junctionRef6);
    connRef10->setDestEndpoint(dstPt);
    connRef10->setRoutingType((ConnType)2);
#endif

    //    router->deleteConnector(connRef5);
    router->processTransaction();

    ConnRef *mergedConn = junctionRef6->removeJunctionAndMergeConnectors();
    router->processTransaction();
    router->outputDiagram("output/removeJunctions01");

    std::pair<ConnEnd, ConnEnd> ends = mergedConn->endpointConnEnds();

    // Expected result: output images should be virtually identical.
    // Result: An endpoint seems to be disconnected from shapeRef8.
    bool isConnected = (ends.first.shape() == shapeRef8) || (ends.second.shape() == shapeRef8);

    delete router;
    return isConnected ? 0 : 1;
//.........这里部分代码省略.........
开发者ID:jtiai,项目名称:adaptagrams,代码行数:101,代码来源:removeJunctions01.cpp

示例11: 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


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