KiCad PCB EDA Suite
tr_modif.cpp File Reference

Trace editing: detects an removes a track which is become redunding, after a new track is craeted. More...

#include <fctsys.h>
#include <gr_basic.h>
#include <wxPcbStruct.h>
#include <class_board.h>
#include <class_track.h>
#include <pcbnew.h>
#include <protos.h>

Go to the source code of this file.

Functions

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...
 

Detailed Description

Trace editing: detects an removes a track which is become redunding, after a new track is craeted.

Definition in file tr_modif.cpp.

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)

Parameters
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 48 of file tr_modif.cpp.

References TRACK::Next().

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

50 {
51  // preserve the start of the list for debugging.
52  for( TRACK* track = aTrackList; nbsegment > 0 && track; nbsegment--, track = track->Next() )
53  {
54  track->Draw( panel, DC, draw_mode );
55  }
56 }
TRACK * Next() const
Definition: class_track.h:97
static void ListSetState ( EDA_ITEM Start,
int  NbItem,
STATUS_FLAGS  State,
bool  onoff 
)
static

Definition at line 317 of file tr_modif.cpp.

References EDA_ITEM::Next().

Referenced by PCB_EDIT_FRAME::EraseRedundantTrack().

319 {
320  for( ; (Start != NULL ) && ( NbItem > 0 ); NbItem--, Start = Start->Next() )
321  {
322  Start->SetState( State, onoff );
323  }
324 }
EDA_ITEM * Next() const
Definition: base_struct.h:206