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
eb94e66c
Commit
eb94e66c
authored
Sep 21, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: some code cleanup in plot functions.
parent
b1c9c542
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
185 additions
and
194 deletions
+185
-194
gen_drill_report_files.cpp
pcbnew/gen_drill_report_files.cpp
+6
-13
pcbplot.h
pcbnew/pcbplot.h
+41
-20
plot_rtn.cpp
pcbnew/plot_rtn.cpp
+138
-161
No files found.
pcbnew/gen_drill_report_files.cpp
View file @
eb94e66c
...
...
@@ -41,7 +41,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
wxPoint
offset
;
PLOTTER
*
plotter
=
NULL
;
const
PCB_PLOT_PARAMS
&
plot_opts
=
aPcb
->
GetPlotOptions
();
PCB_PLOT_PARAMS
plot_opts
;
// starts plotting with default options
LOCALE_IO
toggle
;
// use standard C notation for float numbers
...
...
@@ -131,33 +131,26 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
plotter
->
SetDefaultLineWidth
(
10
*
IU_PER_DECIMILS
);
plotter
->
StartPlot
(
aFile
);
// Draw items on edge layer
// Draw items on edge layer (not all, only items useful for drill map
BRDITEMS_PLOTTER
itemplotter
(
plotter
,
aPcb
,
plot_opts
);
itemplotter
.
SetLayerMask
(
EDGE_LAYER
);
for
(
EDA_ITEM
*
PtStruct
=
aPcb
->
m_Drawings
;
PtStruct
!=
NULL
;
PtStruct
=
PtStruct
->
Next
()
)
{
switch
(
PtStruct
->
Type
()
)
{
case
PCB_LINE_T
:
PlotDrawSegment
(
plotter
,
plot_opts
,
(
DRAWSEGMENT
*
)
PtStruct
,
EDGE_LAYER
,
FILLED
);
itemplotter
.
PlotDrawSegment
(
(
DRAWSEGMENT
*
)
PtStruct
);
break
;
case
PCB_TEXT_T
:
PlotTextePcb
(
plotter
,
plot_opts
,
(
TEXTE_PCB
*
)
PtStruct
,
EDGE_LAYER
,
FILLED
);
itemplotter
.
PlotTextePcb
(
(
TEXTE_PCB
*
)
PtStruct
);
break
;
case
PCB_DIMENSION_T
:
PlotDimension
(
plotter
,
plot_opts
,
(
DIMENSION
*
)
PtStruct
,
EDGE_LAYER
,
FILLED
);
break
;
case
PCB_TARGET_T
:
PlotPcbTarget
(
plotter
,
plot_opts
,
(
PCB_TARGET
*
)
PtStruct
,
EDGE_LAYER
,
FILLED
);
break
;
case
PCB_MARKER_T
:
// do not draw
break
;
default:
DisplayError
(
NULL
,
wxT
(
"WinEDA_DrillFrame::GenDrillMap() : Unexpected Draw Type"
)
);
break
;
}
}
...
...
pcbnew/pcbplot.h
View file @
eb94e66c
...
...
@@ -7,14 +7,16 @@
#include <pcb_plot_params.h>
class
PLOTTER
;
class
TEXTE_PCB
;
class
DRAWSEGMENT
;
class
DIMENSION
;
class
MODULE
;
class
EDGE_MODULE
;
class
PCB_TARGET
;
class
TEXTE_MODULE
;
class
ZONE_CONTAINER
;
class
BOARD
;
// Shared Config keys for plot and print
...
...
@@ -43,25 +45,44 @@ class ZONE_CONTAINER;
// Small drill marks diameter value (in 1/10000 inch)
#define SMALL_DRILL 150
void
PlotTextePcb
(
PLOTTER
*
plotter
,
const
PCB_PLOT_PARAMS
&
aPlotOpts
,
TEXTE_PCB
*
pt_texte
,
int
masque_layer
,
EDA_DRAW_MODE_T
trace_mode
);
void
PlotDrawSegment
(
PLOTTER
*
plotter
,
const
PCB_PLOT_PARAMS
&
aPlotOpts
,
DRAWSEGMENT
*
PtSegm
,
int
masque_layer
,
EDA_DRAW_MODE_T
trace_mode
);
void
PlotDimension
(
PLOTTER
*
plotter
,
const
PCB_PLOT_PARAMS
&
aPlotOpts
,
DIMENSION
*
Dimension
,
int
masque_layer
,
EDA_DRAW_MODE_T
trace_mode
);
void
PlotPcbTarget
(
PLOTTER
*
plotter
,
const
PCB_PLOT_PARAMS
&
aPlotOpts
,
PCB_TARGET
*
PtMire
,
int
masque_layer
,
EDA_DRAW_MODE_T
trace_mode
);
void
Plot_1_EdgeModule
(
PLOTTER
*
plotter
,
const
PCB_PLOT_PARAMS
&
aPlotOpts
,
EDGE_MODULE
*
PtEdge
,
EDA_DRAW_MODE_T
trace_mode
,
int
masque_layer
);
void
PlotFilledAreas
(
PLOTTER
*
plotter
,
const
PCB_PLOT_PARAMS
&
aPlotOpts
,
ZONE_CONTAINER
*
aZone
,
EDA_DRAW_MODE_T
trace_mode
);
// A helper class to plot board items
class
BRDITEMS_PLOTTER
:
public
PCB_PLOT_PARAMS
{
PLOTTER
*
m_plotter
;
BOARD
*
m_board
;
int
m_layerMask
;
public
:
BRDITEMS_PLOTTER
(
PLOTTER
*
aPlotter
,
BOARD
*
aBoard
,
const
PCB_PLOT_PARAMS
&
aPlotOpts
)
:
PCB_PLOT_PARAMS
(
aPlotOpts
)
{
m_plotter
=
aPlotter
;
m_board
=
aBoard
;
m_layerMask
=
0
;
}
// Basic functions to plot a board item
void
SetLayerMask
(
int
aLayerMask
){
m_layerMask
=
aLayerMask
;
}
void
Plot_Edges_Modules
();
void
Plot_1_EdgeModule
(
EDGE_MODULE
*
aEdge
);
void
PlotTextModule
(
TEXTE_MODULE
*
aTextMod
,
EDA_COLOR_T
aColor
);
bool
PlotAllTextsModule
(
MODULE
*
aModule
);
void
PlotDimension
(
DIMENSION
*
Dimension
);
void
PlotPcbTarget
(
PCB_TARGET
*
PtMire
);
void
PlotFilledAreas
(
ZONE_CONTAINER
*
aZone
);
void
PlotTextePcb
(
TEXTE_PCB
*
pt_texte
);
void
PlotDrawSegment
(
DRAWSEGMENT
*
PtSegm
);
/**
* Function getColor
* @return the layer color
* @param aLayer = the layer id
* White color is special: cannot be seen on a white paper
* and in B&W mode, is plotted as white but other colors are plotted in BLACK
* so the returned color is LIGHTGRAY when the layer color is WHITE
*/
EDA_COLOR_T
getColor
(
int
aLayer
);
};
PLOTTER
*
StartPlotBoard
(
BOARD
*
aBoard
,
PCB_PLOT_PARAMS
*
aPlotOpts
,
...
...
pcbnew/plot_rtn.cpp
View file @
eb94e66c
This diff is collapsed.
Click to expand it.
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