本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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 );
}