kicad/pcbnew/trpiste.cpp

61 lines
2.0 KiB
C++
Raw Normal View History

/*****************************************************************/
/* Routines de tracage des pistes ( Toutes, 1 piste, 1 segment ) */
/*****************************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "pcbnew.h"
#include "trigo.h"
#include "protos.h"
/* variables locales : */
/*********************************************************************************/
2007-08-23 04:28:46 +00:00
void Trace_Pistes( WinEDA_DrawPanel* panel, BOARD* Pcb, wxDC* DC, int drawmode )
/********************************************************************************/
2007-08-23 04:28:46 +00:00
2007-10-30 21:30:58 +00:00
/* Draw all tracks and zones. As long as dark colors are used for the tracks,
* Then the OR draw mode should show tracks underneath other tracks. But a white
* track will cover any other color since it has more bits to OR in.
2007-08-23 04:28:46 +00:00
*/
{
2007-10-30 21:30:58 +00:00
for( TRACK* track = Pcb->m_Track; track; track = track->Next() )
2007-08-23 04:28:46 +00:00
{
track->Draw( panel, DC, drawmode );
}
2007-10-30 21:30:58 +00:00
for( SEGZONE* zone = Pcb->m_Zone; zone; zone = zone->Next() )
2007-08-23 04:28:46 +00:00
{
zone->Draw( panel, DC, drawmode );
2007-08-23 04:28:46 +00:00
}
}
/************************************************************************/
2007-08-23 04:28:46 +00:00
void Trace_Une_Piste( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* Track,
int nbsegment, int draw_mode )
/************************************************************************/
2007-08-23 04:28:46 +00:00
/* routine de trace de n segments consecutifs en memoire.
2007-08-23 04:28:46 +00:00
* Utile pour monter une piste en cours de trace car les segments de cette
* piste sont alors contigus en memoire
* Parametres :
* pt_start_piste = adresse de depart de la liste des segments
* nbsegment = nombre de segments a tracer
* draw_mode = mode ( GR_XOR, GR_OR..)
* ATTENTION:
* le point de depart d'une piste suivante DOIT exister: peut etre
* donc mis a 0 avant appel a la routine si la piste a tracer est la derniere
*/
{
2007-10-30 21:30:58 +00:00
for( ; nbsegment > 0 && Track; nbsegment--, Track = Track->Next() )
2007-08-23 04:28:46 +00:00
{
Track->Draw( panel, DC, draw_mode );
}
}
2007-08-23 04:28:46 +00:00