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


C++ LSET::test方法代码示例

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


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

示例1: TransferDataToWindow

bool DIALOG_SWAP_LAYERS::TransferDataToWindow()
{
    LSET enabledCopperLayers = LSET::AllCuMask( m_parent->GetBoard()->GetCopperLayerCount() );
    int row = 0;

    for( size_t layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer )
    {
        if( enabledCopperLayers.test( layer ) )
        {
            auto attr = new wxGridCellAttr;
            attr->SetRenderer( new GRID_CELL_LAYER_RENDERER( m_parent ) );
            attr->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ) );
            attr->SetReadOnly();
            m_grid->SetAttr( row, 0, attr );

            attr = new wxGridCellAttr;
            attr->SetRenderer( new GRID_CELL_LAYER_RENDERER( m_parent ) );
            attr->SetEditor( new GRID_CELL_LAYER_SELECTOR( m_parent, LSET::AllNonCuMask() ) );
            m_grid->SetAttr( row, 1, attr );

            m_grid->GetTable()->SetValueAsLong( row, 0, (long) layer );
            m_grid->GetTable()->SetValueAsLong( row, 1, (long) layer );

            ++row;
        }
    }

    return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:29,代码来源:dialog_swap_layers.cpp

示例2: TransferDataFromWindow

bool DIALOG_SWAP_LAYERS::TransferDataFromWindow()
{
    if( !m_grid->CommitPendingChanges() )
        return false;

    LSET enabledCopperLayers = LSET::AllCuMask( m_parent->GetBoard()->GetCopperLayerCount() );
    wxGridTableBase* table = m_grid->GetTable();
    int row = 0;

    for( size_t layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer )
    {
        if( enabledCopperLayers.test( layer ) )
            m_layerDestinations[ layer ] = (PCB_LAYER_ID) table->GetValueAsLong( row++, 1 );
        else
            m_layerDestinations[ layer ] = (PCB_LAYER_ID) layer;
    }

    return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:19,代码来源:dialog_swap_layers.cpp

示例3: OnLayerVisible

void PCB_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal )
{
    BOARD* brd = myframe->GetBoard();

    LSET visibleLayers = brd->GetVisibleLayers();

    if( visibleLayers.test( aLayer ) != isVisible )
    {
        visibleLayers.set( aLayer, isVisible );

        brd->SetVisibleLayers( visibleLayers );

        myframe->OnModify();

        EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();

        if( galCanvas )
            galCanvas->GetView()->SetLayerVisible( aLayer, isVisible );
    }

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

示例4: isLayerAllowedInFpMode

bool PCB_LAYER_WIDGET::isLayerAllowedInFpMode( PCB_LAYER_ID aLayer )
{
    static LSET allowed = LSET::AllTechMask();
    allowed.set( F_Cu ).set( B_Cu );
    return allowed.test( aLayer );
}
开发者ID:johnbeard,项目名称:kicad,代码行数:6,代码来源:pcb_layer_widget.cpp


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