本文整理汇总了C++中PCB_EDIT_FRAME::GetDisplayOptions方法的典型用法代码示例。如果您正苦于以下问题:C++ PCB_EDIT_FRAME::GetDisplayOptions方法的具体用法?C++ PCB_EDIT_FRAME::GetDisplayOptions怎么用?C++ PCB_EDIT_FRAME::GetDisplayOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PCB_EDIT_FRAME
的用法示例。
在下文中一共展示了PCB_EDIT_FRAME::GetDisplayOptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pickSingleItem
PNS_ITEM* PNS_TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLayer )
{
int tl = getView()->GetTopLayer();
if( aLayer > 0 )
tl = aLayer;
PNS_ITEM* prioritized[4];
for( int i = 0; i < 4; i++ )
prioritized[i] = 0;
PNS_ITEMSET candidates = m_router->QueryHoverItems( aWhere );
for( PNS_ITEM* item : candidates.Items() )
{
if( !IsCopperLayer( item->Layers().Start() ) )
continue;
// fixme: this causes flicker with live loop removal...
//if( item->Parent() && !item->Parent()->ViewIsVisible() )
// continue;
if( aNet < 0 || item->Net() == aNet )
{
if( item->OfKind( PNS_ITEM::VIA | PNS_ITEM::SOLID ) )
{
if( !prioritized[2] )
prioritized[2] = item;
if( item->Layers().Overlaps( tl ) )
prioritized[0] = item;
}
else
{
if( !prioritized[3] )
prioritized[3] = item;
if( item->Layers().Overlaps( tl ) )
prioritized[1] = item;
}
}
}
PNS_ITEM* rv = NULL;
PCB_EDIT_FRAME* frame = getEditFrame<PCB_EDIT_FRAME>();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)frame->GetDisplayOptions();
for( int i = 0; i < 4; i++ )
{
PNS_ITEM* item = prioritized[i];
if( displ_opts->m_ContrastModeDisplay )
if( item && !item->Layers().Overlaps( tl ) )
item = NULL;
if( item )
{
rv = item;
break;
}
}
if( rv && aLayer >= 0 && !rv->Layers().Overlaps( aLayer ) )
rv = NULL;
if( rv )
{
wxLogTrace( "PNS", "%s, layer : %d, tl: %d", rv->KindStr().c_str(), rv->Layers().Start(), tl );
}
return rv;
}