本文整理汇总了C++中PCB_BASE_FRAME::GetToolManager方法的典型用法代码示例。如果您正苦于以下问题:C++ PCB_BASE_FRAME::GetToolManager方法的具体用法?C++ PCB_BASE_FRAME::GetToolManager怎么用?C++ PCB_BASE_FRAME::GetToolManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PCB_BASE_FRAME
的用法示例。
在下文中一共展示了PCB_BASE_FRAME::GetToolManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Push
//.........这里部分代码省略.........
case PCB_LINE_T: // a segment not on copper layers
case PCB_TEXT_T: // a text on a layer
case PCB_TRACE_T: // a track segment (segment on a copper layer)
case PCB_VIA_T: // a via (like track segment on a copper layer)
case PCB_DIMENSION_T: // a dimension (graphic item)
case PCB_TARGET_T: // a target (graphic item)
case PCB_MARKER_T: // a marker used to show something
case PCB_ZONE_AREA_T:
itemsToDeselect.push_back( boardItem );
view->Remove( boardItem );
if( !( changeFlags & CHT_DONE ) )
board->Remove( boardItem );
break;
case PCB_MODULE_T:
{
itemsToDeselect.push_back( boardItem );
// There are no modules inside a module yet
wxASSERT( !m_editModules );
MODULE* module = static_cast<MODULE*>( boardItem );
view->Remove( module );
module->ClearFlags();
if( !( changeFlags & CHT_DONE ) )
board->Remove( module ); // handles connectivity
// Clear flags to indicate, that the ratsnest, list of nets & pads are not valid anymore
board->m_Status_Pcb = 0;
}
break;
default: // other types do not need to (or should not) be handled
wxASSERT( false );
break;
}
break;
}
case CHT_MODIFY:
{
if( !m_editModules && aCreateUndoEntry )
{
ITEM_PICKER itemWrapper( boardItem, UR_CHANGED );
wxASSERT( ent.m_copy );
itemWrapper.SetLink( ent.m_copy );
undoList.PushItem( itemWrapper );
}
if( ent.m_copy )
connectivity->MarkItemNetAsDirty( static_cast<BOARD_ITEM*>( ent.m_copy ) );
connectivity->Update( boardItem );
view->Update( boardItem );
// if no undo entry is needed, the copy would create a memory leak
if( !aCreateUndoEntry )
delete ent.m_copy;
break;
}
default:
wxASSERT( false );
break;
}
}
// Removing an item should trigger the unselect action
// but only after all items are removed otherwise we can get
// flickering depending on the system
if( itemsToDeselect.size() > 0 )
m_toolMgr->RunAction( PCB_ACTIONS::unselectItems, true, &itemsToDeselect );
if( !m_editModules && aCreateUndoEntry )
frame->SaveCopyInUndoList( undoList, UR_UNSPECIFIED );
if( TOOL_MANAGER* toolMgr = frame->GetToolManager() )
toolMgr->PostEvent( { TC_MESSAGE, TA_MODEL_CHANGE, AS_GLOBAL } );
if ( !m_editModules )
{
auto panel = static_cast<PCB_DRAW_PANEL_GAL*>( frame->GetGalCanvas() );
connectivity->RecalculateRatsnest();
connectivity->ClearDynamicRatsnest();
panel->RedrawRatsnest();
}
if( aSetDirtyBit )
frame->OnModify();
frame->UpdateMsgPanel();
clear();
}