Commit 6c3235c1 authored by CHARRAS's avatar CHARRAS
Browse files

first DRC control about zone outlines. Needs improvements, but works

parent 8d90da0a
Loading
Loading
Loading
Loading
+25 −0
Original line number Original line Diff line number Diff line
@@ -259,6 +259,21 @@ public:
        return NULL;
        return NULL;
    }
    }


	/**
     * Function GetAreaIndex
     * returns the Area Index  for the given Zone Container.
     * @param  aArea :The ZONE_CONTAINER to find.
     * @return an Area Index in m_ZoneDescriptorList or -1 if non found.
     */
    int GetAreaIndex( const ZONE_CONTAINER* aArea) const
    {
        for( int ii = 0; ii < GetAreaCount(); ii++ )	// Search for aArea in list
		{
            if ( aArea == GetArea( ii ) )	// Found !
				return ii;
		}
        return -1;
    }
    
    
    /**
    /**
     * Function GetAreaCount
     * Function GetAreaCount
@@ -385,6 +400,16 @@ public:
	 */
	 */
	int CombineAreas( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_combine );
	int CombineAreas( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_combine );


	/**
	 * Function Test_Drc_Areas_Outlines_To_Areas_Outlines
	 * Test Areas outlines for DRC:
	 *      Test areas inside other areas
	 *      Test areas too close 
	 * @param aArea_To_Examine: area to compare with other areas. if NULL: all areas are compared tp all others
	 * @param aCreate_Markers: if true create DRC markers. False: do not creates anything
	 * @return errors count
	*/
	int Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_Examine,bool aCreate_Markers );
};
};


#endif		// #ifndef CLASS_BOARD_H
#endif		// #ifndef CLASS_BOARD_H
+4 −0
Original line number Original line Diff line number Diff line
@@ -65,6 +65,10 @@ wxString DRC_ITEM::GetErrorText() const
        return wxString( _("Pad near pad") );
        return wxString( _("Pad near pad") );
    case DRCE_VIA_HOLE_BIGGER:
    case DRCE_VIA_HOLE_BIGGER:
        return wxString( _("Via hole > diameter"));
        return wxString( _("Via hole > diameter"));
    case COPPERAREA_INSIDE_COPPERAREA:
        return wxString( _("Copper area inside copper area"));
    case COPPERAREA_CLOSE_TO_COPPERAREA:
        return wxString( _("Copper areas intersect or too close"));
        
        
    default:
    default:
        return wxString( wxT("PROGRAM BUG, PLEASE LEAVE THE ROOM.") );
        return wxString( wxT("PROGRAM BUG, PLEASE LEAVE THE ROOM.") );
+3 −3
Original line number Original line Diff line number Diff line
@@ -124,8 +124,8 @@ void MARKER::Display_Infos( WinEDA_DrawFrame* frame )
    wxString txtB;
    wxString txtB;
    txtB << DRC_ITEM::ShowCoord( rpt.GetPointB() ) << wxT(": ") << rpt.GetTextB();     
    txtB << DRC_ITEM::ShowCoord( rpt.GetPointB() ) << wxT(": ") << rpt.GetTextB();     
    
    
    text_pos = 20;      // @todo pick a better color here
    text_pos = 25;
    Affiche_1_Parametre( frame, text_pos, txtA, txtB, BLACK );
    Affiche_1_Parametre( frame, text_pos, txtA, txtB, DARKBROWN );
}
}




+1 −1
Original line number Original line Diff line number Diff line
@@ -35,7 +35,7 @@
const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
    // there are some restrictions on the order of items in the general case.
    // there are some restrictions on the order of items in the general case.
    // all items in m_Drawings for instance should be contiguous.
    // all items in m_Drawings for instance should be contiguous.
    //  *** all items in a same list (shown here) must be contigous ****
    //  *** all items in a same list (shown here) must be contiguous ****
    TYPEMARKER,                 // in m_markers
    TYPEMARKER,                 // in m_markers
    TYPETEXTE,                  // in m_Drawings
    TYPETEXTE,                  // in m_Drawings
    TYPEDRAWSEGMENT,            // in m_Drawings
    TYPEDRAWSEGMENT,            // in m_Drawings
+9 −0
Original line number Original line Diff line number Diff line
@@ -290,6 +290,10 @@ void WinEDA_ZoneFrame::CreateControls()


	if ( m_Zone_Container )
	if ( m_Zone_Container )
		s_Zone_Hatching = m_Zone_Container->m_Poly->GetHatchStyle();
		s_Zone_Hatching = m_Zone_Container->m_Poly->GetHatchStyle();
	else
        s_Zone_Hatching = m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
			(long) CPolyLine::DIAGONAL_EDGE );

    switch( s_Zone_Hatching )
    switch( s_Zone_Hatching )
    {
    {
		case CPolyLine::NO_HATCH:
		case CPolyLine::NO_HATCH:
@@ -461,6 +465,11 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
        break;
        break;
    }
    }


    if( m_Parent->m_Parent->m_EDA_Config )
    {
		m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY, (long)s_Zone_Hatching);
	}	

    switch( m_GridCtrl->GetSelection() )
    switch( m_GridCtrl->GetSelection() )
    {
    {
    case 0:
    case 0:
Loading