pcbnew: Rename PCB_ZONE_T and remove from connectivity
SEGZONE types were confusingly named PCB_ZONE_T. Zones in pcbnew are now _only_ PCB_ZONE_AREA_T, so we name segzone types PCB_SEGZONE_T to be clear. This also removes processing of the SEGZONEs from connectivity calculations.
This commit is contained in:
parent
a81e3c2b13
commit
b3a5e08c2f
|
@ -94,7 +94,7 @@ enum KICAD_T
|
|||
PCB_MODULE_EDGE_T, ///< class EDGE_MODULE, a footprint edge
|
||||
PCB_TRACE_T, ///< class TRACK, a track segment (segment on a copper layer)
|
||||
PCB_VIA_T, ///< class VIA, a via (like a track segment on a copper layer)
|
||||
PCB_ZONE_T, ///< class SEGZONE, a segment used to fill a zone area (segment on a
|
||||
PCB_SEGZONE_T, ///< class SEGZONE, a segment used to fill a zone area (segment on a
|
||||
///< copper layer)
|
||||
PCB_MARKER_T, ///< class MARKER_PCB, a marker used to show something
|
||||
PCB_DIMENSION_T, ///< class DIMENSION, a dimension (graphic item)
|
||||
|
|
|
@ -70,7 +70,7 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
|
|||
TRACK* Track;
|
||||
int nb_segm;
|
||||
|
||||
if( (track == NULL ) || (track->Type() == PCB_ZONE_T) )
|
||||
if( (track == NULL ) || (track->Type() == PCB_SEGZONE_T) )
|
||||
return;
|
||||
|
||||
m_canvas->CrossHairOff( DC ); // Erase cursor shape
|
||||
|
|
|
@ -566,7 +566,7 @@ void PCB_EDIT_FRAME::Block_Delete()
|
|||
|
||||
// These items are deleted, but not put in undo list
|
||||
case PCB_MARKER_T: // a marker used to show something
|
||||
case PCB_ZONE_T: // SEG_ZONE items are now deprecated
|
||||
case PCB_SEGZONE_T: // SEG_ZONE items are now deprecated
|
||||
item->UnLink();
|
||||
itemsList->RemovePicker( ii );
|
||||
ii--;
|
||||
|
@ -625,7 +625,7 @@ void PCB_EDIT_FRAME::Block_Rotate()
|
|||
break;
|
||||
|
||||
// This item is not put in undo list
|
||||
case PCB_ZONE_T: // SEG_ZONE items are now deprecated
|
||||
case PCB_SEGZONE_T: // SEG_ZONE items are now deprecated
|
||||
itemsList->RemovePicker( ii );
|
||||
ii--;
|
||||
break;
|
||||
|
@ -694,7 +694,7 @@ void PCB_EDIT_FRAME::Block_Flip()
|
|||
break;
|
||||
|
||||
// This item is not put in undo list
|
||||
case PCB_ZONE_T: // SEG_ZONE items are now deprecated
|
||||
case PCB_SEGZONE_T: // SEG_ZONE items are now deprecated
|
||||
itemsList->RemovePicker( ii );
|
||||
ii--;
|
||||
break;
|
||||
|
@ -750,7 +750,7 @@ void PCB_EDIT_FRAME::Block_Move()
|
|||
break;
|
||||
|
||||
// This item is not put in undo list
|
||||
case PCB_ZONE_T: // SEG_ZONE items are now deprecated
|
||||
case PCB_SEGZONE_T: // SEG_ZONE items are now deprecated
|
||||
itemsList->RemovePicker( ii );
|
||||
ii--;
|
||||
break;
|
||||
|
|
|
@ -188,7 +188,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
|||
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_T: // SEG_ZONE items are now deprecated
|
||||
case PCB_SEGZONE_T: // SEG_ZONE items are now deprecated
|
||||
case PCB_ZONE_AREA_T:
|
||||
view->Remove( boardItem );
|
||||
|
||||
|
|
|
@ -905,7 +905,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
|
|||
|
||||
break;
|
||||
|
||||
case PCB_ZONE_T:
|
||||
case PCB_SEGZONE_T:
|
||||
if( aMode == ADD_APPEND )
|
||||
m_SegZoneDeprecated.PushBack( (SEGZONE*) aBoardItem );
|
||||
else
|
||||
|
@ -1001,7 +1001,7 @@ void BOARD::Remove( BOARD_ITEM* aBoardItem )
|
|||
m_Track.Remove( (TRACK*) aBoardItem );
|
||||
break;
|
||||
|
||||
case PCB_ZONE_T:
|
||||
case PCB_SEGZONE_T:
|
||||
m_SegZoneDeprecated.Remove( (SEGZONE*) aBoardItem );
|
||||
break;
|
||||
|
||||
|
@ -1383,7 +1383,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
|
|||
++p;
|
||||
break;
|
||||
|
||||
case PCB_ZONE_T:
|
||||
case PCB_SEGZONE_T:
|
||||
result = IterateForward( m_SegZoneDeprecated, inspector, testData, p );
|
||||
++p;
|
||||
break;
|
||||
|
|
|
@ -109,7 +109,7 @@ EDA_ITEM* TRACK::Clone() const
|
|||
|
||||
|
||||
SEGZONE::SEGZONE( BOARD_ITEM* aParent ) :
|
||||
TRACK( aParent, PCB_ZONE_T )
|
||||
TRACK( aParent, PCB_SEGZONE_T )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ TRACK* TRACK::GetBestInsertPoint( BOARD* aPcb )
|
|||
// When reading from a file most of the items will already be in the correct order.
|
||||
// Searching from the back therefore takes us from n^2 to essentially 0.
|
||||
|
||||
if( Type() == PCB_ZONE_T ) // Deprecated items, only found in very old boards
|
||||
if( Type() == PCB_SEGZONE_T ) // Deprecated items, only found in very old boards
|
||||
track = aPcb->m_SegZoneDeprecated.GetLast();
|
||||
else
|
||||
track = aPcb->m_Track.GetLast();
|
||||
|
@ -468,7 +468,7 @@ TRACK* TRACK::GetBestInsertPoint( BOARD* aPcb )
|
|||
return track->Next();
|
||||
}
|
||||
|
||||
if( Type() == PCB_ZONE_T ) // Deprecated
|
||||
if( Type() == PCB_SEGZONE_T ) // Deprecated
|
||||
return aPcb->m_SegZoneDeprecated.GetFirst();
|
||||
else
|
||||
return aPcb->m_Track.GetFirst();
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
static inline bool ClassOf( const EDA_ITEM* aItem )
|
||||
{
|
||||
return aItem && ( ( PCB_ZONE_AREA_T == aItem->Type() ) ||
|
||||
( PCB_ZONE_T == aItem->Type() ) );
|
||||
( PCB_SEGZONE_T == aItem->Type() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,7 +50,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
|
|||
PCB_PAD_T, // in modules
|
||||
PCB_MODULE_TEXT_T, // in modules
|
||||
PCB_MODULE_T, // in m_Modules
|
||||
PCB_ZONE_T, // in m_Zones
|
||||
PCB_SEGZONE_T, // in m_Zones
|
||||
PCB_ZONE_AREA_T, // in m_ZoneDescriptorList
|
||||
EOT
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ const KICAD_T GENERAL_COLLECTOR::BoardLevelItems[] = {
|
|||
PCB_VIA_T,
|
||||
PCB_TRACE_T,
|
||||
PCB_MODULE_T,
|
||||
PCB_ZONE_T,
|
||||
PCB_SEGZONE_T,
|
||||
PCB_ZONE_AREA_T,
|
||||
EOT
|
||||
};
|
||||
|
@ -104,7 +104,7 @@ const KICAD_T GENERAL_COLLECTOR::PadsTracksOrZones[] = {
|
|||
PCB_PAD_T,
|
||||
PCB_VIA_T,
|
||||
PCB_TRACE_T,
|
||||
PCB_ZONE_T,
|
||||
PCB_SEGZONE_T,
|
||||
PCB_ZONE_AREA_T,
|
||||
EOT
|
||||
};
|
||||
|
@ -182,7 +182,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
|||
breakhere++;
|
||||
break;
|
||||
|
||||
case PCB_ZONE_T:
|
||||
case PCB_SEGZONE_T:
|
||||
breakhere++;
|
||||
break;
|
||||
|
||||
|
@ -266,7 +266,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
|
|||
goto exit;
|
||||
break;
|
||||
|
||||
case PCB_ZONE_T:
|
||||
case PCB_SEGZONE_T:
|
||||
break;
|
||||
|
||||
case PCB_ZONE_AREA_T:
|
||||
|
|
|
@ -188,7 +188,6 @@ bool CN_CONNECTIVITY_ALGO::Remove( BOARD_ITEM* aItem )
|
|||
break;
|
||||
|
||||
case PCB_ZONE_AREA_T:
|
||||
case PCB_ZONE_T:
|
||||
{
|
||||
m_itemMap[ static_cast<BOARD_CONNECTED_ITEM*>( aItem ) ].MarkItemsAsInvalid();
|
||||
m_itemMap.erase ( static_cast<BOARD_CONNECTED_ITEM*>( aItem ) );
|
||||
|
@ -196,6 +195,7 @@ bool CN_CONNECTIVITY_ALGO::Remove( BOARD_ITEM* aItem )
|
|||
break;
|
||||
}
|
||||
|
||||
case PCB_SEGZONE_T:
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -279,7 +279,6 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
|
|||
break;
|
||||
|
||||
case PCB_ZONE_AREA_T:
|
||||
case PCB_ZONE_T:
|
||||
{
|
||||
auto zone = static_cast<ZONE_CONTAINER*>( aItem );
|
||||
|
||||
|
@ -294,6 +293,8 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
|
|||
break;
|
||||
}
|
||||
|
||||
//N.B. SEGZONE items are deprecated and not to used for connectivity
|
||||
case PCB_SEGZONE_T:
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -584,7 +585,6 @@ void CN_CONNECTIVITY_ALGO::Build( const std::vector<BOARD_ITEM*>& aItems )
|
|||
{
|
||||
case PCB_TRACE_T:
|
||||
case PCB_VIA_T:
|
||||
case PCB_ZONE_T:
|
||||
case PCB_PAD_T:
|
||||
Add( item );
|
||||
break;
|
||||
|
@ -599,6 +599,8 @@ void CN_CONNECTIVITY_ALGO::Build( const std::vector<BOARD_ITEM*>& aItems )
|
|||
break;
|
||||
}
|
||||
|
||||
//N.B. SEGZONE items are deprecated and not to used for connectivity
|
||||
case PCB_SEGZONE_T:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -830,21 +832,20 @@ bool CN_VISITOR::operator()( CN_ITEM* aCandidate )
|
|||
return true;
|
||||
|
||||
// We should handle zone-zone connection separately
|
||||
if ( ( parentA->Type() == PCB_ZONE_AREA_T || parentA->Type() == PCB_ZONE_T ) &&
|
||||
( parentB->Type() == PCB_ZONE_AREA_T || parentB->Type() == PCB_ZONE_T ) )
|
||||
if ( parentA->Type() == PCB_ZONE_AREA_T && parentB->Type() == PCB_ZONE_AREA_T )
|
||||
{
|
||||
checkZoneZoneConnection( static_cast<CN_ZONE*>( m_item ),
|
||||
static_cast<CN_ZONE*>( aCandidate ) );
|
||||
return true;
|
||||
}
|
||||
|
||||
if( parentA->Type() == PCB_ZONE_AREA_T || parentA->Type() == PCB_ZONE_T)
|
||||
if( parentA->Type() == PCB_ZONE_AREA_T )
|
||||
{
|
||||
checkZoneItemConnection( static_cast<CN_ZONE*>( aCandidate ), m_item );
|
||||
return true;
|
||||
}
|
||||
|
||||
if( parentB->Type() == PCB_ZONE_AREA_T || parentB->Type() == PCB_ZONE_T)
|
||||
if( parentB->Type() == PCB_ZONE_AREA_T )
|
||||
{
|
||||
checkZoneItemConnection( static_cast<CN_ZONE*>( m_item ), aCandidate );
|
||||
return true;
|
||||
|
|
|
@ -170,7 +170,7 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
|
|||
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_ZONE_T:
|
||||
case PCB_SEGZONE_T:
|
||||
// Found a TYPE ZONE
|
||||
if( item->GetTimeStamp() == timestampzone ) // Remove it, redundant, zone already found
|
||||
{
|
||||
|
|
|
@ -1300,7 +1300,7 @@ void PCB_EDIT_FRAME::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
|
|||
Delete_Segment( DC, (TRACK*) Item );
|
||||
break;
|
||||
|
||||
case PCB_ZONE_T:
|
||||
case PCB_SEGZONE_T:
|
||||
Delete_OldZone_Fill( (SEGZONE*) Item );
|
||||
break;
|
||||
|
||||
|
|
|
@ -1103,7 +1103,7 @@ static void CreateRoutesSection( FILE* aFile, BOARD* aPcb )
|
|||
fprintf( aFile, "TRACK TRACK%d\n", track->GetWidth() );
|
||||
}
|
||||
|
||||
if( (track->Type() == PCB_TRACE_T) || (track->Type() == PCB_ZONE_T) )
|
||||
if( (track->Type() == PCB_TRACE_T) || (track->Type() == PCB_SEGZONE_T) )
|
||||
{
|
||||
if( old_layer != track->GetLayer() )
|
||||
{
|
||||
|
|
|
@ -444,7 +444,7 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
|
|||
case PCB_TEXT_T:
|
||||
case PCB_VIA_T:
|
||||
case PCB_TRACE_T:
|
||||
case PCB_ZONE_T:
|
||||
case PCB_SEGZONE_T:
|
||||
case PCB_MARKER_T:
|
||||
case PCB_DIMENSION_T:
|
||||
case PCB_TARGET_T:
|
||||
|
|
|
@ -72,7 +72,7 @@ int PCB_EDIT_FRAME::SelectHighLight( wxDC* DC )
|
|||
|
||||
case PCB_TRACE_T:
|
||||
case PCB_VIA_T:
|
||||
case PCB_ZONE_T:
|
||||
case PCB_SEGZONE_T:
|
||||
// since these classes are all derived from TRACK, use a common
|
||||
// GetNet() function:
|
||||
netcode = ( (TRACK*) item )->GetNetCode();
|
||||
|
|
|
@ -491,7 +491,7 @@ void LEGACY_PLUGIN::loadAllSections( bool doAppend )
|
|||
|
||||
else if( TESTLINE( "$ZONE" ) )
|
||||
{
|
||||
loadTrackList( PCB_ZONE_T );
|
||||
loadTrackList( PCB_SEGZONE_T );
|
||||
}
|
||||
|
||||
else if( TESTLINE( "$GENERAL" ) )
|
||||
|
@ -2263,7 +2263,7 @@ void LEGACY_PLUGIN::loadTrackList( int aStructType )
|
|||
BIU drill = data ? biuParse( data ) : -1; // SetDefault() if < 0
|
||||
|
||||
// Read the 2nd line to determine the exact type, one of:
|
||||
// PCB_TRACE_T, PCB_VIA_T, or PCB_ZONE_T. The type field in 2nd line
|
||||
// PCB_TRACE_T, PCB_VIA_T, or PCB_SEGZONE_T. The type field in 2nd line
|
||||
// differentiates between PCB_TRACE_T and PCB_VIA_T. With virtual
|
||||
// functions in use, it is critical to instantiate the PCB_VIA_T
|
||||
// exactly.
|
||||
|
@ -2316,7 +2316,7 @@ void LEGACY_PLUGIN::loadTrackList( int aStructType )
|
|||
newTrack = new VIA( m_board );
|
||||
break;
|
||||
|
||||
case PCB_ZONE_T: // this is now deprecated, but exist in old boards
|
||||
case PCB_SEGZONE_T: // this is now deprecated, but exist in old boards
|
||||
newTrack = new SEGZONE( m_board );
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -210,7 +210,7 @@ protected:
|
|||
* reads a list of segments (Tracks and Vias, or Segzones)
|
||||
*
|
||||
* @param aStructType is either PCB_TRACE_T to indicate tracks and vias, or
|
||||
* PCB_ZONE_T to indicate oldschool zone segments (before polygons came to be).
|
||||
* PCB_SEGZONE_T to indicate oldschool zone segments (before polygons came to be).
|
||||
*/
|
||||
void loadTrackList( int aStructType );
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
|
|||
|
||||
break;
|
||||
|
||||
case PCB_ZONE_T: // Item used to fill a zone
|
||||
case PCB_SEGZONE_T: // Item used to fill a zone
|
||||
AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_ZONE,
|
||||
_( "Delete Zone Filling" ), KiBitmap( delete_xpm ) );
|
||||
break;
|
||||
|
|
|
@ -290,7 +290,7 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
|
|||
// the "cast" applied in here clarifies which overloaded draw() is called
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_ZONE_T:
|
||||
case PCB_SEGZONE_T:
|
||||
case PCB_TRACE_T:
|
||||
draw( static_cast<const TRACK*>( item ), aLayer );
|
||||
break;
|
||||
|
|
|
@ -310,7 +310,7 @@ void PCB_EDIT_FRAME::RunActionPlugin( ACTION_PLUGIN* aActionPlugin )
|
|||
case PCB_TEXT_T:
|
||||
case PCB_DIMENSION_T:
|
||||
case PCB_TARGET_T:
|
||||
case PCB_ZONE_T:
|
||||
case PCB_SEGZONE_T:
|
||||
|
||||
// If item has a list it's mean that the element is on the board
|
||||
if( item->GetList() == NULL )
|
||||
|
|
|
@ -39,7 +39,7 @@ bool PCB_SELECTION_CONDITIONS::OnlyConnectedItems( const SELECTION& aSelection )
|
|||
{
|
||||
auto type = item->Type();
|
||||
|
||||
if( type != PCB_PAD_T && type != PCB_VIA_T && type != PCB_TRACE_T && type != PCB_ZONE_T )
|
||||
if( type != PCB_PAD_T && type != PCB_VIA_T && type != PCB_TRACE_T && type != PCB_ZONE_AREA_T )
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue