Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
a196a324
Commit
a196a324
authored
Apr 01, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more BOARD_ITEM::Draw() support
parent
f1b36209
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
107 deletions
+55
-107
change_log.txt
change_log.txt
+4
-1
protos.h
gerbview/protos.h
+31
-33
trpiste.cpp
gerbview/trpiste.cpp
+0
-11
block.cpp
pcbnew/block.cpp
+2
-2
editedge.cpp
pcbnew/editedge.cpp
+13
-20
lay2plot.cpp
pcbnew/lay2plot.cpp
+5
-25
protos.h
pcbnew/protos.h
+0
-5
trpiste.cpp
pcbnew/trpiste.cpp
+0
-10
No files found.
change_log.txt
View file @
a196a324
...
...
@@ -13,7 +13,10 @@ email address.
+pcbnew
Added virtual BOARD_ITEM::Draw() and forced all BOARD_ITEM derived classes
to implement it so that all these functions are also virtual.
Made the offset argument default to the new wxPoint BOARD_ITEM::ZeroOffset
Made the offset argument default to the new wxPoint BOARD_ITEM::ZeroOffset.
Coded DRAWSEGMENT::Draw() from Trace_DrawSegmentPcb() and removed the latter.
Coded EQUIPOT::Draw(), and BOARD::Draw(). Both are dummies for now, but
both can be reasonably implemented in the future.
2008-Mar-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
...
...
gerbview/protos.h
View file @
a196a324
...
...
@@ -43,15 +43,15 @@ void ComputePlotFileName( char * FullFileName, char * Ext );
void
calcule_coord_plot
(
int
*
dx
,
int
*
dy
)
;
void
calcule_dim_plot
(
int
*
dx
,
int
*
dy
)
;
void
Trace_Un_TextePcb
(
TEXTE_PCB
*
pt_texte
,
int
format_plot
,
int
masque_layer
);
/* Trace 1 Texte type PCB , c.a.d autre que les textes sur modules,
prepare les parametres de trace de Plot_1_texte */
/* Trace 1 Texte type PCB , c.a.d autre que les textes sur modules,
prepare les parametres de trace de Plot_1_texte */
void
trace_1_arc
(
int
format_plot
,
int
cx
,
int
cy
,
int
start
,
int
end
,
int
rayon
,
int
epaisseur
);
int
rayon
,
int
epaisseur
);
void
trace_1_cercle
(
int
format_plot
,
int
epaisseur
,
int
cx
,
int
cy
,
int
rayon
);
void
Plot_1_texte
(
int
format_plot
,
char
*
ptr
,
int
t_nbcodes
,
int
t_orient
,
int
epaisseur
,
int
ox
,
int
oy
,
int
size_h
,
int
size_v
);
/* Routine de base de trace de 1 chaine de caracteres */
char
*
ptr
,
int
t_nbcodes
,
int
t_orient
,
int
epaisseur
,
int
ox
,
int
oy
,
int
size_h
,
int
size_v
);
/* Routine de base de trace de 1 chaine de caracteres */
void
Trace_Un_DrawSegment
(
DRAWSEGMENT
*
PtSegm
,
int
format_plot
,
int
masque_layer
);
...
...
@@ -59,56 +59,56 @@ void Trace_Une_MirePcb( MIREPCB* PtMire, int format_plot,int masque_layer );
/* PLOTGERB.CC */
void
trace_1_segment_GERBER
(
int
pos_X0
,
int
pos_Y0
,
int
pos_X1
,
int
pos_Y1
,
int
hauteur
);
int
hauteur
);
void
trace_1_cercle_GERBER
(
int
cx
,
int
cy
,
int
rayon
,
int
epaisseur
);
void
trace_1_contour_GERBER
(
int
cX
,
int
cY
,
int
dimX
,
int
dimY
,
int
deltaX
,
int
deltaY
,
int
dim_trait
,
int
orient
);
/* Trace 1 contour rectangulaire ou trapezoidal d'orientation quelconque
donne par son centre cX, cY, ses dimensions dimX et dimY,
ses variations deltaX et deltaY et son orientation orient */
int
deltaX
,
int
deltaY
,
int
dim_trait
,
int
orient
);
/* Trace 1 contour rectangulaire ou trapezoidal d'orientation quelconque
donne par son centre cX, cY, ses dimensions dimX et dimY,
ses variations deltaX et deltaY et son orientation orient */
/* PLOTHPGL.CC */
void
Init_Trace_HPGL
();
void
Fin_Trace_HPGL
();
void
trace_1_segment_HPGL
(
int
pos_X0
,
int
pos_Y0
,
int
pos_X1
,
int
pos_Y1
,
int
hauteur
);
int
hauteur
);
void
trace_1_pad_TRAPEZE_HPGL
(
int
cX
,
int
cY
,
int
dimX
,
int
dimY
,
int
deltaX
,
int
deltaY
,
int
orient
,
int
modetrace
);
int
dimX
,
int
dimY
,
int
deltaX
,
int
deltaY
,
int
orient
,
int
modetrace
);
void
trace_1_pastille_RONDE_HPGL
(
int
pos_X
,
int
pos_Y
,
int
diametre
,
int
modetrace
)
;
void
trace_1_pastille_OVALE_HPGL
(
int
pos_X
,
int
pos_Y
,
int
dx
,
int
dy
,
int
orient
,
int
modetrace
)
;
int
orient
,
int
modetrace
)
;
void
trace_1_pad_rectangulaire_HPGL
(
int
cX
,
int
cY
,
int
dimX
,
int
dimY
,
int
orient
,
int
modetrace
)
;
int
orient
,
int
modetrace
)
;
void
Move_Plume_HPGL
(
int
x
,
int
y
,
int
plume
);
/* deplace la plume levee (plume = 'U') ou baissee (plume = 'D')
en position x,y */
/* deplace la plume levee (plume = 'U') ou baissee (plume = 'D')
en position x,y */
void
Plume_HPGL
(
int
plume
);
/* leve (plume = 'U') ou baisse (plume = 'D') la plume */
/* leve (plume = 'U') ou baisse (plume = 'D') la plume */
/**************/
/* PRINTPS.CC */
/**************/
void
trace_1_pastille_OVALE_POST
(
int
pos_X
,
int
pos_Y
,
int
dx
,
int
dy
,
int
orient
,
int
modetrace
);
int
dx
,
int
dy
,
int
orient
,
int
modetrace
);
void
trace_1_pastille_RONDE_POST
(
int
pos_X
,
int
pos_Y
,
int
diametre
,
int
modetrace
);
int
modetrace
);
void
trace_1_pad_rectangulaire_POST
(
int
cX
,
int
cY
,
int
dimX
,
int
dimY
,
int
orient
,
int
modetrace
);
int
dimX
,
int
dimY
,
int
orient
,
int
modetrace
);
void
trace_1_contour_POST
(
int
cX
,
int
cY
,
int
dimX
,
int
dimY
,
int
deltaX
,
int
deltaY
,
int
dim_trait
,
int
orient
);
int
deltaX
,
int
deltaY
,
int
dim_trait
,
int
orient
);
void
trace_1_pad_TRAPEZE_POST
(
int
cX
,
int
cY
,
int
dimX
,
int
dimY
,
int
deltaX
,
int
deltaY
,
int
orient
,
int
modetrace
);
int
dimX
,
int
dimY
,
int
deltaX
,
int
deltaY
,
int
orient
,
int
modetrace
);
void
trace_1_segment_POST
(
int
pos_X0
,
int
pos_Y0
,
int
pos_X1
,
int
pos_Y1
,
int
large
);
int
large
);
void
trace_1_Cercle_POST
(
int
pos_X
,
int
pos_Y
,
int
diametre
,
int
width
);
void
PlotArcPS
(
int
x
,
int
y
,
int
StAngle
,
int
EndAngle
,
int
rayon
,
int
width
);
...
...
@@ -118,13 +118,11 @@ void PlotArcPS(int x, int y, int StAngle, int EndAngle, int rayon, int width);
/***************/
void
Draw_Track_Buffer
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
BOARD
*
Pcb
,
int
drawmode
,
int
printmasklayer
);
void
Trace_Segment
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
TRACK
*
pt_piste
,
int
draw_mode
);
void
Trace_DrawSegmentPcb
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
DRAWSEGMENT
*
PtDrawSegment
,
int
draw_mode
);
void
Trace_1_texte_pcb
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
TEXTE_PCB
*
pt_texte
,
int
ox
,
int
oy
,
int
DrawMode
);
TEXTE_PCB
*
pt_texte
,
int
ox
,
int
oy
,
int
DrawMode
);
void
Affiche_DCodes_Pistes
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
BOARD
*
Pcb
,
int
drawmode
);
BOARD
*
Pcb
,
int
drawmode
);
/*************/
/* dcode.cpp */
...
...
gerbview/trpiste.cpp
View file @
a196a324
...
...
@@ -217,17 +217,6 @@ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mo
}
/**************************************************************************/
void
Trace_DrawSegmentPcb
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
DRAWSEGMENT
*
PtDrawSegment
,
int
draw_mode
)
/**************************************************************************/
{
// @todo Replace all calls to Trace_DrawSegmentPcb() with this call:
PtDrawSegment
->
Draw
(
panel
,
DC
,
draw_mode
);
}
/*****************************************************************************************/
void
Affiche_DCodes_Pistes
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
BOARD
*
Pcb
,
int
drawmode
)
/*****************************************************************************************/
...
...
pcbnew/block.cpp
View file @
a196a324
...
...
@@ -509,7 +509,7 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
break
;
/* l'element est ici bon a etre efface */
Trace_DrawSegmentPcb
(
DrawPanel
,
DC
,
(
DRAWSEGMENT
*
)
PtStruct
,
GR_XOR
);
PtStruct
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
PtStruct
->
DeleteStructure
();
break
;
...
...
@@ -1231,7 +1231,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
m_Pcb
->
m_Drawings
=
new_drawsegment
;
new_drawsegment
->
m_Start
+=
MoveVector
;
new_drawsegment
->
m_End
+=
MoveVector
;
Trace_DrawSegmentPcb
(
DrawPanel
,
DC
,
new_drawsegment
,
GR_OR
);
new_drawsegment
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
break
;
}
...
...
pcbnew/editedge.cpp
View file @
a196a324
...
...
@@ -30,7 +30,7 @@ void WinEDA_PcbFrame::Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC )
{
if
(
drawitem
==
NULL
)
return
;
Trace_DrawSegmentPcb
(
DrawPanel
,
DC
,
drawitem
,
GR_XOR
);
drawitem
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
drawitem
->
m_Flags
|=
IS_MOVED
;
cursor_pos
=
cursor_pos0
=
GetScreen
()
->
m_Curseur
;
drawitem
->
Display_Infos
(
this
);
...
...
@@ -52,7 +52,7 @@ void WinEDA_PcbFrame::Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC )
if
(
drawitem
==
NULL
)
return
;
Trace_DrawSegmentPcb
(
DrawPanel
,
DC
,
drawitem
,
GR_OR
);
drawitem
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
DrawPanel
->
ManageCurseur
=
NULL
;
DrawPanel
->
ForceCloseManageCurseur
=
NULL
;
SetCurItem
(
NULL
);
...
...
@@ -77,7 +77,7 @@ static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/* efface ancienne position */
if
(
erase
)
Trace_DrawSegmentPcb
(
panel
,
DC
,
Segment
,
GR_XOR
);
Segment
->
Draw
(
panel
,
DC
,
GR_XOR
);
wxPoint
delta
;
delta
.
x
=
panel
->
GetScreen
()
->
m_Curseur
.
x
-
cursor_pos
.
x
;
...
...
@@ -88,7 +88,7 @@ static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
Segment
->
m_End
.
y
+=
delta
.
y
;
cursor_pos
=
panel
->
GetScreen
()
->
m_Curseur
;
Trace_DrawSegmentPcb
(
panel
,
DC
,
Segment
,
GR_XOR
);
Segment
->
Draw
(
panel
,
DC
,
GR_XOR
);
DisplayOpt
.
DisplayDrawItems
=
t_fill
;
}
...
...
@@ -107,7 +107,7 @@ void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC )
{
/* effacement du segment en cours de trace */
DisplayOpt
.
DisplayDrawItems
=
SKETCH
;
Trace_DrawSegmentPcb
(
DrawPanel
,
DC
,
Segment
,
GR_XOR
);
Segment
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
PtStruct
=
Segment
->
Pback
;
Segment
->
DeleteStructure
();
if
(
PtStruct
&&
(
PtStruct
->
Type
()
==
TYPEDRAWSEGMENT
)
)
...
...
@@ -117,7 +117,7 @@ void WinEDA_PcbFrame::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC )
}
else
{
Trace_DrawSegmentPcb
(
DrawPanel
,
DC
,
(
DRAWSEGMENT
*
)
Segment
,
GR_XOR
);
Segment
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
Segment
->
m_Flags
=
0
;
Segment
->
DeleteStructure
();
SetCurItem
(
NULL
);
...
...
@@ -136,14 +136,14 @@ void WinEDA_PcbFrame::Drawing_SetNewWidth( DRAWSEGMENT* DrawSegm, wxDC* DC )
if
(
DrawSegm
==
NULL
)
return
;
Trace_DrawSegmentPcb
(
DrawPanel
,
DC
,
DrawSegm
,
GR_XOR
);
DrawSegm
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
if
(
DrawSegm
->
GetLayer
()
==
EDGE_N
)
DrawSegm
->
m_Width
=
g_DesignSettings
.
m_EdgeSegmentWidth
;
else
DrawSegm
->
m_Width
=
g_DesignSettings
.
m_DrawSegmentWidth
;
Trace_DrawSegmentPcb
(
DrawPanel
,
DC
,
DrawSegm
,
GR_OR
);
DrawSegm
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
DrawSegm
->
Display_Infos
(
this
);
...
...
@@ -182,13 +182,6 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC
switch
(
item
->
Type
()
)
{
case
TYPEDRAWSEGMENT
:
if
(
item
->
GetLayer
()
==
layer
)
{
Trace_DrawSegmentPcb
(
DrawPanel
,
DC
,
(
DRAWSEGMENT
*
)
item
,
GR_XOR
);
item
->
DeleteStructure
();
}
break
;
case
TYPETEXTE
:
case
TYPECOTATION
:
if
(
item
->
GetLayer
()
==
layer
)
...
...
@@ -228,7 +221,7 @@ static void Exit_EditEdge( WinEDA_DrawPanel* Panel, wxDC* DC )
Panel
->
ManageCurseur
(
Panel
,
DC
,
TRUE
);
Panel
->
GetScreen
()
->
m_Curseur
=
pos
;
Segment
->
m_Flags
=
0
;
Trace_DrawSegmentPcb
(
Panel
,
DC
,
Segment
,
GR_OR
);
Segment
->
Draw
(
Panel
,
DC
,
GR_OR
);
}
Panel
->
ManageCurseur
=
NULL
;
Panel
->
ForceCloseManageCurseur
=
NULL
;
...
...
@@ -285,7 +278,7 @@ DRAWSEGMENT* WinEDA_PcbFrame::Begin_DrawSegment( DRAWSEGMENT* Segment,
GetScreen
()
->
SetModify
();
Segment
->
m_Flags
=
0
;
Trace_DrawSegmentPcb
(
DrawPanel
,
DC
,
Segment
,
GR_OR
);
Segment
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
DrawItem
=
Segment
;
...
...
@@ -317,7 +310,7 @@ void WinEDA_PcbFrame::End_Edge( DRAWSEGMENT* Segment, wxDC* DC )
{
if
(
Segment
==
NULL
)
return
;
Trace_DrawSegmentPcb
(
DrawPanel
,
DC
,
(
DRAWSEGMENT
*
)
Segment
,
GR_OR
);
Segment
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
/* Effacement si Longueur nulle */
if
(
(
Segment
->
m_Start
.
x
==
Segment
->
m_End
.
x
)
...
...
@@ -358,7 +351,7 @@ static void Montre_Position_NewSegment( WinEDA_DrawPanel* panel,
/* efface ancienne position */
if
(
erase
)
Trace_DrawSegmentPcb
(
panel
,
DC
,
Segment
,
GR_XOR
);
Segment
->
Draw
(
panel
,
DC
,
GR_XOR
);
if
(
Segments_45_Only
&&
(
Segment
->
m_Shape
==
S_SEGMENT
)
)
{
...
...
@@ -370,6 +363,6 @@ static void Montre_Position_NewSegment( WinEDA_DrawPanel* panel,
Segment
->
m_End
=
panel
->
GetScreen
()
->
m_Curseur
;
}
Trace_DrawSegmentPcb
(
panel
,
DC
,
Segment
,
GR_XOR
);
Segment
->
Draw
(
panel
,
DC
,
GR_XOR
);
DisplayOpt
.
DisplayDrawItems
=
t_fill
;
}
pcbnew/lay2plot.cpp
View file @
a196a324
...
...
@@ -29,7 +29,6 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl
*/
{
MODULE
*
Module
;
BOARD_ITEM
*
PtStruct
;
int
drawmode
=
GR_COPY
;
DISPLAY_OPTIONS
save_opt
;
TRACK
*
pt_piste
;
...
...
@@ -55,40 +54,21 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl
printmasklayer
|=
EDGE_LAYER
;
/* Draw the pcb graphic items (texts, ...) */
PtStruct
=
Pcb
->
m_Drawings
;
for
(
;
PtStruct
!=
NULL
;
PtStruct
=
PtStruct
->
Next
()
)
for
(
BOARD_ITEM
*
item
=
Pcb
->
m_Drawings
;
item
;
item
=
item
->
Next
()
)
{
switch
(
PtStruct
->
Type
()
)
switch
(
item
->
Type
()
)
{
case
TYPEDRAWSEGMENT
:
if
(
(
g_TabOneLayerMask
[
PtStruct
->
GetLayer
()]
&
printmasklayer
)
==
0
)
break
;
Trace_DrawSegmentPcb
(
this
,
DC
,
(
DRAWSEGMENT
*
)
PtStruct
,
drawmode
);
break
;
case
TYPECOTATION
:
if
(
(
g_TabOneLayerMask
[
PtStruct
->
GetLayer
()]
&
printmasklayer
)
==
0
)
break
;
(
(
COTATION
*
)
PtStruct
)
->
Draw
(
this
,
DC
,
drawmode
);
break
;
case
TYPETEXTE
:
{
if
(
(
g_TabOneLayerMask
[
PtStruct
->
GetLayer
()]
&
printmasklayer
)
==
0
)
break
;
(
(
TEXTE_PCB
*
)
PtStruct
)
->
Draw
(
this
,
DC
,
drawmode
);
break
;
}
case
TYPEMIRE
:
if
(
(
g_TabOneLayerMask
[
PtStruct
->
GetLayer
()]
&
printmasklayer
)
==
0
)
if
(
(
(
1
<<
item
->
GetLayer
())
&
printmasklayer
)
==
0
)
break
;
(
(
MIREPCB
*
)
PtStruct
)
->
Draw
(
this
,
DC
,
drawmode
);
break
;
case
TYPEMARKER
:
/* Trace des marqueurs */
item
->
Draw
(
this
,
DC
,
drawmode
);
break
;
case
TYPEMARKER
:
/* Trace des marqueurs */
default
:
break
;
}
...
...
pcbnew/protos.h
View file @
a196a324
...
...
@@ -65,11 +65,6 @@ void Trace_Une_Piste( WinEDA_DrawPanel* panel,
* donc mis a 0 avant appel a la routine si la piste a tracer est la derniere
*/
void
Trace_DrawSegmentPcb
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
DRAWSEGMENT
*
PtDrawSegment
,
int
mode_color
);
/****************/
/* TRACEMOD.C : */
...
...
pcbnew/trpiste.cpp
View file @
a196a324
...
...
@@ -58,13 +58,3 @@ void Trace_Une_Piste( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* Track,
}
/*************************************************************/
void
Trace_DrawSegmentPcb
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
DRAWSEGMENT
*
PtDrawSegment
,
int
draw_mode
)
/*************************************************************/
{
// @todo Replace all calls to Trace_DrawSegmentPcb() with this call:
PtDrawSegment
->
Draw
(
panel
,
DC
,
draw_mode
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment