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


C++ VIEW::UpdateLayerColor方法代码示例

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


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

void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
{
    // Avoid setting the alpha channel, when we are in legacy mode,
    // because in legacy mode the alpha channel is not used, but changing it
    // destroys the GAL color setup
    if( !myframe->IsGalCanvasActive() )
    {
        COLOR4D oldColor = myframe->Settings().Colors().GetLayerColor( aLayer );
        aColor.a = oldColor.a;
    }

    myframe->Settings().Colors().SetLayerColor( aLayer, aColor );

    if( myframe->IsGalCanvasActive() )
    {
        KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
        view->GetPainter()->GetSettings()->ImportLegacyColors( &myframe->Settings().Colors() );
        view->UpdateLayerColor( aLayer );
        view->UpdateLayerColor( GetNetnameLayer( aLayer ) );
    }

    myframe->ReCreateHToolbar();

    myframe->GetCanvas()->Refresh();

    if( aLayer == LAYER_PCB_BACKGROUND )
        myframe->SetDrawBgColor( aColor );
}
开发者ID:johnbeard,项目名称:kicad,代码行数:28,代码来源:pcb_layer_widget.cpp

示例3: OnLayerColorChange

void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, EDA_COLOR_T aColor )
{
    myframe->GetBoard()->SetLayerColor( ToLAYER_ID( aLayer ), aColor );

    if( myframe->IsGalCanvasActive() )
    {
        KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
        view->GetPainter()->GetSettings()->ImportLegacyColors( myframe->GetBoard()->GetColorsSettings() );
        view->UpdateLayerColor( aLayer );
    }

    myframe->GetCanvas()->Refresh();
}
开发者ID:michaellis,项目名称:kicad-source-mirror,代码行数:13,代码来源:class_pcb_layer_widget.cpp

示例4: OnLayerColorChange

void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
{
    // NOTE: Active layer in GerbView is stored as 0-indexed, but layer color is
    //       stored according to the GERBER_DRAW_LAYER() offset.

    myframe->SetLayerColor( GERBER_DRAW_LAYER( aLayer ), aColor );
    myframe->m_SelLayerBox->ResyncBitmapOnly();

    if( myframe->IsGalCanvasActive() )
    {
        KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
        view->GetPainter()->GetSettings()->ImportLegacyColors( myframe->m_colorsSettings );
        view->UpdateLayerColor( GERBER_DRAW_LAYER( aLayer ) );
    }

    myframe->GetCanvas()->Refresh();
}
开发者ID:zhihuitech,项目名称:kicad-source-mirror,代码行数:17,代码来源:gerbview_layer_widget.cpp


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