Loading change_log.txt +4 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ email address. 2008-Mar-10 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ +pcbnew * Improved some comments on new functions. * Improved some comments on new functions dirty area functions * Changed void ConvertPcbUnitsToPixelsUnits( EDA_Rect& aRect ); to void ConvertPcbUnitsToPixelsUnits( EDA_Rect* aRect ); Loading @@ -21,6 +21,9 @@ email address. * Changed from "new wxDCClip()" to use an automatic wxDCClip() variable in drawpanel.cpp * Removed a printf() from "release" build of drawpanel.cpp * Added WinEDA_DrawPanel::PostDirtyRect() * Renamed Supprime_Une_Piste() to Remove_One_Track() and it now uses PostDirtyRect(). 2008-Mar-10 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> Loading include/drawpanel_wxstruct.h +12 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,18 @@ public: wxPoint CursorRealPosition( const wxPoint& ScreenPos ); wxPoint CursorScreenPosition(); /** * Function PostDirtyRect * appends the given rectangle in pcb units to the DrawPanel's invalid * region list so that very soon (but not immediately), this rectangle * along with any other recently posted rectangles is redrawn. Conversion * to pixels is done in here. * @param aRect The rectangle to append, it must be orthogonal * (vertical and horizontal edges only), and it must be [,) in nature, i.e. * [pos, dim) == [inclusive, exclusive) */ void PostDirtyRect( EDA_Rect aRect ); /** * Function ConvertPcbUnitsToPixelsUnits * converts pos and size of the given EDA_Rect to pos and size in pixels, Loading include/wxPcbStruct.h +2 −2 Original line number Diff line number Diff line Loading @@ -476,7 +476,7 @@ public: TRACK* Delete_Segment( wxDC* DC, TRACK* Track ); void Delete_Track( wxDC* DC, TRACK* Track ); void Delete_net( wxDC* DC, TRACK* Track ); void Supprime_Une_Piste( wxDC* DC, TRACK* pt_segm ); void Remove_One_Track( wxDC* DC, TRACK* pt_segm ); bool Resize_Pistes_Vias( wxDC* DC, bool Track, bool Via ); void Edit_Net_Width( wxDC* DC, int Netcode ); void Edit_Track_Width( wxDC* DC, TRACK* Track ); Loading pcbnew/class_track.cpp +30 −39 Original line number Diff line number Diff line Loading @@ -210,11 +210,37 @@ EDA_Rect TRACK::GetBoundingBox() const // end of track is round, this is its radius, rounded up int radius = ( m_Width+1 )/2; int ymax = MAX( m_Start.y, m_End.y ); int xmax = MAX( m_Start.x, m_End.x ); int ymax; int xmax; int ymin = MIN( m_Start.y, m_End.y ); int xmin = MIN( m_Start.x, m_End.x ); int ymin; int xmin; if( Type() == TYPEVIA ) { // because vias are sometimes drawn larger than their m_Width would // provide, erasing them using a dirty rect must also compensate for // possibility (that the via is larger than its m_Width would provide). // because it is cheap to return a larger BoundingBox, do it so that // the via gets erased properly. Do not divide width by 2 for this reason. radius = m_Width; ymax = m_Start.y; xmax = m_Start.x; ymin = m_Start.y; xmin = m_Start.x; } else { radius = ( m_Width+1 )/2; ymax = MAX( m_Start.y, m_End.y ); xmax = MAX( m_Start.x, m_End.x ); ymin = MIN( m_Start.y, m_End.y ); xmin = MIN( m_Start.x, m_End.x ); } ymax += radius; xmax += radius; Loading Loading @@ -890,39 +916,6 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame ) */ bool TRACK::HitTest( const wxPoint& ref_pos ) { #if 0 int l_piste; /* demi-largeur de la piste */ int dx, dy, spot_cX, spot_cY; int ux0, uy0; /* calcul des coordonnees du segment teste */ l_piste = m_Width >> 1; /* l_piste = demi largeur piste */ ux0 = m_Start.x; uy0 = m_Start.y; /* coord de depart */ dx = m_End.x; dy = m_End.y; /* coord d'arrivee */ /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */ dx -= ux0; dy -= uy0; spot_cX = ref_pos.x - ux0; spot_cY = ref_pos.y - uy0; if( Type() == TYPEVIA ) /* VIA rencontree */ { return (double) spot_cX * spot_cX + (double) spot_cY * spot_cY <= (double) l_piste * l_piste; } else { if( DistanceTest( l_piste, dx, dy, spot_cX, spot_cY ) ) return true; } #else int radius = m_Width >> 1; // (dx, dy) is a vector from m_Start to m_End (an origin of m_Start) Loading @@ -944,8 +937,6 @@ bool TRACK::HitTest( const wxPoint& ref_pos ) return true; } #endif return false; } Loading pcbnew/clean.cpp +140 −140 Original line number Diff line number Diff line Loading @@ -792,7 +792,7 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche ) oldpercent = -1; frame->m_Pcb->m_Status_Pcb = 0; frame->Supprime_Une_Piste( DC, segment ); frame->Remove_One_Track( DC, segment ); next = frame->m_Pcb->m_Track; /* NextS a peut etre ete efface */ if( affiche ) Loading Loading
change_log.txt +4 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ email address. 2008-Mar-10 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ +pcbnew * Improved some comments on new functions. * Improved some comments on new functions dirty area functions * Changed void ConvertPcbUnitsToPixelsUnits( EDA_Rect& aRect ); to void ConvertPcbUnitsToPixelsUnits( EDA_Rect* aRect ); Loading @@ -21,6 +21,9 @@ email address. * Changed from "new wxDCClip()" to use an automatic wxDCClip() variable in drawpanel.cpp * Removed a printf() from "release" build of drawpanel.cpp * Added WinEDA_DrawPanel::PostDirtyRect() * Renamed Supprime_Une_Piste() to Remove_One_Track() and it now uses PostDirtyRect(). 2008-Mar-10 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> Loading
include/drawpanel_wxstruct.h +12 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,18 @@ public: wxPoint CursorRealPosition( const wxPoint& ScreenPos ); wxPoint CursorScreenPosition(); /** * Function PostDirtyRect * appends the given rectangle in pcb units to the DrawPanel's invalid * region list so that very soon (but not immediately), this rectangle * along with any other recently posted rectangles is redrawn. Conversion * to pixels is done in here. * @param aRect The rectangle to append, it must be orthogonal * (vertical and horizontal edges only), and it must be [,) in nature, i.e. * [pos, dim) == [inclusive, exclusive) */ void PostDirtyRect( EDA_Rect aRect ); /** * Function ConvertPcbUnitsToPixelsUnits * converts pos and size of the given EDA_Rect to pos and size in pixels, Loading
include/wxPcbStruct.h +2 −2 Original line number Diff line number Diff line Loading @@ -476,7 +476,7 @@ public: TRACK* Delete_Segment( wxDC* DC, TRACK* Track ); void Delete_Track( wxDC* DC, TRACK* Track ); void Delete_net( wxDC* DC, TRACK* Track ); void Supprime_Une_Piste( wxDC* DC, TRACK* pt_segm ); void Remove_One_Track( wxDC* DC, TRACK* pt_segm ); bool Resize_Pistes_Vias( wxDC* DC, bool Track, bool Via ); void Edit_Net_Width( wxDC* DC, int Netcode ); void Edit_Track_Width( wxDC* DC, TRACK* Track ); Loading
pcbnew/class_track.cpp +30 −39 Original line number Diff line number Diff line Loading @@ -210,11 +210,37 @@ EDA_Rect TRACK::GetBoundingBox() const // end of track is round, this is its radius, rounded up int radius = ( m_Width+1 )/2; int ymax = MAX( m_Start.y, m_End.y ); int xmax = MAX( m_Start.x, m_End.x ); int ymax; int xmax; int ymin = MIN( m_Start.y, m_End.y ); int xmin = MIN( m_Start.x, m_End.x ); int ymin; int xmin; if( Type() == TYPEVIA ) { // because vias are sometimes drawn larger than their m_Width would // provide, erasing them using a dirty rect must also compensate for // possibility (that the via is larger than its m_Width would provide). // because it is cheap to return a larger BoundingBox, do it so that // the via gets erased properly. Do not divide width by 2 for this reason. radius = m_Width; ymax = m_Start.y; xmax = m_Start.x; ymin = m_Start.y; xmin = m_Start.x; } else { radius = ( m_Width+1 )/2; ymax = MAX( m_Start.y, m_End.y ); xmax = MAX( m_Start.x, m_End.x ); ymin = MIN( m_Start.y, m_End.y ); xmin = MIN( m_Start.x, m_End.x ); } ymax += radius; xmax += radius; Loading Loading @@ -890,39 +916,6 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame ) */ bool TRACK::HitTest( const wxPoint& ref_pos ) { #if 0 int l_piste; /* demi-largeur de la piste */ int dx, dy, spot_cX, spot_cY; int ux0, uy0; /* calcul des coordonnees du segment teste */ l_piste = m_Width >> 1; /* l_piste = demi largeur piste */ ux0 = m_Start.x; uy0 = m_Start.y; /* coord de depart */ dx = m_End.x; dy = m_End.y; /* coord d'arrivee */ /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */ dx -= ux0; dy -= uy0; spot_cX = ref_pos.x - ux0; spot_cY = ref_pos.y - uy0; if( Type() == TYPEVIA ) /* VIA rencontree */ { return (double) spot_cX * spot_cX + (double) spot_cY * spot_cY <= (double) l_piste * l_piste; } else { if( DistanceTest( l_piste, dx, dy, spot_cX, spot_cY ) ) return true; } #else int radius = m_Width >> 1; // (dx, dy) is a vector from m_Start to m_End (an origin of m_Start) Loading @@ -944,8 +937,6 @@ bool TRACK::HitTest( const wxPoint& ref_pos ) return true; } #endif return false; } Loading
pcbnew/clean.cpp +140 −140 Original line number Diff line number Diff line Loading @@ -792,7 +792,7 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche ) oldpercent = -1; frame->m_Pcb->m_Status_Pcb = 0; frame->Supprime_Une_Piste( DC, segment ); frame->Remove_One_Track( DC, segment ); next = frame->m_Pcb->m_Track; /* NextS a peut etre ete efface */ if( affiche ) Loading