KiCad PCB EDA Suite
panel_pcbnew_color_settings.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2020 Jon Evans <[email protected]>
5 * Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <regex>
22
23#include <pgm_base.h>
24#include <board.h>
25#include <layer_ids.h>
27#include <pcbnew_settings.h>
31#include <pcb_painter.h>
33#include <wx/treebook.h>
34
35
36std::string g_previewBoard =
37 "(kicad_pcb (version 20200724) (host pcbnew \"(5.99.0-2577-gd32bcd569-dirty)\")\n"
38 "\n"
39 " (net 0 \"\")\n"
40 " (net 1 \"GND\")\n"
41 "\n"
42 " (footprint \"Wire_Pads:SolderWirePad_single_1-2mmDrill\" (layer \"F.Cu\") (tedit 5F2C4AD9) (tstamp 196cc548-e42d-4d1f-b07f-f00a85d6308b)\n"
43 " (at 22.7 34.09)\n"
44 " (fp_text reference \"\" (at 0 -3.81) (layer \"F.SilkS\") hide\n"
45 " (effects (font (size 1 1) (thickness 0.15)))\n"
46 " (tstamp 6d50c232-866c-4b86-8aff-b6f4f27af92c)\n"
47 " )\n"
48 " (fp_text value \"SolderWirePad_single_1-2mmDrill\" (at 11.4 2.81) (layer \"F.Fab\")\n"
49 " (effects (font (size 1 1) (thickness 0.15)))\n"
50 " (tstamp b7a15261-2581-4434-810f-55e348906d24)\n"
51 " )\n"
52 " (pad \"1\" thru_hole circle (at 0 0) (size 3.50012 3.50012) (drill 1.19888) (layers *.Cu *.Mask)\n"
53 " (net 1 \"GND\") (tstamp 907d213c-9e76-496e-8ff8-f5d804b4ebf3))\n"
54 " )\n"
55 "\n"
56 " (footprint \"Capacitors_THT:CP_Radial_D5.0mm_P2.00mm\" (layer \"F.Cu\") (tedit 5C22DE58) (tstamp 380485fd-bd1d-4d52-80be-e1a4da6db230)\n"
57 " (at 21.675 27.9525)\n"
58 " (descr \"CP, Radial series, Radial, pin pitch=2.00mm, , diameter=5mm, Electrolytic Capacitor\")\n"
59 " (tags \"CP Radial series Radial pin pitch 2.00mm diameter 5mm Electrolytic Capacitor\")\n"
60 " (fp_text reference \"C48\" (at 0.9525 -3.33375) (layer \"F.SilkS\")\n"
61 " (effects (font (size 1 1.2) (thickness 0.22)))\n"
62 " (tstamp dfc53a4c-91a2-4c4c-b399-a47b59d95339)\n"
63 " )\n"
64 " (fp_text value \"47uF\" (at 4.775 -0.00125 90) (layer \"F.Fab\")\n"
65 " (effects (font (size 1 1) (thickness 0.15)))\n"
66 " (tstamp 2d0cb149-f436-43e7-b1eb-c65c4629a1f1)\n"
67 " )\n"
68 " (fp_line (start -1.6 -0.65) (end -1.6 0.65) (layer \"F.SilkS\") (width 0.12) (tstamp 65bc7811-5705-4b18-beae-ab88ae6b9449))\n"
69 " (fp_line (start -2.2 0) (end -1 0) (layer \"F.SilkS\") (width 0.12) (tstamp 68db5686-fc0b-47b8-9e2e-19d88b41181f))\n"
70 " (fp_arc (start 1 0) (end -1.30558 -1.18) (angle 125.8) (layer \"F.SilkS\") (width 0.12) (tstamp 3b98e4c6-9ef9-48e5-a1aa-c32e87964514))\n"
71 " (fp_arc (start 1 0) (end 3.30558 -1.18) (angle 54.2) (layer \"F.SilkS\") (width 0.5) (tstamp 42adcf5e-59b0-492b-a4c4-95141c0a39f5))\n"
72 " (fp_arc (start 1 0) (end -1.30558 1.18) (angle -125.8) (layer \"F.SilkS\") (width 0.12) (tstamp e1a2da0b-cc0a-4697-99c2-b5a0a71a0bb2))\n"
73 " (fp_line (start -1.85 -2.85) (end -1.85 2.85) (layer \"F.CrtYd\") (width 0.05) (tstamp 74efa428-d26e-4ad0-9f18-0faeac9dc1d4))\n"
74 " (fp_line (start 3.85 -2.85) (end -1.85 -2.85) (layer \"F.CrtYd\") (width 0.05) (tstamp 7622f7f7-21e8-4de5-ad60-3b06ccba2287))\n"
75 " (fp_line (start -1.85 2.85) (end 3.85 2.85) (layer \"F.CrtYd\") (width 0.05) (tstamp 989e58cc-09a4-48ad-b9cc-9a273bfa6446))\n"
76 " (fp_line (start 3.85 2.85) (end 3.85 -2.85) (layer \"F.CrtYd\") (width 0.05) (tstamp d49a971f-1061-4efe-acba-573b8dc99906))\n"
77 " (fp_line (start -1.6 -0.65) (end -1.6 0.65) (layer \"F.Fab\") (width 0.1) (tstamp 8b6277e9-17a1-4f65-80cc-586ab7b3f75b))\n"
78 " (fp_line (start -2.2 0) (end -1 0) (layer \"F.Fab\") (width 0.1) (tstamp b4f62f30-a5f3-4d20-a9ad-086b777a9ac1))\n"
79 " (fp_circle (center 1 0) (end 3.5 0) (layer \"F.Fab\") (width 0.1) (tstamp 2bce3e04-d9c6-4eff-84a1-edabbb01864d))\n"
80 " (pad \"1\" thru_hole rect (at 0 0) (size 1.4 1.4) (drill 0.8) (layers *.Cu *.Mask)\n"
81 " (net 1 \"GND\") (tstamp 7920b7f9-55c4-4584-bf5c-436e8ef95e74))\n"
82 " (pad \"2\" thru_hole circle (at 2 0) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)\n"
83 " (net 1 \"GND\") (tstamp e4c29d51-7825-48f6-aae3-5e0ea3eb6e7a))\n"
84 " (model \"${KICAD6_3DMODEL_DIR}/Capacitors_THT.3dshapes/CP_Radial_D5.0mm_P2.00mm.wrl\"\n"
85 " (offset (xyz 0 0 0))\n"
86 " (scale (xyz 1 1 1))\n"
87 " (rotate (xyz 0 0 0))\n"
88 " )\n"
89 " )\n"
90 "\n"
91 " (footprint \"Wire_Pads:SolderWirePad_single_1mmDrill\" locked (layer \"F.Cu\") (tedit 0) (tstamp 473e3291-e4a8-4615-824b-1aa98b60e481)\n"
92 " (at 44.8525 24.46)\n"
93 " (fp_text reference \"Hidden RefDes\" (at -0.2835 7.47025 180) (layer \"F.SilkS\") hide\n"
94 " (effects (font (size 1 1) (thickness 0.15)))\n"
95 " (tstamp 02d2fb75-3428-4538-b599-cd811796b4d9)\n"
96 " )\n"
97 " (fp_text value \"Hidden Value\" (at -0.2135 9.05025) (layer \"F.Fab\") hide\n"
98 " (effects (font (size 1 1) (thickness 0.15)))\n"
99 " (tstamp 2b366321-55c2-4e5a-8a51-2cf0a1c7c64e)\n"
100 " )\n"
101 " (fp_text user \"LED\" (at 0.15875 3.33375 90) (layer \"F.SilkS\")\n"
102 " (effects (font (size 1 1.1) (thickness 0.25)))\n"
103 " (tstamp f36fd79c-0dff-4a81-b4b4-9e222e82814f)\n"
104 " )\n"
105 " (pad \"1\" thru_hole circle (at 0 0) (size 2.49936 2.49936) (drill 1.00076) (layers *.Cu *.Mask) (tstamp ec712720-3eda-4621-ad13-dc832c80aef6))\n"
106 " )\n"
107 "\n"
108 " (footprint \"Wire_Pads:SolderWirePad_single_1mmDrill\" (layer \"F.Cu\") (tedit 0) (tstamp 621d7aa9-bc19-436a-9ebe-ef9cdda47103)\n"
109 " (at 44.8525 20.9675)\n"
110 " (fp_text reference \"\" (at 2.2225 0 90) (layer \"F.SilkS\") hide\n"
111 " (effects (font (size 1.3 1.5) (thickness 0.25)))\n"
112 " (tstamp dc982b23-a764-4ef4-924b-4c90cf7e51bc)\n"
113 " )\n"
114 " (fp_text value \"Front Panel PWR\" (at 2.4575 1.72375 90) (layer \"F.Fab\")\n"
115 " (effects (font (size 1 1) (thickness 0.15)))\n"
116 " (tstamp a89dd8b8-81fc-41a9-a224-79f778e145ca)\n"
117 " )\n"
118 " (fp_text user \"12V\" (at 0.15875 -3.33375 90) (layer \"F.SilkS\")\n"
119 " (effects (font (size 1 1.1) (thickness 0.25)))\n"
120 " (tstamp 2ca6df83-f367-4aad-b4c2-1c3d5fe3b65e)\n"
121 " )\n"
122 " (pad \"1\" thru_hole circle (at 0 0) (size 2.49936 2.49936) (drill 1.00076) (layers *.Cu *.Mask)\n"
123 " (net 1 \"GND\") (tstamp 5c04f147-7717-4bbf-88a9-07e172a78a08))\n"
124 " )\n"
125 "\n"
126 " (footprint \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp 90b0a5fc-e8b0-4fa0-a8bd-198c1d756a29)\n"
127 " (at 28.9775 20.9675)\n"
128 " (descr \"Resistor, Axial_DIN0207 series, Axial, Horizontal, pin pitch=10.16mm, 0.25W = 1/4W, length*diameter=6.3*2.5mm^2, http://cdn-reichelt.de/documents/datenblatt/B400/1_4W%23YAG.pdf\")\n"
129 " (tags \"Resistor Axial_DIN0207 series Axial Horizontal pin pitch 10.16mm 0.25W = 1/4W length 6.3mm diameter 2.5mm\")\n"
130 " (fp_text reference \"R74\" (at 5.08 0) (layer \"F.SilkS\")\n"
131 " (effects (font (size 1.4 1.6) (thickness 0.3)))\n"
132 " (tstamp 9a6b9e83-9fea-4ae3-a69d-0de871c2078e)\n"
133 " )\n"
134 " (fp_text value \"10K\" (at 12.2925 3.50375 90) (layer \"F.Fab\")\n"
135 " (effects (font (size 1 1) (thickness 0.15)))\n"
136 " (tstamp d73aa2bc-2e81-4c7a-8f14-4de04daa74aa)\n"
137 " )\n"
138 " (fp_line (start 9.18 0) (end 8.29 0) (layer \"F.SilkS\") (width 0.12) (tstamp 26d8d0f7-c717-4cd1-aa43-446631d365b0))\n"
139 " (fp_line (start 1.87 -1.31) (end 1.87 1.31) (layer \"F.SilkS\") (width 0.12) (tstamp 4acaa78a-ffdc-4fff-b0bd-79bb54e1ac47))\n"
140 " (fp_line (start 0.98 0) (end 1.87 0) (layer \"F.SilkS\") (width 0.12) (tstamp 693536e9-30cc-41d2-aeb6-69447ddc61e2))\n"
141 " (fp_line (start 8.29 -1.31) (end 1.87 -1.31) (layer \"F.SilkS\") (width 0.12) (tstamp 7f495b78-7217-4013-908a-2ff1dd367a10))\n"
142 " (fp_line (start 1.87 1.31) (end 8.29 1.31) (layer \"F.SilkS\") (width 0.12) (tstamp ac3c2b1d-1f56-4ac7-9c5b-e93b60924ad7))\n"
143 " (fp_line (start 8.29 1.31) (end 8.29 -1.31) (layer \"F.SilkS\") (width 0.12) (tstamp fab7de09-20cf-4131-b969-27b695177867))\n"
144 " (fp_line (start -1.05 1.6) (end 11.25 1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp 3cb8ef09-2a19-4905-b082-c9534db84f47))\n"
145 " (fp_line (start -1.05 -1.6) (end -1.05 1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp 9dd0c083-9647-4d26-aebe-fabacbe66605))\n"
146 " (fp_line (start 11.25 1.6) (end 11.25 -1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp e01b3280-f982-4a3e-9f01-c1aaff70d915))\n"
147 " (fp_line (start 11.25 -1.6) (end -1.05 -1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp f602c95b-8818-4ea9-9f7a-b87bfa28f508))\n"
148 " (fp_line (start 8.23 1.25) (end 8.23 -1.25) (layer \"F.Fab\") (width 0.1) (tstamp 079bdccf-881c-4a76-bb47-fda88c1e8539))\n"
149 " (fp_line (start 8.23 -1.25) (end 1.93 -1.25) (layer \"F.Fab\") (width 0.1) (tstamp 31a6e71b-e018-445e-80bf-4390f0da9d94))\n"
150 " (fp_line (start 1.93 -1.25) (end 1.93 1.25) (layer \"F.Fab\") (width 0.1) (tstamp 394e6f3e-8168-4351-b602-150b25a3e918))\n"
151 " (fp_line (start 0 0) (end 1.93 0) (layer \"F.Fab\") (width 0.1) (tstamp 4d964dda-4fec-485c-8618-dd88da973f8f))\n"
152 " (fp_line (start 10.16 0) (end 8.23 0) (layer \"F.Fab\") (width 0.1) (tstamp 9985c0f0-7ff6-46bf-a22e-2fa42e34b9b1))\n"
153 " (fp_line (start 1.93 1.25) (end 8.23 1.25) (layer \"F.Fab\") (width 0.1) (tstamp cfc9a5ff-3c40-4d48-b7b6-8825e86fc710))\n"
154 " (pad \"1\" thru_hole circle (at 0 0) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask)\n"
155 " (net 1 \"GND\") (tstamp def83b42-5ec2-442a-8f2b-ffd7b14105ce))\n"
156 " (pad \"2\" thru_hole circle (at 10.16 0) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask) (tstamp 6386fdb7-f3d1-4839-9830-ab733b3e8d94))\n"
157 " (model \"${KICAD6_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
158 " (offset (xyz 0 0 0))\n"
159 " (scale (xyz 0.393701 0.393701 0.393701))\n"
160 " (rotate (xyz 0 0 0))\n"
161 " )\n"
162 " )\n"
163 "\n"
164 " (footprint \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp c3f66ae9-669e-4889-915f-2cccae13db42)\n"
165 " (at 28.9775 27.9525)\n"
166 " (descr \"Resistor, Axial_DIN0207 series, Axial, Horizontal, pin pitch=10.16mm, 0.25W = 1/4W, length*diameter=6.3*2.5mm^2, http://cdn-reichelt.de/documents/datenblatt/B400/1_4W%23YAG.pdf\")\n"
167 " (tags \"Resistor Axial_DIN0207 series Axial Horizontal pin pitch 10.16mm 0.25W = 1/4W length 6.3mm diameter 2.5mm\")\n"
168 " (fp_text reference \"R75\" (at 5.08 0) (layer \"F.SilkS\")\n"
169 " (effects (font (size 1.4 1.6) (thickness 0.3)))\n"
170 " (tstamp ef6e671a-a5ac-4bc4-8077-708c1a429470)\n"
171 " )\n"
172 " (fp_text value \"4K7\" (at 12.2925 0.06875 90) (layer \"F.Fab\")\n"
173 " (effects (font (size 1 1) (thickness 0.15)))\n"
174 " (tstamp 2c71cca7-0f57-4ce3-b3f4-64c98749588d)\n"
175 " )\n"
176 " (fp_line (start 8.29 -1.31) (end 1.87 -1.31) (layer \"F.SilkS\") (width 0.12) (tstamp 1033538b-29a3-4da7-8f54-f17c12867391))\n"
177 " (fp_line (start 1.87 -1.31) (end 1.87 1.31) (layer \"F.SilkS\") (width 0.12) (tstamp 2376397b-6e25-4057-90ca-3ebd6d1da982))\n"
178 " (fp_line (start 9.18 0) (end 8.29 0) (layer \"F.SilkS\") (width 0.12) (tstamp 5796fca2-ca98-4d4b-bec4-d31bde85a650))\n"
179 " (fp_line (start 0.98 0) (end 1.87 0) (layer \"F.SilkS\") (width 0.12) (tstamp 65f4508e-8af5-46fe-980c-f387540cb953))\n"
180 " (fp_line (start 8.29 1.31) (end 8.29 -1.31) (layer \"F.SilkS\") (width 0.12) (tstamp 79b31583-fa09-40ce-a54d-53e2344537e2))\n"
181 " (fp_line (start 1.87 1.31) (end 8.29 1.31) (layer \"F.SilkS\") (width 0.12) (tstamp 997a5329-dd3e-4903-b5bf-b579c496c0c2))\n"
182 " (fp_line (start -1.05 1.6) (end 11.25 1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp 504e4184-74f3-4bb3-9268-148507ff437b))\n"
183 " (fp_line (start 11.25 -1.6) (end -1.05 -1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp c014700f-6b3e-4db2-9179-a63ca83ee80a))\n"
184 " (fp_line (start 11.25 1.6) (end 11.25 -1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp cf155cca-0e54-4902-9419-cd47ab3b7a6e))\n"
185 " (fp_line (start -1.05 -1.6) (end -1.05 1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp da31697f-6c09-4894-9726-82e5965b76a9))\n"
186 " (fp_line (start 8.23 -1.25) (end 1.93 -1.25) (layer \"F.Fab\") (width 0.1) (tstamp 3f4a794f-b45b-42fe-8e89-c86eb999b1ac))\n"
187 " (fp_line (start 1.93 -1.25) (end 1.93 1.25) (layer \"F.Fab\") (width 0.1) (tstamp 495ba46e-e0f2-40df-bc2e-8273aef7c524))\n"
188 " (fp_line (start 0 0) (end 1.93 0) (layer \"F.Fab\") (width 0.1) (tstamp 7ff54d88-df7e-42a5-9c8b-88764220ede8))\n"
189 " (fp_line (start 8.23 1.25) (end 8.23 -1.25) (layer \"F.Fab\") (width 0.1) (tstamp 9d755f30-54b4-43f1-acea-b1a3ac435bd1))\n"
190 " (fp_line (start 10.16 0) (end 8.23 0) (layer \"F.Fab\") (width 0.1) (tstamp b999b5b2-327e-491b-9266-35b8482540c8))\n"
191 " (fp_line (start 1.93 1.25) (end 8.23 1.25) (layer \"F.Fab\") (width 0.1) (tstamp dfab8391-a4f8-43c8-8cf8-6b7e6a977081))\n"
192 " (pad \"1\" thru_hole circle (at 0 0) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask)\n"
193 " (net 1 \"GND\") (tstamp 5a702112-f16c-4b59-9902-914db0fa4360))\n"
194 " (pad \"2\" thru_hole circle (at 10.16 0) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask) (tstamp b2b0d740-b086-433e-90f5-ffe119efdd07))\n"
195 " (model \"${KICAD6_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
196 " (offset (xyz 0 0 0))\n"
197 " (scale (xyz 0.393701 0.393701 0.393701))\n"
198 " (rotate (xyz 0 0 0))\n"
199 " )\n"
200 " )\n"
201 "\n"
202 " (footprint \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp e072334e-f411-41c9-ade0-5444e440897b)\n"
203 " (at 39.1375 24.46 180)\n"
204 " (descr \"Resistor, Axial_DIN0207 series, Axial, Horizontal, pin pitch=10.16mm, 0.25W = 1/4W, length*diameter=6.3*2.5mm^2, http://cdn-reichelt.de/documents/datenblatt/B400/1_4W%23YAG.pdf\")\n"
205 " (tags \"Resistor Axial_DIN0207 series Axial Horizontal pin pitch 10.16mm 0.25W = 1/4W length 6.3mm diameter 2.5mm\")\n"
206 " (fp_text reference \"R73\" (at 5.08 0 180) (layer \"F.SilkS\")\n"
207 " (effects (font (size 1.3 1.5) (thickness 0.25)))\n"
208 " (tstamp 014cf222-f3a5-4b8e-8488-4309307a6bdc)\n"
209 " )\n"
210 " (fp_text value \"10K\" (at -2.0825 3.53875 270) (layer \"F.Fab\")\n"
211 " (effects (font (size 1 1) (thickness 0.15)))\n"
212 " (tstamp 2deddb35-a3f9-4993-a1ed-8c3208648d4e)\n"
213 " )\n"
214 " (fp_line (start 1.87 -1.31) (end 1.87 1.31) (layer \"F.SilkS\") (width 0.12) (tstamp 0de0f2c4-5641-4214-9afa-5e4cbfe4ee44))\n"
215 " (fp_line (start 1.87 1.31) (end 8.29 1.31) (layer \"F.SilkS\") (width 0.12) (tstamp 485d8c5a-a3d7-4c96-a3f3-f4b630b27e17))\n"
216 " (fp_line (start 8.29 1.31) (end 8.29 -1.31) (layer \"F.SilkS\") (width 0.12) (tstamp 5085ec5b-cfed-4f7c-bc9b-f7148c4b7222))\n"
217 " (fp_line (start 9.18 0) (end 8.29 0) (layer \"F.SilkS\") (width 0.12) (tstamp 7007fd01-2893-48e3-8840-341e7cb4ec8d))\n"
218 " (fp_line (start 8.29 -1.31) (end 1.87 -1.31) (layer \"F.SilkS\") (width 0.12) (tstamp 7a872980-3288-4161-8107-5d277e19ca53))\n"
219 " (fp_line (start 0.98 0) (end 1.87 0) (layer \"F.SilkS\") (width 0.12) (tstamp a7b6dccc-6e78-4d89-adc7-7c6cfb560515))\n"
220 " (fp_line (start 11.25 -1.6) (end -1.05 -1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp 2db3a7de-4ff9-4f7c-8023-a96c3233363e))\n"
221 " (fp_line (start 11.25 1.6) (end 11.25 -1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp 87f28b49-9648-446b-85a9-34010f350294))\n"
222 " (fp_line (start -1.05 1.6) (end 11.25 1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp 8b0e0021-dee0-4fba-85b0-dc1550b5b15c))\n"
223 " (fp_line (start -1.05 -1.6) (end -1.05 1.6) (layer \"F.CrtYd\") (width 0.05) (tstamp 9324d473-26e5-4c7d-95c0-367ba971acd7))\n"
224 " (fp_line (start 0 0) (end 1.93 0) (layer \"F.Fab\") (width 0.1) (tstamp 001328a4-472c-4707-a7bf-46a7a15f91f6))\n"
225 " (fp_line (start 1.93 1.25) (end 8.23 1.25) (layer \"F.Fab\") (width 0.1) (tstamp 1af02505-0a10-49cf-8a95-d3c06be3152d))\n"
226 " (fp_line (start 8.23 1.25) (end 8.23 -1.25) (layer \"F.Fab\") (width 0.1) (tstamp 65eee186-e6fe-44b5-a7e4-202672bff890))\n"
227 " (fp_line (start 1.93 -1.25) (end 1.93 1.25) (layer \"F.Fab\") (width 0.1) (tstamp 73b1c134-2d49-42d8-b1ba-e81b8df404ba))\n"
228 " (fp_line (start 10.16 0) (end 8.23 0) (layer \"F.Fab\") (width 0.1) (tstamp 7529bced-6b8a-483c-9aee-d7c487d3a292))\n"
229 " (fp_line (start 8.23 -1.25) (end 1.93 -1.25) (layer \"F.Fab\") (width 0.1) (tstamp c0322b20-ac45-4f20-bbab-44368f60ac5d))\n"
230 " (pad \"1\" thru_hole circle (at 0 0 180) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask) (tstamp 945fccb0-61fe-41e2-8f09-c8a33f294a3e))\n"
231 " (pad \"2\" thru_hole circle (at 10.16 0 180) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask) (tstamp d8e786d3-14bf-403c-80db-810abc9eda53))\n"
232 " (model \"${KICAD6_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
233 " (offset (xyz 0 0 0))\n"
234 " (scale (xyz 0.393701 0.393701 0.393701))\n"
235 " (rotate (xyz 0 0 0))\n"
236 " )\n"
237 " )\n"
238 "\n"
239 " (footprint \"Capacitors_THT:CP_Radial_D5.0mm_P2.00mm\" (layer \"F.Cu\") (tedit 5C22DE41) (tstamp fa4fd0e8-6269-4cb7-a049-03c4e343895c)\n"
240 " (at 21.675 20.9675)\n"
241 " (descr \"CP, Radial series, Radial, pin pitch=2.00mm, , diameter=5mm, Electrolytic Capacitor\")\n"
242 " (tags \"CP Radial series Radial pin pitch 2.00mm diameter 5mm Electrolytic Capacitor\")\n"
243 " (fp_text reference \"C47\" (at 0.9525 -3.33375) (layer \"F.SilkS\")\n"
244 " (effects (font (size 1 1.2) (thickness 0.22)))\n"
245 " (tstamp f13eb790-c841-466d-a0c1-07116ebc1073)\n"
246 " )\n"
247 " (fp_text value \"47uF\" (at 4.775 -0.01625 90) (layer \"F.Fab\")\n"
248 " (effects (font (size 1 1) (thickness 0.15)))\n"
249 " (tstamp 027137f5-363d-41b8-8495-34c7a18a7117)\n"
250 " )\n"
251 " (fp_line (start -1.6 -0.65) (end -1.6 0.65) (layer \"F.SilkS\") (width 0.12) (tstamp 87ac9cb8-d215-4372-8cd3-4abaacc0bf33))\n"
252 " (fp_line (start -2.2 0) (end -1 0) (layer \"F.SilkS\") (width 0.12) (tstamp d0ff0d50-cd0b-459a-8f2d-e84c2cb66ac5))\n"
253 " (fp_arc (start 1 0) (end 3.30558 -1.18) (angle 54.2) (layer \"F.SilkS\") (width 0.5) (tstamp 4404d1b4-9af5-4b29-a1e9-a89d90f6d256))\n"
254 " (fp_arc (start 1 0) (end -1.30558 -1.18) (angle 125.8) (layer \"F.SilkS\") (width 0.12) (tstamp 6fdf8300-e925-4956-a69a-91818d6e51c8))\n"
255 " (fp_arc (start 1 0) (end -1.30558 1.18) (angle -125.8) (layer \"F.SilkS\") (width 0.12) (tstamp ad60c624-9f4d-4a30-a5f4-59f698eff831))\n"
256 " (fp_line (start -1.85 -2.85) (end -1.85 2.85) (layer \"F.CrtYd\") (width 0.05) (tstamp 5ed611e7-0ad0-4da5-adb6-fcbf8512cd95))\n"
257 " (fp_line (start 3.85 -2.85) (end -1.85 -2.85) (layer \"F.CrtYd\") (width 0.05) (tstamp 6b007cca-ff72-43ca-ba72-b26458c5a115))\n"
258 " (fp_line (start -1.85 2.85) (end 3.85 2.85) (layer \"F.CrtYd\") (width 0.05) (tstamp 98571876-9364-410c-ac47-f290b1e46d98))\n"
259 " (fp_line (start 3.85 2.85) (end 3.85 -2.85) (layer \"F.CrtYd\") (width 0.05) (tstamp ba016114-5eb4-430b-ab2e-dbefa70d896a))\n"
260 " (fp_line (start -2.2 0) (end -1 0) (layer \"F.Fab\") (width 0.1) (tstamp 68c156d0-784a-4c9c-b97c-a32d6c3aa3b9))\n"
261 " (fp_line (start -1.6 -0.65) (end -1.6 0.65) (layer \"F.Fab\") (width 0.1) (tstamp 900d1364-baa6-4fae-a49a-97678ffcc675))\n"
262 " (fp_circle (center 1 0) (end 3.5 0) (layer \"F.Fab\") (width 0.1) (tstamp e572501a-055a-4591-8f6b-f3bf2e7ee86b))\n"
263 " (pad \"1\" thru_hole rect (at 0 0) (size 1.4 1.4) (drill 0.8) (layers *.Cu *.Mask)\n"
264 " (net 1 \"GND\") (tstamp 7ef87fdc-802f-4acb-9867-18732d4a7e7a))\n"
265 " (pad \"2\" thru_hole circle (at 2 0) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)\n"
266 " (net 1 \"GND\") (tstamp 1ad1f5f9-68f6-4131-9e09-bd1d361fc282))\n"
267 " (model \"${KICAD6_3DMODEL_DIR}/Capacitors_THT.3dshapes/CP_Radial_D5.0mm_P2.00mm.wrl\"\n"
268 " (offset (xyz 0 0 0))\n"
269 " (scale (xyz 1 1 1))\n"
270 " (rotate (xyz 0 0 0))\n"
271 " )\n"
272 " )\n"
273 "\n"
274 " (gr_rect (start 15.65 13.74) (end 52.5 38.8) (layer \"Edge.Cuts\") (width 0.05) (tstamp a879b274-bf89-4c34-8db0-6e2a7291f014))\n"
275 " (dimension 3.6 (width 0.0508) (layer \"Margin\") (tstamp 6db437a2-8229-43a5-8bd8-1a58ddb201b9)\n"
276 " (gr_text \"0.1417 in\" (at 55.72 22.7 270) (layer \"Margin\") (tstamp 6db437a2-8229-43a5-8bd8-1a58ddb201b9)\n"
277 " (effects (font (size 0.762 0.762) (thickness 0.127)))\n"
278 " )\n"
279 " (feature1 (pts (xy 44.88 24.5) (xy 55.056421 24.5)))\n"
280 " (feature2 (pts (xy 44.88 20.9) (xy 55.056421 20.9)))\n"
281 " (crossbar (pts (xy 54.47 20.9) (xy 54.47 24.5)))\n"
282 " (arrow1a (pts (xy 54.47 24.5) (xy 53.883579 23.373496)))\n"
283 " (arrow1b (pts (xy 54.47 24.5) (xy 55.056421 23.373496)))\n"
284 " (arrow2a (pts (xy 54.47 20.9) (xy 53.883579 22.026504)))\n"
285 " (arrow2b (pts (xy 54.47 20.9) (xy 55.056421 22.026504)))\n"
286 " )\n"
287 "\n"
288 " (segment (start 44.8525 24.46) (end 39.1375 24.46) (width 0.381) (layer \"F.Cu\") (net 0) (tstamp 7ca12133-777b-47ba-bbd3-cb8a544b2671) (status 30))\n"
289 " (segment (start 33.105 32.74025) (end 33.105 27.9525) (width 0.381) (layer \"F.Cu\") (net 1) (tstamp 069bdf66-094e-4225-a62a-5e9ac38209e5))\n"
290 " (segment (start 33.105 27.9525) (end 28.9775 27.9525) (width 0.381) (layer \"F.Cu\") (net 1) (tstamp 6fd4daae-acd4-44ce-bc05-d098c9a39286))\n"
291 " (segment (start 34.0575 32.74025) (end 34.0575 20.9675) (width 0.381) (layer \"F.Cu\") (net 1) (tstamp 730eecf7-4831-459b-b926-557f809e0c1c))\n"
292 " (segment (start 35.01 19.22125) (end 35.01 32.74025) (width 0.381) (layer \"F.Cu\") (net 1) (tstamp c69ca14f-e0e6-485f-a878-4f0a683c3915))\n"
293 " (segment (start 34.0575 20.9675) (end 28.9775 20.9675) (width 0.381) (layer \"F.Cu\") (net 1) (tstamp e5e766f6-987a-4192-9c34-760f17795c27))\n"
294 " (via (at 35.01 19.22125) (size 0.75) (drill 0.35) (layers \"F.Cu\" \"B.Cu\") (net 1) (tstamp a3ff2347-4667-4dde-8969-ef5af9da726e))\n"
295 " (segment (start 35.01 19.22125) (end 44.8525 19.22125) (width 0.762) (layer \"B.Cu\") (net 1) (tstamp 236da8c8-0850-4652-aecc-efa2304d6271))\n"
296 " (segment (start 44.8525 19.22125) (end 44.8525 20.9675) (width 0.762) (layer \"B.Cu\") (net 1) (tstamp 351a1a87-af11-41b0-80e3-ad556442a4d5))\n"
297 " (segment (start 21.68 27.9475) (end 21.675 27.9525) (width 0.762) (layer \"B.Cu\") (net 1) (tstamp 353c08b1-5615-4291-a96c-91924dfe8626))\n"
298 " (segment (start 35.01 19.22125) (end 21.68 19.22125) (width 0.762) (layer \"B.Cu\") (net 1) (tstamp 41941280-cdfb-4779-bd2b-633d67a413a7))\n"
299 " (segment (start 21.68 19.22125) (end 21.68 27.9475) (width 0.762) (layer \"B.Cu\") (net 1) (tstamp 5b37df1f-f5c1-4c27-b720-6f0e5bc0eb66))\n"
300 " (segment (start 28.9775 20.9675) (end 23.675 20.9675) (width 0.381) (layer \"B.Cu\") (net 1) (tstamp e365420e-bf4e-4c36-a39f-b4aac3c33817))\n"
301 " (segment (start 28.9775 27.9525) (end 23.675 27.9525) (width 0.381) (layer \"B.Cu\") (net 1) (tstamp fa7580a1-979a-4da5-a6ea-fde491f0a6aa))\n"
302 "\n"
303 " (zone (net 1) (net_name \"GND\") (layer \"F.Cu\") (tstamp b32d7e64-2aaa-46f7-a99f-f3198188b35a) (hatch edge 0.508)\n"
304 " (connect_pads (clearance 0.508))\n"
305 " (min_thickness 0.254)\n"
306 " (fill yes (thermal_gap 0.508) (thermal_bridge_width 0.508))\n"
307 " (polygon\n"
308 " (pts\n"
309 " (xy 37.06 36.6)(xy 19.8 36.7)(xy 19.8 31.4)(xy 37.06 31.4)\n"
310 " )\n"
311 " )\n"
312 " (filled_polygon\n"
313 " (layer F.Cu)\n"
314 " (pts\n"
315 " (xy 36.934 36.474728)(xy 19.926 36.573268)(xy 19.926 35.808311)(xy 21.162708 35.808311)\n"
316 " (xy 21.165543 35.916543)(xy 21.219269 35.964917)(xy 21.225838 35.970086)(xy 21.480245 36.144282)\n"
317 " (xy 21.48744 36.148537)(xy 21.762651 36.287557)(xy 21.770346 36.290824)(xy 22.061526 36.392223)\n"
318 " (xy 22.069586 36.394443)(xy 22.371619 36.456441)(xy 22.379901 36.457575)(xy 22.68748 36.479084)\n"
319 " (xy 22.69584 36.479113)(xy 23.003562 36.459753)(xy 23.011852 36.458676)(xy 23.314311 36.398787)\n"
320 " (xy 23.322386 36.396624)(xy 23.614266 36.29726)(xy 23.621984 36.294047)(xy 23.898159 36.156953)\n"
321 " (xy 23.905384 36.152748)(xy 24.161002 35.980331)(xy 24.167608 35.975207)(xy 24.233615 35.916601)\n"
322 " (xy 24.236842 35.807861)(xy 22.752191 34.32321)(xy 22.647809 34.32321)(xy 21.162708 35.808311)\n"
323 " (xy 19.926 35.808311)(xy 19.926 34.035807)(xy 20.311498 34.035807)(xy 20.32441 34.343867)\n"
324 " (xy 20.325312 34.352178)(xy 20.378853 34.655824)(xy 20.380847 34.663942)(xy 20.474077 34.95784)\n"
325 " (xy 20.477127 34.965623)(xy 20.608409 35.244609)(xy 20.612461 35.251921)(xy 20.779486 35.511092)\n"
326 " (xy 20.78447 35.517803)(xy 20.872749 35.621533)(xy 20.983019 35.625962)(xy 22.46679 34.142191)\n"
327 " (xy 22.46679 34.037809)(xy 22.93321 34.037809)(xy 22.93321 34.142191)(xy 24.417196 35.626177)\n"
328 " (xy 24.526956 35.622152)(xy 24.605514 35.531142)(xy 24.610545 35.524466)(xy 24.779376 35.266467)\n"
329 " (xy 24.78348 35.259183)(xy 24.916705 34.98112)(xy 24.919809 34.973358)(xy 25.015089 34.680119)\n"
330 " (xy 25.017139 34.672015)(xy 25.072939 34.367992)(xy 25.073956 34.358143)(xy 25.08422 33.938144)\n"
331 " (xy 25.083685 33.928258)(xy 25.042804 33.621872)(xy 25.041152 33.613677)(xy 24.960311 33.316133)\n"
332 " (xy 24.95759 33.308228)(xy 24.838107 33.023991)(xy 24.834364 33.016516)(xy 24.678339 32.750577)\n"
333 " (xy 24.67364 32.743663)(xy 24.530633 32.560622)(xy 24.417327 32.553692)(xy 22.93321 34.037809)\n"
334 " (xy 22.46679 34.037809)(xy 20.979485 32.550504)(xy 20.863171 32.560067)(xy 20.671713 32.82749)\n"
335 " (xy 20.667308 32.834595)(xy 20.522555 33.106835)(xy 20.519128 33.11446)(xy 20.411653 33.403453)\n"
336 " (xy 20.409265 33.411464)(xy 20.340955 33.712132)(xy 20.339647 33.720389)(xy 20.311703 34.02745)\n"
337 " (xy 20.311498 34.035807)(xy 19.926 34.035807)(xy 19.926 32.373199)(xy 21.164218 32.373199)\n"
338 " (xy 22.647809 33.85679)(xy 22.752191 33.85679)(xy 24.237543 32.371437)(xy 24.229314 32.256623)\n"
339 " (xy 24.00471 32.088598)(xy 23.997699 32.084045)(xy 23.728551 31.933623)(xy 23.720999 31.930037)\n"
340 " (xy 23.43432 31.816533)(xy 23.426361 31.813978)(xy 23.12719 31.739386)(xy 23.118962 31.737905)\n"
341 " (xy 22.812553 31.703536)(xy 22.804202 31.703157)(xy 22.495939 31.709614)(xy 22.487612 31.710343)\n"
342 " (xy 22.18291 31.757513)(xy 22.174752 31.759336)(xy 21.878966 31.846391)(xy 21.871121 31.849277)\n"
343 " (xy 21.589447 31.974686)(xy 21.582052 31.978585)(xy 21.319439 32.140147)(xy 21.312624 32.144989)\n"
344 " (xy 21.169881 32.261408)(xy 21.164218 32.373199)(xy 19.926 32.373199)(xy 19.926 31.526)\n"
345 " (xy 36.934 31.526)\n"
346 " )\n"
347 " )\n"
348 " )"
349 ")";
350
351std::set<int> g_excludedLayers =
352 {
363 GAL_LAYER_ID_START + 6, // where LAYER_MOD_TEXT_BK (deprecated) used to be
364 GAL_LAYER_ID_START + 14, // where LAYER_NO_CONNECTS (deprecated) used to be
370 };
371
372
374 : PANEL_COLOR_SETTINGS( aParent ),
375 m_preview( nullptr ),
376 m_page( nullptr ),
377 m_titleBlock( nullptr ),
378 m_board( aBoard )
379{
380 m_colorNamespace = "board";
381
382 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
383 PCBNEW_SETTINGS* app_settings = mgr.GetAppSettings<PCBNEW_SETTINGS>();
384 COLOR_SETTINGS* current = mgr.GetColorSettings( app_settings->m_ColorTheme );
385
386 // Saved theme doesn't exist? Reset to default
387 if( current->GetFilename() != app_settings->m_ColorTheme )
388 app_settings->m_ColorTheme = current->GetFilename();
389
390 createThemeList( app_settings->m_ColorTheme );
391
392 // Currently this only applies to eeschema
393 m_optOverrideColors->Hide();
394
395 m_currentSettings = new COLOR_SETTINGS( *current );
396
397 for( int id = GAL_LAYER_ID_START; id < GAL_LAYER_ID_BITMASK_END; id++ )
398 {
399 if( g_excludedLayers.count( id ) )
400 continue;
401
402 m_validLayers.push_back( id );
403 }
404
407 m_validLayers.push_back( LAYER_PAGE_LIMITS );
408
409 // NOTE: Main board layers are added by createSwatches()
410
412}
413
414
416{
417 delete m_page;
418 delete m_titleBlock;
419 delete m_currentSettings;
420}
421
422
424{
425 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
426 PCBNEW_SETTINGS* app_settings = mgr.GetAppSettings<PCBNEW_SETTINGS>();
427 app_settings->m_ColorTheme = m_currentSettings->GetFilename();
428
429 return true;
430}
431
432
434{
436 return true;
437}
438
439
441{
442 std::sort( m_validLayers.begin(), m_validLayers.end(),
443 []( int a, int b )
444 {
445 return LayerName( a ) < LayerName( b );
446 } );
447
448 // Don't sort aBoard layers by name
449 for( int i = PCBNEW_LAYER_ID_START; i <= User_9; ++i )
450 m_validLayers.insert( m_validLayers.begin() + i, i );
451
452 for( int layer : m_validLayers )
453 {
454 wxString name = LayerName( layer );
455
456 if( m_board && layer >= PCBNEW_LAYER_ID_START && layer < PCB_LAYER_ID_COUNT )
457 name = m_board->GetLayerName( static_cast<PCB_LAYER_ID>( layer ) );
458
459 createSwatch( layer, name );
460 }
461
462 m_preview = FOOTPRINT_PREVIEW_PANEL::New( nullptr, this );
463 m_preview->GetGAL()->SetAxesEnabled( false );
464
465 m_previewPanelSizer->Add( m_preview, 1, wxALL | wxEXPAND, 5 );
466
468 Layout();
471}
472
473
475{
477}
478
479
481{
484 m_titleBlock->SetTitle( _( "Color Preview" ) );
485 m_titleBlock->SetDate( wxDateTime::Now().FormatDate() );
486
487 m_page->SetHeightMils( 5000 );
488 m_page->SetWidthMils( 6000 );
489
490 STRING_LINE_READER reader( g_previewBoard, wxT( "preview" ) );
491 PCB_PLUGIN pi;
492
493 try
494 {
495 pi.DoLoad( reader, m_preview->GetBoard(), nullptr, nullptr, 0 );
496 }
497 catch( const IO_ERROR& )
498 {
499 return;
500 }
501
504
506 nullptr, m_titleBlock, nullptr );
507 drawingSheet->SetIsFirstPage( true );
508 drawingSheet->SetColorLayer( LAYER_DRAWINGSHEET );
510 m_preview->SetDrawingSheet( drawingSheet );
511
513}
514
515
517{
519}
520
521
523{
526}
527
528
530{
531 if( !m_preview )
532 return;
533
534 KIGFX::VIEW* view = m_preview->GetView();
535 auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
536 settings->LoadColors( m_currentSettings );
537
538 m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() );
539
541 auto rect = m_preview->GetScreenRect();
542 m_preview->Refresh( true, &rect );
543}
544
545
547{
548 if( m_preview )
549 {
550 KIGFX::VIEW* view = m_preview->GetView();
552 BOX2I defaultBox = m_preview->GetDefaultViewBBox();
553
554 view->SetScale( 1.0 );
555 VECTOR2D screenSize = view->ToWorld( m_preview->GetClientSize(), false );
556
557 if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
558 bBox = defaultBox;
559
560 VECTOR2D vsize = bBox.GetSize();
561 double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
562 fabs( vsize.y / screenSize.y ) );
563
564 view->SetScale( scale / 1.1 );
565 view->SetCenter( bBox.Centre() );
567 }
568}
569
570
571void PANEL_PCBNEW_COLOR_SETTINGS::OnSize( wxSizeEvent& aEvent )
572{
574 aEvent.Skip();
575}
576
577
const char * name
Definition: DXF_plotter.cpp:56
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:196
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: board.h:809
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:413
coord_type GetHeight() const
Definition: box2.h:188
coord_type GetWidth() const
Definition: box2.h:187
Vec Centre() const
Definition: box2.h:70
const Vec & GetSize() const
Definition: box2.h:179
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetPageBorderColorLayer(int aLayerId)
Overrides the layer used to pick the color of the page border (normally LAYER_GRID)
void SetIsFirstPage(bool aIsFirstPage)
Change if this is first page.
void SetColorLayer(int aLayerId)
Can be used to override which layer ID is used for drawing sheet item colors.
void ForceRefresh()
Force a redraw.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
static FOOTPRINT_PREVIEW_PANEL * New(KIWAY *aKiway, wxWindow *aParent)
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:76
wxString GetFilename() const
Definition: json_settings.h:73
void SetAxesEnabled(bool aAxesEnabled)
Enable drawing the axes.
void SetClearColor(const COLOR4D &aColor)
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
Definition: pcb_painter.h:72
void LoadColors(const COLOR_SETTINGS *aSettings) override
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:69
double GetScale() const
Definition: view.h:269
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
Definition: view.cpp:548
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:445
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1479
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:213
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Definition: view.cpp:574
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
void SetWidthMils(int aWidthInMils)
Definition: page_info.cpp:244
static const wxChar Custom[]
"User" defined page type
Definition: page_info.h:77
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:258
void createThemeList(const wxString &aCurrent)
Builds the theme listbox and sets the selection to the current theme.
void createSwatch(int aLayer, const wxString &aName)
std::vector< int > m_validLayers
A list of layer IDs that are valid for the current color settings dialog.
std::string m_colorNamespace
A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings.
virtual void ResetPanel() override
Reset the contents of this panel.
COLOR_SETTINGS * m_currentSettings
void OnSize(wxSizeEvent &aEvent) override
void onColorChanged() override
Event fired when the user changes any color.
void onNewThemeSelected() override
Event fired when a new theme is selected that can be overridden in children.
FOOTPRINT_PREVIEW_PANEL * m_preview
PANEL_PCBNEW_COLOR_SETTINGS(wxWindow *aParent, BOARD *aBoard)
void ResetPanel() override
Reset the contents of this panel.
void UpdateColors()
Update the color settings in the painter and GAL.
BOX2I GetDefaultViewBBox() const override
Return the bounding box of the view that should be used if model is not valid.
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
A PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
Definition: pcb_plugin.h:261
BOARD * DoLoad(LINE_READER &aReader, BOARD *aAppendToMe, const STRING_UTF8_MAP *aProperties, PROGRESS_REPORTER *aProgressReporter, unsigned aLineCount)
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
Definition: richio.h:241
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:41
void SetTitle(const wxString &aTitle)
Definition: title_block.h:58
void SetDate(const wxString &aDate)
Set the date field, and defaults to the current time and date.
Definition: title_block.h:71
#define _(s)
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition: layer_id.cpp:30
@ GAL_LAYER_ID_START
Definition: layer_ids.h:191
@ LAYER_PAGE_LIMITS
color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)
Definition: layer_ids.h:249
@ LAYER_LOCKED_ITEM_SHADOW
shadow layer for locked items
Definition: layer_ids.h:239
@ LAYER_VIA_HOLEWALLS
Definition: layer_ids.h:234
@ LAYER_CONFLICTS_SHADOW
shadow layer for items flagged conficting
Definition: layer_ids.h:241
@ LAYER_PAD_FR
smd pads, front layer
Definition: layer_ids.h:202
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
Definition: layer_ids.h:217
@ LAYER_DRAW_BITMAPS
to handle and draw images bitmaps
Definition: layer_ids.h:223
@ LAYER_MOD_TEXT
Definition: layer_ids.h:198
@ LAYER_PCB_BACKGROUND
PCB background color.
Definition: layer_ids.h:220
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
Definition: layer_ids.h:214
@ LAYER_GP_OVERLAY
general purpose overlay
Definition: layer_ids.h:218
@ GAL_LAYER_ID_BITMASK_END
This is the end of the layers used for visibility bit masks in legacy board files.
Definition: layer_ids.h:226
@ LAYER_TRACKS
Definition: layer_ids.h:212
@ LAYER_MOD_FR
show footprints on front
Definition: layer_ids.h:208
@ LAYER_PAD_BK
smd pads, back layer
Definition: layer_ids.h:203
@ LAYER_MOD_VALUES
show footprints values (when texts are visible)
Definition: layer_ids.h:210
@ LAYER_MARKER_SHADOWS
shadows for drc markers
Definition: layer_ids.h:237
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
Definition: layer_ids.h:193
@ LAYER_MOD_BK
show footprints on back
Definition: layer_ids.h:209
@ LAYER_MOD_REFERENCES
show footprints references (when texts are visible)
Definition: layer_ids.h:211
@ LAYER_PAD_HOLEWALLS
Definition: layer_ids.h:233
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ PCBNEW_LAYER_ID_START
Definition: layer_ids.h:63
@ User_9
Definition: layer_ids.h:131
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:137
@ COLOR
Color has changed.
Definition: view_item.h:48
std::string g_previewBoard
std::set< int > g_excludedLayers
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111
const int scale
const double IU_PER_MILS
Definition: base_units.h:78