This commit is contained in:
parent
8d4a9b510d
commit
cbb5159a07
|
@ -1,30 +0,0 @@
|
||||||
== Spaces and Tabs ==
|
|
||||||
|
|
||||||
Try to use as many as can TABS instead of spaces, this makes indenting
|
|
||||||
much more easy.
|
|
||||||
|
|
||||||
|
|
||||||
== Function prototypes ==
|
|
||||||
|
|
||||||
The name of the function should be on a seperated line, this for easy
|
|
||||||
searching in long source files.
|
|
||||||
Each parameter should use a own line, aligned under the first parameter.
|
|
||||||
Below there is an example, this style is for reading and editing quick trough
|
|
||||||
sourcecode. Also indenting can be set with a good programmers editor
|
|
||||||
(visual spaces per tab, this because one tab is normaly 8 spaces on screen)
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
void
|
|
||||||
foo( int x,
|
|
||||||
int y,
|
|
||||||
int z )
|
|
||||||
{
|
|
||||||
function1();
|
|
||||||
|
|
||||||
if(var == 1)
|
|
||||||
{
|
|
||||||
dothis();
|
|
||||||
dothat();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -878,6 +878,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
|
||||||
SEGZONE* edge_poly;
|
SEGZONE* edge_poly;
|
||||||
edge_poly = new SEGZONE( pcb );
|
edge_poly = new SEGZONE( pcb );
|
||||||
pcb->m_Zone.Append( edge_poly );
|
pcb->m_Zone.Append( edge_poly );
|
||||||
|
D(printf("R:%p\n", edge_poly );)
|
||||||
|
|
||||||
edge_poly->SetLayer( activeLayer );
|
edge_poly->SetLayer( activeLayer );
|
||||||
edge_poly->m_Width = 1;
|
edge_poly->m_Width = 1;
|
||||||
|
@ -933,6 +934,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
|
||||||
case GERB_INTERPOL_LINEAR_1X:
|
case GERB_INTERPOL_LINEAR_1X:
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillLineTRACK( track, dcode, activeLayer,
|
fillLineTRACK( track, dcode, activeLayer,
|
||||||
m_PreviousPos, m_CurrentPos,
|
m_PreviousPos, m_CurrentPos,
|
||||||
size.x, !(m_LayerNegative ^ m_ImageNegative) );
|
size.x, !(m_LayerNegative ^ m_ImageNegative) );
|
||||||
|
@ -948,6 +950,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
|
||||||
case GERB_INTERPOL_ARC_POS:
|
case GERB_INTERPOL_ARC_POS:
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillArcTRACK( track, dcode, activeLayer,
|
fillArcTRACK( track, dcode, activeLayer,
|
||||||
m_PreviousPos, m_CurrentPos, m_IJPos,
|
m_PreviousPos, m_CurrentPos, m_IJPos,
|
||||||
size.x, m_Iterpolation==GERB_INTERPOL_ARC_NEG ? false : true,
|
size.x, m_Iterpolation==GERB_INTERPOL_ARC_NEG ? false : true,
|
||||||
|
@ -984,6 +987,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
|
||||||
case APT_CIRCLE:
|
case APT_CIRCLE:
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillRoundFlashTRACK( track, dcode, activeLayer,
|
fillRoundFlashTRACK( track, dcode, activeLayer,
|
||||||
m_CurrentPos,
|
m_CurrentPos,
|
||||||
size.x, !(m_LayerNegative ^ m_ImageNegative) );
|
size.x, !(m_LayerNegative ^ m_ImageNegative) );
|
||||||
|
@ -993,6 +997,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
|
||||||
case APT_RECT:
|
case APT_RECT:
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
||||||
m_CurrentPos, size,
|
m_CurrentPos, size,
|
||||||
aperture == APT_RECT ? S_SPOT_RECT : S_SPOT_OVALE,
|
aperture == APT_RECT ? S_SPOT_RECT : S_SPOT_OVALE,
|
||||||
|
@ -1020,6 +1025,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
|
||||||
|
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillRoundFlashTRACK( track, dcode, activeLayer,
|
fillRoundFlashTRACK( track, dcode, activeLayer,
|
||||||
m_CurrentPos,
|
m_CurrentPos,
|
||||||
diameter, exposure );
|
diameter, exposure );
|
||||||
|
@ -1049,6 +1055,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
|
||||||
curPos += midPoint;
|
curPos += midPoint;
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
||||||
curPos, size, S_SPOT_RECT,
|
curPos, size, S_SPOT_RECT,
|
||||||
exposure );
|
exposure );
|
||||||
|
@ -1064,6 +1071,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
|
||||||
curPos += mapPt( p->params[3].GetValue( tool ), p->params[4].GetValue( tool ), m_GerbMetric );
|
curPos += mapPt( p->params[3].GetValue( tool ), p->params[4].GetValue( tool ), m_GerbMetric );
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
||||||
curPos, size, S_SPOT_RECT,
|
curPos, size, S_SPOT_RECT,
|
||||||
exposure );
|
exposure );
|
||||||
|
@ -1083,6 +1091,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
|
||||||
curPos.x += size.x/2;
|
curPos.x += size.x/2;
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
||||||
curPos, size, S_SPOT_RECT,
|
curPos, size, S_SPOT_RECT,
|
||||||
exposure );
|
exposure );
|
||||||
|
@ -1098,11 +1107,13 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
|
||||||
|
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillRoundFlashTRACK( track, dcode, activeLayer, curPos,
|
fillRoundFlashTRACK( track, dcode, activeLayer, curPos,
|
||||||
outerDiam, !(m_LayerNegative ^ m_ImageNegative) );
|
outerDiam, !(m_LayerNegative ^ m_ImageNegative) );
|
||||||
|
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillRoundFlashTRACK( track, dcode, activeLayer, curPos,
|
fillRoundFlashTRACK( track, dcode, activeLayer, curPos,
|
||||||
innerDiam, (m_LayerNegative ^ m_ImageNegative) );
|
innerDiam, (m_LayerNegative ^ m_ImageNegative) );
|
||||||
|
|
||||||
|
@ -1130,18 +1141,22 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
|
||||||
{
|
{
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillCircularTRACK( track, dcode, activeLayer, curPos, outerDiam,
|
fillCircularTRACK( track, dcode, activeLayer, curPos, outerDiam,
|
||||||
penThickness, !(m_LayerNegative ^ m_ImageNegative) );
|
penThickness, !(m_LayerNegative ^ m_ImageNegative) );
|
||||||
}
|
}
|
||||||
|
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
||||||
curPos, wxSize(crossHairThickness,crossHairLength),
|
curPos, wxSize(crossHairThickness,crossHairLength),
|
||||||
S_SPOT_RECT, !(m_LayerNegative ^ m_ImageNegative) );
|
S_SPOT_RECT, !(m_LayerNegative ^ m_ImageNegative) );
|
||||||
|
|
||||||
track = new TRACK( pcb );
|
track = new TRACK( pcb );
|
||||||
pcb->m_Track.Append( track );
|
pcb->m_Track.Append( track );
|
||||||
|
D(printf("R:%p\n", track );)
|
||||||
|
|
||||||
// swap x and y in wxSize() for this one
|
// swap x and y in wxSize() for this one
|
||||||
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
|
||||||
curPos, wxSize(crossHairLength,crossHairThickness),
|
curPos, wxSize(crossHairLength,crossHairThickness),
|
||||||
|
|
|
@ -128,9 +128,11 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
|
||||||
if( !(track->ReturnMaskLayer() & printmasklayer) )
|
if( !(track->ReturnMaskLayer() & printmasklayer) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
D(printf("D:%p\n", track );)
|
||||||
|
|
||||||
if( track->GetNet() == 0 ) // StartPoint
|
if( track->GetNet() == 0 ) // StartPoint
|
||||||
{
|
{
|
||||||
if( points.size() ) // we have found a new polygon: Draw the old polygon
|
if( points.size() ) // we have found a new polygon: Draw the old polygon
|
||||||
{
|
{
|
||||||
if( erase )
|
if( erase )
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
/***************************************************************************************************/
|
/***************************************************************************************************/
|
||||||
void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_mode,
|
void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_mode,
|
||||||
int printmasklayer )
|
int printmasklayer )
|
||||||
/***************************************************************************************************/
|
/***************************************************************************************************/
|
||||||
|
|
||||||
/* Function to draw the tracks (i.e Spots or lines) in gerbview
|
/* Function to draw the tracks (i.e Spots or lines) in gerbview
|
||||||
|
@ -29,23 +29,25 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_
|
||||||
* @param printmasklayer = mask for allowed layer (=-1 to draw all layers)
|
* @param printmasklayer = mask for allowed layer (=-1 to draw all layers)
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
|
int layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
|
||||||
GERBER* gerber = g_GERBER_List[layer];
|
GERBER* gerber = g_GERBER_List[layer];
|
||||||
int dcode_hightlight = 0;
|
int dcode_hightlight = 0;
|
||||||
|
|
||||||
if( gerber )
|
if( gerber )
|
||||||
dcode_hightlight = gerber->m_Selected_Tool;
|
dcode_hightlight = gerber->m_Selected_Tool;
|
||||||
|
|
||||||
for( TRACK* track = Pcb->m_Track; track; track = track->Next() )
|
for( TRACK* track = Pcb->m_Track; track; track = track->Next() )
|
||||||
{
|
{
|
||||||
if( !(track->ReturnMaskLayer() & printmasklayer) )
|
if( !(track->ReturnMaskLayer() & printmasklayer) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( dcode_hightlight == track->GetNet() && track->GetLayer()==layer )
|
D(printf("D:%p\n", track );)
|
||||||
Trace_Segment( panel, DC, track, draw_mode | GR_SURBRILL );
|
|
||||||
else
|
if( dcode_hightlight == track->GetNet() && track->GetLayer()==layer )
|
||||||
Trace_Segment( panel, DC, track, draw_mode );
|
Trace_Segment( panel, DC, track, draw_mode | GR_SURBRILL );
|
||||||
}
|
else
|
||||||
|
Trace_Segment( panel, DC, track, draw_mode );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,174 +63,174 @@ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mo
|
||||||
* draw_mode = mode ( GR_XOR, GR_OR..)
|
* draw_mode = mode ( GR_XOR, GR_OR..)
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int l_piste;
|
int l_piste;
|
||||||
int color;
|
int color;
|
||||||
int zoom;
|
int zoom;
|
||||||
int fillopt;
|
int fillopt;
|
||||||
static bool show_err;
|
static bool show_err;
|
||||||
|
|
||||||
if( track->m_Flags & DRAW_ERASED ) // draw in background color, used by classs TRACK in gerbview
|
if( track->m_Flags & DRAW_ERASED ) // draw in background color, used by classs TRACK in gerbview
|
||||||
{
|
{
|
||||||
color = g_DrawBgColor;
|
color = g_DrawBgColor;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
color = g_DesignSettings.m_LayerColor[track->GetLayer()];
|
color = g_DesignSettings.m_LayerColor[track->GetLayer()];
|
||||||
if( color & ITEM_NOT_SHOW )
|
if( color & ITEM_NOT_SHOW )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( draw_mode & GR_SURBRILL )
|
if( draw_mode & GR_SURBRILL )
|
||||||
{
|
{
|
||||||
if( draw_mode & GR_AND )
|
if( draw_mode & GR_AND )
|
||||||
color &= ~HIGHT_LIGHT_FLAG;
|
color &= ~HIGHT_LIGHT_FLAG;
|
||||||
else
|
else
|
||||||
color |= HIGHT_LIGHT_FLAG;
|
color |= HIGHT_LIGHT_FLAG;
|
||||||
}
|
}
|
||||||
if( color & HIGHT_LIGHT_FLAG )
|
if( color & HIGHT_LIGHT_FLAG )
|
||||||
color = ColorRefs[color & MASKCOLOR].m_LightColor;
|
color = ColorRefs[color & MASKCOLOR].m_LightColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
GRSetDrawMode( DC, draw_mode );
|
GRSetDrawMode( DC, draw_mode );
|
||||||
|
|
||||||
zoom = panel->GetZoom();
|
zoom = panel->GetZoom();
|
||||||
|
|
||||||
fillopt = DisplayOpt.DisplayPcbTrackFill ? FILLED : SKETCH;
|
fillopt = DisplayOpt.DisplayPcbTrackFill ? FILLED : SKETCH;
|
||||||
|
|
||||||
switch( track->m_Shape )
|
switch( track->m_Shape )
|
||||||
{
|
{
|
||||||
case S_CIRCLE:
|
case S_CIRCLE:
|
||||||
{
|
{
|
||||||
int radius = (int) hypot( (double) (track->m_End.x - track->m_Start.x),
|
int radius = (int) hypot( (double) (track->m_End.x - track->m_Start.x),
|
||||||
(double) (track->m_End.y - track->m_Start.y) );
|
(double) (track->m_End.y - track->m_Start.y) );
|
||||||
|
|
||||||
int halfPenWidth = track->m_Width >> 1;
|
int halfPenWidth = track->m_Width >> 1;
|
||||||
if( (halfPenWidth / zoom) < L_MIN_DESSIN )
|
if( (halfPenWidth / zoom) < L_MIN_DESSIN )
|
||||||
{
|
{
|
||||||
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
radius, 0, color );
|
radius, 0, color );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( fillopt == SKETCH )
|
if( fillopt == SKETCH )
|
||||||
{
|
{
|
||||||
// draw the border of the pen's path using two circles, each as narrow as possible
|
// draw the border of the pen's path using two circles, each as narrow as possible
|
||||||
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
radius - halfPenWidth, 0, color );
|
radius - halfPenWidth, 0, color );
|
||||||
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
radius + halfPenWidth, 0, color );
|
radius + halfPenWidth, 0, color );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
radius, track->m_Width, color );
|
radius, track->m_Width, color );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_ARC:
|
case S_ARC:
|
||||||
if( fillopt == SKETCH )
|
if( fillopt == SKETCH )
|
||||||
{
|
{
|
||||||
GRArc1( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRArc1( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
track->m_End.x, track->m_End.y,
|
track->m_End.x, track->m_End.y,
|
||||||
track->m_Param, track->GetSubNet(), 0, color );
|
track->m_Param, track->GetSubNet(), 0, color );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GRArc1( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRArc1( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
track->m_End.x, track->m_End.y,
|
track->m_End.x, track->m_End.y,
|
||||||
track->m_Param, track->GetSubNet(),
|
track->m_Param, track->GetSubNet(),
|
||||||
track->m_Width, color );
|
track->m_Width, color );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_SPOT_CIRCLE:
|
case S_SPOT_CIRCLE:
|
||||||
{
|
{
|
||||||
int radius = track->m_Width >> 1;
|
int radius = track->m_Width >> 1;
|
||||||
|
|
||||||
fillopt = DisplayOpt.DisplayPadFill ? FILLED : SKETCH;
|
fillopt = DisplayOpt.DisplayPadFill ? FILLED : SKETCH;
|
||||||
if( (radius / zoom) < L_MIN_DESSIN )
|
if( (radius / zoom) < L_MIN_DESSIN )
|
||||||
{
|
{
|
||||||
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
radius, 0, color );
|
radius, 0, color );
|
||||||
}
|
}
|
||||||
else if( fillopt == SKETCH )
|
else if( fillopt == SKETCH )
|
||||||
{
|
{
|
||||||
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
radius, 0, color );
|
radius, 0, color );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GRFilledCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRFilledCircle( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
radius, 0, color, color );
|
radius, 0, color, color );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_SPOT_RECT:
|
case S_SPOT_RECT:
|
||||||
case S_RECT:
|
case S_RECT:
|
||||||
|
|
||||||
l_piste = track->m_Width >> 1;
|
l_piste = track->m_Width >> 1;
|
||||||
|
|
||||||
fillopt = DisplayOpt.DisplayPadFill ? FILLED : SKETCH;
|
fillopt = DisplayOpt.DisplayPadFill ? FILLED : SKETCH;
|
||||||
if( (l_piste / zoom) < L_MIN_DESSIN )
|
if( (l_piste / zoom) < L_MIN_DESSIN )
|
||||||
{
|
{
|
||||||
GRLine( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRLine( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
track->m_End.x, track->m_End.y, 0, color );
|
track->m_End.x, track->m_End.y, 0, color );
|
||||||
}
|
}
|
||||||
else if( fillopt == SKETCH )
|
else if( fillopt == SKETCH )
|
||||||
{
|
{
|
||||||
GRRect( &panel->m_ClipBox, DC,
|
GRRect( &panel->m_ClipBox, DC,
|
||||||
track->m_Start.x - l_piste,
|
track->m_Start.x - l_piste,
|
||||||
track->m_Start.y - l_piste,
|
track->m_Start.y - l_piste,
|
||||||
track->m_End.x + l_piste,
|
track->m_End.x + l_piste,
|
||||||
track->m_End.y + l_piste,
|
track->m_End.y + l_piste,
|
||||||
0, color );
|
0, color );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GRFilledRect( &panel->m_ClipBox, DC,
|
GRFilledRect( &panel->m_ClipBox, DC,
|
||||||
track->m_Start.x - l_piste,
|
track->m_Start.x - l_piste,
|
||||||
track->m_Start.y - l_piste,
|
track->m_Start.y - l_piste,
|
||||||
track->m_End.x + l_piste,
|
track->m_End.x + l_piste,
|
||||||
track->m_End.y + l_piste,
|
track->m_End.y + l_piste,
|
||||||
0, color, color );
|
0, color, color );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_SPOT_OVALE:
|
case S_SPOT_OVALE:
|
||||||
fillopt = DisplayOpt.DisplayPadFill ? FILLED : SKETCH;
|
fillopt = DisplayOpt.DisplayPadFill ? FILLED : SKETCH;
|
||||||
|
|
||||||
case S_SEGMENT:
|
case S_SEGMENT:
|
||||||
l_piste = track->m_Width >> 1;
|
l_piste = track->m_Width >> 1;
|
||||||
|
|
||||||
if( (l_piste / zoom) < L_MIN_DESSIN )
|
if( (l_piste / zoom) < L_MIN_DESSIN )
|
||||||
{
|
{
|
||||||
GRLine( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRLine( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
track->m_End.x, track->m_End.y, 0, color );
|
track->m_End.x, track->m_End.y, 0, color );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( fillopt == SKETCH )
|
if( fillopt == SKETCH )
|
||||||
{
|
{
|
||||||
GRCSegm( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRCSegm( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
track->m_End.x, track->m_End.y,
|
track->m_End.x, track->m_End.y,
|
||||||
track->m_Width, color );
|
track->m_Width, color );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GRFillCSegm( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
GRFillCSegm( &panel->m_ClipBox, DC, track->m_Start.x, track->m_Start.y,
|
||||||
track->m_End.x, track->m_End.y,
|
track->m_End.x, track->m_End.y,
|
||||||
track->m_Width, color );
|
track->m_Width, color );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if( !show_err )
|
if( !show_err )
|
||||||
{
|
{
|
||||||
DisplayError( panel, wxT( "Trace_Segment() type error" ) );
|
DisplayError( panel, wxT( "Trace_Segment() type error" ) );
|
||||||
show_err = TRUE;
|
show_err = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -238,49 +240,49 @@ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mo
|
||||||
void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode )
|
void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode )
|
||||||
/*****************************************************************************************/
|
/*****************************************************************************************/
|
||||||
{
|
{
|
||||||
TRACK* track;
|
TRACK* track;
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
int width, orient;
|
int width, orient;
|
||||||
wxString Line;
|
wxString Line;
|
||||||
|
|
||||||
GRSetDrawMode( DC, drawmode );
|
GRSetDrawMode( DC, drawmode );
|
||||||
track = Pcb->m_Track;
|
track = Pcb->m_Track;
|
||||||
for( ; track != NULL; track = track->Next() )
|
for( ; track != NULL; track = track->Next() )
|
||||||
{
|
{
|
||||||
if( (track->m_Shape == S_ARC)
|
if( (track->m_Shape == S_ARC)
|
||||||
|| (track->m_Shape == S_CIRCLE)
|
|| (track->m_Shape == S_CIRCLE)
|
||||||
|| (track->m_Shape == S_ARC_RECT) )
|
|| (track->m_Shape == S_ARC_RECT) )
|
||||||
{
|
{
|
||||||
pos.x = track->m_Start.x;
|
pos.x = track->m_Start.x;
|
||||||
pos.y = track->m_Start.y;
|
pos.y = track->m_Start.y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pos.x = (track->m_Start.x + track->m_End.x) / 2;
|
pos.x = (track->m_Start.x + track->m_End.x) / 2;
|
||||||
pos.y = (track->m_Start.y + track->m_End.y) / 2;
|
pos.y = (track->m_Start.y + track->m_End.y) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Line.Printf( wxT( "D%d" ), track->GetNet() );
|
Line.Printf( wxT( "D%d" ), track->GetNet() );
|
||||||
|
|
||||||
width = track->m_Width;
|
width = track->m_Width;
|
||||||
orient = TEXT_ORIENT_HORIZ;
|
orient = TEXT_ORIENT_HORIZ;
|
||||||
if( track->m_Shape >= S_SPOT_CIRCLE ) // forme flash
|
if( track->m_Shape >= S_SPOT_CIRCLE ) // forme flash
|
||||||
{
|
{
|
||||||
width /= 3;
|
width /= 3;
|
||||||
}
|
}
|
||||||
else // lines
|
else // lines
|
||||||
{
|
{
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
dx = track->m_Start.x - track->m_End.x;
|
dx = track->m_Start.x - track->m_End.x;
|
||||||
dy = track->m_Start.y - track->m_End.y;
|
dy = track->m_Start.y - track->m_End.y;
|
||||||
if( abs( dx ) < abs( dy ) )
|
if( abs( dx ) < abs( dy ) )
|
||||||
orient = TEXT_ORIENT_VERT;
|
orient = TEXT_ORIENT_VERT;
|
||||||
width /= 2;
|
width /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawGraphicText( panel, DC,
|
DrawGraphicText( panel, DC,
|
||||||
pos, (EDA_Colors) g_DCodesColor, Line,
|
pos, (EDA_Colors) g_DCodesColor, Line,
|
||||||
orient, wxSize( width, width ),
|
orient, wxSize( width, width ),
|
||||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER );
|
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue