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


C++ EDA_DRAW_PANEL_GAL::GetGAL方法代码示例

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


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

示例1: OnRenderColorChange

void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor )
{
    wxASSERT( aId > GAL_LAYER_ID_START && aId < GAL_LAYER_ID_END );

    myframe->Settings().Colors().SetItemColor( static_cast<GAL_LAYER_ID>( aId ), aColor );

    EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();

    if( galCanvas && myframe->IsGalCanvasActive() )
    {
        if( aId == LAYER_GRID )
            galCanvas->GetGAL()->SetGridColor( aColor );

        KIGFX::VIEW* view = galCanvas->GetView();
        view->GetPainter()->GetSettings()->ImportLegacyColors( &myframe->Settings().Colors() );
        view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );   // useful to update rastnest
        view->UpdateLayerColor( aId );

        // plated-through-holes don't have their own color; they use the background color
        if( aId == LAYER_PCB_BACKGROUND )
            view->UpdateLayerColor( LAYER_PADS_PLATEDHOLES );

        galCanvas->ForceRefresh();
    }

    myframe->ReCreateHToolbar();

    myframe->GetCanvas()->Refresh();
}
开发者ID:johnbeard,项目名称:kicad,代码行数:29,代码来源:pcb_layer_widget.cpp

示例2: OnRenderEnable

void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
{
    BOARD*  brd = myframe->GetBoard();
    brd->SetElementVisibility( aId, isEnabled );

    EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
    if( galCanvas )
    {
        if( aId == GRID_VISIBLE )
        {
            galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
            galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
        }
        else
            galCanvas->GetView()->SetLayerVisible( ITEM_GAL_LAYER( aId ), isEnabled );
    }

    if( galCanvas && myframe->IsGalCanvasActive() )
        galCanvas->Refresh();
    else
        myframe->GetCanvas()->Refresh();
}
开发者ID:johnbeard,项目名称:kicad-source-mirror,代码行数:22,代码来源:class_pcb_layer_widget.cpp

示例3: OnRenderEnable

void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
{
    BOARD*  brd = myframe->GetBoard();
    wxASSERT( aId > GAL_LAYER_ID_START && aId < GAL_LAYER_ID_END );

    if( myframe->IsType( FRAME_PCB ) )
    {
        // The layer visibility status is saved in the board file so set the board
        // modified state so the user has the option to save the changes.
        if( brd->IsElementVisible( static_cast<GAL_LAYER_ID>( aId ) ) != isEnabled )
            myframe->OnModify();
    }

    brd->SetElementVisibility( static_cast<GAL_LAYER_ID>( aId ), isEnabled );

    EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();

    if( galCanvas && myframe->IsGalCanvasActive() )
    {
        if( aId == LAYER_GRID )
        {
            galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
            galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
        }
        else if( aId == LAYER_RATSNEST )
        {
            // don't touch the layers. ratsnest is enabled on per-item basis.
            galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
            galCanvas->GetView()->SetLayerVisible( aId, true );
        }
        else
            galCanvas->GetView()->SetLayerVisible( aId, isEnabled );

        galCanvas->Refresh();
    }

    myframe->GetCanvas()->Refresh();
}
开发者ID:johnbeard,项目名称:kicad,代码行数:38,代码来源:pcb_layer_widget.cpp


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