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


C++ SCH_LINE::MergeOverlap方法代码示例

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


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

示例1: SchematicCleanUp

bool SCH_SCREEN::SchematicCleanUp()
{
    bool      modified = false;

    for( SCH_ITEM* item = m_drawList.begin() ; item; item = item->Next() )
    {
        if( ( item->Type() != SCH_LINE_T ) && ( item->Type() != SCH_JUNCTION_T ) )
            continue;

        bool restart;

        for( SCH_ITEM* testItem = item->Next(); testItem; testItem = restart ? m_drawList.begin() : testItem->Next() )
        {
            restart = false;

            if( ( item->Type() == SCH_LINE_T ) && ( testItem->Type() == SCH_LINE_T ) )
            {
                SCH_LINE* line = (SCH_LINE*) item;

                if( line->MergeOverlap( (SCH_LINE*) testItem ) )
                {
                    // Keep the current flags, because the deleted segment can be flagged.
                    item->SetFlags( testItem->GetFlags() );
                    DeleteItem( testItem );
                    restart = true;
                    modified = true;
                }
            }
            else if ( ( ( item->Type() == SCH_JUNCTION_T )
                      && ( testItem->Type() == SCH_JUNCTION_T ) ) && ( testItem != item ) )
            {
                if ( testItem->HitTest( item->GetPosition() ) )
                {
                    // Keep the current flags, because the deleted segment can be flagged.
                    item->SetFlags( testItem->GetFlags() );
                    DeleteItem( testItem );
                    restart = true;
                    modified = true;
                }
            }
        }
    }

    TestDanglingEnds();

    return modified;
}
开发者ID:RyuKojiro,项目名称:kicad-source-mirror,代码行数:47,代码来源:sch_screen.cpp

示例2: SchematicCleanUp

bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
{
    SCH_ITEM* item, * testItem;
    bool      modified = false;

    item = m_drawList.begin();

    for( ; item; item = item->Next() )
    {
        if( ( item->Type() != SCH_LINE_T ) && ( item->Type() != SCH_JUNCTION_T ) )
            continue;

        testItem = item->Next();

        while( testItem )
        {
            if( ( item->Type() == SCH_LINE_T ) && ( testItem->Type() == SCH_LINE_T ) )
            {
                SCH_LINE* line = (SCH_LINE*) item;

                if( line->MergeOverlap( (SCH_LINE*) testItem ) )
                {
                    // Keep the current flags, because the deleted segment can be flagged.
                    item->SetFlags( testItem->GetFlags() );
                    DeleteItem( testItem );
                    testItem = m_drawList.begin();
                    modified = true;
                }
                else
                {
                    testItem = testItem->Next();
                }
            }
            else if ( ( ( item->Type() == SCH_JUNCTION_T ) && ( testItem->Type() == SCH_JUNCTION_T ) ) && ( testItem != item ) )
            {
                if ( testItem->HitTest( item->GetPosition() ) )
                {
                    // Keep the current flags, because the deleted segment can be flagged.
                    item->SetFlags( testItem->GetFlags() );
                    DeleteItem( testItem );
                    testItem = m_drawList.begin();
                    modified = true;
                }
                else
                {
                    testItem = testItem->Next();
                }
            }
            else
            {
                testItem = testItem->Next();
            }
        }
    }

    TestDanglingEnds( aCanvas, aDC );

    if( aCanvas && modified )
        aCanvas->Refresh();

    return modified;
}
开发者ID:hzeller,项目名称:kicad-source-mirror,代码行数:62,代码来源:sch_screen.cpp


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