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


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

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


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

示例2: handleSettingChange

void SPAvoidRef::handleSettingChange(void)
{
    SPDesktop *desktop = inkscape_active_desktop();
    if (desktop == NULL) {
        return;
    }
    if (sp_desktop_document(desktop) != item->document) {
        // We don't want to go any further if the active desktop's document
        // isn't the same as the document that this item is part of.  This
        // case can happen if a new document is loaded from the file chooser
        // or via the recent file menu.  In this case, we can end up here
        // as a rersult of a ensureUpToDate performed on a
        // document not yet attached to the active desktop.
        return;
    }

    if (new_setting == setting) {
        // Don't need to make any changes
        return;
    }
    setting = new_setting;

    Router *router = item->document->router;

    _transformed_connection.disconnect();
    if (new_setting) {
        Avoid::Polygon poly = avoid_item_poly(item);
        if (poly.size() > 0) {
            _transformed_connection = item->connectTransformed(
                    sigc::ptr_fun(&avoid_item_move));

            char const *id = item->getAttribute("id");
            g_assert(id != NULL);

            // Get a unique ID for the item.
            GQuark itemID = g_quark_from_string(id);

            shapeRef = new Avoid::ShapeRef(router, poly, itemID);

            router->addShape(shapeRef);
        }
    }
    else
    {
        g_assert(shapeRef);

        // Deleting the shapeRef will remove it completely from 
        // an existing Router instance.
        delete shapeRef;
        shapeRef = NULL;
    }
}
开发者ID:Grandrogue,项目名称:inkscape_metal,代码行数:52,代码来源:conn-avoid-ref.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, 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

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

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

示例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, 200);
    router->setRoutingPenalty((PenaltyType)3, 4000);
    router->setRoutingPenalty((PenaltyType)4, 110);
    router->setOrthogonalNudgeDistance(25);

    Polygon poly219926511(4);
    poly219926511.ps[0] = Point(50760, 51240);
    poly219926511.ps[1] = Point(50760, 51260);
    poly219926511.ps[2] = Point(50740, 51260);
    poly219926511.ps[3] = Point(50740, 51240);
    ShapeRef *shapeRef219926511 = new ShapeRef(router, poly219926511, 219926511);
    router->addShape(shapeRef219926511);
    new ShapeConnectionPin(shapeRef219926511, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 4);
    new ShapeConnectionPin(shapeRef219926511, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 1);
    new ShapeConnectionPin(shapeRef219926511, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 8);
    new ShapeConnectionPin(shapeRef219926511, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 2);

    Polygon poly171026375(4);
    poly171026375.ps[0] = Point(51085, 51215);
    poly171026375.ps[1] = Point(51085, 51235);
    poly171026375.ps[2] = Point(51065, 51235);
    poly171026375.ps[3] = Point(51065, 51215);
    ShapeRef *shapeRef171026375 = new ShapeRef(router, poly171026375, 171026375);
    router->addShape(shapeRef171026375);
    new ShapeConnectionPin(shapeRef171026375, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 4);
    new ShapeConnectionPin(shapeRef171026375, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 1);
    new ShapeConnectionPin(shapeRef171026375, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 8);
    new ShapeConnectionPin(shapeRef171026375, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 2);

    Polygon poly878674(4);
    poly878674.ps[0] = Point(51454, 51200);
    poly878674.ps[1] = Point(51454, 51285);
    poly878674.ps[2] = Point(51396, 51285);
    poly878674.ps[3] = Point(51396, 51200);
    ShapeRef *shapeRef878674 = new ShapeRef(router, poly878674, 878674);
    router->addShape(shapeRef878674);

    Polygon poly286906544(4);
    poly286906544.ps[0] = Point(50704, 51250);
    poly286906544.ps[1] = Point(50704, 51335);
    poly286906544.ps[2] = Point(50646, 51335);
    poly286906544.ps[3] = Point(50646, 51250);
    ShapeRef *shapeRef286906544 = new ShapeRef(router, poly286906544, 286906544);
    router->addShape(shapeRef286906544);

    Polygon poly170813081(4);
    poly170813081.ps[0] = Point(51104, 51090);
    poly170813081.ps[1] = Point(51104, 51175);
    poly170813081.ps[2] = Point(51046, 51175);
    poly170813081.ps[3] = Point(51046, 51090);
    ShapeRef *shapeRef170813081 = new ShapeRef(router, poly170813081, 170813081);
    router->addShape(shapeRef170813081);

    Polygon poly342721632(4);
    poly342721632.ps[0] = Point(51910, 50946);
    poly342721632.ps[1] = Point(51910, 51004);
    poly342721632.ps[2] = Point(51825, 51004);
    poly342721632.ps[3] = Point(51825, 50946);
    ShapeRef *shapeRef342721632 = new ShapeRef(router, poly342721632, 342721632);
    router->addShape(shapeRef342721632);

    Polygon poly223927132(4);
    poly223927132.ps[0] = Point(51510, 51190);
    poly223927132.ps[1] = Point(51510, 51210);
    poly223927132.ps[2] = Point(51490, 51210);
    poly223927132.ps[3] = Point(51490, 51190);
    ShapeRef *shapeRef223927132 = new ShapeRef(router, poly223927132, 223927132);
    router->addShape(shapeRef223927132);
    new ShapeConnectionPin(shapeRef223927132, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 4);
    new ShapeConnectionPin(shapeRef223927132, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 1);
    new ShapeConnectionPin(shapeRef223927132, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 8);
    new ShapeConnectionPin(shapeRef223927132, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 2);

    Polygon poly102578723(4);
    poly102578723.ps[0] = Point(51285, 50715);
    poly102578723.ps[1] = Point(51285, 50735);
    poly102578723.ps[2] = Point(51265, 50735);
    poly102578723.ps[3] = Point(51265, 50715);
    ShapeRef *shapeRef102578723 = new ShapeRef(router, poly102578723, 102578723);
    router->addShape(shapeRef102578723);
    new ShapeConnectionPin(shapeRef102578723, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 4);
    new ShapeConnectionPin(shapeRef102578723, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 1);
    new ShapeConnectionPin(shapeRef102578723, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 8);
    new ShapeConnectionPin(shapeRef102578723, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 2);

    Polygon poly17922268(4);
    poly17922268.ps[0] = Point(50860, 50965);
    poly17922268.ps[1] = Point(50860, 50985);
    poly17922268.ps[2] = Point(50840, 50985);
    poly17922268.ps[3] = Point(50840, 50965);
    ShapeRef *shapeRef17922268 = new ShapeRef(router, poly17922268, 17922268);
    router->addShape(shapeRef17922268);
    new ShapeConnectionPin(shapeRef17922268, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 4);
    new ShapeConnectionPin(shapeRef17922268, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 1);
    new ShapeConnectionPin(shapeRef17922268, 2147483646, 0.5, 0.5, 0, (ConnDirFlags) 8);
