本文整理汇总了C++中ZONE_CONTAINER::SetSelectedCorner方法的典型用法代码示例。如果您正苦于以下问题:C++ ZONE_CONTAINER::SetSelectedCorner方法的具体用法?C++ ZONE_CONTAINER::SetSelectedCorner怎么用?C++ ZONE_CONTAINER::SetSelectedCorner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZONE_CONTAINER
的用法示例。
在下文中一共展示了ZONE_CONTAINER::SetSelectedCorner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PcbGeneralLocateAndDisplay
BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
{
BOARD_ITEM* item;
GENERAL_COLLECTORS_GUIDE guide = GetCollectorsGuide();
// Assign to scanList the proper item types desired based on tool type
// or hotkey that is in play.
const KICAD_T* scanList = NULL;
if( aHotKeyCode )
{
// @todo: add switch here and add calls to PcbGeneralLocateAndDisplay( int aHotKeyCode )
// when searching is needed from a hotkey handler
}
else if( GetToolId() == ID_NO_TOOL_SELECTED )
{
if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )
scanList = GENERAL_COLLECTOR::ModuleItems;
else
scanList = (DisplayOpt.DisplayZonesMode == 0) ?
GENERAL_COLLECTOR::AllBoardItems :
GENERAL_COLLECTOR::AllButZones;
}
else
{
switch( GetToolId() )
{
case ID_PCB_SHOW_1_RATSNEST_BUTT:
scanList = GENERAL_COLLECTOR::PadsOrModules;
break;
case ID_TRACK_BUTT:
scanList = GENERAL_COLLECTOR::Tracks;
break;
case ID_PCB_MODULE_BUTT:
scanList = GENERAL_COLLECTOR::ModuleItems;
break;
case ID_PCB_ZONES_BUTT:
case ID_PCB_KEEPOUT_AREA_BUTT:
scanList = GENERAL_COLLECTOR::Zones;
break;
default:
scanList = DisplayOpt.DisplayZonesMode == 0 ?
GENERAL_COLLECTOR::AllBoardItems :
GENERAL_COLLECTOR::AllButZones;
}
}
m_Collector->Collect( m_Pcb, scanList, RefPos( true ), guide );
#if 0
// debugging: print out the collected items, showing their priority order too.
for( int i = 0; i<m_Collector->GetCount(); ++i )
(*m_Collector)[i]->Show( 0, std::cout );
#endif
/* Remove redundancies: sometime, legacy zones are found twice,
* because zones can be filled by overlapping segments (this is a fill option)
* Trigger the selection of the current edge for new-style zones
*/
time_t timestampzone = 0;
for( int ii = 0; ii < m_Collector->GetCount(); ii++ )
{
item = (*m_Collector)[ii];
switch( item->Type() )
{
case PCB_ZONE_T:
// Found a TYPE ZONE
if( item->GetTimeStamp() == timestampzone ) // Remove it, redundant, zone already found
{
m_Collector->Remove( ii );
ii--;
}
else
{
timestampzone = item->GetTimeStamp();
}
break;
case PCB_ZONE_AREA_T:
{
/* We need to do the selection now because the menu text
* depends on it */
ZONE_CONTAINER *zone = static_cast<ZONE_CONTAINER*>( item );
zone->SetSelectedCorner( RefPos( true ) );
}
break;
default:
break;
}
}
//.........这里部分代码省略.........