Compare commits
745 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5526fba124 | |||
| cceafd5e7d | |||
| 4044ed65cd | |||
| a13dbf8cf4 | |||
| 2f42a85724 | |||
| 154c52defd | |||
| fc518c5584 | |||
| a7a7e963c9 | |||
| 46e6eb163b | |||
| 42429aff15 | |||
| f02c62971f | |||
| 47aba551d1 | |||
| c9295d6f60 | |||
| 6505b996c9 | |||
| ce134a1342 | |||
| 1f0530734e | |||
| 22df27111f | |||
| 68ab95ad43 | |||
| 32048d3b1e | |||
| 7498f1b1a6 | |||
| c55d2c092e | |||
| e13c414052 | |||
| ee49cf555a | |||
| 3aded5da4b | |||
| cbd55bc201 | |||
| 26674ceec3 | |||
| 71a6231bb8 | |||
| c4f9710f98 | |||
| 4c561b3193 | |||
| 6193652e89 | |||
| 8c980facb4 | |||
| 12782a163b | |||
| 73d43a985f | |||
| a9d1c87461 | |||
| 961588ef56 | |||
| 23955965d1 | |||
| 7882505426 | |||
| 707ec69916 | |||
| b788cb860a | |||
| 372f6dd9d6 | |||
| d4454bf3d2 | |||
| ae05479dff | |||
| 6727e4993c | |||
| 6de07ce92b | |||
| 348fe1c49d | |||
| 55e0780887 | |||
| 6c30e4f90b | |||
| fb92923f82 | |||
| c25264528c | |||
| e5e4d9b814 | |||
| a8d04d0079 | |||
| b345dac82b | |||
| dd2d8e1a62 | |||
| 227c74f2ee | |||
| 51557e5f66 | |||
| e35bd84c07 | |||
| 308c632f44 | |||
| dba149447c | |||
| 753a436183 | |||
| 9e9870580b | |||
| f8bf5d2c38 | |||
| af9cbdc4fb | |||
| 32ebb1f3a2 | |||
| 8650e5a063 | |||
| fe6fa68694 | |||
| 6b1a415281 | |||
| 328f37cc3f | |||
| 818d650ce2 | |||
| 648825127d | |||
| ad501536e8 | |||
| 13331d00bb | |||
| 2b2b7d2232 | |||
| a65fe79551 | |||
| 5b79ad7f6b | |||
| 184863db1a | |||
| 3ed4eece94 | |||
| 38c0e50f13 | |||
| 1215b0c304 | |||
| 14a05de36a | |||
| bb95659afb | |||
| 5edc846122 | |||
| a12bcbb6ea | |||
| aa69aa63be | |||
| c9e35a59dc | |||
| 785be9bd59 | |||
| 6cfd84993c | |||
| 56082b5d60 | |||
| e404e18c3d | |||
| 90df0c2d8b | |||
| ad26cec474 | |||
| 2982409887 | |||
| f357a55393 | |||
| 989e7c3779 | |||
| b3b4d65982 | |||
| 215f2d8320 | |||
| 4c6bbe21c0 | |||
| 55ffa472c6 | |||
| 410f3f0f7b | |||
| 01df75ed36 | |||
| be68120865 | |||
| 1c0a6fd14f | |||
| 60fca542ec | |||
| 072562eb1a | |||
| 68b86e6817 | |||
| 491b451519 | |||
| d7eea3cf7b | |||
| 4ba7cff25e | |||
| a4a3ee31e4 | |||
| 56345a4158 | |||
| 8c26f4f10e | |||
| ff02626f75 | |||
| d6a6337a96 | |||
| 42461e4a69 | |||
| ab51588005 | |||
| 3a4fdcd391 | |||
| 6d431d1670 | |||
| 398d6b4328 | |||
| f1d5093dfc | |||
| 67eff4e495 | |||
| c829773a44 | |||
| eec89791d8 | |||
| a4a27f0956 | |||
| 8458066468 | |||
| 33fad39cf4 | |||
| c2d3c9b292 | |||
| 37103c6e15 | |||
| 3b4111d3a2 | |||
| 906ef8bca7 | |||
| aab730abc1 | |||
| 91602ee7ba | |||
| ee513f7a8b | |||
| 5adc6ee2f4 | |||
| a4f71ae3ee | |||
| cc69f8b9ae | |||
| ec17012c81 | |||
| e93b05e413 | |||
| f82760f6e3 | |||
| 01a09e8a3f | |||
| fcc170f077 | |||
| 03d80dd8d8 | |||
| f91afe1f49 | |||
| 1bba0d96ad | |||
| a107722eac | |||
| d9bba779fd | |||
| 49dc16fcb0 | |||
| fc82d8d19c | |||
| ec061ebd2e | |||
| 65b509a225 | |||
| 097cef1819 | |||
| 8bf538f529 | |||
| 06fdb5e86c | |||
| b4831a17a0 | |||
| 32cef776da | |||
| ce314185fb | |||
| 9bd43071ae | |||
| bfe895bfd5 | |||
| dc3a3ec597 | |||
| 69e909dc76 | |||
| 446e7f3125 | |||
| cf66d47b74 | |||
| 11f3bbdbcb | |||
| 6028cb3ec2 | |||
| f7cdd9eaa7 | |||
| 3fadd20088 | |||
| 9db8765d52 | |||
| 5644e6d517 | |||
| 9be41e97f7 | |||
| 1c835fee75 | |||
| bae846c2cd | |||
| afe3d2c43e | |||
| e784b03f61 | |||
| 9a0a4b8671 | |||
| 6780cdb54c | |||
| c5771d8874 | |||
| 2cebea3b04 | |||
| dfb66e2fdb | |||
| 31a7048faf | |||
| 58a76a2617 | |||
| 4b137bbaea | |||
| 4a533bfb07 | |||
| 1e11916975 | |||
| df4435ed80 | |||
| ecf3697ad3 | |||
| aab7701c17 | |||
| 09da370512 | |||
| 0fca70a0bc | |||
| ff6bee400e | |||
| 2b99d3e2e6 | |||
| 30f1c400e2 | |||
| fe162b2f3c | |||
| 37f11379c3 | |||
| 9b253fbdd7 | |||
| 3068868f65 | |||
| 87de0ac806 | |||
| 8334a83aaa | |||
| 5cba809a1e | |||
| e23c2e30ee | |||
| 6cd3a802a7 | |||
| a3fff6ea10 | |||
| dd468a916e | |||
| e2b976594a | |||
| d8903534b7 | |||
| de1257abdf | |||
| 3d36d41ea7 | |||
| 2c74d46d79 | |||
| 7bee2cf842 | |||
| 6446e01483 | |||
| f5adac9369 | |||
| 312b75291b | |||
| c54b65fff7 | |||
| 766e48fb4f | |||
| 6ec1585c58 | |||
| c65d27dae1 | |||
| 82d572df80 | |||
| 32e9762230 | |||
| f987688b6f | |||
| 5544a315bd | |||
| 9d1344d707 | |||
| e0db6d013b | |||
| 13cbdda586 | |||
| a6d81d019f | |||
| fa10961d6c | |||
| a1a710dfed | |||
| 6efaa64908 | |||
| e918f820f5 | |||
| 806f9ea5fd | |||
| 9c4a88a129 | |||
| 956a633d4d | |||
| 63a03734e9 | |||
| 221f28eafc | |||
| d6406d1349 | |||
| 36b9c08793 | |||
| 6988e79714 | |||
| 147234ca68 | |||
| 71659be29b | |||
| b685378efa | |||
| 736044cd71 | |||
| de1a04d6b4 | |||
| 8149107e33 | |||
| 36eb0c75d4 | |||
| bc4fe1e05a | |||
| 0c083e560c | |||
| 4ff1fc2f1b | |||
| 141a6291c9 | |||
| 9043279301 | |||
| 4003fdfe98 | |||
| 3f060a6107 | |||
| ca284ebb4e | |||
| b446e794b8 | |||
| 8c162ecbca | |||
| d05fe64d41 | |||
| b2d3a602c5 | |||
| 2546534056 | |||
| 303c1bef7b | |||
| 9cbc1db2a1 | |||
| 2b8083920a | |||
| 69589840df | |||
| 558488f874 | |||
| 73f77658bb | |||
| 4d6bb9317b | |||
| 4aeb2c58fb | |||
| 0087959bf5 | |||
| efea324ee4 | |||
| 3c6cb7b5b9 | |||
| cae665cd76 | |||
| 547997e1a6 | |||
| 6ad924ea45 | |||
| 56d9d46a0b | |||
| b56ff24acd | |||
| cbeb6735e9 | |||
| 83b8bdf137 | |||
| a21bcb4903 | |||
| 4e064d5502 | |||
| 8e48445a5b | |||
| 6b1505438d | |||
| 7f6136454a | |||
| 548a33dace | |||
| 4ea36da4c3 | |||
| 37fe0eca73 | |||
| 3b45663866 | |||
| 238b5fedc8 | |||
| 8694c70237 | |||
| 84adec02a7 | |||
| d61d66505f | |||
| beb4bb9007 | |||
| b2c59f2359 | |||
| a417afac8e | |||
| 80e2153a14 | |||
| 7208e6baf6 | |||
| 8e81d9ec73 | |||
| a44c2d9a5c | |||
| 02688ce919 | |||
| 35e119c152 | |||
| e09f4d79c9 | |||
| 0e8afc8243 | |||
| a2ca66d05b | |||
| c32639d6b5 | |||
| f7572e254d | |||
| 817dba3a57 | |||
| daaee3f1b8 | |||
| ebef835852 | |||
| 6073a32833 | |||
| 1723346524 | |||
| 97982cd089 | |||
| 4e353c8366 | |||
| 772295c573 | |||
| 88c4913f65 | |||
| 1d80bd4043 | |||
| 3085ec0a5d | |||
| 5622a9e295 | |||
| 81585f7a83 | |||
| 7c953d11f7 | |||
| 5fa1d0eaeb | |||
| a0baef9d12 | |||
| b112ca3944 | |||
| d271a47375 | |||
| a9adc64f3e | |||
| 65f9264531 | |||
| d45fbaca96 | |||
| b007cb143d | |||
| 96bfa17469 | |||
| e7ea87f454 | |||
| e1c292e600 | |||
| 537a8cc652 | |||
| 62fa53ca96 | |||
| c1575392e6 | |||
| 4a3889f1fe | |||
| afb5487fd5 | |||
| 1d443ca74c | |||
| 4ec80ee395 | |||
| a00726378b | |||
| 33d891de29 | |||
| f875045b6a | |||
| 9f47704f04 | |||
| 630f23c11f | |||
| 32d29d1d1f | |||
| d2a94de5d5 | |||
| d72c23b602 | |||
| 43bb8dcb2d | |||
| 2d365f4037 | |||
| 429eebad4b | |||
| 4b08c4ade8 | |||
| a103af96d7 | |||
| 3e0125628e | |||
| 457db26576 | |||
| 96040df625 | |||
| 1bfeececa5 | |||
| 8027348d8a | |||
| 6a834f8811 | |||
| 81914c846f | |||
| 579c08155f | |||
| cac3a140cc | |||
| c7f1d0a0ff | |||
| 56c05869dd | |||
| b9f249226a | |||
| 77588e0d0f | |||
| 80e45b2f1d | |||
| dfea0b4dd5 | |||
| b6b3245cfc | |||
| aa4d019efb | |||
| cbdad19566 | |||
| 299ed49de6 | |||
| 8ecbdb4f3d | |||
| f8f905025d | |||
| a14830b796 | |||
| 537e3e625b | |||
| 1d6a67d2b2 | |||
| 285c549394 | |||
| c2c915c98c | |||
| 1c894f0e9a | |||
| 4ea24a4d39 | |||
| 817aa5670e | |||
| eddd925269 | |||
| 61bcf85fb3 | |||
| 8c5e98ee03 | |||
| 20138d20f9 | |||
| 57fc76cb22 | |||
| de9fa7bdb1 | |||
| 6b5525f946 | |||
| a9e29a957a | |||
| ee1951cd58 | |||
| d66879cafa | |||
| 3c6631bdb2 | |||
| f40be70e07 | |||
| 151d745922 | |||
| bd3cc02b18 | |||
| 8acf694129 | |||
| 348700eb1d | |||
| c0d20fce9e | |||
| bf0bd05c75 | |||
| d2550138bc | |||
| 029f72161b | |||
| 87457cfdaf | |||
| c258b99d2f | |||
| b436a4fd2a | |||
| 98becb9814 | |||
| 49c352a95e | |||
| 96541f9ef7 | |||
| 0dfe8ce154 | |||
| bcf992f22f | |||
| a8d79ec4be | |||
| a38a76791f | |||
| 44c66225e7 | |||
| c973fa7ad0 | |||
| 3993e6dcb0 | |||
| e1436d3597 | |||
| 28ba36129a | |||
| c6abc5fdd0 | |||
| 6104651613 | |||
| 5b88f2509e | |||
| 6768e34e0e | |||
| 372b704844 | |||
| 3648c8c31a | |||
| 2df3924ea0 | |||
| 48d194a0fc | |||
| 8a3d7d66a1 | |||
| d7c9c8aeca | |||
| 48d3b67686 | |||
| a4ac97d5de | |||
| bb525e3c68 | |||
| d4002b95d4 | |||
| ae4978502f | |||
| c4ad3456f4 | |||
| c521dabcf0 | |||
| b5716ef54b | |||
| 9515bf9038 | |||
| 38dcfdc350 | |||
| 55aeca477d | |||
| 572fcdfa22 | |||
| 234994bf53 | |||
| 49d8fc900f | |||
| 27b55eb32f | |||
| cf118f142c | |||
| be0c8c88e5 | |||
| de953b0fdb | |||
| 3ea0191954 | |||
| f835591c8b | |||
| 12fcf31dc5 | |||
| 31b65a241f | |||
| 2bf369793c | |||
| 12680cfecb | |||
| ff578d9866 | |||
| 48e254fe4c | |||
| 222bfda5c3 | |||
| c93d8115cb | |||
| 5c1d7f11d7 | |||
| 90d64e3eb1 | |||
| 8cbd172c3c | |||
| 69de87675a | |||
| 33492efb01 | |||
| e22e2c5109 | |||
| 8937a7cc82 | |||
| 141eb9d1b7 | |||
| f291629c64 | |||
| b4dbba2f5f | |||
| bafa055114 | |||
| 2ca4f60729 | |||
| 9451214ecf | |||
| 635974cfcc | |||
| a40c4c68d1 | |||
| b422281eb8 | |||
| 5e3eda108f | |||
| 5bd28c9569 | |||
| fc562ba229 | |||
| e3ab4b066c | |||
| edfba6ce84 | |||
| 7f7b023c19 | |||
| 2e9c197f09 | |||
| f8db7a2aca | |||
| 34138ffc42 | |||
| 10d34f5b9b | |||
| 7cb85e2dd1 | |||
| 34906f0871 | |||
| 2fa818b002 | |||
| 9e98bb68d7 | |||
| 4b26e737c0 | |||
| bcb8c2097c | |||
| 028721f3ed | |||
| b837dc1d3b | |||
| 3446dbbf27 | |||
| aee836d722 | |||
| 5d9908647c | |||
| 631c5ec01d | |||
| d92f42cdcb | |||
| a4893523e4 | |||
| 4dc0a31071 | |||
| c65a1139cb | |||
| 71aae415a4 | |||
| 7061b64319 | |||
| 03da07767d | |||
| f3c5b21b1b | |||
| 69eb81196d | |||
| f23b06de27 | |||
| badaac9366 | |||
| 215c3fdf77 | |||
| b658031b8c | |||
| 02b756189b | |||
| d2af56597e | |||
| f862eea1b9 | |||
| 73f495c67d | |||
| b46780ad46 | |||
| 9762fb855d | |||
| 9d156891c6 | |||
| b73b154abc | |||
| 1d9a5c33ca | |||
| 12dac14ba6 | |||
| 116aa3d344 | |||
| 7219a5dd77 | |||
| 729d14827e | |||
| e8ec50e04c | |||
| 8b2e70afb0 | |||
| 21384b64f7 | |||
| 184798b770 | |||
| f93a954c7b | |||
| a69d6a129a | |||
| 491af0df39 | |||
| 34458cf738 | |||
| 809948333e | |||
| 1a6160b132 | |||
| 51f588b55b | |||
| 1effbe5d01 | |||
| 50711b1294 | |||
| b3ba8d78b5 | |||
| 11df4b32eb | |||
| 1de9a83ff0 | |||
| 25de338bdd | |||
| 4df101b94e | |||
| cf78215276 | |||
| ed5ec0f749 | |||
| 2da1294492 | |||
| 04733511fc | |||
| 1414e90ce9 | |||
| 5c492429be | |||
| e9e2c9399b | |||
| 58422f2c97 | |||
| 618077bbf2 | |||
| 6aa274bc0d | |||
| 12f460cc7a | |||
| cbe22a23b8 | |||
| 0f8f9214b0 | |||
| 4f63cb6a26 | |||
| 64d8bbd1d9 | |||
| f957dfa218 | |||
| 0d18ad188b | |||
| bf189855f8 | |||
| 81658cb2c9 | |||
| 5e80f4bf32 | |||
| 684b92dfa6 | |||
| 22e2850cdc | |||
| be7b69172f | |||
| 07f74ab56e | |||
| 89bbaa6d2e | |||
| ce8737936e | |||
| 8c45d3621e | |||
| bae042b934 | |||
| 5e724a2909 | |||
| 4810f50083 | |||
| 771c6b21df | |||
| 5f1feb4532 | |||
| 759b279009 | |||
| 456fc581f1 | |||
| d18d47fbeb | |||
| efae811143 | |||
| f7eb925bfe | |||
| f92c46d585 | |||
| 648c3aec39 | |||
| 46ef12ff4d | |||
| 477f856e9a | |||
| 3a1cb402ad | |||
| 9c50f208af | |||
| 0d9daa372e | |||
| 91a2edd16f | |||
| 765c4ffce6 | |||
| 50b8b797f7 | |||
| 9025f04f20 | |||
| ce2b4a7b16 | |||
| ed76b543a0 | |||
| 622a3f5bad | |||
| f125ab95c9 | |||
| d52811d367 | |||
| 549258a5cc | |||
| 2ae04b32b4 | |||
| ab0d02b322 | |||
| 9e163b7480 | |||
| d69e7c579c | |||
| 2a1de79916 | |||
| 7116be4ae0 | |||
| 66bf97bc0f | |||
| 42a18ad3b6 | |||
| afd35001cb | |||
| cbc964fb94 | |||
| d033859596 | |||
| c7a6f3c63b | |||
| 984b872c28 | |||
| a246a96d18 | |||
| 12d3f54da4 | |||
| 97b0e6d403 | |||
| 89226575c6 | |||
| 6febb9ddde | |||
| 47150649b7 | |||
| ae6c865a77 | |||
| 154c89765f | |||
| 341818306e | |||
| 87a0106c57 | |||
| 2504195e6e | |||
| 3f5195de3d | |||
| 31fe178504 | |||
| e44e3ae25e | |||
| ae96cf1715 | |||
| 203ddb7b47 | |||
| 0ec82b65be | |||
| 09c63ea1ec | |||
| 0c2edf8e5c | |||
| d9a779d8ce | |||
| e56894ccc2 | |||
| 5c624dacd2 | |||
| 3ad740c920 | |||
| 9055821db6 | |||
| d08cb55d94 | |||
| 240a7bb238 | |||
| e453da97af | |||
| 140f92b1d7 | |||
| 51ec75e565 | |||
| 4c13ca2bea | |||
| a638ca22c2 | |||
| 6526fe75ea | |||
| 3c41c33e39 | |||
| d267f46c21 | |||
| a47298b72f | |||
| 41c3607512 | |||
| d7ba90c573 | |||
| 3f984704be | |||
| 2bb2f1398c | |||
| 9b1b2c626a | |||
| ff74d7b24a | |||
| 9a3ae62b70 | |||
| 2e17848d3f | |||
| 36b4bab5cc | |||
| 3a91fc8c2b | |||
| f4f92b0184 | |||
| 87532491e1 | |||
| 5cdca70bf1 | |||
| cb7ea2f117 | |||
| 1c0769ce27 | |||
| c7afa8ce87 | |||
| cc2ca441fa | |||
| 8d1f1fd4f5 | |||
| 377476df1d | |||
| 5465ff8143 | |||
| 969c28864f | |||
| fd202d7b8d | |||
| 7e79a99cea | |||
| ad2c243220 | |||
| fb02d02698 | |||
| a10ab54bf2 | |||
| 72454180c1 | |||
| 5909fc1c8f | |||
| 82ead56d9a | |||
| 798e9999c2 | |||
| a752dd5105 | |||
| da8dcab1de | |||
| b707b305ac | |||
| 038b927cfa | |||
| bdd4a88127 | |||
| f60313367c | |||
| a4e2d54221 | |||
| 8ef8ca4d39 | |||
| ae0396ee3c | |||
| b97bd36b44 | |||
| f3523b6ad9 | |||
| 0fccad7183 | |||
| 337689a69e | |||
| a3e3c0384e | |||
| 36924926de | |||
| ec1353168b | |||
| 1712f5f8e7 | |||
| 6485465301 | |||
| 87f7ed7846 | |||
| f8993933a9 | |||
| b135491d35 | |||
| 2aa9d4851e | |||
| 4cd8833687 | |||
| 870807fbad | |||
| a844554443 | |||
| d6f10f9f88 | |||
| dcc09a9e77 | |||
| 45bb1da77a | |||
| a153e4fc63 | |||
| f3371f9c21 | |||
| 8a3086652a | |||
| 2103f303b7 | |||
| 17cac94c6a | |||
| c4c32aa7bb | |||
| 8162896bd5 | |||
| 92a605385b | |||
| b948611c6f | |||
| ba2156a0f1 | |||
| 966c7e40e5 | |||
| 89b4adc042 | |||
| ff3687420f | |||
| 7aafe9efe9 | |||
| e6f6e7b2f0 | |||
| 68b590cadb | |||
| 1ec7051f97 | |||
| 866a5722f6 | |||
| 4e7da6169d | |||
| ebb8682dde | |||
| 812bbe8919 | |||
| fd2932bc06 | |||
| 1b6621d898 | |||
| 4aa11830e4 | |||
| 91f5096ecc | |||
| 4dbf39743b | |||
| c7d62a23be | |||
| b81f0b4377 | |||
| f45e2b2252 | |||
| db44690460 | |||
| f8c0109c6e | |||
| a60f0b3782 | |||
| 7cc2b47d2e | |||
| 71ebe394d5 | |||
| 9d27f5526c | |||
| bf1daeab64 | |||
| 5693ba1432 | |||
| a60307340f | |||
| 5a6793f9fb | |||
| b3463dce71 | |||
| 58b8e9736d | |||
| a1dd583696 | |||
| 6429246ce0 | |||
| aaca5d820b | |||
| 2579165733 | |||
| 93fdd52d14 | |||
| 079636ad18 | |||
| f6148f10e1 | |||
| 2a93af1348 | |||
| ee2039b531 | |||
| cc77cb4252 | |||
| 072a2b6305 | |||
| 3cae075945 | |||
| 900b6bfffb | |||
| 0c68ab4556 | |||
| 1a41387a50 | |||
| e602e0bdbd | |||
| f2e814c330 |
@@ -0,0 +1,57 @@
|
||||
# minimum clang-format 10
|
||||
BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: true
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllConstructorInitializersOnNextLine: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: InlineOnly
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: None
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeBraces: Allman
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: AfterColon
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 100
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 8
|
||||
ContinuationIndentWidth: 8
|
||||
Cpp11BracedListStyle: false
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ForEachMacros: [ BOOST_FOREACH ]
|
||||
IndentCaseLabels: false
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
Language: Cpp
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: Inner
|
||||
PointerAlignment: Left
|
||||
ReflowComments: false
|
||||
SortIncludes: false
|
||||
SpaceAfterCStyleCast: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: Never
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: true
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: c++11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
@@ -89,9 +89,6 @@ pcbnew/Info.plist
|
||||
*.orig
|
||||
*.patch
|
||||
|
||||
# _clang-format is used, .clang-format is not
|
||||
.clang-format
|
||||
|
||||
# These CMake files are wanted
|
||||
!cmake/**/*.cmake
|
||||
|
||||
@@ -130,11 +127,9 @@ i18n_status.csv
|
||||
# Project local settings files and backups (in demos and qa tests)
|
||||
*.kicad_prl
|
||||
*-backups
|
||||
~*.lck
|
||||
|
||||
# QA dataoutput
|
||||
qa/data/**/*.csv
|
||||
qa/data/**/*.spice
|
||||
|
||||
# Don't actually ignore any of these files, since we need them in the tree
|
||||
!resources/linux/icons/hicolor/**/**/*
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
# Despite the unfortunate naming convention of this file, KiCad does not have code "owners".
|
||||
# All parts of KiCad are worked on by all developers, and we do not require explicit approval
|
||||
# from any particular person in order to accept contributions or fixes to sections of KiCad.
|
||||
|
||||
# This file is used to generate suggested reviewers for pull requests that touch certain parts
|
||||
# of the KiCad codebase based on the development history of those parts. Most of KiCad does not
|
||||
# have a particular set of reviewers defined in this file, and in general, it is a good thing if
|
||||
# entries can be removed from this file over time, because it indicates that expertise about
|
||||
# parts of the codebase that once were only familiar to one or two developers is now shared among
|
||||
# a wider set of the core development team.
|
||||
|
||||
# Contributors: despite this file, the KiCad team still primarily matches up new merge requests
|
||||
# with reviewers based on developer availability. If a change you propose touches files that
|
||||
# are covered by entries in this file, the relevant developer(s) may or may not be the final
|
||||
# reviewer(s) for your merge request.
|
||||
|
||||
# Core team developers: consider adding yourself to places where you are commonly asked for
|
||||
# review feedback by the rest of the team. Consider removing yourself if you are stepping back
|
||||
# from participating in KiCad code review, or if you notice that an area you were previously
|
||||
# listed as a reviewer because not many others were familiar with it is now familiar with the
|
||||
# larger team.
|
||||
|
||||
^[Suggested Reviewers]
|
||||
|
||||
/vcpkg*.json @mroszko
|
||||
|
||||
/api/ @craftyjon
|
||||
|
||||
/cmake/InstallSteps/*MacOS.cmake @craftyjon
|
||||
|
||||
/common/api/ @craftyjon
|
||||
/common/git/ @sethhillbrand
|
||||
/common/database/ @craftyjon
|
||||
/common/io/eagle/ @stambaughw
|
||||
/common/jobs/ @mroszko
|
||||
|
||||
/cmake/KiCadVersion.cmake @stambaughw
|
||||
|
||||
/eeschema/api/ @craftyjon
|
||||
/eeschema/erc/ @jeffyoung
|
||||
/eeschema/connection_graph.* @craftyjon @sethhillbrand
|
||||
/eeschema/sch_io/database/ @craftyjon
|
||||
/eeschema/sch_io/kicad_sexpr/ @stambaughw
|
||||
/eeschema/sch_io/eagle/ @stambaughw
|
||||
|
||||
/libs/kinng/ @craftyjon
|
||||
|
||||
/pcbnew/api/ @craftyjon
|
||||
/pcbnew/drc/ @jeffyoung
|
||||
/pcbnew/pcb_io/easyeda* @dsa-t
|
||||
/pcbnew/pcb_io/ipc2581/ @sethhillbrand
|
||||
/pcbnew/pcb_io/odbpp/ @SYSUeric66 @sethhillbrand @craftyjon
|
||||
/pcbnew/router/ @twlostow @craftyjon @sethhillbrand
|
||||
/pcbnew/zone_filler* @jeffyoung
|
||||
|
||||
/scripting/ @craftyjon @sethhillbrand
|
||||
|
||||
/thirdparty/nanodbc/ @craftyjon
|
||||
@@ -37,8 +37,6 @@ win64_build:
|
||||
../../
|
||||
- cmake --build . 2>&1 | tee compilation_log.txt
|
||||
- cd ../../
|
||||
after_script:
|
||||
- Get-Content -Path C:\builder\vcpkg\buildtrees\wxpython-33\python3-tool-post-install-err.log
|
||||
artifacts:
|
||||
# Only save the artifacts that are needed for running the tests in the next stage
|
||||
# and the compilation log. The entire build directory is too large to save as an
|
||||
|
||||
@@ -147,7 +147,7 @@ SCENEGRAPH* S3D_CACHE::load( const wxString& aModelFile, const wxString& aBasePa
|
||||
if( aCachePtr )
|
||||
*aCachePtr = nullptr;
|
||||
|
||||
wxString full3Dpath = m_FNResolver->ResolvePath( aModelFile, aBasePath, std::move( aEmbeddedFilesStack ) );
|
||||
wxString full3Dpath = m_FNResolver->ResolvePath( aModelFile, aBasePath, aEmbeddedFilesStack );
|
||||
|
||||
if( full3Dpath.empty() )
|
||||
{
|
||||
@@ -215,7 +215,7 @@ SCENEGRAPH* S3D_CACHE::load( const wxString& aModelFile, const wxString& aBasePa
|
||||
SCENEGRAPH* S3D_CACHE::Load( const wxString& aModelFile, const wxString& aBasePath,
|
||||
std::vector<const EMBEDDED_FILES*> aEmbeddedFilesStack )
|
||||
{
|
||||
return load( aModelFile, aBasePath, nullptr, std::move( aEmbeddedFilesStack ) );
|
||||
return load( aModelFile, aBasePath, nullptr, aEmbeddedFilesStack );
|
||||
}
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ S3DMODEL* S3D_CACHE::GetModel( const wxString& aModelFileName, const wxString& a
|
||||
std::vector<const EMBEDDED_FILES*> aEmbeddedFilesStack )
|
||||
{
|
||||
S3D_CACHE_ENTRY* cp = nullptr;
|
||||
SCENEGRAPH* sp = load( aModelFileName, aBasePath, &cp, std::move( aEmbeddedFilesStack ) );
|
||||
SCENEGRAPH* sp = load( aModelFileName, aBasePath, &cp, aEmbeddedFilesStack );
|
||||
|
||||
if( !sp )
|
||||
return nullptr;
|
||||
|
||||
@@ -752,9 +752,7 @@ bool SGSHAPE::Prepare( const glm::dmat4* aTransform, S3D::MATLIST& materials,
|
||||
for( unsigned int i = 0; i < nvidx; ++i )
|
||||
{
|
||||
mit = indexmap.find( lv[i] );
|
||||
|
||||
if( mit != indexmap.end() )
|
||||
lvidx[i] = mit->second;
|
||||
lvidx[i] = mit->second;
|
||||
}
|
||||
|
||||
m.m_FaceIdxSize = (unsigned int )nvidx;
|
||||
|
||||
@@ -113,8 +113,6 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
|
||||
m_frontCopperThickness3DU = DEFAULT_COPPER_THICKNESS * m_biuTo3Dunits;
|
||||
m_backCopperThickness3DU = DEFAULT_COPPER_THICKNESS * m_biuTo3Dunits;
|
||||
m_nonCopperLayerThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
|
||||
m_frontMaskThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
|
||||
m_backMaskThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
|
||||
m_solderPasteLayerThickness3DU = SOLDERPASTE_LAYER_THICKNESS * m_biuTo3Dunits;
|
||||
|
||||
m_trackCount = 0;
|
||||
@@ -227,11 +225,17 @@ BOARD_ADAPTER::~BOARD_ADAPTER()
|
||||
|
||||
void BOARD_ADAPTER::ReloadColorSettings() noexcept
|
||||
{
|
||||
PCBNEW_SETTINGS* cfg = GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
|
||||
COLOR_SETTINGS* cs = ::GetColorSettings( cfg ? cfg->m_ColorTheme : DEFAULT_THEME );
|
||||
wxCHECK( PgmOrNull(), /* void */ );
|
||||
|
||||
for( int layer = F_Cu; layer < PCB_LAYER_ID_COUNT; ++layer )
|
||||
m_BoardEditorColors[ layer ] = cs->GetColor( layer );
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
|
||||
COLOR_SETTINGS* colors = mgr.GetColorSettings( cfg ? cfg->m_ColorTheme : wxString( "" ) );
|
||||
|
||||
if( colors )
|
||||
{
|
||||
for( int layer = F_Cu; layer < PCB_LAYER_ID_COUNT; ++layer )
|
||||
m_BoardEditorColors[ layer ] = colors->GetColor( layer );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -318,7 +322,7 @@ unsigned int BOARD_ADAPTER::GetCircleSegmentCount( int aDiameterBIU ) const
|
||||
{
|
||||
wxASSERT( aDiameterBIU > 0 );
|
||||
|
||||
return GetArcToSegmentCount( aDiameterBIU / 2, m_board->GetDesignSettings().m_MaxError, FULL_CIRCLE );
|
||||
return GetArcToSegmentCount( aDiameterBIU / 2, ARC_HIGH_DEF, FULL_CIRCLE );
|
||||
}
|
||||
|
||||
|
||||
@@ -377,8 +381,6 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
m_frontCopperThickness3DU = DEFAULT_COPPER_THICKNESS * m_biuTo3Dunits;
|
||||
m_backCopperThickness3DU = DEFAULT_COPPER_THICKNESS * m_biuTo3Dunits;
|
||||
m_nonCopperLayerThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
|
||||
m_frontMaskThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
|
||||
m_backMaskThickness3DU = DEFAULT_TECH_LAYER_THICKNESS * m_biuTo3Dunits;
|
||||
m_solderPasteLayerThickness3DU = SOLDERPASTE_LAYER_THICKNESS * m_biuTo3Dunits;
|
||||
|
||||
g_BevelThickness3DU = pcbIUScale.mmToIU( ADVANCED_CFG::GetCfg().m_3DRT_BevelHeight_um / 1000.0 )
|
||||
@@ -390,7 +392,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
|
||||
if( bds.GetStackupDescriptor().GetCount() )
|
||||
{
|
||||
int body_thickness = 0;
|
||||
int thickness = 0;
|
||||
|
||||
for( BOARD_STACKUP_ITEM* item : bds.GetStackupDescriptor().GetList() )
|
||||
{
|
||||
@@ -398,44 +400,31 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
{
|
||||
case BS_ITEM_TYPE_DIELECTRIC:
|
||||
for( int sublayer = 0; sublayer < item->GetSublayersCount(); sublayer++ )
|
||||
body_thickness += item->GetThickness( sublayer );
|
||||
|
||||
thickness += item->GetThickness( sublayer );
|
||||
break;
|
||||
|
||||
case BS_ITEM_TYPE_COPPER:
|
||||
{
|
||||
// The copper thickness must be > 0 to avoid draw issues (divide by 0 for
|
||||
// instance). We use a minimal arbitrary value = 1 micrometer here:
|
||||
int copper_thickness = std::max( item->GetThickness(), pcbIUScale.mmToIU( 0.001 ) );
|
||||
int copper_thickness = std::max( item->GetThickness(),
|
||||
pcbIUScale.mmToIU( 0.001 ) );
|
||||
|
||||
if( item->GetBrdLayerId() == F_Cu )
|
||||
m_frontCopperThickness3DU = copper_thickness * m_biuTo3Dunits;
|
||||
else if( item->GetBrdLayerId() == B_Cu )
|
||||
m_backCopperThickness3DU = copper_thickness * m_biuTo3Dunits;
|
||||
else if( item->IsEnabled() )
|
||||
body_thickness += copper_thickness;
|
||||
|
||||
thickness += copper_thickness;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case BS_ITEM_TYPE_SOLDERMASK:
|
||||
{
|
||||
// The mask thickness must be > 0 to avoid draw issues (divide by 0 for
|
||||
// instance). We use a minimal arbitrary value = 1 micrometer here:
|
||||
int mask_thickness = std::max( item->GetThickness(), pcbIUScale.mmToIU( 0.001 ) );
|
||||
|
||||
if( item->GetBrdLayerId() == F_Mask )
|
||||
m_frontMaskThickness3DU = mask_thickness * m_biuTo3Dunits;
|
||||
else if( item->GetBrdLayerId() == B_Mask )
|
||||
m_backMaskThickness3DU = mask_thickness * m_biuTo3Dunits;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_boardBodyThickness3DU = body_thickness * m_biuTo3Dunits;
|
||||
m_boardBodyThickness3DU = thickness * m_biuTo3Dunits;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,7 +458,8 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
};
|
||||
|
||||
m_layerZcoordBottom[layer_id] = m_boardBodyThickness3DU / 2.0
|
||||
- ( m_boardBodyThickness3DU * layer_pos / ( m_copperLayersCount - 1 ) );
|
||||
- ( m_boardBodyThickness3DU * layer_pos
|
||||
/ ( m_copperLayersCount - 1 ) );
|
||||
|
||||
if( layer_pos < (m_copperLayersCount / 2) )
|
||||
m_layerZcoordTop[layer_id] = m_layerZcoordBottom[layer_id] + m_frontCopperThickness3DU;
|
||||
@@ -507,7 +497,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
|
||||
case B_Mask:
|
||||
zposBottom = zpos_copperTop_back;
|
||||
zposTop = zpos_copperTop_back - m_backMaskThickness3DU;
|
||||
zposTop = zpos_copperTop_back - m_nonCopperLayerThickness3DU;
|
||||
break;
|
||||
|
||||
case B_Paste:
|
||||
@@ -517,7 +507,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
|
||||
case F_Mask:
|
||||
zposBottom = zpos_copperTop_front;
|
||||
zposTop = zpos_copperTop_front + m_frontMaskThickness3DU;
|
||||
zposTop = zpos_copperTop_front + m_nonCopperLayerThickness3DU;
|
||||
break;
|
||||
|
||||
case F_Paste:
|
||||
@@ -545,7 +535,8 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
|
||||
m_boardCenter = SFVEC3F( m_boardPos.x * m_biuTo3Dunits, m_boardPos.y * m_biuTo3Dunits, 0.0f );
|
||||
|
||||
SFVEC3F boardSize = SFVEC3F( m_boardSize.x * m_biuTo3Dunits, m_boardSize.y * m_biuTo3Dunits, 0.0f );
|
||||
SFVEC3F boardSize = SFVEC3F( m_boardSize.x * m_biuTo3Dunits, m_boardSize.y * m_biuTo3Dunits,
|
||||
0.0f );
|
||||
boardSize /= 2.0f;
|
||||
|
||||
SFVEC3F boardMin = ( m_boardCenter - boardSize );
|
||||
@@ -611,7 +602,7 @@ std::map<int, COLOR4D> BOARD_ADAPTER::GetDefaultColors() const
|
||||
colors[ LAYER_3D_USER_ECO1 ] = BOARD_ADAPTER::g_DefaultECOs;
|
||||
colors[ LAYER_3D_USER_ECO2 ] = BOARD_ADAPTER::g_DefaultECOs;
|
||||
|
||||
COLOR_SETTINGS* settings = ::GetColorSettings( DEFAULT_THEME );
|
||||
COLOR_SETTINGS* settings = Pgm().GetSettingsManager().GetColorSettings( wxEmptyString );
|
||||
|
||||
for( int layer = LAYER_3D_USER_1; layer <= LAYER_3D_USER_45; ++layer )
|
||||
colors[ layer ] = settings->GetColor( layer );
|
||||
@@ -630,7 +621,7 @@ std::map<int, COLOR4D> BOARD_ADAPTER::GetLayerColors() const
|
||||
}
|
||||
else
|
||||
{
|
||||
COLOR_SETTINGS* settings = ::GetColorSettings( DEFAULT_THEME );
|
||||
COLOR_SETTINGS* settings = Pgm().GetSettingsManager().GetColorSettings();
|
||||
|
||||
for( const auto& [ layer, defaultColor /* unused */ ] : GetDefaultColors() )
|
||||
colors[ layer ] = settings->GetColor( layer );
|
||||
@@ -740,7 +731,7 @@ std::map<int, COLOR4D> BOARD_ADAPTER::GetLayerColors() const
|
||||
|
||||
void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
|
||||
{
|
||||
COLOR_SETTINGS* settings = ::GetColorSettings( DEFAULT_THEME );
|
||||
COLOR_SETTINGS* settings = Pgm().GetSettingsManager().GetColorSettings();
|
||||
|
||||
for( const auto& [ layer, color ] : aColors )
|
||||
{
|
||||
@@ -785,7 +776,7 @@ void BOARD_ADAPTER::SetVisibleLayers( const std::bitset<LAYER_3D_END>& aLayers )
|
||||
|
||||
m_Cfg->m_Render.show_model_bbox = aLayers.test( LAYER_3D_BOUNDING_BOXES );
|
||||
m_Cfg->m_Render.show_off_board_silk = aLayers.test( LAYER_3D_OFF_BOARD_SILK );
|
||||
m_Cfg->m_Render.show_navigator = aLayers.test( LAYER_3D_NAVIGATOR );
|
||||
m_Cfg->m_Render.show_axis = aLayers.test( LAYER_3D_AXES );
|
||||
}
|
||||
|
||||
|
||||
@@ -793,7 +784,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
|
||||
{
|
||||
std::bitset<LAYER_3D_END> ret;
|
||||
|
||||
if( m_IsPreviewer )
|
||||
if( m_board && m_board->IsFootprintHolder() )
|
||||
{
|
||||
if( m_Cfg->m_Render.preview_show_board_body )
|
||||
{
|
||||
@@ -828,7 +819,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
|
||||
|
||||
ret.set( LAYER_3D_BOUNDING_BOXES, m_Cfg->m_Render.show_model_bbox );
|
||||
ret.set( LAYER_3D_OFF_BOARD_SILK, m_Cfg->m_Render.show_off_board_silk );
|
||||
ret.set( LAYER_3D_NAVIGATOR, m_Cfg->m_Render.show_navigator );
|
||||
ret.set( LAYER_3D_AXES, m_Cfg->m_Render.show_axis );
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -862,7 +853,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
|
||||
|
||||
ret.set( LAYER_3D_BOUNDING_BOXES, m_Cfg->m_Render.show_model_bbox );
|
||||
ret.set( LAYER_3D_OFF_BOARD_SILK, m_Cfg->m_Render.show_off_board_silk );
|
||||
ret.set( LAYER_3D_NAVIGATOR, m_Cfg->m_Render.show_navigator );
|
||||
ret.set( LAYER_3D_AXES, m_Cfg->m_Render.show_axis );
|
||||
|
||||
if( m_Cfg->m_CurrentPreset == FOLLOW_PCB )
|
||||
{
|
||||
@@ -914,9 +905,9 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetVisibleLayers() const
|
||||
for( int layer = LAYER_3D_USER_1; layer <= LAYER_3D_USER_45; ++layer )
|
||||
ret.set( layer, layers.test( Map3DLayerToPCBLayer( layer ) ) );
|
||||
|
||||
ret.set( LAYER_FP_REFERENCES, plotParams.GetPlotReference() );
|
||||
ret.set( LAYER_FP_VALUES, plotParams.GetPlotValue() );
|
||||
ret.set( LAYER_FP_TEXT, plotParams.GetPlotFPText() );
|
||||
ret.set( LAYER_FP_REFERENCES, plotParams.GetPlotReference() );
|
||||
ret.set( LAYER_FP_VALUES, plotParams.GetPlotValue() );
|
||||
ret.set( LAYER_FP_TEXT, plotParams.GetPlotFPText() );
|
||||
}
|
||||
else if( LAYER_PRESET_3D* preset = m_Cfg->FindPreset( m_Cfg->m_CurrentPreset ) )
|
||||
{
|
||||
@@ -960,7 +951,7 @@ std::bitset<LAYER_3D_END> BOARD_ADAPTER::GetDefaultVisibleLayers() const
|
||||
|
||||
ret.set( LAYER_3D_BOUNDING_BOXES, false );
|
||||
ret.set( LAYER_3D_OFF_BOARD_SILK, false );
|
||||
ret.set( LAYER_3D_NAVIGATOR, true );
|
||||
ret.set( LAYER_3D_AXES, true );
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1053,8 +1044,9 @@ SFVEC4F BOARD_ADAPTER::GetColor( const COLOR4D& aColor ) const
|
||||
|
||||
SFVEC2F BOARD_ADAPTER::GetSphericalCoord( int i ) const
|
||||
{
|
||||
SFVEC2F sphericalCoord = SFVEC2F( ( m_Cfg->m_Render.raytrace_lightElevation[i] + 90.0f ) / 180.0f,
|
||||
m_Cfg->m_Render.raytrace_lightAzimuth[i] / 180.0f );
|
||||
SFVEC2F sphericalCoord =
|
||||
SFVEC2F( ( m_Cfg->m_Render.raytrace_lightElevation[i] + 90.0f ) / 180.0f,
|
||||
m_Cfg->m_Render.raytrace_lightAzimuth[i] / 180.0f );
|
||||
|
||||
sphericalCoord.x = glm::clamp( sphericalCoord.x, 0.0f, 1.0f );
|
||||
sphericalCoord.y = glm::clamp( sphericalCoord.y, 0.0f, 2.0f );
|
||||
|
||||
@@ -492,15 +492,16 @@ private:
|
||||
double m_biuTo3Dunits; ///< Scale factor to convert board internal units
|
||||
///< to 3D units normalized between -1.0 and 1.0.
|
||||
|
||||
std::map<PCB_LAYER_ID, float> m_layerZcoordTop; ///< Top (End) Z pos of each layer in 3D units.
|
||||
std::map<PCB_LAYER_ID, float> m_layerZcoordBottom; ///< Bottom (Start) Z pos of each layer.
|
||||
std::map<PCB_LAYER_ID, float> m_layerZcoordTop; ///< Top (End) Z position of each
|
||||
///< layer in 3D units.
|
||||
|
||||
std::map<PCB_LAYER_ID, float> m_layerZcoordBottom; ///< Bottom (Start) Z position of
|
||||
///< each layer in 3D units.
|
||||
|
||||
float m_frontCopperThickness3DU;
|
||||
float m_backCopperThickness3DU;
|
||||
float m_boardBodyThickness3DU;
|
||||
float m_nonCopperLayerThickness3DU;
|
||||
float m_frontMaskThickness3DU;
|
||||
float m_backMaskThickness3DU;
|
||||
float m_solderPasteLayerThickness3DU;
|
||||
|
||||
unsigned int m_trackCount;
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <pcb_text.h>
|
||||
#include <pcb_textbox.h>
|
||||
#include <pcb_table.h>
|
||||
#include <board_design_settings.h>
|
||||
#include <pcb_painter.h> // for PCB_RENDER_SETTINGS
|
||||
#include <zone.h>
|
||||
#include <convert_basic_shapes_to_polygon.h>
|
||||
@@ -109,7 +110,8 @@ void BOARD_ADAPTER::addText( const EDA_TEXT* aText, CONTAINER_2D_BASE* aContaine
|
||||
SHAPE_POLY_SET finalPoly;
|
||||
const PCB_TEXT* pcbText = static_cast<const PCB_TEXT*>( aOwner );
|
||||
|
||||
pcbText->TransformTextToPolySet( finalPoly, 0, aOwner->GetMaxError(), ERROR_INSIDE );
|
||||
pcbText->TransformTextToPolySet( finalPoly, 0, m_board->GetDesignSettings().m_MaxError,
|
||||
ERROR_INSIDE );
|
||||
|
||||
// Do not call finalPoly.Fracture() here: ConvertPolygonToTriangles() call it
|
||||
// if needed, and Fracture() called twice can create bad results and is useless
|
||||
@@ -190,7 +192,7 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2
|
||||
{
|
||||
KIGFX::GAL_DISPLAY_OPTIONS empty_opts;
|
||||
|
||||
for( PCB_FIELD* field : aFootprint->GetFields() )
|
||||
for( PCB_FIELD* field : aFootprint->GetFields( true /* visibleOnly */ ) )
|
||||
{
|
||||
if( !aFlags.test( LAYER_FP_TEXT ) )
|
||||
continue;
|
||||
@@ -201,7 +203,7 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2
|
||||
if( field->IsValue() && !aFlags.test( LAYER_FP_VALUES ) )
|
||||
continue;
|
||||
|
||||
if( field->GetLayer() == aLayerId && field->IsVisible() )
|
||||
if( field->GetLayer() == aLayerId )
|
||||
addText( field, aContainer, field );
|
||||
}
|
||||
|
||||
@@ -279,8 +281,9 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::createTrackWithMargin( const PCB_TRACK* aTrack, CONTAINER_2D_BASE* aDstContainer,
|
||||
PCB_LAYER_ID aLayer, int aMargin )
|
||||
void BOARD_ADAPTER::createTrackWithMargin( const PCB_TRACK* aTrack,
|
||||
CONTAINER_2D_BASE* aDstContainer, PCB_LAYER_ID aLayer,
|
||||
int aMargin )
|
||||
{
|
||||
SFVEC2F start3DU = TO_SFVEC2F( aTrack->GetStart() );
|
||||
SFVEC2F end3DU = TO_SFVEC2F( aTrack->GetEnd() );
|
||||
@@ -316,7 +319,7 @@ void BOARD_ADAPTER::createTrackWithMargin( const PCB_TRACK* aTrack, CONTAINER_2D
|
||||
VECTOR2I center( arc->GetCenter() );
|
||||
EDA_ANGLE arc_angle = arc->GetAngle();
|
||||
double radius = arc->GetRadius();
|
||||
int arcsegcount = GetArcToSegmentCount( KiROUND( radius ), arc->GetMaxError(), arc_angle );
|
||||
int arcsegcount = GetArcToSegmentCount( KiROUND( radius ), ARC_HIGH_DEF, arc_angle );
|
||||
int circlesegcount;
|
||||
|
||||
// Avoid arcs that cannot be drawn
|
||||
@@ -336,7 +339,8 @@ void BOARD_ADAPTER::createTrackWithMargin( const PCB_TRACK* aTrack, CONTAINER_2D
|
||||
}
|
||||
|
||||
createArcSegments( center, arc->GetStart(), arc_angle, circlesegcount,
|
||||
arc->GetWidth() + aMargin * 2, aDstContainer, *arc );
|
||||
arc->GetWidth() + aMargin * 2,
|
||||
aDstContainer, *arc );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -357,6 +361,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
|
||||
PCB_LAYER_ID aLayer, const VECTOR2I& aMargin ) const
|
||||
{
|
||||
SHAPE_POLY_SET poly;
|
||||
int maxError = GetBoard()->GetDesignSettings().m_MaxError;
|
||||
VECTOR2I clearance = aMargin;
|
||||
|
||||
// Our shape-based builder can't handle negative or differing x:y clearance values (the
|
||||
@@ -366,7 +371,8 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
|
||||
// Of course being a hack it falls down when dealing with custom shape pads (where the size
|
||||
// is only the size of the anchor), so for those we punt and just use aMargin.x.
|
||||
|
||||
if( ( clearance.x < 0 || clearance.x != clearance.y ) && aPad->GetShape( aLayer ) != PAD_SHAPE::CUSTOM )
|
||||
if( ( clearance.x < 0 || clearance.x != clearance.y )
|
||||
&& aPad->GetShape( aLayer ) != PAD_SHAPE::CUSTOM )
|
||||
{
|
||||
VECTOR2I dummySize = VECTOR2I( aPad->GetSize( aLayer ) ) + clearance + clearance;
|
||||
|
||||
@@ -375,19 +381,23 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
|
||||
|
||||
PAD dummy( *aPad );
|
||||
dummy.SetSize( aLayer, VECTOR2I( dummySize.x, dummySize.y ) );
|
||||
dummy.TransformShapeToPolygon( poly, aLayer, 0, aPad->GetMaxError(), ERROR_INSIDE );
|
||||
dummy.TransformShapeToPolygon( poly, aLayer, 0, maxError, ERROR_INSIDE );
|
||||
clearance = { 0, 0 };
|
||||
|
||||
// Remove group membership from dummy item before deleting
|
||||
dummy.SetParentGroup( nullptr );
|
||||
}
|
||||
else if( aPad->GetShape( aLayer ) == PAD_SHAPE::CUSTOM )
|
||||
{
|
||||
// A custom pad can have many complex subshape items. To avoid issues, use its
|
||||
// final polygon shape, not its basic shape set. One cannot apply the clearance
|
||||
// to each subshape: it does no work
|
||||
aPad->TransformShapeToPolygon( poly, aLayer, 0, aPad->GetMaxError() );
|
||||
aPad->TransformShapeToPolygon( poly, aLayer, 0, maxError );
|
||||
}
|
||||
else
|
||||
{
|
||||
auto padShapes = std::static_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape( aLayer ) );
|
||||
auto padShapes =
|
||||
std::static_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape( aLayer ) );
|
||||
|
||||
for( const SHAPE* shape : padShapes->Shapes() )
|
||||
{
|
||||
@@ -439,7 +449,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
|
||||
case SH_ARC:
|
||||
{
|
||||
const SHAPE_ARC* arc = static_cast<const SHAPE_ARC*>( shape );
|
||||
SHAPE_LINE_CHAIN l = arc->ConvertToPolyline( aPad->GetMaxError() );
|
||||
SHAPE_LINE_CHAIN l = arc->ConvertToPolyline( maxError );
|
||||
|
||||
for( int i = 0; i < l.SegmentCount(); i++ )
|
||||
{
|
||||
@@ -465,7 +475,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
|
||||
if( !poly.IsEmpty() )
|
||||
{
|
||||
if( clearance.x )
|
||||
poly.Inflate( clearance.x, CORNER_STRATEGY::ROUND_ALL_CORNERS, aPad->GetMaxError() );
|
||||
poly.Inflate( clearance.x, CORNER_STRATEGY::ROUND_ALL_CORNERS, maxError );
|
||||
|
||||
// Add the PAD polygon
|
||||
ConvertPolygonToTriangles( poly, *aContainer, m_biuTo3Dunits, *aPad );
|
||||
@@ -589,29 +599,22 @@ void BOARD_ADAPTER::createArcSegments( const VECTOR2I& aCentre, const VECTOR2I&
|
||||
void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aContainer,
|
||||
const BOARD_ITEM* aOwner, PCB_LAYER_ID aLayer )
|
||||
{
|
||||
LINE_STYLE lineStyle = aShape->GetStroke().GetLineStyle();
|
||||
int linewidth = aShape->GetWidth();
|
||||
int margin = 0;
|
||||
bool isSolidFill = aShape->IsSolidFill();
|
||||
bool isHatchedFill = aShape->IsHatchedFill();
|
||||
// The full width of the lines to create
|
||||
int linewidth = aShape->GetWidth();
|
||||
int margin = 0;
|
||||
|
||||
if( IsSolderMaskLayer( aLayer )
|
||||
&& aShape->HasSolderMask()
|
||||
&& IsExternalCopperLayer( aShape->GetLayer() ) )
|
||||
&& aShape->HasSolderMask()
|
||||
&& IsExternalCopperLayer( aShape->GetLayer() ) )
|
||||
{
|
||||
margin = aShape->GetSolderMaskExpansion();
|
||||
linewidth += margin * 2;
|
||||
lineStyle = LINE_STYLE::SOLID;
|
||||
|
||||
if( isHatchedFill )
|
||||
{
|
||||
isSolidFill = true;
|
||||
isHatchedFill = false;
|
||||
}
|
||||
}
|
||||
|
||||
float linewidth3DU = TO_3DU( linewidth );
|
||||
|
||||
LINE_STYLE lineStyle = aShape->GetStroke().GetLineStyle();
|
||||
|
||||
if( lineStyle <= LINE_STYLE::FIRST_TYPE )
|
||||
{
|
||||
switch( aShape->GetShape() )
|
||||
@@ -622,7 +625,7 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
|
||||
float innerR3DU = TO_3DU( aShape->GetRadius() ) - linewidth3DU / 2.0;
|
||||
float outerR3DU = TO_3DU( aShape->GetRadius() ) + linewidth3DU / 2.0;
|
||||
|
||||
if( isSolidFill || innerR3DU <= 0.0 )
|
||||
if( aShape->IsFilled() || innerR3DU <= 0.0 )
|
||||
addFILLED_CIRCLE_2D( aContainer, center3DU, outerR3DU, *aOwner );
|
||||
else
|
||||
addRING_2D( aContainer, center3DU, innerR3DU, outerR3DU, *aOwner );
|
||||
@@ -631,18 +634,19 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
|
||||
}
|
||||
|
||||
case SHAPE_T::RECTANGLE:
|
||||
if( isSolidFill )
|
||||
if( aShape->IsFilled() )
|
||||
{
|
||||
SHAPE_POLY_SET polyList;
|
||||
|
||||
aShape->TransformShapeToPolySet( polyList, UNDEFINED_LAYER, 0, aShape->GetMaxError(),
|
||||
aShape->TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, ARC_HIGH_DEF,
|
||||
ERROR_INSIDE );
|
||||
|
||||
polyList.Simplify();
|
||||
|
||||
if( margin != 0 )
|
||||
{
|
||||
polyList.Inflate( margin, CORNER_STRATEGY::ROUND_ALL_CORNERS, aShape->GetMaxError() );
|
||||
polyList.Inflate( margin, CORNER_STRATEGY::ROUND_ALL_CORNERS,
|
||||
GetBoard()->GetDesignSettings().m_MaxError );
|
||||
}
|
||||
|
||||
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
|
||||
@@ -677,10 +681,11 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
|
||||
break;
|
||||
|
||||
case SHAPE_T::BEZIER:
|
||||
case SHAPE_T::POLY:
|
||||
{
|
||||
SHAPE_POLY_SET polyList;
|
||||
|
||||
aShape->TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, aShape->GetMaxError(),
|
||||
aShape->TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, ARC_HIGH_DEF,
|
||||
ERROR_INSIDE );
|
||||
|
||||
// Some polygons can be a bit complex (especially when coming from a
|
||||
@@ -696,56 +701,13 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
|
||||
CORNER_STRATEGY cornerStr = margin >= 0 ? CORNER_STRATEGY::ROUND_ALL_CORNERS
|
||||
: CORNER_STRATEGY::ALLOW_ACUTE_CORNERS;
|
||||
|
||||
polyList.Inflate( margin, cornerStr, aShape->GetMaxError() );
|
||||
polyList.Inflate( margin, cornerStr, GetBoard()->GetDesignSettings().m_MaxError );
|
||||
}
|
||||
|
||||
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
|
||||
break;
|
||||
}
|
||||
|
||||
case SHAPE_T::POLY:
|
||||
{
|
||||
if( isSolidFill )
|
||||
{
|
||||
SHAPE_POLY_SET polyList;
|
||||
|
||||
aShape->TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, aShape->GetMaxError(),
|
||||
ERROR_INSIDE );
|
||||
|
||||
// Some polygons can be a bit complex (especially when coming from a
|
||||
// picture of a text converted to a polygon
|
||||
// So call Simplify before calling ConvertPolygonToTriangles, just in case.
|
||||
polyList.Simplify();
|
||||
|
||||
if( polyList.IsEmpty() ) // Just for caution
|
||||
break;
|
||||
|
||||
if( margin != 0 )
|
||||
{
|
||||
CORNER_STRATEGY cornerStr = margin >= 0 ? CORNER_STRATEGY::ROUND_ALL_CORNERS
|
||||
: CORNER_STRATEGY::ALLOW_ACUTE_CORNERS;
|
||||
|
||||
polyList.Inflate( margin, cornerStr, aShape->GetMaxError() );
|
||||
}
|
||||
|
||||
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<VECTOR2I> pts = aShape->GetCorners();
|
||||
|
||||
for( int i = 0; i < pts.size() - 1; i++ )
|
||||
{
|
||||
addROUND_SEGMENT_2D( aContainer, TO_SFVEC2F( pts[i] ), TO_SFVEC2F( pts[i + 1] ), linewidth3DU,
|
||||
*aOwner );
|
||||
}
|
||||
|
||||
addROUND_SEGMENT_2D( aContainer, TO_SFVEC2F( pts[pts.size() - 1] ), TO_SFVEC2F( pts[0] ), linewidth3DU,
|
||||
*aOwner );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxT( "BOARD_ADAPTER::addShape no implementation for " )
|
||||
+ aShape->SHAPE_T_asString() );
|
||||
@@ -777,9 +739,6 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta
|
||||
for( SHAPE* shape : shapes )
|
||||
delete shape;
|
||||
}
|
||||
|
||||
if( isHatchedFill )
|
||||
ConvertPolygonToTriangles( aShape->GetHatching(), *aContainer, m_biuTo3Dunits, *aOwner );
|
||||
}
|
||||
|
||||
|
||||
@@ -803,7 +762,7 @@ void BOARD_ADAPTER::addShape( const PCB_TEXTBOX* aTextBox, CONTAINER_2D_BASE* aC
|
||||
{
|
||||
SHAPE_POLY_SET polyList;
|
||||
|
||||
aTextBox->PCB_SHAPE::TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, aTextBox->GetMaxError(),
|
||||
aTextBox->PCB_SHAPE::TransformShapeToPolygon( polyList, UNDEFINED_LAYER, 0, ARC_HIGH_DEF,
|
||||
ERROR_INSIDE );
|
||||
|
||||
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
|
||||
@@ -833,7 +792,8 @@ void BOARD_ADAPTER::addSolidAreasShapes( const ZONE* aZone, CONTAINER_2D_BASE* a
|
||||
PCB_LAYER_ID aLayerId )
|
||||
{
|
||||
// This convert the poly in outline and holes
|
||||
ConvertPolygonToTriangles( *aZone->GetFilledPolysList( aLayerId ), *aContainer, m_biuTo3Dunits, *aZone );
|
||||
ConvertPolygonToTriangles( *aZone->GetFilledPolysList( aLayerId ), *aContainer, m_biuTo3Dunits,
|
||||
*aZone );
|
||||
}
|
||||
|
||||
|
||||
@@ -852,7 +812,8 @@ void BOARD_ADAPTER::buildPadOutlineAsSegments( const PAD* aPad, PCB_LAYER_ID aLa
|
||||
else
|
||||
{
|
||||
// For other shapes, add outlines as thick segments in polygon buffer
|
||||
const std::shared_ptr<SHAPE_POLY_SET>& corners = aPad->GetEffectivePolygon( aLayer, ERROR_INSIDE );
|
||||
const std::shared_ptr<SHAPE_POLY_SET>& corners = aPad->GetEffectivePolygon( aLayer,
|
||||
ERROR_INSIDE );
|
||||
const SHAPE_LINE_CHAIN& path = corners->COutline( 0 );
|
||||
|
||||
for( int j = 0; j < path.PointCount(); j++ )
|
||||
|
||||
@@ -23,17 +23,34 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file create_layer_items.cpp
|
||||
* @brief This file implements the creation of the pcb board.
|
||||
*
|
||||
* It is based on the function found in the files:
|
||||
* board_items_to_polygon_shape_transform.cpp
|
||||
* board_items_to_polygon_shape_transform.cpp
|
||||
*/
|
||||
|
||||
#include "board_adapter.h"
|
||||
#include "../3d_rendering/raytracing/shapes2D/filled_circle_2d.h"
|
||||
#include "raytracing/shapes2D/triangle_2d.h"
|
||||
#include <board_design_settings.h>
|
||||
#include <board.h>
|
||||
#include <footprint.h>
|
||||
#include <layer_range.h>
|
||||
#include <lset.h>
|
||||
#include <pad.h>
|
||||
#include <pcb_text.h>
|
||||
#include <pcb_textbox.h>
|
||||
#include <pcb_table.h>
|
||||
#include <pcb_shape.h>
|
||||
#include <zone.h>
|
||||
#include <convert_basic_shapes_to_polygon.h>
|
||||
#include <trigo.h>
|
||||
#include <vector>
|
||||
#include <thread>
|
||||
#include <core/arraydim.h>
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <wx/log.h>
|
||||
@@ -42,6 +59,9 @@
|
||||
#include <core/profile.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* This is used to draw pad outlines on silk layers.
|
||||
*/
|
||||
@@ -77,7 +97,7 @@ void transformFPShapesToPolySet( const FOOTPRINT* aFootprint, PCB_LAYER_ID aLaye
|
||||
if( item->Type() == PCB_SHAPE_T || BaseType( item->Type() ) == PCB_DIMENSION_T )
|
||||
{
|
||||
if( item->GetLayer() == aLayer )
|
||||
item->TransformShapeToPolySet( aBuffer, aLayer, 0, aMaxError, aErrorLoc );
|
||||
item->TransformShapeToPolygon( aBuffer, aLayer, 0, aMaxError, aErrorLoc );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +137,10 @@ void transformFPTextToPolySet( const FOOTPRINT* aFootprint, PCB_LAYER_ID aLayer,
|
||||
{
|
||||
// border
|
||||
if( textbox->IsBorderEnabled() )
|
||||
textbox->PCB_SHAPE::TransformShapeToPolygon( aBuffer, aLayer, 0, aMaxError, aErrorLoc );
|
||||
{
|
||||
textbox->PCB_SHAPE::TransformShapeToPolygon( aBuffer, aLayer, 0, aMaxError,
|
||||
aErrorLoc );
|
||||
}
|
||||
|
||||
// text
|
||||
textbox->TransformTextToPolySet( aBuffer, 0, aMaxError, aErrorLoc );
|
||||
@@ -125,7 +148,7 @@ void transformFPTextToPolySet( const FOOTPRINT* aFootprint, PCB_LAYER_ID aLayer,
|
||||
}
|
||||
}
|
||||
|
||||
for( const PCB_FIELD* field : aFootprint->GetFields() )
|
||||
for( const PCB_FIELD* field : aFootprint->GetFields( true /* visibleOnly */ ) )
|
||||
{
|
||||
if( !aFlags.test( LAYER_FP_TEXT ) )
|
||||
continue;
|
||||
@@ -136,7 +159,7 @@ void transformFPTextToPolySet( const FOOTPRINT* aFootprint, PCB_LAYER_ID aLayer,
|
||||
if( field->IsValue() && !aFlags.test( LAYER_FP_VALUES ) )
|
||||
continue;
|
||||
|
||||
if( field->GetLayer() == aLayer && field->IsVisible() )
|
||||
if( field && field->GetLayer() == aLayer )
|
||||
field->TransformTextToPolySet( aBuffer, 0, aMaxError, aErrorLoc );
|
||||
}
|
||||
}
|
||||
@@ -219,10 +242,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
trackList.clear();
|
||||
trackList.reserve( m_board->Tracks().size() );
|
||||
|
||||
int maxError = m_board->GetDesignSettings().m_MaxError;
|
||||
|
||||
for( PCB_TRACK* track : m_board->Tracks() )
|
||||
{
|
||||
// Skip tracks (not vias theyt are on more than one layer ) on disabled layers
|
||||
if( track->Type() != PCB_VIA_T && !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) )
|
||||
if( track->Type() != PCB_VIA_T
|
||||
&& !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -293,7 +319,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
// Create tracks as objects and add it to container
|
||||
for( PCB_LAYER_ID layer : layer_ids )
|
||||
{
|
||||
wxASSERT( m_layerMap.contains( layer ) );
|
||||
wxASSERT( m_layerMap.find( layer ) != m_layerMap.end() );
|
||||
|
||||
BVH_CONTAINER_2D *layerContainer = m_layerMap[layer];
|
||||
|
||||
@@ -348,7 +374,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
BVH_CONTAINER_2D *layerHoleContainer = nullptr;
|
||||
|
||||
// Check if the layer is already created
|
||||
if( !m_layerHoleMap.contains( layer ) )
|
||||
if( m_layerHoleMap.find( layer ) == m_layerHoleMap.end() )
|
||||
{
|
||||
// not found, create a new container
|
||||
layerHoleContainer = new BVH_CONTAINER_2D;
|
||||
@@ -367,8 +393,10 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
else if( layer == layer_ids[0] ) // it only adds once the THT holes
|
||||
{
|
||||
// Add through hole object
|
||||
m_TH_ODs.Add( new FILLED_CIRCLE_2D( via_center, hole_inner_radius + thickness, *track ) );
|
||||
m_viaTH_ODs.Add( new FILLED_CIRCLE_2D( via_center, hole_inner_radius + thickness, *track ) );
|
||||
m_TH_ODs.Add( new FILLED_CIRCLE_2D( via_center, hole_inner_radius + thickness,
|
||||
*track ) );
|
||||
m_viaTH_ODs.Add( new FILLED_CIRCLE_2D( via_center, hole_inner_radius + thickness,
|
||||
*track ) );
|
||||
|
||||
if( cfg.clip_silk_on_via_annuli && ring_radius > 0.0 )
|
||||
m_viaAnnuli.Add( new FILLED_CIRCLE_2D( via_center, ring_radius, *track ) );
|
||||
@@ -380,12 +408,12 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
if( cfg.DifferentiatePlatedCopper() && layer == F_Cu )
|
||||
{
|
||||
track->TransformShapeToPolygon( *m_frontPlatedCopperPolys, F_Cu, 0, track->GetMaxError(),
|
||||
track->TransformShapeToPolygon( *m_frontPlatedCopperPolys, F_Cu, 0, maxError,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
else if( cfg.DifferentiatePlatedCopper() && layer == B_Cu )
|
||||
{
|
||||
track->TransformShapeToPolygon( *m_backPlatedCopperPolys, B_Cu, 0, track->GetMaxError(),
|
||||
track->TransformShapeToPolygon( *m_backPlatedCopperPolys, B_Cu, 0, maxError,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
@@ -419,13 +447,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
SHAPE_POLY_SET *layerInnerHolesPoly = nullptr;
|
||||
|
||||
// Check if the layer is already created
|
||||
if( !m_layerHoleOdPolys.contains( layer ) )
|
||||
if( m_layerHoleOdPolys.find( layer ) == m_layerHoleOdPolys.end() )
|
||||
{
|
||||
// not found, create a new container
|
||||
layerOuterHolesPoly = new SHAPE_POLY_SET;
|
||||
m_layerHoleOdPolys[layer] = layerOuterHolesPoly;
|
||||
|
||||
wxASSERT( !m_layerHoleIdPolys.contains( layer ) );
|
||||
wxASSERT( m_layerHoleIdPolys.find( layer ) == m_layerHoleIdPolys.end() );
|
||||
|
||||
layerInnerHolesPoly = new SHAPE_POLY_SET;
|
||||
m_layerHoleIdPolys[layer] = layerInnerHolesPoly;
|
||||
@@ -435,7 +463,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
// found
|
||||
layerOuterHolesPoly = m_layerHoleOdPolys[layer];
|
||||
|
||||
wxASSERT( m_layerHoleIdPolys.contains( layer ) );
|
||||
wxASSERT( m_layerHoleIdPolys.find( layer ) != m_layerHoleIdPolys.end() );
|
||||
|
||||
layerInnerHolesPoly = m_layerHoleIdPolys[layer];
|
||||
}
|
||||
@@ -443,11 +471,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
const int holediameter = via->GetDrillValue();
|
||||
const int hole_outer_radius = (holediameter / 2) + GetHolePlatingThickness();
|
||||
|
||||
TransformCircleToPolygon( *layerOuterHolesPoly, via->GetStart(), hole_outer_radius,
|
||||
via->GetMaxError(), ERROR_INSIDE );
|
||||
TransformCircleToPolygon( *layerOuterHolesPoly, via->GetStart(),
|
||||
hole_outer_radius, maxError, ERROR_INSIDE );
|
||||
|
||||
TransformCircleToPolygon( *layerInnerHolesPoly, via->GetStart(), holediameter / 2,
|
||||
via->GetMaxError(), ERROR_INSIDE );
|
||||
TransformCircleToPolygon( *layerInnerHolesPoly, via->GetStart(),
|
||||
holediameter / 2, maxError, ERROR_INSIDE );
|
||||
}
|
||||
else if( layer == layer_ids[0] ) // it only adds once the THT holes
|
||||
{
|
||||
@@ -457,16 +485,16 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
// Add through hole contours
|
||||
TransformCircleToPolygon( m_TH_ODPolys, via->GetStart(), hole_outer_radius,
|
||||
via->GetMaxError(), ERROR_INSIDE );
|
||||
maxError, ERROR_INSIDE );
|
||||
|
||||
// Add same thing for vias only
|
||||
TransformCircleToPolygon( m_viaTH_ODPolys, via->GetStart(), hole_outer_radius,
|
||||
via->GetMaxError(), ERROR_INSIDE );
|
||||
maxError, ERROR_INSIDE );
|
||||
|
||||
if( cfg.clip_silk_on_via_annuli )
|
||||
{
|
||||
TransformCircleToPolygon( m_viaAnnuliPolys, via->GetStart(), hole_outer_ring_radius,
|
||||
via->GetMaxError(), ERROR_INSIDE );
|
||||
TransformCircleToPolygon( m_viaAnnuliPolys, via->GetStart(),
|
||||
hole_outer_ring_radius, maxError, ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -478,7 +506,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
{
|
||||
for( PCB_LAYER_ID layer : layer_ids )
|
||||
{
|
||||
wxASSERT( m_layers_poly.contains( layer ) );
|
||||
wxASSERT( m_layers_poly.find( layer ) != m_layers_poly.end() );
|
||||
|
||||
SHAPE_POLY_SET *layerPoly = m_layers_poly[layer];
|
||||
|
||||
@@ -493,11 +521,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
continue;
|
||||
|
||||
// Skip vias annulus when not flashed on this layer
|
||||
if( track->Type() == PCB_VIA_T && !static_cast<const PCB_VIA*>( track )->FlashLayer( layer ) )
|
||||
if( track->Type() == PCB_VIA_T
|
||||
&& !static_cast<const PCB_VIA*>( track )->FlashLayer( layer ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the track/via contour
|
||||
track->TransformShapeToPolygon( *layerPoly, layer, 0, track->GetMaxError(), ERROR_INSIDE );
|
||||
track->TransformShapeToPolygon( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -515,7 +546,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
// The hole in the body is inflated by copper thickness, if not plated, no copper
|
||||
int inflate = 0;
|
||||
|
||||
if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
|
||||
if( pad->GetAttribute () != PAD_ATTRIB::NPTH )
|
||||
inflate = KiROUND( GetHolePlatingThickness() / 2.0 );
|
||||
|
||||
m_holeCount++;
|
||||
@@ -547,20 +578,20 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
// The hole in the body is inflated by copper thickness.
|
||||
const int inflate = GetHolePlatingThickness();
|
||||
|
||||
if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
|
||||
if( pad->GetAttribute () != PAD_ATTRIB::NPTH )
|
||||
{
|
||||
if( cfg.clip_silk_on_via_annuli )
|
||||
pad->TransformHoleToPolygon( m_viaAnnuliPolys, inflate, pad->GetMaxError(), ERROR_INSIDE );
|
||||
pad->TransformHoleToPolygon( m_viaAnnuliPolys, inflate, maxError, ERROR_INSIDE );
|
||||
|
||||
pad->TransformHoleToPolygon( m_TH_ODPolys, inflate, pad->GetMaxError(), ERROR_INSIDE );
|
||||
pad->TransformHoleToPolygon( m_TH_ODPolys, inflate, maxError, ERROR_INSIDE );
|
||||
}
|
||||
else
|
||||
{
|
||||
// If not plated, no copper.
|
||||
if( cfg.clip_silk_on_via_annuli )
|
||||
pad->TransformHoleToPolygon( m_viaAnnuliPolys, 0, pad->GetMaxError(), ERROR_INSIDE );
|
||||
pad->TransformHoleToPolygon( m_viaAnnuliPolys, 0, maxError, ERROR_INSIDE );
|
||||
|
||||
pad->TransformHoleToPolygon( m_NPTH_ODPolys, 0, pad->GetMaxError(), ERROR_INSIDE );
|
||||
pad->TransformHoleToPolygon( m_NPTH_ODPolys, 0, maxError, ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -568,7 +599,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
// Add footprints copper items (pads, shapes and text) to containers
|
||||
for( PCB_LAYER_ID layer : layer_ids )
|
||||
{
|
||||
wxASSERT( m_layerMap.contains( layer ) );
|
||||
wxASSERT( m_layerMap.find( layer ) != m_layerMap.end() );
|
||||
|
||||
BVH_CONTAINER_2D *layerContainer = m_layerMap[layer];
|
||||
|
||||
@@ -578,13 +609,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
addFootprintShapes( fp, layerContainer, layer, visibilityFlags );
|
||||
|
||||
// Add copper item to the plated copper polygon list if required
|
||||
if( cfg.DifferentiatePlatedCopper() && IsExternalCopperLayer( layer ) )
|
||||
if( cfg.DifferentiatePlatedCopper() && ( layer == F_Cu || layer == B_Cu ) )
|
||||
{
|
||||
SHAPE_POLY_SET* layerPoly = layer == F_Cu ? m_frontPlatedCopperPolys : m_backPlatedCopperPolys;
|
||||
|
||||
fp->TransformPadsToPolySet( *layerPoly, layer, 0, fp->GetMaxError(), ERROR_INSIDE );
|
||||
transformFPTextToPolySet( fp, layer, visibilityFlags, *layerPoly, fp->GetMaxError(), ERROR_INSIDE );
|
||||
transformFPShapesToPolySet( fp, layer, *layerPoly, fp->GetMaxError(), ERROR_INSIDE );
|
||||
fp->TransformPadsToPolySet( *layerPoly, layer, 0, maxError, ERROR_INSIDE, true );
|
||||
transformFPTextToPolySet( fp, layer, visibilityFlags, *layerPoly, maxError, ERROR_INSIDE );
|
||||
transformFPShapesToPolySet( fp, layer, *layerPoly, maxError, ERROR_INSIDE );
|
||||
}
|
||||
|
||||
// Add copper item to poly contours (vertical outlines) if required
|
||||
@@ -594,9 +625,9 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
SHAPE_POLY_SET* layerPoly = m_layers_poly[layer];
|
||||
|
||||
fp->TransformPadsToPolySet( *layerPoly, layer, 0, fp->GetMaxError(), ERROR_INSIDE );
|
||||
transformFPTextToPolySet( fp, layer, visibilityFlags, *layerPoly, fp->GetMaxError(), ERROR_INSIDE );
|
||||
transformFPShapesToPolySet( fp, layer, *layerPoly, fp->GetMaxError(), ERROR_INSIDE );
|
||||
fp->TransformPadsToPolySet( *layerPoly, layer, 0, maxError, ERROR_INSIDE, true );
|
||||
transformFPTextToPolySet( fp, layer, visibilityFlags, *layerPoly, maxError, ERROR_INSIDE );
|
||||
transformFPShapesToPolySet( fp, layer, *layerPoly, maxError, ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -604,7 +635,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
// Add graphic item on copper layers to object containers
|
||||
for( PCB_LAYER_ID layer : layer_ids )
|
||||
{
|
||||
wxASSERT( m_layerMap.contains( layer ) );
|
||||
wxASSERT( m_layerMap.find( layer ) != m_layerMap.end() );
|
||||
|
||||
BVH_CONTAINER_2D *layerContainer = m_layerMap[layer];
|
||||
|
||||
@@ -640,16 +671,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
addShape( static_cast<PCB_DIMENSION_BASE*>( item ), layerContainer, item );
|
||||
break;
|
||||
|
||||
case PCB_REFERENCE_IMAGE_T: // ignore
|
||||
break;
|
||||
|
||||
default:
|
||||
wxLogTrace( m_logTrace, wxT( "createLayers: item type: %d not implemented" ), item->Type() );
|
||||
break;
|
||||
}
|
||||
|
||||
// Add copper item to the plated copper polygon list if required
|
||||
if( cfg.DifferentiatePlatedCopper() && IsExternalCopperLayer( layer ) )
|
||||
if( cfg.DifferentiatePlatedCopper() && ( layer == F_Cu || layer == B_Cu ) )
|
||||
{
|
||||
SHAPE_POLY_SET* copperPolys = layer == F_Cu ? m_frontPlatedCopperPolys : m_backPlatedCopperPolys;
|
||||
|
||||
@@ -658,20 +686,19 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
if( item->Type() == PCB_TEXTBOX_T )
|
||||
{
|
||||
PCB_TEXTBOX* text_box = static_cast<PCB_TEXTBOX*>( item );
|
||||
text_box->TransformTextToPolySet( *copperPolys, 0, text_box->GetMaxError(), ERROR_INSIDE );
|
||||
|
||||
text_box->TransformTextToPolySet( *copperPolys, 0, maxError, ERROR_INSIDE );
|
||||
// Add box outlines
|
||||
text_box->PCB_SHAPE::TransformShapeToPolygon( *copperPolys, layer, 0, text_box->GetMaxError(),
|
||||
text_box->PCB_SHAPE::TransformShapeToPolygon( *copperPolys, layer, 0, maxError,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
else if( item->Type() == PCB_TEXT_T )
|
||||
{
|
||||
PCB_TEXT* text = static_cast<PCB_TEXT*>( item );
|
||||
text->TransformTextToPolySet( *copperPolys, 0, text->GetMaxError(), ERROR_INSIDE );
|
||||
text->TransformTextToPolySet( *copperPolys, 0, maxError, ERROR_INSIDE );
|
||||
}
|
||||
else if( item->Type() != PCB_REFERENCE_IMAGE_T )
|
||||
else
|
||||
{
|
||||
item->TransformShapeToPolySet( *copperPolys, layer, 0, item->GetMaxError(), ERROR_INSIDE );
|
||||
item->TransformShapeToPolygon( *copperPolys, layer, 0, maxError, ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,14 +712,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_SHAPE_T:
|
||||
item->TransformShapeToPolySet( *layerPoly, layer, 0, item->GetMaxError(), ERROR_INSIDE );
|
||||
item->TransformShapeToPolygon( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
|
||||
break;
|
||||
|
||||
case PCB_TEXT_T:
|
||||
{
|
||||
PCB_TEXT* text = static_cast<PCB_TEXT*>( item );
|
||||
|
||||
text->TransformTextToPolySet( *layerPoly, 0, text->GetMaxError(), ERROR_INSIDE );
|
||||
text->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -702,11 +729,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
if( textbox->IsBorderEnabled() )
|
||||
{
|
||||
textbox->PCB_SHAPE::TransformShapeToPolygon( *layerPoly, layer, 0, textbox->GetMaxError(),
|
||||
ERROR_INSIDE );
|
||||
textbox->PCB_SHAPE::TransformShapeToPolygon( *layerPoly, layer, 0,
|
||||
maxError, ERROR_INSIDE );
|
||||
}
|
||||
|
||||
textbox->TransformTextToPolySet( *layerPoly, 0, textbox->GetMaxError(), ERROR_INSIDE );
|
||||
textbox->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -715,14 +742,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
PCB_TABLE* table = static_cast<PCB_TABLE*>( item );
|
||||
|
||||
for( PCB_TABLECELL* cell : table->GetCells() )
|
||||
cell->TransformTextToPolySet( *layerPoly, 0, cell->GetMaxError(), ERROR_INSIDE );
|
||||
cell->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
|
||||
|
||||
table->DrawBorders(
|
||||
[&]( const VECTOR2I& ptA, const VECTOR2I& ptB,
|
||||
const STROKE_PARAMS& stroke )
|
||||
{
|
||||
SHAPE_SEGMENT seg( ptA, ptB, stroke.GetWidth() );
|
||||
seg.TransformToPolygon( *layerPoly, table->GetMaxError(), ERROR_INSIDE );
|
||||
seg.TransformToPolygon( *layerPoly, maxError, ERROR_INSIDE );
|
||||
} );
|
||||
break;
|
||||
}
|
||||
@@ -735,17 +762,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
{
|
||||
PCB_DIMENSION_BASE* dimension = static_cast<PCB_DIMENSION_BASE*>( item );
|
||||
|
||||
dimension->TransformTextToPolySet( *layerPoly, 0, dimension->GetMaxError(), ERROR_INSIDE );
|
||||
dimension->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
|
||||
|
||||
for( const std::shared_ptr<SHAPE>& shape : dimension->GetShapes() )
|
||||
shape->TransformToPolygon( *layerPoly, dimension->GetMaxError(), ERROR_INSIDE );
|
||||
shape->TransformToPolygon( *layerPoly, maxError, ERROR_INSIDE );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PCB_REFERENCE_IMAGE_T: // ignore
|
||||
break;
|
||||
|
||||
default:
|
||||
wxLogTrace( m_logTrace, wxT( "createLayers: item type: %d not implemented" ), item->Type() );
|
||||
break;
|
||||
@@ -769,11 +793,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
zones.emplace_back( std::make_pair( zone, layer ) );
|
||||
layer_lock.emplace( layer, std::make_unique<std::mutex>() );
|
||||
|
||||
if( cfg.DifferentiatePlatedCopper() && IsExternalCopperLayer( layer ) )
|
||||
if( cfg.DifferentiatePlatedCopper() && ( layer == F_Cu || layer == B_Cu ) )
|
||||
{
|
||||
SHAPE_POLY_SET* copperPolys = layer == F_Cu ? m_frontPlatedCopperPolys : m_backPlatedCopperPolys;
|
||||
|
||||
zone->TransformShapeToPolygon( *copperPolys, layer, 0, zone->GetMaxError(), ERROR_INSIDE );
|
||||
zone->TransformShapeToPolygon( *copperPolys, layer, 0, maxError, ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -800,19 +824,19 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
PCB_LAYER_ID layer = zones[areaId].second;
|
||||
|
||||
if( m_layerMap.contains( layer ) )
|
||||
addSolidAreasShapes( zone, m_layerMap[layer], layer );
|
||||
auto layerContainer = m_layerMap.find( layer );
|
||||
auto layerPolyContainer = m_layers_poly.find( layer );
|
||||
|
||||
if( layerContainer != m_layerMap.end() )
|
||||
addSolidAreasShapes( zone, layerContainer->second, layer );
|
||||
|
||||
if( cfg.opengl_copper_thickness && cfg.engine == RENDER_ENGINE::OPENGL
|
||||
&& m_layers_poly.contains( layer ) )
|
||||
&& layerPolyContainer != m_layers_poly.end() )
|
||||
{
|
||||
auto mut_it = layer_lock.find( layer );
|
||||
|
||||
if( mut_it != layer_lock.end() )
|
||||
{
|
||||
std::lock_guard< std::mutex > lock( *( mut_it->second ) );
|
||||
zone->TransformSolidAreasShapesToPolygon( layer, *m_layers_poly[layer] );
|
||||
}
|
||||
std::lock_guard< std::mutex > lock( *( mut_it->second ) );
|
||||
zone->TransformSolidAreasShapesToPolygon( layer, *layerPolyContainer->second );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -973,15 +997,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
continue;
|
||||
|
||||
// Only vias on a external copper layer can have a solder mask
|
||||
PCB_LAYER_ID copper_layer = ( layer == F_Mask ) ? F_Cu : B_Cu;
|
||||
PCB_LAYER_ID copper_layer = layer == F_Mask ? F_Cu : B_Cu;
|
||||
|
||||
if( track->Type() == PCB_VIA_T )
|
||||
{
|
||||
const PCB_VIA* via = static_cast<const PCB_VIA*>( track );
|
||||
|
||||
if( !via->FlashLayer( copper_layer ) )
|
||||
continue;
|
||||
}
|
||||
if( track->Type() == PCB_VIA_T
|
||||
&& !static_cast<const PCB_VIA*>( track )->FlashLayer( copper_layer ) )
|
||||
continue;
|
||||
|
||||
int maskExpansion = track->GetSolderMaskExpansion();
|
||||
createTrackWithMargin( track, layerContainer, layer, maskExpansion );
|
||||
@@ -1036,14 +1056,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_SHAPE_T:
|
||||
item->TransformShapeToPolySet( *layerPoly, layer, 0, item->GetMaxError(), ERROR_INSIDE );
|
||||
item->TransformShapeToPolygon( *layerPoly, layer, 0, maxError, ERROR_INSIDE );
|
||||
break;
|
||||
|
||||
case PCB_TEXT_T:
|
||||
{
|
||||
PCB_TEXT* text = static_cast<PCB_TEXT*>( item );
|
||||
|
||||
text->TransformTextToPolySet( *layerPoly, 0, text->GetMaxError(), ERROR_INSIDE );
|
||||
text->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1053,11 +1073,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
if( textbox->IsBorderEnabled() )
|
||||
{
|
||||
textbox->PCB_SHAPE::TransformShapeToPolygon( *layerPoly, layer, 0, textbox->GetMaxError(),
|
||||
ERROR_INSIDE );
|
||||
textbox->PCB_SHAPE::TransformShapeToPolygon( *layerPoly, layer, 0,
|
||||
maxError, ERROR_INSIDE );
|
||||
}
|
||||
|
||||
textbox->TransformTextToPolySet( *layerPoly, 0, textbox->GetMaxError(), ERROR_INSIDE );
|
||||
textbox->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1066,14 +1086,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
PCB_TABLE* table = static_cast<PCB_TABLE*>( item );
|
||||
|
||||
for( PCB_TABLECELL* cell : table->GetCells() )
|
||||
cell->TransformTextToPolySet( *layerPoly, 0, cell->GetMaxError(), ERROR_INSIDE );
|
||||
cell->TransformTextToPolySet( *layerPoly, 0, maxError, ERROR_INSIDE );
|
||||
|
||||
table->DrawBorders(
|
||||
[&]( const VECTOR2I& ptA, const VECTOR2I& ptB,
|
||||
const STROKE_PARAMS& stroke )
|
||||
{
|
||||
SHAPE_SEGMENT seg( ptA, ptB, stroke.GetWidth() );
|
||||
seg.TransformToPolygon( *layerPoly, table->GetMaxError(), ERROR_INSIDE );
|
||||
seg.TransformToPolygon( *layerPoly, maxError, ERROR_INSIDE );
|
||||
} );
|
||||
|
||||
break;
|
||||
@@ -1097,7 +1117,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
if( via->FlashLayer( layer ) && !via->IsTented( layer ) )
|
||||
{
|
||||
track->TransformShapeToPolygon( *layerPoly, layer, maskExpansion, track->GetMaxError(),
|
||||
track->TransformShapeToPolygon( *layerPoly, layer, maskExpansion, maxError,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
@@ -1105,7 +1125,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
{
|
||||
if( track->HasSolderMask() )
|
||||
{
|
||||
track->TransformShapeToPolySet( *layerPoly, layer, maskExpansion, track->GetMaxError(),
|
||||
track->TransformShapeToPolygon( *layerPoly, layer, maskExpansion, maxError,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
@@ -1123,19 +1143,21 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
{
|
||||
if( pad->IsOnLayer( layer ) )
|
||||
{
|
||||
buildPadOutlineAsPolygon( pad, layer, *layerPoly, linewidth, pad->GetMaxError(),
|
||||
buildPadOutlineAsPolygon( pad, layer, *layerPoly, linewidth, maxError,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
footprint->TransformPadsToPolySet( *layerPoly, layer, 0, footprint->GetMaxError(), ERROR_INSIDE );
|
||||
footprint->TransformPadsToPolySet( *layerPoly, layer, 0, maxError,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
|
||||
transformFPTextToPolySet( footprint, layer, visibilityFlags, *layerPoly, footprint->GetMaxError(),
|
||||
transformFPTextToPolySet( footprint, layer, visibilityFlags, *layerPoly, maxError,
|
||||
ERROR_INSIDE );
|
||||
transformFPShapesToPolySet( footprint, layer, *layerPoly, footprint->GetMaxError(), ERROR_INSIDE );
|
||||
transformFPShapesToPolySet( footprint, layer, *layerPoly, maxError,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
|
||||
if( cfg.show_zones || layer == F_Mask || layer == B_Mask )
|
||||
@@ -1185,25 +1207,29 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
aStatusReporter->Report( _( "Calculating plated copper" ) );
|
||||
|
||||
// TRIM PLATED COPPER TO SOLDERMASK
|
||||
if( m_layers_poly.contains( F_Mask ) )
|
||||
if( m_layers_poly.find( F_Mask ) != m_layers_poly.end() )
|
||||
{
|
||||
m_frontPlatedCopperPolys->BooleanIntersection( *m_layers_poly.at( F_Mask ) );
|
||||
}
|
||||
|
||||
if( m_layers_poly.contains( B_Mask ))
|
||||
if( m_layers_poly.find( B_Mask ) != m_layers_poly.end() )
|
||||
{
|
||||
m_backPlatedCopperPolys->BooleanIntersection( *m_layers_poly.at( B_Mask ) );
|
||||
}
|
||||
|
||||
// Subtract plated copper from unplated copper
|
||||
if( m_layers_poly.contains( F_Cu ) )
|
||||
if( m_layers_poly.find( F_Cu ) != m_layers_poly.end() )
|
||||
m_layers_poly[F_Cu]->BooleanSubtract( *m_frontPlatedCopperPolys );
|
||||
|
||||
if( m_layers_poly.contains( B_Cu ) )
|
||||
if( m_layers_poly.find( B_Cu ) != m_layers_poly.end() )
|
||||
m_layers_poly[B_Cu]->BooleanSubtract( *m_backPlatedCopperPolys );
|
||||
|
||||
// ADD PLATED COPPER
|
||||
ConvertPolygonToTriangles( *m_frontPlatedCopperPolys, *m_platedPadsFront, m_biuTo3Dunits,
|
||||
*DELETED_BOARD_ITEM::GetInstance() );
|
||||
*m_board->GetItem( niluuid ) );
|
||||
|
||||
ConvertPolygonToTriangles( *m_backPlatedCopperPolys, *m_platedPadsBack, m_biuTo3Dunits,
|
||||
*DELETED_BOARD_ITEM::GetInstance() );
|
||||
*m_board->GetItem( niluuid ) );
|
||||
|
||||
m_platedPadsFront->BuildBVH();
|
||||
m_platedPadsBack->BuildBVH();
|
||||
@@ -1252,11 +1278,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
i < selected_layer_id.size();
|
||||
i = nextItem.fetch_add( 1 ) )
|
||||
{
|
||||
if( m_layers_poly.contains( selected_layer_id[i] ) )
|
||||
auto layerPoly = m_layers_poly.find( selected_layer_id[i] );
|
||||
|
||||
if( layerPoly != m_layers_poly.end() )
|
||||
{
|
||||
// This will make a union of all added contours
|
||||
m_layers_poly[ selected_layer_id[i] ]->ClearArcs();
|
||||
m_layers_poly[ selected_layer_id[i] ]->Simplify();
|
||||
layerPoly->second->ClearArcs();
|
||||
layerPoly->second->Simplify();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1277,13 +1305,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
for( PCB_LAYER_ID layer : layer_ids )
|
||||
{
|
||||
if( m_layerHoleOdPolys.contains( layer ) )
|
||||
if( m_layerHoleOdPolys.find( layer ) != m_layerHoleOdPolys.end() )
|
||||
{
|
||||
// found
|
||||
SHAPE_POLY_SET *polyLayer = m_layerHoleOdPolys[layer];
|
||||
polyLayer->Simplify();
|
||||
|
||||
wxASSERT( m_layerHoleIdPolys.contains( layer ) );
|
||||
wxASSERT( m_layerHoleIdPolys.find( layer ) != m_layerHoleIdPolys.end() );
|
||||
|
||||
polyLayer = m_layerHoleIdPolys[layer];
|
||||
polyLayer->Simplify();
|
||||
|
||||
@@ -583,19 +583,6 @@ void EDA_3D_CANVAS::DoRePaint()
|
||||
Request_refresh( false );
|
||||
}
|
||||
|
||||
static constexpr std::array<VIEW3D_TYPE, static_cast<int>( SPHERES_GIZMO::GizmoSphereSelection::Count )>
|
||||
viewTable = { VIEW3D_TYPE::VIEW3D_RIGHT, VIEW3D_TYPE::VIEW3D_LEFT, VIEW3D_TYPE::VIEW3D_BACK,
|
||||
VIEW3D_TYPE::VIEW3D_FRONT, VIEW3D_TYPE::VIEW3D_TOP, VIEW3D_TYPE::VIEW3D_BOTTOM };
|
||||
|
||||
SPHERES_GIZMO::GizmoSphereSelection selectedGizmoSphere = m_3d_render_opengl->getSelectedGizmoSphere();
|
||||
int index = static_cast<int>( selectedGizmoSphere );
|
||||
if( index >= 0 && index < static_cast<int>( viewTable.size() ) )
|
||||
{
|
||||
SetView3D( viewTable[index] );
|
||||
}
|
||||
|
||||
m_3d_render_opengl->resetSelectedGizmoSphere();
|
||||
|
||||
m_is_currently_painting.clear();
|
||||
}
|
||||
|
||||
@@ -872,22 +859,6 @@ void EDA_3D_CANVAS::OnLeftUp( wxMouseEvent& event )
|
||||
m_mouse_is_moving = false;
|
||||
restart_editingTimeOut_Timer();
|
||||
}
|
||||
|
||||
wxSize logicalSize = GetClientSize();
|
||||
int logicalW = logicalSize.GetWidth();
|
||||
int logicalH = logicalSize.GetHeight();
|
||||
|
||||
int gizmo_x, gizmo_y, gizmo_width, gizmo_height;
|
||||
std::tie( gizmo_x, gizmo_y, gizmo_width, gizmo_height ) = m_3d_render_opengl->getGizmoViewport();
|
||||
|
||||
float scaleX = static_cast<float>( gizmo_width ) / logicalW;
|
||||
float scaleY = static_cast<float>( gizmo_height ) / logicalH;
|
||||
|
||||
int scaledMouseX = static_cast<int>( event.GetX() * scaleX );
|
||||
int scaledMouseY = static_cast<int>( ( logicalH - event.GetY() ) * scaleY );
|
||||
|
||||
m_3d_render_opengl->handleGizmoMouseInput( scaledMouseX, scaledMouseY );
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -1124,14 +1095,14 @@ bool EDA_3D_CANVAS::SetView3D( VIEW3D_TYPE aRequestedView )
|
||||
|
||||
void EDA_3D_CANVAS::RenderEngineChanged()
|
||||
{
|
||||
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
switch( cfg->m_Render.engine )
|
||||
{
|
||||
switch( cfg->m_Render.engine )
|
||||
{
|
||||
case RENDER_ENGINE::OPENGL: m_3d_render = m_3d_render_opengl; break;
|
||||
case RENDER_ENGINE::RAYTRACING: m_3d_render = m_3d_render_raytracing; break;
|
||||
default: m_3d_render = nullptr; break;
|
||||
}
|
||||
case RENDER_ENGINE::OPENGL: m_3d_render = m_3d_render_opengl; break;
|
||||
case RENDER_ENGINE::RAYTRACING: m_3d_render = m_3d_render_raytracing; break;
|
||||
default: m_3d_render = nullptr; break;
|
||||
}
|
||||
|
||||
if( m_3d_render )
|
||||
|
||||
@@ -1,368 +0,0 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright 2025, Damjan Prerad <damjanovmail@gmail.com>
|
||||
* Copyright (C) The KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <gal/opengl/kiglew.h> // Must be included first
|
||||
#include <glm/geometric.hpp>
|
||||
|
||||
#include "3d_spheres_gizmo.h"
|
||||
|
||||
|
||||
SPHERES_GIZMO::~SPHERES_GIZMO()
|
||||
{
|
||||
if( m_quadric )
|
||||
{
|
||||
gluDeleteQuadric( m_quadric );
|
||||
m_quadric = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SPHERES_GIZMO::SPHERES_GIZMO( int aGizmoPosX, int aGizmoPosY )
|
||||
{
|
||||
m_gizmoPosX = aGizmoPosX;
|
||||
m_gizmoPosY = aGizmoPosY;
|
||||
|
||||
m_quadric = gluNewQuadric();
|
||||
gluQuadricNormals( m_quadric, GLU_SMOOTH );
|
||||
}
|
||||
|
||||
|
||||
void SPHERES_GIZMO::setViewport( int ax, int ay, int aWidth, int aHeight )
|
||||
{
|
||||
m_viewportX = ax;
|
||||
m_viewportY = ay;
|
||||
m_viewportW = aWidth;
|
||||
m_viewportH = aHeight;
|
||||
}
|
||||
|
||||
|
||||
std::tuple<int, int, int, int> SPHERES_GIZMO::getViewport() const
|
||||
{
|
||||
return std::make_tuple( m_viewportX, m_viewportY, m_viewportW, m_viewportH );
|
||||
}
|
||||
|
||||
|
||||
void SPHERES_GIZMO::setGizmoPosition( int ax, int ay )
|
||||
{
|
||||
m_gizmoPosX = ax;
|
||||
m_gizmoPosY = ay;
|
||||
}
|
||||
|
||||
|
||||
void SPHERES_GIZMO::setGizmoMaterial()
|
||||
{
|
||||
glEnable( GL_COLOR_MATERIAL );
|
||||
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
|
||||
|
||||
const SFVEC4F ambient = SFVEC4F( 0.0f, 0.0f, 0.0f, 1.0f );
|
||||
const SFVEC4F diffuse = SFVEC4F( 0.0f, 0.0f, 0.0f, 1.0f );
|
||||
const SFVEC4F emissive = SFVEC4F( 0.0f, 0.0f, 0.0f, 1.0f );
|
||||
const SFVEC4F specular = SFVEC4F( 0.1f, 0.1f, 0.1f, 1.0f );
|
||||
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, &specular.r );
|
||||
glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS, 96.0f );
|
||||
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, &ambient.r );
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, &diffuse.r );
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, &emissive.r );
|
||||
}
|
||||
|
||||
void SPHERES_GIZMO::handleMouseInput( int aMouseX, int aMouseY )
|
||||
{
|
||||
int smallViewportW = m_viewportH / 8;
|
||||
int smallViewportH = m_viewportH / 8;
|
||||
|
||||
bool inside = ( aMouseX >= m_gizmoPosX && aMouseX <= m_gizmoPosX + smallViewportW && aMouseY >= m_gizmoPosY
|
||||
&& aMouseY <= m_gizmoPosY + smallViewportH );
|
||||
|
||||
if( inside )
|
||||
{
|
||||
m_ndcX = 2.0f * static_cast<float>( aMouseX - m_gizmoPosX ) / smallViewportW - 1.0f;
|
||||
m_ndcY = 2.0f * static_cast<float>( aMouseY - m_gizmoPosY ) / smallViewportH - 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ndcX = -1.0f;
|
||||
m_ndcY = -1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SPHERES_GIZMO::render3dSpheresGizmo( glm::mat4 aCameraRotationMatrix )
|
||||
{
|
||||
float fov = 60.0f;
|
||||
|
||||
glDisable( GL_CULL_FACE );
|
||||
|
||||
// Set up a square viewport (Y x Y)
|
||||
glViewport( m_gizmoPosX, m_gizmoPosY, m_viewportH / 8, m_viewportH / 8 );
|
||||
glClear( GL_DEPTH_BUFFER_BIT );
|
||||
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
|
||||
gluPerspective( fov, 1.0f, 0.001f, 2.0f * RANGE_SCALE_3D );
|
||||
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
|
||||
glm::mat4 TranslationMatrix = glm::translate( glm::mat4( 1.0f ), SFVEC3F( 0.0f, 0.0f, -( m_arrowSize * 2.75f ) ) );
|
||||
glm::mat4 ViewMatrix = TranslationMatrix * aCameraRotationMatrix;
|
||||
glLoadMatrixf( glm::value_ptr( ViewMatrix ) );
|
||||
|
||||
setGizmoMaterial();
|
||||
|
||||
// Intersection test
|
||||
glm::mat4 proj = glm::perspective( glm::radians( fov ), 1.0f, 0.001f, 2.0f * RANGE_SCALE_3D );
|
||||
glm::mat4 invVP = glm::inverse( proj * ViewMatrix );
|
||||
|
||||
glm::vec4 rayStartNDC( m_ndcX, m_ndcY, -1.0f, 1.0f );
|
||||
glm::vec4 rayEndNDC( m_ndcX, m_ndcY, 1.0f, 1.0f );
|
||||
|
||||
glm::vec4 rayStartWorld = invVP * rayStartNDC;
|
||||
rayStartWorld /= rayStartWorld.w;
|
||||
|
||||
glm::vec4 rayEndWorld = invVP * rayEndNDC;
|
||||
rayEndWorld /= rayEndWorld.w;
|
||||
|
||||
glm::vec3 rayOrigin = glm::vec3( rayStartWorld );
|
||||
glm::vec3 rayDirection = glm::normalize( glm::vec3( rayEndWorld - rayStartWorld ) );
|
||||
|
||||
auto intersects =
|
||||
[]( const glm::vec3& aRayOrigin, const glm::vec3& aRayDir, const glm::vec3& aSphereCenter, float aRadius )
|
||||
{
|
||||
glm::vec3 L = aSphereCenter - aRayOrigin;
|
||||
float tca = glm::dot( L, aRayDir );
|
||||
float d2 = glm::dot( L, L ) - tca * tca;
|
||||
return d2 <= aRadius * aRadius;
|
||||
};
|
||||
|
||||
int clickedIndex = -1;
|
||||
m_selectedGizmoSphere = GizmoSphereSelection::None;
|
||||
for( size_t i = 0; i < m_spheres.size(); ++i )
|
||||
{
|
||||
const auto& sphere = m_spheres[i];
|
||||
if( intersects( rayOrigin, rayDirection, sphere.m_position, sphere.m_radius ) )
|
||||
{
|
||||
clickedIndex = static_cast<int>( i );
|
||||
|
||||
m_selectedGizmoSphere = static_cast<GizmoSphereSelection>( i );
|
||||
break; // only pick the first intersected sphere
|
||||
}
|
||||
}
|
||||
|
||||
// Update colors
|
||||
for( size_t i = 0; i < m_spheres.size(); ++i )
|
||||
{
|
||||
if( static_cast<int>( i ) == clickedIndex )
|
||||
{
|
||||
m_spheres[i].m_color = { 1.0f, 1.0f, 1.0f }; // White
|
||||
}
|
||||
else
|
||||
{
|
||||
m_spheres[i].m_color = m_spheres[i].m_originalColor; // Restore default
|
||||
}
|
||||
}
|
||||
|
||||
// Intersection test done
|
||||
|
||||
auto drawBillboardCircle = []( const glm::vec3& aCenter, float aRadius, const glm::vec3& aColor,
|
||||
const glm::vec3& aCamRight, const glm::vec3& aCamUp, int aSegments = 64 )
|
||||
{
|
||||
float thickness = aRadius * 0.4f;
|
||||
glColor3f( aColor.r, aColor.g, aColor.b );
|
||||
|
||||
glBegin( GL_TRIANGLE_STRIP );
|
||||
for( int i = 0; i <= aSegments; ++i )
|
||||
{
|
||||
float angle = 2.0f * glm::pi<float>() * i / aSegments;
|
||||
glm::vec3 dir = cos( angle ) * aCamRight + sin( angle ) * aCamUp;
|
||||
|
||||
glm::vec3 outer = aCenter + dir * ( aRadius + thickness * 0.5f );
|
||||
glm::vec3 inner = aCenter + dir * ( aRadius - thickness * 0.5f );
|
||||
|
||||
glVertex3f( outer.x, outer.y, outer.z );
|
||||
glVertex3f( inner.x, inner.y, inner.z );
|
||||
}
|
||||
glEnd();
|
||||
};
|
||||
|
||||
glm::vec3 camRight( aCameraRotationMatrix[0][0], aCameraRotationMatrix[1][0], aCameraRotationMatrix[2][0] );
|
||||
glm::vec3 camUp( aCameraRotationMatrix[0][1], aCameraRotationMatrix[1][1], aCameraRotationMatrix[2][1] );
|
||||
|
||||
glEnable( GL_BLEND );
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||
|
||||
for( const auto& sphere : m_spheres )
|
||||
{
|
||||
glColor4f( sphere.m_color.r, sphere.m_color.g, sphere.m_color.b, 0.3f );
|
||||
glPushMatrix();
|
||||
glTranslatef( sphere.m_position.x, sphere.m_position.y, sphere.m_position.z );
|
||||
if( m_quadric )
|
||||
{
|
||||
gluSphere( m_quadric, sphere.m_radius, 32, 32 );
|
||||
}
|
||||
glPopMatrix();
|
||||
|
||||
drawBillboardCircle( sphere.m_position, sphere.m_radius, sphere.m_color, camRight, camUp );
|
||||
}
|
||||
|
||||
// Draw sphere labels
|
||||
|
||||
glDisable( GL_DEPTH_TEST );
|
||||
glDisable( GL_LIGHTING );
|
||||
|
||||
std::array<std::string, 6> labels = { "X", "", "Y", "", "Z", "" };
|
||||
|
||||
// View direction (camera looks along negative Z in view space)
|
||||
// So we offset a little toward the camera to avoid z-fighting
|
||||
glm::vec3 offset = glm::normalize( -rayDirection ) * 0.02f;
|
||||
|
||||
glColor4f( 0.0f, 0.0f, 0.0f, 1.0f );
|
||||
|
||||
auto drawX = []( const glm::vec3& aPos, float aSize, const glm::vec3& aColor, const glm::vec3& aCamRight,
|
||||
const glm::vec3& aCamUp )
|
||||
{
|
||||
glColor3f( aColor.r, aColor.g, aColor.b );
|
||||
glLineWidth( 3.0f );
|
||||
|
||||
float h = aSize * 0.5f;
|
||||
|
||||
// Define two diagonal line directions in camera-facing plane
|
||||
glm::vec3 dir1 = ( -aCamRight + aCamUp ) * h; // one diagonal
|
||||
glm::vec3 dir2 = ( -aCamRight - aCamUp ) * h; // other diagonal
|
||||
|
||||
glBegin( GL_LINES );
|
||||
glVertex3f( ( aPos - dir1 ).x, ( aPos - dir1 ).y, ( aPos - dir1 ).z );
|
||||
glVertex3f( ( aPos + dir1 ).x, ( aPos + dir1 ).y, ( aPos + dir1 ).z );
|
||||
|
||||
glVertex3f( ( aPos - dir2 ).x, ( aPos - dir2 ).y, ( aPos - dir2 ).z );
|
||||
glVertex3f( ( aPos + dir2 ).x, ( aPos + dir2 ).y, ( aPos + dir2 ).z );
|
||||
glEnd();
|
||||
};
|
||||
|
||||
auto drawY = []( const glm::vec3& aPos, float aSize, const glm::vec3& aColor, const glm::vec3& aCamRight,
|
||||
const glm::vec3& aCamUp )
|
||||
{
|
||||
glColor3f( aColor.r, aColor.g, aColor.b );
|
||||
glLineWidth( 3.0f );
|
||||
|
||||
float h = aSize * 0.5f;
|
||||
|
||||
// Top-left and top-right in screen plane
|
||||
glm::vec3 topLeft = aPos + aCamUp * h - aCamRight * h;
|
||||
glm::vec3 topRight = aPos + aCamUp * h + aCamRight * h;
|
||||
glm::vec3 bottom = aPos - aCamUp * h;
|
||||
|
||||
glBegin( GL_LINES );
|
||||
glVertex3f( topLeft.x, topLeft.y, topLeft.z );
|
||||
glVertex3f( aPos.x, aPos.y, aPos.z );
|
||||
|
||||
glVertex3f( topRight.x, topRight.y, topRight.z );
|
||||
glVertex3f( aPos.x, aPos.y, aPos.z );
|
||||
|
||||
glVertex3f( aPos.x, aPos.y, aPos.z );
|
||||
glVertex3f( bottom.x, bottom.y, bottom.z );
|
||||
glEnd();
|
||||
};
|
||||
|
||||
auto drawZ = []( const glm::vec3& aPos, float aSize, const glm::vec3& aColor, const glm::vec3& aCamRight,
|
||||
const glm::vec3& aCamUp )
|
||||
{
|
||||
glColor3f( aColor.r, aColor.g, aColor.b );
|
||||
glLineWidth( 3.0f );
|
||||
|
||||
float h = aSize * 0.5f;
|
||||
|
||||
// Define corners in screen plane relative to camera
|
||||
glm::vec3 topLeft = aPos + aCamUp * h - aCamRight * h;
|
||||
glm::vec3 topRight = aPos + aCamUp * h + aCamRight * h;
|
||||
glm::vec3 bottomLeft = aPos - aCamUp * h - aCamRight * h;
|
||||
glm::vec3 bottomRight = aPos - aCamUp * h + aCamRight * h;
|
||||
|
||||
glBegin( GL_LINE_STRIP );
|
||||
glVertex3f( topLeft.x, topLeft.y, topLeft.z );
|
||||
glVertex3f( topRight.x, topRight.y, topRight.z );
|
||||
glVertex3f( bottomLeft.x, bottomLeft.y, bottomLeft.z );
|
||||
glVertex3f( bottomRight.x, bottomRight.y, bottomRight.z );
|
||||
glEnd();
|
||||
};
|
||||
|
||||
for( size_t i = 0; i < m_spheres.size(); ++i )
|
||||
{
|
||||
if( labels[i].empty() )
|
||||
continue;
|
||||
|
||||
glm::vec3 textPos = m_spheres[i].m_position + offset;
|
||||
const std::string& label = labels[i];
|
||||
|
||||
if( label == "X" )
|
||||
{
|
||||
drawX( textPos, 0.30f, glm::vec3( 0.0f ), camRight, camUp );
|
||||
}
|
||||
else if( label == "Y" )
|
||||
{
|
||||
drawY( textPos, 0.30f, glm::vec3( 0.0f ), camRight, camUp );
|
||||
}
|
||||
else if( label == "Z" )
|
||||
{
|
||||
drawZ( textPos, 0.30f, glm::vec3( 0.0f ), camRight, camUp );
|
||||
}
|
||||
}
|
||||
|
||||
glEnable( GL_LIGHTING );
|
||||
glEnable( GL_DEPTH_TEST );
|
||||
|
||||
// Draw lines only to the positive axis spheres
|
||||
glLineWidth( 2.0f );
|
||||
glBegin( GL_LINES );
|
||||
|
||||
glColor3f( 0.9f, 0.0f, 0.0f ); // X+
|
||||
glVertex3f( 0.0f, 0.0f, 0.0f );
|
||||
glVertex3f( m_arrowSize, 0.0f, 0.0f );
|
||||
|
||||
glColor3f( 0.0f, 0.9f, 0.0f ); // Y+
|
||||
glVertex3f( 0.0f, 0.0f, 0.0f );
|
||||
glVertex3f( 0.0f, m_arrowSize, 0.0f );
|
||||
|
||||
glColor3f( 0.0f, 0.0f, 0.9f ); // Z+
|
||||
glVertex3f( 0.0f, 0.0f, 0.0f );
|
||||
glVertex3f( 0.0f, 0.0f, m_arrowSize );
|
||||
|
||||
glEnd();
|
||||
|
||||
glEnable( GL_CULL_FACE );
|
||||
}
|
||||
|
||||
SPHERES_GIZMO::GizmoSphereSelection SPHERES_GIZMO::getSelectedGizmoSphere() const
|
||||
{
|
||||
return m_selectedGizmoSphere;
|
||||
}
|
||||
|
||||
void SPHERES_GIZMO::resetSelectedGizmoSphere()
|
||||
{
|
||||
m_selectedGizmoSphere = GizmoSphereSelection::None;
|
||||
m_ndcX = -1.0f;
|
||||
m_ndcY = -1.0f;
|
||||
}
|
||||
@@ -1,133 +0,0 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright 2025, Damjan Prerad <damjanovmail@gmail.com>
|
||||
* Copyright (C) The KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef _3D_SPHERES_GIZMO_H_
|
||||
#define _3D_SPHERES_GIZMO_H_
|
||||
|
||||
#include "../render_3d_base.h"
|
||||
|
||||
/**
|
||||
* @class SPHERES_GIZMO
|
||||
* @brief Renders a set of colored spheres in 3D space that act as a directional orientation gizmo.
|
||||
*/
|
||||
class SPHERES_GIZMO
|
||||
{
|
||||
public:
|
||||
SPHERES_GIZMO( int aGizmoPosX, int aGizmoPosY );
|
||||
~SPHERES_GIZMO();
|
||||
|
||||
void setViewport( int ax, int ay, int aWidth, int aHeight );
|
||||
std::tuple<int, int, int, int> getViewport() const;
|
||||
void setGizmoPosition( int ax, int ay );
|
||||
|
||||
void handleMouseInput( int aMouseX, int aMouseY );
|
||||
|
||||
/**
|
||||
* @enum GizmoSphereSelection
|
||||
* @brief Enum to indicate which sphere (direction) is selected.
|
||||
*/
|
||||
enum class GizmoSphereSelection
|
||||
{
|
||||
None = -1, ///< No sphere selected.
|
||||
Right = 0, ///< +X direction.
|
||||
Left, ///< -X direction.
|
||||
Back, ///< +Y direction.
|
||||
Front, ///< -Y direction.
|
||||
Top, ///< +Z direction.
|
||||
Bottom, ///< -Z direction.
|
||||
Count ///< Number of selectable spheres.
|
||||
};
|
||||
|
||||
GizmoSphereSelection getSelectedGizmoSphere() const;
|
||||
void resetSelectedGizmoSphere();
|
||||
void render3dSpheresGizmo( glm::mat4 aCameraRotationMatrix );
|
||||
|
||||
private:
|
||||
void setGizmoMaterial();
|
||||
|
||||
GLUquadric* m_quadric = nullptr;
|
||||
|
||||
int m_gizmoPosX = 0;
|
||||
int m_gizmoPosY = 0;
|
||||
|
||||
int m_viewportX = 0;
|
||||
int m_viewportY = 0;
|
||||
int m_viewportW = 0;
|
||||
int m_viewportH = 0;
|
||||
|
||||
float m_ndcX = -1.0f;
|
||||
float m_ndcY = -1.0f;
|
||||
|
||||
struct GizmoSphere
|
||||
{
|
||||
glm::vec3 m_position;
|
||||
float m_radius;
|
||||
glm::vec3 m_labelPosition;
|
||||
glm::vec3 m_color;
|
||||
glm::vec3 m_originalColor;
|
||||
};
|
||||
|
||||
// Define sphere positions
|
||||
const float m_arrowSize = RANGE_SCALE_3D * 0.20f;
|
||||
const float m_sphereRadius = 0.05f * RANGE_SCALE_3D;
|
||||
|
||||
/**
|
||||
* @brief List of all directional gizmo spheres.
|
||||
* The order follows the GizmoSphereSelection enum.
|
||||
*/
|
||||
std::array<GizmoSphere, 6> m_spheres = { { { { m_arrowSize, 0.0f, 0.0f },
|
||||
m_sphereRadius,
|
||||
{ m_arrowSize + 0.02f, 0.0f, 0.0f },
|
||||
{ 0.9f, 0.0f, 0.0f },
|
||||
{ 0.9f, 0.0f, 0.0f } },
|
||||
{ { -m_arrowSize, 0.0f, 0.0f },
|
||||
m_sphereRadius,
|
||||
{ -m_arrowSize - 0.02f, 0.0f, 0.0f },
|
||||
{ 0.4f, 0.0f, 0.0f },
|
||||
{ 0.4f, 0.0f, 0.0f } },
|
||||
{ { 0.0f, m_arrowSize, 0.0f },
|
||||
m_sphereRadius,
|
||||
{ 0.0f, m_arrowSize + 0.02f, 0.0f },
|
||||
{ 0.0f, 0.9f, 0.0f },
|
||||
{ 0.0f, 0.9f, 0.0f } },
|
||||
{ { 0.0f, -m_arrowSize, 0.0f },
|
||||
m_sphereRadius,
|
||||
{ 0.0f, -m_arrowSize - 0.02f, 0.0f },
|
||||
{ 0.0f, 0.4f, 0.0f },
|
||||
{ 0.0f, 0.4f, 0.0f } },
|
||||
{ { 0.0f, 0.0f, m_arrowSize },
|
||||
m_sphereRadius,
|
||||
{ 0.0f, 0.0f, m_arrowSize + 0.02f },
|
||||
{ 0.0f, 0.0f, 0.9f },
|
||||
{ 0.0f, 0.0f, 0.9f } },
|
||||
{ { 0.0f, 0.0f, -m_arrowSize },
|
||||
m_sphereRadius,
|
||||
{ 0.0f, 0.0f, -m_arrowSize - 0.02f },
|
||||
{ 0.0f, 0.0f, 0.4f },
|
||||
{ 0.0f, 0.0f, 0.4f } } } };
|
||||
|
||||
GizmoSphereSelection m_selectedGizmoSphere = GizmoSphereSelection::None;
|
||||
};
|
||||
|
||||
#endif // _3D_SPHERES_GIZMO_H_
|
||||
@@ -481,8 +481,9 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
|
||||
|
||||
SHAPE_POLY_SET board_poly_with_holes = m_boardAdapter.GetBoardPoly().CloneDropTriangulation();
|
||||
board_poly_with_holes.BooleanSubtract( m_boardAdapter.GetTH_ODPolys() );
|
||||
board_poly_with_holes.BooleanSubtract( m_boardAdapter.GetNPTH_ODPolys() );
|
||||
|
||||
m_boardWithHoles = createBoard( board_poly_with_holes, &m_boardAdapter.GetTH_IDs() );
|
||||
m_boardWithHoles = createBoard( board_poly_with_holes );
|
||||
|
||||
if( m_antiBoard )
|
||||
m_antiBoard->SetItIsTransparent( true );
|
||||
@@ -566,7 +567,7 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
|
||||
|
||||
if( m_boardAdapter.m_Cfg->m_Render.opengl_copper_thickness )
|
||||
{
|
||||
if( map_poly.contains( layer ) )
|
||||
if( map_poly.find( layer ) != map_poly.end() )
|
||||
{
|
||||
polyListSubtracted = *map_poly.at( layer );
|
||||
|
||||
@@ -583,11 +584,11 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
|
||||
|
||||
if( m_boardAdapter.m_Cfg->m_Render.subtract_mask_from_silk )
|
||||
{
|
||||
if( layer == B_SilkS && map_poly.contains( B_Mask ) )
|
||||
if( layer == B_SilkS && map_poly.find( B_Mask ) != map_poly.end() )
|
||||
{
|
||||
polyListSubtracted.BooleanSubtract( *map_poly.at( B_Mask ) );
|
||||
}
|
||||
else if( layer == F_SilkS && map_poly.contains( F_Mask ) )
|
||||
else if( layer == F_SilkS && map_poly.find( F_Mask ) != map_poly.end() )
|
||||
{
|
||||
polyListSubtracted.BooleanSubtract( *map_poly.at( F_Mask ) );
|
||||
}
|
||||
@@ -771,12 +772,13 @@ void RENDER_3D_OPENGL::generateViasAndPads()
|
||||
|
||||
wxASSERT( zbot < ztop );
|
||||
|
||||
generateCylinder( via_center, hole_inner_radius, hole_inner_radius + platingThickness3d,
|
||||
generateCylinder( via_center, hole_inner_radius,
|
||||
hole_inner_radius + platingThickness3d,
|
||||
ztop, zbot, nrSegments, layerTriangleVIA );
|
||||
}
|
||||
}
|
||||
|
||||
m_microviaHoles = new OPENGL_RENDER_LIST( *layerTriangleVIA, 0, 0.0f, 0.0f );
|
||||
m_vias = new OPENGL_RENDER_LIST( *layerTriangleVIA, 0, 0.0f, 0.0f );
|
||||
|
||||
delete layerTriangleVIA;
|
||||
}
|
||||
@@ -801,10 +803,10 @@ void RENDER_3D_OPENGL::generateViasAndPads()
|
||||
{
|
||||
TransformCircleToPolygon( tht_outer_holes_poly, via->GetPosition(),
|
||||
via->GetDrill() / 2 + platingThickness,
|
||||
via->GetMaxError(), ERROR_INSIDE );
|
||||
ARC_HIGH_DEF, ERROR_INSIDE );
|
||||
|
||||
TransformCircleToPolygon( tht_inner_holes_poly, via->GetPosition(), via->GetDrill() / 2,
|
||||
via->GetMaxError(), ERROR_INSIDE );
|
||||
TransformCircleToPolygon( tht_inner_holes_poly, via->GetPosition(),
|
||||
via->GetDrill() / 2, ARC_HIGH_DEF, ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -823,9 +825,9 @@ void RENDER_3D_OPENGL::generateViasAndPads()
|
||||
continue;
|
||||
|
||||
pad->TransformHoleToPolygon( tht_outer_holes_poly, platingThickness,
|
||||
pad->GetMaxError(), ERROR_INSIDE );
|
||||
pad->TransformHoleToPolygon( tht_inner_holes_poly, 0,
|
||||
pad->GetMaxError(), ERROR_INSIDE );
|
||||
ARC_HIGH_DEF, ERROR_INSIDE );
|
||||
pad->TransformHoleToPolygon( tht_inner_holes_poly, 0, ARC_HIGH_DEF,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -960,7 +962,7 @@ void RENDER_3D_OPENGL::load3dModels( REPORTER* aStatusReporter )
|
||||
|
||||
// Check if the fp_model is not present in our cache map
|
||||
// (Not already loaded in memory)
|
||||
if( !m_3dModelMap.contains( fp_model.m_Filename ) )
|
||||
if( m_3dModelMap.find( fp_model.m_Filename ) == m_3dModelMap.end() )
|
||||
{
|
||||
// It is not present, try get it from cache
|
||||
std::vector<const EMBEDDED_FILES*> embeddedFilesStack;
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
*/
|
||||
#define UNITS3D_TO_UNITSPCB ( pcbIUScale.IU_PER_MM )
|
||||
|
||||
RENDER_3D_OPENGL::RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter, CAMERA& aCamera ) :
|
||||
RENDER_3D_OPENGL::RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdapter,
|
||||
CAMERA& aCamera ) :
|
||||
RENDER_3D_BASE( aAdapter, aCamera ),
|
||||
m_canvas( aCanvas )
|
||||
{
|
||||
@@ -70,7 +71,7 @@ RENDER_3D_OPENGL::RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdap
|
||||
m_outerThroughHoles = nullptr;
|
||||
m_outerThroughHoleRings = nullptr;
|
||||
m_outerViaThroughHoles = nullptr;
|
||||
m_microviaHoles = nullptr;
|
||||
m_vias = nullptr;
|
||||
m_padHoles = nullptr;
|
||||
|
||||
m_circleTexture = 0;
|
||||
@@ -80,8 +81,6 @@ RENDER_3D_OPENGL::RENDER_3D_OPENGL( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aAdap
|
||||
m_boardWithHoles = nullptr;
|
||||
|
||||
m_3dModelMap.clear();
|
||||
|
||||
m_spheres_gizmo = new SPHERES_GIZMO( 4, 4 );
|
||||
}
|
||||
|
||||
|
||||
@@ -92,8 +91,6 @@ RENDER_3D_OPENGL::~RENDER_3D_OPENGL()
|
||||
freeAllLists();
|
||||
|
||||
glDeleteTextures( 1, &m_circleTexture );
|
||||
|
||||
delete m_spheres_gizmo;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,13 +104,9 @@ void RENDER_3D_OPENGL::SetCurWindowSize( const wxSize& aSize )
|
||||
{
|
||||
if( m_windowSize != aSize )
|
||||
{
|
||||
int viewport[4];
|
||||
int fbWidth, fbHeight;
|
||||
glGetIntegerv( GL_VIEWPORT, viewport );
|
||||
|
||||
m_windowSize = aSize;
|
||||
glViewport( 0, 0, m_windowSize.x, m_windowSize.y );
|
||||
setGizmoViewport( 0, 0, m_windowSize.x, m_windowSize.y );
|
||||
|
||||
// Initialize here any screen dependent data here
|
||||
}
|
||||
}
|
||||
@@ -146,33 +139,42 @@ void RENDER_3D_OPENGL::setLightBottom( bool enabled )
|
||||
}
|
||||
|
||||
|
||||
void RENDER_3D_OPENGL::resetSelectedGizmoSphere()
|
||||
void RENDER_3D_OPENGL::render3dArrows()
|
||||
{
|
||||
m_spheres_gizmo->resetSelectedGizmoSphere();
|
||||
}
|
||||
const float arrow_size = RANGE_SCALE_3D * 0.30f;
|
||||
|
||||
glDisable( GL_CULL_FACE );
|
||||
|
||||
SPHERES_GIZMO::GizmoSphereSelection RENDER_3D_OPENGL::getSelectedGizmoSphere() const
|
||||
{
|
||||
return m_spheres_gizmo->getSelectedGizmoSphere();
|
||||
}
|
||||
// YxY squared view port, this is on propose
|
||||
glViewport( 4, 4, m_windowSize.y / 8 , m_windowSize.y / 8 );
|
||||
glClear( GL_DEPTH_BUFFER_BIT );
|
||||
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
gluPerspective( 45.0f, 1.0f, 0.001f, RANGE_SCALE_3D );
|
||||
|
||||
void RENDER_3D_OPENGL::setGizmoViewport( int x, int y, int width, int height )
|
||||
{
|
||||
m_spheres_gizmo->setViewport( x, y, width, height );
|
||||
}
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
|
||||
const glm::mat4 TranslationMatrix =
|
||||
glm::translate( glm::mat4( 1.0f ), SFVEC3F( 0.0f, 0.0f, -( arrow_size * 2.75f ) ) );
|
||||
|
||||
std::tuple<int, int, int, int> RENDER_3D_OPENGL::getGizmoViewport() const
|
||||
{
|
||||
return m_spheres_gizmo->getViewport();
|
||||
}
|
||||
const glm::mat4 ViewMatrix = TranslationMatrix * m_camera.GetRotationMatrix();
|
||||
|
||||
glLoadMatrixf( glm::value_ptr( ViewMatrix ) );
|
||||
|
||||
void RENDER_3D_OPENGL::handleGizmoMouseInput( int mouseX, int mouseY )
|
||||
{
|
||||
m_spheres_gizmo->handleMouseInput( mouseX, mouseY );
|
||||
setArrowMaterial();
|
||||
|
||||
glColor3f( 0.9f, 0.0f, 0.0f );
|
||||
DrawRoundArrow( SFVEC3F( 0.0f, 0.0f, 0.0f ), SFVEC3F( arrow_size, 0.0f, 0.0f ), 0.275f );
|
||||
|
||||
glColor3f( 0.0f, 0.9f, 0.0f );
|
||||
DrawRoundArrow( SFVEC3F( 0.0f, 0.0f, 0.0f ), SFVEC3F( 0.0f, arrow_size, 0.0f ), 0.275f );
|
||||
|
||||
glColor3f( 0.0f, 0.0f, 0.9f );
|
||||
DrawRoundArrow( SFVEC3F( 0.0f, 0.0f, 0.0f ), SFVEC3F( 0.0f, 0.0f, arrow_size ), 0.275f );
|
||||
|
||||
glEnable( GL_CULL_FACE );
|
||||
}
|
||||
|
||||
|
||||
@@ -593,15 +595,15 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
|
||||
|
||||
bool skipThickness = aIsMoving && cfg.opengl_thickness_disableOnMove;
|
||||
bool skipRenderHoles = aIsMoving && cfg.opengl_holes_disableOnMove;
|
||||
bool skipRenderMicroVias = aIsMoving && cfg.opengl_microvias_disableOnMove;
|
||||
bool skipRenderVias = aIsMoving && cfg.opengl_vias_disableOnMove;
|
||||
bool showThickness = !skipThickness;
|
||||
|
||||
std::bitset<LAYER_3D_END> layerFlags = m_boardAdapter.GetVisibleLayers();
|
||||
|
||||
setLayerMaterial( B_Cu );
|
||||
|
||||
if( !( skipRenderMicroVias || skipRenderHoles ) && m_microviaHoles )
|
||||
m_microviaHoles->DrawAll();
|
||||
if( !( skipRenderVias || skipRenderHoles ) && m_vias )
|
||||
m_vias->DrawAll();
|
||||
|
||||
if( !skipRenderHoles && m_padHoles )
|
||||
m_padHoles->DrawAll();
|
||||
@@ -684,6 +686,10 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
|
||||
|
||||
unsetDepthOffset();
|
||||
}
|
||||
else if( isPasteLayer && skipRenderHoles )
|
||||
{
|
||||
// Do not render paste layers when skipRenderHoles is enabled or we get z-fight issues
|
||||
}
|
||||
else
|
||||
{
|
||||
setLayerMaterial( layer );
|
||||
@@ -692,13 +698,10 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
|
||||
OPENGL_RENDER_LIST* anti_board = nullptr;
|
||||
OPENGL_RENDER_LIST* solder_mask = nullptr;
|
||||
|
||||
if( !skipRenderHoles )
|
||||
{
|
||||
if( isSilkLayer && cfg.clip_silk_on_via_annuli )
|
||||
throughHolesOuter = m_outerThroughHoleRings;
|
||||
else
|
||||
throughHolesOuter = m_outerThroughHoles;
|
||||
}
|
||||
if( isSilkLayer && cfg.clip_silk_on_via_annuli )
|
||||
throughHolesOuter = m_outerThroughHoleRings;
|
||||
else
|
||||
throughHolesOuter = m_outerThroughHoles;
|
||||
|
||||
if( isSilkLayer && cfg.show_off_board_silk )
|
||||
anti_board = nullptr;
|
||||
@@ -824,8 +827,8 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
|
||||
}
|
||||
|
||||
// Render 3D arrows
|
||||
if( cfg.show_navigator )
|
||||
m_spheres_gizmo->render3dSpheresGizmo( m_camera.GetRotationMatrix() );
|
||||
if( cfg.show_axis )
|
||||
render3dArrows();
|
||||
|
||||
// Return back to the original viewport (this is important if we want
|
||||
// to take a screenshot after the render)
|
||||
@@ -945,7 +948,7 @@ void RENDER_3D_OPENGL::freeAllLists()
|
||||
DELETE_AND_FREE( m_outerViaThroughHoles )
|
||||
DELETE_AND_FREE( m_outerThroughHoleRings )
|
||||
|
||||
DELETE_AND_FREE( m_microviaHoles )
|
||||
DELETE_AND_FREE( m_vias )
|
||||
DELETE_AND_FREE( m_padHoles )
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
#include "../render_3d_base.h"
|
||||
#include "layer_triangles.h"
|
||||
#include "3d_spheres_gizmo.h"
|
||||
|
||||
#include "../raytracing/shapes2D/polygon_2d.h"
|
||||
#include "../raytracing/shapes2D/triangle_2d.h"
|
||||
@@ -71,11 +70,6 @@ public:
|
||||
* Load footprint models if they are not already loaded, i.e. if m_3dModelMap is empty
|
||||
*/
|
||||
void Load3dModelsIfNeeded();
|
||||
void handleGizmoMouseInput( int mouseX, int mouseY );
|
||||
void setGizmoViewport( int x, int y, int width, int height );
|
||||
std::tuple<int, int, int, int> getGizmoViewport() const;
|
||||
SPHERES_GIZMO::GizmoSphereSelection getSelectedGizmoSphere() const;
|
||||
void resetSelectedGizmoSphere();
|
||||
|
||||
private:
|
||||
OPENGL_RENDER_LIST* generateHoles( const LIST_OBJECT2D& aListHolesObject2d,
|
||||
@@ -174,6 +168,8 @@ private:
|
||||
void setLightTop( bool enabled );
|
||||
void setLightBottom( bool enabled );
|
||||
|
||||
void render3dArrows();
|
||||
|
||||
/**
|
||||
* Create a 3D grid to an OpenGL display list.
|
||||
*
|
||||
@@ -234,7 +230,7 @@ private:
|
||||
GLuint m_grid; ///< oGL list that stores current grid
|
||||
GRID3D_TYPE m_lastGridType; ///< Stores the last grid type.
|
||||
|
||||
OPENGL_RENDER_LIST* m_microviaHoles;
|
||||
OPENGL_RENDER_LIST* m_vias;
|
||||
OPENGL_RENDER_LIST* m_padHoles;
|
||||
|
||||
// Caches
|
||||
@@ -243,9 +239,8 @@ private:
|
||||
|
||||
BOARD_ITEM* m_currentRollOverItem;
|
||||
|
||||
SHAPE_POLY_SET m_antiBoardPolys; ///< The negative polygon representation of the board
|
||||
///< outline.
|
||||
SPHERES_GIZMO* m_spheres_gizmo;
|
||||
SHAPE_POLY_SET m_antiBoardPolys; ///< The negative polygon representation of the board
|
||||
///< outline.
|
||||
};
|
||||
|
||||
#endif // RENDER_3D_OPENGL_H
|
||||
|
||||
@@ -1296,7 +1296,7 @@ void RENDER_3D_RAYTRACE_BASE::load3DModels( CONTAINER_3D& aDstContainer,
|
||||
embeddedFilesStack.push_back( m_boardAdapter.GetBoard()->GetEmbeddedFiles() );
|
||||
|
||||
const S3DMODEL* modelPtr = cacheMgr->GetModel( model.m_Filename, footprintBasePath,
|
||||
std::move( embeddedFilesStack ) );
|
||||
embeddedFilesStack );
|
||||
|
||||
// only add it if the return is not NULL.
|
||||
if( modelPtr )
|
||||
|
||||
@@ -48,8 +48,15 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
|
||||
//
|
||||
ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
|
||||
|
||||
fileMenu->Add( EDA_3D_ACTIONS::exportAsPNG );
|
||||
fileMenu->Add( EDA_3D_ACTIONS::exportAsJPEG );
|
||||
fileMenu->Add( _( "Export Current View as PNG..." ),
|
||||
wxEmptyString,
|
||||
ID_MENU_SCREENCOPY_PNG,
|
||||
BITMAPS::export_png );
|
||||
|
||||
fileMenu->Add( _( "Export Current View as JPEG..." ),
|
||||
wxEmptyString,
|
||||
ID_MENU_SCREENCOPY_JPEG,
|
||||
BITMAPS::export_file );
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->AddClose( _( "3D Viewer" ) );
|
||||
@@ -60,7 +67,10 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
|
||||
// The translated modifiers do not always work
|
||||
ACTION_MENU* editMenu = new ACTION_MENU( false, tool );
|
||||
|
||||
editMenu->Add( EDA_3D_ACTIONS::copyToClipboard );
|
||||
editMenu->Add( _( "Copy 3D Image" ),
|
||||
wxEmptyString,
|
||||
ID_TOOL_SCREENCOPY_TOCLIBBOARD,
|
||||
BITMAPS::copy );
|
||||
|
||||
|
||||
//-- View menu -------------------------------------------------------
|
||||
@@ -112,7 +122,10 @@ void EDA_3D_VIEWER_FRAME::doReCreateMenuBar()
|
||||
//
|
||||
ACTION_MENU* prefsMenu = new ACTION_MENU( false, tool );
|
||||
|
||||
prefsMenu->Add( EDA_3D_ACTIONS::toggleRaytacing, ACTION_MENU::CHECK );
|
||||
prefsMenu->Add( _( "Raytracing" ), "",
|
||||
ID_RENDER_CURRENT_VIEW,
|
||||
BITMAPS::tools,
|
||||
ACTION_MENU::CHECK );
|
||||
|
||||
prefsMenu->Add( ACTIONS::openPreferences );
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2023 CERN
|
||||
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <wx/wupdlock.h>
|
||||
#include <wx/choice.h>
|
||||
|
||||
#include <bitmaps.h>
|
||||
#include <dialogs/eda_view_switcher.h>
|
||||
#include <eda_3d_viewer_frame.h>
|
||||
#include <tool/action_toolbar.h>
|
||||
#include <tools/eda_3d_actions.h>
|
||||
#include <3d_viewer_id.h>
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::ReCreateMainToolbar()
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::ReCreateMainToolbar" ) );
|
||||
|
||||
wxWindowUpdateLocker dummy( this );
|
||||
|
||||
if( m_mainToolBar )
|
||||
{
|
||||
m_mainToolBar->ClearToolbar();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
||||
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT |
|
||||
wxAUI_TB_HORIZONTAL );
|
||||
m_mainToolBar->SetAuiManager( &m_auimgr );
|
||||
}
|
||||
|
||||
// Set up toolbar
|
||||
m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
|
||||
KiBitmapBundle( BITMAPS::import3d ),
|
||||
_( "Reload board" ) );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
|
||||
KiBitmapBundle( BITMAPS::copy ),
|
||||
_( "Copy 3D image to clipboard" ) );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
|
||||
KiBitmapBundle( BITMAPS::ray_tracing ),
|
||||
_( "Render current view using Raytracing" ), wxITEM_CHECK );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->Add( ACTIONS::zoomRedraw );
|
||||
m_mainToolBar->Add( ACTIONS::zoomInCenter );
|
||||
m_mainToolBar->Add( ACTIONS::zoomOutCenter );
|
||||
m_mainToolBar->Add( ACTIONS::zoomFitScreen );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateXCW );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateXCCW );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateYCW );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateYCCW );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateZCW );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateZCCW );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::flipView );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::moveLeft );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::moveRight );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::moveUp );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::moveDown );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::toggleOrtho, ACTION_TOOLBAR::TOGGLE );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::showLayersManager, ACTION_TOOLBAR::TOGGLE );
|
||||
|
||||
m_mainToolBar->KiRealize();
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
#include <widgets/wx_aui_utils.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <project_pcb.h>
|
||||
#include <toolbars_3d.h>
|
||||
|
||||
#include <3d_navlib/nl_3d_viewer_plugin.h>
|
||||
|
||||
@@ -81,6 +80,7 @@ BEGIN_EVENT_TABLE( EDA_3D_VIEWER_FRAME, KIWAY_PLAYER )
|
||||
EDA_3D_VIEWER_FRAME::Process_Special_Functions )
|
||||
|
||||
EVT_MENU( wxID_CLOSE, EDA_3D_VIEWER_FRAME::Exit3DFrame )
|
||||
EVT_MENU( ID_RENDER_CURRENT_VIEW, EDA_3D_VIEWER_FRAME::onRenderEngineSelection )
|
||||
EVT_MENU( ID_DISABLE_RAY_TRACING, EDA_3D_VIEWER_FRAME::onDisableRayTracing )
|
||||
|
||||
EVT_CLOSE( EDA_3D_VIEWER_FRAME::OnCloseWindow )
|
||||
@@ -91,6 +91,7 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
|
||||
const wxString& aTitle, long style ) :
|
||||
KIWAY_PLAYER( aKiway, aParent, FRAME_PCB_DISPLAY3D, aTitle, wxDefaultPosition,
|
||||
wxDefaultSize, style, QUALIFIED_VIEWER3D_FRAMENAME( aParent ), unityScale ),
|
||||
m_mainToolBar( nullptr ),
|
||||
m_canvas( nullptr ),
|
||||
m_currentCamera( m_trackBallCamera ),
|
||||
m_trackBallCamera( 2 * RANGE_SCALE_3D )
|
||||
@@ -111,26 +112,24 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
|
||||
wxStatusBar *status_bar = CreateStatusBar( arrayDim( status_dims ) );
|
||||
SetStatusWidths( arrayDim( status_dims ), status_dims );
|
||||
|
||||
ANTIALIASING_MODE aaMode = ANTIALIASING_MODE::AA_NONE;
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
ANTIALIASING_MODE aaMode = static_cast<ANTIALIASING_MODE>( cfg->m_Render.opengl_AA_mode );
|
||||
|
||||
if( cfg )
|
||||
aaMode = static_cast<ANTIALIASING_MODE>( cfg->m_Render.opengl_AA_mode );
|
||||
|
||||
m_canvas = new EDA_3D_CANVAS( this, OGL_ATT_LIST::GetAttributesList( aaMode, true ), m_boardAdapter,
|
||||
m_currentCamera, PROJECT_PCB::Get3DCacheManager( &Prj() ) );
|
||||
m_canvas = new EDA_3D_CANVAS( this, OGL_ATT_LIST::GetAttributesList( aaMode, true ),
|
||||
m_boardAdapter, m_currentCamera,
|
||||
PROJECT_PCB::Get3DCacheManager( &Prj() ) );
|
||||
|
||||
m_appearancePanel = new APPEARANCE_CONTROLS_3D( this, GetCanvas() );
|
||||
|
||||
LoadSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
|
||||
LoadSettings( cfg );
|
||||
loadCommonSettings();
|
||||
|
||||
m_appearancePanel->SetUserViewports( Prj().GetProjectFile().m_Viewports3D );
|
||||
|
||||
// Create the manager
|
||||
m_toolManager = new TOOL_MANAGER;
|
||||
m_toolManager->SetEnvironment( GetBoard(), nullptr, nullptr,
|
||||
GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ), this );
|
||||
m_toolManager->SetEnvironment( GetBoard(), nullptr, nullptr, cfg, this );
|
||||
|
||||
m_actions = new EDA_3D_ACTIONS();
|
||||
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
|
||||
@@ -144,22 +143,19 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
|
||||
setupUIConditions();
|
||||
|
||||
if( EDA_3D_CONTROLLER* ctrlTool = GetToolManager()->GetTool<EDA_3D_CONTROLLER>() )
|
||||
ctrlTool->SetRotationIncrement( cfg ? cfg->m_Camera.rotation_increment : 10.0 );
|
||||
ctrlTool->SetRotationIncrement( cfg->m_Camera.rotation_increment );
|
||||
|
||||
// Run the viewer control tool, it is supposed to be always active
|
||||
m_toolManager->InvokeTool( "3DViewer.Control" );
|
||||
|
||||
ReCreateMenuBar();
|
||||
|
||||
m_toolbarSettings = Pgm().GetSettingsManager().GetToolbarSettings<EDA_3D_VIEWER_TOOLBAR_SETTINGS>( "3d_viewer-toolbars" );
|
||||
configureToolbars();
|
||||
RecreateToolbars();
|
||||
ReCreateMainToolbar();
|
||||
|
||||
m_infoBar = new WX_INFOBAR( this, &m_auimgr );
|
||||
|
||||
m_auimgr.SetManagedWindow( this );
|
||||
|
||||
m_auimgr.AddPane( m_tbTopMain, EDA_PANE().HToolbar().Name( wxS( "TopMainToolbar" ) )
|
||||
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( wxS( "MainToolbar" ) )
|
||||
.Top().Layer( 6 ) );
|
||||
m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( wxS( "InfoBar" ) )
|
||||
.Top().Layer( 1 ) );
|
||||
@@ -172,11 +168,10 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
|
||||
|
||||
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
|
||||
|
||||
if( cfg && cfg->m_AuiPanels.right_panel_width > 0 )
|
||||
if( cfg->m_AuiPanels.right_panel_width > 0 )
|
||||
SetAuiPaneSize( m_auimgr, layersManager, cfg->m_AuiPanels.right_panel_width, -1 );
|
||||
|
||||
if( cfg )
|
||||
layersManager.Show( cfg->m_AuiPanels.show_layer_manager );
|
||||
layersManager.Show( cfg->m_AuiPanels.show_layer_manager );
|
||||
|
||||
// Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
|
||||
// hiding it.
|
||||
@@ -260,9 +255,10 @@ void EDA_3D_VIEWER_FRAME::setupUIConditions()
|
||||
{
|
||||
return m_boardAdapter.m_Cfg->m_Render.show_model_bbox;
|
||||
};
|
||||
auto showNavig = [this]( const SELECTION& aSel )
|
||||
auto showAxes =
|
||||
[this]( const SELECTION& aSel )
|
||||
{
|
||||
return m_boardAdapter.m_Cfg->m_Render.show_navigator;
|
||||
return m_boardAdapter.m_Cfg->m_Render.show_axis;
|
||||
};
|
||||
auto ortho =
|
||||
[this]( const SELECTION& )
|
||||
@@ -276,7 +272,7 @@ void EDA_3D_VIEWER_FRAME::setupUIConditions()
|
||||
return m_boardAdapter.m_Cfg->m_AuiPanels.show_layer_manager;
|
||||
};
|
||||
|
||||
mgr->SetConditions( EDA_3D_ACTIONS::toggleRaytacing, ACTION_CONDITIONS().Check( raytracing ) );
|
||||
RegisterUIUpdateHandler( ID_RENDER_CURRENT_VIEW, ACTION_CONDITIONS().Check( raytracing ) );
|
||||
|
||||
mgr->SetConditions( EDA_3D_ACTIONS::showTHT, ACTION_CONDITIONS().Check( showTH ) );
|
||||
mgr->SetConditions( EDA_3D_ACTIONS::showSMD, ACTION_CONDITIONS().Check( showSMD ) );
|
||||
@@ -286,7 +282,7 @@ void EDA_3D_VIEWER_FRAME::setupUIConditions()
|
||||
mgr->SetConditions( EDA_3D_ACTIONS::showDNP, ACTION_CONDITIONS().Check( show_DNP ) );
|
||||
|
||||
mgr->SetConditions( EDA_3D_ACTIONS::showBBoxes, ACTION_CONDITIONS().Check( showBBoxes ) );
|
||||
mgr->SetConditions( EDA_3D_ACTIONS::showNavigator, ACTION_CONDITIONS().Check( showNavig ) );
|
||||
mgr->SetConditions( EDA_3D_ACTIONS::showAxis, ACTION_CONDITIONS().Check( showAxes ) );
|
||||
|
||||
mgr->SetConditions( EDA_3D_ACTIONS::noGrid, GridSizeCheck( GRID3D_TYPE::NONE ) );
|
||||
mgr->SetConditions( EDA_3D_ACTIONS::show10mmGrid, GridSizeCheck( GRID3D_TYPE::GRID_10MM ) );
|
||||
@@ -458,25 +454,45 @@ void EDA_3D_VIEWER_FRAME::OnCloseWindow( wxCloseEvent &event )
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::Process_Special_Functions( wxCommandEvent &event )
|
||||
{
|
||||
int id = event.GetId();
|
||||
bool isChecked = event.IsChecked();
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::Process_Special_Functions id %d "
|
||||
"isChecked %d" ),
|
||||
id,
|
||||
isChecked );
|
||||
|
||||
if( m_canvas == nullptr )
|
||||
return;
|
||||
|
||||
switch( event.GetId() )
|
||||
switch( id )
|
||||
{
|
||||
case ID_RELOAD3D_BOARD:
|
||||
NewDisplay( true );
|
||||
break;
|
||||
|
||||
case ID_TOOL_SCREENCOPY_TOCLIBBOARD:
|
||||
case ID_MENU_SCREENCOPY_PNG:
|
||||
case ID_MENU_SCREENCOPY_JPEG:
|
||||
takeScreenshot( event );
|
||||
return;
|
||||
|
||||
case ID_MENU3D_RESET_DEFAULTS:
|
||||
{
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
m_boardAdapter.SetLayerColors( m_boardAdapter.GetDefaultColors() );
|
||||
|
||||
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
|
||||
cfg->ResetToDefaults();
|
||||
|
||||
LoadSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
|
||||
cfg->ResetToDefaults();
|
||||
LoadSettings( cfg );
|
||||
|
||||
// Tell canvas that we (may have) changed the render engine
|
||||
RenderEngineChanged();
|
||||
|
||||
NewDisplay( true );
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxT( "Invalid event in EDA_3D_VIEWER_FRAME::Process_Special_Functions()" ) );
|
||||
@@ -485,9 +501,28 @@ void EDA_3D_VIEWER_FRAME::Process_Special_Functions( wxCommandEvent &event )
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::onRenderEngineSelection( wxCommandEvent &event )
|
||||
{
|
||||
RENDER_ENGINE& engine = m_boardAdapter.m_Cfg->m_Render.engine;
|
||||
RENDER_ENGINE old_engine = engine;
|
||||
|
||||
if( old_engine == RENDER_ENGINE::OPENGL )
|
||||
engine = RENDER_ENGINE::RAYTRACING;
|
||||
else
|
||||
engine = RENDER_ENGINE::OPENGL;
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::OnRenderEngineSelection type %s " ),
|
||||
engine == RENDER_ENGINE::RAYTRACING ? wxT( "raytracing" ) : wxT( "realtime" ) );
|
||||
|
||||
if( old_engine != engine )
|
||||
RenderEngineChanged();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::onDisableRayTracing( wxCommandEvent& aEvent )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::%s disabling ray tracing." ), __WXFUNCTION__ );
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::%s disabling ray tracing." ),
|
||||
__WXFUNCTION__ );
|
||||
|
||||
m_disable_ray_tracing = true;
|
||||
m_boardAdapter.m_Cfg->m_Render.engine = RENDER_ENGINE::OPENGL;
|
||||
@@ -539,6 +574,9 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
|
||||
{
|
||||
applySettings( cfg );
|
||||
|
||||
if( !GetBoard()->GetProject() )
|
||||
GetBoard()->SetProject( &Prj() );
|
||||
|
||||
m_boardAdapter.SetBoard( GetBoard() );
|
||||
|
||||
// When opening the 3D viewer, we use the OpenGL mode, never the ray tracing engine
|
||||
@@ -572,9 +610,19 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::SaveSettings( APP_SETTINGS_BASE *aCfg )
|
||||
{
|
||||
EDA_BASE_FRAME::SaveSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
|
||||
EDA_BASE_FRAME::SaveSettings( cfg );
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::SaveSettings" ) );
|
||||
|
||||
wxLogTrace( m_logTrace, m_boardAdapter.m_Cfg->m_Render.engine == RENDER_ENGINE::RAYTRACING ?
|
||||
wxT( "EDA_3D_VIEWER_FRAME::SaveSettings render setting Ray Trace" )
|
||||
:
|
||||
wxT( "EDA_3D_VIEWER_FRAME::SaveSettings render setting OpenGL" ) );
|
||||
|
||||
if( cfg )
|
||||
{
|
||||
cfg->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x;
|
||||
|
||||
@@ -595,8 +643,12 @@ void EDA_3D_VIEWER_FRAME::CommonSettingsChanged( int aFlags )
|
||||
// Regen menu bars, etc
|
||||
EDA_BASE_FRAME::CommonSettingsChanged( aFlags );
|
||||
|
||||
// There is no base class that handles toolbars for this frame
|
||||
ReCreateMainToolbar();
|
||||
|
||||
loadCommonSettings();
|
||||
applySettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
|
||||
applySettings(
|
||||
Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
|
||||
|
||||
m_appearancePanel->CommonSettingsChanged();
|
||||
|
||||
@@ -609,7 +661,7 @@ void EDA_3D_VIEWER_FRAME::ShowChangedLanguage()
|
||||
EDA_BASE_FRAME::ShowChangedLanguage();
|
||||
|
||||
SetTitle( _( "3D Viewer" ) );
|
||||
RecreateToolbars();
|
||||
ReCreateMainToolbar();
|
||||
|
||||
if( m_appearancePanel )
|
||||
{
|
||||
@@ -624,24 +676,23 @@ void EDA_3D_VIEWER_FRAME::ShowChangedLanguage()
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::ToggleAppearanceManager()
|
||||
{
|
||||
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
|
||||
|
||||
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
|
||||
// show auxiliary Vertical layers and visibility manager toolbar
|
||||
cfg->m_AuiPanels.show_layer_manager = !cfg->m_AuiPanels.show_layer_manager;
|
||||
|
||||
layersManager.Show( cfg->m_AuiPanels.show_layer_manager );
|
||||
|
||||
if( cfg->m_AuiPanels.show_layer_manager )
|
||||
{
|
||||
// show auxiliary Vertical layers and visibility manager toolbar
|
||||
cfg->m_AuiPanels.show_layer_manager = !cfg->m_AuiPanels.show_layer_manager;
|
||||
|
||||
layersManager.Show( cfg->m_AuiPanels.show_layer_manager );
|
||||
|
||||
if( cfg->m_AuiPanels.show_layer_manager )
|
||||
{
|
||||
SetAuiPaneSize( m_auimgr, layersManager, cfg->m_AuiPanels.right_panel_width, -1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
cfg->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x;
|
||||
m_auimgr.Update();
|
||||
}
|
||||
SetAuiPaneSize( m_auimgr, layersManager, cfg->m_AuiPanels.right_panel_width, -1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
cfg->m_AuiPanels.right_panel_width = m_appearancePanel->GetSize().x;
|
||||
m_auimgr.Update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,15 +704,15 @@ void EDA_3D_VIEWER_FRAME::OnDarkModeToggle()
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat )
|
||||
void EDA_3D_VIEWER_FRAME::takeScreenshot( wxCommandEvent& event )
|
||||
{
|
||||
wxString fullFileName;
|
||||
bool fmt_is_jpeg = false;
|
||||
|
||||
if( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG )
|
||||
if( event.GetId() == ID_MENU_SCREENCOPY_JPEG )
|
||||
fmt_is_jpeg = true;
|
||||
|
||||
if( aFormat != EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
|
||||
if( event.GetId() != ID_TOOL_SCREENCOPY_TOCLIBBOARD )
|
||||
{
|
||||
// Remember path between saves during this session only.
|
||||
const wxString wildcard =
|
||||
@@ -725,7 +776,7 @@ void EDA_3D_VIEWER_FRAME::TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat )
|
||||
|
||||
cfg.highlight_on_rollover = allow_highlight;
|
||||
|
||||
if( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD )
|
||||
if( event.GetId() == ID_TOOL_SCREENCOPY_TOCLIBBOARD )
|
||||
{
|
||||
wxBitmap bitmap( screenshotImage );
|
||||
|
||||
|
||||
@@ -57,13 +57,6 @@ enum EDA_3D_VIEWER_STATUSBAR
|
||||
ZOOM_LEVEL,
|
||||
};
|
||||
|
||||
enum class EDA_3D_VIEWER_EXPORT_FORMAT
|
||||
{
|
||||
CLIPBOARD,
|
||||
PNG,
|
||||
JPEG
|
||||
};
|
||||
|
||||
/**
|
||||
* Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard
|
||||
*/
|
||||
@@ -130,12 +123,6 @@ public:
|
||||
|
||||
void OnDarkModeToggle();
|
||||
|
||||
/**
|
||||
* Create a Screenshot of the current 3D view.
|
||||
* Output file format is png or jpeg, or image is copied to the clipboard
|
||||
*/
|
||||
void TakeScreenshot( EDA_3D_VIEWER_EXPORT_FORMAT aFormat );
|
||||
|
||||
protected:
|
||||
void setupUIConditions() override;
|
||||
|
||||
@@ -151,12 +138,20 @@ private:
|
||||
|
||||
void Process_Special_Functions( wxCommandEvent& event );
|
||||
|
||||
void onRenderEngineSelection( wxCommandEvent& event );
|
||||
void onDisableRayTracing( wxCommandEvent& aEvent );
|
||||
|
||||
void OnActivate( wxActivateEvent& event );
|
||||
void OnSetFocus( wxFocusEvent& event );
|
||||
|
||||
void doReCreateMenuBar() override;
|
||||
void ReCreateMainToolbar();
|
||||
|
||||
/**
|
||||
* Create a Screenshot of the current 3D view.
|
||||
* Output file format is png or jpeg, or image is copied to the clipboard
|
||||
*/
|
||||
void takeScreenshot( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* @brief RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged
|
||||
@@ -177,6 +172,7 @@ private:
|
||||
private:
|
||||
wxFileName m_defaultSaveScreenshotFileName;
|
||||
|
||||
ACTION_TOOLBAR* m_mainToolBar;
|
||||
EDA_3D_CANVAS* m_canvas;
|
||||
BOARD_ADAPTER m_boardAdapter;
|
||||
CAMERA& m_currentCamera;
|
||||
|
||||
@@ -103,7 +103,7 @@ PARAM_LAYER_PRESET_3D::PARAM_LAYER_PRESET_3D( const std::string& aPath,
|
||||
LAYER( "user_drawings", LAYER_3D_USER_DRAWINGS );
|
||||
LAYER( "user_eco1", LAYER_3D_USER_ECO1 );
|
||||
LAYER( "user_eco2", LAYER_3D_USER_ECO2 );
|
||||
LAYER( "3d_navigator", LAYER_3D_NAVIGATOR );
|
||||
LAYER( "3d_axes", LAYER_3D_AXES );
|
||||
LAYER( "th_models", LAYER_3D_TH_MODELS );
|
||||
LAYER( "smd_models", LAYER_3D_SMD_MODELS );
|
||||
LAYER( "virtual_models", LAYER_3D_VIRTUAL_MODELS );
|
||||
@@ -253,7 +253,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
|
||||
m_params.emplace_back( new PARAM<bool>( "render.opengl_thickness_disableOnMove",
|
||||
&m_Render.opengl_thickness_disableOnMove, false ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.opengl_vias_disableOnMove",
|
||||
&m_Render.opengl_microvias_disableOnMove, false ) );
|
||||
&m_Render.opengl_vias_disableOnMove, false ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.opengl_holes_disableOnMove",
|
||||
&m_Render.opengl_holes_disableOnMove, false ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.opengl_render_bbox_only_OnMove",
|
||||
@@ -320,7 +320,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
|
||||
|
||||
m_params.emplace_back( new PARAM_LIST<COLOR4D>( "render.raytrace_lightColor",
|
||||
&m_Render.raytrace_lightColor,
|
||||
std::move( default_colors ) ) );
|
||||
default_colors ) );
|
||||
|
||||
const std::vector<int> default_elevation =
|
||||
{
|
||||
@@ -329,7 +329,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
|
||||
|
||||
m_params.emplace_back( new PARAM_LIST<int>( "render.raytrace_lightElevation",
|
||||
&m_Render.raytrace_lightElevation,
|
||||
std::move( default_elevation ) ) );
|
||||
default_elevation ) );
|
||||
|
||||
const std::vector<int> default_azimuth =
|
||||
{
|
||||
@@ -338,12 +338,12 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
|
||||
|
||||
m_params.emplace_back( new PARAM_LIST<int>( "render.raytrace_lightAzimuth",
|
||||
&m_Render.raytrace_lightAzimuth,
|
||||
std::move( default_azimuth ) ) );
|
||||
default_azimuth ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_adhesive",
|
||||
&m_Render.show_adhesive, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_navigator",
|
||||
&m_Render.show_navigator, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_axis",
|
||||
&m_Render.show_axis, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_board_body",
|
||||
&m_Render.show_board_body, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.show_comments",
|
||||
@@ -489,7 +489,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() :
|
||||
legacyColorMap[483] = "virtual_models";
|
||||
legacyColorMap[484] = "non_pos_file_models";
|
||||
legacyColorMap[485] = "dnp_models";
|
||||
legacyColorMap[486] = "3d_navigator";
|
||||
legacyColorMap[486] = "3d_axes";
|
||||
legacyColorMap[487] = "bounding_boxes";
|
||||
legacyColorMap[488] = "off_board_silk";
|
||||
|
||||
@@ -579,7 +579,7 @@ bool EDA_3D_VIEWER_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
|
||||
ret &= fromLegacy<bool>( aCfg, "Render_RAY_Shadows", "render.raytrace_shadows" );
|
||||
ret &= fromLegacy<bool>( aCfg, "ShowRealisticMode", "render.realistic" );
|
||||
ret &= fromLegacy<bool>( aCfg, "ShowAdhesiveLayers", "render.show_adhesive" );
|
||||
ret &= fromLegacy<bool>( aCfg, "ShowNavigator", "render.show_navigator" );
|
||||
ret &= fromLegacy<bool>( aCfg, "ShowAxis", "render.show_axis" );
|
||||
ret &= fromLegacy<bool>( aCfg, "ShowBoardBody", "render.show_board_body" );
|
||||
ret &= fromLegacy<bool>( aCfg, "ShowCommentsLayers", "render.show_comments" );
|
||||
ret &= fromLegacy<bool>( aCfg, "ShowEcoLayers", "render.show_eco" );
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
|
||||
bool opengl_AA_disableOnMove;
|
||||
bool opengl_thickness_disableOnMove;
|
||||
bool opengl_microvias_disableOnMove;
|
||||
bool opengl_vias_disableOnMove;
|
||||
bool opengl_holes_disableOnMove;
|
||||
bool opengl_render_bbox_only_OnMove;
|
||||
bool opengl_copper_thickness;
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
std::vector<int> raytrace_lightAzimuth; // 0 .. 359
|
||||
|
||||
bool show_adhesive;
|
||||
bool show_navigator;
|
||||
bool show_axis;
|
||||
bool show_board_body;
|
||||
bool show_comments;
|
||||
bool show_drawings;
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2023 CERN
|
||||
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <wx/wupdlock.h>
|
||||
#include <wx/choice.h>
|
||||
|
||||
#include <bitmaps.h>
|
||||
#include <dialogs/eda_view_switcher.h>
|
||||
#include <eda_3d_viewer_frame.h>
|
||||
#include <tool/action_toolbar.h>
|
||||
#include <tools/eda_3d_actions.h>
|
||||
#include <3d_viewer_id.h>
|
||||
|
||||
#include <toolbars_3d.h>
|
||||
|
||||
|
||||
std::optional<TOOLBAR_CONFIGURATION> EDA_3D_VIEWER_TOOLBAR_SETTINGS::DefaultToolbarConfig( TOOLBAR_LOC aToolbar )
|
||||
{
|
||||
TOOLBAR_CONFIGURATION config;
|
||||
|
||||
// clang-format off
|
||||
switch( aToolbar )
|
||||
{
|
||||
case TOOLBAR_LOC::LEFT:
|
||||
case TOOLBAR_LOC::RIGHT:
|
||||
case TOOLBAR_LOC::TOP_AUX:
|
||||
return std::nullopt;
|
||||
case TOOLBAR_LOC::TOP_MAIN:
|
||||
config.AppendAction( EDA_3D_ACTIONS::reloadBoard );
|
||||
|
||||
config.AppendSeparator()
|
||||
.AppendAction( EDA_3D_ACTIONS::copyToClipboard );
|
||||
|
||||
config.AppendSeparator()
|
||||
.AppendAction( EDA_3D_ACTIONS::toggleRaytacing );
|
||||
|
||||
config.AppendSeparator()
|
||||
.AppendAction( ACTIONS::zoomRedraw )
|
||||
.AppendAction( ACTIONS::zoomInCenter )
|
||||
.AppendAction( ACTIONS::zoomOutCenter )
|
||||
.AppendAction( ACTIONS::zoomFitScreen );
|
||||
|
||||
config.AppendSeparator()
|
||||
.AppendAction( EDA_3D_ACTIONS::rotateXCW )
|
||||
.AppendAction( EDA_3D_ACTIONS::rotateXCCW );
|
||||
|
||||
config.AppendSeparator()
|
||||
.AppendAction( EDA_3D_ACTIONS::rotateYCW )
|
||||
.AppendAction( EDA_3D_ACTIONS::rotateYCCW );
|
||||
|
||||
config.AppendSeparator()
|
||||
.AppendAction( EDA_3D_ACTIONS::rotateZCW )
|
||||
.AppendAction( EDA_3D_ACTIONS::rotateZCCW );
|
||||
|
||||
config.AppendSeparator()
|
||||
.AppendAction( EDA_3D_ACTIONS::flipView );
|
||||
|
||||
config.AppendSeparator()
|
||||
.AppendAction( EDA_3D_ACTIONS::moveLeft )
|
||||
.AppendAction( EDA_3D_ACTIONS::moveRight )
|
||||
.AppendAction( EDA_3D_ACTIONS::moveUp )
|
||||
.AppendAction( EDA_3D_ACTIONS::moveDown );
|
||||
|
||||
config.AppendSeparator()
|
||||
.AppendAction( EDA_3D_ACTIONS::toggleOrtho );
|
||||
|
||||
config.AppendSeparator()
|
||||
.AppendAction( EDA_3D_ACTIONS::showLayersManager );
|
||||
break;
|
||||
}
|
||||
|
||||
// clang-format on
|
||||
return config;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TOOLBARS_3D_H_
|
||||
#define TOOLBARS_3D_H_
|
||||
|
||||
#include <tool/ui/toolbar_configuration.h>
|
||||
|
||||
/**
|
||||
* Toolbar configuration for the 3D viewer.
|
||||
*/
|
||||
class EDA_3D_VIEWER_TOOLBAR_SETTINGS : public TOOLBAR_SETTINGS
|
||||
{
|
||||
public:
|
||||
EDA_3D_VIEWER_TOOLBAR_SETTINGS() :
|
||||
TOOLBAR_SETTINGS( "3d_viewer-toolbars" )
|
||||
{}
|
||||
|
||||
~EDA_3D_VIEWER_TOOLBAR_SETTINGS() {}
|
||||
|
||||
std::optional<TOOLBAR_CONFIGURATION> DefaultToolbarConfig( TOOLBAR_LOC aToolbar ) override;
|
||||
};
|
||||
|
||||
#endif /* TOOLBARS_3D_H_ */
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <bitmaps.h>
|
||||
#include <3d_viewer_id.h>
|
||||
#include <3d_enums.h>
|
||||
#include <3d-viewer/3d_viewer/eda_3d_viewer_frame.h>
|
||||
#include "eda_3d_actions.h"
|
||||
#include "tool/tool_action.h"
|
||||
|
||||
@@ -39,47 +38,7 @@
|
||||
TOOL_ACTION EDA_3D_ACTIONS::controlActivate( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.Flags( AF_ACTIVATE )
|
||||
.ToolbarState( TOOLBAR_STATE::HIDDEN) );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS:: reloadBoard( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.reloadBoard" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Reload board" ) )
|
||||
.Tooltip( _( "Reload board and refresh 3D view" ) )
|
||||
.Icon( BITMAPS::import3d ) );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::toggleRaytacing( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.toggleRaytacing" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Use raytracing" ) )
|
||||
.Tooltip( _( "Render current view using Raytracing" ) )
|
||||
.Icon( BITMAPS::ray_tracing )
|
||||
.ToolbarState( TOOLBAR_STATE::TOGGLE) );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::copyToClipboard( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.copyToClipboard" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Copy 3D image to clipboard" ) )
|
||||
.Tooltip( _( "Copy the current 3D image to the clipboard" ) )
|
||||
.Icon( BITMAPS::copy )
|
||||
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::CLIPBOARD ) );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::exportAsPNG( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.exportAsPNG" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Export Current View as PNG..." ) )
|
||||
.Tooltip( _( "Export the Current View as a PNG image" ) )
|
||||
.Icon( BITMAPS::export_png )
|
||||
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::PNG ) );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::exportAsJPEG( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.exportAsJPEG" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Export Current View as JPEG..." ) )
|
||||
.Tooltip( _( "Export the Current View as a JPEG image" ) )
|
||||
.Icon( BITMAPS::export_file )
|
||||
.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>( EDA_3D_VIEWER_EXPORT_FORMAT::JPEG ) );
|
||||
.Flags( AF_ACTIVATE ) );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::pivotCenter( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.pivotCenter" )
|
||||
@@ -125,7 +84,6 @@ TOOL_ACTION EDA_3D_ACTIONS::rotateYCCW( TOOL_ACTION_ARGS()
|
||||
TOOL_ACTION EDA_3D_ACTIONS::rotateZCW( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.rotateZclockwise" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.DefaultHotkey( MD_SHIFT + 'R' )
|
||||
.FriendlyName( _( "Rotate Z Clockwise" ) )
|
||||
.Icon( BITMAPS::rotate_cw_z )
|
||||
.Flags( AF_NONE )
|
||||
@@ -134,7 +92,6 @@ TOOL_ACTION EDA_3D_ACTIONS::rotateZCW( TOOL_ACTION_ARGS()
|
||||
TOOL_ACTION EDA_3D_ACTIONS::rotateZCCW( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.rotateZcounterclockwise" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.DefaultHotkey( 'R' )
|
||||
.FriendlyName( _( "Rotate Z Counterclockwise" ) )
|
||||
.Icon( BITMAPS::rotate_ccw_z )
|
||||
.Flags( AF_NONE )
|
||||
@@ -200,8 +157,7 @@ TOOL_ACTION EDA_3D_ACTIONS::toggleOrtho( TOOL_ACTION_ARGS()
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Toggle Orthographic Projection" ) )
|
||||
.Tooltip( _( "Enable/disable orthographic projection" ) )
|
||||
.Icon( BITMAPS::ortho )
|
||||
.ToolbarState( TOOLBAR_STATE::TOGGLE ) );
|
||||
.Icon( BITMAPS::ortho ) );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::viewFront( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.viewFront" )
|
||||
@@ -363,16 +319,16 @@ TOOL_ACTION EDA_3D_ACTIONS::showDNP( TOOL_ACTION_ARGS()
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::showBBoxes( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.showBoundingBoxes" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Show Model Bounding Boxes" ) )
|
||||
.Tooltip( _( "Show 3D model bounding boxes in realtime renderer" ) )
|
||||
.Icon( BITMAPS::ortho )
|
||||
.Flags( AF_NONE ) );
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Show Model Bounding Boxes" ) )
|
||||
.Tooltip( _( "Show 3D model bounding boxes in realtime renderer" ) )
|
||||
.Icon( BITMAPS::ortho )
|
||||
.Flags( AF_NONE ) );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::showNavigator( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.showNavigator" )
|
||||
TOOL_ACTION EDA_3D_ACTIONS::showAxis( TOOL_ACTION_ARGS()
|
||||
.Name( "3DViewer.Control.showAxis" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Show 3D Navigator" ) )
|
||||
.FriendlyName( _( "Show 3D Axis" ) )
|
||||
.Icon( BITMAPS::axis3d_front )
|
||||
.Flags( AF_NONE ) );
|
||||
|
||||
@@ -381,6 +337,5 @@ TOOL_ACTION EDA_3D_ACTIONS::showLayersManager( TOOL_ACTION_ARGS()
|
||||
.Scope( AS_GLOBAL )
|
||||
.FriendlyName( _( "Show Appearance Manager" ) )
|
||||
.Tooltip( _( "Show/hide the appearance manager" ) )
|
||||
.Icon( BITMAPS::layers_manager )
|
||||
.ToolbarState( TOOLBAR_STATE::TOGGLE ) );
|
||||
.Icon( BITMAPS::layers_manager ) );
|
||||
|
||||
|
||||
@@ -42,13 +42,6 @@ class EDA_3D_ACTIONS : public ACTIONS
|
||||
public:
|
||||
static TOOL_ACTION controlActivate;
|
||||
|
||||
static TOOL_ACTION reloadBoard;
|
||||
static TOOL_ACTION toggleRaytacing;
|
||||
|
||||
static TOOL_ACTION copyToClipboard;
|
||||
static TOOL_ACTION exportAsPNG;
|
||||
static TOOL_ACTION exportAsJPEG;
|
||||
|
||||
static TOOL_ACTION pivotCenter;
|
||||
static TOOL_ACTION rotateXCW;
|
||||
static TOOL_ACTION rotateXCCW;
|
||||
@@ -87,7 +80,7 @@ public:
|
||||
static TOOL_ACTION showNotInPosFile;
|
||||
static TOOL_ACTION showDNP;
|
||||
static TOOL_ACTION showBBoxes;
|
||||
static TOOL_ACTION showNavigator;
|
||||
static TOOL_ACTION showAxis;
|
||||
static TOOL_ACTION showLayersManager;
|
||||
};
|
||||
|
||||
|
||||
@@ -256,8 +256,8 @@ int EDA_3D_CONTROLLER::ToggleVisibility( const TOOL_EVENT& aEvent )
|
||||
flipLayer( LAYER_3D_MODELS_NOT_IN_POS );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showDNP ) )
|
||||
flipLayer( LAYER_3D_MODELS_MARKED_DNP );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showNavigator ) )
|
||||
flipLayer( LAYER_3D_NAVIGATOR );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showAxis ) )
|
||||
flipLayer( LAYER_3D_AXES );
|
||||
else if( aEvent.IsAction( &EDA_3D_ACTIONS::showBBoxes ) )
|
||||
flipLayer( LAYER_3D_BOUNDING_BOXES );
|
||||
}
|
||||
@@ -334,65 +334,11 @@ int EDA_3D_CONTROLLER::ZoomFitScreen( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
|
||||
|
||||
int EDA_3D_CONTROLLER::ReloadBoard( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( m_toolMgr->GetToolHolder() );
|
||||
|
||||
if( frame && frame->GetFrameType() == FRAME_PCB_DISPLAY3D )
|
||||
static_cast<EDA_3D_VIEWER_FRAME*>( frame )->NewDisplay( true );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int EDA_3D_CONTROLLER::ToggleRaytracing( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( m_toolMgr->GetToolHolder() );
|
||||
|
||||
if( frame && frame->GetFrameType() == FRAME_PCB_DISPLAY3D )
|
||||
{
|
||||
EDA_3D_VIEWER_FRAME* frame3d = static_cast<EDA_3D_VIEWER_FRAME*>( frame );
|
||||
|
||||
RENDER_ENGINE& engine = frame3d->GetAdapter().m_Cfg->m_Render.engine;
|
||||
RENDER_ENGINE old_engine = engine;
|
||||
|
||||
if( old_engine == RENDER_ENGINE::OPENGL )
|
||||
engine = RENDER_ENGINE::RAYTRACING;
|
||||
else
|
||||
engine = RENDER_ENGINE::OPENGL;
|
||||
|
||||
// Directly tell the canvas the rendering engine changed
|
||||
if( old_engine != engine )
|
||||
frame3d->GetCanvas()->RenderEngineChanged();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int EDA_3D_CONTROLLER::ExportImage( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( m_toolMgr->GetToolHolder() );
|
||||
|
||||
if( frame && frame->GetFrameType() == FRAME_PCB_DISPLAY3D )
|
||||
static_cast<EDA_3D_VIEWER_FRAME*>( frame )->TakeScreenshot( aEvent.Parameter<EDA_3D_VIEWER_EXPORT_FORMAT>() );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_CONTROLLER::setTransitions()
|
||||
{
|
||||
Go( &EDA_3D_CONTROLLER::Main, EDA_3D_ACTIONS::controlActivate.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::UpdateMenu, ACTIONS::updateMenu.MakeEvent() );
|
||||
|
||||
// Miscellaneous control
|
||||
Go( &EDA_3D_CONTROLLER::ReloadBoard, EDA_3D_ACTIONS::reloadBoard.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ToggleRaytracing, EDA_3D_ACTIONS::toggleRaytacing.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::copyToClipboard.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::exportAsPNG.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ExportImage, EDA_3D_ACTIONS::exportAsJPEG.MakeEvent() );
|
||||
|
||||
// Pan control
|
||||
Go( &EDA_3D_CONTROLLER::PanControl, ACTIONS::panUp.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::PanControl, ACTIONS::panDown.MakeEvent() );
|
||||
|
||||
@@ -96,10 +96,6 @@ public:
|
||||
int ToggleVisibility( const TOOL_EVENT& aEvent );
|
||||
int ToggleLayersManager( const TOOL_EVENT& aEvent );
|
||||
|
||||
int ReloadBoard( const TOOL_EVENT& aEvent );
|
||||
int ToggleRaytracing( const TOOL_EVENT& aEvent );
|
||||
int ExportImage( const TOOL_EVENT& aEvent );
|
||||
|
||||
private:
|
||||
/// Set up handlers for various events.
|
||||
void setTransitions() override;
|
||||
|
||||
@@ -34,12 +34,20 @@
|
||||
enum id_3dview_frm
|
||||
{
|
||||
ID_START_COMMAND_3D = ID_KICAD_3D_VIEWER_START,
|
||||
ID_RELOAD3D_BOARD,
|
||||
ID_TOOL_SCREENCOPY_TOCLIBBOARD,
|
||||
|
||||
ID_MENU_SCREENCOPY_PNG,
|
||||
ID_MENU_SCREENCOPY_JPEG,
|
||||
ID_MENU_SCREENCOPY_TOCLIBBOARD,
|
||||
|
||||
ID_MENU3D_RESET_DEFAULTS,
|
||||
|
||||
// Help
|
||||
ID_MENU_COMMAND_END,
|
||||
|
||||
ID_RENDER_CURRENT_VIEW,
|
||||
|
||||
ID_DISABLE_RAY_TRACING,
|
||||
|
||||
ID_CUSTOM_EVENT_1, // A id for a custom event (canvas refresh request)
|
||||
|
||||
@@ -38,7 +38,6 @@ set(3D-VIEWER_SRCS
|
||||
3d_rendering/opengl/create_scene.cpp
|
||||
3d_rendering/opengl/render_3d_opengl.cpp
|
||||
3d_rendering/opengl/layer_triangles.cpp
|
||||
3d_rendering/opengl/3d_spheres_gizmo.cpp
|
||||
${DIR_RAY_ACC}/accelerator_3d.cpp
|
||||
${DIR_RAY_ACC}/bvh_packet_traversal.cpp
|
||||
${DIR_RAY_ACC}/bvh_pbrt.cpp
|
||||
@@ -82,7 +81,7 @@ set(3D-VIEWER_SRCS
|
||||
3d_rendering/test_cases.cpp
|
||||
3d_rendering/trackball.cpp
|
||||
3d_viewer/3d_menubar.cpp
|
||||
3d_viewer/toolbars_3d.cpp
|
||||
3d_viewer/3d_toolbar.cpp
|
||||
3d_viewer/tools/eda_3d_actions.cpp
|
||||
3d_viewer/tools/eda_3d_conditions.cpp
|
||||
3d_viewer/tools/eda_3d_controller.cpp
|
||||
|
||||
@@ -31,12 +31,18 @@
|
||||
#define OPENGL_INCLUDES_H
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifndef GL_SILENCE_DEPRECATION
|
||||
// Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated.
|
||||
// Luckily we can silence warnings about its deprecation.
|
||||
#define GL_SILENCE_DEPRECATION 1
|
||||
#endif
|
||||
#include <OpenGL/gl.h>
|
||||
#include <OpenGL/glu.h>
|
||||
#else
|
||||
|
||||
#ifdef _WIN32
|
||||
// required for the windows gl.h to work
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
/// Render Row abbreviation to reduce source width.
|
||||
#define RR APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D
|
||||
|
||||
// clang-format off
|
||||
/// Template for object appearance settings
|
||||
const APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D APPEARANCE_CONTROLS_3D::s_layerSettings[] = {
|
||||
|
||||
@@ -117,26 +118,27 @@ const APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D APPEARANCE_CONTROLS_3D::s_la
|
||||
RR( _HKI( "Models marked DNP" ), LAYER_3D_MODELS_MARKED_DNP, EDA_3D_ACTIONS::showDNP ),
|
||||
RR( _HKI( "Model Bounding Boxes" ), LAYER_3D_BOUNDING_BOXES, EDA_3D_ACTIONS::showBBoxes ),
|
||||
RR(),
|
||||
RR( _HKI( "Values" ), LAYER_FP_VALUES, _HKI( "Show footprint values" ) ),
|
||||
RR( _HKI( "References" ), LAYER_FP_REFERENCES, _HKI( "Show footprint references" ) ),
|
||||
RR( _HKI( "Footprint Text" ), LAYER_FP_TEXT, _HKI( "Show all footprint text" ) ),
|
||||
RR( _HKI( "Off-board Silkscreen" ), LAYER_3D_OFF_BOARD_SILK, _HKI( "Do not clip silk layers to board outline" ) ),
|
||||
RR( _HKI( "Values" ), LAYER_FP_VALUES, _HKI( "Show footprint values" ) ),
|
||||
RR( _HKI( "References" ), LAYER_FP_REFERENCES, _HKI( "Show footprint references" ) ),
|
||||
RR( _HKI( "Footprint Text" ), LAYER_FP_TEXT, _HKI( "Show all footprint text" ) ),
|
||||
RR( _HKI( "Off-board Silkscreen" ), LAYER_3D_OFF_BOARD_SILK, _HKI( "Do not clip silk layers to board outline" ) ),
|
||||
RR(),
|
||||
RR( _HKI( "3D Navigator" ), LAYER_3D_NAVIGATOR, EDA_3D_ACTIONS::showNavigator ),
|
||||
RR( _HKI( "3D Axis" ), LAYER_3D_AXES, EDA_3D_ACTIONS::showAxis ),
|
||||
RR( _HKI( "Background Start" ), LAYER_3D_BACKGROUND_TOP, _HKI( "Background gradient start color" ) ),
|
||||
RR( _HKI( "Background End" ), LAYER_3D_BACKGROUND_BOTTOM, _HKI( "Background gradient end color" ) ),
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
// The list of IDs that can have colors coming from the board stackup, and cannot be
|
||||
// modified if use colors from stackup is activated
|
||||
static std::vector<int> inStackupColors{ LAYER_3D_BOARD,
|
||||
LAYER_3D_COPPER_TOP, LAYER_3D_COPPER_BOTTOM,
|
||||
LAYER_3D_SOLDERPASTE,
|
||||
static std::vector<int> inStackupColors{ LAYER_3D_BOARD, LAYER_3D_COPPER_TOP,
|
||||
LAYER_3D_COPPER_BOTTOM, LAYER_3D_SOLDERPASTE,
|
||||
LAYER_3D_SILKSCREEN_TOP, LAYER_3D_SILKSCREEN_BOTTOM,
|
||||
LAYER_3D_SOLDERMASK_TOP, LAYER_3D_SOLDERMASK_BOTTOM
|
||||
};
|
||||
|
||||
APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent, wxWindow* aFocusOwner ) :
|
||||
APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent,
|
||||
wxWindow* aFocusOwner ) :
|
||||
APPEARANCE_CONTROLS_3D_BASE( aParent ),
|
||||
m_frame( aParent ),
|
||||
m_focusOwner( aFocusOwner ),
|
||||
@@ -198,17 +200,18 @@ APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D( EDA_3D_VIEWER_FRAME* aParent, wx
|
||||
m_panelLayersSizer->Add( m_cbUseBoardEditorCopperColors, 0,
|
||||
wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_cbLayerPresets->SetToolTip( wxString::Format( _( "Save and restore color and visibility combinations.\n"
|
||||
m_cbLayerPresets->SetToolTip( wxString::Format( _( "Save and restore color and visibility "
|
||||
"combinations.\n"
|
||||
"Use %s+Tab to activate selector.\n"
|
||||
"Successive Tabs while holding %s down will cycle through "
|
||||
"presets in the popup." ),
|
||||
"Successive Tabs while holding %s down will "
|
||||
"cycle through presets in the popup." ),
|
||||
KeyNameFromKeyCode( PRESET_SWITCH_KEY ),
|
||||
KeyNameFromKeyCode( PRESET_SWITCH_KEY ) ) );
|
||||
|
||||
m_cbViewports->SetToolTip( wxString::Format( _( "Save and restore camera position and zoom.\n"
|
||||
"Use %s+Tab to activate selector.\n"
|
||||
"Successive Tabs while holding %s down will cycle through "
|
||||
"viewports in the popup." ),
|
||||
"Successive Tabs while holding %s down will "
|
||||
"cycle through viewports in the popup." ),
|
||||
KeyNameFromKeyCode( VIEWPORT_SWITCH_KEY ),
|
||||
KeyNameFromKeyCode( VIEWPORT_SWITCH_KEY ) ) );
|
||||
|
||||
@@ -472,7 +475,8 @@ void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisibl
|
||||
|
||||
if( doFastRefresh && m_frame->GetAdapter().m_Cfg->m_Render.engine == RENDER_ENGINE::OPENGL )
|
||||
{
|
||||
RENDER_3D_OPENGL* renderer = static_cast<RENDER_3D_OPENGL*>( m_frame->GetCanvas()->GetCurrentRender() );
|
||||
RENDER_3D_OPENGL* renderer =
|
||||
static_cast<RENDER_3D_OPENGL*>( m_frame->GetCanvas()->GetCurrentRender() );
|
||||
renderer->Load3dModelsIfNeeded();
|
||||
m_frame->GetCanvas()->Request_refresh();
|
||||
}
|
||||
@@ -591,10 +595,9 @@ void APPEARANCE_CONTROLS_3D::rebuildLayers()
|
||||
}
|
||||
else
|
||||
{
|
||||
BITMAP_TOGGLE* btn_visible = new BITMAP_TOGGLE( m_windowLayers, layer,
|
||||
KiBitmapBundle( BITMAPS::visibility ),
|
||||
KiBitmapBundle( BITMAPS::visibility_off ),
|
||||
aSetting->m_Visible );
|
||||
BITMAP_TOGGLE* btn_visible = new BITMAP_TOGGLE(
|
||||
m_windowLayers, layer, KiBitmapBundle( BITMAPS::visibility ),
|
||||
KiBitmapBundle( BITMAPS::visibility_off ), aSetting->m_Visible );
|
||||
|
||||
btn_visible->Bind( TOGGLE_CHANGED,
|
||||
[this]( wxCommandEvent& aEvent )
|
||||
@@ -667,8 +670,12 @@ void APPEARANCE_CONTROLS_3D::UpdateLayerCtls()
|
||||
|
||||
// if cfg->m_UseStackupColors is set, board colors cannot be modified locally, but
|
||||
// other colors can be
|
||||
if( alg::contains( inStackupColors, setting->m_Id ) && cfg )
|
||||
setting->m_Ctl_color->SetReadOnly( cfg->m_UseStackupColors );
|
||||
if( std::find( inStackupColors.begin(), inStackupColors.end(), setting->m_Id )
|
||||
!= inStackupColors.end() )
|
||||
{
|
||||
if( cfg )
|
||||
setting->m_Ctl_color->SetReadOnly( cfg->m_UseStackupColors );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -715,8 +722,11 @@ void APPEARANCE_CONTROLS_3D::syncLayerPresetSelection()
|
||||
presets.begin(), presets.end(),
|
||||
[&]( const LAYER_PRESET_3D& aPreset )
|
||||
{
|
||||
if( aPreset.name.Lower() == _( "legacy colors" ) && m_cbUseBoardStackupColors->GetValue() )
|
||||
if( aPreset.name.Lower() == _( "legacy colors" )
|
||||
&& m_cbUseBoardStackupColors->GetValue() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for( int layer = LAYER_3D_BOARD; layer < LAYER_3D_END; ++layer )
|
||||
{
|
||||
@@ -864,8 +874,7 @@ void APPEARANCE_CONTROLS_3D::onLayerPresetChanged( wxCommandEvent& aEvent )
|
||||
if( cfg->m_CurrentPreset == name )
|
||||
cfg->m_CurrentPreset = wxEmptyString;
|
||||
|
||||
if( m_presetMRU.Index( name ) >= 0 )
|
||||
m_presetMRU.Remove( name );
|
||||
m_presetMRU.Remove( name );
|
||||
}
|
||||
|
||||
resetSelection();
|
||||
@@ -977,7 +986,8 @@ void APPEARANCE_CONTROLS_3D::onViewportChanged( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_viewports[name] = VIEWPORT3D( name, m_frame->GetCurrentCamera().GetViewMatrix() );
|
||||
|
||||
index = m_cbViewports->Insert( name, index-1, static_cast<void*>( &m_viewports[name] ) );
|
||||
index = m_cbViewports->Insert( name, index-1,
|
||||
static_cast<void*>( &m_viewports[name] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -64,28 +64,32 @@ void PANEL_3D_DISPLAY_OPTIONS::loadViewSettings( EDA_3D_VIEWER_SETTINGS* aCfg )
|
||||
|
||||
bool PANEL_3D_DISPLAY_OPTIONS::TransferDataToWindow()
|
||||
{
|
||||
loadViewSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
loadViewSettings( cfg );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool PANEL_3D_DISPLAY_OPTIONS::TransferDataFromWindow()
|
||||
{
|
||||
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
|
||||
{
|
||||
// Set visibility of items
|
||||
cfg->m_Render.show_zones = m_checkBoxAreas->GetValue();
|
||||
cfg->m_Render.subtract_mask_from_silk = m_checkBoxSubtractMaskFromSilk->GetValue();
|
||||
cfg->m_Render.clip_silk_on_via_annuli = m_checkBoxClipSilkOnViaAnnulus->GetValue();
|
||||
cfg->m_Render.differentiate_plated_copper = m_checkBoxRenderPlatedPadsAsPlated->GetValue();
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
cfg->m_Render.material_mode = static_cast<MATERIAL_MODE>( m_materialProperties->GetSelection() );
|
||||
// Set visibility of items
|
||||
cfg->m_Render.show_zones = m_checkBoxAreas->GetValue();
|
||||
cfg->m_Render.subtract_mask_from_silk = m_checkBoxSubtractMaskFromSilk->GetValue();
|
||||
cfg->m_Render.clip_silk_on_via_annuli = m_checkBoxClipSilkOnViaAnnulus->GetValue();
|
||||
cfg->m_Render.differentiate_plated_copper = m_checkBoxRenderPlatedPadsAsPlated->GetValue();
|
||||
|
||||
// Camera Options
|
||||
cfg->m_Camera.animation_enabled = m_checkBoxEnableAnimation->GetValue();
|
||||
cfg->m_Camera.moving_speed_multiplier = m_sliderAnimationSpeed->GetValue();
|
||||
cfg->m_Camera.rotation_increment = m_spinCtrlRotationAngle->GetValue();
|
||||
}
|
||||
cfg->m_Render.material_mode = static_cast<MATERIAL_MODE>( m_materialProperties->GetSelection() );
|
||||
|
||||
// Camera Options
|
||||
cfg->m_Camera.animation_enabled = m_checkBoxEnableAnimation->GetValue();
|
||||
cfg->m_Camera.moving_speed_multiplier = m_sliderAnimationSpeed->GetValue();
|
||||
cfg->m_Camera.rotation_increment = m_spinCtrlRotationAngle->GetValue();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -25,7 +25,7 @@ PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent,
|
||||
bSizeLeft->Add( m_renderOptionsLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 );
|
||||
|
||||
m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizeLeft->Add( m_staticline4, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
bSizeLeft->Add( m_staticline4, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
wxFlexGridSizer* fgSizer2;
|
||||
fgSizer2 = new wxFlexGridSizer( 0, 1, 5, 0 );
|
||||
@@ -33,7 +33,7 @@ PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent,
|
||||
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_checkBoxClipSilkOnViaAnnulus = new wxCheckBox( this, wxID_ANY, _("Clip silkscreen at via annuli"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_checkBoxClipSilkOnViaAnnulus, 0, wxTOP|wxLEFT, 5 );
|
||||
fgSizer2->Add( m_checkBoxClipSilkOnViaAnnulus, 0, wxLEFT, 5 );
|
||||
|
||||
m_checkBoxSubtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Clip silkscreen at solder mask edges"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_checkBoxSubtractMaskFromSilk, 0, wxLEFT, 5 );
|
||||
@@ -76,22 +76,22 @@ PANEL_3D_DISPLAY_OPTIONS_BASE::PANEL_3D_DISPLAY_OPTIONS_BASE( wxWindow* parent,
|
||||
bSizerRight->Add( m_cameraOptionsLabel, 0, wxTOP|wxRIGHT|wxLEFT, 13 );
|
||||
|
||||
m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizerRight->Add( m_staticline5, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
bSizerRight->Add( m_staticline5, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
wxBoxSizer* bSizerRotAngle;
|
||||
bSizerRotAngle = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_staticTextRotAngle = new wxStaticText( this, wxID_ANY, _("Rotation increment:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextRotAngle->Wrap( -1 );
|
||||
bSizerRotAngle->Add( m_staticTextRotAngle, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
bSizerRotAngle->Add( m_staticTextRotAngle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_spinCtrlRotationAngle = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 359, 10, 1 );
|
||||
m_spinCtrlRotationAngle->SetDigits( 0 );
|
||||
bSizerRotAngle->Add( m_spinCtrlRotationAngle, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
bSizerRotAngle->Add( m_spinCtrlRotationAngle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_staticTextRotAngleUnits = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextRotAngleUnits->Wrap( -1 );
|
||||
bSizerRotAngle->Add( m_staticTextRotAngleUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
|
||||
bSizerRotAngle->Add( m_staticTextRotAngleUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
|
||||
bSizerRight->Add( bSizerRotAngle, 0, wxTOP|wxLEFT, 5 );
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class PANEL_3D_DISPLAY_OPTIONS_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -49,34 +49,39 @@ void PANEL_3D_OPENGL_OPTIONS::loadSettings( EDA_3D_VIEWER_SETTINGS* aCfg )
|
||||
|
||||
m_checkBoxDisableAAMove->SetValue( aCfg->m_Render.opengl_AA_disableOnMove );
|
||||
m_checkBoxDisableMoveThickness->SetValue( aCfg->m_Render.opengl_thickness_disableOnMove );
|
||||
m_checkBoxDisableMoveVias->SetValue( aCfg->m_Render.opengl_microvias_disableOnMove );
|
||||
m_checkBoxDisableMoveVias->SetValue( aCfg->m_Render.opengl_vias_disableOnMove );
|
||||
m_checkBoxDisableMoveHoles->SetValue( aCfg->m_Render.opengl_holes_disableOnMove );
|
||||
}
|
||||
|
||||
|
||||
bool PANEL_3D_OPENGL_OPTIONS::TransferDataToWindow()
|
||||
{
|
||||
loadSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
loadSettings( cfg );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool PANEL_3D_OPENGL_OPTIONS::TransferDataFromWindow()
|
||||
{
|
||||
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
|
||||
{
|
||||
cfg->m_Render.opengl_copper_thickness = m_checkBoxCuThickness->GetValue();
|
||||
cfg->m_Render.show_model_bbox = m_checkBoxBoundingBoxes->GetValue();
|
||||
cfg->m_Render.highlight_on_rollover = m_checkBoxHighlightOnRollOver->GetValue();
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
cfg->m_Render.opengl_AA_mode = static_cast<ANTIALIASING_MODE>( m_choiceAntiAliasing->GetSelection() );
|
||||
cfg->m_Render.opengl_selection_color = m_selectionColorSwatch->GetSwatchColor();
|
||||
cfg->m_Render.opengl_copper_thickness = m_checkBoxCuThickness->GetValue();
|
||||
cfg->m_Render.show_model_bbox = m_checkBoxBoundingBoxes->GetValue();
|
||||
cfg->m_Render.highlight_on_rollover = m_checkBoxHighlightOnRollOver->GetValue();
|
||||
|
||||
cfg->m_Render.opengl_AA_disableOnMove = m_checkBoxDisableAAMove->GetValue();
|
||||
cfg->m_Render.opengl_thickness_disableOnMove = m_checkBoxDisableMoveThickness->GetValue();
|
||||
cfg->m_Render.opengl_microvias_disableOnMove = m_checkBoxDisableMoveVias->GetValue();
|
||||
cfg->m_Render.opengl_holes_disableOnMove = m_checkBoxDisableMoveHoles->GetValue();
|
||||
}
|
||||
cfg->m_Render.opengl_AA_mode =
|
||||
static_cast<ANTIALIASING_MODE>( m_choiceAntiAliasing->GetSelection() );
|
||||
cfg->m_Render.opengl_selection_color = m_selectionColorSwatch->GetSwatchColor();
|
||||
|
||||
cfg->m_Render.opengl_AA_disableOnMove = m_checkBoxDisableAAMove->GetValue();
|
||||
cfg->m_Render.opengl_thickness_disableOnMove = m_checkBoxDisableMoveThickness->GetValue();
|
||||
cfg->m_Render.opengl_vias_disableOnMove = m_checkBoxDisableMoveVias->GetValue();
|
||||
cfg->m_Render.opengl_holes_disableOnMove = m_checkBoxDisableMoveHoles->GetValue();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ PANEL_3D_OPENGL_OPTIONS_BASE::PANEL_3D_OPENGL_OPTIONS_BASE( wxWindow* parent, wx
|
||||
m_checkBoxBoundingBoxes = new wxCheckBox( this, wxID_ANY, _("Show model bounding boxes"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerMargins->Add( m_checkBoxBoundingBoxes, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_checkBoxCuThickness = new wxCheckBox( this, wxID_ANY, _("Show copper and tech layers thickness (slow)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkBoxCuThickness = new wxCheckBox( this, wxID_ANY, _("Show copper and tech layers thickness (very slow)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerMargins->Add( m_checkBoxCuThickness, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_checkBoxHighlightOnRollOver = new wxCheckBox( this, wxID_ANY, _("Highlight items on rollover"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
@@ -88,10 +88,10 @@ PANEL_3D_OPENGL_OPTIONS_BASE::PANEL_3D_OPENGL_OPTIONS_BASE( wxWindow* parent, wx
|
||||
m_checkBoxDisableMoveThickness = new wxCheckBox( this, wxID_ANY, _("Disable thickness"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer3->Add( m_checkBoxDisableMoveThickness, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_checkBoxDisableMoveVias = new wxCheckBox( this, wxID_ANY, _("Disable uVia holes"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkBoxDisableMoveVias = new wxCheckBox( this, wxID_ANY, _("Disable vias"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer3->Add( m_checkBoxDisableMoveVias, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_checkBoxDisableMoveHoles = new wxCheckBox( this, wxID_ANY, _("Disable all plated holes"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkBoxDisableMoveHoles = new wxCheckBox( this, wxID_ANY, _("Disable holes"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer3->Add( m_checkBoxDisableMoveHoles, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Show copper and tech layers thickness (slow)</property>
|
||||
<property name="label">Show copper and tech layers thickness (very slow)</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -977,7 +977,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Disable uVia holes</property>
|
||||
<property name="label">Disable vias</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -1042,7 +1042,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Disable all plated holes</property>
|
||||
<property name="label">Disable holes</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
||||
@@ -110,78 +110,85 @@ void PANEL_3D_RAYTRACING_OPTIONS::loadSettings( EDA_3D_VIEWER_SETTINGS* aCfg )
|
||||
|
||||
bool PANEL_3D_RAYTRACING_OPTIONS::TransferDataToWindow()
|
||||
{
|
||||
loadSettings( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
loadSettings( cfg );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool PANEL_3D_RAYTRACING_OPTIONS::TransferDataFromWindow()
|
||||
{
|
||||
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
|
||||
{
|
||||
cfg->m_Render.raytrace_shadows = m_cbRaytracing_renderShadows->GetValue();
|
||||
cfg->m_Render.raytrace_backfloor = m_cbRaytracing_addFloor->GetValue();
|
||||
cfg->m_Render.raytrace_refractions = m_cbRaytracing_showRefractions->GetValue();
|
||||
cfg->m_Render.raytrace_reflections = m_cbRaytracing_showReflections->GetValue();
|
||||
cfg->m_Render.raytrace_post_processing = m_cbRaytracing_postProcessing->GetValue();
|
||||
cfg->m_Render.raytrace_anti_aliasing = m_cbRaytracing_antiAliasing->GetValue();
|
||||
cfg->m_Render.raytrace_procedural_textures = m_cbRaytracing_proceduralTextures->GetValue();
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
cfg->m_Render.raytrace_nrsamples_shadows = m_numSamples_Shadows->GetValue();
|
||||
cfg->m_Render.raytrace_nrsamples_reflections = m_numSamples_Reflections->GetValue();
|
||||
cfg->m_Render.raytrace_nrsamples_refractions = m_numSamples_Refractions->GetValue();
|
||||
cfg->m_Render.raytrace_shadows = m_cbRaytracing_renderShadows->GetValue();
|
||||
cfg->m_Render.raytrace_backfloor = m_cbRaytracing_addFloor->GetValue();
|
||||
cfg->m_Render.raytrace_refractions = m_cbRaytracing_showRefractions->GetValue();
|
||||
cfg->m_Render.raytrace_reflections = m_cbRaytracing_showReflections->GetValue();
|
||||
cfg->m_Render.raytrace_post_processing = m_cbRaytracing_postProcessing->GetValue();
|
||||
cfg->m_Render.raytrace_anti_aliasing = m_cbRaytracing_antiAliasing->GetValue();
|
||||
cfg->m_Render.raytrace_procedural_textures = m_cbRaytracing_proceduralTextures->GetValue();
|
||||
|
||||
cfg->m_Render.raytrace_spread_shadows =
|
||||
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
|
||||
m_spreadFactor_Shadows->GetValue() ) / 100.0f;
|
||||
cfg->m_Render.raytrace_spread_reflections =
|
||||
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
|
||||
m_spreadFactor_Reflections->GetValue() ) / 100.0f;
|
||||
cfg->m_Render.raytrace_spread_refractions =
|
||||
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
|
||||
m_spreadFactor_Refractions->GetValue() ) / 100.0f;
|
||||
cfg->m_Render.raytrace_nrsamples_shadows = m_numSamples_Shadows->GetValue();
|
||||
cfg->m_Render.raytrace_nrsamples_reflections = m_numSamples_Reflections->GetValue();
|
||||
cfg->m_Render.raytrace_nrsamples_refractions = m_numSamples_Refractions->GetValue();
|
||||
|
||||
cfg->m_Render.raytrace_recursivelevel_reflections = m_recursiveLevel_Reflections->GetValue();
|
||||
cfg->m_Render.raytrace_recursivelevel_refractions = m_recursiveLevel_Refractions->GetValue();
|
||||
cfg->m_Render.raytrace_spread_shadows =
|
||||
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
|
||||
m_spreadFactor_Shadows->GetValue() )
|
||||
/ 100.0f;
|
||||
cfg->m_Render.raytrace_spread_reflections =
|
||||
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
|
||||
m_spreadFactor_Reflections->GetValue() )
|
||||
/ 100.0f;
|
||||
cfg->m_Render.raytrace_spread_refractions =
|
||||
EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::PERCENT,
|
||||
m_spreadFactor_Refractions->GetValue() )
|
||||
/ 100.0f;
|
||||
|
||||
cfg->m_Render.raytrace_lightColorCamera = m_colourPickerCameraLight->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColorTop = m_colourPickerTopLight->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColorBottom = m_colourPickerBottomLight->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_recursivelevel_reflections = m_recursiveLevel_Reflections->GetValue();
|
||||
cfg->m_Render.raytrace_recursivelevel_refractions = m_recursiveLevel_Refractions->GetValue();
|
||||
|
||||
cfg->m_Render.raytrace_lightColor[0] = m_colourPickerLight1->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[1] = m_colourPickerLight2->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[2] = m_colourPickerLight3->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[3] = m_colourPickerLight4->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[4] = m_colourPickerLight5->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[5] = m_colourPickerLight6->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[6] = m_colourPickerLight7->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[7] = m_colourPickerLight8->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColorCamera = m_colourPickerCameraLight->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColorTop = m_colourPickerTopLight->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColorBottom = m_colourPickerBottomLight->GetSwatchColor();
|
||||
|
||||
auto get_value =
|
||||
[]( wxTextCtrl* aCtrl )
|
||||
{
|
||||
return EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::UNSCALED,
|
||||
aCtrl->GetValue() );
|
||||
};
|
||||
cfg->m_Render.raytrace_lightColor[0] = m_colourPickerLight1->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[1] = m_colourPickerLight2->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[2] = m_colourPickerLight3->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[3] = m_colourPickerLight4->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[4] = m_colourPickerLight5->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[5] = m_colourPickerLight6->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[6] = m_colourPickerLight7->GetSwatchColor();
|
||||
cfg->m_Render.raytrace_lightColor[7] = m_colourPickerLight8->GetSwatchColor();
|
||||
|
||||
cfg->m_Render.raytrace_lightElevation[0] = get_value( m_lightElevation1 );
|
||||
cfg->m_Render.raytrace_lightElevation[1] = get_value( m_lightElevation2 );
|
||||
cfg->m_Render.raytrace_lightElevation[2] = get_value( m_lightElevation3 );
|
||||
cfg->m_Render.raytrace_lightElevation[3] = get_value( m_lightElevation4 );
|
||||
cfg->m_Render.raytrace_lightElevation[4] = get_value( m_lightElevation5 );
|
||||
cfg->m_Render.raytrace_lightElevation[5] = get_value( m_lightElevation6 );
|
||||
cfg->m_Render.raytrace_lightElevation[6] = get_value( m_lightElevation7 );
|
||||
cfg->m_Render.raytrace_lightElevation[7] = get_value( m_lightElevation8 );
|
||||
auto get_value =
|
||||
[]( wxTextCtrl* aCtrl )
|
||||
{
|
||||
return EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::UNSCALED,
|
||||
aCtrl->GetValue() );
|
||||
};
|
||||
|
||||
cfg->m_Render.raytrace_lightAzimuth[0] = get_value( m_lightAzimuth1 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[1] = get_value( m_lightAzimuth2 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[2] = get_value( m_lightAzimuth3 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[3] = get_value( m_lightAzimuth4 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[4] = get_value( m_lightAzimuth5 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[5] = get_value( m_lightAzimuth6 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[6] = get_value( m_lightAzimuth7 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[7] = get_value( m_lightAzimuth8 );
|
||||
}
|
||||
cfg->m_Render.raytrace_lightElevation[0] = get_value( m_lightElevation1 );
|
||||
cfg->m_Render.raytrace_lightElevation[1] = get_value( m_lightElevation2 );
|
||||
cfg->m_Render.raytrace_lightElevation[2] = get_value( m_lightElevation3 );
|
||||
cfg->m_Render.raytrace_lightElevation[3] = get_value( m_lightElevation4 );
|
||||
cfg->m_Render.raytrace_lightElevation[4] = get_value( m_lightElevation5 );
|
||||
cfg->m_Render.raytrace_lightElevation[5] = get_value( m_lightElevation6 );
|
||||
cfg->m_Render.raytrace_lightElevation[6] = get_value( m_lightElevation7 );
|
||||
cfg->m_Render.raytrace_lightElevation[7] = get_value( m_lightElevation8 );
|
||||
|
||||
cfg->m_Render.raytrace_lightAzimuth[0] = get_value( m_lightAzimuth1 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[1] = get_value( m_lightAzimuth2 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[2] = get_value( m_lightAzimuth3 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[3] = get_value( m_lightAzimuth4 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[4] = get_value( m_lightAzimuth5 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[5] = get_value( m_lightAzimuth6 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[6] = get_value( m_lightAzimuth7 );
|
||||
cfg->m_Render.raytrace_lightAzimuth[7] = get_value( m_lightAzimuth8 );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -19,25 +19,22 @@ PANEL_3D_RAYTRACING_OPTIONS_BASE::PANEL_3D_RAYTRACING_OPTIONS_BASE( wxWindow* pa
|
||||
bSizerMain->Add( m_renderingLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
|
||||
|
||||
bSizerMain->Add( 0, 5, 0, wxEXPAND, 5 );
|
||||
bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
wxGridSizer* gSizer1;
|
||||
gSizer1 = new wxGridSizer( 0, 1, 0, 20 );
|
||||
|
||||
m_cbRaytracing_proceduralTextures = new wxCheckBox( this, wxID_ANY, _("Procedural textures (slow)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbRaytracing_proceduralTextures->SetValue(true);
|
||||
gSizer1->Add( m_cbRaytracing_proceduralTextures, 0, wxRIGHT|wxLEFT, 5 );
|
||||
gSizer1->Add( m_cbRaytracing_proceduralTextures, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_cbRaytracing_addFloor = new wxCheckBox( this, wxID_ANY, _("Add floor (slow)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbRaytracing_addFloor->SetValue(true);
|
||||
gSizer1->Add( m_cbRaytracing_addFloor, 0, wxRIGHT|wxLEFT, 5 );
|
||||
gSizer1->Add( m_cbRaytracing_addFloor, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_cbRaytracing_antiAliasing = new wxCheckBox( this, wxID_ANY, _("Anti-aliasing (slow)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbRaytracing_antiAliasing->SetValue(true);
|
||||
gSizer1->Add( m_cbRaytracing_antiAliasing, 0, wxRIGHT|wxLEFT, 5 );
|
||||
gSizer1->Add( m_cbRaytracing_antiAliasing, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_cbRaytracing_postProcessing = new wxCheckBox( this, wxID_ANY, _("Screen space ambient occlusions and global illumination reflections (slow)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbRaytracing_postProcessing->SetValue(true);
|
||||
@@ -126,7 +123,7 @@ PANEL_3D_RAYTRACING_OPTIONS_BASE::PANEL_3D_RAYTRACING_OPTIONS_BASE( wxWindow* pa
|
||||
bSizerMain->Add( m_lightsLabel, 0, wxTOP|wxRIGHT|wxLEFT, 13 );
|
||||
|
||||
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizerMain->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
bSizerMain->Add( m_staticline2, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
wxBoxSizer* bLightsSizer;
|
||||
bLightsSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class PANEL_3D_RAYTRACING_OPTIONS_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -212,7 +212,10 @@ void PANEL_PREVIEW_3D_MODEL::loadSettings()
|
||||
// TODO(JE) use all control options
|
||||
m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0;
|
||||
|
||||
if( EDA_3D_VIEWER_SETTINGS* cfg = GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) )
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
if( cfg )
|
||||
{
|
||||
// Save the 3D viewer render settings, to restore it after closing the preview
|
||||
m_initialRender = cfg->m_Render;
|
||||
|
||||
@@ -158,7 +158,7 @@ PANEL_PREVIEW_3D_MODEL_BASE::PANEL_PREVIEW_3D_MODEL_BASE( wxWindow* parent, wxWi
|
||||
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Opacity") ), wxVERTICAL );
|
||||
|
||||
m_opacity = new wxSlider( sbSizer4->GetStaticBox(), wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
|
||||
sbSizer4->Add( m_opacity, 0, wxRIGHT|wxLEFT|wxEXPAND, 2 );
|
||||
sbSizer4->Add( m_opacity, 0, wxRIGHT|wxLEFT, 2 );
|
||||
|
||||
|
||||
bSizerLeft->Add( sbSizer4, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
@@ -1889,7 +1889,7 @@
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT|wxEXPAND</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxSlider" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
||||
+2
-3
@@ -168,9 +168,9 @@
|
||||
Thomas Gambier
|
||||
Ashutosh Gangwar
|
||||
Alessandro Gatti
|
||||
Zenn Geeraerts
|
||||
Alex Gellen
|
||||
Robert Antoni Buj Gelonch
|
||||
Robert Antoni Buj Genlonch
|
||||
Hal Gentz
|
||||
Lucas Gerads
|
||||
Davide Gerhard
|
||||
@@ -228,7 +228,6 @@
|
||||
Mario Hros
|
||||
Hubert Hu
|
||||
Josue Huaroto
|
||||
Eli Hughes
|
||||
Huibean
|
||||
Matt Huszagh
|
||||
José Ignacio
|
||||
@@ -622,7 +621,7 @@
|
||||
欠陥電気
|
||||
木 王
|
||||
郝弘毅
|
||||
Damjan Prerad
|
||||
Eli Hughes
|
||||
|
||||
See git repo on GitLab for contributors at
|
||||
https://gitlab.com/kicad/code/kicad/-/graphs/master
|
||||
+70
-96
@@ -22,7 +22,7 @@
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
#
|
||||
|
||||
cmake_minimum_required( VERSION 3.22 FATAL_ERROR )
|
||||
cmake_minimum_required( VERSION 3.21 FATAL_ERROR )
|
||||
|
||||
# Generate DEPFILES without transforming relative paths
|
||||
cmake_policy( SET CMP0116 OLD )
|
||||
@@ -62,21 +62,6 @@ set( CMAKE_MODULE_PATH "${KICAD_CMAKE_MODULE_PATH}" )
|
||||
|
||||
include( ConfigurePlatform )
|
||||
|
||||
if( WIN32 )
|
||||
# Without WIN32_LEAN_AND_MEAN defined including windows.h pulls in legacy
|
||||
# winsocks.h which conflicts with winsocks2.h used by modern libraries such
|
||||
# as curl.
|
||||
# There is no harm in defining this globally, at worst some additional
|
||||
# headers have to be included explicitly.
|
||||
add_compile_definitions( WIN32_LEAN_AND_MEAN )
|
||||
endif()
|
||||
|
||||
if( APPLE )
|
||||
# Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated.
|
||||
# Luckily we can silence warnings about its deprecation.
|
||||
add_compile_definitions( GL_SILENCE_DEPRECATION=1 )
|
||||
endif()
|
||||
|
||||
# Create a flag to identify the non-Apple unix systems
|
||||
if( UNIX AND NOT APPLE )
|
||||
set( UNIX_NOT_APPLE ON )
|
||||
@@ -130,6 +115,12 @@ option( KICAD_UPDATE_CHECK
|
||||
"Build in update check"
|
||||
ON )
|
||||
|
||||
# EGL is only needed on Linux with Wayland
|
||||
cmake_dependent_option( KICAD_USE_EGL
|
||||
"Build KiCad with EGL backend support for Wayland."
|
||||
OFF "UNIX_NOT_APPLE"
|
||||
OFF)
|
||||
|
||||
cmake_dependent_option( KICAD_USE_BUNDLED_GLEW
|
||||
"Use the bundled version of GLEW - only available when KICAD_USE_EGL is set"
|
||||
ON "KICAD_USE_EGL"
|
||||
@@ -295,6 +286,16 @@ add_compile_definitions( $<$<BOOL:${KICAD_GAL_PROFILE}>:KICAD_GAL_PROFILE> )
|
||||
add_compile_definitions( $<$<BOOL:${KICAD_WIN32_VERIFY_CODESIGN}>:KICAD_WIN32_VERIFY_CODESIGN> )
|
||||
add_compile_definitions( $<$<BOOL:${KICAD_UPDATE_CHECK}>:KICAD_UPDATE_CHECK> )
|
||||
|
||||
if( KICAD_USE_EGL )
|
||||
message( STATUS "Configuring KiCad for the wxGLCanvas EGL backend" )
|
||||
add_compile_definitions( KICAD_USE_EGL )
|
||||
endif()
|
||||
|
||||
if( KICAD_WAYLAND )
|
||||
message( STATUS "Configuring KiCad to support Wayland features" )
|
||||
add_compile_definitions( KICAD_WAYLAND )
|
||||
endif()
|
||||
|
||||
if( KICAD_IPC_API )
|
||||
add_definitions( -DKICAD_IPC_API )
|
||||
endif()
|
||||
@@ -754,6 +755,43 @@ if( KICAD_BUILD_I18N )
|
||||
find_package( Gettext REQUIRED )
|
||||
endif()
|
||||
|
||||
#
|
||||
# Find OpenGL library, required
|
||||
#
|
||||
if( KICAD_USE_EGL )
|
||||
find_package( OpenGL REQUIRED COMPONENTS OpenGL EGL )
|
||||
else()
|
||||
set( OpenGL_GL_PREFERENCE "LEGACY" ) # CMake 3.11+ setting; see 'cmake --help-policy CMP0072'
|
||||
find_package( OpenGL REQUIRED )
|
||||
endif()
|
||||
|
||||
#
|
||||
# Find GLEW library, required
|
||||
#
|
||||
# The EGL canvas on GTK requires the use of a GLEW version compiled with an EGL flag.
|
||||
# The one built in the thirdparty directory has the flag for EGL set, so we use it unless told
|
||||
# otherwise. Then we search for the system GLEW version and use that instead.
|
||||
#
|
||||
if( KICAD_USE_EGL AND KICAD_USE_BUNDLED_GLEW AND UNIX AND NOT APPLE )
|
||||
if( OpenGL_EGL_FOUND )
|
||||
message( STATUS "Found OpenGL EGL library: ${OPENGL_egl_LIBRARY}" )
|
||||
else()
|
||||
message( FATAL_ERROR "OpenGL EGL library not found" )
|
||||
endif()
|
||||
|
||||
# Add the custom GLEW target
|
||||
add_subdirectory( thirdparty/glew )
|
||||
|
||||
# Set the standard package variables to point to our custom target to mimic the system version.
|
||||
set( GLEW_LIBRARIES glew )
|
||||
set( GLEW_FOUND TRUE )
|
||||
include_directories( SYSTEM $<TARGET_PROPERTY:glew,INCLUDE_DIRECTORIES> )
|
||||
else()
|
||||
find_package( GLEW REQUIRED )
|
||||
check_find_package_result( GLEW_FOUND "GLEW" )
|
||||
include_directories( SYSTEM ${GLEW_INCLUDE_DIR} )
|
||||
endif()
|
||||
|
||||
#
|
||||
# Find GLM library, required
|
||||
#
|
||||
@@ -786,7 +824,7 @@ find_package( Pixman 0.30 REQUIRED )
|
||||
include_directories( SYSTEM ${PIXMAN_INCLUDE_DIR} )
|
||||
|
||||
# Find libgit2, required
|
||||
find_package( libgit2 1.5 REQUIRED )
|
||||
find_package( libgit2 REQUIRED )
|
||||
|
||||
# Set include directories for libgit
|
||||
include_directories(${LIBGIT2_INCLUDE_DIRS})
|
||||
@@ -838,37 +876,24 @@ if( OCC_VERSION_STRING VERSION_LESS 7.5.0 )
|
||||
endif()
|
||||
include_directories( SYSTEM ${OCC_INCLUDE_DIR} )
|
||||
|
||||
# Try to find Protobuf with modern approach first, fallback to legacy if needed
|
||||
set( _protobuf_found FALSE )
|
||||
|
||||
if( NOT KICAD_USE_CMAKE_FINDPROTOBUF )
|
||||
message( STATUS "Attempting to find Protobuf using CONFIG mode..." )
|
||||
find_package( Protobuf QUIET CONFIG )
|
||||
if( Protobuf_FOUND )
|
||||
set( Protobuf_LIBRARY "protobuf::libprotobuf" )
|
||||
set( _protobuf_found TRUE )
|
||||
message( STATUS "Found Protobuf using CONFIG mode" )
|
||||
else()
|
||||
message( STATUS "CONFIG mode failed, falling back to FindProtobuf.cmake" )
|
||||
set( KICAD_USE_CMAKE_FINDPROTOBUF ON )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( NOT _protobuf_found )
|
||||
message( STATUS "Using FindProtobuf.cmake to locate Protobuf..." )
|
||||
if( KICAD_USE_CMAKE_FINDPROTOBUF )
|
||||
include( FindProtobuf )
|
||||
find_package( Protobuf REQUIRED )
|
||||
if( Protobuf_FOUND )
|
||||
message( STATUS "Found Protobuf using FindProtobuf.cmake" )
|
||||
endif()
|
||||
else()
|
||||
find_package( Protobuf REQUIRED CONFIG )
|
||||
set( Protobuf_LIBRARY "protobuf::libprotobuf" )
|
||||
endif()
|
||||
|
||||
if( NOT Protobuf_PROTOC_EXECUTABLE )
|
||||
if( NOT KICAD_USE_CMAKE_FINDPROTOBUF)
|
||||
set( Protobuf_PROTOC_EXECUTABLE "protobuf::protoc" )
|
||||
else()
|
||||
MESSAGE( FATAL_ERROR "Protobuf compiler not found. Please install protobuf-compiler." )
|
||||
endif()
|
||||
if( NOT KICAD_USE_CMAKE_FINDPROTOBUF)
|
||||
set( Protobuf_PROTOC_EXECUTABLE "protobuf::protoc" )
|
||||
else()
|
||||
MESSAGE( FATAL_ERROR "Protobuf compiler not found. Please install protobuf-compiler." )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( NOT Protobuf_INCLUDE_DIR )
|
||||
get_target_property( Protobuf_INCLUDE_DIR protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES )
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1035,7 +1060,7 @@ include( ${wxWidgets_USE_FILE} )
|
||||
|
||||
# Detect wxWidgets port being used
|
||||
if( wxWidgets_FIND_STYLE STREQUAL "win32" )
|
||||
string(REGEX MATCH "(msw|qt|gtk)" KICAD_WX_PORT "${WX_CONFIGURATION}")
|
||||
string(REGEX MATCH "^[msw|qt|gtk]*" KICAD_WX_PORT "${WX_CONFIGURATION}")
|
||||
|
||||
if( KICAD_WX_PORT STREQUAL "qt" )
|
||||
add_compile_definitions( __WXQT__ )
|
||||
@@ -1043,7 +1068,7 @@ if( wxWidgets_FIND_STYLE STREQUAL "win32" )
|
||||
add_compile_definitions( __WXGTK__ )
|
||||
endif()
|
||||
elseif( _wx_selected_config )
|
||||
string(REGEX MATCH "(msw|qt|gtk|osx)" KICAD_WX_PORT "${_wx_selected_config}")
|
||||
string(REGEX MATCH "^[msw|qt|gtk|osx]*" KICAD_WX_PORT "${_wx_selected_config}")
|
||||
endif()
|
||||
|
||||
if( KICAD_WX_PORT )
|
||||
@@ -1052,8 +1077,6 @@ else()
|
||||
message( FATAL_ERROR "Unable to detect wxWidgets port")
|
||||
endif()
|
||||
|
||||
message(STATUS "wxUSE_GLCANVAS_EGL=${wxWidgets_GLCANVAS_EGL}")
|
||||
|
||||
if( NOT MSVC )
|
||||
if( ${wxWidgets_VERSION_STRING} VERSION_LESS 3.2 )
|
||||
message( FATAL_ERROR "wxWidgets 3.2.0 or greater is required" )
|
||||
@@ -1070,55 +1093,6 @@ if( MINGW )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
# Find OpenGL library, required
|
||||
#
|
||||
if( wxWidgets_GLCANVAS_EGL EQUAL 1 )
|
||||
set( KICAD_USE_EGL ON )
|
||||
find_package( OpenGL REQUIRED COMPONENTS OpenGL EGL )
|
||||
else()
|
||||
set( KICAD_USE_EGL OFF )
|
||||
set( OpenGL_GL_PREFERENCE "LEGACY" ) # CMake 3.11+ setting; see 'cmake --help-policy CMP0072'
|
||||
find_package( OpenGL REQUIRED )
|
||||
endif()
|
||||
|
||||
if( KICAD_USE_EGL )
|
||||
message( STATUS "Configuring KiCad for the wxGLCanvas EGL backend" )
|
||||
add_compile_definitions( KICAD_USE_EGL )
|
||||
endif()
|
||||
|
||||
if( KICAD_WAYLAND )
|
||||
message( STATUS "Configuring KiCad to support Wayland features" )
|
||||
add_compile_definitions( KICAD_WAYLAND )
|
||||
endif()
|
||||
|
||||
#
|
||||
# Find GLEW library, required
|
||||
#
|
||||
# The EGL canvas on GTK requires the use of a GLEW version compiled with an EGL flag.
|
||||
# The one built in the thirdparty directory has the flag for EGL set, so we use it unless told
|
||||
# otherwise. Then we search for the system GLEW version and use that instead.
|
||||
#
|
||||
if( KICAD_USE_EGL AND KICAD_USE_BUNDLED_GLEW )
|
||||
if( OpenGL_EGL_FOUND )
|
||||
message( STATUS "Found OpenGL EGL library: ${OPENGL_egl_LIBRARY}" )
|
||||
else()
|
||||
message( FATAL_ERROR "OpenGL EGL library not found" )
|
||||
endif()
|
||||
|
||||
# Add the custom GLEW target
|
||||
add_subdirectory( thirdparty/glew )
|
||||
|
||||
# Set the standard package variables to point to our custom target to mimic the system version.
|
||||
set( GLEW_LIBRARIES glew )
|
||||
set( GLEW_FOUND TRUE )
|
||||
include_directories( SYSTEM $<TARGET_PROPERTY:glew,INCLUDE_DIRECTORIES> )
|
||||
else()
|
||||
find_package( GLEW REQUIRED )
|
||||
check_find_package_result( GLEW_FOUND "GLEW" )
|
||||
include_directories( SYSTEM ${GLEW_INCLUDE_DIR} )
|
||||
endif()
|
||||
|
||||
if( APPLE )
|
||||
# Remove app bundles in ${KICAD_BIN} before installing anything new.
|
||||
# Must be defined before all includes so that it is executed first.
|
||||
|
||||
+47
-74
@@ -1,83 +1,56 @@
|
||||
{
|
||||
"version": 9,
|
||||
"version": 3,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "base",
|
||||
"hidden": true,
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
},
|
||||
"cacheVariables": {
|
||||
"KICAD_BUILD_QA_TESTS": "OFF",
|
||||
"KICAD_BUILD_I18N": "ON",
|
||||
"KICAD_SCRIPTING_WXPYTHON": "ON"
|
||||
}
|
||||
{
|
||||
"name": "base",
|
||||
"hidden": true,
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
},
|
||||
{
|
||||
"name": "win64",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"KICAD_WIN32_DPI_AWARE": "ON",
|
||||
"CMAKE_INSTALL_PREFIX": "out",
|
||||
"CMAKE_PDB_OUTPUT_DIRECTORY": "out/pdb"
|
||||
},
|
||||
"architecture": {
|
||||
"value": "x64",
|
||||
"strategy": "external"
|
||||
},
|
||||
"inherits": [
|
||||
"base"
|
||||
]
|
||||
"cacheVariables": {
|
||||
"KICAD_BUILD_QA_TESTS": "OFF",
|
||||
"KICAD_BUILD_I18N": "ON",
|
||||
"KICAD_SCRIPTING_WXPYTHON": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "win64",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"KICAD_WIN32_DPI_AWARE": "ON",
|
||||
"CMAKE_INSTALL_PREFIX": "out",
|
||||
"CMAKE_PDB_OUTPUT_DIRECTORY": "out/pdb"
|
||||
},
|
||||
{
|
||||
"name": "x64-debug",
|
||||
"displayName": "x64 Debug",
|
||||
"description": "Sets debug build type and x64 arch",
|
||||
"inherits": "win64",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
"architecture": {
|
||||
"value": "x64",
|
||||
"strategy": "external"
|
||||
},
|
||||
{
|
||||
"name": "x64-release",
|
||||
"displayName": "x64 Release",
|
||||
"description": "Sets release build type",
|
||||
"inherits": "win64",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||
}
|
||||
"inherits": [
|
||||
"base"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-debug",
|
||||
"displayName": "x64 Debug",
|
||||
"description": "Sets debug build type and x64 arch",
|
||||
"inherits": "win64",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "kicad",
|
||||
"configurePreset": "x64-debug",
|
||||
"configuration": "Debug",
|
||||
"targets": [
|
||||
"install"
|
||||
]
|
||||
}
|
||||
],
|
||||
"workflowPresets": [
|
||||
{
|
||||
"name": "kicad",
|
||||
"description": "kicad",
|
||||
"displayName": "kicad",
|
||||
"steps": [
|
||||
{
|
||||
"type": "configure",
|
||||
"name": "x64-debug"
|
||||
},
|
||||
{
|
||||
"type": "build",
|
||||
"name": "kicad"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-release",
|
||||
"displayName": "x64 Release",
|
||||
"description": "Sets release build type",
|
||||
"inherits": "win64",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+3
-2
@@ -6,6 +6,7 @@ AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: true
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllConstructorInitializersOnNextLine: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
@@ -23,7 +24,8 @@ BreakBeforeBraces: Allman
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: AfterColon
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 120
|
||||
ColumnLimit: 100
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 8
|
||||
ContinuationIndentWidth: 8
|
||||
Cpp11BracedListStyle: false
|
||||
@@ -37,7 +39,6 @@ KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
Language: Cpp
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: Inner
|
||||
PackConstructorInitializers: Never
|
||||
PointerAlignment: Left
|
||||
ReflowComments: false
|
||||
SortIncludes: false
|
||||
|
||||
@@ -189,42 +189,6 @@ message PadShapeAsPolygonResponse
|
||||
repeated kiapi.common.types.PolygonWithHoles polygons = 2;
|
||||
}
|
||||
|
||||
// Tests if the given set of items with padstacks (pads or vias) has content on the given set of layers.
|
||||
// This is a dynamic call rather than a property of the padstack because pads and vias can be set to only include
|
||||
// shapes on connected copper layers, and whether or not the pad is connected can't be determined in isolation.
|
||||
// To optimize API call performance, multiple items and multiple layers to test may be passed in with this
|
||||
// command message. The return will include the results for each valid item on each valid layer.
|
||||
// Note that not all layers make sense for a given item (for example, testing against BL_UNDEFINED never makes
|
||||
// sense). In general, the internal KiCad APIs will not return an error when testing non-sensical layers for a given
|
||||
// item, and instead will return a default of "true" for any such layers.
|
||||
message CheckPadstackPresenceOnLayers
|
||||
{
|
||||
kiapi.common.types.DocumentSpecifier board = 1;
|
||||
|
||||
repeated kiapi.common.types.KIID items = 2;
|
||||
|
||||
repeated kiapi.board.types.BoardLayer layers = 3;
|
||||
}
|
||||
|
||||
enum PadstackPresence
|
||||
{
|
||||
PSP_UNKNOWN = 0;
|
||||
PSP_PRESENT = 1; // The padstack has a shape on a given layer (is flashed)
|
||||
PSP_NOT_PRESENT = 2; // The padstack has no shape on a given layer (is not flashed)
|
||||
}
|
||||
|
||||
message PadstackPresenceEntry
|
||||
{
|
||||
kiapi.common.types.KIID item = 1;
|
||||
kiapi.board.types.BoardLayer layer = 2;
|
||||
PadstackPresence presence = 3;
|
||||
}
|
||||
|
||||
message PadstackPresenceResponse
|
||||
{
|
||||
repeated PadstackPresenceEntry entries = 1;
|
||||
}
|
||||
|
||||
// PCB editor commands
|
||||
|
||||
// returns BoardLayers
|
||||
|
||||
@@ -294,31 +294,15 @@ message PadStackLayer
|
||||
|
||||
enum SolderMaskMode
|
||||
{
|
||||
SMM_UNKNOWN = 0;
|
||||
SMM_UNKOWN = 0;
|
||||
SMM_MASKED = 1;
|
||||
SMM_UNMASKED = 2;
|
||||
SMM_FROM_DESIGN_RULES = 3;
|
||||
}
|
||||
|
||||
enum ViaCoveringMode
|
||||
{
|
||||
VCM_UNKNOWN = 0;
|
||||
VCM_COVERED = 1;
|
||||
VCM_UNCOVERED = 2;
|
||||
VCM_FROM_DESIGN_RULES = 3;
|
||||
}
|
||||
|
||||
enum ViaPluggingMode
|
||||
{
|
||||
VPM_UNKNOWN = 0;
|
||||
VPM_PLUGGED = 1;
|
||||
VPM_UNPLUGGED = 2;
|
||||
VPM_FROM_DESIGN_RULES = 3;
|
||||
}
|
||||
|
||||
enum SolderPasteMode
|
||||
{
|
||||
SPM_UNKNOWN = 0;
|
||||
SPM_UNKOWN = 0;
|
||||
SPM_PASTE = 1;
|
||||
SPM_NO_PASTE = 2;
|
||||
SPM_FROM_DESIGN_RULES = 3;
|
||||
@@ -335,9 +319,6 @@ message PadStackOuterLayer
|
||||
|
||||
// NOTE: At present, KiCad does not support different solder paste expansion settings for the top and bottom layers
|
||||
SolderPasteOverrides solder_paste_settings = 4;
|
||||
|
||||
ViaPluggingMode plugging_mode = 5;
|
||||
ViaCoveringMode covering_mode = 6;
|
||||
}
|
||||
|
||||
enum DrillShape
|
||||
@@ -348,22 +329,6 @@ enum DrillShape
|
||||
DS_UNDEFINED = 3;
|
||||
}
|
||||
|
||||
enum ViaDrillCappingMode
|
||||
{
|
||||
VDCM_UNKNOWN = 0;
|
||||
VDCM_CAPPED = 1;
|
||||
VDCM_UNCAPPED = 2;
|
||||
VDCM_FROM_DESIGN_RULES = 3;
|
||||
}
|
||||
|
||||
enum ViaDrillFillingMode
|
||||
{
|
||||
VDFM_UNKNOWN = 0;
|
||||
VDFM_FILLED = 1;
|
||||
VDFM_UNFILLED = 2;
|
||||
VDFM_FROM_DESIGN_RULES = 3;
|
||||
}
|
||||
|
||||
message DrillProperties
|
||||
{
|
||||
// Lowest (closest to F_Cu) layer this drill exists on.
|
||||
@@ -377,10 +342,6 @@ message DrillProperties
|
||||
kiapi.common.types.Vector2 diameter = 3;
|
||||
|
||||
DrillShape shape = 4;
|
||||
|
||||
ViaDrillCappingMode capped = 5;
|
||||
|
||||
ViaDrillFillingMode filled = 6;
|
||||
}
|
||||
|
||||
// A pad stack definition for a multilayer pad or via.
|
||||
@@ -609,7 +570,6 @@ enum PlacementRuleSourceType
|
||||
PRST_UNKNOWN = 0;
|
||||
PRST_SHEET_NAME = 1;
|
||||
PRST_COMPONENT_CLASS = 2;
|
||||
PRST_GROUP = 3;
|
||||
}
|
||||
|
||||
message RuleAreaSettings
|
||||
@@ -648,14 +608,6 @@ message ZoneFilledPolygons
|
||||
kiapi.common.types.PolySet shapes = 2;
|
||||
}
|
||||
|
||||
message ZoneLayerProperties
|
||||
{
|
||||
BoardLayer layer = 1;
|
||||
|
||||
kiapi.common.types.Vector2 hatching_offset = 2;
|
||||
}
|
||||
|
||||
|
||||
message Zone
|
||||
{
|
||||
kiapi.common.types.KIID id = 1;
|
||||
@@ -682,8 +634,6 @@ message Zone
|
||||
ZoneBorderSettings border = 11;
|
||||
|
||||
kiapi.common.types.LockedState locked = 12;
|
||||
|
||||
repeated ZoneLayerProperties layer_properties = 13;
|
||||
}
|
||||
|
||||
// An aligned dimension is drawn parallel to the line segment between the start and end points
|
||||
@@ -841,9 +791,7 @@ message ReferenceImage
|
||||
|
||||
message Group
|
||||
{
|
||||
kiapi.common.types.KIID id = 1;
|
||||
string name = 2;
|
||||
repeated kiapi.common.types.KIID items = 3;
|
||||
// TODO
|
||||
}
|
||||
|
||||
message FieldId
|
||||
@@ -912,19 +860,6 @@ message Footprint3DModel
|
||||
double opacity = 6;
|
||||
}
|
||||
|
||||
message JumperGroup
|
||||
{
|
||||
repeated string pad_names = 1;
|
||||
}
|
||||
|
||||
message JumperSettings
|
||||
{
|
||||
/// If true, duplicate pad names in this footprint are jumpered together
|
||||
bool duplicate_names_are_jumpered = 1;
|
||||
|
||||
repeated JumperGroup groups = 2;
|
||||
}
|
||||
|
||||
// A footprint definition (i.e. what would be in a library)
|
||||
message Footprint
|
||||
{
|
||||
@@ -942,8 +877,6 @@ message Footprint
|
||||
|
||||
// All footprint items except for mandatory fields
|
||||
repeated google.protobuf.Any items = 11;
|
||||
|
||||
JumperSettings jumpers = 12;
|
||||
}
|
||||
|
||||
// An instance of a footprint on a board
|
||||
@@ -963,7 +896,4 @@ message FootprintInstance
|
||||
|
||||
FootprintAttributes attributes = 11;
|
||||
FootprintDesignRuleOverrides overrides = 12;
|
||||
|
||||
// The sheet path to the associated symbol for this footprint instance, if one exists
|
||||
kiapi.common.types.SheetPath symbol_path = 13;
|
||||
}
|
||||
|
||||
@@ -222,14 +222,6 @@ message GetItems
|
||||
repeated kiapi.common.types.KiCadObjectType types = 2;
|
||||
}
|
||||
|
||||
message GetItemsById
|
||||
{
|
||||
// Specifies which document to query, which fields to return, etc.
|
||||
kiapi.common.types.ItemHeader header = 1;
|
||||
|
||||
repeated kiapi.common.types.KIID items = 2;
|
||||
}
|
||||
|
||||
message GetItemsResponse
|
||||
{
|
||||
// Specifies which document was modified, which fields are included in items, etc.
|
||||
|
||||
@@ -84,8 +84,6 @@ enum KiCadObjectType
|
||||
KOT_WSG_TEXT = 48;
|
||||
KOT_WSG_BITMAP = 49;
|
||||
KOT_WSG_PAGE = 50;
|
||||
|
||||
KOT_SCH_GROUP = 51;
|
||||
}
|
||||
|
||||
// Mapped to GR_TEXT_H_ALIGN_T
|
||||
|
||||
@@ -30,15 +30,11 @@
|
||||
#include <common.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <potracelib.h>
|
||||
#include <vector>
|
||||
#include <wx/arrstr.h>
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/dnd.h>
|
||||
#include <wx/rawbmp.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/dcclient.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/string.h>
|
||||
|
||||
#define DEFAULT_DPI 300 // the image DPI used in formats that do not define a DPI
|
||||
|
||||
@@ -62,12 +58,9 @@ BITMAP2CMP_PANEL::BITMAP2CMP_PANEL( BITMAP2CMP_FRAME* aParent ) :
|
||||
|
||||
m_buttonExportFile->Enable( false );
|
||||
m_buttonExportClipboard->Enable( false );
|
||||
|
||||
m_InitialPicturePanel->SetDropTarget( new DROP_FILE( this ) );
|
||||
m_GreyscalePicturePanel->SetDropTarget( new DROP_FILE( this ) );
|
||||
m_BNPicturePanel->SetDropTarget( new DROP_FILE( this ) );
|
||||
}
|
||||
|
||||
|
||||
wxWindow* BITMAP2CMP_PANEL::GetCurrentPage()
|
||||
{
|
||||
return m_Notebook->GetCurrentPage();
|
||||
@@ -569,33 +562,3 @@ void BITMAP2CMP_PANEL::OnFormatChange( wxCommandEvent& event )
|
||||
m_layerLabel->Enable( m_rbFootprint->GetValue() );
|
||||
m_layerCtrl->Enable( m_rbFootprint->GetValue() );
|
||||
}
|
||||
|
||||
|
||||
DROP_FILE::DROP_FILE( BITMAP2CMP_PANEL* panel ) :
|
||||
m_panel( panel )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool DROP_FILE::OnDropFiles( wxCoord x, wxCoord y, const wxArrayString& filenames )
|
||||
{
|
||||
m_panel->SetFocus();
|
||||
|
||||
// If a file is already loaded
|
||||
if( m_panel->GetOutputSizeX().GetOriginalSizePixels() != 0 )
|
||||
{
|
||||
wxString cap = _( "Replace Loaded File?" );
|
||||
wxString msg = _( "There is already a file loaded. Do you want to replace it?" );
|
||||
wxMessageDialog acceptFileDlg( m_panel, msg, cap, wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
|
||||
int replace = acceptFileDlg.ShowModal();
|
||||
|
||||
if( replace == wxID_NO )
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<wxString> fNameVec;
|
||||
fNameVec.insert( fNameVec.begin(), filenames.begin(), filenames.end() );
|
||||
m_panel->OpenProjectFiles( fNameVec );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include <bitmap2cmp_panel_base.h>
|
||||
#include <eda_units.h>
|
||||
#include <wx/dnd.h>
|
||||
|
||||
|
||||
class BITMAP2CMP_FRAME;
|
||||
class BITMAP2CMP_SETTINGS;
|
||||
@@ -134,18 +134,4 @@ private:
|
||||
bool m_negative;
|
||||
double m_aspectRatio;
|
||||
};
|
||||
|
||||
|
||||
class DROP_FILE : public wxFileDropTarget
|
||||
{
|
||||
public:
|
||||
DROP_FILE( BITMAP2CMP_PANEL* panel );
|
||||
DROP_FILE() = delete;
|
||||
|
||||
bool OnDropFiles( wxCoord x, wxCoord y, const wxArrayString& filenames ) override;
|
||||
|
||||
private:
|
||||
BITMAP2CMP_PANEL* m_panel;
|
||||
};
|
||||
|
||||
#endif// BITMAP2CMP_PANEL
|
||||
|
||||
+2
-1
@@ -48,7 +48,9 @@ set( OCC_LIBS_COMMON
|
||||
TKLCAF
|
||||
TKMath
|
||||
TKMesh
|
||||
TKMeshVS
|
||||
TKOffset
|
||||
TKOpenGl
|
||||
TKPrim
|
||||
TKRWMesh
|
||||
TKService
|
||||
@@ -136,7 +138,6 @@ else(WIN32)
|
||||
HINTS
|
||||
${OCC_LIBRARY_DIR}
|
||||
/usr
|
||||
/usr/opencascade
|
||||
/usr/local
|
||||
/usr/local/opencascade
|
||||
/opt/opencascade
|
||||
|
||||
@@ -520,15 +520,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
set(WX_LIB_DIR_PREFIX vc)
|
||||
endif()
|
||||
|
||||
set( EXTRA_LIB_PATH "" )
|
||||
if(VCPKG_TOOLCHAIN)
|
||||
if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
|
||||
set( EXTRA_LIB_PATH "${WX_ROOT_DIR}/debug/lib" )
|
||||
else()
|
||||
set( EXTRA_LIB_PATH "${WX_ROOT_DIR}/lib" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
find_path(wxWidgets_LIB_DIR
|
||||
NAMES
|
||||
@@ -545,7 +536,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
PATHS
|
||||
${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll # prefer shared
|
||||
${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib
|
||||
${EXTRA_LIB_PATH}
|
||||
DOC "Path to wxWidgets libraries"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
@@ -565,7 +555,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
PATHS
|
||||
${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib # prefer static
|
||||
${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll
|
||||
${EXTRA_LIB_PATH}
|
||||
DOC "Path to wxWidgets libraries"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
@@ -625,10 +614,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
set(WX_USE_REL_AND_DBG FALSE)
|
||||
endif()
|
||||
|
||||
if( VCPKG_TOOLCHAIN )
|
||||
set(WX_USE_REL_AND_DBG FALSE)
|
||||
endif()
|
||||
|
||||
# Get configuration parameters from the name.
|
||||
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} PF UNV UCD DBG)
|
||||
|
||||
@@ -799,14 +784,6 @@ else()
|
||||
|
||||
DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
|
||||
|
||||
execute_process(
|
||||
COMMAND sh -c "echo '#include <wx/platform.h>' ; echo CMAKE_WXTEST_RESULT wxUSE_GLCANVAS_EGL"
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ${wxWidgets_CXX_FLAGS} -E -
|
||||
COMMAND grep CMAKE_WXTEST_RESULT
|
||||
COMMAND cut "-d " -f2
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE wxWidgets_GLCANVAS_EGL )
|
||||
|
||||
# parse definitions from cxxflags;
|
||||
# drop -D* from CXXFLAGS and the -D prefix
|
||||
string(REGEX MATCHALL "-D[^;]+"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
# KiCad.
|
||||
#
|
||||
# Note: This version string should follow the semantic versioning system
|
||||
set( KICAD_SEMANTIC_VERSION "9.99.0-unknown" )
|
||||
set( KICAD_SEMANTIC_VERSION "9.0.2" )
|
||||
|
||||
# Default the version to the semantic version.
|
||||
# This is overridden by the git repository tag though (if using git)
|
||||
|
||||
@@ -259,8 +259,6 @@ if( MSVC )
|
||||
string( APPEND WARN_FLAGS_CXX " /wd5204 /wd4265" )
|
||||
# disable "layout of class may have changed from a previous version of the compiler"
|
||||
string( APPEND WARN_FLAGS_CXX " /wd4371" )
|
||||
# disable "'this': used in base member initializer list"
|
||||
string( APPEND WARN_FLAGS_CXX " /wd4355" )
|
||||
# disable "relative include path contains '..'"
|
||||
string( APPEND WARN_FLAGS_CXX " /wd4464" )
|
||||
# disable "'const' variable is not used"
|
||||
|
||||
+3
-46
@@ -71,14 +71,12 @@ set( KICOMMON_SRCS
|
||||
jobs/job_export_pcb_dxf.cpp
|
||||
jobs/job_export_pcb_gerber.cpp
|
||||
jobs/job_export_pcb_gerbers.cpp
|
||||
jobs/job_export_pcb_hpgl.cpp
|
||||
jobs/job_export_pcb_ipc2581.cpp
|
||||
jobs/job_export_pcb_ipcd356.cpp
|
||||
jobs/job_export_pcb_odb.cpp
|
||||
jobs/job_export_pcb_pdf.cpp
|
||||
jobs/job_export_pcb_plot.cpp
|
||||
jobs/job_export_pcb_pos.cpp
|
||||
jobs/job_export_pcb_ps.cpp
|
||||
jobs/job_export_pcb_svg.cpp
|
||||
jobs/job_export_pcb_gencad.cpp
|
||||
jobs/job_export_pcb_3d.cpp
|
||||
@@ -115,15 +113,10 @@ set( KICOMMON_SRCS
|
||||
settings/settings_manager.cpp
|
||||
|
||||
project/board_project_settings.cpp
|
||||
project/component_class_settings.cpp
|
||||
project/net_settings.cpp
|
||||
project/project_archiver.cpp
|
||||
project/project_file.cpp
|
||||
project/project_local_settings.cpp
|
||||
project/time_domain_parameters.cpp
|
||||
|
||||
# This is basically a settings object, but for the toolbar
|
||||
tool/ui/toolbar_configuration.cpp
|
||||
|
||||
dialogs/dialog_migrate_settings.cpp
|
||||
dialogs/dialog_migrate_settings_base.cpp
|
||||
@@ -148,7 +141,6 @@ set( KICOMMON_SRCS
|
||||
design_block_info_impl.cpp
|
||||
|
||||
advanced_config.cpp
|
||||
app_monitor.cpp
|
||||
asset_archive.cpp
|
||||
array_axis.cpp
|
||||
array_options.cpp
|
||||
@@ -245,7 +237,6 @@ target_link_libraries( kicommon
|
||||
fmt::fmt
|
||||
CURL::libcurl
|
||||
picosha2
|
||||
rapidcsv
|
||||
${ZSTD_LIBRARY}
|
||||
${wxWidgets_LIBRARIES}
|
||||
${LIBGIT2_LIBRARIES}
|
||||
@@ -267,7 +258,7 @@ if( KICAD_USE_SENTRY )
|
||||
target_link_libraries( kicommon
|
||||
sentry )
|
||||
|
||||
set_property(SOURCE app_monitor.cpp APPEND PROPERTY COMPILE_DEFINITIONS KICAD_SENTRY_DSN="${KICAD_SENTRY_DSN}")
|
||||
set_property(SOURCE pgm_base.cpp APPEND PROPERTY COMPILE_DEFINITIONS KICAD_SENTRY_DSN="${KICAD_SENTRY_DSN}")
|
||||
endif()
|
||||
|
||||
if( KICAD_IPC_API )
|
||||
@@ -358,8 +349,6 @@ set( COMMON_DLG_SRCS
|
||||
dialogs/dialog_color_picker_base.cpp
|
||||
dialogs/dialog_configure_paths.cpp
|
||||
dialogs/dialog_configure_paths_base.cpp
|
||||
dialogs/dialog_design_block_properties.cpp
|
||||
dialogs/dialog_design_block_properties_base.cpp
|
||||
dialogs/dialog_display_html_text_base.cpp
|
||||
dialogs/dialog_edit_library_tables.cpp
|
||||
dialogs/dialog_embed_files.cpp
|
||||
@@ -368,8 +357,6 @@ set( COMMON_DLG_SRCS
|
||||
dialogs/dialog_global_design_block_lib_table_config.cpp
|
||||
dialogs/dialog_grid_settings.cpp
|
||||
dialogs/dialog_grid_settings_base.cpp
|
||||
dialogs/dialog_group_properties.cpp
|
||||
dialogs/dialog_group_properties_base.cpp
|
||||
dialogs/dialog_hotkey_list.cpp
|
||||
dialogs/dialog_HTML_reporter_base.cpp
|
||||
dialogs/dialog_import_choose_project.cpp
|
||||
@@ -418,15 +405,10 @@ set( COMMON_DLG_SRCS
|
||||
dialogs/panel_plugin_settings.cpp
|
||||
dialogs/panel_plugin_settings_base.cpp
|
||||
dialogs/panel_setup_netclasses.cpp
|
||||
dialogs/panel_printer_list.cpp
|
||||
dialogs/panel_printer_list_base.cpp
|
||||
|
||||
dialogs/panel_setup_netclasses_base.cpp
|
||||
dialogs/panel_setup_severities.cpp
|
||||
dialogs/panel_text_variables.cpp
|
||||
dialogs/panel_text_variables_base.cpp
|
||||
dialogs/panel_toolbar_customization.cpp
|
||||
dialogs/panel_toolbar_customization_base.cpp
|
||||
)
|
||||
|
||||
if( KICAD_USE_SENTRY )
|
||||
@@ -437,11 +419,9 @@ endif()
|
||||
|
||||
set( COMMON_WIDGET_SRCS
|
||||
widgets/app_progress_dialog.cpp
|
||||
widgets/wx_bitmap_combobox.cpp
|
||||
widgets/bitmap_toggle.cpp
|
||||
widgets/button_row_panel.cpp
|
||||
widgets/color_swatch.cpp
|
||||
widgets/design_block_pane.cpp
|
||||
widgets/filter_combobox.cpp
|
||||
widgets/font_choice.cpp
|
||||
widgets/footprint_choice.cpp
|
||||
@@ -467,7 +447,6 @@ set( COMMON_WIDGET_SRCS
|
||||
widgets/mathplot.cpp
|
||||
widgets/msgpanel.cpp
|
||||
widgets/paged_dialog.cpp
|
||||
widgets/panel_design_block_chooser.cpp
|
||||
widgets/properties_panel.cpp
|
||||
widgets/search_pane.cpp
|
||||
widgets/search_pane_base.cpp
|
||||
@@ -530,6 +509,7 @@ set( PLOTTERS_CONTROL_SRCS
|
||||
plotters/plotter.cpp
|
||||
plotters/DXF_plotter.cpp
|
||||
plotters/GERBER_plotter.cpp
|
||||
plotters/HPGL_plotter.cpp
|
||||
plotters/PDF_plotter.cpp
|
||||
plotters/PS_plotter.cpp
|
||||
plotters/SVG_plotter.cpp
|
||||
@@ -558,16 +538,6 @@ set( COMMON_IO_SRCS
|
||||
# EasyEDA pro
|
||||
io/easyedapro/easyedapro_parser.cpp
|
||||
io/easyedapro/easyedapro_import_utils.cpp
|
||||
|
||||
io/csv.cpp
|
||||
)
|
||||
|
||||
set ( COMMON_TRANSLINE_CALCULATION_SRCS
|
||||
transline_calculations/transline_calculation_base.cpp
|
||||
transline_calculations/microstrip.cpp
|
||||
transline_calculations/coupled_microstrip.cpp
|
||||
transline_calculations/stripline.cpp
|
||||
transline_calculations/coupled_stripline.cpp
|
||||
)
|
||||
|
||||
set( COMMON_IMPORT_GFX_SRCS
|
||||
@@ -604,7 +574,6 @@ set( COMMON_SRCS
|
||||
${FONT_SRCS}
|
||||
${COMMON_IMPORT_GFX_SRCS}
|
||||
${COMMON_GIT_SRCS}
|
||||
${COMMON_TRANSLINE_CALCULATION_SRCS}
|
||||
base_screen.cpp
|
||||
bin_mod.cpp
|
||||
bitmap_base.cpp
|
||||
@@ -618,7 +587,6 @@ set( COMMON_SRCS
|
||||
eda_dde.cpp
|
||||
eda_doc.cpp
|
||||
eda_draw_frame.cpp
|
||||
eda_group.cpp
|
||||
eda_item.cpp
|
||||
eda_shape.cpp
|
||||
eda_text.cpp
|
||||
@@ -640,7 +608,6 @@ set( COMMON_SRCS
|
||||
lib_table_grid_tricks.cpp
|
||||
lib_tree_model.cpp
|
||||
lib_tree_model_adapter.cpp
|
||||
design_block_tree_model_adapter.cpp
|
||||
marker_base.cpp
|
||||
origin_transforms.cpp
|
||||
printout.cpp
|
||||
@@ -674,14 +641,12 @@ set( COMMON_SRCS
|
||||
tool/construction_manager.cpp
|
||||
tool/common_tools.cpp
|
||||
tool/conditional_menu.cpp
|
||||
tool/design_block_control.cpp
|
||||
tool/edit_constraints.cpp
|
||||
tool/edit_points.cpp
|
||||
tool/editor_conditions.cpp
|
||||
tool/embed_tool.cpp
|
||||
tool/grid_helper.cpp
|
||||
tool/grid_menu.cpp
|
||||
tool/group_tool.cpp
|
||||
tool/library_editor_control.cpp
|
||||
tool/picker_tool.cpp
|
||||
tool/point_editor_behavior.cpp
|
||||
@@ -803,10 +768,7 @@ set( PCB_COMMON_SRCS
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_parameters.cpp #needed by board_design_settings.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/router/pns_meander.cpp #needed by board_design_settings.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/board.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class_assignment_rule.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class_cache_proxy.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/component_classes/component_class_manager.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/component_class_manager.cpp #needed by board.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/board_item.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_dimension.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_shape.cpp
|
||||
@@ -865,7 +827,6 @@ set( PCB_COMMON_SRCS
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_parameters.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_utils.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/zone_settings.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_board_outline.cpp
|
||||
|
||||
# IO files
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/pcb_io.cpp
|
||||
@@ -881,10 +842,6 @@ set( PCB_COMMON_SRCS
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_editor_conditions.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_viewer_tools.cpp
|
||||
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/length_delay_calculation/length_delay_calculation.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/length_delay_calculation/length_delay_calculation_item.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/length_delay_calculation/time_domain_parameters_user_defined.cpp
|
||||
|
||||
widgets/net_selector.cpp
|
||||
)
|
||||
|
||||
|
||||
+20
-21
@@ -98,10 +98,12 @@ static const wxChar AllowManualCanvasScale[] = wxT( "AllowManualCanvasScale" );
|
||||
static const wxChar UpdateUIEventInterval[] = wxT( "UpdateUIEventInterval" );
|
||||
static const wxChar V3DRT_BevelHeight_um[] = wxT( "V3DRT_BevelHeight_um" );
|
||||
static const wxChar V3DRT_BevelExtentFactor[] = wxT( "V3DRT_BevelExtentFactor" );
|
||||
static const wxChar EnablePcbDesignBlocks[] = wxT( "EnablePcbDesignBlocks" );
|
||||
static const wxChar EnableDesignBlocks[] = wxT( "EnableDesignBlocks" );
|
||||
static const wxChar EnableGenerators[] = wxT( "EnableGenerators" );
|
||||
static const wxChar EnableLibWithText[] = wxT( "EnableLibWithText" );
|
||||
static const wxChar EnableLibDir[] = wxT( "EnableLibDir" );
|
||||
static const wxChar EnableEeschemaPrintCairo[] = wxT( "EnableEeschemaPrintCairo" );
|
||||
static const wxChar EnableEeschemaExportClipboardCairo[] = wxT( "EnableEeschemaExportClipboardCairo" );
|
||||
static const wxChar DisambiguationTime[] = wxT( "DisambiguationTime" );
|
||||
static const wxChar PcbSelectionVisibilityRatio[] = wxT( "PcbSelectionVisibilityRatio" );
|
||||
static const wxChar FontErrorSize[] = wxT( "FontErrorSize" );
|
||||
@@ -126,8 +128,6 @@ static const wxChar NetInspectorBulkUpdateOptimisationThreshold[] =
|
||||
wxT( "NetInspectorBulkUpdateOptimisationThreshold" );
|
||||
static const wxChar ExcludeFromSimulationLineWidth[] = wxT( "ExcludeFromSimulationLineWidth" );
|
||||
static const wxChar GitIconRefreshInterval[] = wxT( "GitIconRefreshInterval" );
|
||||
static const wxChar ConfigurableToolbars[] = wxT( "ConfigurableToolbars" );
|
||||
static const wxChar MaxPastedTextLength[] = wxT( "MaxPastedTextLength" );
|
||||
|
||||
} // namespace KEYS
|
||||
|
||||
@@ -256,11 +256,14 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||
m_CompactSave = false;
|
||||
m_UpdateUIEventInterval = 0;
|
||||
m_ShowRepairSchematic = false;
|
||||
m_EnablePcbDesignBlocks = false;
|
||||
m_EnableDesignBlocks = true;
|
||||
m_EnableGenerators = false;
|
||||
m_EnableLibWithText = false;
|
||||
m_EnableLibDir = false;
|
||||
|
||||
m_EnableEeschemaPrintCairo = true;
|
||||
m_EnableEeschemaExportClipboardCairo = true;
|
||||
|
||||
m_3DRT_BevelHeight_um = 30;
|
||||
m_3DRT_BevelExtentFactor = 1.0 / 16.0;
|
||||
|
||||
@@ -302,16 +305,12 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||
|
||||
m_MinimumMarkerSeparationDistance = 0.15;
|
||||
|
||||
m_NetInspectorBulkUpdateOptimisationThreshold = 100;
|
||||
m_NetInspectorBulkUpdateOptimisationThreshold = 25;
|
||||
|
||||
m_ExcludeFromSimulationLineWidth = 25;
|
||||
|
||||
m_GitIconRefreshInterval = 10000;
|
||||
|
||||
m_ConfigurableToolbars = false;
|
||||
|
||||
m_MaxPastedTextLength = 100;
|
||||
|
||||
loadFromConfigFile();
|
||||
}
|
||||
|
||||
@@ -492,8 +491,8 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
||||
m_DisambiguationMenuDelay,
|
||||
50, 10000 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnablePcbDesignBlocks, &m_EnablePcbDesignBlocks,
|
||||
m_EnablePcbDesignBlocks ) );
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableDesignBlocks,
|
||||
&m_EnableDesignBlocks, m_EnableDesignBlocks ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableGenerators,
|
||||
&m_EnableGenerators, m_EnableGenerators ) );
|
||||
@@ -507,6 +506,14 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableLibDir,
|
||||
&m_EnableLibDir, m_EnableLibDir ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableEeschemaPrintCairo,
|
||||
&m_EnableEeschemaPrintCairo,
|
||||
m_EnableEeschemaPrintCairo ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableEeschemaExportClipboardCairo,
|
||||
&m_EnableEeschemaExportClipboardCairo,
|
||||
m_EnableEeschemaExportClipboardCairo ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::PcbSelectionVisibilityRatio,
|
||||
&m_PcbSelectionVisibilityRatio,
|
||||
m_PcbSelectionVisibilityRatio, 0.0, 1.0 ) );
|
||||
@@ -525,11 +532,11 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::TriangulateSimplificationLevel,
|
||||
&m_TriangulateSimplificationLevel,
|
||||
m_TriangulateSimplificationLevel, 5, 1000 ) );
|
||||
m_TriangulateSimplificationLevel, 0, 1000 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::TriangulateMinimumArea,
|
||||
&m_TriangulateMinimumArea,
|
||||
m_TriangulateMinimumArea, 25, 100000 ) );
|
||||
m_TriangulateMinimumArea, 0, 100000 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableCacheFriendlyFracture,
|
||||
&m_EnableCacheFriendlyFracture,
|
||||
@@ -594,14 +601,6 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
||||
&m_GitIconRefreshInterval,
|
||||
m_GitIconRefreshInterval, 0, 100000 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ConfigurableToolbars,
|
||||
&m_ConfigurableToolbars,
|
||||
m_ConfigurableToolbars ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MaxPastedTextLength,
|
||||
&m_MaxPastedTextLength,
|
||||
m_MaxPastedTextLength, 0, 100000 ) );
|
||||
|
||||
// Special case for trace mask setting...we just grab them and set them immediately
|
||||
// Because we even use wxLogTrace inside of advanced config
|
||||
wxString traceMasks;
|
||||
|
||||
@@ -53,7 +53,6 @@ KICAD_T FromProtoEnum( types::KiCadObjectType aValue )
|
||||
case types::KiCadObjectType::KOT_PCB_DIMENSION: return PCB_DIMENSION_T;
|
||||
case types::KiCadObjectType::KOT_PCB_ZONE: return PCB_ZONE_T;
|
||||
case types::KiCadObjectType::KOT_PCB_GROUP: return PCB_GROUP_T;
|
||||
case types::KiCadObjectType::KOT_SCH_GROUP: return SCH_GROUP_T;
|
||||
case types::KiCadObjectType::KOT_SCH_MARKER: return SCH_MARKER_T;
|
||||
case types::KiCadObjectType::KOT_SCH_JUNCTION: return SCH_JUNCTION_T;
|
||||
case types::KiCadObjectType::KOT_SCH_NO_CONNECT: return SCH_NO_CONNECT_T;
|
||||
@@ -127,7 +126,6 @@ types::KiCadObjectType ToProtoEnum( KICAD_T aValue )
|
||||
case SCH_TABLECELL_T: return types::KiCadObjectType::KOT_SCH_TABLECELL;
|
||||
case SCH_LABEL_T: return types::KiCadObjectType::KOT_SCH_LABEL;
|
||||
case SCH_GLOBAL_LABEL_T: return types::KiCadObjectType::KOT_SCH_GLOBAL_LABEL;
|
||||
case SCH_GROUP_T: return types::KiCadObjectType::KOT_SCH_GROUP;
|
||||
case SCH_HIER_LABEL_T: return types::KiCadObjectType::KOT_SCH_HIER_LABEL;
|
||||
case SCH_DIRECTIVE_LABEL_T: return types::KiCadObjectType::KOT_SCH_DIRECTIVE_LABEL;
|
||||
case SCH_FIELD_T: return types::KiCadObjectType::KOT_SCH_FIELD;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <magic_enum.hpp>
|
||||
#include <api/api_utils.h>
|
||||
#include <geometry/shape_poly_set.h>
|
||||
#include <kiid.h>
|
||||
#include <wx/log.h>
|
||||
|
||||
const wxChar* const traceApi = wxT( "KICAD_API" );
|
||||
@@ -233,12 +232,4 @@ KICOMMON_API KIGFX::COLOR4D UnpackColor( const types::Color& aInput )
|
||||
return KIGFX::COLOR4D( r, g, b, a );
|
||||
}
|
||||
|
||||
KICOMMON_API void PackSheetPath( types::SheetPath& aOutput, const KIID_PATH& aInput )
|
||||
{
|
||||
aOutput.clear_path();
|
||||
|
||||
for( const KIID& entry : aInput )
|
||||
aOutput.add_path()->set_value( entry.AsStdString() );
|
||||
}
|
||||
|
||||
} // namespace kiapi::common
|
||||
|
||||
@@ -1,480 +0,0 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <app_monitor.h>
|
||||
#include <pgm_base.h>
|
||||
#include <magic_enum.hpp>
|
||||
#include <kiplatform/policy.h>
|
||||
#include <policy_keys.h>
|
||||
#include <paths.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/ffile.h>
|
||||
|
||||
#include <boost/uuid/uuid_io.hpp>
|
||||
#include <boost/uuid/uuid_generators.hpp>
|
||||
#include <build_version.h>
|
||||
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
#include <sentry.h>
|
||||
#endif
|
||||
|
||||
using namespace APP_MONITOR;
|
||||
|
||||
SENTRY::SENTRY() :
|
||||
m_isOptedIn( false )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void SENTRY::Init()
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
sentryInit();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void SENTRY::Cleanup()
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
sentry_close();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void SENTRY::AddTag( const wxString& aKey, const wxString& aValue )
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
sentry_set_tag( aKey.c_str(), aValue.c_str() );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void SENTRY::SetSentryOptIn( bool aOptIn )
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
if( aOptIn )
|
||||
{
|
||||
// Opting in (when not opted in before) may require reading the uid off disk
|
||||
// as it was skipped previously.
|
||||
readOrCreateUid();
|
||||
|
||||
if( !m_sentry_optin_fn.Exists() )
|
||||
{
|
||||
wxFFile sentryInitFile( m_sentry_optin_fn.GetFullPath(), "w" );
|
||||
sentryInitFile.Write( "" );
|
||||
sentryInitFile.Close();
|
||||
}
|
||||
|
||||
m_isOptedIn = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( m_sentry_optin_fn.Exists() )
|
||||
{
|
||||
wxRemoveFile( m_sentry_optin_fn.GetFullPath() );
|
||||
sentry_close();
|
||||
}
|
||||
|
||||
m_isOptedIn = false;
|
||||
}
|
||||
#else
|
||||
m_isOptedIn = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
wxString SENTRY::sentryCreateUid()
|
||||
{
|
||||
boost::uuids::uuid uuid = boost::uuids::random_generator()();
|
||||
wxString userGuid = boost::uuids::to_string( uuid );
|
||||
|
||||
wxFFile sentryInitFile( m_sentry_uid_fn.GetFullPath(), "w" );
|
||||
sentryInitFile.Write( userGuid );
|
||||
sentryInitFile.Close();
|
||||
|
||||
return userGuid;
|
||||
}
|
||||
|
||||
|
||||
void SENTRY::ResetSentryId()
|
||||
{
|
||||
m_sentryUid = sentryCreateUid();
|
||||
}
|
||||
|
||||
|
||||
const wxString& SENTRY::GetSentryId()
|
||||
{
|
||||
return m_sentryUid;
|
||||
}
|
||||
|
||||
|
||||
void SENTRY::readOrCreateUid()
|
||||
{
|
||||
wxFFile sentryInitFile( m_sentry_uid_fn.GetFullPath() );
|
||||
sentryInitFile.ReadAll( &m_sentryUid );
|
||||
sentryInitFile.Close();
|
||||
|
||||
if( m_sentryUid.IsEmpty() || m_sentryUid.length() != 36 )
|
||||
{
|
||||
ResetSentryId();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SENTRY::sentryInit()
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
m_sentry_optin_fn = wxFileName( PATHS::GetUserCachePath(), "sentry-opt-in" );
|
||||
m_sentry_uid_fn = wxFileName( PATHS::GetUserCachePath(), "sentry-uid" );
|
||||
|
||||
if( isConfiguredOptedIn() )
|
||||
{
|
||||
m_isOptedIn = true;
|
||||
|
||||
readOrCreateUid();
|
||||
|
||||
sentry_options_t* options = sentry_options_new();
|
||||
|
||||
#ifndef KICAD_SENTRY_DSN
|
||||
#error "Project configuration error, missing KICAD_SENTRY_DSN"
|
||||
#endif
|
||||
// only capture 5% of transactions
|
||||
sentry_options_set_traces_sample_rate( options, 0.05 );
|
||||
sentry_options_set_dsn( options, KICAD_SENTRY_DSN );
|
||||
|
||||
wxFileName tmp;
|
||||
tmp.AssignDir( PATHS::GetUserCachePath() );
|
||||
tmp.AppendDir( "sentry" );
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
sentry_options_set_database_pathw( options, tmp.GetPathWithSep().wc_str() );
|
||||
#else
|
||||
sentry_options_set_database_path( options, tmp.GetPathWithSep().c_str() );
|
||||
#endif
|
||||
sentry_options_set_symbolize_stacktraces( options, true );
|
||||
sentry_options_set_auto_session_tracking( options, false );
|
||||
|
||||
sentry_options_set_release( options, GetCommitHash().ToStdString().c_str() );
|
||||
|
||||
// This just gives us more filtering within sentry, issues still get grouped across
|
||||
// environments.
|
||||
sentry_options_set_environment( options, GetMajorMinorVersion().c_str() );
|
||||
|
||||
sentry_init( options );
|
||||
|
||||
sentry_value_t user = sentry_value_new_object();
|
||||
sentry_value_set_by_key( user, "id", sentry_value_new_string( m_sentryUid.c_str() ) );
|
||||
sentry_set_user( user );
|
||||
|
||||
sentry_set_tag( "kicad.version", GetBuildVersion().ToStdString().c_str() );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
bool SENTRY::isConfiguredOptedIn()
|
||||
{
|
||||
// policy takes precedence
|
||||
KIPLATFORM::POLICY::PBOOL policyState = KIPLATFORM::POLICY::GetPolicyBool( POLICY_KEY_DATACOLLECTION );
|
||||
if( policyState != KIPLATFORM::POLICY::PBOOL::NOT_CONFIGURED )
|
||||
{
|
||||
return policyState == KIPLATFORM::POLICY::PBOOL::ENABLED;
|
||||
}
|
||||
|
||||
return m_sentry_optin_fn.Exists();
|
||||
}
|
||||
|
||||
|
||||
bool SENTRY::IsOptedIn()
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
// always override with policy, just in case
|
||||
KIPLATFORM::POLICY::PBOOL policyState = KIPLATFORM::POLICY::GetPolicyBool( POLICY_KEY_DATACOLLECTION );
|
||||
if( policyState != KIPLATFORM::POLICY::PBOOL::NOT_CONFIGURED )
|
||||
{
|
||||
return policyState == KIPLATFORM::POLICY::PBOOL::ENABLED;
|
||||
}
|
||||
|
||||
return m_isOptedIn;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void SENTRY::LogAssert( const ASSERT_CACHE_KEY& aKey, const wxString& aAssertMsg )
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
if( !APP_MONITOR::SENTRY::Instance()->IsOptedIn() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// We use an assert cache to avoid collecting too many events
|
||||
// Because they can come from functions that are called hundreds of times in loops
|
||||
if( m_assertCache.find( aKey ) == m_assertCache.end() )
|
||||
{
|
||||
sentry_value_t exc = sentry_value_new_exception( "assert", aAssertMsg.c_str() );
|
||||
sentry_value_set_stacktrace( exc, NULL, 0 );
|
||||
|
||||
sentry_value_t sentryEvent = sentry_value_new_event();
|
||||
sentry_event_add_exception( sentryEvent, exc );
|
||||
sentry_capture_event( sentryEvent );
|
||||
m_assertCache.insert( aKey );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void SENTRY::LogException( const wxString& aMsg )
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
if( !APP_MONITOR::SENTRY::Instance()->IsOptedIn() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sentry_value_t exc = sentry_value_new_exception( "exception", aMsg.c_str() );
|
||||
sentry_value_set_stacktrace( exc, NULL, 0 );
|
||||
|
||||
sentry_value_t sentryEvent = sentry_value_new_event();
|
||||
sentry_event_add_exception( sentryEvent, exc );
|
||||
sentry_capture_event( sentryEvent );
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
static std::string GetSentryBreadCrumbType( BREADCRUMB_TYPE aType )
|
||||
{
|
||||
// the only special case due to collisions with defines
|
||||
if( aType == BREADCRUMB_TYPE::DBG )
|
||||
return "debug";
|
||||
|
||||
if( aType == BREADCRUMB_TYPE::ERR )
|
||||
return "error";
|
||||
|
||||
std::string ret( magic_enum::enum_name( aType ) );
|
||||
|
||||
std::transform( ret.begin(), ret.end(), ret.begin(),
|
||||
[]( unsigned char c )
|
||||
{
|
||||
return std::tolower( c );
|
||||
} );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static std::string GetSentryBreadCrumbLevel( BREADCRUMB_LEVEL aLevel )
|
||||
{
|
||||
// the only special case due to collisions with defines
|
||||
if( aLevel == BREADCRUMB_LEVEL::DBG )
|
||||
return "debug";
|
||||
|
||||
if( aLevel == BREADCRUMB_LEVEL::ERR )
|
||||
return "error";
|
||||
|
||||
std::string ret( magic_enum::enum_name( aLevel ) );
|
||||
|
||||
std::transform( ret.begin(), ret.end(), ret.begin(),
|
||||
[]( unsigned char c )
|
||||
{
|
||||
return std::tolower( c );
|
||||
} );
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace APP_MONITOR
|
||||
{
|
||||
SENTRY* SENTRY::m_instance = nullptr;
|
||||
|
||||
|
||||
bool operator<( const ASSERT_CACHE_KEY& aKey1, const ASSERT_CACHE_KEY& aKey2 )
|
||||
{
|
||||
return aKey1.file < aKey2.file || aKey1.line < aKey2.line || aKey1.func < aKey2.func || aKey1.cond < aKey2.cond;
|
||||
}
|
||||
|
||||
|
||||
void AddBreadcrumb( BREADCRUMB_TYPE aType, const wxString& aMsg, const wxString& aCategory, BREADCRUMB_LEVEL aLevel )
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
if( !SENTRY::Instance()->IsOptedIn() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::string type = GetSentryBreadCrumbType( aType );
|
||||
sentry_value_t crumb = sentry_value_new_breadcrumb( type.c_str(), aMsg.c_str() );
|
||||
|
||||
sentry_value_set_by_key( crumb, "category", sentry_value_new_string( aCategory.c_str() ) );
|
||||
|
||||
if( aType == BREADCRUMB_TYPE::ERR )
|
||||
{
|
||||
std::string level = GetSentryBreadCrumbLevel( aLevel );
|
||||
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( level.c_str() ) );
|
||||
}
|
||||
|
||||
sentry_add_breadcrumb( crumb );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void AddNavigationBreadcrumb( const wxString& aMsg, const wxString& aCategory )
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
AddBreadcrumb( BREADCRUMB_TYPE::NAVIGATION, aMsg, aCategory, BREADCRUMB_LEVEL::INFO );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void AddTransactionBreadcrumb( const wxString& aMsg, const wxString& aCategory )
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
AddBreadcrumb( BREADCRUMB_TYPE::TRANSACTION, aMsg, aCategory, BREADCRUMB_LEVEL::INFO );
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
class TRANSACTION_IMPL
|
||||
{
|
||||
public:
|
||||
TRANSACTION_IMPL( const std::string& aName, const std::string& aOperation )
|
||||
{
|
||||
m_ctx = sentry_transaction_context_new( aName.c_str(), aOperation.c_str() );
|
||||
}
|
||||
|
||||
~TRANSACTION_IMPL() {
|
||||
Finish();
|
||||
|
||||
// note m_ctx is handled by sentry
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
m_tx = sentry_transaction_start( m_ctx, sentry_value_new_null() );
|
||||
}
|
||||
|
||||
void Finish()
|
||||
{
|
||||
FinishSpan();
|
||||
|
||||
if( m_tx )
|
||||
{
|
||||
sentry_transaction_finish( m_tx );
|
||||
m_tx = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void StartSpan( const std::string& aOperation, const std::string& aDescription )
|
||||
{
|
||||
if( m_span )
|
||||
return;
|
||||
|
||||
if( !m_tx )
|
||||
return;
|
||||
|
||||
m_span = sentry_transaction_start_child( m_tx, aOperation.c_str(), aDescription.c_str() );
|
||||
}
|
||||
|
||||
void FinishSpan()
|
||||
{
|
||||
if( m_span )
|
||||
{
|
||||
sentry_span_finish( m_span );
|
||||
m_span = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
sentry_transaction_context_t* m_ctx = nullptr;
|
||||
sentry_transaction_t* m_tx = nullptr;
|
||||
sentry_span_t* m_span = nullptr;
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
TRANSACTION::TRANSACTION( const std::string& aName, const std::string& aOperation )
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
if( SENTRY::Instance()->IsOptedIn() )
|
||||
{
|
||||
m_impl = new TRANSACTION_IMPL( aName, aOperation );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
TRANSACTION::~TRANSACTION()
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
delete m_impl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void TRANSACTION::Start()
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
if( m_impl )
|
||||
{
|
||||
m_impl->Start();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void TRANSACTION::StartSpan( const std::string& aOperation, const std::string& aDescription )
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
if( m_impl )
|
||||
{
|
||||
m_impl->StartSpan( aOperation, aDescription );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void TRANSACTION::Finish()
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
if( m_impl )
|
||||
{
|
||||
m_impl->Finish();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void TRANSACTION::FinishSpan()
|
||||
{
|
||||
#ifdef KICAD_USE_SENTRY
|
||||
if( m_impl )
|
||||
{
|
||||
m_impl->FinishSpan();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -134,6 +134,7 @@ void ARRAY_AXIS::SetStep( int aStep )
|
||||
|
||||
wxString ARRAY_AXIS::GetItemNumber( int n ) const
|
||||
{
|
||||
wxString itemNum;
|
||||
const wxString& alphabet = GetAlphabet();
|
||||
const bool nonUnitColsStartAt0 = schemeNonUnitColsStartAt0( m_type );
|
||||
|
||||
|
||||
@@ -133,11 +133,6 @@ ARRAY_OPTIONS::TRANSFORM ARRAY_CIRCULAR_OPTIONS::GetTransform( int n, const VECT
|
||||
// n'th step
|
||||
angle = EDA_ANGLE( m_angle.AsDegrees() * n, DEGREES_T );
|
||||
|
||||
angle += m_angleOffset;
|
||||
|
||||
if( m_clockwise )
|
||||
angle = -angle;
|
||||
|
||||
VECTOR2I new_pos = aPos;
|
||||
RotatePoint( new_pos, m_centre, angle );
|
||||
|
||||
|
||||
@@ -173,10 +173,9 @@ private:
|
||||
|
||||
|
||||
BACKGROUND_JOB_REPORTER::BACKGROUND_JOB_REPORTER( BACKGROUND_JOBS_MONITOR* aMonitor,
|
||||
const std::shared_ptr<BACKGROUND_JOB>& aJob ) :
|
||||
std::shared_ptr<BACKGROUND_JOB> aJob ) :
|
||||
PROGRESS_REPORTER_BASE( 1 ),
|
||||
m_monitor( aMonitor ),
|
||||
m_job( aJob )
|
||||
m_monitor( aMonitor ), m_job( aJob )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -306,8 +305,10 @@ void BACKGROUND_JOBS_MONITOR::ShowList( wxWindow* aParent, wxPoint aPos )
|
||||
|
||||
std::shared_lock<std::shared_mutex> lock( m_mutex, std::try_to_lock );
|
||||
|
||||
for( const std::shared_ptr<BACKGROUND_JOB>& job : m_jobs )
|
||||
for( std::shared_ptr<BACKGROUND_JOB> job : m_jobs )
|
||||
{
|
||||
list->Add( job );
|
||||
}
|
||||
|
||||
lock.unlock();
|
||||
|
||||
|
||||
@@ -102,8 +102,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_16.png" ), 16, wxT( "light" ) );
|
||||
@@ -187,8 +185,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@@ -272,8 +268,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_32.png" ), 32, wxT( "light" ) );
|
||||
@@ -357,8 +351,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@@ -4901,7 +4893,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::color_code_tolerance].emplace_back( BITMAPS::color_code_tolerance, wxT( "color_code_tolerance.png" ), -1, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::color_code_value].emplace_back( BITMAPS::color_code_value, wxT( "color_code_value.png" ), -1, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::color_code_value_and_name].emplace_back( BITMAPS::color_code_value_and_name, wxT( "color_code_value_and_name.png" ), -1, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::coupled_stripline].emplace_back( BITMAPS::coupled_stripline, wxT( "coupled_stripline.png" ), -1, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::creepage_clearance].emplace_back( BITMAPS::creepage_clearance, wxT( "creepage_clearance.png" ), -1, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cpw].emplace_back( BITMAPS::cpw, wxT( "cpw.png" ), -1, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::cpw_back].emplace_back( BITMAPS::cpw_back, wxT( "cpw_back.png" ), -1, wxT( "light" ) );
|
||||
@@ -4937,7 +4928,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::color_code_tolerance].emplace_back( BITMAPS::color_code_tolerance, wxT( "color_code_tolerance_dark.png" ), -1, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::color_code_value].emplace_back( BITMAPS::color_code_value, wxT( "color_code_value_dark.png" ), -1, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::color_code_value_and_name].emplace_back( BITMAPS::color_code_value_and_name, wxT( "color_code_value_and_name_dark.png" ), -1, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::coupled_stripline].emplace_back( BITMAPS::coupled_stripline, wxT( "coupled_stripline_dark.png" ), -1, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::creepage_clearance].emplace_back( BITMAPS::creepage_clearance, wxT( "creepage_clearance_dark.png" ), -1, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cpw].emplace_back( BITMAPS::cpw, wxT( "cpw_dark.png" ), -1, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::cpw_back].emplace_back( BITMAPS::cpw_back, wxT( "cpw_back_dark.png" ), -1, wxT( "dark" ) );
|
||||
|
||||
+14
-28
@@ -31,7 +31,6 @@
|
||||
#include <build_version.h>
|
||||
|
||||
#include <tuple>
|
||||
#include <mutex>
|
||||
|
||||
// kicad_curl.h must be included before wx headers, to avoid
|
||||
// conflicts for some defines, at least on Windows
|
||||
@@ -52,9 +51,6 @@ extern std::string GetCurlLibVersion();
|
||||
#include <kicad_build_version.h>
|
||||
#undef INCLUDE_KICAD_VERSION
|
||||
|
||||
// Mutex for wxPlatformInfo
|
||||
static std::recursive_mutex s_platformInfoMutex;
|
||||
|
||||
// Remember OpenGL info
|
||||
static wxString s_glVendor;
|
||||
static wxString s_glRenderer;
|
||||
@@ -70,10 +66,8 @@ void SetOpenGLInfo( const char* aVendor, const char* aRenderer, const char* aVer
|
||||
|
||||
wxString GetPlatformGetBitnessName()
|
||||
{
|
||||
// wxPlatformInfo is not thread-safe, so protect it
|
||||
std::unique_lock lock(s_platformInfoMutex);
|
||||
|
||||
return wxPlatformInfo().GetBitnessName();
|
||||
wxPlatformInfo platform;
|
||||
return platform.GetBitnessName();
|
||||
}
|
||||
|
||||
|
||||
@@ -163,6 +157,7 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
|
||||
#endif
|
||||
<< " build";
|
||||
|
||||
wxPlatformInfo platform;
|
||||
aMsg << "Application: " << aTitle;
|
||||
aMsg << " " << wxGetCpuArchitectureName() << " on " << wxGetNativeCpuArchitectureName();
|
||||
|
||||
@@ -192,19 +187,14 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
|
||||
// Linux uses the lsb-release program to get the description of the OS, if lsb-release
|
||||
// isn't installed, then the string will be empty and we fallback to the method used on
|
||||
// the other platforms (to at least get the kernel/uname info).
|
||||
if( osDescription.empty() )
|
||||
osDescription = wxGetOsDescription();
|
||||
if( osDescription.empty() )
|
||||
osDescription = wxGetOsDescription();
|
||||
|
||||
{
|
||||
// wxPlatformInfo is not thread-safe, so protect it
|
||||
std::unique_lock lock( s_platformInfoMutex );
|
||||
|
||||
aMsg << "Platform: "
|
||||
<< osDescription << ", "
|
||||
<< GetPlatformGetBitnessName() << ", "
|
||||
<< wxPlatformInfo().GetEndiannessName() << ", "
|
||||
<< wxPlatformInfo().GetPortIdName();
|
||||
}
|
||||
aMsg << "Platform: "
|
||||
<< osDescription << ", "
|
||||
<< GetPlatformGetBitnessName() << ", "
|
||||
<< platform.GetEndiannessName() << ", "
|
||||
<< platform.GetPortIdName();
|
||||
|
||||
#ifdef __WXGTK__
|
||||
if( wxTheApp && wxTheApp->IsGUI() )
|
||||
@@ -250,15 +240,11 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
|
||||
|
||||
// Get the GTK+ version where possible.
|
||||
#ifdef __WXGTK__
|
||||
{
|
||||
// wxPlatformInfo is not thread-safe, so protect it
|
||||
std::unique_lock lock( s_platformInfoMutex );
|
||||
int major, minor;
|
||||
int major, minor;
|
||||
|
||||
major = wxPlatformInfo().GetToolkitMajorVersion();
|
||||
minor = wxPlatformInfo().GetToolkitMinorVersion();
|
||||
aMsg << " GTK+ " << major << "." << minor;
|
||||
}
|
||||
major = wxPlatformInfo().Get().GetToolkitMajorVersion();
|
||||
minor = wxPlatformInfo().Get().GetToolkitMinorVersion();
|
||||
aMsg << " GTK+ " << major << "." << minor;
|
||||
#endif
|
||||
|
||||
aMsg << eol;
|
||||
|
||||
+1
-69
@@ -26,12 +26,6 @@
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/sstream.h>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include <io/csv.h>
|
||||
|
||||
|
||||
bool SaveClipboard( const std::string& aTextUTF8 )
|
||||
@@ -112,66 +106,4 @@ std::unique_ptr<wxImage> GetImageFromClipboard()
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
bool SaveTabularDataToClipboard( const std::vector<std::vector<wxString>>& aData )
|
||||
{
|
||||
wxLogNull doNotLog; // disable logging of failed clipboard actions
|
||||
|
||||
if( wxTheClipboard->Open() )
|
||||
{
|
||||
wxDataObjectComposite* data = new wxDataObjectComposite();
|
||||
|
||||
// Set plain text CSV
|
||||
{
|
||||
wxStringOutputStream os;
|
||||
CSV_WRITER writer( os );
|
||||
writer.WriteLines( aData );
|
||||
|
||||
data->Add( new wxTextDataObject( os.GetString() ), true );
|
||||
}
|
||||
|
||||
// At this point, it would be great if we could add some format that spreadsheet
|
||||
// programs can understand without asking the user for options: perhaps SYLK or DIF.
|
||||
// But it doesn't seem like WX allows to put arbitrary MIME types on the clipboard,
|
||||
// even with wxCustomDataObject( wxDataFormat( "mime/type" ) ), which just ends up as
|
||||
// wxDF_PRIVATE, and wxDF_SYLK/DIF aren't mapped on GTK.
|
||||
|
||||
wxTheClipboard->SetData( data );
|
||||
wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
|
||||
wxTheClipboard->Close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool GetTabularDataFromClipboard( std::vector<std::vector<wxString>>& aData )
|
||||
{
|
||||
// Again, it would be ideal if we could detect a spreadsheet mimetype here,
|
||||
// but WX doesn't seem to do that on Linux, at least.
|
||||
|
||||
bool ok = false;
|
||||
|
||||
// First try for text data
|
||||
if( wxTheClipboard->Open() )
|
||||
{
|
||||
if( wxTheClipboard->IsSupported( wxDF_TEXT ) )
|
||||
{
|
||||
wxTextDataObject data;
|
||||
if( wxTheClipboard->GetData( data ) )
|
||||
{
|
||||
ok = AutoDecodeCSV( data.GetText(), aData );
|
||||
}
|
||||
}
|
||||
|
||||
// We could also handle .csv wxDF_FILENAMEs here
|
||||
|
||||
wxTheClipboard->Close();
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
+28
-13
@@ -28,7 +28,6 @@
|
||||
#include <core/kicad_algo.h>
|
||||
#include <commit.h>
|
||||
#include <eda_item.h>
|
||||
#include <eda_group.h>
|
||||
#include <macros.h>
|
||||
|
||||
COMMIT::COMMIT()
|
||||
@@ -39,12 +38,14 @@ COMMIT::COMMIT()
|
||||
COMMIT::~COMMIT()
|
||||
{
|
||||
for( COMMIT_LINE& ent : m_changes )
|
||||
delete ent.m_copy;
|
||||
{
|
||||
if( ent.m_copy )
|
||||
delete ent.m_copy;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aScreen,
|
||||
RECURSE_MODE aRecurse )
|
||||
COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aScreen )
|
||||
{
|
||||
// CHT_MODIFY and CHT_DONE are not compatible
|
||||
wxASSERT( ( aChangeType & ( CHT_MODIFY | CHT_DONE ) ) != ( CHT_MODIFY | CHT_DONE ) );
|
||||
@@ -55,25 +56,32 @@ COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aS
|
||||
{
|
||||
case CHT_ADD:
|
||||
makeEntry( aItem, CHT_ADD | flag, nullptr, aScreen );
|
||||
break;
|
||||
return *this;
|
||||
|
||||
case CHT_REMOVE:
|
||||
wxASSERT( m_deletedItems.find( aItem ) == m_deletedItems.end() );
|
||||
m_deletedItems.insert( aItem );
|
||||
makeEntry( aItem, CHT_REMOVE | flag, makeImage( aItem ), aScreen );
|
||||
|
||||
if( EDA_GROUP* parentGroup = aItem->GetParentGroup() )
|
||||
Modify( parentGroup->AsEdaItem(), aScreen, RECURSE_MODE::NO_RECURSE );
|
||||
|
||||
break;
|
||||
makeEntry( aItem, CHT_REMOVE | flag, nullptr, aScreen );
|
||||
return *this;
|
||||
|
||||
case CHT_MODIFY:
|
||||
{
|
||||
EDA_ITEM* parent = parentObject( aItem );
|
||||
createModified( parent, makeImage( parent ), flag, aScreen );
|
||||
EDA_ITEM* clone = makeImage( parent );
|
||||
|
||||
wxASSERT( clone );
|
||||
|
||||
if( clone )
|
||||
return createModified( parent, clone, flag, aScreen );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case CHT_GROUP:
|
||||
case CHT_UNGROUP:
|
||||
makeEntry( aItem, aChangeType, nullptr, aScreen );
|
||||
return *this;
|
||||
|
||||
default:
|
||||
wxFAIL;
|
||||
}
|
||||
@@ -83,7 +91,7 @@ COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aS
|
||||
|
||||
|
||||
COMMIT& COMMIT::Stage( std::vector<EDA_ITEM*> &container, CHANGE_TYPE aChangeType,
|
||||
BASE_SCREEN *aScreen )
|
||||
BASE_SCREEN *aScreen )
|
||||
{
|
||||
for( EDA_ITEM* item : container )
|
||||
Stage( item, aChangeType, aScreen);
|
||||
@@ -146,6 +154,9 @@ COMMIT& COMMIT::createModified( EDA_ITEM* aItem, EDA_ITEM* aCopy, int aExtraFlag
|
||||
|
||||
void COMMIT::makeEntry( EDA_ITEM* aItem, CHANGE_TYPE aType, EDA_ITEM* aCopy, BASE_SCREEN *aScreen )
|
||||
{
|
||||
// Expect an item copy if it is going to be modified
|
||||
wxASSERT( !!aCopy == ( ( aType & CHT_TYPE ) == CHT_MODIFY ) );
|
||||
|
||||
COMMIT_LINE ent;
|
||||
|
||||
ent.m_item = aItem;
|
||||
@@ -179,6 +190,8 @@ CHANGE_TYPE COMMIT::convert( UNDO_REDO aType ) const
|
||||
{
|
||||
case UNDO_REDO::NEWITEM: return CHT_ADD;
|
||||
case UNDO_REDO::DELETED: return CHT_REMOVE;
|
||||
case UNDO_REDO::REGROUP: return CHT_GROUP;
|
||||
case UNDO_REDO::UNGROUP: return CHT_UNGROUP;
|
||||
case UNDO_REDO::CHANGED: return CHT_MODIFY;
|
||||
default: wxASSERT( false ); return CHT_MODIFY;
|
||||
}
|
||||
@@ -191,6 +204,8 @@ UNDO_REDO COMMIT::convert( CHANGE_TYPE aType ) const
|
||||
{
|
||||
case CHT_ADD: return UNDO_REDO::NEWITEM;
|
||||
case CHT_REMOVE: return UNDO_REDO::DELETED;
|
||||
case CHT_GROUP: return UNDO_REDO::REGROUP;
|
||||
case CHT_UNGROUP: return UNDO_REDO::UNGROUP;
|
||||
case CHT_MODIFY: return UNDO_REDO::CHANGED;
|
||||
default: wxASSERT( false ); return UNDO_REDO::CHANGED;
|
||||
}
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@
|
||||
#include <wx/regex.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -433,7 +433,7 @@ wxString EnsureFileExtension( const wxString& aFilename, const wxString& aExtens
|
||||
// extension, such as "Schematic_1.1".
|
||||
if( newFilename.Lower().AfterLast( '.' ) != aExtension )
|
||||
{
|
||||
if( !newFilename.EndsWith( '.' ) )
|
||||
if( newFilename.Last() != '.' )
|
||||
newFilename.Append( '.' );
|
||||
|
||||
newFilename.Append( aExtension );
|
||||
|
||||
+23
-25
@@ -31,6 +31,8 @@
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/choicdlg.h>
|
||||
#include <wx/crt.h>
|
||||
|
||||
|
||||
/**
|
||||
* Flag to enable confirmation dialog debugging output.
|
||||
*
|
||||
@@ -51,7 +53,7 @@ bool AskOverrideLock( wxWindow* aParent, const wxString& aMessage )
|
||||
+ wxS( "\n" ) );
|
||||
dlg.SetYesNoLabels( _( "&Cancel" ), _( "&Open Anyway" ) );
|
||||
#else
|
||||
KICAD_MESSAGE_DIALOG_BASE dlg( aParent, aMessage, _( "File Open Warning" ),
|
||||
wxMessageDialog dlg( aParent, aMessage, _( "File Open Warning" ),
|
||||
wxYES_NO | wxICON_ERROR | wxCENTER );
|
||||
dlg.SetExtendedMessage( _( "Interleaved saves may produce very unexpected results." ) );
|
||||
dlg.SetYesNoLabels( _( "&Cancel" ), _( "&Open Anyway" ) );
|
||||
@@ -65,9 +67,8 @@ int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage, bool* aApp
|
||||
{
|
||||
static bool s_apply_to_all = false;
|
||||
|
||||
KICAD_RICH_MESSAGE_DIALOG_BASE dlg( parent, aMessage, _( "Save Changes?" ),
|
||||
wxYES_NO | wxCANCEL |
|
||||
wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
wxRichMessageDialog dlg( parent, aMessage, _( "Save Changes?" ),
|
||||
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." )
|
||||
+ wxS( "\n" ) );
|
||||
dlg.SetYesNoLabels( _( "&Save" ), _( "&Discard Changes" ) );
|
||||
@@ -104,7 +105,7 @@ int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage )
|
||||
wxWindowDisabler disable( true );
|
||||
#endif
|
||||
|
||||
KICAD_MESSAGE_DIALOG_BASE dlg( parent, aMessage, _( "Save Changes?" ),
|
||||
wxMessageDialog dlg( parent, aMessage, _( "Save Changes?" ),
|
||||
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." ) );
|
||||
dlg.SetYesNoLabels( _( "&Save" ), _( "&Discard Changes" ) );
|
||||
@@ -117,8 +118,8 @@ int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage )
|
||||
|
||||
bool ConfirmRevertDialog( wxWindow* parent, const wxString& aMessage )
|
||||
{
|
||||
KICAD_MESSAGE_DIALOG_BASE dlg( parent, aMessage, wxEmptyString,
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
wxMessageDialog dlg( parent, aMessage, wxEmptyString,
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
dlg.SetExtendedMessage( _( "Your current changes will be permanently lost." ) );
|
||||
dlg.SetOKCancelLabels( _( "&Revert" ), _( "&Cancel" ) );
|
||||
|
||||
@@ -143,8 +144,8 @@ int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning, const wxStrin
|
||||
const wxString& aDetailedMessage, const wxString& aOKLabel,
|
||||
const wxString& aCancelLabel, bool* aApplyToAll )
|
||||
{
|
||||
KICAD_RICH_MESSAGE_DIALOG_BASE dlg( aParent, aMessage, aWarning,
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
wxRichMessageDialog dlg( aParent, aMessage, aWarning,
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
|
||||
|
||||
dlg.SetOKCancelLabels( ( aOKLabel.IsEmpty() ) ? _( "&OK" ) : aOKLabel,
|
||||
( aCancelLabel.IsEmpty() ) ? _( "&Cancel" ) : aCancelLabel );
|
||||
@@ -166,7 +167,7 @@ int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning, const wxStrin
|
||||
|
||||
|
||||
// DisplayError should be deprecated, use DisplayErrorMessage instead
|
||||
void DisplayError( wxWindow* aParent, const wxString& aText )
|
||||
void DisplayError( wxWindow* aParent, const wxString& aText, int aDisplayTime )
|
||||
{
|
||||
if( !wxTheApp || !wxTheApp->IsMainLoopRunning() )
|
||||
{
|
||||
@@ -180,11 +181,11 @@ void DisplayError( wxWindow* aParent, const wxString& aText )
|
||||
return;
|
||||
}
|
||||
|
||||
KICAD_MESSAGE_DIALOG_BASE* dlg;
|
||||
wxMessageDialog* dlg;
|
||||
int icon = aDisplayTime > 0 ? wxICON_INFORMATION : wxICON_ERROR;
|
||||
|
||||
dlg = new KICAD_MESSAGE_DIALOG_BASE( aParent, aText, _( "Error" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER |
|
||||
wxICON_ERROR | wxSTAY_ON_TOP );
|
||||
dlg = new wxMessageDialog( aParent, aText, _( "Warning" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER | icon | wxSTAY_ON_TOP );
|
||||
|
||||
dlg->ShowModal();
|
||||
dlg->Destroy();
|
||||
@@ -205,11 +206,10 @@ void DisplayErrorMessage( wxWindow* aParent, const wxString& aText, const wxStri
|
||||
return;
|
||||
}
|
||||
|
||||
KICAD_MESSAGE_DIALOG_BASE* dlg;
|
||||
wxMessageDialog* dlg;
|
||||
|
||||
dlg = new KICAD_MESSAGE_DIALOG_BASE( aParent, aText, _( "Error" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER |
|
||||
wxICON_ERROR | wxSTAY_ON_TOP );
|
||||
dlg = new wxMessageDialog( aParent, aText, _( "Error" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER | wxICON_ERROR | wxSTAY_ON_TOP );
|
||||
|
||||
if( !aExtraInfo.IsEmpty() )
|
||||
dlg->SetExtendedMessage( aExtraInfo );
|
||||
@@ -233,12 +233,11 @@ void DisplayInfoMessage( wxWindow* aParent, const wxString& aMessage, const wxSt
|
||||
return;
|
||||
}
|
||||
|
||||
KICAD_MESSAGE_DIALOG_BASE* dlg;
|
||||
wxMessageDialog* dlg;
|
||||
int icon = wxICON_INFORMATION;
|
||||
|
||||
dlg = new KICAD_MESSAGE_DIALOG_BASE( aParent, aMessage, _( "Information" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER |
|
||||
icon | wxSTAY_ON_TOP );
|
||||
dlg = new wxMessageDialog( aParent, aMessage, _( "Information" ),
|
||||
wxOK | wxCENTRE | wxRESIZE_BORDER | icon | wxSTAY_ON_TOP );
|
||||
|
||||
if( !aExtraInfo.IsEmpty() )
|
||||
dlg->SetExtendedMessage( aExtraInfo );
|
||||
@@ -264,9 +263,8 @@ bool IsOK( wxWindow* aParent, const wxString& aMessage )
|
||||
#endif
|
||||
|
||||
#if !defined( __WXGTK__ )
|
||||
KICAD_RICH_MESSAGE_DIALOG_BASE dlg( aParent, aMessage, _( "Confirmation" ),
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT |
|
||||
wxCENTRE | icon | wxSTAY_ON_TOP );
|
||||
wxRichMessageDialog dlg( aParent, aMessage, _( "Confirmation" ),
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxCENTRE | icon | wxSTAY_ON_TOP );
|
||||
#else
|
||||
wxMessageDialog dlg( aParent, aMessage, _( "Confirmation" ),
|
||||
wxOK | wxCANCEL | wxOK_DEFAULT | wxCENTRE | icon | wxSTAY_ON_TOP );
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
const int dblibSchemaVersion = 1;
|
||||
|
||||
|
||||
DATABASE_FIELD_MAPPING::DATABASE_FIELD_MAPPING( const std::string& aColumn, const std::string& aName,
|
||||
DATABASE_FIELD_MAPPING::DATABASE_FIELD_MAPPING( std::string aColumn, std::string aName,
|
||||
bool aVisibleOnAdd, bool aVisibleInChooser,
|
||||
bool aShowName, bool aInheritProperties ) :
|
||||
column( aColumn ),
|
||||
|
||||
+2
-12
@@ -21,10 +21,6 @@
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef DESIGN_BLOCK_H
|
||||
#define DESIGN_BLOCK_H
|
||||
|
||||
#include <kicommon.h>
|
||||
#include <lib_id.h>
|
||||
#include <json_common.h>
|
||||
@@ -45,9 +41,6 @@ public:
|
||||
const wxString& GetSchematicFile() const { return m_schematicFile; }
|
||||
void SetSchematicFile( const wxString& aFile ) { m_schematicFile = aFile; }
|
||||
|
||||
const wxString& GetBoardFile() const { return m_boardFile; }
|
||||
void SetBoardFile( const wxString& aFile ) { m_boardFile = aFile; }
|
||||
|
||||
void SetFields( nlohmann::ordered_map<wxString, wxString>& aFields )
|
||||
{
|
||||
m_fields = std::move( aFields );
|
||||
@@ -62,12 +55,9 @@ public:
|
||||
|
||||
private:
|
||||
LIB_ID m_lib_id;
|
||||
wxString m_schematicFile; ///< File name and path for schematic file.
|
||||
wxString m_boardFile; ///< File name and path for board file
|
||||
wxString m_schematicFile; ///< File name and path for schematic symbol.
|
||||
wxString m_libDescription; ///< File name and path for documentation file.
|
||||
wxString m_keywords; ///< Search keywords to find design block in library.
|
||||
wxString m_keywords; ///< Search keywords to find footprint in library.
|
||||
|
||||
nlohmann::ordered_map<wxString, wxString> m_fields;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,9 +21,11 @@
|
||||
#include <design_block_info_impl.h>
|
||||
|
||||
#include <design_block.h>
|
||||
#include <design_block_info.h>
|
||||
#include <design_block_lib_table.h>
|
||||
#include <kiway.h>
|
||||
#include <locale_io.h>
|
||||
#include <lib_id.h>
|
||||
#include <progress_reporter.h>
|
||||
#include <string_utils.h>
|
||||
#include <thread_pool.h>
|
||||
@@ -31,6 +33,7 @@
|
||||
|
||||
#include <kiplatform/io.h>
|
||||
|
||||
#include <wx/textfile.h>
|
||||
#include <wx/txtstrm.h>
|
||||
#include <wx/wfstream.h>
|
||||
|
||||
@@ -41,8 +44,7 @@ void DESIGN_BLOCK_INFO_IMPL::load()
|
||||
|
||||
wxASSERT( dbtable );
|
||||
|
||||
std::unique_ptr<const DESIGN_BLOCK> design_block( dbtable->GetEnumeratedDesignBlock( m_nickname,
|
||||
m_dbname ) );
|
||||
const DESIGN_BLOCK* design_block = dbtable->GetEnumeratedDesignBlock( m_nickname, m_dbname );
|
||||
|
||||
if( design_block )
|
||||
{
|
||||
@@ -126,6 +128,7 @@ bool DESIGN_BLOCK_LIST_IMPL::ReadDesignBlockFiles( DESIGN_BLOCK_LIB_TABLE* aTabl
|
||||
m_queue.push( nickname );
|
||||
}
|
||||
|
||||
|
||||
if( m_progress_reporter )
|
||||
{
|
||||
m_progress_reporter->SetMaxProgress( (int) m_queue.size() );
|
||||
|
||||
+20
-71
@@ -267,9 +267,7 @@ void DESIGN_BLOCK_IO::DesignBlockEnumerate( wxArrayString& aDesignBlockNames,
|
||||
wxDir dir( aLibraryPath );
|
||||
|
||||
if( !dir.IsOpened() )
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format( _( "Design block '%s' does not exist." ), aLibraryPath ) );
|
||||
}
|
||||
return;
|
||||
|
||||
wxString dirname;
|
||||
wxString fileSpec = wxT( "*." ) + wxString( FILEEXT::KiCadDesignBlockPathExtension );
|
||||
@@ -291,23 +289,17 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
|
||||
+ FILEEXT::KiCadDesignBlockPathExtension + wxFileName::GetPathSeparator();
|
||||
wxString dbSchPath = dbPath + aDesignBlockName + wxT( "." )
|
||||
+ FILEEXT::KiCadSchematicFileExtension;
|
||||
wxString dbPcbPath = dbPath + aDesignBlockName + wxT( "." ) + FILEEXT::KiCadPcbFileExtension;
|
||||
wxString dbMetadataPath = dbPath + aDesignBlockName + wxT( "." ) + FILEEXT::JsonFileExtension;
|
||||
|
||||
if( !wxDir::Exists( dbPath ) )
|
||||
THROW_IO_ERROR( wxString::Format( _( "Design block '%s' does not exist." ), dbPath ) );
|
||||
if( !wxFileExists( dbSchPath ) )
|
||||
return nullptr;
|
||||
|
||||
DESIGN_BLOCK* newDB = new DESIGN_BLOCK();
|
||||
|
||||
// Library name needs to be empty for when we fill it in with the correct library nickname
|
||||
// one layer above
|
||||
newDB->SetLibId( LIB_ID( wxEmptyString, aDesignBlockName ) );
|
||||
|
||||
if( wxFileExists( dbSchPath ) )
|
||||
newDB->SetSchematicFile( dbSchPath );
|
||||
|
||||
if( wxFileExists( dbPcbPath ) )
|
||||
newDB->SetBoardFile( dbPcbPath );
|
||||
newDB->SetSchematicFile( dbSchPath );
|
||||
|
||||
// Parse the JSON file if it exists
|
||||
if( wxFileExists( dbMetadataPath ) )
|
||||
@@ -343,27 +335,16 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
delete newDB;
|
||||
THROW_IO_ERROR( wxString::Format(
|
||||
_( "Design block metadata file '%s' could not be read." ), dbMetadataPath ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return newDB;
|
||||
}
|
||||
|
||||
|
||||
bool DESIGN_BLOCK_IO::DesignBlockExists( const wxString& aLibraryPath,
|
||||
const wxString& aDesignBlockName,
|
||||
const std::map<std::string, UTF8>* aProperties )
|
||||
{
|
||||
wxString dbPath = aLibraryPath + wxFileName::GetPathSeparator() + aDesignBlockName + wxT( "." )
|
||||
+ FILEEXT::KiCadDesignBlockPathExtension + wxFileName::GetPathSeparator();
|
||||
|
||||
return wxDir::Exists( dbPath );
|
||||
}
|
||||
|
||||
|
||||
void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibraryPath,
|
||||
const DESIGN_BLOCK* aDesignBlock,
|
||||
const std::map<std::string, UTF8>* aProperties )
|
||||
@@ -374,23 +355,12 @@ void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibra
|
||||
THROW_IO_ERROR( _( "Design block does not have a valid library ID." ) );
|
||||
}
|
||||
|
||||
if( aDesignBlock->GetSchematicFile().IsEmpty() && aDesignBlock->GetBoardFile().IsEmpty() )
|
||||
{
|
||||
THROW_IO_ERROR( _( "Design block does not have a schematic or board file." ) );
|
||||
}
|
||||
|
||||
wxFileName schematicFile( aDesignBlock->GetSchematicFile() );
|
||||
wxFileName boardFile( aDesignBlock->GetBoardFile() );
|
||||
|
||||
if( !aDesignBlock->GetSchematicFile().IsEmpty() && !schematicFile.FileExists() )
|
||||
if( !schematicFile.FileExists() )
|
||||
{
|
||||
THROW_IO_ERROR(
|
||||
wxString::Format( _( "Schematic source file '%s' does not exist." ), schematicFile.GetFullPath() ) );
|
||||
}
|
||||
|
||||
if( !aDesignBlock->GetBoardFile().IsEmpty() && !boardFile.FileExists() )
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format( _( "Board source file '%s' does not exist." ), boardFile.GetFullPath() ) );
|
||||
THROW_IO_ERROR( wxString::Format( _( "Schematic source file '%s' does not exist." ),
|
||||
schematicFile.GetFullPath() ) );
|
||||
}
|
||||
|
||||
// Create the design block folder
|
||||
@@ -408,44 +378,23 @@ void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibra
|
||||
}
|
||||
}
|
||||
|
||||
if( !aDesignBlock->GetSchematicFile().IsEmpty() )
|
||||
{
|
||||
// The new schematic file name is based on the design block name, not the source sheet name
|
||||
wxString dbSchematicFile = dbFolder.GetFullPath() + aDesignBlock->GetLibId().GetLibItemName() + wxT( "." )
|
||||
+ FILEEXT::KiCadSchematicFileExtension;
|
||||
// The new schematic file name is based on the design block name, not the source sheet name
|
||||
wxString dbSchematicFile = dbFolder.GetFullPath() + aDesignBlock->GetLibId().GetLibItemName()
|
||||
+ wxT( "." ) + FILEEXT::KiCadSchematicFileExtension;
|
||||
|
||||
// If the source and destination files are the same, then we don't need to copy the file
|
||||
// as we are just updating the metadata
|
||||
if( schematicFile.GetFullPath() != dbSchematicFile )
|
||||
// If the source and destination files are the same, then we don't need to copy the file
|
||||
// as we are just updating the metadata
|
||||
if( schematicFile.GetFullPath() != dbSchematicFile )
|
||||
{
|
||||
// Copy the source sheet file to the design block folder, under the design block name
|
||||
if( !wxCopyFile( schematicFile.GetFullPath(), dbSchematicFile ) )
|
||||
{
|
||||
// Copy the source sheet file to the design block folder, under the design block name
|
||||
if( !wxCopyFile( schematicFile.GetFullPath(), dbSchematicFile ) )
|
||||
{
|
||||
THROW_IO_ERROR(
|
||||
wxString::Format( _( "Schematic file '%s' could not be saved as design block at '%s'." ),
|
||||
schematicFile.GetFullPath(), dbSchematicFile ) );
|
||||
}
|
||||
THROW_IO_ERROR( wxString::Format(
|
||||
_( "Schematic file '%s' could not be saved as design block at '%s'." ),
|
||||
schematicFile.GetFullPath(), dbSchematicFile ) );
|
||||
}
|
||||
}
|
||||
|
||||
if( !aDesignBlock->GetBoardFile().IsEmpty() )
|
||||
{
|
||||
// The new Board file name is based on the design block name, not the source sheet name
|
||||
wxString dbBoardFile = dbFolder.GetFullPath() + aDesignBlock->GetLibId().GetLibItemName() + wxT( "." )
|
||||
+ FILEEXT::KiCadPcbFileExtension;
|
||||
|
||||
// If the source and destination files are the same, then we don't need to copy the file
|
||||
// as we are just updating the metadata
|
||||
if( boardFile.GetFullPath() != dbBoardFile )
|
||||
{
|
||||
// Copy the source sheet file to the design block folder, under the design block name
|
||||
if( !wxCopyFile( boardFile.GetFullPath(), dbBoardFile ) )
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format( _( "Board file '%s' could not be saved as design block at '%s'." ),
|
||||
boardFile.GetFullPath(), dbBoardFile ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxString dbMetadataFile = dbFolder.GetFullPath() + aDesignBlock->GetLibId().GetLibItemName()
|
||||
+ wxT( "." ) + FILEEXT::JsonFileExtension;
|
||||
|
||||
@@ -76,7 +76,10 @@ public:
|
||||
}
|
||||
|
||||
bool DesignBlockExists( const wxString& aLibraryPath, const wxString& aDesignBlockName,
|
||||
const std::map<std::string, UTF8>* aProperties = nullptr );
|
||||
const std::map<std::string, UTF8>* aProperties = nullptr )
|
||||
{
|
||||
return DesignBlockLoad( aLibraryPath, aDesignBlockName, true, aProperties ) != nullptr;
|
||||
}
|
||||
|
||||
DESIGN_BLOCK* ImportDesignBlock( const wxString& aDesignBlockPath,
|
||||
wxString& aDesignBlockNameOut,
|
||||
|
||||
@@ -73,23 +73,6 @@ void DESIGN_BLOCK_LIB_TABLE_ROW::SetType( const wxString& aType )
|
||||
}
|
||||
|
||||
|
||||
bool DESIGN_BLOCK_LIB_TABLE_ROW::Refresh()
|
||||
{
|
||||
if( !plugin )
|
||||
{
|
||||
wxArrayString dummyList;
|
||||
|
||||
plugin.reset( DESIGN_BLOCK_IO_MGR::FindPlugin( type ) );
|
||||
SetLoaded( false );
|
||||
plugin->DesignBlockEnumerate( dummyList, GetFullURI( true ), true, GetProperties() );
|
||||
SetLoaded( true );
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
DESIGN_BLOCK_LIB_TABLE::DESIGN_BLOCK_LIB_TABLE( DESIGN_BLOCK_LIB_TABLE* aFallBackTable ) :
|
||||
LIB_TABLE( aFallBackTable )
|
||||
{
|
||||
@@ -450,7 +433,7 @@ DESIGN_BLOCK_LIB_TABLE::DesignBlockSave( const wxString& aNickname,
|
||||
std::unique_ptr<DESIGN_BLOCK> design_block( row->plugin->DesignBlockLoad(
|
||||
row->GetFullURI( true ), DesignBlockname, row->GetProperties() ) );
|
||||
|
||||
if( design_block )
|
||||
if( design_block.get() )
|
||||
return SAVE_SKIPPED;
|
||||
}
|
||||
|
||||
@@ -554,11 +537,13 @@ public:
|
||||
// consider a directory to be a lib if it's name ends with the design block lib dir
|
||||
// extension it is under $KICADn_3RD_PARTY/design_blocks/<pkgid>/ i.e. has nested
|
||||
// level of at least +3.
|
||||
if( dirPath.EndsWith( wxString::Format( wxS( ".%s" ), FILEEXT::KiCadDesignBlockLibPathExtension ) )
|
||||
if( dirPath.EndsWith( wxString::Format( wxS( ".%s" ),
|
||||
FILEEXT::KiCadDesignBlockLibPathExtension ) )
|
||||
&& dir.GetDirCount() >= m_prefix_dir_count + 3 )
|
||||
{
|
||||
wxString versionedPath;
|
||||
versionedPath.Printf( wxS( "${%s}" ), ENV_VAR::GetVersionedEnvVarName( wxS( "3RD_PARTY" ) ) );
|
||||
versionedPath.Printf( wxS( "${%s}" ),
|
||||
ENV_VAR::GetVersionedEnvVarName( wxS( "3RD_PARTY" ) ) );
|
||||
|
||||
wxArrayString parts = dir.GetDirs();
|
||||
parts.RemoveAt( 0, m_prefix_dir_count );
|
||||
@@ -587,9 +572,9 @@ public:
|
||||
} while( m_lib_table.HasLibrary( nickname ) );
|
||||
}
|
||||
|
||||
m_lib_table.InsertRow( new DESIGN_BLOCK_LIB_TABLE_ROW( nickname, libPath, wxT( "KiCad" ),
|
||||
wxEmptyString,
|
||||
_( "Added by Plugin and Content Manager" ) ) );
|
||||
m_lib_table.InsertRow( new DESIGN_BLOCK_LIB_TABLE_ROW(
|
||||
nickname, libPath, wxT( "KiCad" ), wxEmptyString,
|
||||
_( "Added by Plugin and Content Manager" ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -626,7 +611,8 @@ bool DESIGN_BLOCK_LIB_TABLE::LoadGlobalTable( DESIGN_BLOCK_LIB_TABLE& aTable )
|
||||
SystemDirsAppend( &ss );
|
||||
|
||||
const ENV_VAR_MAP& envVars = Pgm().GetLocalEnvVariables();
|
||||
std::optional<wxString> v = ENV_VAR::GetVersionedEnvVarValue( envVars, wxT( "TEMPLATE_DIR" ) );
|
||||
std::optional<wxString> v = ENV_VAR::GetVersionedEnvVarValue( envVars,
|
||||
wxT( "TEMPLATE_DIR" ) );
|
||||
|
||||
if( v && !v->IsEmpty() )
|
||||
ss.AddPaths( *v, 0 );
|
||||
@@ -645,14 +631,16 @@ bool DESIGN_BLOCK_LIB_TABLE::LoadGlobalTable( DESIGN_BLOCK_LIB_TABLE& aTable )
|
||||
aTable.clear();
|
||||
aTable.Load( fn.GetFullPath() );
|
||||
|
||||
KICAD_SETTINGS* cfg = GetAppSettings<KICAD_SETTINGS>( "kicad" );
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
KICAD_SETTINGS* settings = mgr.GetAppSettings<KICAD_SETTINGS>( "kicad" );
|
||||
|
||||
const ENV_VAR_MAP& env = Pgm().GetLocalEnvVariables();
|
||||
wxString packagesPath;
|
||||
|
||||
if( std::optional<wxString> v = ENV_VAR::GetVersionedEnvVarValue( env, wxT( "3RD_PARTY" ) ) )
|
||||
packagesPath = *v;
|
||||
|
||||
if( cfg && cfg->m_PcmLibAutoAdd )
|
||||
if( settings->m_PcmLibAutoAdd )
|
||||
{
|
||||
// Scan for libraries in PCM packages directory
|
||||
|
||||
@@ -661,14 +649,15 @@ bool DESIGN_BLOCK_LIB_TABLE::LoadGlobalTable( DESIGN_BLOCK_LIB_TABLE& aTable )
|
||||
|
||||
if( d.DirExists() )
|
||||
{
|
||||
PCM_DESIGN_BLOCK_LIB_TRAVERSER traverser( packagesPath, aTable, cfg->m_PcmLibPrefix );
|
||||
PCM_DESIGN_BLOCK_LIB_TRAVERSER traverser( packagesPath, aTable,
|
||||
settings->m_PcmLibPrefix );
|
||||
wxDir dir( d.GetPath() );
|
||||
|
||||
dir.Traverse( traverser );
|
||||
}
|
||||
}
|
||||
|
||||
if( cfg && cfg->m_PcmLibAutoRemove )
|
||||
if( settings->m_PcmLibAutoRemove )
|
||||
{
|
||||
// Remove PCM libraries that no longer exist
|
||||
std::vector<wxString> to_remove;
|
||||
|
||||
+2
-14
@@ -23,7 +23,6 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <app_monitor.h>
|
||||
#include <dialog_shim.h>
|
||||
#include <core/ignore.h>
|
||||
#include <kiway_player.h>
|
||||
@@ -112,9 +111,6 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl
|
||||
#endif
|
||||
|
||||
Bind( wxEVT_PAINT, &DIALOG_SHIM::OnPaint, this );
|
||||
|
||||
wxString msg = wxString::Format( "Opening dialog %s", GetTitle() );
|
||||
APP_MONITOR::AddNavigationBreadcrumb( msg, "dialog.open" );
|
||||
}
|
||||
|
||||
|
||||
@@ -569,6 +565,8 @@ void DIALOG_SHIM::EndQuasiModal( int retCode )
|
||||
m_qmodal_loop->Exit( 0 );
|
||||
else
|
||||
m_qmodal_loop->ScheduleExit( 0 );
|
||||
|
||||
m_qmodal_loop = nullptr;
|
||||
}
|
||||
|
||||
delete m_qmodal_parent_disabler;
|
||||
@@ -580,9 +578,6 @@ void DIALOG_SHIM::EndQuasiModal( int retCode )
|
||||
|
||||
void DIALOG_SHIM::OnCloseWindow( wxCloseEvent& aEvent )
|
||||
{
|
||||
wxString msg = wxString::Format( "Closing dialog %s", GetTitle() );
|
||||
APP_MONITOR::AddNavigationBreadcrumb( msg, "dialog.close" );
|
||||
|
||||
if( IsQuasiModal() )
|
||||
{
|
||||
EndQuasiModal( wxID_CANCEL );
|
||||
@@ -665,13 +660,6 @@ void DIALOG_SHIM::OnCharHook( wxKeyEvent& aEvt )
|
||||
|
||||
if( wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( eventSource ) )
|
||||
{
|
||||
// If the text control is not multi-line, we want to close the dialog
|
||||
if( !textCtrl->IsMultiLine() )
|
||||
{
|
||||
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined( __WXMAC__ ) || defined( __WXMSW__ )
|
||||
wxString eol = "\r\n";
|
||||
#else
|
||||
|
||||
@@ -423,9 +423,8 @@ void DIALOG_COLOR_PICKER::drawRGBPalette()
|
||||
// Use Y axis from bottom to top and origin to center
|
||||
bitmapDC.SetAxisOrientation( true, true );
|
||||
|
||||
#if defined( __WXMSW__ ) && !wxCHECK_VERSION( 3, 3, 0 )
|
||||
#if defined( __WXMSW__ )
|
||||
// For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7
|
||||
// It was fixed in wx >= 3.3
|
||||
bitmapDC.SetDeviceOrigin( half_size, -half_size );
|
||||
#else
|
||||
bitmapDC.SetDeviceOrigin( half_size, half_size );
|
||||
@@ -497,9 +496,8 @@ void DIALOG_COLOR_PICKER::drawHSVPalette()
|
||||
|
||||
// Use Y axis from bottom to top and origin to center
|
||||
bitmapDC.SetAxisOrientation( true, true );
|
||||
#if defined( __WXMSW__ ) && !wxCHECK_VERSION(3,3,0)
|
||||
#if defined( __WXMSW__)
|
||||
// For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7
|
||||
// It was fixed in wx >= 3.3
|
||||
bitmapDC.SetDeviceOrigin( half_size, -half_size );
|
||||
#else
|
||||
bitmapDC.SetDeviceOrigin( half_size, half_size );
|
||||
|
||||
@@ -82,6 +82,9 @@ DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS( wxWindow* aParent ) :
|
||||
attr->SetEditor( new GRID_CELL_PATH_EDITOR( this, m_EnvVars, &m_curdir, wxEmptyString ) );
|
||||
m_EnvVars->SetColAttr( TV_VALUE_COL, attr );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_EnvVars->SetDefaultRowSize( m_EnvVars->GetDefaultRowSize() + FromDIP( 4 ) );
|
||||
|
||||
m_EnvVars->PushEventHandler( new GRID_TRICKS( m_EnvVars,
|
||||
[this]( wxCommandEvent& aEvent )
|
||||
{
|
||||
|
||||
@@ -1,735 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="18"/>
|
||||
<object class="Project" expanded="true">
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="cpp_class_decoration"></property>
|
||||
<property name="cpp_disconnect_events">1</property>
|
||||
<property name="cpp_event_generation">connect</property>
|
||||
<property name="cpp_help_provider">none</property>
|
||||
<property name="cpp_namespace"></property>
|
||||
<property name="cpp_precompiled_header"></property>
|
||||
<property name="cpp_use_array_enum">0</property>
|
||||
<property name="cpp_use_enum">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="file">dialog_group_properties_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="lua_skip_events">1</property>
|
||||
<property name="lua_ui_table">UI</property>
|
||||
<property name="name">dialog_group_properties</property>
|
||||
<property name="path">.</property>
|
||||
<property name="php_disconnect_events">0</property>
|
||||
<property name="php_disconnect_mode">source_name</property>
|
||||
<property name="php_skip_events">1</property>
|
||||
<property name="python_disconnect_events">0</property>
|
||||
<property name="python_disconnect_mode">source_name</property>
|
||||
<property name="python_image_path_wrapper_function_name"></property>
|
||||
<property name="python_indent_with_spaces"></property>
|
||||
<property name="python_skip_events">1</property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<property name="use_native_eol">0</property>
|
||||
<object class="Dialog" expanded="true">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="center">wxBOTH</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">DIALOG_GROUP_PROPERTIES_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Group Properties</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="two_step_creation">0</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnClose">onClose</event>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerMain</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerUpper</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxFlexGridSizer" expanded="true">
|
||||
<property name="cols">2</property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols">1</property>
|
||||
<property name="growablerows"></property>
|
||||
<property name="hgap">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">fgSizer1</property>
|
||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
||||
<property name="permission">none</property>
|
||||
<property name="rows">0</property>
|
||||
<property name="vgap">0</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Group name:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_nameLabel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_nameCtrl</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Library link:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_libraryLinkLabel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_libraryLink</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Locked</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_locked</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Prevents group from being moved on canvas</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Group members:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_membersLabel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxListBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="choices"></property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">360,200</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_membersList</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnListBox">OnMemberSelected</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bMembershipButtons</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">MyButton</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_bpAddMember</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnAddMember</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">10</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">MyButton</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_bpRemoveMember</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnRemoveMember</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStdDialogButtonSizer" expanded="true">
|
||||
<property name="Apply">0</property>
|
||||
<property name="Cancel">1</property>
|
||||
<property name="ContextHelp">0</property>
|
||||
<property name="Help">0</property>
|
||||
<property name="No">0</property>
|
||||
<property name="OK">1</property>
|
||||
<property name="Save">0</property>
|
||||
<property name="Yes">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_sdbSizer</property>
|
||||
<property name="permission">protected</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</wxFormBuilder_Project>
|
||||
@@ -60,17 +60,11 @@ void DIALOG_LOCKED_ITEMS_QUERY::onOverrideLocks( wxCommandEvent& event )
|
||||
|
||||
int DIALOG_LOCKED_ITEMS_QUERY::ShowModal()
|
||||
{
|
||||
static int doNotShowValue = wxID_ANY;
|
||||
|
||||
if( doNotShowValue != wxID_ANY && m_lockingOptions.m_sessionSkipPrompts )
|
||||
return doNotShowValue;
|
||||
|
||||
int ret = DIALOG_SHIM::ShowModal();
|
||||
|
||||
// Has the user asked not to show the dialog again this session?
|
||||
if( m_doNotShowBtn->IsChecked() && ret != wxID_CANCEL )
|
||||
{
|
||||
doNotShowValue = ret;
|
||||
m_lockingOptions.m_sessionSkipPrompts = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -474,16 +474,23 @@ bool DIALOG_PAGES_SETTINGS::SavePageSettings()
|
||||
wxString msg;
|
||||
wxString fileName = GetWksFileName();
|
||||
|
||||
wxString fullFileName = m_filenameResolver->ResolvePath( fileName, m_projectPath, { m_embeddedFiles } );
|
||||
|
||||
BASE_SCREEN::m_DrawingSheetFileName = fileName;
|
||||
|
||||
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( fullFileName, &msg ) )
|
||||
if( fileName != BASE_SCREEN::m_DrawingSheetFileName )
|
||||
{
|
||||
DisplayErrorMessage( this, wxString::Format( _( "Error loading drawing sheet '%s'." ), fullFileName ), msg );
|
||||
}
|
||||
wxString fullFileName = m_filenameResolver->ResolvePath( fileName, m_projectPath,
|
||||
{ m_embeddedFiles } );
|
||||
|
||||
m_localPrjConfigChanged = true;
|
||||
BASE_SCREEN::m_DrawingSheetFileName = fileName;
|
||||
|
||||
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( fullFileName, &msg ) )
|
||||
{
|
||||
DisplayErrorMessage( this,
|
||||
wxString::Format( _( "Error loading drawing sheet '%s'." ),
|
||||
fullFileName ),
|
||||
msg );
|
||||
}
|
||||
|
||||
m_localPrjConfigChanged = true;
|
||||
}
|
||||
|
||||
int idx = std::max( m_paperSizeComboBox->GetSelection(), 0 );
|
||||
const wxString paperType = m_pageFmt[idx];
|
||||
@@ -816,7 +823,7 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
|
||||
if( m_embeddedFiles && customize.GetEmbed() )
|
||||
{
|
||||
fn.Assign( fileName );
|
||||
EMBEDDED_FILES::EMBEDDED_FILE* result = m_embeddedFiles->AddFile( fn, true );
|
||||
EMBEDDED_FILES::EMBEDDED_FILE* result = m_embeddedFiles->AddFile( fn, false );
|
||||
shortFileName = result->GetLink();
|
||||
fileName = m_embeddedFiles->GetTemporaryFileName( result->name ).GetFullPath();
|
||||
}
|
||||
|
||||
@@ -39,19 +39,22 @@
|
||||
|
||||
|
||||
DIALOG_PLUGIN_OPTIONS::DIALOG_PLUGIN_OPTIONS( wxWindow* aParent,
|
||||
const wxString& aNickname,
|
||||
const std::map<std::string, UTF8>& aPluginOptions,
|
||||
const wxString& aFormattedOptions,
|
||||
wxString* aResult ) :
|
||||
DIALOG_PLUGIN_OPTIONS_BASE( aParent ),
|
||||
m_callers_options( aFormattedOptions ),
|
||||
m_result( aResult ),
|
||||
m_choices( aPluginOptions ),
|
||||
m_initial_help( INITIAL_HELP ),
|
||||
m_grid_widths_dirty( true )
|
||||
const wxString& aNickname,
|
||||
const std::map<std::string, UTF8>& aPluginOptions,
|
||||
const wxString& aFormattedOptions,
|
||||
wxString* aResult ) :
|
||||
DIALOG_PLUGIN_OPTIONS_BASE( aParent ),
|
||||
m_callers_options( aFormattedOptions ),
|
||||
m_result( aResult ),
|
||||
m_choices( aPluginOptions ),
|
||||
m_initial_help( INITIAL_HELP ),
|
||||
m_grid_widths_dirty( true )
|
||||
{
|
||||
SetTitle( wxString::Format( _( "Options for Library '%s'" ), aNickname ) );
|
||||
|
||||
// Give a bit more room for combobox editors
|
||||
m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() + 4 );
|
||||
|
||||
m_grid->SetSelectionMode( wxGrid::wxGridSelectionModes::wxGridSelectRows );
|
||||
|
||||
// add Cut, Copy, and Paste to wxGrid
|
||||
@@ -62,7 +65,8 @@ DIALOG_PLUGIN_OPTIONS::DIALOG_PLUGIN_OPTIONS( wxWindow* aParent,
|
||||
{
|
||||
unsigned int row = 0;
|
||||
|
||||
for( std::map<std::string, UTF8>::const_iterator it = m_choices.begin(); it != m_choices.end(); ++it, ++row )
|
||||
for( std::map<std::string, UTF8>::const_iterator it = m_choices.begin();
|
||||
it != m_choices.end(); ++it, ++row )
|
||||
{
|
||||
wxString item = From_UTF8( it->first.c_str() );
|
||||
|
||||
@@ -107,7 +111,8 @@ bool DIALOG_PLUGIN_OPTIONS::TransferDataToWindow()
|
||||
|
||||
int row = 0;
|
||||
|
||||
for( std::map<std::string, UTF8>::const_iterator it = props->begin(); it != props->end(); ++it, ++row )
|
||||
for( std::map<std::string, UTF8>::const_iterator it = props->begin(); it != props->end();
|
||||
++it, ++row )
|
||||
{
|
||||
m_grid->SetCellValue( row, 0, From_UTF8( it->first.c_str() ) );
|
||||
m_grid->SetCellValue( row, 1, it->second );
|
||||
@@ -137,7 +142,9 @@ bool DIALOG_PLUGIN_OPTIONS::TransferDataFromWindow()
|
||||
UTF8 value = m_grid->GetCellValue( row, 1 ).Trim( false ).Trim();
|
||||
|
||||
if( name.size() )
|
||||
{
|
||||
props[name] = value;
|
||||
}
|
||||
}
|
||||
|
||||
*m_result = LIB_TABLE::FormatOptions( &props ).wx_str();
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
#include <wx/print.h>
|
||||
#include <wx/printdlg.h>
|
||||
|
||||
#include <dialogs/panel_printer_list.h>
|
||||
|
||||
// Define min and max reasonable values for print scale
|
||||
static constexpr double MIN_SCALE = 0.01;
|
||||
static constexpr double MAX_SCALE = 100.0;
|
||||
@@ -95,9 +93,6 @@ DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC( EDA_DRAW_FRAME* aParent, PRINTOUT_SE
|
||||
m_scaleValidator.SetRange( 0.0, MAX_SCALE );
|
||||
m_scaleCustomText->SetValidator( m_scaleValidator );
|
||||
|
||||
// Show m_panelPrinters only if there are printers to list:
|
||||
m_panelPrinters->Show( m_panelPrinters->AsPrintersAvailable() );
|
||||
|
||||
SetupStandardButtons( { { wxID_OK, _( "Print" ) },
|
||||
{ wxID_APPLY, _( "Print Preview" ) },
|
||||
{ wxID_CANCEL, _( "Close" ) } } );
|
||||
@@ -250,13 +245,6 @@ void DIALOG_PRINT_GENERIC::onPrintPreview( wxCommandEvent& event )
|
||||
return;
|
||||
}
|
||||
|
||||
wxString selectedPrinterName;
|
||||
|
||||
if( m_panelPrinters )
|
||||
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
|
||||
|
||||
s_PrintData->SetPrinterName( selectedPrinterName );
|
||||
|
||||
// Pass two printout objects: for preview, and possible printing.
|
||||
wxString title = _( "Print Preview" );
|
||||
wxPrintPreview* preview =
|
||||
@@ -308,13 +296,6 @@ void DIALOG_PRINT_GENERIC::onPrintButtonClick( wxCommandEvent& event )
|
||||
return;
|
||||
}
|
||||
|
||||
wxString selectedPrinterName;
|
||||
|
||||
if( m_panelPrinters )
|
||||
selectedPrinterName = m_panelPrinters->GetSelectedPrinterName();
|
||||
|
||||
s_PrintData->SetPrinterName( selectedPrinterName );
|
||||
|
||||
wxPrintDialogData printDialogData( *s_PrintData );
|
||||
printDialogData.SetMaxPage( m_settings->m_pageCount );
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialogs/panel_printer_list.h"
|
||||
|
||||
#include "dialog_print_generic_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -18,15 +16,6 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow
|
||||
wxBoxSizer* bMainSizer;
|
||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxBoxSizer* bSizerPanelPrinters;
|
||||
bSizerPanelPrinters = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_panelPrinters = new PANEL_PRINTER_LIST( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
bSizerPanelPrinters->Add( m_panelPrinters, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
|
||||
bMainSizer->Add( bSizerPanelPrinters, 0, wxEXPAND, 5 );
|
||||
|
||||
m_bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* bRightCol;
|
||||
|
||||
@@ -65,75 +65,6 @@
|
||||
<property name="name">bMainSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerPanelPrinters</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND | wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxPanel" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_panelPrinters</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">PANEL_PRINTER_LIST; dialogs/panel_printer_list.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
|
||||
@@ -10,20 +10,17 @@
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class PANEL_PRINTER_LIST;
|
||||
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/panel.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/gbsizer.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/textctrl.h>
|
||||
@@ -49,7 +46,6 @@ class DIALOG_PRINT_GENERIC_BASE : public DIALOG_SHIM
|
||||
wxID_PRINT_OPTIONS,
|
||||
};
|
||||
|
||||
PANEL_PRINTER_LIST* m_panelPrinters;
|
||||
wxBoxSizer* m_bUpperSizer;
|
||||
wxStaticBoxSizer* m_sbOptionsSizer;
|
||||
wxGridBagSizer* m_gbOptionsSizer;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -17,8 +17,8 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
|
||||
wxBoxSizer* bLeftSizer;
|
||||
bLeftSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_enableGit = new wxCheckBox( this, wxID_ANY, _("Enable Git tracking"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bLeftSizer->Add( m_enableGit, 0, wxEXPAND|wxALL, 10 );
|
||||
m_enableGit = new wxCheckBox( this, wxID_ANY, _("Enable Git Tracking"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bLeftSizer->Add( m_enableGit, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 13 );
|
||||
|
||||
m_gitSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
@@ -30,7 +30,7 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
|
||||
bSizerUpdate->Add( m_staticText6, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 13 );
|
||||
|
||||
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizerUpdate->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
bSizerUpdate->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
wxGridBagSizer* gbUpdate;
|
||||
gbUpdate = new wxGridBagSizer( 4, 5 );
|
||||
@@ -54,10 +54,10 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
|
||||
|
||||
gbUpdate->AddGrowableCol( 2 );
|
||||
|
||||
bSizerUpdate->Add( gbUpdate, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
bSizerUpdate->Add( gbUpdate, 0, wxEXPAND|wxLEFT, 13 );
|
||||
|
||||
|
||||
m_gitSizer->Add( bSizerUpdate, 0, wxEXPAND|wxTOP, 5 );
|
||||
m_gitSizer->Add( bSizerUpdate, 0, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizerCommitData;
|
||||
bSizerCommitData = new wxBoxSizer( wxVERTICAL );
|
||||
@@ -67,7 +67,7 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
|
||||
bSizerCommitData->Add( m_staticText12, 0, wxEXPAND|wxLEFT|wxTOP, 13 );
|
||||
|
||||
m_staticline31 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizerCommitData->Add( m_staticline31, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
bSizerCommitData->Add( m_staticline31, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
wxFlexGridSizer* fgSizer1;
|
||||
fgSizer1 = new wxFlexGridSizer( 0, 2, 0, 0 );
|
||||
@@ -86,29 +86,29 @@ PANEL_GIT_REPOS_BASE::PANEL_GIT_REPOS_BASE( wxWindow* parent, wxWindowID id, con
|
||||
m_authorLabel->Wrap( -1 );
|
||||
m_authorLabel->Enable( false );
|
||||
|
||||
fgSizer1->Add( m_authorLabel, 0, wxTOP|wxLEFT, 5 );
|
||||
fgSizer1->Add( m_authorLabel, 0, wxALL, 5 );
|
||||
|
||||
m_author = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_author->Enable( false );
|
||||
|
||||
fgSizer1->Add( m_author, 1, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
fgSizer1->Add( m_author, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_authorEmailLabel = new wxStaticText( this, wxID_ANY, _("Author e-mail:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_authorEmailLabel->Wrap( -1 );
|
||||
m_authorEmailLabel->Enable( false );
|
||||
|
||||
fgSizer1->Add( m_authorEmailLabel, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
fgSizer1->Add( m_authorEmailLabel, 0, wxALL, 5 );
|
||||
|
||||
m_authorEmail = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_authorEmail->Enable( false );
|
||||
|
||||
fgSizer1->Add( m_authorEmail, 1, wxALL, 5 );
|
||||
fgSizer1->Add( m_authorEmail, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerCommitData->Add( fgSizer1, 0, wxEXPAND|wxALL, 5 );
|
||||
bSizerCommitData->Add( fgSizer1, 0, wxBOTTOM|wxEXPAND|wxLEFT, 8 );
|
||||
|
||||
|
||||
m_gitSizer->Add( bSizerCommitData, 1, wxEXPAND|wxTOP, 10 );
|
||||
m_gitSizer->Add( bSizerCommitData, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bLeftSizer->Add( m_gitSizer, 0, wxEXPAND, 0 );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
||||
@@ -70,8 +70,8 @@
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="border">13</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -103,7 +103,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Enable Git tracking</property>
|
||||
<property name="label">Enable Git Tracking</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -146,7 +146,7 @@
|
||||
<property name="permission">protected</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
@@ -216,8 +216,8 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND | wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -275,10 +275,10 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxLEFT</property>
|
||||
<property name="border">13</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxGridBagSizer" expanded="true">
|
||||
<object class="wxGridBagSizer" expanded="false">
|
||||
<property name="empty_cell_size">-1,2</property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols">2</property>
|
||||
@@ -490,8 +490,8 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
@@ -561,8 +561,8 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND | wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -620,8 +620,8 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="border">8</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxFlexGridSizer" expanded="false">
|
||||
<property name="cols">2</property>
|
||||
@@ -713,7 +713,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxLEFT</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -775,8 +775,8 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
@@ -840,7 +840,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxLEFT</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -902,8 +902,8 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
|
||||
@@ -369,14 +369,15 @@ bool PANEL_COLOR_SETTINGS::saveCurrentTheme( bool aValidate )
|
||||
if( aValidate && !validateSave() )
|
||||
return false;
|
||||
|
||||
COLOR_SETTINGS* selected = ::GetColorSettings( m_currentSettings->GetFilename() );
|
||||
SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager();
|
||||
COLOR_SETTINGS* selected = settingsMgr.GetColorSettings( m_currentSettings->GetFilename() );
|
||||
|
||||
selected->SetOverrideSchItemColors( m_optOverrideColors->GetValue() );
|
||||
|
||||
for( int layer : m_validLayers )
|
||||
selected->SetColor( layer, m_currentSettings->GetColor( layer ) );
|
||||
|
||||
Pgm().GetSettingsManager().SaveColorSettings( selected, m_colorNamespace );
|
||||
settingsMgr.SaveColorSettings( selected, m_colorNamespace );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6-dirty)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -24,7 +24,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
bLeftSizer->Add( m_staticText20, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 );
|
||||
|
||||
m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bLeftSizer->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
bLeftSizer->Add( m_staticline3, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
wxBoxSizer* bAntialiasingSizer;
|
||||
bAntialiasingSizer = new wxBoxSizer( wxVERTICAL );
|
||||
@@ -72,7 +72,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
bLeftSizer->Add( m_staticText21, 0, wxTOP|wxRIGHT|wxLEFT, 13 );
|
||||
|
||||
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bLeftSizer->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
bLeftSizer->Add( m_staticline2, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
wxBoxSizer* bHelperAppsSizer;
|
||||
bHelperAppsSizer = new wxBoxSizer( wxVERTICAL );
|
||||
@@ -144,7 +144,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
bLeftSizer->Add( m_staticText22, 0, wxTOP|wxRIGHT|wxLEFT, 13 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bLeftSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
bLeftSizer->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
wxBoxSizer* bUserInterfaceSizer;
|
||||
bUserInterfaceSizer = new wxBoxSizer( wxVERTICAL );
|
||||
@@ -203,7 +203,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
bSizerIconsTheme->Add( m_rbIconThemeAuto, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bUserInterfaceSizer->Add( bSizerIconsTheme, 0, wxEXPAND|wxTOP, 5 );
|
||||
bUserInterfaceSizer->Add( bSizerIconsTheme, 0, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizerToolbarSize;
|
||||
bSizerToolbarSize = new wxBoxSizer( wxHORIZONTAL );
|
||||
@@ -230,30 +230,33 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
|
||||
bUserInterfaceSizer->Add( bSizerToolbarSize, 0, wxEXPAND, 5 );
|
||||
|
||||
m_scaleFonts = new wxCheckBox( this, wxID_ANY, _("Apply icon scaling to fonts"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bUserInterfaceSizer->Add( m_scaleFonts, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
m_fontScalingHelp = new wxStaticText( this, wxID_ANY, _("(This workaround will improve some GTK HiDPI font scaling issues.)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_fontScalingHelp->Wrap( -1 );
|
||||
bUserInterfaceSizer->Add( m_fontScalingHelp, 0, wxBOTTOM|wxLEFT, 8 );
|
||||
|
||||
m_gbUserInterface = new wxGridBagSizer( 5, 0 );
|
||||
m_gbUserInterface->SetFlexibleDirection( wxVERTICAL );
|
||||
m_gbUserInterface->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
|
||||
|
||||
m_staticTextCanvasScale = new wxStaticText( this, wxID_ANY, _("Canvas scale:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextCanvasScale->Wrap( -1 );
|
||||
m_gbUserInterface->Add( m_staticTextCanvasScale, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
m_gbUserInterface->Add( m_staticTextCanvasScale, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
|
||||
|
||||
m_canvasScaleCtrl = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0, 1 );
|
||||
m_canvasScaleCtrl->SetDigits( 0 );
|
||||
m_gbUserInterface->Add( m_canvasScaleCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
m_gbUserInterface->Add( m_canvasScaleCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_canvasScaleAuto = new wxCheckBox( this, wxID_ANY, _("Automatic"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_gbUserInterface->Add( m_canvasScaleAuto, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 15 );
|
||||
m_gbUserInterface->Add( m_canvasScaleAuto, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 15 );
|
||||
|
||||
|
||||
bUserInterfaceSizer->Add( m_gbUserInterface, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
bUserInterfaceSizer->Add( m_gbUserInterface, 0, wxTOP|wxBOTTOM|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bUserInterfaceSizer->Add( 0, 10, 0, wxEXPAND, 5 );
|
||||
|
||||
m_scaleFonts = new wxCheckBox( this, wxID_ANY, _("Apply icon scaling to fonts"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bUserInterfaceSizer->Add( m_scaleFonts, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
m_fontScalingHelp = new wxStaticText( this, wxID_ANY, _("(This workaround will improve some GTK HiDPI font scaling issues.)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_fontScalingHelp->Wrap( -1 );
|
||||
bUserInterfaceSizer->Add( m_fontScalingHelp, 0, wxBOTTOM|wxLEFT, 8 );
|
||||
|
||||
wxBoxSizer* bSizerHighContrast;
|
||||
bSizerHighContrast = new wxBoxSizer( wxHORIZONTAL );
|
||||
@@ -270,13 +273,13 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
bSizerHighContrast->Add( m_highContrastUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bUserInterfaceSizer->Add( bSizerHighContrast, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
bUserInterfaceSizer->Add( bSizerHighContrast, 0, wxBOTTOM|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bLeftSizer->Add( bUserInterfaceSizer, 0, wxTOP|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bPanelSizer->Add( bLeftSizer, 0, wxRIGHT, 35 );
|
||||
bPanelSizer->Add( bLeftSizer, 0, wxRIGHT, 20 );
|
||||
|
||||
wxBoxSizer* rightSizer;
|
||||
rightSizer = new wxBoxSizer( wxVERTICAL );
|
||||
@@ -286,7 +289,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
rightSizer->Add( m_staticText23, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 13 );
|
||||
|
||||
m_staticline6 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
rightSizer->Add( m_staticline6, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
rightSizer->Add( m_staticline6, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
wxBoxSizer* bEditingSizer;
|
||||
bEditingSizer = new wxBoxSizer( wxVERTICAL );
|
||||
@@ -311,7 +314,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
rightSizer->Add( m_staticText24, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 13 );
|
||||
|
||||
m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
rightSizer->Add( m_staticline5, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
rightSizer->Add( m_staticline5, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
wxBoxSizer* bSessionSizer;
|
||||
bSessionSizer = new wxBoxSizer( wxVERTICAL );
|
||||
@@ -320,7 +323,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
m_cbRememberOpenFiles->SetValue(true);
|
||||
m_cbRememberOpenFiles->SetToolTip( _("If checked, launching a project will also launch tools such as the schematic and board editors with previously open files") );
|
||||
|
||||
bSessionSizer->Add( m_cbRememberOpenFiles, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
bSessionSizer->Add( m_cbRememberOpenFiles, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSessionSizer->Add( 0, 5, 0, 0, 5 );
|
||||
@@ -381,7 +384,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
rightSizer->Add( m_staticText25, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 13 );
|
||||
|
||||
m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
rightSizer->Add( m_staticline4, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 );
|
||||
rightSizer->Add( m_staticline4, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
wxBoxSizer* bProjectBackupSizer;
|
||||
bProjectBackupSizer = new wxBoxSizer( wxVERTICAL );
|
||||
@@ -454,7 +457,7 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
rightSizer->Add( bProjectBackupSizer, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
|
||||
|
||||
|
||||
bPanelSizer->Add( rightSizer, 0, wxRIGHT|wxLEFT, 5 );
|
||||
bPanelSizer->Add( rightSizer, 0, wxLEFT, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bPanelSizer );
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">35</property>
|
||||
<property name="border">20</property>
|
||||
<property name="flag">wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
@@ -132,8 +132,8 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -557,8 +557,8 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -1354,8 +1354,8 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -1416,7 +1416,7 @@
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxLEFT|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<object class="wxBoxSizer" expanded="false">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bUserInterfaceSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
@@ -1759,7 +1759,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="false">
|
||||
<property name="minimum_size"></property>
|
||||
@@ -2293,6 +2293,235 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxLEFT|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxGridBagSizer" expanded="false">
|
||||
<property name="empty_cell_size">-1,-1</property>
|
||||
<property name="flexible_direction">wxVERTICAL</property>
|
||||
<property name="growablecols"></property>
|
||||
<property name="growablerows"></property>
|
||||
<property name="hgap">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_gbUserInterface</property>
|
||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_ALL</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="vgap">5</property>
|
||||
<object class="gbsizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxStaticText" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Canvas scale:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextCanvasScale</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">1</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxSpinCtrlDouble" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="digits">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="inc">1</property>
|
||||
<property name="initial">0</property>
|
||||
<property name="max">100</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_canvasScaleCtrl</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxSP_ARROW_KEYS</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="false">
|
||||
<property name="border">15</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">2</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxCheckBox" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Automatic</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_canvasScaleAuto</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnCheckBox">OnCanvasScaleAuto</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="false">
|
||||
<property name="height">10</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxLEFT|wxRIGHT|wxTOP</property>
|
||||
@@ -2420,228 +2649,9 @@
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxGridBagSizer" expanded="true">
|
||||
<property name="empty_cell_size">-1,-1</property>
|
||||
<property name="flexible_direction">wxVERTICAL</property>
|
||||
<property name="growablecols"></property>
|
||||
<property name="growablerows"></property>
|
||||
<property name="hgap">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_gbUserInterface</property>
|
||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_ALL</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="vgap">5</property>
|
||||
<object class="gbsizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="row">0</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxStaticText" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Canvas scale:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextCanvasScale</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">1</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="row">0</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxSpinCtrlDouble" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="digits">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="inc">1</property>
|
||||
<property name="initial">0</property>
|
||||
<property name="max">100</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_canvasScaleCtrl</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxSP_ARROW_KEYS</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="false">
|
||||
<property name="border">15</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">2</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
|
||||
<property name="row">0</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxCheckBox" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Automatic</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_canvasScaleAuto</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnCheckBox">OnCanvasScaleAuto</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="false">
|
||||
<property name="minimum_size"></property>
|
||||
@@ -2845,7 +2855,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
@@ -2915,8 +2925,8 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -3187,8 +3197,8 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -3256,7 +3266,7 @@
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -3944,8 +3954,8 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">2</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6-dirty)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -75,12 +75,12 @@ class PANEL_COMMON_SETTINGS_BASE : public RESETTABLE_PANEL
|
||||
wxRadioButton* m_rbIconSizeSmall;
|
||||
wxRadioButton* m_rbIconSizeNormal;
|
||||
wxRadioButton* m_rbIconSizeLarge;
|
||||
wxCheckBox* m_scaleFonts;
|
||||
wxStaticText* m_fontScalingHelp;
|
||||
wxGridBagSizer* m_gbUserInterface;
|
||||
wxStaticText* m_staticTextCanvasScale;
|
||||
wxSpinCtrlDouble* m_canvasScaleCtrl;
|
||||
wxCheckBox* m_canvasScaleAuto;
|
||||
wxCheckBox* m_scaleFonts;
|
||||
wxStaticText* m_fontScalingHelp;
|
||||
wxStaticText* m_highContrastLabel;
|
||||
wxTextCtrl* m_highContrastCtrl;
|
||||
wxStaticText* m_highContrastUnits;
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
#include <dialogs/panel_data_collection.h>
|
||||
|
||||
#include <advanced_config.h>
|
||||
#include <app_monitor.h>
|
||||
#include <bitmaps.h>
|
||||
#include <dialog_shim.h>
|
||||
#include <kiface_base.h>
|
||||
#include <kiplatform/policy.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <pgm_base.h>
|
||||
#include <policy_keys.h>
|
||||
#include <id.h>
|
||||
#include <settings/common_settings.h>
|
||||
@@ -54,7 +54,7 @@ bool PANEL_DATA_COLLECTION::TransferDataToWindow()
|
||||
Disable();
|
||||
}
|
||||
|
||||
m_sentryUid->SetValue( APP_MONITOR::SENTRY::Instance()->GetSentryId() );
|
||||
m_sentryUid->SetValue( Pgm().GetSentryId() );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ bool PANEL_DATA_COLLECTION::TransferDataToWindow()
|
||||
|
||||
bool PANEL_DATA_COLLECTION::TransferDataFromWindow()
|
||||
{
|
||||
APP_MONITOR::SENTRY::Instance()->SetSentryOptIn( m_cbOptIn->GetValue() );
|
||||
Pgm().SetSentryOptIn( m_cbOptIn->GetValue() );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -76,12 +76,12 @@ void PANEL_DATA_COLLECTION::ResetPanel()
|
||||
|
||||
void PANEL_DATA_COLLECTION::applySettingsToPanel()
|
||||
{
|
||||
m_cbOptIn->SetValue( APP_MONITOR::SENTRY::Instance()->IsOptedIn() );
|
||||
m_cbOptIn->SetValue( Pgm().IsSentryOptedIn() );
|
||||
}
|
||||
|
||||
|
||||
void PANEL_DATA_COLLECTION::OnResetIdClick( wxCommandEvent& aEvent )
|
||||
{
|
||||
APP_MONITOR::SENTRY::Instance()->ResetSentryId();
|
||||
m_sentryUid->SetValue( APP_MONITOR::SENTRY::Instance()->GetSentryId() );
|
||||
Pgm().ResetSentryId();
|
||||
m_sentryUid->SetValue( Pgm().GetSentryId() );
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user