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 <jon@craftyjon.com>
5  * Copyright (C) 2020-2021 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 <board.h>
25 #include <layer_ids.h>
27 #include <pcbnew_settings.h>
28 #include <pcb_edit_frame.h>
33 #include <pcb_painter.h>
35 #include <wx/treebook.h>
36 
37 
38 std::string g_previewBoard =
39  "(kicad_pcb (version 20200724) (host pcbnew \"(5.99.0-2577-gd32bcd569-dirty)\")\n"
40  "\n"
41  " (net 0 \"\")\n"
42  " (net 1 \"GND\")\n"
43  "\n"
44  " (module \"Wire_Pads:SolderWirePad_single_1-2mmDrill\" (layer \"F.Cu\") (tedit 5F2C4AD9) (tstamp 196cc548-e42d-4d1f-b07f-f00a85d6308b)\n"
45  " (at 22.7 34.09)\n"
46  " (fp_text reference \"\" (at 0 -3.81) (layer \"F.SilkS\") hide\n"
47  " (effects (font (size 1 1) (thickness 0.15)))\n"
48  " (tstamp 6d50c232-866c-4b86-8aff-b6f4f27af92c)\n"
49  " )\n"
50  " (fp_text value \"SolderWirePad_single_1-2mmDrill\" (at 11.4 2.81) (layer \"F.Fab\")\n"
51  " (effects (font (size 1 1) (thickness 0.15)))\n"
52  " (tstamp b7a15261-2581-4434-810f-55e348906d24)\n"
53  " )\n"
54  " (pad \"1\" thru_hole circle (at 0 0) (size 3.50012 3.50012) (drill 1.19888) (layers *.Cu *.Mask)\n"
55  " (net 1 \"GND\") (tstamp 907d213c-9e76-496e-8ff8-f5d804b4ebf3))\n"
56  " )\n"
57  "\n"
58  " (module \"Capacitors_THT:CP_Radial_D5.0mm_P2.00mm\" (layer \"F.Cu\") (tedit 5C22DE58) (tstamp 380485fd-bd1d-4d52-80be-e1a4da6db230)\n"
59  " (at 21.675 27.9525)\n"
60  " (descr \"CP, Radial series, Radial, pin pitch=2.00mm, , diameter=5mm, Electrolytic Capacitor\")\n"
61  " (tags \"CP Radial series Radial pin pitch 2.00mm diameter 5mm Electrolytic Capacitor\")\n"
62  " (fp_text reference \"C48\" (at 0.9525 -3.33375) (layer \"F.SilkS\")\n"
63  " (effects (font (size 1 1.2) (thickness 0.22)))\n"
64  " (tstamp dfc53a4c-91a2-4c4c-b399-a47b59d95339)\n"
65  " )\n"
66  " (fp_text value \"47uF\" (at 4.775 -0.00125 90) (layer \"F.Fab\")\n"
67  " (effects (font (size 1 1) (thickness 0.15)))\n"
68  " (tstamp 2d0cb149-f436-43e7-b1eb-c65c4629a1f1)\n"
69  " )\n"
70  " (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"
71  " (fp_line (start -2.2 0) (end -1 0) (layer \"F.SilkS\") (width 0.12) (tstamp 68db5686-fc0b-47b8-9e2e-19d88b41181f))\n"
72  " (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"
73  " (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"
74  " (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"
75  " (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"
76  " (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"
77  " (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"
78  " (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"
79  " (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"
80  " (fp_line (start -2.2 0) (end -1 0) (layer \"F.Fab\") (width 0.1) (tstamp b4f62f30-a5f3-4d20-a9ad-086b777a9ac1))\n"
81  " (fp_circle (center 1 0) (end 3.5 0) (layer \"F.Fab\") (width 0.1) (tstamp 2bce3e04-d9c6-4eff-84a1-edabbb01864d))\n"
82  " (pad \"1\" thru_hole rect (at 0 0) (size 1.4 1.4) (drill 0.8) (layers *.Cu *.Mask)\n"
83  " (net 1 \"GND\") (tstamp 7920b7f9-55c4-4584-bf5c-436e8ef95e74))\n"
84  " (pad \"2\" thru_hole circle (at 2 0) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)\n"
85  " (net 1 \"GND\") (tstamp e4c29d51-7825-48f6-aae3-5e0ea3eb6e7a))\n"
86  " (model \"${KICAD6_3DMODEL_DIR}/Capacitors_THT.3dshapes/CP_Radial_D5.0mm_P2.00mm.wrl\"\n"
87  " (offset (xyz 0 0 0))\n"
88  " (scale (xyz 1 1 1))\n"
89  " (rotate (xyz 0 0 0))\n"
90  " )\n"
91  " )\n"
92  "\n"
93  " (module \"Wire_Pads:SolderWirePad_single_1mmDrill\" (layer \"F.Cu\") (tedit 0) (tstamp 473e3291-e4a8-4615-824b-1aa98b60e481)\n"
94  " (at 44.8525 24.46)\n"
95  " (fp_text reference \"Hidden RefDes\" (at -0.2835 7.47025 180) (layer \"F.SilkS\") hide\n"
96  " (effects (font (size 1 1) (thickness 0.15)))\n"
97  " (tstamp 02d2fb75-3428-4538-b599-cd811796b4d9)\n"
98  " )\n"
99  " (fp_text value \"Hidden Value\" (at -0.2135 9.05025) (layer \"F.Fab\") hide\n"
100  " (effects (font (size 1 1) (thickness 0.15)))\n"
101  " (tstamp 2b366321-55c2-4e5a-8a51-2cf0a1c7c64e)\n"
102  " )\n"
103  " (fp_text user \"LED\" (at 0.15875 3.33375 90) (layer \"F.SilkS\")\n"
104  " (effects (font (size 1 1.1) (thickness 0.25)))\n"
105  " (tstamp f36fd79c-0dff-4a81-b4b4-9e222e82814f)\n"
106  " )\n"
107  " (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"
108  " )\n"
109  "\n"
110  " (module \"Wire_Pads:SolderWirePad_single_1mmDrill\" (layer \"F.Cu\") (tedit 0) (tstamp 621d7aa9-bc19-436a-9ebe-ef9cdda47103)\n"
111  " (at 44.8525 20.9675)\n"
112  " (fp_text reference \"\" (at 2.2225 0 90) (layer \"F.SilkS\") hide\n"
113  " (effects (font (size 1.3 1.5) (thickness 0.25)))\n"
114  " (tstamp dc982b23-a764-4ef4-924b-4c90cf7e51bc)\n"
115  " )\n"
116  " (fp_text value \"Front Panel PWR\" (at 2.4575 1.72375 90) (layer \"F.Fab\")\n"
117  " (effects (font (size 1 1) (thickness 0.15)))\n"
118  " (tstamp a89dd8b8-81fc-41a9-a224-79f778e145ca)\n"
119  " )\n"
120  " (fp_text user \"12V\" (at 0.15875 -3.33375 90) (layer \"F.SilkS\")\n"
121  " (effects (font (size 1 1.1) (thickness 0.25)))\n"
122  " (tstamp 2ca6df83-f367-4aad-b4c2-1c3d5fe3b65e)\n"
123  " )\n"
124  " (pad \"1\" thru_hole circle (at 0 0) (size 2.49936 2.49936) (drill 1.00076) (layers *.Cu *.Mask)\n"
125  " (net 1 \"GND\") (tstamp 5c04f147-7717-4bbf-88a9-07e172a78a08))\n"
126  " )\n"
127  "\n"
128  " (module \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp 90b0a5fc-e8b0-4fa0-a8bd-198c1d756a29)\n"
129  " (at 28.9775 20.9675)\n"
130  " (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"
131  " (tags \"Resistor Axial_DIN0207 series Axial Horizontal pin pitch 10.16mm 0.25W = 1/4W length 6.3mm diameter 2.5mm\")\n"
132  " (fp_text reference \"R74\" (at 5.08 0) (layer \"F.SilkS\")\n"
133  " (effects (font (size 1.4 1.6) (thickness 0.3)))\n"
134  " (tstamp 9a6b9e83-9fea-4ae3-a69d-0de871c2078e)\n"
135  " )\n"
136  " (fp_text value \"10K\" (at 12.2925 3.50375 90) (layer \"F.Fab\")\n"
137  " (effects (font (size 1 1) (thickness 0.15)))\n"
138  " (tstamp d73aa2bc-2e81-4c7a-8f14-4de04daa74aa)\n"
139  " )\n"
140  " (fp_line (start 9.18 0) (end 8.29 0) (layer \"F.SilkS\") (width 0.12) (tstamp 26d8d0f7-c717-4cd1-aa43-446631d365b0))\n"
141  " (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"
142  " (fp_line (start 0.98 0) (end 1.87 0) (layer \"F.SilkS\") (width 0.12) (tstamp 693536e9-30cc-41d2-aeb6-69447ddc61e2))\n"
143  " (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"
144  " (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"
145  " (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"
146  " (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"
147  " (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"
148  " (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"
149  " (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"
150  " (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"
151  " (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"
152  " (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"
153  " (fp_line (start 0 0) (end 1.93 0) (layer \"F.Fab\") (width 0.1) (tstamp 4d964dda-4fec-485c-8618-dd88da973f8f))\n"
154  " (fp_line (start 10.16 0) (end 8.23 0) (layer \"F.Fab\") (width 0.1) (tstamp 9985c0f0-7ff6-46bf-a22e-2fa42e34b9b1))\n"
155  " (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"
156  " (pad \"1\" thru_hole circle (at 0 0) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask)\n"
157  " (net 1 \"GND\") (tstamp def83b42-5ec2-442a-8f2b-ffd7b14105ce))\n"
158  " (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"
159  " (model \"${KICAD6_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
160  " (offset (xyz 0 0 0))\n"
161  " (scale (xyz 0.393701 0.393701 0.393701))\n"
162  " (rotate (xyz 0 0 0))\n"
163  " )\n"
164  " )\n"
165  "\n"
166  " (module \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp c3f66ae9-669e-4889-915f-2cccae13db42)\n"
167  " (at 28.9775 27.9525)\n"
168  " (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"
169  " (tags \"Resistor Axial_DIN0207 series Axial Horizontal pin pitch 10.16mm 0.25W = 1/4W length 6.3mm diameter 2.5mm\")\n"
170  " (fp_text reference \"R75\" (at 5.08 0) (layer \"F.SilkS\")\n"
171  " (effects (font (size 1.4 1.6) (thickness 0.3)))\n"
172  " (tstamp ef6e671a-a5ac-4bc4-8077-708c1a429470)\n"
173  " )\n"
174  " (fp_text value \"4K7\" (at 12.2925 0.06875 90) (layer \"F.Fab\")\n"
175  " (effects (font (size 1 1) (thickness 0.15)))\n"
176  " (tstamp 2c71cca7-0f57-4ce3-b3f4-64c98749588d)\n"
177  " )\n"
178  " (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"
179  " (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"
180  " (fp_line (start 9.18 0) (end 8.29 0) (layer \"F.SilkS\") (width 0.12) (tstamp 5796fca2-ca98-4d4b-bec4-d31bde85a650))\n"
181  " (fp_line (start 0.98 0) (end 1.87 0) (layer \"F.SilkS\") (width 0.12) (tstamp 65f4508e-8af5-46fe-980c-f387540cb953))\n"
182  " (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"
183  " (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"
184  " (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"
185  " (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"
186  " (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"
187  " (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"
188  " (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"
189  " (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"
190  " (fp_line (start 0 0) (end 1.93 0) (layer \"F.Fab\") (width 0.1) (tstamp 7ff54d88-df7e-42a5-9c8b-88764220ede8))\n"
191  " (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"
192  " (fp_line (start 10.16 0) (end 8.23 0) (layer \"F.Fab\") (width 0.1) (tstamp b999b5b2-327e-491b-9266-35b8482540c8))\n"
193  " (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"
194  " (pad \"1\" thru_hole circle (at 0 0) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask)\n"
195  " (net 1 \"GND\") (tstamp 5a702112-f16c-4b59-9902-914db0fa4360))\n"
196  " (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"
197  " (model \"${KICAD6_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
198  " (offset (xyz 0 0 0))\n"
199  " (scale (xyz 0.393701 0.393701 0.393701))\n"
200  " (rotate (xyz 0 0 0))\n"
201  " )\n"
202  " )\n"
203  "\n"
204  " (module \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp e072334e-f411-41c9-ade0-5444e440897b)\n"
205  " (at 39.1375 24.46 180)\n"
206  " (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"
207  " (tags \"Resistor Axial_DIN0207 series Axial Horizontal pin pitch 10.16mm 0.25W = 1/4W length 6.3mm diameter 2.5mm\")\n"
208  " (fp_text reference \"R73\" (at 5.08 0 180) (layer \"F.SilkS\")\n"
209  " (effects (font (size 1.3 1.5) (thickness 0.25)))\n"
210  " (tstamp 014cf222-f3a5-4b8e-8488-4309307a6bdc)\n"
211  " )\n"
212  " (fp_text value \"10K\" (at -2.0825 3.53875 270) (layer \"F.Fab\")\n"
213  " (effects (font (size 1 1) (thickness 0.15)))\n"
214  " (tstamp 2deddb35-a3f9-4993-a1ed-8c3208648d4e)\n"
215  " )\n"
216  " (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"
217  " (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"
218  " (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"
219  " (fp_line (start 9.18 0) (end 8.29 0) (layer \"F.SilkS\") (width 0.12) (tstamp 7007fd01-2893-48e3-8840-341e7cb4ec8d))\n"
220  " (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"
221  " (fp_line (start 0.98 0) (end 1.87 0) (layer \"F.SilkS\") (width 0.12) (tstamp a7b6dccc-6e78-4d89-adc7-7c6cfb560515))\n"
222  " (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"
223  " (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"
224  " (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"
225  " (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"
226  " (fp_line (start 0 0) (end 1.93 0) (layer \"F.Fab\") (width 0.1) (tstamp 001328a4-472c-4707-a7bf-46a7a15f91f6))\n"
227  " (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"
228  " (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"
229  " (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"
230  " (fp_line (start 10.16 0) (end 8.23 0) (layer \"F.Fab\") (width 0.1) (tstamp 7529bced-6b8a-483c-9aee-d7c487d3a292))\n"
231  " (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"
232  " (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"
233  " (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"
234  " (model \"${KICAD6_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
235  " (offset (xyz 0 0 0))\n"
236  " (scale (xyz 0.393701 0.393701 0.393701))\n"
237  " (rotate (xyz 0 0 0))\n"
238  " )\n"
239  " )\n"
240  "\n"
241  " (module \"Capacitors_THT:CP_Radial_D5.0mm_P2.00mm\" (layer \"F.Cu\") (tedit 5C22DE41) (tstamp fa4fd0e8-6269-4cb7-a049-03c4e343895c)\n"
242  " (at 21.675 20.9675)\n"
243  " (descr \"CP, Radial series, Radial, pin pitch=2.00mm, , diameter=5mm, Electrolytic Capacitor\")\n"
244  " (tags \"CP Radial series Radial pin pitch 2.00mm diameter 5mm Electrolytic Capacitor\")\n"
245  " (fp_text reference \"C47\" (at 0.9525 -3.33375) (layer \"F.SilkS\")\n"
246  " (effects (font (size 1 1.2) (thickness 0.22)))\n"
247  " (tstamp f13eb790-c841-466d-a0c1-07116ebc1073)\n"
248  " )\n"
249  " (fp_text value \"47uF\" (at 4.775 -0.01625 90) (layer \"F.Fab\")\n"
250  " (effects (font (size 1 1) (thickness 0.15)))\n"
251  " (tstamp 027137f5-363d-41b8-8495-34c7a18a7117)\n"
252  " )\n"
253  " (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"
254  " (fp_line (start -2.2 0) (end -1 0) (layer \"F.SilkS\") (width 0.12) (tstamp d0ff0d50-cd0b-459a-8f2d-e84c2cb66ac5))\n"
255  " (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"
256  " (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"
257  " (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"
258  " (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"
259  " (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"
260  " (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"
261  " (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"
262  " (fp_line (start -2.2 0) (end -1 0) (layer \"F.Fab\") (width 0.1) (tstamp 68c156d0-784a-4c9c-b97c-a32d6c3aa3b9))\n"
263  " (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"
264  " (fp_circle (center 1 0) (end 3.5 0) (layer \"F.Fab\") (width 0.1) (tstamp e572501a-055a-4591-8f6b-f3bf2e7ee86b))\n"
265  " (pad \"1\" thru_hole rect (at 0 0) (size 1.4 1.4) (drill 0.8) (layers *.Cu *.Mask)\n"
266  " (net 1 \"GND\") (tstamp 7ef87fdc-802f-4acb-9867-18732d4a7e7a))\n"
267  " (pad \"2\" thru_hole circle (at 2 0) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)\n"
268  " (net 1 \"GND\") (tstamp 1ad1f5f9-68f6-4131-9e09-bd1d361fc282))\n"
269  " (model \"${KICAD6_3DMODEL_DIR}/Capacitors_THT.3dshapes/CP_Radial_D5.0mm_P2.00mm.wrl\"\n"
270  " (offset (xyz 0 0 0))\n"
271  " (scale (xyz 1 1 1))\n"
272  " (rotate (xyz 0 0 0))\n"
273  " )\n"
274  " )\n"
275  "\n"
276  " (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"
277  " (dimension 3.6 (width 0.0508) (layer \"Margin\") (tstamp 6db437a2-8229-43a5-8bd8-1a58ddb201b9)\n"
278  " (gr_text \"0.1417 in\" (at 55.72 22.7 270) (layer \"Margin\") (tstamp 6db437a2-8229-43a5-8bd8-1a58ddb201b9)\n"
279  " (effects (font (size 0.762 0.762) (thickness 0.127)))\n"
280  " )\n"
281  " (feature1 (pts (xy 44.88 24.5) (xy 55.056421 24.5)))\n"
282  " (feature2 (pts (xy 44.88 20.9) (xy 55.056421 20.9)))\n"
283  " (crossbar (pts (xy 54.47 20.9) (xy 54.47 24.5)))\n"
284  " (arrow1a (pts (xy 54.47 24.5) (xy 53.883579 23.373496)))\n"
285  " (arrow1b (pts (xy 54.47 24.5) (xy 55.056421 23.373496)))\n"
286  " (arrow2a (pts (xy 54.47 20.9) (xy 53.883579 22.026504)))\n"
287  " (arrow2b (pts (xy 54.47 20.9) (xy 55.056421 22.026504)))\n"
288  " )\n"
289  "\n"
290  " (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"
291  " (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"
292  " (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"
293  " (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"
294  " (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"
295  " (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"
296  " (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"
297  " (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"
298  " (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"
299  " (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"
300  " (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"
301  " (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"
302  " (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"
303  " (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"
304  "\n"
305  " (zone (net 1) (net_name \"GND\") (layer \"F.Cu\") (tstamp b32d7e64-2aaa-46f7-a99f-f3198188b35a) (hatch edge 0.508)\n"
306  " (connect_pads (clearance 0.508))\n"
307  " (min_thickness 0.254)\n"
308  " (fill yes (thermal_gap 0.508) (thermal_bridge_width 0.508))\n"
309  " (polygon\n"
310  " (pts\n"
311  " (xy 37.06 36.6)(xy 19.8 36.7)(xy 19.8 31.4)(xy 37.06 31.4)\n"
312  " )\n"
313  " )\n"
314  " (filled_polygon\n"
315  " (layer F.Cu)\n"
316  " (pts\n"
317  " (xy 36.934 36.474728)(xy 19.926 36.573268)(xy 19.926 35.808311)(xy 21.162708 35.808311)\n"
318  " (xy 21.165543 35.916543)(xy 21.219269 35.964917)(xy 21.225838 35.970086)(xy 21.480245 36.144282)\n"
319  " (xy 21.48744 36.148537)(xy 21.762651 36.287557)(xy 21.770346 36.290824)(xy 22.061526 36.392223)\n"
320  " (xy 22.069586 36.394443)(xy 22.371619 36.456441)(xy 22.379901 36.457575)(xy 22.68748 36.479084)\n"
321  " (xy 22.69584 36.479113)(xy 23.003562 36.459753)(xy 23.011852 36.458676)(xy 23.314311 36.398787)\n"
322  " (xy 23.322386 36.396624)(xy 23.614266 36.29726)(xy 23.621984 36.294047)(xy 23.898159 36.156953)\n"
323  " (xy 23.905384 36.152748)(xy 24.161002 35.980331)(xy 24.167608 35.975207)(xy 24.233615 35.916601)\n"
324  " (xy 24.236842 35.807861)(xy 22.752191 34.32321)(xy 22.647809 34.32321)(xy 21.162708 35.808311)\n"
325  " (xy 19.926 35.808311)(xy 19.926 34.035807)(xy 20.311498 34.035807)(xy 20.32441 34.343867)\n"
326  " (xy 20.325312 34.352178)(xy 20.378853 34.655824)(xy 20.380847 34.663942)(xy 20.474077 34.95784)\n"
327  " (xy 20.477127 34.965623)(xy 20.608409 35.244609)(xy 20.612461 35.251921)(xy 20.779486 35.511092)\n"
328  " (xy 20.78447 35.517803)(xy 20.872749 35.621533)(xy 20.983019 35.625962)(xy 22.46679 34.142191)\n"
329  " (xy 22.46679 34.037809)(xy 22.93321 34.037809)(xy 22.93321 34.142191)(xy 24.417196 35.626177)\n"
330  " (xy 24.526956 35.622152)(xy 24.605514 35.531142)(xy 24.610545 35.524466)(xy 24.779376 35.266467)\n"
331  " (xy 24.78348 35.259183)(xy 24.916705 34.98112)(xy 24.919809 34.973358)(xy 25.015089 34.680119)\n"
332  " (xy 25.017139 34.672015)(xy 25.072939 34.367992)(xy 25.073956 34.358143)(xy 25.08422 33.938144)\n"
333  " (xy 25.083685 33.928258)(xy 25.042804 33.621872)(xy 25.041152 33.613677)(xy 24.960311 33.316133)\n"
334  " (xy 24.95759 33.308228)(xy 24.838107 33.023991)(xy 24.834364 33.016516)(xy 24.678339 32.750577)\n"
335  " (xy 24.67364 32.743663)(xy 24.530633 32.560622)(xy 24.417327 32.553692)(xy 22.93321 34.037809)\n"
336  " (xy 22.46679 34.037809)(xy 20.979485 32.550504)(xy 20.863171 32.560067)(xy 20.671713 32.82749)\n"
337  " (xy 20.667308 32.834595)(xy 20.522555 33.106835)(xy 20.519128 33.11446)(xy 20.411653 33.403453)\n"
338  " (xy 20.409265 33.411464)(xy 20.340955 33.712132)(xy 20.339647 33.720389)(xy 20.311703 34.02745)\n"
339  " (xy 20.311498 34.035807)(xy 19.926 34.035807)(xy 19.926 32.373199)(xy 21.164218 32.373199)\n"
340  " (xy 22.647809 33.85679)(xy 22.752191 33.85679)(xy 24.237543 32.371437)(xy 24.229314 32.256623)\n"
341  " (xy 24.00471 32.088598)(xy 23.997699 32.084045)(xy 23.728551 31.933623)(xy 23.720999 31.930037)\n"
342  " (xy 23.43432 31.816533)(xy 23.426361 31.813978)(xy 23.12719 31.739386)(xy 23.118962 31.737905)\n"
343  " (xy 22.812553 31.703536)(xy 22.804202 31.703157)(xy 22.495939 31.709614)(xy 22.487612 31.710343)\n"
344  " (xy 22.18291 31.757513)(xy 22.174752 31.759336)(xy 21.878966 31.846391)(xy 21.871121 31.849277)\n"
345  " (xy 21.589447 31.974686)(xy 21.582052 31.978585)(xy 21.319439 32.140147)(xy 21.312624 32.144989)\n"
346  " (xy 21.169881 32.261408)(xy 21.164218 32.373199)(xy 19.926 32.373199)(xy 19.926 31.526)\n"
347  " (xy 36.934 31.526)\n"
348  " )\n"
349  " )\n"
350  " )"
351  ")";
352 
353 std::set<int> g_excludedLayers =
354  {
355  LAYER_VIAS,
357  LAYER_MOD_FR,
358  LAYER_MOD_BK,
359  LAYER_PAD_FR,
360  LAYER_PAD_BK,
363  LAYER_TRACKS,
371  };
372 
373 
375  wxWindow* aParent )
376  : PANEL_COLOR_SETTINGS( aParent ),
377  m_frame( aFrame ),
378  m_preview( nullptr ),
379  m_page( nullptr ),
380  m_titleBlock( nullptr )
381 {
382  m_colorNamespace = "board";
383 
385  PCBNEW_SETTINGS* app_settings = mgr->GetAppSettings<PCBNEW_SETTINGS>();
386  COLOR_SETTINGS* current = mgr->GetColorSettings( app_settings->m_ColorTheme );
387 
388  // Saved theme doesn't exist? Reset to default
389  if( current->GetFilename() != app_settings->m_ColorTheme )
390  app_settings->m_ColorTheme = current->GetFilename();
391 
392  createThemeList( app_settings->m_ColorTheme );
393 
394  // Currently this only applies to eeschema
395  m_optOverrideColors->Hide();
396 
397  m_currentSettings = new COLOR_SETTINGS( *current );
398 
399  for( int id = GAL_LAYER_ID_START; id < GAL_LAYER_ID_BITMASK_END; id++ )
400  {
401  if( g_excludedLayers.count( id ) )
402  continue;
403 
404  m_validLayers.push_back( id );
405  }
406 
407  // NOTE: Main board layers are added by createSwatches()
408 
410 
411  m_colorsMainSizer->Insert( 0, 10, 0, 0, wxEXPAND, 5 );
412 
413  createSwatches();
414 
416  m_preview->GetGAL()->SetAxesEnabled( false );
417 
418  m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
419  m_colorsMainSizer->Add( m_preview, 1, wxALL | wxEXPAND, 5 );
420  m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
421 
423  updatePreview();
424  zoomFitPreview();
425 }
426 
427 
429 {
430  delete m_page;
431  delete m_titleBlock;
432  delete m_currentSettings;
433 }
434 
435 
437 {
438  SETTINGS_MANAGER* settingsMgr = m_frame->GetSettingsManager();
439  PCBNEW_SETTINGS* app_settings = settingsMgr->GetAppSettings<PCBNEW_SETTINGS>();
440  app_settings->m_ColorTheme = m_currentSettings->GetFilename();
441 
442  return true;
443 }
444 
445 
447 {
448  zoomFitPreview();
449  return true;
450 }
451 
452 
454 {
455  std::sort( m_validLayers.begin(), m_validLayers.end(),
456  []( int a, int b )
457  {
458  return LayerName( a ) < LayerName( b );
459  } );
460 
461  // Don't sort board layers by name
462  for( int i = PCBNEW_LAYER_ID_START; i <= User_9; ++i )
463  m_validLayers.insert( m_validLayers.begin() + i, i );
464 
465  BOARD* board = m_frame->GetBoard();
466 
467  for( int layer : m_validLayers )
468  {
469  wxString name = LayerName( layer );
470 
471  if( board && layer >= PCBNEW_LAYER_ID_START && layer < PCB_LAYER_ID_COUNT )
472  name = board->GetLayerName( static_cast<PCB_LAYER_ID>( layer ) );
473 
474  createSwatch( layer, name );
475  }
476 
477  // Give a minimal width to m_colorsListWindow, in order to always having
478  // a full row shown
479  int min_width = m_colorsGridSizer->GetMinSize().x;
480  const int margin = 20; // A margin around the sizer
481  m_colorsListWindow->SetMinSize( wxSize( min_width + margin, -1 ) );
482 }
483 
484 
486 {
487  updatePreview();
488 }
489 
490 
492 {
495  m_titleBlock->SetTitle( _( "Color Preview" ) );
496  m_titleBlock->SetDate( wxDateTime::Now().FormatDate() );
497 
498  m_page->SetHeightMils( 5000 );
499  m_page->SetWidthMils( 6000 );
500 
501  STRING_LINE_READER reader( g_previewBoard, "preview" );
502  PCB_IO pi;
503 
504  try
505  {
506  pi.DoLoad( reader, m_preview->GetBoard(), nullptr, nullptr, 0 );
507  }
508  catch( const IO_ERROR& )
509  {
510  return;
511  }
512 
515 
516  DS_PROXY_VIEW_ITEM* drawingSheet = new DS_PROXY_VIEW_ITEM( (int) IU_PER_MILS, m_page, nullptr,
517  m_titleBlock );
518  drawingSheet->SetColorLayer( LAYER_DRAWINGSHEET );
519  m_preview->SetDrawingSheet( drawingSheet );
520 
521  zoomFitPreview();
522 }
523 
524 
526 {
527  updatePreview();
528 }
529 
530 
532 {
534  updatePreview();
535 }
536 
537 
539 {
540  if( !m_preview )
541  return;
542 
543  KIGFX::VIEW* view = m_preview->GetView();
544  auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
545  settings->LoadColors( m_currentSettings );
546 
547  m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() );
548 
549  view->UpdateAllItems( KIGFX::COLOR );
550  auto rect = m_preview->GetScreenRect();
551  m_preview->Refresh( true, &rect );
552 }
553 
554 
556 {
557  KIGFX::VIEW* view = m_preview->GetView();
558  BOX2I bBox = m_preview->GetBoard()->GetBoundingBox();
559  BOX2I defaultBox = m_preview->GetDefaultViewBBox();
560 
561  view->SetScale( 1.0 );
562  VECTOR2D screenSize = view->ToWorld( m_preview->GetClientSize(), false );
563 
564  if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
565  bBox = defaultBox;
566 
567  VECTOR2D vsize = bBox.GetSize();
568  double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
569  fabs( vsize.y / screenSize.y ) );
570 
571  view->SetScale( scale / 1.1 );
572  view->SetCenter( bBox.Centre() );
574 }
575 
576 
577 void PANEL_PCBNEW_COLOR_SETTINGS::OnSize( wxSizeEvent& aEvent )
578 {
579  zoomFitPreview();
580  aEvent.Skip();
581 }
582 
583 
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: board.h:728
smd pads, front layer
Definition: layer_ids.h:197
void SetClearColor(const COLOR4D &aColor)
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
void ForceRefresh()
Force a redraw.
A PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:361
void SetColorLayer(int aLayerId)
Can be used to override which layer ID is used for drawing sheet item colors.
SETTINGS_MANAGER * GetSettingsManager() const
virtual void ResetPanel() override
Reset the contents of this panel.
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:452
std::string g_previewBoard
show footprints values (when texts are visible)
Definition: layer_ids.h:205
wxString GetFilename() const
Definition: json_settings.h:72
smd pads, back layer
Definition: layer_ids.h:198
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1430
void ResetPanel() override
Reset the contents of this panel.
void SetDate(const wxString &aDate)
Set the date field, and defaults to the current time and date.
Definition: title_block.h:71
show footprints on back
Definition: layer_ids.h:204
static const wxChar Custom[]
"User" defined page type
Definition: page_info.h:77
Color has changed.
Definition: view_item.h:53
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:40
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:208
PANEL_PCBNEW_COLOR_SETTINGS(PCB_EDIT_FRAME *aFrame, wxWindow *aParent)
std::string m_colorNamespace
A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings.
This is the end of the layers used for visibility bit masks in Pcbnew.
Definition: layer_ids.h:221
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Definition: view.cpp:581
Meta control for all vias opacity/visibility.
Definition: layer_ids.h:188
void DisplayBoard(BOARD *aBoard)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
void OnSize(wxSizeEvent &aEvent) override
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
void createThemeList(const wxString &aCurrent)
Builds the theme listbox and sets the selection to the current theme.
shadows for drc markers
Definition: layer_ids.h:232
coord_type GetWidth() const
Definition: box2.h:180
COLOR_SETTINGS * m_currentSettings
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
show footprints on front
Definition: layer_ids.h:203
static FOOTPRINT_PREVIEW_PANEL * New(KIWAY *aKiway, wxWindow *aParent)
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
#define _(s)
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition: layer_id.cpp:27
to handle and draw images bitmaps
Definition: layer_ids.h:218
drawingsheet frame and titleblock
Definition: layer_ids.h:212
void SetTitle(const wxString &aTitle)
Definition: title_block.h:58
void SetAxesEnabled(bool aAxesEnabled)
Enable drawing the axes.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:257
std::vector< int > m_validLayers
A list of layer IDs that are valid for the current color settings dialog.
BOX2I GetDefaultViewBBox() const override
Return the bounding box of the view that should be used if model is not valid.
void UpdateColors()
Update the color settings in the painter and GAL.
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
Definition: view.cpp:555
void onColorChanged() override
Event fired when the user changes any color.
show footprints references (when texts are visible)
Definition: layer_ids.h:206
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
const int scale
Vec Centre() const
Definition: box2.h:63
const char * name
Definition: DXF_plotter.cpp:56
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
general purpose overlay
Definition: layer_ids.h:213
std::set< int > g_excludedLayers
void SetWidthMils(int aWidthInMils)
Definition: page_info.cpp:243
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...
The main frame for Pcbnew.
#define IU_PER_MILS
Definition: plotter.cpp:136
coord_type GetHeight() const
Definition: box2.h:181
PCB background color.
Definition: layer_ids.h:215
Color settings are a bit different than most of the settings objects in that there can be more than o...
to draw pad holes (plated)
Definition: layer_ids.h:209
BOARD * DoLoad(LINE_READER &aReader, BOARD *aAppendToMe, const PROPERTIES *aProperties, PROGRESS_REPORTER *aProgressReporter, unsigned aLineCount)
const Vec & GetSize() const
Definition: box2.h:172
BOARD * GetBoard() const
FOOTPRINT_PREVIEW_PANEL * m_preview
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
double GetScale() const
Definition: view.h:264
void createSwatch(int aLayer, const wxString &aName)
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
Definition: richio.h:240
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75
void onNewThemeSelected() override
Event fired when a new theme is selected that can be overridden in children.
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:184