本文整理汇总了C++中LSET::count方法的典型用法代码示例。如果您正苦于以下问题:C++ LSET::count方法的具体用法?C++ LSET::count怎么用?C++ LSET::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LSET
的用法示例。
在下文中一共展示了LSET::count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LayerMaskDescribe
wxString LayerMaskDescribe( const BOARD *aBoard, LSET aMask )
{
// Try to be smart and useful. Check all copper first.
if( aMask[F_Cu] && aMask[B_Cu] )
return _( "All copper layers" );
// Check for copper.
auto layer = aBoard->GetEnabledLayers().AllCuMask() & aMask;
for( int i = 0; i < 2; i++ )
{
for( int bit = PCBNEW_LAYER_ID_START; bit < PCB_LAYER_ID_COUNT; ++bit )
{
if( layer[ bit ] )
{
wxString layerInfo = aBoard->GetLayerName( static_cast<PCB_LAYER_ID>( bit ) );
if( aMask.count() > 1 )
layerInfo << _( " and others" );
return layerInfo;
}
}
// No copper; check for technicals.
layer = aBoard->GetEnabledLayers().AllTechMask() & aMask;
}
// No copper, no technicals: no layer
return _( "no layers" );
}
示例2: OnPrintPage
bool BOARD_PRINTOUT_CONTROLLER::OnPrintPage( int aPage )
{
LSET lset = m_PrintParams.m_PrintMaskLayer;
int pageCount = lset.count();
wxString layer;
LAYER_ID extractLayer;
// compute layer mask from page number if we want one page per layer
if( m_PrintParams.m_OptionPrintPage == 0 ) // One page per layer
{
// This sequence is TBD, call a different
// sequencer if needed, such as Seq(). Could not find documentation on
// page order.
LSEQ seq = lset.UIOrder();
// aPage starts at 1, not 0
if( unsigned( aPage-1 ) < seq.size() )
m_PrintParams.m_PrintMaskLayer = LSET( seq[aPage-1] );
}
if( !m_PrintParams.m_PrintMaskLayer.any() )
return false;
extractLayer = m_PrintParams.m_PrintMaskLayer.ExtractLayer();
if( extractLayer == UNDEFINED_LAYER )
layer = _( "Multiple Layers" );
else
layer = LSET::Name( extractLayer );
// In Pcbnew we can want the layer EDGE always printed
if( m_PrintParams.m_Flags == 1 )
m_PrintParams.m_PrintMaskLayer.set( Edge_Cuts );
DrawPage( layer, aPage, pageCount );
m_PrintParams.m_PrintMaskLayer = lset;
return true;
}
示例3: OnPresetsChoice
void DIALOG_LAYERS_SETUP::OnPresetsChoice( wxCommandEvent& event )
{
unsigned presetNdx = m_PresetsChoice->GetCurrentSelection();
if( presetNdx == 0 ) // the Custom setting controls nothing.
return;
if( presetNdx < DIM(presets) )
{
m_EnabledLayers = presets[ presetNdx ];
LSET copperSet = m_EnabledLayers & LSET::AllCuMask();
int copperCount = copperSet.count();
m_CopperLayerCount = copperCount;
showCopperChoice( m_CopperLayerCount );
showSelectedLayerCheckBoxes( m_EnabledLayers );
setCopperLayerCheckBoxes( m_CopperLayerCount );
}
}