KiCad PCB EDA Suite
editrack-part2.cpp File Reference
#include <fctsys.h>
#include <gr_basic.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <pcb_edit_frame.h>
#include <class_board.h>
#include <class_module.h>
#include <class_track.h>
#include <class_marker_pcb.h>
#include <pcbnew.h>
#include <drc.h>
#include <connectivity_data.h>

Go to the source code of this file.


static void ListSetState (EDA_ITEM *Start, int NbItem, STATUS_FLAGS State, bool onoff)
void DrawTraces (EDA_DRAW_PANEL *panel, wxDC *DC, TRACK *aTrackList, int nbsegment, GR_DRAWMODE draw_mode)
 Function DrawTraces Draws n consecutive track segments in list. More...

Function Documentation

void DrawTraces ( EDA_DRAW_PANEL panel,
wxDC *  DC,
TRACK aStartTrace,
int  nbsegment,
GR_DRAWMODE  mode_color 

Function DrawTraces Draws n consecutive track segments in list.

Useful to show a track when it is a chain of segments (for instance when creating a new track)

panelA EDA_DRAW_ITEM pointer to the canvas.
DCA wxDC pointer of the device context used for drawing.
aStartTraceFirst segment
nbsegmentNumber of segments in list
mode_colorDrawing mode (GRXOR, GROR ..)

Definition at line 229 of file editrack-part2.cpp.

References TRACK::Next().

Referenced by AddNewTrace(), PCB_EDIT_FRAME::Attribut_Track(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::EraseRedundantTrack(), and ShowNewTrackWhenMovingCursor().

231 {
232  // preserve the start of the list for debugging.
233  for( TRACK* track = aTrackList; nbsegment > 0 && track; nbsegment--, track = track->Next() )
234  {
235  track->Draw( panel, DC, draw_mode );
236  }
237 }
TRACK * Next() const
Definition: class_track.h:99
static void ListSetState ( EDA_ITEM Start,
int  NbItem,
bool  onoff 

Definition at line 504 of file editrack-part2.cpp.

References EDA_ITEM::Next().

Referenced by PCB_EDIT_FRAME::EraseRedundantTrack(), and PCB_EDIT_FRAME::Other_Layer_Route().

506 {
507  for( ; (Start != NULL ) && ( NbItem > 0 ); NbItem--, Start = Start->Next() )
508  {
509  Start->SetState( State, onoff );
510  }
511 }
EDA_ITEM * Next() const
Definition: base_struct.h:217