本文整理汇总了C++中LSET::any方法的典型用法代码示例。如果您正苦于以下问题:C++ LSET::any方法的具体用法?C++ LSET::any怎么用?C++ LSET::any使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LSET
的用法示例。
在下文中一共展示了LSET::any方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compute_pad_access_code
// Compute the access code for a pad. Returns -1 if there is no copper
static int compute_pad_access_code( BOARD *aPcb, LSET aLayerMask )
{
// Non-copper is not interesting here
aLayerMask &= LSET::AllCuMask();
if( !aLayerMask.any() )
return -1;
// Traditional TH pad
if( aLayerMask[F_Cu] && aLayerMask[B_Cu] )
return 0;
// Front SMD pad
if( aLayerMask[F_Cu] )
return 1;
// Back SMD pad
if( aLayerMask[B_Cu] )
return aPcb->GetCopperLayerCount();
// OK, we have an inner-layer only pad (and I have no idea about
// what could be used for); anyway, find the first copper layer
// it's on
for( LAYER_NUM layer = In1_Cu; layer < B_Cu; ++layer )
{
if( aLayerMask[layer] )
return layer + 1;
}
// This shouldn't happen
return -1;
}
示例2: sameLayerFunc
bool PCB_SELECTION_CONDITIONS::sameLayerFunc( const SELECTION& aSelection )
{
if( aSelection.Empty() )
return false;
LSET layerSet;
layerSet.set();
for( const auto& i : aSelection )
{
auto item = static_cast<BOARD_ITEM*>( i );
layerSet &= item->GetLayerSet();
if( !layerSet.any() ) // there are no common layers left
return false;
}
return true;
}
示例3: sameLayerFunc
bool SELECTION_CONDITIONS::sameLayerFunc( const SELECTION& aSelection )
{
if( aSelection.Empty() )
return false;
LSET layerSet;
layerSet.set();
for( int i = 0; i < aSelection.Size(); ++i )
{
const BOARD_ITEM* item = dynamic_cast<const BOARD_ITEM*>( aSelection.Item<EDA_ITEM>( i ) );
if( !item )
return false;
layerSet &= item->GetLayerSet();
if( !layerSet.any() ) // there are no common layers left
return false;
}
return true;
}