//.........这里部分代码省略.........
开发者ID:TheProjecter,项目名称:pockemul,代码行数:101,代码来源:connectionpin03.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, 0);
    router->setRoutingPenalty((PenaltyType)3, 4000);
    router->setRoutingPenalty((PenaltyType)4, 110);
    router->setOrthogonalNudgeDistance(25);

    Polygon poly426345871(4);
    poly426345871.ps[0] = Point(7200, 5240);
    poly426345871.ps[1] = Point(7200, 5660);
    poly426345871.ps[2] = Point(6690, 5660);
    poly426345871.ps[3] = Point(6690, 5240);
    ShapeRef *shapeRef426345871 = new ShapeRef(router, poly426345871, 426345871);
    router->addShape(shapeRef426345871);

    Polygon poly596896212(4);
    poly596896212.ps[0] = Point(7200, 5740);
    poly596896212.ps[1] = Point(7200, 6160);
    poly596896212.ps[2] = Point(6690, 6160);
    poly596896212.ps[3] = Point(6690, 5740);
    ShapeRef *shapeRef596896212 = new ShapeRef(router, poly596896212, 596896212);
    router->addShape(shapeRef596896212);

    ConnRef *connRef20026701 = new ConnRef(router, 20026701);
    ConnEnd srcPt20026701(Point(7190, 5600), 8);
    connRef20026701->setSourceEndpoint(srcPt20026701);
    ConnEnd dstPt20026701(Point(7190, 5800), 8);
    connRef20026701->setDestEndpoint(dstPt20026701);
    connRef20026701->setRoutingType((ConnType)2);

    ConnRef *connRef124776000 = new ConnRef(router, 124776000);
    ConnEnd srcPt124776000(Point(7190, 5550), 8);
    connRef124776000->setSourceEndpoint(srcPt124776000);
    ConnEnd dstPt124776000(Point(7190, 5850), 8);
    connRef124776000->setDestEndpoint(dstPt124776000);
    connRef124776000->setRoutingType((ConnType)2);

    ConnRef *connRef162425002 = new ConnRef(router, 162425002);
    ConnEnd srcPt162425002(Point(7190, 5500), 8);
    connRef162425002->setSourceEndpoint(srcPt162425002);
    ConnEnd dstPt162425002(Point(7190, 5900), 8);
    connRef162425002->setDestEndpoint(dstPt162425002);
    connRef162425002->setRoutingType((ConnType)2);

    ConnRef *connRef445102866 = new ConnRef(router, 445102866);
    ConnEnd srcPt445102866(Point(7190, 5450), 8);
    connRef445102866->setSourceEndpoint(srcPt445102866);
    ConnEnd dstPt445102866(Point(7190, 5950), 8);
    connRef445102866->setDestEndpoint(dstPt445102866);
    connRef445102866->setRoutingType((ConnType)2);

    ConnRef *connRef472520508 = new ConnRef(router, 472520508);
    ConnEnd srcPt472520508(Point(7190, 5400), 8);
    connRef472520508->setSourceEndpoint(srcPt472520508);
    ConnEnd dstPt472520508(Point(7190, 6000), 8);
    connRef472520508->setDestEndpoint(dstPt472520508);
    connRef472520508->setRoutingType((ConnType)2);

    ConnRef *connRef406587600 = new ConnRef(router, 406587600);
    ConnEnd srcPt406587600(Point(7190, 5350), 8);
    connRef406587600->setSourceEndpoint(srcPt406587600);
    ConnEnd dstPt406587600(Point(7190, 6050), 8);
    connRef406587600->setDestEndpoint(dstPt406587600);
    connRef406587600->setRoutingType((ConnType)2);

    ConnRef *connRef41657796 = new ConnRef(router, 41657796);
    ConnEnd srcPt41657796(Point(7190, 5300), 8);
    connRef41657796->setSourceEndpoint(srcPt41657796);
    ConnEnd dstPt41657796(Point(7190, 6100), 8);
    connRef41657796->setDestEndpoint(dstPt41657796);
    connRef41657796->setRoutingType((ConnType)2);

    router->processTransaction();
    router->outputInstanceToSVG("test-nudgeold");
    delete router;
    return 0;
};
开发者ID:TheProjecter,项目名称:pockemul,代码行数:80,代码来源:nudgeold.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, 400);
    router->setRoutingPenalty((PenaltyType)3, 4000);
    router->setRoutingPenalty((PenaltyType)4, 110);
    router->setOrthogonalNudgeDistance(25);

    Polygon poly143407352(4);
    poly143407352.ps[0] = Point(5810, 4340);
    poly143407352.ps[1] = Point(5810, 5035);
    poly143407352.ps[2] = Point(5450, 5035);
    poly143407352.ps[3] = Point(5450, 4340);
    ShapeRef *shapeRef143407352 = new ShapeRef(router, poly143407352, 143407352);
    router->addShape(shapeRef143407352);

    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);
    ShapeRef *shapeRef124950386 = new ShapeRef(router, poly124950386, 124950386);
    router->addShape(shapeRef124950386);

    ConnRef *connRef373967044 = new ConnRef(router, 373967044);
    ConnEnd srcPt373967044(Point(4890, 4250), 8);
    connRef373967044->setSourceEndpoint(srcPt373967044);
    ConnEnd dstPt373967044(Point(5460, 4500), 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(5460, 4575), 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(5460, 4650), 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(5460, 4725), 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(5460, 4800), 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(5460, 4875), 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(5460, 4950), 4);
    connRef283100856->setDestEndpoint(dstPt283100856);
    connRef283100856->setRoutingType((ConnType)2);

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

    router->processTransaction();
    router->outputInstanceToSVG("test-orthordering-01");
    int crossings = router->existsOrthogonalCrossings();
    delete router;
    return (crossings > 0) ? 1 : 0;
};
开发者ID:TheProjecter,项目名称:pockemul,代码行数:88,代码来源:orthordering01.cpp


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