Commit 00bdc800 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Pcbnew: Fix a collision name between 2 methods: EDA_ITEM::GetFlags() and...

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().
parent 8cb20938
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -2272,9 +2272,9 @@ bool BOARD::NormalizeAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, ZONE_CONTAI


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


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


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



    SetLocalFlags( aZone.GetLocalFlags() );
    utility    = aZone.utility;
}
}




+3 −3
Original line number Original line Diff line number Diff line
@@ -242,8 +242,8 @@ public:
    int GetSelectedCorner() const { return m_CornerSelection; }
    int GetSelectedCorner() const { return m_CornerSelection; }
    void SetSelectedCorner( int aCorner ) { m_CornerSelection = aCorner; }
    void SetSelectedCorner( int aCorner ) { m_CornerSelection = aCorner; }


    int GetFlags() const { return utility; }
    int GetLocalFlags() const { return m_localFlgs; }
    void SetFlags( int aFlags ) { utility = aFlags; }
    void SetLocalFlags( int aFlags ) { m_localFlgs = aFlags; }


    std::vector <SEGMENT>& FillSegments() { return m_FillSegmList; }
    std::vector <SEGMENT>& FillSegments() { return m_FillSegmList; }
    const std::vector <SEGMENT>& FillSegments() const { 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.
    /// The index of the corner being moved or -1 if no corner is selected.
    int                   m_CornerSelection;
    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.
    /** Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used.
+4 −6
Original line number Original line Diff line number Diff line
@@ -818,13 +818,11 @@ static void export_vrml_zones( BOARD* pcb )
            {
            {
                CPolyPt* endcorner = &zone->m_FilledPolysList[ic];
                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,
                export_vrml_line( layer, begincorner->x, begincorner->y,
                                  endcorner->x, endcorner->y, width, 1 );
                                  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->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,
                    export_vrml_line( layer, endcorner->x, endcorner->y,
                                      firstcorner->x, firstcorner->y, width, 1 );
                                      firstcorner->x, firstcorner->y, width, 1 );
                    ic++;
                    ic++;
Loading