pcbnew: Add a number of missing handles for module zones

This commit is contained in:
Seth Hillbrand 2020-06-14 07:23:10 -07:00
parent 09eee84a3e
commit 491ac0256d
5 changed files with 16 additions and 1 deletions

View File

@ -149,7 +149,8 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
board->Modules().front()->Add( boardItem ); board->Modules().front()->Add( boardItem );
} }
else if( boardItem->Type() == PCB_MODULE_TEXT_T || else if( boardItem->Type() == PCB_MODULE_TEXT_T ||
boardItem->Type() == PCB_MODULE_EDGE_T ) boardItem->Type() == PCB_MODULE_EDGE_T ||
boardItem->Type() == PCB_MODULE_ZONE_AREA_T )
{ {
wxASSERT( boardItem->GetParent() && wxASSERT( boardItem->GetParent() &&
boardItem->GetParent()->Type() == PCB_MODULE_T ); boardItem->GetParent()->Type() == PCB_MODULE_T );

View File

@ -941,6 +941,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
case PCB_PAD_T: case PCB_PAD_T:
case PCB_MODULE_TEXT_T: case PCB_MODULE_TEXT_T:
case PCB_MODULE_EDGE_T: case PCB_MODULE_EDGE_T:
case PCB_MODULE_ZONE_AREA_T:
// this calls MODULE::Visit() on each module. // this calls MODULE::Visit() on each module.
result = IterateForward<MODULE*>( m_modules, inspector, testData, p ); result = IterateForward<MODULE*>( m_modules, inspector, testData, p );
@ -954,6 +955,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
case PCB_PAD_T: case PCB_PAD_T:
case PCB_MODULE_TEXT_T: case PCB_MODULE_TEXT_T:
case PCB_MODULE_EDGE_T: case PCB_MODULE_EDGE_T:
case PCB_MODULE_ZONE_AREA_T:
continue; continue;
default: default:

View File

@ -82,6 +82,7 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected )
// check if it not one of the module primitives // check if it not one of the module primitives
if( ( i->Type() != PCB_MODULE_EDGE_T ) && if( ( i->Type() != PCB_MODULE_EDGE_T ) &&
( i->Type() != PCB_MODULE_TEXT_T ) && ( i->Type() != PCB_MODULE_TEXT_T ) &&
( i->Type() != PCB_MODULE_ZONE_AREA_T ) &&
( i->Type() != PCB_PAD_T ) ) ( i->Type() != PCB_PAD_T ) )
{ {
onlyModuleParts = false; onlyModuleParts = false;
@ -167,6 +168,7 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected )
// Dont format stuff that cannot exist standalone! // Dont format stuff that cannot exist standalone!
if( ( i->Type() != PCB_MODULE_EDGE_T ) && if( ( i->Type() != PCB_MODULE_EDGE_T ) &&
( i->Type() != PCB_MODULE_TEXT_T ) && ( i->Type() != PCB_MODULE_TEXT_T ) &&
( i->Type() != PCB_MODULE_ZONE_AREA_T ) &&
( i->Type() != PCB_PAD_T ) ) ( i->Type() != PCB_PAD_T ) )
{ {
auto item = static_cast<BOARD_ITEM*>( i ); auto item = static_cast<BOARD_ITEM*>( i );

View File

@ -762,6 +762,7 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
{ {
case PCB_MODULE_EDGE_T: case PCB_MODULE_EDGE_T:
case PCB_MODULE_TEXT_T: case PCB_MODULE_TEXT_T:
case PCB_MODULE_ZONE_AREA_T:
case PCB_PAD_T: case PCB_PAD_T:
// Only create undo entry for items on the board // Only create undo entry for items on the board
if( !item->IsNew() && !EditingModules() ) if( !item->IsNew() && !EditingModules() )
@ -782,6 +783,13 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
break; break;
} }
case PCB_MODULE_ZONE_AREA_T:
{
auto& zone = static_cast<MODULE_ZONE_CONTAINER&>( *item );
zone.Mirror( mirrorPoint, false );
break;
}
case PCB_MODULE_TEXT_T: case PCB_MODULE_TEXT_T:
{ {
auto& modText = static_cast<TEXTE_MODULE&>( *item ); auto& modText = static_cast<TEXTE_MODULE&>( *item );

View File

@ -646,6 +646,7 @@ SELECTION_LOCK_FLAGS SELECTION_TOOL::CheckLock()
case PCB_MODULE_EDGE_T: case PCB_MODULE_EDGE_T:
case PCB_MODULE_TEXT_T: case PCB_MODULE_TEXT_T:
case PCB_MODULE_ZONE_AREA_T:
if( static_cast<MODULE*>( item->GetParent() )->IsLocked() ) if( static_cast<MODULE*>( item->GetParent() )->IsLocked() )
containsLocked = true; containsLocked = true;
break; break;
@ -1546,6 +1547,7 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn
switch( aItem->Type() ) switch( aItem->Type() )
{ {
case PCB_ZONE_AREA_T: case PCB_ZONE_AREA_T:
case PCB_MODULE_ZONE_AREA_T:
{ {
// Check to see if this keepout is part of a footprint // Check to see if this keepout is part of a footprint
// If it is, and we are not editing the footprint, it should not be selectable // If it is, and we are not editing the footprint, it should not be selectable