Commit f723c540 authored by charras's avatar charras

code cleaning. Some comments translated into English.

Added: Zones unfill in polygon mode
parent afd39b3d
...@@ -133,7 +133,7 @@ bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY ) ...@@ -133,7 +133,7 @@ bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY )
* de piste soit horizontal dans le nouveau repere */ * de piste soit horizontal dans le nouveau repere */
int angle; int angle;
angle = (int) ( atan2( (float) segY, (float) segX ) * 1800 / M_PI); angle = (int) ( atan2( (double) segY, (double) segX ) * 1800 / M_PI);
cXrot = pointX; cYrot = pointY; cXrot = pointX; cYrot = pointY;
RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */ RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */
...@@ -224,7 +224,7 @@ void RotatePoint( int* pX, int* pY, int angle ) ...@@ -224,7 +224,7 @@ void RotatePoint( int* pX, int* pY, int angle )
* pour une rotation de centre 0, 0, et d'angle angle ( en 1/10 degre) * pour une rotation de centre 0, 0, et d'angle angle ( en 1/10 degre)
*/ */
{ {
float fpx, fpy; double fpx, fpy;
int tmp; int tmp;
while( angle < 0 ) while( angle < 0 )
...@@ -262,7 +262,7 @@ void RotatePoint( int* pX, int* pY, int angle ) ...@@ -262,7 +262,7 @@ void RotatePoint( int* pX, int* pY, int angle )
fpx = (*pY * fsinus[angle]) + (*pX * fcosinus[angle]); fpx = (*pY * fsinus[angle]) + (*pX * fcosinus[angle]);
fpy = (*pY * fcosinus[angle]) - (*pX * fsinus[angle]); fpy = (*pY * fcosinus[angle]) - (*pX * fsinus[angle]);
*pX = (int) round( fpx ); *pX = (int) round( fpx );
*pY = (int) round( fpy ); *pY = (int) round( fpy );
} }
} }
...@@ -280,9 +280,9 @@ void RotatePoint( int* pX, int* pY, int cx, int cy, int angle ) ...@@ -280,9 +280,9 @@ void RotatePoint( int* pX, int* pY, int cx, int cy, int angle )
{ {
int ox, oy; int ox, oy;
ox = *pX - cx; ox = *pX - cx;
oy = *pY - cy; oy = *pY - cy;
RotatePoint( &ox, &oy, angle ); RotatePoint( &ox, &oy, angle );
*pX = ox + cx; *pX = ox + cx;
...@@ -302,9 +302,9 @@ void RotatePoint( wxPoint* point, int angle ) ...@@ -302,9 +302,9 @@ void RotatePoint( wxPoint* point, int angle )
{ {
int ox, oy; int ox, oy;
ox = point->x; ox = point->x;
oy = point->y; oy = point->y;
RotatePoint( &ox, &oy, angle ); RotatePoint( &ox, &oy, angle );
point->x = ox; point->x = ox;
point->y = oy; point->y = oy;
...@@ -323,9 +323,9 @@ void RotatePoint( wxPoint* point, const wxPoint& centre, int angle ) ...@@ -323,9 +323,9 @@ void RotatePoint( wxPoint* point, const wxPoint& centre, int angle )
{ {
int ox, oy; int ox, oy;
ox = point->x - centre.x; ox = point->x - centre.x;
oy = point->y - centre.y; oy = point->y - centre.y;
RotatePoint( &ox, &oy, angle ); RotatePoint( &ox, &oy, angle );
point->x = ox + centre.x; point->x = ox + centre.x;
point->y = oy + centre.y; point->y = oy + centre.y;
...@@ -339,11 +339,11 @@ void RotatePoint( double* pX, double* pY, double cx, double cy, int angle ) ...@@ -339,11 +339,11 @@ void RotatePoint( double* pX, double* pY, double cx, double cy, int angle )
{ {
double ox, oy; double ox, oy;
ox = *pX - cx; ox = *pX - cx;
oy = *pY - cy; oy = *pY - cy;
RotatePoint( &ox, &oy, angle ); RotatePoint( &ox, &oy, angle );
*pX = ox + cx; *pX = ox + cx;
*pY = oy + cy; *pY = oy + cy;
} }
...@@ -390,8 +390,8 @@ void RotatePoint( double* pX, double* pY, int angle ) ...@@ -390,8 +390,8 @@ void RotatePoint( double* pX, double* pY, int angle )
{ {
double fpx = (*pY * fsinus[angle]) + (*pX * fcosinus[angle]); double fpx = (*pY * fsinus[angle]) + (*pX * fcosinus[angle]);
double fpy = (*pY * fcosinus[angle]) - (*pX * fsinus[angle]); double fpy = (*pY * fcosinus[angle]) - (*pX * fsinus[angle]);
*pX = fpx; *pX = fpx;
*pY = fpy; *pY = fpy;
} }
} }
......
...@@ -256,9 +256,10 @@ static int TstAlignSegment( EDA_DrawLineStruct* RefSegm, ...@@ -256,9 +256,10 @@ static int TstAlignSegment( EDA_DrawLineStruct* RefSegm,
} }
else else
{ {
if( atan2( RefSegm->m_Start.x - RefSegm->m_End.x, RefSegm->m_Start.y - if( atan2( (double)(RefSegm->m_Start.x - RefSegm->m_End.x),
RefSegm->m_End.y ) == (double)(RefSegm->m_Start.y - RefSegm->m_End.y) ) ==
atan2( TstSegm->m_Start.x - TstSegm->m_End.x, TstSegm->m_Start.y - TstSegm->m_End.y ) ) atan2( (double)(TstSegm->m_Start.x - TstSegm->m_End.x),
(double)(TstSegm->m_Start.y - TstSegm->m_End.y) ) )
{ {
RefSegm->m_End = TstSegm->m_End; RefSegm->m_End = TstSegm->m_End;
return 1; return 1;
......
...@@ -834,7 +834,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen, ...@@ -834,7 +834,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
break; break;
dx = px - Arc->m_Pos.x; dx = px - Arc->m_Pos.x;
dy = py + Arc->m_Pos.y; dy = py + Arc->m_Pos.y;
ii = (int) sqrt( dx * dx + dy * dy ); ii = (int) sqrt( ((double)dx * dx) + ((double)dy * dy) );
if( abs( ii - Arc->m_Rayon ) <= seuil ) if( abs( ii - Arc->m_Rayon ) <= seuil )
return DrawItem; return DrawItem;
} }
...@@ -1015,7 +1015,7 @@ int distance( int dx, int dy, int spot_cX, int spot_cY, int seuil ) ...@@ -1015,7 +1015,7 @@ int distance( int dx, int dy, int spot_cX, int spot_cY, int seuil )
* de piste soit horizontal dans le nouveau repere */ * de piste soit horizontal dans le nouveau repere */
int angle; int angle;
angle = (int) ( atan2( (float) segY, (float) segX ) * 1800 / M_PI); angle = (int) ( atan2( (double) segY, (double) segX ) * 1800 / M_PI);
cXrot = pointX; cYrot = pointY; cXrot = pointX; cYrot = pointY;
RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */ RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */
RotatePoint( &segX, &segY, angle ); /* Rotation du segment */ RotatePoint( &segX, &segY, angle ); /* Rotation du segment */
......
...@@ -575,7 +575,7 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -575,7 +575,7 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
case COMPONENT_CIRCLE_DRAW_TYPE: case COMPONENT_CIRCLE_DRAW_TYPE:
dx = ( (LibDrawCircle*) CurrentDrawItem )->m_Pos.x - mx; dx = ( (LibDrawCircle*) CurrentDrawItem )->m_Pos.x - mx;
dy = ( (LibDrawCircle*) CurrentDrawItem )->m_Pos.y + my; dy = ( (LibDrawCircle*) CurrentDrawItem )->m_Pos.y + my;
( (LibDrawCircle*) CurrentDrawItem )->m_Rayon = (int) sqrt( (dx * dx) + (dy * dy) ); ( (LibDrawCircle*) CurrentDrawItem )->m_Rayon = (int) sqrt( ((double)dx * dx) + ((double)dy * dy) );
( (LibDrawCircle*) CurrentDrawItem )->m_Fill = FlSymbol_Fill; ( (LibDrawCircle*) CurrentDrawItem )->m_Fill = FlSymbol_Fill;
break; break;
...@@ -745,7 +745,7 @@ static void ComputeArc( LibDrawArc* DrawItem, wxPoint ArcCentre ) ...@@ -745,7 +745,7 @@ static void ComputeArc( LibDrawArc* DrawItem, wxPoint ArcCentre )
/* calcul de cX et cY pour que l'arc passe par ArcStartX,Y et ArcEndX,Y */ /* calcul de cX et cY pour que l'arc passe par ArcStartX,Y et ArcEndX,Y */
dx = ArcEndX - ArcStartX; dy = ArcEndY - ArcStartY; dx = ArcEndX - ArcStartX; dy = ArcEndY - ArcStartY;
cX -= ArcStartX; cY -= ArcStartY; cX -= ArcStartX; cY -= ArcStartY;
angle = (int) (atan2( dy, dx ) * 1800 / M_PI); angle = (int) (atan2( (double)dy, (double)dx ) * 1800 / M_PI);
RotatePoint( &dx, &dy, angle ); /* Le segment dx, dy est horizontal */ RotatePoint( &dx, &dy, angle ); /* Le segment dx, dy est horizontal */
/* -> dx = longueur, dy = 0 */ /* -> dx = longueur, dy = 0 */
RotatePoint( &cX, &cY, angle ); RotatePoint( &cX, &cY, angle );
...@@ -759,14 +759,14 @@ static void ComputeArc( LibDrawArc* DrawItem, wxPoint ArcCentre ) ...@@ -759,14 +759,14 @@ static void ComputeArc( LibDrawArc* DrawItem, wxPoint ArcCentre )
dx = ArcStartX - DrawItem->m_Pos.x; dx = ArcStartX - DrawItem->m_Pos.x;
dy = ArcStartY - DrawItem->m_Pos.y; dy = ArcStartY - DrawItem->m_Pos.y;
DrawItem->m_Rayon = (int) sqrt( (dx * dx) + (dy * dy) ); DrawItem->m_Rayon = (int) sqrt( ((double)dx * dx) + ((double)dy * dy) );
DrawItem->t1 = (int) (atan2( dy, dx ) * 1800 / M_PI); DrawItem->t1 = (int) (atan2( (double)dy, (double)dx ) * 1800 / M_PI);
dx = ArcEndX - DrawItem->m_Pos.x; dx = ArcEndX - DrawItem->m_Pos.x;
dy = ArcEndY - DrawItem->m_Pos.y; dy = ArcEndY - DrawItem->m_Pos.y;
DrawItem->t2 = (int) (atan2( dy, dx ) * 1800 / M_PI); DrawItem->t2 = (int) (atan2( (double)dy, (double)dx ) * 1800 / M_PI);
DrawItem->m_ArcStart.x = ArcStartX; DrawItem->m_ArcStart.x = ArcStartX;
DrawItem->m_ArcStart.y = ArcStartY; DrawItem->m_ArcStart.y = ArcStartY;
......
...@@ -436,7 +436,7 @@ int distance( int seuil ) ...@@ -436,7 +436,7 @@ int distance( int seuil )
* de piste soit horizontal dans le nouveau repere */ * de piste soit horizontal dans le nouveau repere */
int angle; int angle;
angle = (int) ( atan2( (float) segY, (float) segX ) * 1800 / M_PI); angle = (int) ( atan2( (double) segY, (double) segX ) * 1800 / M_PI);
cXrot = pointX; cYrot = pointY; cXrot = pointX; cYrot = pointY;
RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */ RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */
RotatePoint( &segX, &segY, angle ); /* Rotation du segment */ RotatePoint( &segX, &segY, angle ); /* Rotation du segment */
......
...@@ -570,8 +570,8 @@ enum main_id { ...@@ -570,8 +570,8 @@ enum main_id {
ID_POPUP_PCB_PLACE_ZONE_OUTLINES, ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT, ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT,
ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT, ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT,
ID_POPUP_PCB_REMOVE_FILLED_AREAS, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES,
ID_POPUP_ZONE_UNUSED4, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE,
ID_POPUP_PCB_DELETE_MARKER, ID_POPUP_PCB_DELETE_MARKER,
ID_POPUP_PCB_DELETE_COTATION, ID_POPUP_PCB_DELETE_COTATION,
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
/* exchange 2 items */ /* exchange 2 items */
#define EXCHG( a, b ) { typeof(a)__temp__ = (a); (a) = (b); (b) = __temp__; } #define EXCHG( a, b ) { typeof(a) __temp__ = (a); (a) = (b); (b) = __temp__; }
/* inline functions to insert menuitems with a icon: */ /* inline functions to insert menuitems with a icon: */
static inline void ADD_MENUITEM( wxMenu* menu, int id, static inline void ADD_MENUITEM( wxMenu* menu, int id,
......
No preview for this file type
...@@ -2,8 +2,8 @@ msgid "" ...@@ -2,8 +2,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: kicad\n" "Project-Id-Version: kicad\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-10-26 17:23+0100\n" "POT-Creation-Date: 2008-10-27 13:41+0100\n"
"PO-Revision-Date: 2008-10-26 17:24+0100\n" "PO-Revision-Date: 2008-10-27 13:42+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n" "Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
...@@ -347,7 +347,7 @@ msgstr "dimension" ...@@ -347,7 +347,7 @@ msgstr "dimension"
#: pcbnew/class_marker.cpp:133 #: pcbnew/class_marker.cpp:133
#: pcbnew/class_text_mod.cpp:503 #: pcbnew/class_text_mod.cpp:503
#: pcbnew/class_track.cpp:853 #: pcbnew/class_track.cpp:853
#: pcbnew/class_zone.cpp:775 #: pcbnew/class_zone.cpp:789
msgid "Type" msgid "Type"
msgstr "Type" msgstr "Type"
...@@ -370,7 +370,7 @@ msgstr "Segment" ...@@ -370,7 +370,7 @@ msgstr "Segment"
#: pcbnew/class_pcb_text.cpp:190 #: pcbnew/class_pcb_text.cpp:190
#: pcbnew/class_text_mod.cpp:516 #: pcbnew/class_text_mod.cpp:516
#: pcbnew/class_track.cpp:910 #: pcbnew/class_track.cpp:910
#: pcbnew/class_zone.cpp:809 #: pcbnew/class_zone.cpp:823
msgid "Layer" msgid "Layer"
msgstr "Couche" msgstr "Couche"
...@@ -571,12 +571,12 @@ msgid "Display" ...@@ -571,12 +571,12 @@ msgid "Display"
msgstr "Affichage" msgstr "Affichage"
#: pcbnew/class_track.cpp:869 #: pcbnew/class_track.cpp:869
#: pcbnew/class_zone.cpp:797 #: pcbnew/class_zone.cpp:811
msgid "NetName" msgid "NetName"
msgstr "NetName" msgstr "NetName"
#: pcbnew/class_track.cpp:874 #: pcbnew/class_track.cpp:874
#: pcbnew/class_zone.cpp:805 #: pcbnew/class_zone.cpp:819
msgid "NetCode" msgid "NetCode"
msgstr "NetCode" msgstr "NetCode"
...@@ -588,27 +588,27 @@ msgstr "Standard" ...@@ -588,27 +588,27 @@ msgstr "Standard"
msgid "Diam" msgid "Diam"
msgstr "Diam" msgstr "Diam"
#: pcbnew/class_zone.cpp:800 #: pcbnew/class_zone.cpp:814
msgid "Non Copper Zone" msgid "Non Copper Zone"
msgstr "Zone non Cuivre" msgstr "Zone non Cuivre"
#: pcbnew/class_zone.cpp:813 #: pcbnew/class_zone.cpp:827
msgid "Corners" msgid "Corners"
msgstr "Sommets" msgstr "Sommets"
#: pcbnew/class_zone.cpp:819 #: pcbnew/class_zone.cpp:833
msgid "No Grid" msgid "No Grid"
msgstr "Pas de Grille" msgstr "Pas de Grille"
#: pcbnew/class_zone.cpp:820 #: pcbnew/class_zone.cpp:834
msgid "Fill Grid" msgid "Fill Grid"
msgstr "Grille de Remplissage" msgstr "Grille de Remplissage"
#: pcbnew/class_zone.cpp:825 #: pcbnew/class_zone.cpp:839
msgid "Hatch lines" msgid "Hatch lines"
msgstr "Lignes de Hachure" msgstr "Lignes de Hachure"
#: pcbnew/class_zone.cpp:831 #: pcbnew/class_zone.cpp:845
msgid "Corners in DrawList" msgid "Corners in DrawList"
msgstr "Sommets en Liste de dessin" msgstr "Sommets en Liste de dessin"
...@@ -1822,8 +1822,8 @@ msgid "Fill or Refill All Zones" ...@@ -1822,8 +1822,8 @@ msgid "Fill or Refill All Zones"
msgstr "Remplir ou Re-remplir Toutes les Zones" msgstr "Remplir ou Re-remplir Toutes les Zones"
#: pcbnew/onrightclick.cpp:345 #: pcbnew/onrightclick.cpp:345
msgid "Remove filled areas" msgid "Remove Filled Areas in All Zones"
msgstr "Suppimer zones remplies" msgstr "Supprimer le Remplissage de toutes les Zones"
#: pcbnew/onrightclick.cpp:350 #: pcbnew/onrightclick.cpp:350
#: pcbnew/onrightclick.cpp:359 #: pcbnew/onrightclick.cpp:359
...@@ -2113,94 +2113,98 @@ msgstr "Addition d'une Zone Interdite" ...@@ -2113,94 +2113,98 @@ msgstr "Addition d'une Zone Interdite"
msgid "Fill Zone" msgid "Fill Zone"
msgstr "Remplir Zone" msgstr "Remplir Zone"
#: pcbnew/onrightclick.cpp:678 #: pcbnew/onrightclick.cpp:680
msgid "Remove Filled Areas in Zone"
msgstr "Supprimer le Remplissage de la Zone"
#: pcbnew/onrightclick.cpp:684
msgid "Move Zone" msgid "Move Zone"
msgstr "Déplace Zone" msgstr "Déplace Zone"
#: pcbnew/onrightclick.cpp:681 #: pcbnew/onrightclick.cpp:687
msgid "Edit Zone Params" msgid "Edit Zone Params"
msgstr "Editer Paramètres de la Zone" msgstr "Editer Paramètres de la Zone"
#: pcbnew/onrightclick.cpp:686 #: pcbnew/onrightclick.cpp:692
msgid "Delete Cutout" msgid "Delete Cutout"
msgstr "Supprimer Zone Interdite" msgstr "Supprimer Zone Interdite"
#: pcbnew/onrightclick.cpp:689 #: pcbnew/onrightclick.cpp:695
msgid "Delete Zone Outline" msgid "Delete Zone Outline"
msgstr "Supprimer Contour de Zone" msgstr "Supprimer Contour de Zone"
#: pcbnew/onrightclick.cpp:711 #: pcbnew/onrightclick.cpp:717
#: pcbnew/onrightclick.cpp:756 #: pcbnew/onrightclick.cpp:762
#: pcbnew/onrightclick.cpp:794 #: pcbnew/onrightclick.cpp:800
#: pcbnew/onrightclick.cpp:860 #: pcbnew/onrightclick.cpp:866
msgid "Move" msgid "Move"
msgstr "Move" msgstr "Move"
#: pcbnew/onrightclick.cpp:714 #: pcbnew/onrightclick.cpp:720
#: pcbnew/onrightclick.cpp:796 #: pcbnew/onrightclick.cpp:802
msgid "Drag" msgid "Drag"
msgstr "Drag" msgstr "Drag"
#: pcbnew/onrightclick.cpp:718 #: pcbnew/onrightclick.cpp:724
msgid "Rotate +" msgid "Rotate +"
msgstr "Rotation +" msgstr "Rotation +"
#: pcbnew/onrightclick.cpp:722 #: pcbnew/onrightclick.cpp:728
msgid "Rotate -" msgid "Rotate -"
msgstr "Rotation -" msgstr "Rotation -"
#: pcbnew/onrightclick.cpp:723 #: pcbnew/onrightclick.cpp:729
msgid "Flip" msgid "Flip"
msgstr "Change côté" msgstr "Change côté"
#: pcbnew/onrightclick.cpp:727 #: pcbnew/onrightclick.cpp:733
#: pcbnew/onrightclick.cpp:761 #: pcbnew/onrightclick.cpp:767
#: pcbnew/onrightclick.cpp:865 #: pcbnew/onrightclick.cpp:871
msgid "Edit" msgid "Edit"
msgstr "Editer" msgstr "Editer"
#: pcbnew/onrightclick.cpp:733 #: pcbnew/onrightclick.cpp:739
msgid "Delete Module" msgid "Delete Module"
msgstr "Supprimer Module" msgstr "Supprimer Module"
#: pcbnew/onrightclick.cpp:759 #: pcbnew/onrightclick.cpp:765
#: pcbnew/onrightclick.cpp:863 #: pcbnew/onrightclick.cpp:869
msgid "Rotate" msgid "Rotate"
msgstr "Rotation" msgstr "Rotation"
#: pcbnew/onrightclick.cpp:798 #: pcbnew/onrightclick.cpp:804
msgid "Edit Pad" msgid "Edit Pad"
msgstr "Edit Pad" msgstr "Edit Pad"
#: pcbnew/onrightclick.cpp:802 #: pcbnew/onrightclick.cpp:808
msgid "New Pad Settings" msgid "New Pad Settings"
msgstr "Nouvelles Caract. Pads" msgstr "Nouvelles Caract. Pads"
#: pcbnew/onrightclick.cpp:803 #: pcbnew/onrightclick.cpp:809
msgid "Copy current pad settings to this pad" msgid "Copy current pad settings to this pad"
msgstr "Copier les réglages courants pour ce pad" msgstr "Copier les réglages courants pour ce pad"
#: pcbnew/onrightclick.cpp:806 #: pcbnew/onrightclick.cpp:812
msgid "Export Pad Settings" msgid "Export Pad Settings"
msgstr "Exporte Caract. Pads" msgstr "Exporte Caract. Pads"
#: pcbnew/onrightclick.cpp:807 #: pcbnew/onrightclick.cpp:813
msgid "Copy this pad settings to current pad settings" msgid "Copy this pad settings to current pad settings"
msgstr "Copier les caractéristiques de ce pad vers les caractéristiques courantes" msgstr "Copier les caractéristiques de ce pad vers les caractéristiques courantes"
#: pcbnew/onrightclick.cpp:813 #: pcbnew/onrightclick.cpp:819
msgid "Global Pad Settings" msgid "Global Pad Settings"
msgstr "Edition Globale des pads" msgstr "Edition Globale des pads"
#: pcbnew/onrightclick.cpp:815 #: pcbnew/onrightclick.cpp:821
msgid "Copy this pad settings to all pads in this footprint (or similar footprints)" msgid "Copy this pad settings to all pads in this footprint (or similar footprints)"
msgstr "Copier les caractéristiques de ce pad vers tous les autres pads de ce module( ou modules similaires)" msgstr "Copier les caractéristiques de ce pad vers tous les autres pads de ce module( ou modules similaires)"
#: pcbnew/onrightclick.cpp:827 #: pcbnew/onrightclick.cpp:833
msgid "Autoroute Pad" msgid "Autoroute Pad"
msgstr "Autoroute Pad" msgstr "Autoroute Pad"
#: pcbnew/onrightclick.cpp:828 #: pcbnew/onrightclick.cpp:834
msgid "Autoroute Net" msgid "Autoroute Net"
msgstr "Autoroute Net" msgstr "Autoroute Net"
...@@ -2436,56 +2440,56 @@ msgstr "Erreur système sur écriture fichier \"%s\"" ...@@ -2436,56 +2440,56 @@ msgstr "Erreur système sur écriture fichier \"%s\""
msgid "Error writing to STRINGFORMATTER" msgid "Error writing to STRINGFORMATTER"
msgstr "Error writing to STRINGFORMATTER" msgstr "Error writing to STRINGFORMATTER"
#: pcbnew/edit.cpp:180 #: pcbnew/edit.cpp:181
#: pcbnew/editmod.cpp:45 #: pcbnew/editmod.cpp:45
msgid "Module Editor" msgid "Module Editor"
msgstr "Ouvrir Editeur de modules" msgstr "Ouvrir Editeur de modules"
#: pcbnew/edit.cpp:260 #: pcbnew/edit.cpp:261
msgid "Add Tracks" msgid "Add Tracks"
msgstr "Addition de Pistes" msgstr "Addition de Pistes"
#: pcbnew/edit.cpp:269 #: pcbnew/edit.cpp:270
msgid "Add Zones" msgid "Add Zones"
msgstr "Addition de Zones" msgstr "Addition de Zones"
#: pcbnew/edit.cpp:271 #: pcbnew/edit.cpp:272
msgid "Warning: Display Zone is OFF!!!" msgid "Warning: Display Zone is OFF!!!"
msgstr "Attention: Affichage zones désactivé !!!" msgstr "Attention: Affichage zones désactivé !!!"
#: pcbnew/edit.cpp:277 #: pcbnew/edit.cpp:278
msgid "Add Layer Alignment Target" msgid "Add Layer Alignment Target"
msgstr "Ajouter Mire de superposition" msgstr "Ajouter Mire de superposition"
#: pcbnew/edit.cpp:281 #: pcbnew/edit.cpp:282
msgid "Adjust Zero" msgid "Adjust Zero"
msgstr "Ajuster Zéro" msgstr "Ajuster Zéro"
#: pcbnew/edit.cpp:287 #: pcbnew/edit.cpp:288
msgid "Add Graphic" msgid "Add Graphic"
msgstr "Addition éléments graphiques" msgstr "Addition éléments graphiques"
#: pcbnew/edit.cpp:291 #: pcbnew/edit.cpp:292
msgid "Add Text" msgid "Add Text"
msgstr "Ajout de Texte" msgstr "Ajout de Texte"
#: pcbnew/edit.cpp:295 #: pcbnew/edit.cpp:296
msgid "Add Modules" msgid "Add Modules"
msgstr "Addition de Modules" msgstr "Addition de Modules"
#: pcbnew/edit.cpp:299 #: pcbnew/edit.cpp:300
msgid "Add Dimension" msgid "Add Dimension"
msgstr "Ajout de cotes" msgstr "Ajout de cotes"
#: pcbnew/edit.cpp:307 #: pcbnew/edit.cpp:308
msgid "Net Highlight" msgid "Net Highlight"
msgstr "Surbrillance des équipotentielles" msgstr "Surbrillance des équipotentielles"
#: pcbnew/edit.cpp:311 #: pcbnew/edit.cpp:312
msgid "Local Ratsnest" msgid "Local Ratsnest"
msgstr "Montrer le chevelu général" msgstr "Montrer le chevelu général"
#: pcbnew/edit.cpp:569 #: pcbnew/edit.cpp:579
msgid "Delete item" msgid "Delete item"
msgstr "Suppression d'éléments" msgstr "Suppression d'éléments"
...@@ -9869,7 +9873,7 @@ msgstr "Hollandais" ...@@ -9869,7 +9873,7 @@ msgstr "Hollandais"
msgid "Language" msgid "Language"
msgstr "Langage" msgstr "Langage"
#: 3d-viewer/3d_aux.cpp:207 #: 3d-viewer/3d_aux.cpp:206
msgid "Vertex " msgid "Vertex "
msgstr "Vertex " msgstr "Vertex "
......
...@@ -1060,7 +1060,8 @@ void MODULE::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -1060,7 +1060,8 @@ void MODULE::Display_Infos( WinEDA_DrawFrame* frame )
pos += 6; pos += 6;
if( flag ) // Affichage date de modification (utile en Module Editor) if( flag ) // Affichage date de modification (utile en Module Editor)
{ {
strcpy( Line, ctime( &m_LastEdit_Time ) ); time_t edit_time = m_LastEdit_Time;
strcpy( Line, ctime( &edit_time ) );
strtok( Line, " \n\r" ); strtok( Line, " \n\r" );
strcpy( bufcar, strtok( NULL, " \n\r" ) ); strcat( bufcar, " " ); strcpy( bufcar, strtok( NULL, " \n\r" ) ); strcat( bufcar, " " );
strcat( bufcar, strtok( NULL, " \n\r" ) ); strcat( bufcar, ", " ); strcat( bufcar, strtok( NULL, " \n\r" ) ); strcat( bufcar, ", " );
......
...@@ -20,13 +20,13 @@ class Struct3D_Master; ...@@ -20,13 +20,13 @@ class Struct3D_Master;
/* Flags :*/ /* Flags :*/
enum Mod_Attribut /* Attributs d'un module */ enum Mod_Attribut /* Attributs used for modules */
{ {
MOD_DEFAULT = 0, /* Type default */ MOD_DEFAULT = 0, /* Type default */
MOD_CMS = 1, /* Pour module apparaissant dans les MOD_CMS = 1, /* Set for modules listed in the automatic insertion list
* fichiers de placement automatique (principalement modules CMS */ * (usually SMD footprints) */
MOD_VIRTUAL = 2 /* Module virtuel constitue par un dessin sur circuit MOD_VIRTUAL = 2 /* Virtuel component: when created by copper shapes on board
* (connecteur, trou de percage..) */ * (Like edge card connectors, mounting hole...) */
}; };
...@@ -41,34 +41,33 @@ public: ...@@ -41,34 +41,33 @@ public:
wxPoint m_Pos; // Real coord on board wxPoint m_Pos; // Real coord on board
D_PAD* m_Pads; /* Pad list (linked list) */ D_PAD* m_Pads; /* Pad list (linked list) */
BOARD_ITEM* m_Drawings; /* Graphic items list (linked list) */ BOARD_ITEM* m_Drawings; /* Graphic items list (linked list) */
Struct3D_Master* m_3D_Drawings; /* Pointeur sur la liste des elements de trace 3D*/ Struct3D_Master* m_3D_Drawings; /* First item of the 3D shapes (linked list)*/
TEXTE_MODULE* m_Reference; // texte reference du composant (U34, R18..) TEXTE_MODULE* m_Reference; // Component reference (U34, R18..)
TEXTE_MODULE* m_Value; // texte valeur du composant (74LS00, 22K..) TEXTE_MODULE* m_Value; // Component value (74LS00, 22K..)
wxString m_LibRef; /* nom du module en librairie */ wxString m_LibRef; /* Name of the module in library (and the default value when loading amodule from the library) */
wxString m_AlternateReference; /* Used when m_Reference cannot be used to wxString m_AlternateReference; /* Used when m_Reference cannot be used to
* identify the footprint ( after a full reannotation of the schematic */ * identify the footprint ( after a full reannotation of the schematic */
int m_Attributs; /* Flags bits a bit ( voir enum Mod_Attribut ) */ int m_Attributs; /* Flags(ORed bits) ( see Mod_Attribut ) */
int m_Orient; /* orientation en 1/10 degres */ int m_Orient; /* orientation in 0.1 degrees */
int flag; /* flag utilise en trace rastnest et routage auto */ int flag; /* flag utilise en trace rastnest et routage auto */
int m_ModuleStatus; /* For autoplace: flags (LOCKED, AUTOPLACED) */ int m_ModuleStatus; /* For autoplace: flags (LOCKED, AUTOPLACED) */
EDA_Rect m_BoundaryBox; /* position/taille du cadre de reperage (coord locales)*/ EDA_Rect m_BoundaryBox; /* Bounding box coordinates relatives to the anchor, orient 0*/
EDA_Rect m_RealBoundaryBox; /* position/taille du module (coord relles) */ EDA_Rect m_RealBoundaryBox; /* Bounding box : coordinates on board, real orientation */
int m_PadNum; // Nombre total de pads int m_PadNum; // Pad count
int m_AltPadNum; // en placement auto Nombre de pads actifs pour int m_AltPadNum; // Pad with netcode > 0 (active pads)count
// les calculs
int m_CntRot90; // Automatic placement : cost ( 0..10 ) for 90 degrees rotaion (Horiz<->Vertical)
int m_CntRot90; // Placement auto: cout ( 0..10 ) de la rotation 90 degre int m_CntRot180; // Automatic placement : cost ( 0..10 ) for 180 degrees rotaion (UP <->Down)
int m_CntRot180; // Placement auto: cout ( 0..10 ) de la rotation 180 degre wxSize m_Ext; // Automatic placement margin around the module
wxSize m_Ext; // marges de "garde": utilise en placement auto. float m_Surface; // Bounding box area
float m_Surface; // surface du rectangle d'encadrement
unsigned long m_Link; // Temporary variable ( used in editions, ...)
unsigned long m_Link; // variable temporaire ( pour editions, ...)
long m_LastEdit_Time; // Date de la derniere modification du module (gestion de librairies) long m_LastEdit_Time; // Date de la derniere modification du module (gestion de librairies)
wxString m_Path; wxString m_Path;
wxString m_Doc; // Texte de description du module wxString m_Doc; // Module Description (info for users)
wxString m_KeyWord; // Liste des mots cles relatifs au module wxString m_KeyWord; // Keywords to select the module in lib
public: public:
MODULE( BOARD* parent ); MODULE( BOARD* parent );
...@@ -79,11 +78,17 @@ public: ...@@ -79,11 +78,17 @@ public:
MODULE* Next() { return (MODULE*) Pnext; } MODULE* Next() { return (MODULE*) Pnext; }
void Set_Rectangle_Encadrement(); /* mise a jour du rect d'encadrement /** Function Set_Rectangle_Encadrement()
* en coord locales (orient 0 et origine = pos module) */ * Calculates the bounding box
* for orient 0 et origin = module anchor)
*/
void Set_Rectangle_Encadrement();
void SetRectangleExinscrit(); /* mise a jour du rect d'encadrement /** function SetRectangleExinscrit()
* et de la surface en coord reelles */ * Calculates the real bounding box accordint to theboard position, and real orientaion
* and also calculates the area value (used in automatic placement)
*/
void SetRectangleExinscrit();
/** /**
* Function GetBoundingBox * Function GetBoundingBox
* returns the bounding box of this Footprint * returns the bounding box of this Footprint
...@@ -103,11 +108,11 @@ public: ...@@ -103,11 +108,11 @@ public:
} }
// deplacements // Moves
void SetPosition( const wxPoint& newpos ); void SetPosition( const wxPoint& newpos );
void SetOrientation( int newangle ); void SetOrientation( int newangle );
/* supprime du chainage la structure Struct */ /* Remove this from the linked list */
void UnLink(); void UnLink();
...@@ -151,7 +156,7 @@ public: ...@@ -151,7 +156,7 @@ public:
/** /**
* Function Read_GPCB_Descr * Function Read_GPCB_Descr
* Read a footprint description in GPCB format * Read a footprint description in GPCB format (newlib version)
* @param CmpFullFileName = Full file name (there is one footprint per file. * @param CmpFullFileName = Full file name (there is one footprint per file.
* this is also the footprint name * this is also the footprint name
* @return bool - true if success reading else false. * @return bool - true if success reading else false.
......
...@@ -61,10 +61,10 @@ public: ...@@ -61,10 +61,10 @@ public:
int m_Orient; // in 1/10 degrees int m_Orient; // in 1/10 degrees
int m_logical_connexion; // variable used in rastnest computations int m_logical_connexion; // variable used in rastnest computations
// handle block number in ratsnet connection // handle subnet (block) number in ratsnet connection
int m_physical_connexion; // variable used in rastnest computations int m_physical_connexion; // variable used in rastnest computations
// handle block number in track connection // handle physical subnet (block)number in track connection
protected: protected:
int m_ZoneSubnet; // variable used in rastnest computations int m_ZoneSubnet; // variable used in rastnest computations
// handle block number in zone connection // handle block number in zone connection
......
...@@ -38,6 +38,20 @@ ZONE_CONTAINER::~ZONE_CONTAINER() ...@@ -38,6 +38,20 @@ ZONE_CONTAINER::~ZONE_CONTAINER()
} }
/** virtual function GetPosition
* @return a wxPoint, position of the first point of the outline
*/
wxPoint& ZONE_CONTAINER::GetPosition()
{
static wxPoint pos;
if ( m_Poly )
{
pos = GetCornerPosition(0);
}
else pos = wxPoint(0,0);
return pos;
}
/*******************************************/ /*******************************************/
void ZONE_CONTAINER::SetNet( int anet_code ) void ZONE_CONTAINER::SetNet( int anet_code )
/*******************************************/ /*******************************************/
......
...@@ -53,13 +53,10 @@ public: ...@@ -53,13 +53,10 @@ public:
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
int ReadDescr( FILE* aFile, int* aLineNum = NULL ); int ReadDescr( FILE* aFile, int* aLineNum = NULL );
wxPoint& GetPosition() /** virtual function GetPosition
{ * @return a wxPoint, position of the first point of the outline
static wxPoint pos; */
wxPoint& GetPosition();
return pos;
}
void UnLink( void ) void UnLink( void )
{ {
......
...@@ -267,9 +267,9 @@ void WinEDA_BasePcbFrame::test_connexions( wxDC* DC ) ...@@ -267,9 +267,9 @@ void WinEDA_BasePcbFrame::test_connexions( wxDC* DC )
/***************************************************/ /***************************************************/
/** Function testing the connections relative to all nets /** Function testing the connections relative to all nets
* This function update le status du chevelu ( flag CH_ACTIF = 0 if a connection is found, = 1 else) * This function update the status of the ratsnest ( flag CH_ACTIF = 0 if a connection is found, = 1 else)
* track segments are assumed to be sorted by net codes. * track segments are assumed to be sorted by net codes.
* This is the case because when a new track is added, it is put in the linked link according to its net code. * This is the case because when a new track is added, it is inserted in the linked list according to its net code.
* and when nets are changed (when a new netlist is read) tracks are sorted before using this function * and when nets are changed (when a new netlist is read) tracks are sorted before using this function
* @param DC = current Device Context * @param DC = current Device Context
*/ */
...@@ -443,18 +443,18 @@ static void calcule_connexite_1_net( TRACK* pt_start_conn, TRACK* pt_end_conn ) ...@@ -443,18 +443,18 @@ static void calcule_connexite_1_net( TRACK* pt_start_conn, TRACK* pt_end_conn )
#define POS_AFF_CHREF 62 #define POS_AFF_CHREF 62
/******************************************************************************/ /******************************************************************************/
static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste, static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* aPcb, LISTE_PAD* pt_liste,
int px, int py, int masque_layer ) const wxPoint & posref, int masque_layer )
/******************************************************************************/ /******************************************************************************/
/** Function SuperFast_Locate_Pad_Connecte /** Function SuperFast_Locate_Pad_Connecte
* Locate the pad connected to a track ended at coord px, py * Locate the pad connected to a track ended at coord px, py
* A track is seen as connected if the px, py position is same as the pad position * A track is seen as connected if the px, py position is same as the pad position
* @param px = reference X coordinate * @param aPcb = the board.
* @param py = reference Y coordinate
* @param masque_layer = Layers (bit to bit) to consider
* @param pt_liste = Pointers to pads buffer * @param pt_liste = Pointers to pads buffer
* This buffer is a list like the list created by build_liste_pad, but sorted by increasing X pad coordinate * This buffer is a list like the list created by build_liste_pad, but sorted by increasing X pad coordinate
* @param posref = reference coordinate
* @param masque_layer = Layers (bit to bit) to consider
* @return : pointer on the connected pad * @return : pointer on the connected pad
* This function uses a fast search in this sorted pad list and it is faster than Fast_Locate_Pad_connecte(), * This function uses a fast search in this sorted pad list and it is faster than Fast_Locate_Pad_connecte(),
* But this sorted pad list must be built before calling this function. * But this sorted pad list must be built before calling this function.
...@@ -464,10 +464,10 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste, ...@@ -464,10 +464,10 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
{ {
D_PAD* pad; D_PAD* pad;
LISTE_PAD* ptr_pad, * lim; LISTE_PAD* ptr_pad, * lim;
int nb_pad = pcb->m_NbPads; int nb_pad = aPcb->m_NbPads;
int ii; int ii;
lim = pt_liste + (pcb->m_NbPads - 1 ); lim = pt_liste + (aPcb->m_NbPads - 1 );
ptr_pad = pt_liste; ptr_pad = pt_liste;
while( nb_pad ) while( nb_pad )
{ {
...@@ -478,14 +478,14 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste, ...@@ -478,14 +478,14 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
if( (ii & 1) && ( ii > 1 ) ) if( (ii & 1) && ( ii > 1 ) )
nb_pad++; nb_pad++;
if( pad->m_Pos.x < px ) /* Must search after this item */ if( pad->m_Pos.x < posref.x ) /* Must search after this item */
{ {
ptr_pad += nb_pad; ptr_pad += nb_pad;
if( ptr_pad > lim ) if( ptr_pad > lim )
ptr_pad = lim; ptr_pad = lim;
continue; continue;
} }
if( pad->m_Pos.x > px ) /* Must search before this item */ if( pad->m_Pos.x > posref.x ) /* Must search before this item */
{ {
ptr_pad -= nb_pad; ptr_pad -= nb_pad;
if( ptr_pad < pt_liste ) if( ptr_pad < pt_liste )
...@@ -493,13 +493,13 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste, ...@@ -493,13 +493,13 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
continue; continue;
} }
if( pad->m_Pos.x == px ) /* A suitable block is found (X coordinate matches the px reference: but wue must matches the Y coordinate */ if( pad->m_Pos.x == posref.x ) /* A suitable block is found (X coordinate matches the px reference: but wue must matches the Y coordinate */
{ {
/* Search the beginning of the block */ /* Search the beginning of the block */
while( ptr_pad >= pt_liste ) while( ptr_pad >= pt_liste )
{ {
pad = *ptr_pad; pad = *ptr_pad;
if( pad->m_Pos.x == px ) if( pad->m_Pos.x == posref.x )
ptr_pad--; ptr_pad--;
else else
break; break;
...@@ -513,10 +513,10 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste, ...@@ -513,10 +513,10 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
return NULL; /* outside suitable block */ return NULL; /* outside suitable block */
pad = *ptr_pad; pad = *ptr_pad;
if( pad->m_Pos.x != px ) if( pad->m_Pos.x != posref.x )
return NULL; /* outside suitable block */ return NULL; /* outside suitable block */
if( pad->m_Pos.y != py ) if( pad->m_Pos.y != posref.y )
continue; continue;
/* A Pad if found here: but it must mach the layer */ /* A Pad if found here: but it must mach the layer */
...@@ -615,8 +615,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche ) ...@@ -615,8 +615,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
/* Search for a pad on the segment starting point */ /* Search for a pad on the segment starting point */
pt_piste->start = SuperFast_Locate_Pad_Connecte( m_Pcb, pt_piste->start = SuperFast_Locate_Pad_Connecte( m_Pcb,
&sortedPads[0], &sortedPads[0],
pt_piste->m_Start.x, pt_piste->m_Start,
pt_piste->m_Start.y,
masque_layer ); masque_layer );
if( pt_piste->start != NULL ) if( pt_piste->start != NULL )
{ {
...@@ -627,8 +626,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche ) ...@@ -627,8 +626,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
/* Search for a pad on the segment ending point */ /* Search for a pad on the segment ending point */
pt_piste->end = SuperFast_Locate_Pad_Connecte( m_Pcb, pt_piste->end = SuperFast_Locate_Pad_Connecte( m_Pcb,
&sortedPads[0], &sortedPads[0],
pt_piste->m_End.x, pt_piste->m_End,
pt_piste->m_End.y,
masque_layer ); masque_layer );
if( pt_piste->end != NULL ) if( pt_piste->end != NULL )
......
...@@ -330,7 +330,7 @@ static void Montre_Position_New_Cotation( WinEDA_DrawPanel* panel, wxDC* DC, boo ...@@ -330,7 +330,7 @@ static void Montre_Position_New_Cotation( WinEDA_DrawPanel* panel, wxDC* DC, boo
/* Calcul de la direction de deplacement /* Calcul de la direction de deplacement
* ( perpendiculaire a l'axe de la cote ) */ * ( perpendiculaire a l'axe de la cote ) */
angle = atan2( deltay, deltax ) + (M_PI / 2); angle = atan2( (double)deltay, (double)deltax ) + (M_PI / 2);
deltax = pos.x - Cotation->TraitD_ox; deltax = pos.x - Cotation->TraitD_ox;
deltay = pos.y - Cotation->TraitD_oy; deltay = pos.y - Cotation->TraitD_oy;
...@@ -405,10 +405,10 @@ static void Ajuste_Details_Cotation( COTATION* Cotation ) ...@@ -405,10 +405,10 @@ static void Ajuste_Details_Cotation( COTATION* Cotation )
deltay = Cotation->TraitD_oy - Cotation->TraitG_oy; deltay = Cotation->TraitD_oy - Cotation->TraitG_oy;
/* Calcul de la cote */ /* Calcul de la cote */
mesure = (int) (hypot( (float) deltax, (float) deltay ) + 0.5 ); mesure = (int) (hypot( (double) deltax, (double) deltay ) + 0.5 );
if( deltax || deltay ) if( deltax || deltay )
angle = atan2( (float) deltay, (float) deltax ); angle = atan2( (double) deltay, (double) deltax );
else else
angle = 0.0; angle = 0.0;
......
...@@ -68,7 +68,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -68,7 +68,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE: case ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE:
case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER: case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER:
case ID_POPUP_PCB_FILL_ALL_ZONES: case ID_POPUP_PCB_FILL_ALL_ZONES:
case ID_POPUP_PCB_REMOVE_FILLED_AREAS: case ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES:
case ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE:
case ID_POPUP_PCB_PLACE_ZONE_CORNER: case ID_POPUP_PCB_PLACE_ZONE_CORNER:
case ID_POPUP_PCB_PLACE_ZONE_OUTLINES: case ID_POPUP_PCB_PLACE_ZONE_OUTLINES:
case ID_POPUP_PCB_EDIT_ZONE_PARAMS: case ID_POPUP_PCB_EDIT_ZONE_PARAMS:
...@@ -543,8 +544,17 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -543,8 +544,17 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
Fill_All_Zones( &dc ); Fill_All_Zones( &dc );
break; break;
case ID_POPUP_PCB_REMOVE_FILLED_AREAS: // Remove all zones : case ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE:
if ( ( GetCurItem())->Type() == TYPEZONE_CONTAINER)
{
((ZONE_CONTAINER* )GetCurItem())->m_FilledPolysList.clear();
GetScreen()->SetModify();
DrawPanel->Refresh();
}
break;
case ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES: // Remove all zones :
if( m_Pcb->m_Zone ) if( m_Pcb->m_Zone )
{ {
m_Pcb->m_Zone->DeleteStructList(); m_Pcb->m_Zone->DeleteStructList();
......
...@@ -283,7 +283,7 @@ void TraceSegmentPcb( BOARD* Pcb, TRACK* pt_segm, int color, int marge, int op_l ...@@ -283,7 +283,7 @@ void TraceSegmentPcb( BOARD* Pcb, TRACK* pt_segm, int color, int marge, int op_l
mask_layer = 1 << Route_Layer_TOP; mask_layer = 1 << Route_Layer_TOP;
else mask_layer = -1; else mask_layer = -1;
} }
if( color == VIA_IMPOSSIBLE ) if( color == VIA_IMPOSSIBLE )
mask_layer = -1; mask_layer = -1;
...@@ -464,7 +464,7 @@ void TraceFilledRectangle( BOARD* Pcb, ...@@ -464,7 +464,7 @@ void TraceFilledRectangle( BOARD* Pcb,
/*****************************************************************/ /*****************************************************************/
/* Fonction Surchargee. /* Fonction Surchargee.
* *
* Met a la valeur color l'ensemble des cellules du board inscrites dans * Met a la valeur color l'ensemble des cellules du board inscrites dans
* le rectangle de coord ux0,uy0 ( angle haut a gauche ) * le rectangle de coord ux0,uy0 ( angle haut a gauche )
* a ux1,uy1 ( angle bas a droite ) * a ux1,uy1 ( angle bas a droite )
...@@ -545,7 +545,7 @@ void TraceFilledRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1, int a ...@@ -545,7 +545,7 @@ void TraceFilledRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1, int a
/***********************************************************************************/ /***********************************************************************************/
/* Fonction Surchargee. /* Fonction Surchargee.
* *
* Met a la valeur color l'ensemble des cellules du board inscrites dans * Met a la valeur color l'ensemble des cellules du board inscrites dans
* le rectangle de coord ux0,uy0 ( angle haut a droite ) * le rectangle de coord ux0,uy0 ( angle haut a droite )
* a ux1,uy1 ( angle bas a gauche ) * a ux1,uy1 ( angle bas a gauche )
...@@ -595,8 +595,8 @@ void TraceFilledRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1, int a ...@@ -595,8 +595,8 @@ void TraceFilledRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1, int a
ux1 -= Pcb->m_BoundaryBox.m_Pos.x; uy1 -= Pcb->m_BoundaryBox.m_Pos.y; ux1 -= Pcb->m_BoundaryBox.m_Pos.x; uy1 -= Pcb->m_BoundaryBox.m_Pos.y;
cx = (ux0 + ux1) / 2; cy = (uy0 + uy1) / 2; cx = (ux0 + ux1) / 2; cy = (uy0 + uy1) / 2;
rayon = (int) sqrt( (float) (cx - ux0) * (cx - ux0) rayon = (int) sqrt( (double) (cx - ux0) * (cx - ux0)
+ (float) (cy - uy0) * (cy - uy0) ); + (double) (cy - uy0) * (cy - uy0) );
/* Calcul des coord limites des cellules appartenant au rectangle */ /* Calcul des coord limites des cellules appartenant au rectangle */
row_max = (cy + rayon) / g_GridRoutingSize; row_max = (cy + rayon) / g_GridRoutingSize;
...@@ -719,7 +719,7 @@ void DrawSegmentQcq( int ux0, int uy0, int ux1, int uy1, int lg, int layer, ...@@ -719,7 +719,7 @@ void DrawSegmentQcq( int ux0, int uy0, int ux1, int uy1, int lg, int layer,
dx = ux1 - ux0; dy = uy1 - uy0; dx = ux1 - ux0; dy = uy1 - uy0;
if( dx ) if( dx )
angle = (int) (atan2( dy, dx ) * 1800 / M_PI); angle = (int) (atan2( (double)dy, (double)dx ) * 1800 / M_PI);
else else
{ {
angle = 900; if( dy < 0 ) angle = 900; if( dy < 0 )
......
...@@ -341,8 +341,8 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -341,8 +341,8 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_FILL_ALL_ZONES, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_FILL_ALL_ZONES,
_( "Fill or Refill All Zones" ), fill_zone_xpm ); _( "Fill or Refill All Zones" ), fill_zone_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_REMOVE_FILLED_AREAS, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES,
_( "Remove filled areas" ), fill_zone_xpm ); _( "Remove Filled Areas in All Zones" ), fill_zone_xpm );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
} }
...@@ -674,6 +674,12 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu ...@@ -674,6 +674,12 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_FILL_ZONE, ADD_MENUITEM( zones_menu, ID_POPUP_PCB_FILL_ZONE,
_( "Fill Zone" ), fill_zone_xpm ); _( "Fill Zone" ), fill_zone_xpm );
if (edge_zone->m_FilledPolysList.size() > 0 )
{
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE,
_( "Remove Filled Areas in Zone" ), fill_zone_xpm );
}
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, ADD_MENUITEM( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES,
_( "Move Zone" ), move_xpm ); _( "Move Zone" ), move_xpm );
......
...@@ -693,13 +693,13 @@ void trace_1_pad_TRAPEZE_HPGL( wxPoint padpos, wxSize size, wxSize delta, ...@@ -693,13 +693,13 @@ void trace_1_pad_TRAPEZE_HPGL( wxPoint padpos, wxSize size, wxSize delta,
/* Calcul du demi angle d'inclinaison des cotes du trapeze */ /* Calcul du demi angle d'inclinaison des cotes du trapeze */
if( delta.y ) /* Trapeze horizontal */ if( delta.y ) /* Trapeze horizontal */
{ {
fangle = atan2( (float) (polygone[1].y - polygone[0].y), fangle = atan2( (double) (polygone[1].y - polygone[0].y),
(float) (polygone[1].x - polygone[0].x) ) / 2; (double) (polygone[1].x - polygone[0].x) ) / 2;
} }
else else
{ {
fangle = atan2( (float) (polygone[3].y - polygone[0].y), fangle = atan2( (double) (polygone[3].y - polygone[0].y),
(float) (polygone[3].x - polygone[0].x) ) / 2; (double) (polygone[3].x - polygone[0].x) ) / 2;
} }
/* Trace du contour */ /* Trace du contour */
...@@ -871,7 +871,7 @@ void trace_1_segment_HPGL( int pos_X0, int pos_Y0, int pos_X1, int pos_Y1, ...@@ -871,7 +871,7 @@ void trace_1_segment_HPGL( int pos_X0, int pos_Y0, int pos_X1, int pos_Y1,
} }
else else
{ {
alpha = atan2( (float) size.y, (float) size.x ); alpha = atan2( (double) size.y, (double) size.x );
sin_alpha = sin( alpha ); sin_alpha = sin( alpha );
cos_alpha = cos( alpha ); cos_alpha = cos( alpha );
} }
......
...@@ -28,7 +28,7 @@ static bool DisplayRastnestInProgress; // Enable the display of the ratsnes ...@@ -28,7 +28,7 @@ static bool DisplayRastnestInProgress; // Enable the display of the ratsnes
* Building the general ratsnest: * Building the general ratsnest:
* I used the "lee algoritm". * I used the "lee algoritm".
* This is a 2 steps algoritm. * This is a 2 steps algoritm.
* the m_logical_connexion member of pads handle a "block number" or a "cluster number" * the m_logical_connexion member of pads handle a "block number" or a "cluster number" or a "subnet number"
* initially, m_logical_connexion = 0 (pad not connected). * initially, m_logical_connexion = 0 (pad not connected).
* Build_Board_Ratsnest( wxDC* DC ) Create this rastnest * Build_Board_Ratsnest( wxDC* DC ) Create this rastnest
* for each net: * for each net:
...@@ -39,7 +39,7 @@ static bool DisplayRastnestInProgress; // Enable the display of the ratsnes ...@@ -39,7 +39,7 @@ static bool DisplayRastnestInProgress; // Enable the display of the ratsnes
* link these 2 pads (i.e. create a ratsnest item) * link these 2 pads (i.e. create a ratsnest item)
* the pads are grouped in a logical block ( a cluster). * the pads are grouped in a logical block ( a cluster).
* until no pad without link found. * until no pad without link found.
* Each logical block has a number called block number, * Each logical block has a number called block number or "subnet number",
* stored in m_logical_connexion member for each pad of the block. * stored in m_logical_connexion member for each pad of the block.
* The first block has its block number = 1, the second is 2 ... * The first block has its block number = 1, the second is 2 ...
* the function to do thas is gen_rats_pad_to_pad() * the function to do thas is gen_rats_pad_to_pad()
...@@ -1155,8 +1155,8 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module ) ...@@ -1155,8 +1155,8 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
tri_par_net ); tri_par_net );
/* Compute the internal ratsnet: /* Compute the internal ratsnet:
* this is the same as general ratsnest, but considers onluy tje currant footprint pads * this is the same as general ratsnest, but considers only the current footprint pads
* it is therefore not time consumming, and it is made onlu once * it is therefore not time consuming, and it is made only once
*/ */
local_liste_chevelu = (CHEVELU*) pt_liste_pad; // buffer chevelu a la suite de la liste des pads local_liste_chevelu = (CHEVELU*) pt_liste_pad; // buffer chevelu a la suite de la liste des pads
nb_local_chevelu = 0; nb_local_chevelu = 0;
...@@ -1282,7 +1282,7 @@ calcul_chevelu_ext: ...@@ -1282,7 +1282,7 @@ calcul_chevelu_ext:
local_chevelu++; local_chevelu++;
} }
/* return the newt free memory buffer address, in the general buffer */ /* return the new free memory buffer address, in the general buffer */
adr_max = MAX( adr_max, (char*) (local_chevelu + 1) ); adr_max = MAX( adr_max, (char*) (local_chevelu + 1) );
return (char*) (local_chevelu + 1); /* the struct pointed by local_chevelu is used return (char*) (local_chevelu + 1); /* the struct pointed by local_chevelu is used
......
...@@ -28,10 +28,10 @@ using namespace std; ...@@ -28,10 +28,10 @@ using namespace std;
#include "zones.h" #include "zones.h"
static void CalculateSubAreaBoundaryBox( EDA_Rect& aBbox, static void CalculateSubAreaBoundaryBox( EDA_Rect& aBbox,
std::vector <CPolyPt> aPolysList, std::vector <CPolyPt> aPolysList,
int aIndexStart, int aIndexStart,
int aIndexEnd ); int aIndexEnd );
/* Local variables */ /* Local variables */
std::vector <wxPoint> s_ListPoints; // list of coordinates of pads and vias on this layer and on this net. std::vector <wxPoint> s_ListPoints; // list of coordinates of pads and vias on this layer and on this net.
...@@ -116,10 +116,20 @@ void ZONE_CONTAINER::Test_For_Copper_Island_And_Remove_Insulated_Islands( BOARD* ...@@ -116,10 +116,20 @@ void ZONE_CONTAINER::Test_For_Copper_Island_And_Remove_Insulated_Islands( BOARD*
} }
void CalculateSubAreaBoundaryBox( EDA_Rect& aBbox, /******************************************************************/
void CalculateSubAreaBoundaryBox( EDA_Rect& aBbox,
std::vector <CPolyPt> aPolysList, std::vector <CPolyPt> aPolysList,
int aIndexStart, int aIndexStart,
int aIndexEnd ) int aIndexEnd )
/******************************************************************/
/** function CalculateSubAreaBoundaryBox
* Calculates the bounding box of a polygon stored in a vector <CPolyPt>
* @param aBbox = EDA_Rect to init as bounding box
* @param aPolysList = set of CPolyPt that are the corners of one or more polygons
* @param aIndexStart = index of the first corner of a polygon in aPolysList
* @param aIndexEnd = index of the last corner of a polygon in aPolysList
*/
{ {
CPolyPt start_point, end_point; CPolyPt start_point, end_point;
......
...@@ -1535,8 +1535,8 @@ void CPolyLine::AppendArc( int xi, int yi, int xf, int yf, int xc, int yc, int n ...@@ -1535,8 +1535,8 @@ void CPolyLine::AppendArc( int xi, int yi, int xf, int yf, int xc, int yc, int n
double r = sqrt( (double) (xi - xc) * (xi - xc) + (double) (yi - yc) * (yi - yc) ); double r = sqrt( (double) (xi - xc) * (xi - xc) + (double) (yi - yc) * (yi - yc) );
// get angles of start and finish // get angles of start and finish
double th_i = atan2( (double) yi - yc, (double) xi - xc ); double th_i = atan2( (double) (yi - yc), (double) (xi - xc) );
double th_f = atan2( (double) yf - yc, (double) xf - xc ); double th_f = atan2( (double) (yf - yc), (double) (xf - xc) );
double th_d = (th_f - th_i) / (num - 1); double th_d = (th_f - th_i) / (num - 1);
double theta = th_i; double theta = th_i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment