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 )
* de piste soit horizontal dans le nouveau repere */
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;
RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */
......@@ -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)
*/
{
float fpx, fpy;
double fpx, fpy;
int tmp;
while( angle < 0 )
......
......@@ -256,9 +256,10 @@ static int TstAlignSegment( EDA_DrawLineStruct* RefSegm,
}
else
{
if( atan2( RefSegm->m_Start.x - RefSegm->m_End.x, 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 ) )
if( atan2( (double)(RefSegm->m_Start.x - RefSegm->m_End.x),
(double)(RefSegm->m_Start.y - RefSegm->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;
return 1;
......
......@@ -834,7 +834,7 @@ LibEDA_BaseStruct* LocateDrawItem( SCH_SCREEN* Screen,
break;
dx = px - Arc->m_Pos.x;
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 )
return DrawItem;
}
......@@ -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 */
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;
RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */
RotatePoint( &segX, &segY, angle ); /* Rotation du segment */
......
......@@ -575,7 +575,7 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
case COMPONENT_CIRCLE_DRAW_TYPE:
dx = ( (LibDrawCircle*) CurrentDrawItem )->m_Pos.x - mx;
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;
break;
......@@ -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 */
dx = ArcEndX - ArcStartX; dy = ArcEndY - 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 */
/* -> dx = longueur, dy = 0 */
RotatePoint( &cX, &cY, angle );
......@@ -759,14 +759,14 @@ static void ComputeArc( LibDrawArc* DrawItem, wxPoint ArcCentre )
dx = ArcStartX - DrawItem->m_Pos.x;
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;
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.y = ArcStartY;
......
......@@ -436,7 +436,7 @@ int distance( int seuil )
* de piste soit horizontal dans le nouveau repere */
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;
RotatePoint( &cXrot, &cYrot, angle ); /* Rotation du point a tester */
RotatePoint( &segX, &segY, angle ); /* Rotation du segment */
......
......@@ -570,8 +570,8 @@ enum main_id {
ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT,
ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT,
ID_POPUP_PCB_REMOVE_FILLED_AREAS,
ID_POPUP_ZONE_UNUSED4,
ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES,
ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE,
ID_POPUP_PCB_DELETE_MARKER,
ID_POPUP_PCB_DELETE_COTATION,
......
......@@ -49,7 +49,7 @@
/* 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: */
static inline void ADD_MENUITEM( wxMenu* menu, int id,
......
No preview for this file type
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: kicad\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-10-26 17:23+0100\n"
"PO-Revision-Date: 2008-10-26 17:24+0100\n"
"POT-Creation-Date: 2008-10-27 13:41+0100\n"
"PO-Revision-Date: 2008-10-27 13:42+0100\n"
"Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n"
"MIME-Version: 1.0\n"
......@@ -347,7 +347,7 @@ msgstr "dimension"
#: pcbnew/class_marker.cpp:133
#: pcbnew/class_text_mod.cpp:503
#: pcbnew/class_track.cpp:853
#: pcbnew/class_zone.cpp:775
#: pcbnew/class_zone.cpp:789
msgid "Type"
msgstr "Type"
......@@ -370,7 +370,7 @@ msgstr "Segment"
#: pcbnew/class_pcb_text.cpp:190
#: pcbnew/class_text_mod.cpp:516
#: pcbnew/class_track.cpp:910
#: pcbnew/class_zone.cpp:809
#: pcbnew/class_zone.cpp:823
msgid "Layer"
msgstr "Couche"
......@@ -571,12 +571,12 @@ msgid "Display"
msgstr "Affichage"
#: pcbnew/class_track.cpp:869
#: pcbnew/class_zone.cpp:797
#: pcbnew/class_zone.cpp:811
msgid "NetName"
msgstr "NetName"
#: pcbnew/class_track.cpp:874
#: pcbnew/class_zone.cpp:805
#: pcbnew/class_zone.cpp:819
msgid "NetCode"
msgstr "NetCode"
......@@ -588,27 +588,27 @@ msgstr "Standard"
msgid "Diam"
msgstr "Diam"
#: pcbnew/class_zone.cpp:800
#: pcbnew/class_zone.cpp:814
msgid "Non Copper Zone"
msgstr "Zone non Cuivre"
#: pcbnew/class_zone.cpp:813
#: pcbnew/class_zone.cpp:827
msgid "Corners"
msgstr "Sommets"
#: pcbnew/class_zone.cpp:819
#: pcbnew/class_zone.cpp:833
msgid "No Grid"
msgstr "Pas de Grille"
#: pcbnew/class_zone.cpp:820
#: pcbnew/class_zone.cpp:834
msgid "Fill Grid"
msgstr "Grille de Remplissage"
#: pcbnew/class_zone.cpp:825
#: pcbnew/class_zone.cpp:839
msgid "Hatch lines"
msgstr "Lignes de Hachure"
#: pcbnew/class_zone.cpp:831
#: pcbnew/class_zone.cpp:845
msgid "Corners in DrawList"
msgstr "Sommets en Liste de dessin"
......@@ -1822,8 +1822,8 @@ msgid "Fill or Refill All Zones"
msgstr "Remplir ou Re-remplir Toutes les Zones"
#: pcbnew/onrightclick.cpp:345
msgid "Remove filled areas"
msgstr "Suppimer zones remplies"
msgid "Remove Filled Areas in All Zones"
msgstr "Supprimer le Remplissage de toutes les Zones"
#: pcbnew/onrightclick.cpp:350
#: pcbnew/onrightclick.cpp:359
......@@ -2113,94 +2113,98 @@ msgstr "Addition d'une Zone Interdite"
msgid "Fill 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"
msgstr "Déplace Zone"
#: pcbnew/onrightclick.cpp:681
#: pcbnew/onrightclick.cpp:687
msgid "Edit Zone Params"
msgstr "Editer Paramètres de la Zone"
#: pcbnew/onrightclick.cpp:686
#: pcbnew/onrightclick.cpp:692
msgid "Delete Cutout"
msgstr "Supprimer Zone Interdite"
#: pcbnew/onrightclick.cpp:689
#: pcbnew/onrightclick.cpp:695
msgid "Delete Zone Outline"
msgstr "Supprimer Contour de Zone"
#: pcbnew/onrightclick.cpp:711
#: pcbnew/onrightclick.cpp:756
#: pcbnew/onrightclick.cpp:794
#: pcbnew/onrightclick.cpp:860
#: pcbnew/onrightclick.cpp:717
#: pcbnew/onrightclick.cpp:762
#: pcbnew/onrightclick.cpp:800
#: pcbnew/onrightclick.cpp:866
msgid "Move"
msgstr "Move"
#: pcbnew/onrightclick.cpp:714
#: pcbnew/onrightclick.cpp:796
#: pcbnew/onrightclick.cpp:720
#: pcbnew/onrightclick.cpp:802
msgid "Drag"
msgstr "Drag"
#: pcbnew/onrightclick.cpp:718
#: pcbnew/onrightclick.cpp:724
msgid "Rotate +"
msgstr "Rotation +"
#: pcbnew/onrightclick.cpp:722
#: pcbnew/onrightclick.cpp:728
msgid "Rotate -"
msgstr "Rotation -"
#: pcbnew/onrightclick.cpp:723
#: pcbnew/onrightclick.cpp:729
msgid "Flip"
msgstr "Change côté"
#: pcbnew/onrightclick.cpp:727
#: pcbnew/onrightclick.cpp:761
#: pcbnew/onrightclick.cpp:865
#: pcbnew/onrightclick.cpp:733
#: pcbnew/onrightclick.cpp:767
#: pcbnew/onrightclick.cpp:871
msgid "Edit"
msgstr "Editer"
#: pcbnew/onrightclick.cpp:733
#: pcbnew/onrightclick.cpp:739
msgid "Delete Module"
msgstr "Supprimer Module"
#: pcbnew/onrightclick.cpp:759
#: pcbnew/onrightclick.cpp:863
#: pcbnew/onrightclick.cpp:765
#: pcbnew/onrightclick.cpp:869
msgid "Rotate"
msgstr "Rotation"
#: pcbnew/onrightclick.cpp:798
#: pcbnew/onrightclick.cpp:804
msgid "Edit Pad"
msgstr "Edit Pad"
#: pcbnew/onrightclick.cpp:802
#: pcbnew/onrightclick.cpp:808
msgid "New Pad Settings"
msgstr "Nouvelles Caract. Pads"
#: pcbnew/onrightclick.cpp:803
#: pcbnew/onrightclick.cpp:809
msgid "Copy current pad settings to this pad"
msgstr "Copier les réglages courants pour ce pad"
#: pcbnew/onrightclick.cpp:806
#: pcbnew/onrightclick.cpp:812
msgid "Export Pad Settings"
msgstr "Exporte Caract. Pads"
#: pcbnew/onrightclick.cpp:807
#: pcbnew/onrightclick.cpp:813
msgid "Copy this pad settings to current pad settings"
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"
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)"
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"
msgstr "Autoroute Pad"
#: pcbnew/onrightclick.cpp:828
#: pcbnew/onrightclick.cpp:834
msgid "Autoroute Net"
msgstr "Autoroute Net"
......@@ -2436,56 +2440,56 @@ msgstr "Erreur système sur écriture fichier \"%s\""
msgid "Error writing to STRINGFORMATTER"
msgstr "Error writing to STRINGFORMATTER"
#: pcbnew/edit.cpp:180
#: pcbnew/edit.cpp:181
#: pcbnew/editmod.cpp:45
msgid "Module Editor"
msgstr "Ouvrir Editeur de modules"
#: pcbnew/edit.cpp:260
#: pcbnew/edit.cpp:261
msgid "Add Tracks"
msgstr "Addition de Pistes"
#: pcbnew/edit.cpp:269
#: pcbnew/edit.cpp:270
msgid "Add Zones"
msgstr "Addition de Zones"
#: pcbnew/edit.cpp:271
#: pcbnew/edit.cpp:272
msgid "Warning: Display Zone is OFF!!!"
msgstr "Attention: Affichage zones désactivé !!!"
#: pcbnew/edit.cpp:277
#: pcbnew/edit.cpp:278
msgid "Add Layer Alignment Target"
msgstr "Ajouter Mire de superposition"
#: pcbnew/edit.cpp:281
#: pcbnew/edit.cpp:282
msgid "Adjust Zero"
msgstr "Ajuster Zéro"
#: pcbnew/edit.cpp:287
#: pcbnew/edit.cpp:288
msgid "Add Graphic"
msgstr "Addition éléments graphiques"
#: pcbnew/edit.cpp:291
#: pcbnew/edit.cpp:292
msgid "Add Text"
msgstr "Ajout de Texte"
#: pcbnew/edit.cpp:295
#: pcbnew/edit.cpp:296
msgid "Add Modules"
msgstr "Addition de Modules"
#: pcbnew/edit.cpp:299
#: pcbnew/edit.cpp:300
msgid "Add Dimension"
msgstr "Ajout de cotes"
#: pcbnew/edit.cpp:307
#: pcbnew/edit.cpp:308
msgid "Net Highlight"
msgstr "Surbrillance des équipotentielles"
#: pcbnew/edit.cpp:311
#: pcbnew/edit.cpp:312
msgid "Local Ratsnest"
msgstr "Montrer le chevelu général"
#: pcbnew/edit.cpp:569
#: pcbnew/edit.cpp:579
msgid "Delete item"
msgstr "Suppression d'éléments"
......@@ -9869,7 +9873,7 @@ msgstr "Hollandais"
msgid "Language"
msgstr "Langage"
#: 3d-viewer/3d_aux.cpp:207
#: 3d-viewer/3d_aux.cpp:206
msgid "Vertex "
msgstr "Vertex "
......
......@@ -1060,7 +1060,8 @@ void MODULE::Display_Infos( WinEDA_DrawFrame* frame )
pos += 6;
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" );
strcpy( bufcar, strtok( NULL, " \n\r" ) ); strcat( bufcar, " " );
strcat( bufcar, strtok( NULL, " \n\r" ) ); strcat( bufcar, ", " );
......
......@@ -20,13 +20,13 @@ class Struct3D_Master;
/* Flags :*/
enum Mod_Attribut /* Attributs d'un module */
enum Mod_Attribut /* Attributs used for modules */
{
MOD_DEFAULT = 0, /* Type default */
MOD_CMS = 1, /* Pour module apparaissant dans les
* fichiers de placement automatique (principalement modules CMS */
MOD_VIRTUAL = 2 /* Module virtuel constitue par un dessin sur circuit
* (connecteur, trou de percage..) */
MOD_CMS = 1, /* Set for modules listed in the automatic insertion list
* (usually SMD footprints) */
MOD_VIRTUAL = 2 /* Virtuel component: when created by copper shapes on board
* (Like edge card connectors, mounting hole...) */
};
......@@ -41,34 +41,33 @@ public:
wxPoint m_Pos; // Real coord on board
D_PAD* m_Pads; /* Pad 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*/
TEXTE_MODULE* m_Reference; // texte reference du composant (U34, R18..)
TEXTE_MODULE* m_Value; // texte valeur du composant (74LS00, 22K..)
wxString m_LibRef; /* nom du module en librairie */
Struct3D_Master* m_3D_Drawings; /* First item of the 3D shapes (linked list)*/
TEXTE_MODULE* m_Reference; // Component reference (U34, R18..)
TEXTE_MODULE* m_Value; // Component value (74LS00, 22K..)
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
* identify the footprint ( after a full reannotation of the schematic */
int m_Attributs; /* Flags bits a bit ( voir enum Mod_Attribut ) */
int m_Orient; /* orientation en 1/10 degres */
int m_Attributs; /* Flags(ORed bits) ( see Mod_Attribut ) */
int m_Orient; /* orientation in 0.1 degrees */
int flag; /* flag utilise en trace rastnest et routage auto */
int m_ModuleStatus; /* For autoplace: flags (LOCKED, AUTOPLACED) */
EDA_Rect m_BoundaryBox; /* position/taille du cadre de reperage (coord locales)*/
EDA_Rect m_RealBoundaryBox; /* position/taille du module (coord relles) */
int m_PadNum; // Nombre total de pads
int m_AltPadNum; // en placement auto Nombre de pads actifs pour
// les calculs
int m_CntRot90; // Placement auto: cout ( 0..10 ) de la rotation 90 degre
int m_CntRot180; // Placement auto: cout ( 0..10 ) de la rotation 180 degre
wxSize m_Ext; // marges de "garde": utilise en placement auto.
float m_Surface; // surface du rectangle d'encadrement
unsigned long m_Link; // variable temporaire ( pour editions, ...)
EDA_Rect m_BoundaryBox; /* Bounding box coordinates relatives to the anchor, orient 0*/
EDA_Rect m_RealBoundaryBox; /* Bounding box : coordinates on board, real orientation */
int m_PadNum; // Pad count
int m_AltPadNum; // Pad with netcode > 0 (active pads)count
int m_CntRot90; // Automatic placement : cost ( 0..10 ) for 90 degrees rotaion (Horiz<->Vertical)
int m_CntRot180; // Automatic placement : cost ( 0..10 ) for 180 degrees rotaion (UP <->Down)
wxSize m_Ext; // Automatic placement margin around the module
float m_Surface; // Bounding box area
unsigned long m_Link; // Temporary variable ( used in editions, ...)
long m_LastEdit_Time; // Date de la derniere modification du module (gestion de librairies)
wxString m_Path;
wxString m_Doc; // Texte de description du module
wxString m_KeyWord; // Liste des mots cles relatifs au module
wxString m_Doc; // Module Description (info for users)
wxString m_KeyWord; // Keywords to select the module in lib
public:
MODULE( BOARD* parent );
......@@ -79,11 +78,17 @@ public:
MODULE* Next() { return (MODULE*) Pnext; }
void Set_Rectangle_Encadrement(); /* mise a jour du rect d'encadrement
* en coord locales (orient 0 et origine = pos module) */
/** Function Set_Rectangle_Encadrement()
* Calculates the bounding box
* for orient 0 et origin = module anchor)
*/
void Set_Rectangle_Encadrement();
void SetRectangleExinscrit(); /* mise a jour du rect d'encadrement
* et de la surface en coord reelles */
/** function SetRectangleExinscrit()
* 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
* returns the bounding box of this Footprint
......@@ -103,11 +108,11 @@ public:
}
// deplacements
// Moves
void SetPosition( const wxPoint& newpos );
void SetOrientation( int newangle );
/* supprime du chainage la structure Struct */
/* Remove this from the linked list */
void UnLink();
......@@ -151,7 +156,7 @@ public:
/**
* 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.
* this is also the footprint name
* @return bool - true if success reading else false.
......
......@@ -61,10 +61,10 @@ public:
int m_Orient; // in 1/10 degrees
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
// handle block number in track connection
// handle physical subnet (block)number in track connection
protected:
int m_ZoneSubnet; // variable used in rastnest computations
// handle block number in zone connection
......
......@@ -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 )
/*******************************************/
......
......@@ -53,13 +53,10 @@ public:
bool Save( FILE* aFile ) const;
int ReadDescr( FILE* aFile, int* aLineNum = NULL );
wxPoint& GetPosition()
{
static wxPoint pos;
return pos;
}
/** virtual function GetPosition
* @return a wxPoint, position of the first point of the outline
*/
wxPoint& GetPosition();
void UnLink( void )
{
......
......@@ -267,9 +267,9 @@ void WinEDA_BasePcbFrame::test_connexions( wxDC* DC )
/***************************************************/
/** 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.
* 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
* @param DC = current Device Context
*/
......@@ -443,18 +443,18 @@ static void calcule_connexite_1_net( TRACK* pt_start_conn, TRACK* pt_end_conn )
#define POS_AFF_CHREF 62
/******************************************************************************/
static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
int px, int py, int masque_layer )
static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* aPcb, LISTE_PAD* pt_liste,
const wxPoint & posref, int masque_layer )
/******************************************************************************/
/** Function SuperFast_Locate_Pad_Connecte
* 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
* @param px = reference X coordinate
* @param py = reference Y coordinate
* @param masque_layer = Layers (bit to bit) to consider
* @param aPcb = the board.
* @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
* @param posref = reference coordinate
* @param masque_layer = Layers (bit to bit) to consider
* @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(),
* 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,
{
D_PAD* pad;
LISTE_PAD* ptr_pad, * lim;
int nb_pad = pcb->m_NbPads;
int nb_pad = aPcb->m_NbPads;
int ii;
lim = pt_liste + (pcb->m_NbPads - 1 );
lim = pt_liste + (aPcb->m_NbPads - 1 );
ptr_pad = pt_liste;
while( nb_pad )
{
......@@ -478,14 +478,14 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
if( (ii & 1) && ( ii > 1 ) )
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;
if( ptr_pad > lim )
ptr_pad = lim;
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;
if( ptr_pad < pt_liste )
......@@ -493,13 +493,13 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
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 */
while( ptr_pad >= pt_liste )
{
pad = *ptr_pad;
if( pad->m_Pos.x == px )
if( pad->m_Pos.x == posref.x )
ptr_pad--;
else
break;
......@@ -513,10 +513,10 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
return NULL; /* outside suitable block */
pad = *ptr_pad;
if( pad->m_Pos.x != px )
if( pad->m_Pos.x != posref.x )
return NULL; /* outside suitable block */
if( pad->m_Pos.y != py )
if( pad->m_Pos.y != posref.y )
continue;
/* A Pad if found here: but it must mach the layer */
......@@ -615,8 +615,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
/* Search for a pad on the segment starting point */
pt_piste->start = SuperFast_Locate_Pad_Connecte( m_Pcb,
&sortedPads[0],
pt_piste->m_Start.x,
pt_piste->m_Start.y,
pt_piste->m_Start,
masque_layer );
if( pt_piste->start != NULL )
{
......@@ -627,8 +626,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
/* Search for a pad on the segment ending point */
pt_piste->end = SuperFast_Locate_Pad_Connecte( m_Pcb,
&sortedPads[0],
pt_piste->m_End.x,
pt_piste->m_End.y,
pt_piste->m_End,
masque_layer );
if( pt_piste->end != NULL )
......
......@@ -330,7 +330,7 @@ static void Montre_Position_New_Cotation( WinEDA_DrawPanel* panel, wxDC* DC, boo
/* Calcul de la direction de deplacement
* ( 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;
deltay = pos.y - Cotation->TraitD_oy;
......@@ -405,10 +405,10 @@ static void Ajuste_Details_Cotation( COTATION* Cotation )
deltay = Cotation->TraitD_oy - Cotation->TraitG_oy;
/* 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 )
angle = atan2( (float) deltay, (float) deltax );
angle = atan2( (double) deltay, (double) deltax );
else
angle = 0.0;
......
......@@ -68,7 +68,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE:
case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER:
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_OUTLINES:
case ID_POPUP_PCB_EDIT_ZONE_PARAMS:
......@@ -544,7 +545,16 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
Fill_All_Zones( &dc );
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 )
{
m_Pcb->m_Zone->DeleteStructList();
......
......@@ -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;
cx = (ux0 + ux1) / 2; cy = (uy0 + uy1) / 2;
rayon = (int) sqrt( (float) (cx - ux0) * (cx - ux0)
+ (float) (cy - uy0) * (cy - uy0) );
rayon = (int) sqrt( (double) (cx - ux0) * (cx - ux0)
+ (double) (cy - uy0) * (cy - uy0) );
/* Calcul des coord limites des cellules appartenant au rectangle */
row_max = (cy + rayon) / g_GridRoutingSize;
......@@ -719,7 +719,7 @@ void DrawSegmentQcq( int ux0, int uy0, int ux1, int uy1, int lg, int layer,
dx = ux1 - ux0; dy = uy1 - uy0;
if( dx )
angle = (int) (atan2( dy, dx ) * 1800 / M_PI);
angle = (int) (atan2( (double)dy, (double)dx ) * 1800 / M_PI);
else
{
angle = 900; if( dy < 0 )
......
......@@ -341,8 +341,8 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
aPopMenu->AppendSeparator();
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_FILL_ALL_ZONES,
_( "Fill or Refill All Zones" ), fill_zone_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_REMOVE_FILLED_AREAS,
_( "Remove filled areas" ), fill_zone_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES,
_( "Remove Filled Areas in All Zones" ), fill_zone_xpm );
aPopMenu->AppendSeparator();
}
......@@ -674,6 +674,12 @@ void WinEDA_PcbFrame::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu
ADD_MENUITEM( zones_menu, ID_POPUP_PCB_FILL_ZONE,
_( "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,
_( "Move Zone" ), move_xpm );
......
......@@ -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 */
if( delta.y ) /* Trapeze horizontal */
{
fangle = atan2( (float) (polygone[1].y - polygone[0].y),
(float) (polygone[1].x - polygone[0].x) ) / 2;
fangle = atan2( (double) (polygone[1].y - polygone[0].y),
(double) (polygone[1].x - polygone[0].x) ) / 2;
}
else
{
fangle = atan2( (float) (polygone[3].y - polygone[0].y),
(float) (polygone[3].x - polygone[0].x) ) / 2;
fangle = atan2( (double) (polygone[3].y - polygone[0].y),
(double) (polygone[3].x - polygone[0].x) ) / 2;
}
/* Trace du contour */
......@@ -871,7 +871,7 @@ void trace_1_segment_HPGL( int pos_X0, int pos_Y0, int pos_X1, int pos_Y1,
}
else
{
alpha = atan2( (float) size.y, (float) size.x );
alpha = atan2( (double) size.y, (double) size.x );
sin_alpha = sin( alpha );
cos_alpha = cos( alpha );
}
......
......@@ -28,7 +28,7 @@ static bool DisplayRastnestInProgress; // Enable the display of the ratsnes
* Building the general ratsnest:
* I used the "lee 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).
* Build_Board_Ratsnest( wxDC* DC ) Create this rastnest
* for each net:
......@@ -39,7 +39,7 @@ static bool DisplayRastnestInProgress; // Enable the display of the ratsnes
* link these 2 pads (i.e. create a ratsnest item)
* the pads are grouped in a logical block ( a cluster).
* 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.
* The first block has its block number = 1, the second is 2 ...
* 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 )
tri_par_net );
/* Compute the internal ratsnet:
* this is the same as general ratsnest, but considers onluy tje currant footprint pads
* it is therefore not time consumming, and it is made onlu once
* this is the same as general ratsnest, but considers only the current footprint pads
* 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
nb_local_chevelu = 0;
......@@ -1282,7 +1282,7 @@ calcul_chevelu_ext:
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) );
return (char*) (local_chevelu + 1); /* the struct pointed by local_chevelu is used
......
......@@ -116,10 +116,20 @@ void ZONE_CONTAINER::Test_For_Copper_Island_And_Remove_Insulated_Islands( BOARD*
}
/******************************************************************/
void CalculateSubAreaBoundaryBox( EDA_Rect& aBbox,
std::vector <CPolyPt> aPolysList,
int aIndexStart,
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;
......
......@@ -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) );
// get angles of start and finish
double th_i = atan2( (double) yi - yc, (double) xi - xc );
double th_f = atan2( (double) yf - yc, (double) xf - xc );
double th_i = atan2( (double) (yi - yc), (double) (xi - xc) );
double th_f = atan2( (double) (yf - yc), (double) (xf - xc) );
double th_d = (th_f - th_i) / (num - 1);
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