keepout in footprint: fix some crashes and issues. Create a specific type (PCB_MODULE_ZONE_AREA_T) for zones in footprint. The new class (MODULE_ZONE_CONTAINER) is the same as ZONE_CONTAINER, but the type ID is PCB_MODULE_ZONE_AREA_T instead of PCB_ZONE_AREA_T.

This is mandatory because these zones must be handled differently in many functions.
This commit is contained in:
jean-pierre charras
2019-10-29 11:24:57 +01:00
parent 64a42ffa35
commit bc5dcf182f
16 changed files with 249 additions and 145 deletions
+9 -2
View File
@@ -64,7 +64,7 @@ COMMIT& BOARD_COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType )
{
EDA_ITEM* item = aItem->GetParent();
if( item && item->Type() == PCB_MODULE_T ) // means aItem belongs a footprint
if( item && item->Type() == PCB_MODULE_T ) // means aItem belongs a footprint
aItem = item;
}
@@ -171,6 +171,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
case PCB_PAD_T:
case PCB_MODULE_EDGE_T:
case PCB_MODULE_TEXT_T:
case PCB_MODULE_ZONE_AREA_T:
// This level can only handle module items when editing modules
if( !m_editModules )
break;
@@ -330,9 +331,15 @@ EDA_ITEM* BOARD_COMMIT::parentObject( EDA_ITEM* aItem ) const
case PCB_PAD_T:
case PCB_MODULE_EDGE_T:
case PCB_MODULE_TEXT_T:
case PCB_MODULE_ZONE_AREA_T:
return aItem->GetParent();
default:
case PCB_ZONE_AREA_T:
wxASSERT( !dynamic_cast<MODULE*>( aItem->GetParent() ) );
return aItem;
default:
break;
}
return aItem;