Pcbnew: Fix a collision name between 2 methods: EDA_ITEM::GetFlags() and ZONE_CONTAINER::GetFlags(), which creates a very strange behavior when creating/edition zones.

ZONE_CONTAINER::GetFlags() is now named  ZONE_CONTAINER::GetLocalFlags().
This commit is contained in:
jean-pierre charras 2013-03-26 10:58:40 +01:00
parent 8cb20938f4
commit 00bdc80087
7 changed files with 21 additions and 24 deletions

View File

@ -2272,9 +2272,9 @@ bool BOARD::NormalizeAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, ZONE_CONTAI
// mark all areas as unmodified except this one, if modified
for( unsigned ia = 0; ia < m_ZoneDescriptorList.size(); ia++ )
m_ZoneDescriptorList[ia]->SetFlags( 0 );
m_ZoneDescriptorList[ia]->SetLocalFlags( 0 );
aCurrArea->SetFlags( 1 );
aCurrArea->SetLocalFlags( 1 );
if( curr_polygon->IsPolygonSelfIntersecting() )
{
@ -2299,7 +2299,7 @@ bool BOARD::NormalizeAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, ZONE_CONTAI
delete NewArea->Outline();
NewArea->SetOutline( new_p );
NewArea->Outline()->Hatch();
NewArea->SetFlags( 1 );
NewArea->SetLocalFlags( 1 );
}
}

View File

@ -1107,7 +1107,6 @@ public:
* @param aNewZonesList = a PICKED_ITEMS_LIST * where to store new created areas pickers
* @param aCurrArea = the zone to process
* @return true if changes are made
* Also sets areas->utility1 flags if areas are modified
*/
bool NormalizeAreaPolygon( PICKED_ITEMS_LIST* aNewZonesList, ZONE_CONTAINER* aCurrArea );
@ -1130,13 +1129,13 @@ public:
* @param aDeletedList = a PICKED_ITEMS_LIST * where to store deleted areas (useful
* in undo commands can be NULL
* @param aNetCode = net to consider
* @param aUseUtility : if true, don't check areas if both utility flags are 0
* Sets utility flag = 1 for any areas modified
* @param aUseLocalFlags : if true, don't check areas if both local flags are 0
* Sets local flag = 1 for any areas modified
* @return true if some areas modified
*/
bool CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList,
int aNetCode,
bool aUseUtility );
bool aUseLocalFlags );
/**
* Function RemoveArea

View File

@ -66,7 +66,7 @@ ZONE_CONTAINER::ZONE_CONTAINER( BOARD* aBoard ) :
SetDoNotAllowVias( true ); // has meaning only if m_isKeepout == true
SetDoNotAllowTracks( true ); // has meaning only if m_isKeepout == true
m_cornerRadius = 0;
utility = 0; // flags used in polygon calculations
SetLocalFlags( 0 ); // flags tempoarry used in zone calculations
m_Poly = new CPolyLine(); // Outlines
aBoard->GetZoneSettings().ExportSetting( *this );
}
@ -101,8 +101,7 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) :
m_cornerSmoothingType = aZone.m_cornerSmoothingType;
m_cornerRadius = aZone.m_cornerRadius;
utility = aZone.utility;
SetLocalFlags( aZone.GetLocalFlags() );
}

View File

@ -242,8 +242,8 @@ public:
int GetSelectedCorner() const { return m_CornerSelection; }
void SetSelectedCorner( int aCorner ) { m_CornerSelection = aCorner; }
int GetFlags() const { return utility; }
void SetFlags( int aFlags ) { utility = aFlags; }
int GetLocalFlags() const { return m_localFlgs; }
void SetLocalFlags( int aFlags ) { m_localFlgs = aFlags; }
std::vector <SEGMENT>& FillSegments() { return m_FillSegmList; }
const std::vector <SEGMENT>& FillSegments() const { return m_FillSegmList; }
@ -617,7 +617,7 @@ private:
/// The index of the corner being moved or -1 if no corner is selected.
int m_CornerSelection;
int utility; ///< Flags used in polygon calculations.
int m_localFlgs; ///< Flags used in polygon calculations.
/** Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used.

View File

@ -818,15 +818,13 @@ static void export_vrml_zones( BOARD* pcb )
{
CPolyPt* endcorner = &zone->m_FilledPolysList[ic];
if( begincorner->utility == 0 ) // Draw only basic outlines, not extra segments
export_vrml_line( layer, begincorner->x, begincorner->y,
endcorner->x, endcorner->y, width, 1 );
export_vrml_line( layer, begincorner->x, begincorner->y,
endcorner->x, endcorner->y, width, 1 );
if( (endcorner->end_contour) || (ic == imax) ) // the last corner of a filled area is found: draw it
{
if( endcorner->utility == 0 ) // Draw only basic outlines, not extra segments
export_vrml_line( layer, endcorner->x, endcorner->y,
firstcorner->x, firstcorner->y, width, 1 );
export_vrml_line( layer, endcorner->x, endcorner->y,
firstcorner->x, firstcorner->y, width, 1 );
ic++;
// A new contour?

View File

@ -2348,9 +2348,9 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
BIU y = biuParse( data, &data );
bool end_contour = intParse( data, &data ); // end_countour was a bool when file saved, so '0' or '1' here
int utility = intParse( data );
int cornerUtilityFlg = intParse( data );
polysList.push_back( CPolyPt( x, y, end_contour, utility ) );
polysList.push_back( CPolyPt( x, y, end_contour, cornerUtilityFlg ) );
}
zc->AddFilledPolysList( polysList );
}

View File

@ -86,7 +86,7 @@ bool BOARD::OnAreaPolygonModified( PICKED_ITEMS_LIST* aModifiedZonesList,
bool BOARD::CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList, int aNetCode,
bool aUseUtility )
bool aUseLocalFlags )
{
if( m_ZoneDescriptorList.size() <= 1 )
return false;
@ -127,7 +127,8 @@ bool BOARD::CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList, int aNetCode,
|| b1.bottom > b2.top || b1.top < b2.bottom ) )
{
// check area2 against curr_area
if( curr_area->GetFlags() || area2->GetFlags() || aUseUtility == false )
if( curr_area->GetLocalFlags() || area2->GetLocalFlags()
|| aUseLocalFlags == false )
{
bool ret = TestAreaIntersection( curr_area, area2 );
@ -350,7 +351,7 @@ bool BOARD::CombineAreas( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_
RemoveArea( aDeletedList, area_to_combine );
area_ref->SetFlags( 1 );
area_ref->SetLocalFlags( 1 );
area_ref->Outline()->Hatch();
return true;