Commit 8faf1e72 authored by jean-pierre charras's avatar jean-pierre charras

Gerbview:

    Added: in file dialog, multiple file selection.
    Added: Draw mode selector (in left toolbar):
        Raw mode:
            a Gerber image is drawn on screen without buffering.
            Artifacts happen if there are negative items drawn, if more than one  Gerber file is shown.
        Stacked mode:
            each Geber image is drawn in a buffer and after drawn on screen
            No artifact with negative items.
            Each Gerber image covers previous images.
        OR mode (transparency mode):
            each Geber image is drawn in a buffer and after drawn on screen
            No artifact with negative items.
            Each Gerber image is "ORed" with previous images, like in Pcbnew.
    Try to optimize Draw function in buffered modes.
        (Useful for PC that have problems with "blit" graphic function)
    Fix minor issues.
parent 1cdf342d
......@@ -4,6 +4,27 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with
email address.
2010-dec-15, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
Gerbview:
Added: in file dialog, multiple file selection.
Added: Draw mode selector (in left toolbar):
Raw mode:
a Gerber image is drawn on screen without buffering.
Artifacts happen if there are negative items drawn, if more than one
Gerber file is shown.
Stacked mode:
each Geber image is drawn in a buffer and after drawn on screen
No artifact with negative items.
Each Gerber image covers previous images.
OR mode (transparency mode):
each Geber image is drawn in a buffer and after drawn on screen
No artifact with negative items.
Each Gerber image is "ORed" with previous images, like in Pcbnew.
Try to optimize Draw function in buffered modes.
(Useful for PC that have problems with "blit" graphic function)
Fix minor issues.
2010-dec-13 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
* Remove deprecated options and quoted project name option in Doxygen file.
......
......@@ -135,6 +135,9 @@ set(BITMAP_SRCS
Flag.xpm
Fonts.xpm
Footprint_Text.xpm
gbr_select_mode0.xpm
gbr_select_mode1.xpm
gbr_select_mode2.xpm
general_deletions.xpm
general_ratsnet.xpm
GLabel2Label.xpm
......
/* XPM */
const char *gbr_select_mode0_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 16 1",
": c #BC9694",
"% c #B43B3C",
"& c #B46A6C",
"* c #643E3C",
"O c #8C8D8C",
"$ c #8C1A1C",
"- c #7C2A2C",
"X c #717071",
"o c None",
". c #4C4E4C",
"= c #BC9A9C",
"+ c #ACAAAC",
"# c #AC0204",
" c #585858",
"@ c #AC1614",
"; c #AC0A0C",
/* pixels */
" ............Xoo",
"X............ oo",
"O.............+o",
"+.............Oo",
"o ............Xo",
"oX............ o",
"@############$.+",
"%#############.O",
"&#############*X",
"=#############- ",
"o;############%o",
"o%############;o",
"o&#############=",
"o:#############&",
"oo;############%",
"oo%############@"
};
/* XPM */
const char *gbr_select_mode1_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 16 1",
": c #BC9694",
"; c #4C4604",
"% c #B43B3C",
"= c #246604",
"* c #B46A6C",
"+ c #9CB29C",
"X c None",
"$ c #742A04",
"O c #94B294",
"- c #BC9A9C",
"# c #AC0204",
"& c #047E04",
"@ c #AC1614",
" c #058205",
". c #3C943C",
"o c #6CA56C",
/* pixels */
" .XX",
". XX",
"o OX",
"+ oX",
"X .X",
"X. X",
"@############$ +",
"%#############&o",
"*#############=.",
"-#############; ",
"X#############%X",
"X%#############X",
"X*#############-",
"X:#############*",
"XX#############%",
"XX%############@"
};
/* XPM */
const char *gbr_select_mode2_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 16 1",
"$ c #213C2F",
"X c #3C3C94",
"O c #6C6AA4",
"* c #8D3616",
" c #0E1F72",
"; c #B28D96",
"o c None",
". c #040284",
"+ c #A2A89F",
"# c #04562C",
"@ c #38783C",
"- c #BC6B6C",
"% c #599A5F",
"= c #751F14",
"& c #BC4745",
": c #745224",
/* pixels */
" ............Xoo",
"X.............oo",
"O.............+o",
"@############$Oo",
"%#############Xo",
"+@############ o",
"&*===========$ +",
"-*============$O",
";*============$X",
"+&============$ ",
"o&************:+",
"o-*************%",
"o;*************@",
"o+&&&&&&&&&&&&&;",
"oo&&&&&&&&&&&&&-",
"oo-&&&&&&&&&&&&&"
};
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="F:\kicad-launchpad\testing\bitmaps\sources\gbr_select_mode0.png"
width="16"
height="16"
id="svg11300"
sodipodi:version="0.32"
inkscape:version="0.47 r22583"
sodipodi:docname="gbr_select_mode0.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
<title
id="title2867">fabrication.svg</title>
<defs
id="defs3">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 8 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="16 : 8 : 1"
inkscape:persp3d-origin="8 : 5.3333333 : 1"
id="perspective62" />
<linearGradient
inkscape:collect="always"
id="linearGradient2250">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2252" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop2254" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient2265">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop2267" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop2269" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient2257">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2259" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop2261" />
</linearGradient>
<linearGradient
id="linearGradient3087">
<stop
style="stop-color:#3465a4;stop-opacity:1;"
offset="0"
id="stop3089" />
<stop
id="stop3095"
offset="0"
style="stop-color:#9fbce1;stop-opacity:1;" />
<stop
style="stop-color:#6b95ca;stop-opacity:1;"
offset="0"
id="stop2242" />
<stop
id="stop2244"
offset="0.75"
style="stop-color:#3d6aa5;stop-opacity:1;" />
<stop
style="stop-color:#386eb4;stop-opacity:1;"
offset="1"
id="stop3091" />
</linearGradient>
<linearGradient
id="linearGradient3077">
<stop
style="stop-color:#98a0a9;stop-opacity:1;"
offset="0"
id="stop3079" />
<stop
style="stop-color:#c3d0dd;stop-opacity:1;"
offset="1"
id="stop3081" />
</linearGradient>
<linearGradient
id="linearGradient3061">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop3063" />
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="1"
id="stop3065" />
</linearGradient>
<linearGradient
id="linearGradient3049">
<stop
style="stop-color:#b6b6b6;stop-opacity:1;"
offset="0"
id="stop3051" />
<stop
id="stop2262"
offset="0.5"
style="stop-color:#f2f2f2;stop-opacity:1;" />
<stop
style="stop-color:#fafafa;stop-opacity:1;"
offset="0.67612958"
id="stop2264" />
<stop
id="stop2268"
offset="0.84051722"
style="stop-color:#d8d8d8;stop-opacity:1;" />
<stop
id="stop2266"
offset="0.875"
style="stop-color:#f2f2f2;stop-opacity:1;" />
<stop
style="stop-color:#dbdbdb;stop-opacity:1;"
offset="1"
id="stop3053" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3041">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop3043" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop3045" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3041"
id="radialGradient3047"
cx="24.8125"
cy="39.125"
fx="24.8125"
fy="39.125"
r="17.6875"
gradientTransform="matrix(1,0,0,0.374558,0,24.47041)"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3061"
id="linearGradient3067"
x1="50.152931"
y1="-3.6324477"
x2="25.291086"
y2="-4.3002653"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.25783861,0,0,0.2595286,32.155794,28.984379)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3087"
id="linearGradient3093"
x1="9.7503242"
y1="32.28376"
x2="16.915297"
y2="39.443218"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.28963035,0,0,0.22349527,2.044995,37.38192)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2257"
id="linearGradient2263"
x1="12.004697"
y1="35.688461"
x2="10.650805"
y2="33.194965"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.33216589,-0.00670924,0.00869457,0.2563181,1.7338281,36.137935)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2265"
id="linearGradient2271"
x1="14.017542"
y1="36.942543"
x2="15.415793"
y2="38.268368"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.28957395,-0.0044084,0.0057129,0.22345175,1.92189,37.152949)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2250"
id="linearGradient2256"
x1="31.177404"
y1="19.821514"
x2="40.859177"
y2="9.6568537"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.3297737,0,0,0.25447215,1.2083631,36.117783)" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3041"
id="radialGradient2260"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.374558,0,24.47041)"
cx="24.8125"
cy="39.125"
fx="24.8125"
fy="39.125"
r="17.6875" />
</defs>
<sodipodi:namedview
stroke="#204a87"
fill="#3465a4"
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="0.25490196"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
inkscape:cx="5.730549"
inkscape:cy="8.561168"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:showpageshadow="false"
inkscape:window-width="1280"
inkscape:window-height="968"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2865"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
empcolor="#0000ff"
empopacity="0.1372549"
dotted="true" />
</sodipodi:namedview>
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Steiner</dc:title>
</cc:Agent>
</dc:creator>
<dc:source />
<cc:license
rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
<dc:title>fabrication.svg</dc:title>
<dc:subject>
<rdf:Bag />
</dc:subject>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/publicdomain/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer"
transform="translate(0,-32)">
<rect
style="fill:#4d4d4d"
id="rect2932"
width="13.536558"
height="10.298958"
x="-7.8830147"
y="32.956669"
transform="matrix(1,0,0.23919332,0.97097197,0,0)"
rx="0.25089604"
ry="0.38427848"
inkscape:export-filename="F:\kicad-sourceforge\trunk\kicad\bitmaps\sources\layers_manager.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="F:\kicad-sourceforge\trunk\kicad\bitmaps\sources\layers_manager.png"
ry="0.38427848"
rx="0.25089604"
transform="matrix(1,0,0.23919332,0.97097196,0,0)"
y="39.136044"
x="-9.3610802"
height="10.298958"
width="13.536558"
id="rect2878"
style="fill:#aa0000" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="F:\kicad-launchpad\testing\bitmaps\sources\gbr_select_mode1.png"
width="16"
height="16"
id="svg11300"
sodipodi:version="0.32"
inkscape:version="0.47 r22583"
sodipodi:docname="gbr_select_mode1.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
<title
id="title2867">fabrication.svg</title>
<defs
id="defs3">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 8 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="16 : 8 : 1"
inkscape:persp3d-origin="8 : 5.3333333 : 1"
id="perspective62" />
<linearGradient
inkscape:collect="always"
id="linearGradient2250">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2252" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop2254" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient2265">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop2267" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop2269" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient2257">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2259" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop2261" />
</linearGradient>
<linearGradient
id="linearGradient3087">
<stop
style="stop-color:#3465a4;stop-opacity:1;"
offset="0"
id="stop3089" />
<stop
id="stop3095"
offset="0"
style="stop-color:#9fbce1;stop-opacity:1;" />
<stop
style="stop-color:#6b95ca;stop-opacity:1;"
offset="0"
id="stop2242" />
<stop
id="stop2244"
offset="0.75"
style="stop-color:#3d6aa5;stop-opacity:1;" />
<stop
style="stop-color:#386eb4;stop-opacity:1;"
offset="1"
id="stop3091" />
</linearGradient>
<linearGradient
id="linearGradient3077">
<stop
style="stop-color:#98a0a9;stop-opacity:1;"
offset="0"
id="stop3079" />
<stop
style="stop-color:#c3d0dd;stop-opacity:1;"
offset="1"
id="stop3081" />
</linearGradient>
<linearGradient
id="linearGradient3061">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop3063" />
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="1"
id="stop3065" />
</linearGradient>
<linearGradient
id="linearGradient3049">
<stop
style="stop-color:#b6b6b6;stop-opacity:1;"
offset="0"
id="stop3051" />
<stop
id="stop2262"
offset="0.5"
style="stop-color:#f2f2f2;stop-opacity:1;" />
<stop
style="stop-color:#fafafa;stop-opacity:1;"
offset="0.67612958"
id="stop2264" />
<stop
id="stop2268"
offset="0.84051722"
style="stop-color:#d8d8d8;stop-opacity:1;" />
<stop
id="stop2266"
offset="0.875"
style="stop-color:#f2f2f2;stop-opacity:1;" />
<stop
style="stop-color:#dbdbdb;stop-opacity:1;"
offset="1"
id="stop3053" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3041">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop3043" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop3045" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3041"
id="radialGradient3047"
cx="24.8125"
cy="39.125"
fx="24.8125"
fy="39.125"
r="17.6875"
gradientTransform="matrix(1,0,0,0.374558,0,24.47041)"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3061"
id="linearGradient3067"
x1="50.152931"
y1="-3.6324477"
x2="25.291086"
y2="-4.3002653"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.25783861,0,0,0.2595286,32.155794,28.984379)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3087"
id="linearGradient3093"
x1="9.7503242"
y1="32.28376"
x2="16.915297"
y2="39.443218"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.28963035,0,0,0.22349527,2.044995,37.38192)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2257"
id="linearGradient2263"
x1="12.004697"
y1="35.688461"
x2="10.650805"
y2="33.194965"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.33216589,-0.00670924,0.00869457,0.2563181,1.7338281,36.137935)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2265"
id="linearGradient2271"
x1="14.017542"
y1="36.942543"
x2="15.415793"
y2="38.268368"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.28957395,-0.0044084,0.0057129,0.22345175,1.92189,37.152949)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2250"
id="linearGradient2256"
x1="31.177404"
y1="19.821514"
x2="40.859177"
y2="9.6568537"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.3297737,0,0,0.25447215,1.2083631,36.117783)" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3041"
id="radialGradient2260"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.374558,0,24.47041)"
cx="24.8125"
cy="39.125"
fx="24.8125"
fy="39.125"
r="17.6875" />
</defs>
<sodipodi:namedview
stroke="#204a87"
fill="#3465a4"
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="0.25490196"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
inkscape:cx="5.730549"
inkscape:cy="8.561168"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:showpageshadow="false"
inkscape:window-width="1280"
inkscape:window-height="968"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2865"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
empcolor="#0000ff"
empopacity="0.1372549"
dotted="true" />
</sodipodi:namedview>
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Steiner</dc:title>
</cc:Agent>
</dc:creator>
<dc:source />
<cc:license
rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
<dc:title>fabrication.svg</dc:title>
<dc:subject>
<rdf:Bag />
</dc:subject>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/publicdomain/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer"
transform="translate(0,-32)">
<rect
style="fill:#008000"
id="rect2932"
width="13.536558"
height="10.298958"
x="-7.8830147"
y="32.956669"
transform="matrix(1,0,0.23919332,0.97097197,0,0)"
rx="0.25089604"
ry="0.38427848"
inkscape:export-filename="F:\kicad-sourceforge\trunk\kicad\bitmaps\sources\layers_manager.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="F:\kicad-sourceforge\trunk\kicad\bitmaps\sources\layers_manager.png"
ry="0.38427848"
rx="0.25089604"
transform="matrix(1,0,0.23919332,0.97097196,0,0)"
y="39.136044"
x="-9.3610802"
height="10.298958"
width="13.536558"
id="rect2878"
style="fill:#aa0000" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="F:\kicad-launchpad\testing\bitmaps\sources\gbr_select_mode2.png"
width="16"
height="16"
id="svg11300"
sodipodi:version="0.32"
inkscape:version="0.47 r22583"
sodipodi:docname="gbr_select_mode2.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
<title
id="title2867">fabrication.svg</title>
<defs
id="defs3">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 8 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="16 : 8 : 1"
inkscape:persp3d-origin="8 : 5.3333333 : 1"
id="perspective62" />
<linearGradient
id="linearGradient3087">
<stop
style="stop-color:#3465a4;stop-opacity:1;"
offset="0"
id="stop3089" />
<stop
id="stop3095"
offset="0"
style="stop-color:#9fbce1;stop-opacity:1;" />
<stop
style="stop-color:#6b95ca;stop-opacity:1;"
offset="0"
id="stop2242" />
<stop
id="stop2244"
offset="0.75"
style="stop-color:#3d6aa5;stop-opacity:1;" />
<stop
style="stop-color:#386eb4;stop-opacity:1;"
offset="1"
id="stop3091" />
</linearGradient>
<linearGradient
id="linearGradient3077">
<stop
style="stop-color:#98a0a9;stop-opacity:1;"
offset="0"
id="stop3079" />
<stop
style="stop-color:#c3d0dd;stop-opacity:1;"
offset="1"
id="stop3081" />
</linearGradient>
<linearGradient
id="linearGradient3061">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop3063" />
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="1"
id="stop3065" />
</linearGradient>
<linearGradient
id="linearGradient3049">
<stop
style="stop-color:#b6b6b6;stop-opacity:1;"
offset="0"
id="stop3051" />
<stop
id="stop2262"
offset="0.5"
style="stop-color:#f2f2f2;stop-opacity:1;" />
<stop
style="stop-color:#fafafa;stop-opacity:1;"
offset="0.67612958"
id="stop2264" />
<stop
id="stop2268"
offset="0.84051722"
style="stop-color:#d8d8d8;stop-opacity:1;" />
<stop
id="stop2266"
offset="0.875"
style="stop-color:#f2f2f2;stop-opacity:1;" />
<stop
style="stop-color:#dbdbdb;stop-opacity:1;"
offset="1"
id="stop3053" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3041">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop3043" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop3045" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3041"
id="radialGradient3047"
cx="24.8125"
cy="39.125"
fx="24.8125"
fy="39.125"
r="17.6875"
gradientTransform="matrix(1,0,0,0.374558,0,24.47041)"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3041"
id="radialGradient2260"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.374558,0,24.47041)"
cx="24.8125"
cy="39.125"
fx="24.8125"
fy="39.125"
r="17.6875" />
</defs>
<sodipodi:namedview
stroke="#204a87"
fill="#3465a4"
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="0.25490196"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32"
inkscape:cx="7.0561897"
inkscape:cy="8.4031019"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:showpageshadow="false"
inkscape:window-width="1280"
inkscape:window-height="968"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2865"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
empcolor="#0000ff"
empopacity="0.1372549"
dotted="true" />
</sodipodi:namedview>
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:creator>
<cc:Agent>
<dc:title>Jakub Steiner</dc:title>
</cc:Agent>
</dc:creator>
<dc:source />
<cc:license
rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
<dc:title>fabrication.svg</dc:title>
<dc:subject>
<rdf:Bag />
</dc:subject>
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/publicdomain/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer"
transform="translate(0,-32)">
<rect
style="fill:#000080"
id="rect2932"
width="13.536558"
height="10.298958"
x="-7.8830147"
y="32.956669"
transform="matrix(1,0,0.23919332,0.97097197,0,0)"
rx="0.25089604"
ry="0.38427848"
inkscape:export-filename="F:\kicad-sourceforge\trunk\kicad\bitmaps\sources\layers_manager.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="F:\kicad-sourceforge\trunk\kicad\bitmaps\sources\layers_manager.png"
ry="0.38427848"
rx="0.25089604"
transform="matrix(1,0,0.23919332,0.97097196,0,0)"
y="36.046356"
x="-8.6220474"
height="10.298958"
width="13.536558"
id="rect2878"
style="fill:#008000;opacity:0.66666667" />
<rect
style="fill:#b90000;opacity:0.64102563999999995;fill-opacity:1"
id="rect3120"
width="13.536557"
height="10.298958"
x="-9.3610792"
y="39.136044"
transform="matrix(1,0,0.23919331,0.97097197,0,0)"
rx="0.25089604"
ry="0.38427848"
inkscape:export-filename="F:\kicad-sourceforge\trunk\kicad\bitmaps\sources\layers_manager.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
</g>
</svg>
......@@ -95,7 +95,7 @@ GERBER_IMAGE::GERBER_IMAGE( WinEDA_GerberFrame* aParent, int aLayer )
for( unsigned ii = 0; ii < DIM( m_Aperture_List ); ii++ )
m_Aperture_List[ii] = 0;
m_Pcb = 0;
m_Pcb = aParent->GetBoard();
}
......@@ -151,6 +151,7 @@ void GERBER_IMAGE::ResetDefaultValues()
m_FileName.Empty();
m_ImageName = wxT( "no name" ); // Image name from the IN command
m_ImageNegative = false; // true = Negative image
m_hasNegativeItems = -1; // set to uninitialized
m_ImageJustifyOffset = wxPoint(0,0); // Image justify Offset
m_ImageJustifyXCenter = false; // Image Justify Center on X axis (default = false)
m_ImageJustifyYCenter = false; // Image Justify Center on Y axis (default = false)
......@@ -190,6 +191,35 @@ void GERBER_IMAGE::ResetDefaultValues()
m_Selected_Tool = FIRST_DCODE;
}
/* Function HasNegativeItems
* return true if at least one item must be drawn in background color
* used to optimize screen refresh
*/
bool GERBER_IMAGE::HasNegativeItems()
{
if( m_hasNegativeItems < 0 ) // negative items are not yet searched: find them if any
{
if( m_ImageNegative ) // A negative layer is expected having always negative objects.
m_hasNegativeItems = 1;
else
{
m_hasNegativeItems = 0;
for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = item->Next() )
{
GERBER_DRAW_ITEM* gerb_item = (GERBER_DRAW_ITEM*) item;
if( gerb_item->GetLayer() != m_GraphicLayer )
continue;
if( gerb_item->HasNegativeItems() )
{
m_hasNegativeItems = 1;
break;
}
}
// TODO search for items in list
}
}
return m_hasNegativeItems == 1;
}
int GERBER_IMAGE::ReturnUsedDcodeNumber()
{
......
......@@ -128,6 +128,15 @@ public:
APERTURE_MACRO_SET m_aperture_macros; ///< a collection of APERTURE_MACROS, sorted by name
private:
int m_hasNegativeItems; // true if the image is negative or has some negative items
// Used to optimize drawing, because when there are no
// negative items screen refresh does not need
// to build an intermediate bitmap specfic to this image
// -1 = negative items are
// 0 = no negative items found
// 1 = have negative items found
public:
GERBER_IMAGE( WinEDA_GerberFrame* aParent, int layer );
~GERBER_IMAGE();
......@@ -144,6 +153,13 @@ public:
return m_GBRLayerParams;
}
/**
* Function HasNegativeItems
* @return true if at least one item must be drawn in background color
* used to optimize screen refresh (when no items are in background color
* refresh can be faster)
*/
bool HasNegativeItems();
/**
* Function ReportMessage
......
......@@ -738,6 +738,24 @@ void APERTURE_MACRO::DrawApertureMacroShape( GERBER_DRAW_ITEM* aParent,
}
}
/* Function HasNegativeItems
* return true if this macro has at least one aperture primitives
* that must be drawn in background color
* used to optimize screen refresh
*/
bool APERTURE_MACRO::HasNegativeItems( GERBER_DRAW_ITEM* aParent )
{
for( AM_PRIMITIVES::iterator prim_macro = primitives.begin();
prim_macro != primitives.end(); ++prim_macro )
{
if( prim_macro->mapExposure( aParent ) == false ) // = is negative
return true;
}
return false;
}
/** GetShapeDim
* Calculate a value that can be used to evaluate the size of text
* when displaying the D-Code of an item
......
......@@ -208,7 +208,8 @@ struct APERTURE_MACRO
void DrawApertureMacroShape( GERBER_DRAW_ITEM* aParent, EDA_Rect* aClipBox, wxDC* aDC,
int aColor, int aAltColor, wxPoint aShapePos, bool aFilledShape );
/** GetShapeDim
/**
* Function GetShapeDim
* Calculate a value that can be used to evaluate the size of text
* when displaying the D-Code of an item
* due to the complexity of a shape using many primitives
......@@ -220,6 +221,16 @@ struct APERTURE_MACRO
* @return a dimension, or -1 if no dim to calculate
*/
int GetShapeDim( GERBER_DRAW_ITEM* aParent );
/**
* Function HasNegativeItems
* @param aParent = the parent GERBER_DRAW_ITEM which is actually drawn
* @return true if this macro has at least one shape (using aperture primitives)
* must be drawn in background color
* used to optimize screen refresh (when no items are in background color
* refresh can be faster)
*/
bool HasNegativeItems( GERBER_DRAW_ITEM* aParent );
};
......
......@@ -310,6 +310,34 @@ bool GERBER_DRAW_ITEM::Save( FILE* aFile ) const
return true;
}
/* Function HasNegativeItems
* return true if this item or at least one shape (when using aperture macros)
* must be drawn in background color
* useful to optimize screen refresh
*/
bool GERBER_DRAW_ITEM::HasNegativeItems()
{
bool isClear = m_LayerNegative ^ m_imageParams->m_ImageNegative;
// if isClear is true, this item has negative shape
// but if isClear is true, and if this item use an aperture macro definition,
// we must see if this aperture macro uses a negative shape.
if( isClear )
return true;
// see for a macro def
D_CODE* dcodeDescr = GetDcodeDescr();
if( dcodeDescr == NULL )
return false;
if( m_Shape == GBR_SPOT_MACRO )
{
APERTURE_MACRO* macro = dcodeDescr->GetMacro();
if( macro ) // macro == NULL should not occurs
return macro->HasNegativeItems( this );
}
return false;
}
/*********************************************************************/
void GERBER_DRAW_ITEM::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode,
......
......@@ -119,6 +119,15 @@ public:
{
return m_LayerNegative;
}
/**
* Function HasNegativeItems
* @return true if this item or at least one shape (when using aperture macros
* must be drawn in background color
* used to optimize screen refresh (when no items are in background color
* refresh can be faster)
*/
bool HasNegativeItems();
/**
* Function SetLayerParameters
......
This diff is collapsed.
......@@ -28,7 +28,7 @@ void WinEDA_GerberFrame::OnFileHistory( wxCommandEvent& event )
if( fn != wxEmptyString )
{
Erase_Current_Layer( false );
LoadOneGerberFile( fn, false );
LoadGerberFiles( fn );
}
}
......@@ -42,9 +42,8 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
{
case wxID_FILE:
{
wxString fileName = GetScreen()->m_FileName;
Erase_Current_Layer( false );
LoadOneGerberFile( fileName, true );
LoadGerberFiles( wxEmptyString );
break;
}
......@@ -56,7 +55,7 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
{
setActiveLayer(origLayer+1);
Erase_Current_Layer( false );
if( !LoadOneGerberFile( wxEmptyString ) )
if( !LoadGerberFiles( wxEmptyString ) )
setActiveLayer(origLayer);
SetToolbars();
}
......@@ -92,14 +91,16 @@ delete an existing layer to load any new layers." ), NB_LAYERS );
}
bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& aFullFileName, bool aOpenFileDialog )
bool WinEDA_GerberFrame::LoadGerberFiles( const wxString& aFullFileName )
{
wxString filetypes;
wxArrayString filenamesList;
wxFileName filename = aFullFileName;
wxString currentPath;
ActiveScreen = GetScreen();
if( !filename.IsOk() || aOpenFileDialog )
if( ! filename.IsOk() )
{
/* Standard gerber filetypes
* (See http://en.wikipedia.org/wiki/Gerber_File)
......@@ -132,30 +133,57 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& aFullFileName, bool
filetypes += AllFilesWildcard;
/* Use the current working directory if the file name path does not exist. */
wxString current_path = wxGetCwd();
if( filename.DirExists() )
current_path = filename.GetPath();
currentPath = filename.GetPath();
else
currentPath = wxGetCwd();
wxFileDialog dlg( this,
_( "Open Gerber File" ),
current_path,
currentPath,
filename.GetFullName(),
filetypes,
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE | wxFD_CHANGE_DIR );
if( dlg.ShowModal() == wxID_CANCEL )
return false;
filename = dlg.GetPath();
dlg.GetFilenames( filenamesList );
currentPath = wxGetCwd();
}
else
{
wxFileName filename = aFullFileName;
filenamesList.Add( aFullFileName );
currentPath = filename.GetPath();
}
GetScreen()->m_FileName = filename.GetFullPath();
wxSetWorkingDirectory( filename.GetPath() );
filename.SetExt( g_PenFilenameExt );
if( Read_GERBER_File( GetScreen()->m_FileName, filename.GetFullPath() ) )
SetLastProject( GetScreen()->m_FileName );
// Read gerber files: each file is loaded on a new gerbview layer
int layer = getActiveLayer() - 1;
for( unsigned ii = 0; ii < filenamesList.GetCount(); ii++ )
{
wxFileName filename = filenamesList[ii];
filename.SetPath( currentPath );
GetScreen()->m_FileName = filename.GetFullPath();
filename.SetExt( g_PenFilenameExt );
layer++;
if( layer >= NB_LAYERS )
layer = 0;
setActiveLayer(layer);
if( Read_GERBER_File( GetScreen()->m_FileName, filename.GetFullPath() ) )
{
SetLastProject( GetScreen()->m_FileName );
}
else
{
layer--;
if( layer >= 0 )
setActiveLayer(layer);
else
setActiveLayer(0);
}
}
Zoom_Automatique( false );
GetScreen()->SetRefreshReq();
......@@ -203,36 +231,3 @@ static void LoadDCodeFile( WinEDA_GerberFrame* frame,
frame->CopyDCodesSizeToItems();
frame->GetScreen()->SetRefreshReq();
}
/* Save the file in ASCII PCB.
*/
bool WinEDA_GerberFrame::SaveGerberFile( const wxString& FullFileName )
{
wxString wildcard;
wxFileName fn = FullFileName;
if( !fn.IsOk() )
{
fn = GetScreen()->m_FileName;
wildcard.Printf( _( "Gerber DCODE files (%s)|*.%s" ),
GetChars( g_PenFilenameExt ),
GetChars( g_PenFilenameExt ) );
wxFileDialog dlg( this, _( "Save Gerber File" ), fn.GetPath(),
fn.GetFullName(), wildcard,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
if( dlg.ShowModal() == wxID_CANCEL )
return false;
fn = dlg.GetPath();
}
GetScreen()->m_FileName = fn.GetFullPath();
// TODO
return true;
}
......@@ -119,6 +119,12 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
WinEDA_GerberFrame::OnSelectOptionToolbar )
EVT_TOOL( ID_TB_OPTIONS_SHOW_DCODES,
WinEDA_GerberFrame::OnSelectOptionToolbar )
EVT_TOOL( ID_TB_OPTIONS_SHOW_GBR_MODE_0,
WinEDA_GerberFrame::OnSelectDisplayMode )
EVT_TOOL( ID_TB_OPTIONS_SHOW_GBR_MODE_1,
WinEDA_GerberFrame::OnSelectDisplayMode )
EVT_TOOL( ID_TB_OPTIONS_SHOW_GBR_MODE_2,
WinEDA_GerberFrame::OnSelectDisplayMode )
END_EVENT_TABLE()
......@@ -137,6 +143,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
m_HotkeysZoomAndGridList = s_Gerbview_Hokeys_Descr;
m_SelLayerBox = NULL;
m_SelLayerTool = NULL;
m_displayMode = 0;
if( DrawPanel )
DrawPanel->m_Block_Enable = true;
......@@ -279,6 +286,7 @@ void WinEDA_GerberFrame::LoadSettings()
return;
WinEDA_BasePcbFrame::LoadSettings();
config->Read( GerbviewDrawModeOption, &m_displayMode, 0l );
long pageSize_opt;
config->Read( GerbviewShowPageSizeOption, &pageSize_opt, 0l );
int imax = 0;
......@@ -325,6 +333,8 @@ void WinEDA_GerberFrame::SaveSettings()
}
}
}
config->Write( GerbviewDrawModeOption, m_displayMode );
config->Write( GerbviewShowPageSizeOption, pageSize_opt );
config->Write( GerbviewShowDCodes, IsElementVisible( DCODES_VISIBLE ) );
}
......@@ -528,7 +538,8 @@ void WinEDA_GerberFrame::UpdateTitleAndInfo()
text = wxGetApp().GetAppName() + wxT( " " ) + GetBuildVersion();
SetTitle( text );
SetStatusText( wxEmptyString, 0 );
m_TextInfo->Clear();
text.Printf( _("Layer %d not used"), GetScreen()->m_Active_Layer+1 );
m_TextInfo->SetValue( text );
ClearMsgPanel();
return;
}
......@@ -556,3 +567,30 @@ void WinEDA_GerberFrame::UpdateTitleAndInfo()
}
/* Function OnSelectDisplayMode: called to select display mode
* (fast display, or exact mode with stacked images or with transparency
*/
void WinEDA_GerberFrame::OnSelectDisplayMode( wxCommandEvent& event )
{
int oldMode = GetDisplayMode();
switch( event.GetId() )
{
case ID_TB_OPTIONS_SHOW_GBR_MODE_0:
SetDisplayMode( 0 );
break;
case ID_TB_OPTIONS_SHOW_GBR_MODE_1:
SetDisplayMode( 1 );
break;
case ID_TB_OPTIONS_SHOW_GBR_MODE_2:
SetDisplayMode( 2 );
break;
}
SetToolbars();
if( GetDisplayMode() != oldMode )
DrawPanel->Refresh();
}
......@@ -39,8 +39,9 @@ const wxString GerbviewProjectFileExt( wxT( "cnf" ) );
const wxString GerbviewProjectFileWildcard( _( "GerbView project files (.cnf)|*.cnf" ) );
// Config keywords
const wxString GerbviewDrawModeOption( wxT( "DrawModeOption" ) );
const wxString GerbviewShowPageSizeOption( wxT( "ShowPageSizeOpt" ) );
extern const wxString GerbviewShowDCodes( wxT( "ShowDCodesOpt" ) );
const wxString GerbviewShowDCodes( wxT( "ShowDCodesOpt" ) );
GERBER_IMAGE* g_GERBER_List[32];
......@@ -68,7 +69,7 @@ void WinEDA_App::MacOpenFile(const wxString &fileName)
if( !filename.FileExists() )
return;
frame->LoadOneGerberFile( fileName );
frame->LoadGerberFiles( fileName );
}
......@@ -140,7 +141,7 @@ bool WinEDA_App::OnInit()
if( fn.FileExists() )
{
( (PCB_SCREEN*) frame->GetScreen() )->m_Active_Layer = ii - 1;
frame->LoadOneGerberFile( fn.GetFullPath() );
frame->LoadGerberFiles( fn.GetFullPath() );
}
}
}
......
......@@ -62,6 +62,7 @@ extern const wxString GerbviewProjectFileWildcard;
extern Ki_PageDescr* g_GerberPageSizeList[];
// Config keywords
extern const wxString GerbviewDrawModeOption;
extern const wxString GerbviewShowPageSizeOption;
extern const wxString GerbviewShowDCodes;
......
......@@ -25,6 +25,9 @@ enum gerbview_ids
ID_TB_OPTIONS_SHOW_DCODES,
ID_TB_OPTIONS_SHOW_FLASHED_ITEMS_SKETCH,
ID_TB_OPTIONS_SHOW_LINES_SKETCH,
ID_TB_OPTIONS_SHOW_GBR_MODE_0,
ID_TB_OPTIONS_SHOW_GBR_MODE_1,
ID_TB_OPTIONS_SHOW_GBR_MODE_2,
ID_GERBER_END_LIST
};
......
......@@ -55,8 +55,6 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
filesMenu->AppendSeparator();
filesMenu->Append( wxID_PRINT, _( "P&rint" ), _( "Print gerber" ) );
filesMenu->Append( ID_GEN_PLOT, _( "Plot" ),
_( "Plotting in various formats" ) );
filesMenu->AppendSeparator();
filesMenu->Append( ID_EXIT, _( "E&xit" ), _( "Quit Gerbview" ) );
......
......@@ -61,14 +61,10 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos,
if( BlockActive )
return true;
PopMenu->Append( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
_( "Delete Dcode items" ) );
if( DrawStruct == NULL )
return true;
GetScreen()->SetCurItem( DrawStruct );
PopMenu->AppendSeparator();
return true;
}
......@@ -503,6 +503,7 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
case LAYER_POLARITY:
if( *text == 'C' )
GetLayerParams().m_LayerNegative = true;
else
GetLayerParams().m_LayerNegative = false;
D( printf( "%22s: LAYER_POLARITY m_LayerNegative=%s\n", __func__,
......
......@@ -200,6 +200,24 @@ void WinEDA_GerberFrame::ReCreateOptToolbar( void )
wxBitmap( show_dcodenumber_xpm ),
_( "Show dcode number" ), wxITEM_CHECK );
// tools to select draw mode in gerbview
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_0, wxEmptyString,
wxBitmap( gbr_select_mode0_xpm ),
_( "Show layers in raw mode\
(could have problems with negative items when more than one gerber file is shown)" ),
wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, wxEmptyString,
wxBitmap( gbr_select_mode1_xpm ),
_( "Show layers in stacked mode\
(show negative items without artefact, sometimes slow)" ),
wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, wxEmptyString,
wxBitmap( gbr_select_mode2_xpm ),
_( "Show layers in tranparency mode\
(show negative items without artefact, sometimes slow)" ),
wxITEM_CHECK );
// Tools to show/hide toolbars:
m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
......@@ -258,8 +276,7 @@ void WinEDA_GerberFrame::SetToolbars()
{
m_OptionsToolBar->ToggleTool(
ID_TB_OPTIONS_SELECT_UNIT_MM,
g_UserUnit ==
MILLIMETRES ? true : false );
g_UserUnit == MILLIMETRES ? true : false );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_INCH,
g_UserUnit == INCHES ? true : false );
......@@ -284,6 +301,10 @@ void WinEDA_GerberFrame::SetToolbars()
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_DCODES,
IsElementVisible( DCODES_VISIBLE ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GBR_MODE_0, GetDisplayMode() == 0 );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GBR_MODE_1, GetDisplayMode() == 1 );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GBR_MODE_2, GetDisplayMode() == 2 );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
m_show_layer_manager_tools );
if( m_show_layer_manager_tools )
......
......@@ -46,10 +46,19 @@ protected:
public:
WinEDALayerChoiceBox* m_SelLayerBox;
WinEDAChoiceBox* m_SelLayerTool;
wxTextCtrl* m_TextInfo; // a wxTextCtrl used to display some info about
// gerber data (format..)
wxTextCtrl* m_TextInfo; // a wxTextCtrl used to display some info about
// gerber data (format..)
private:
int m_displayMode; // Gerber images ("layers" in Gerbview) can be drawn:
// - in fast mode (write mode) but if there are negative items
// only the last image is correctly drawn
// (no problem to see only one image or when no negative items)
// - in "exact" mode (but slower) in write mode:
// last image covers previous images
// - in "exact" mode (also slower) in OR mode
// (transparency mode)
// m_displayMode = 0, 1 or 2
bool m_show_layer_manager_tools;
wxArrayString m_Messages; // An array sting to store warning messages when reaging a gerber file
......@@ -83,6 +92,22 @@ public:
m_Messages.Clear( );
}
/**
* Function GetDisplayMode
* @return 0 for fast mode (not fully compatible with negative objects)
* 1 for exact mode, write mode
* 2 for exact mode, OR mode (transparency mode)
*/
int GetDisplayMode() { return m_displayMode;}
/**
* Function SetDisplayMode
* @param aMode = 0 for fast mode
* 1 for exact mode, write mode
* 2 for exact mode, OR mode (transparency mode)
*/
void SetDisplayMode( int aMode ) { m_displayMode = aMode;}
/**
* Function IsGridVisible() , virtual
* @return true if the grid must be shown
......@@ -234,6 +259,13 @@ public:
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
int BestZoom();
void OnSelectOptionToolbar( wxCommandEvent& event );
/**
* Function OnSelectDisplayMode
* called on a display mode selection
* Mode selection can be fast display,
* or exact mode with stacked images or with transparency
*/
void OnSelectDisplayMode( wxCommandEvent& event );
void OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct );
GERBER_DRAW_ITEM* GerberGeneralLocateAndDisplay();
......@@ -284,7 +316,6 @@ public:
*/
void Block_Duplicate( wxDC* DC );
void InstallDrillFrame( wxCommandEvent& event );
void ToPostProcess( wxCommandEvent& event );
/**
......@@ -318,20 +349,17 @@ public:
void OnFileHistory( wxCommandEvent& event );
/**
* Load a photoplot (Gerber) file.
*
* @param aFileName - File name with full path to open or empty string to open a new
* file.
* @param aOpenFileDialog - Set to true to display the open file dialog even if
* aFileName is valid.
*
* @return - True if file was opened successfully.
* function LoadGerberFiles
* Load a photoplot (Gerber) file or many files.
* @param aFileName - void string or file name with full path to open or empty string to open a new
* file. In this case one one file is loaded
* if void string: user will be prompted for filename(s)
* @return true if file was opened successfully.
*/
bool LoadOneGerberFile( const wxString& aFileName, bool aOpenFileDialog = false );
bool LoadGerberFiles( const wxString& aFileName );
int ReadGerberFile( FILE* File, bool Append );
bool Read_GERBER_File( const wxString& GERBER_FullFileName,
const wxString& D_Code_FullFileName );
bool SaveGerberFile( const wxString& FileName );
void GeneralControle( wxDC* DC, wxPoint Mouse );
......@@ -409,13 +437,22 @@ public:
int aPrintMasklayer, bool aPrintMirrorMode,
void * aData = NULL);
/** InstallDialogLayerPairChoice
/**
* Function InstallDialogLayerPairChoice
* Install a dialog frame to choose the equivalence
* between gerber layers and pcbnew layers
* @return the "lookup table" if ok, or NULL
*/
int* InstallDialogLayerPairChoice( );
/**
* Function DrawItemsDCodeID
* Draw the DCode value (if exists) corresponding to gerber item
* (polygons do not have a DCode)
* @param aDC = the current device contect
* @param aDrawMode = GR_COPY, GR_OR ...
*/
void DrawItemsDCodeID( wxDC* aDC, int aDrawMode );
DECLARE_EVENT_TABLE()
};
......
......@@ -129,6 +129,9 @@ extern const char* find_xpm[];
extern const char* flag_xpm[];
extern const char* fonts_xpm[];
extern const char* footprint_text_xpm[];
extern const char* gbr_select_mode0_xpm[];
extern const char* gbr_select_mode1_xpm[];
extern const char* gbr_select_mode2_xpm[];
extern const char* general_deletions_xpm[];
extern const char* general_ratsnet_xpm[];
extern const char* glabel2label_xpm[];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment