Compare commits
2249 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a0f1c4126 | |||
| a792a0e7ea | |||
| cad85c8a7a | |||
| c40d25df29 | |||
| 5d4eab87f8 | |||
| d3ee4b1eda | |||
| b331a3b3fd | |||
| 0ec0b63ad2 | |||
| 659c2184b3 | |||
| 6bbd4defaf | |||
| ea4867d5b1 | |||
| 8d14b4798e | |||
| 1283747b59 | |||
| a2df815ba6 | |||
| cd7d6d470b | |||
| e8ef3c14d4 | |||
| 3a8ca47fce | |||
| 176607db25 | |||
| c389c2f6e4 | |||
| 144de5dd78 | |||
| 139ca8f6ef | |||
| 741602c9cc | |||
| 825561d6f4 | |||
| d932043905 | |||
| 68d613ef0d | |||
| 6ffcddcb87 | |||
| e9ece451af | |||
| 5d8db7fa96 | |||
| 608de9970b | |||
| 97de56756f | |||
| 854f882090 | |||
| 1119c1e68f | |||
| c5bc58ee46 | |||
| 0cd99fc3b3 | |||
| dadec3bd25 | |||
| 6ac1bae539 | |||
| 068076a2c2 | |||
| 51fe856360 | |||
| c719b4f3c3 | |||
| f7f45dc4c8 | |||
| dfbafdc3fb | |||
| 2d62eab4b4 | |||
| 4478c09544 | |||
| 438cdafd60 | |||
| 53b6c1f39a | |||
| 0c540ebea6 | |||
| 269e88b18d | |||
| 9a86def109 | |||
| faa6582adc | |||
| 77bba5e9f9 | |||
| bbfd2fb66c | |||
| ec37f295c7 | |||
| af44f2c720 | |||
| 913a9dcdc3 | |||
| 62b264f770 | |||
| edc2938fb8 | |||
| 2498414e91 | |||
| 3c5929258b | |||
| 810a01b779 | |||
| ad2957d534 | |||
| 6742f54243 | |||
| 5437f43790 | |||
| fc14556d43 | |||
| 4bd4c43d1a | |||
| f27e85eeb0 | |||
| 16a70dd267 | |||
| a53caab12b | |||
| 2cead53fc9 | |||
| 77defa69c6 | |||
| 8c540c8b83 | |||
| 0a415fad36 | |||
| 95bb3d6bb1 | |||
| 3142172cff | |||
| 074a265166 | |||
| ce3943446c | |||
| 6c0c2b4365 | |||
| 2fc8a05aec | |||
| 3eab6c5af2 | |||
| d1bd519e7c | |||
| 0b62184c51 | |||
| 7ae4bc208a | |||
| c28fbe566d | |||
| 5ae8d9b220 | |||
| 4d3ac11467 | |||
| 5777523b35 | |||
| e0eb666f6c | |||
| 19ebe3feb8 | |||
| b9e9480e5c | |||
| 70b7131ae7 | |||
| 7ec2c004a2 | |||
| 7e884e1eb1 | |||
| 7689d48632 | |||
| 514c6c11ae | |||
| e18828bed7 | |||
| 0d52d9aa52 | |||
| bf9db2148c | |||
| 768f7c0e45 | |||
| d160459f4a | |||
| 69b16484ec | |||
| 5f023e1e25 | |||
| b7996a4ad4 | |||
| 447bb98480 | |||
| 68d43a49df | |||
| 3353297858 | |||
| f56e4fe1a4 | |||
| 5a6e6b2733 | |||
| 58b96efe06 | |||
| 0328cfe83e | |||
| 4270fece64 | |||
| 9cba0c0b02 | |||
| 64201d49f0 | |||
| c801fcd835 | |||
| aac9946aef | |||
| ebdddf0bc0 | |||
| a8ac725564 | |||
| 342684587a | |||
| 9a532f2cda | |||
| 909b7fb425 | |||
| 0913c5e167 | |||
| 9abad0063e | |||
| 4b851f9b98 | |||
| a8339496e5 | |||
| 9a183196a2 | |||
| 5a12aa9e1b | |||
| 5c0d62ac2e | |||
| 3d511efbb9 | |||
| 05a159d648 | |||
| 5a9aa812e2 | |||
| 35a9deb301 | |||
| c0ed445918 | |||
| f954ace66b | |||
| 6776f8a79f | |||
| ba345cb823 | |||
| 39abd88a54 | |||
| ecccdf0279 | |||
| 095e4a8799 | |||
| a66ae2f51b | |||
| 781c6449d3 | |||
| eca952b8c5 | |||
| 13d4ee03b3 | |||
| 22f9af6bf3 | |||
| d01c071d25 | |||
| 3f4bf9062c | |||
| 92e0d7bab2 | |||
| d9174a110b | |||
| f9c92b7c78 | |||
| bb87cd5fba | |||
| 5d21c2d300 | |||
| da08a4129e | |||
| bff99dcf73 | |||
| 1d7538a557 | |||
| e483be7726 | |||
| 3b8a34bf25 | |||
| 0f6dfb782e | |||
| c8aada9941 | |||
| 3d4fa72b51 | |||
| 936ffcaabc | |||
| 84721d045e | |||
| 0443c73aab | |||
| 5778d74fbb | |||
| b67faf780e | |||
| 3afbd8f2e1 | |||
| fb771bf797 | |||
| 46f42ba9c8 | |||
| bee41d9491 | |||
| f37fb67e5a | |||
| 940fc985e7 | |||
| 384abca49e | |||
| c04eb822b7 | |||
| 0a51662c0b | |||
| 84af2eb8e1 | |||
| f3ef0fcf57 | |||
| 59f450bcfd | |||
| 53db1d2c9b | |||
| 8cc9b69017 | |||
| 12098fe113 | |||
| 53053d0693 | |||
| 829629d05f | |||
| 49233429e4 | |||
| 47b6dd34af | |||
| 4bd71d676f | |||
| 9a860c355a | |||
| c42a473521 | |||
| 43eb124964 | |||
| 86a8bbee9a | |||
| 4897ea8c35 | |||
| fa2edf8547 | |||
| dcefaf675c | |||
| 82b2558d96 | |||
| 466ecca932 | |||
| 96adde2d52 | |||
| b2a71b505b | |||
| ecafc030ef | |||
| 6007dca4d1 | |||
| 08ecc5005f | |||
| 7b70f2835c | |||
| d8b046a361 | |||
| 9ee683e971 | |||
| 0b01c898f0 | |||
| 08e6ef95ab | |||
| dd89260db3 | |||
| 534a04206b | |||
| 25eaf50586 | |||
| e259a150fb | |||
| 6bc8d6a231 | |||
| 8122846078 | |||
| 8fbdc6a50d | |||
| 2be3ebd401 | |||
| f114bed0d2 | |||
| 31deb4d25d | |||
| 413b776194 | |||
| af18baba7b | |||
| 527695bf53 | |||
| bcd3470b20 | |||
| fd86b347e6 | |||
| 801d72c55a | |||
| 6ea28cb69d | |||
| 19196bede7 | |||
| eed87fc699 | |||
| 6c1a67684e | |||
| e5b6055e7d | |||
| 3ea78d07b1 | |||
| c8c06ff230 | |||
| bbc596ad6c | |||
| 0930828a81 | |||
| 8c71406615 | |||
| 1b01dba827 | |||
| 4aa52ddd60 | |||
| b80de21136 | |||
| ca927e4227 | |||
| f2c17a64fb | |||
| c793624195 | |||
| 42d54163c5 | |||
| 5f2f80f480 | |||
| 88be1fee15 | |||
| 0a6a44522a | |||
| 0ba54b4b7c | |||
| 56b35ef6fb | |||
| 03855be6f9 | |||
| 39b55e20c0 | |||
| 24ab8e0b52 | |||
| a961938716 | |||
| 5c2b9d6011 | |||
| 66def25eab | |||
| 16b7338a59 | |||
| 5b89f42738 | |||
| 882a0bcb7d | |||
| 629d397508 | |||
| 346384f8fc | |||
| fe4af49759 | |||
| 5370236743 | |||
| ee289e4a30 | |||
| 83ccbc7add | |||
| aa633bf2c7 | |||
| 621b92cd5e | |||
| 0d549ae203 | |||
| d944e67a69 | |||
| e2b13be7a0 | |||
| 8750485c6d | |||
| 1f9c1e6627 | |||
| 050e782df5 | |||
| 732f4856c6 | |||
| 27863c0bc9 | |||
| f0215a7009 | |||
| 3a06962045 | |||
| 6fffba5bb2 | |||
| 2ace8e0a5e | |||
| 99e99e5b60 | |||
| fc19e7dfdb | |||
| 2398fa4044 | |||
| aedfb6e6fa | |||
| c760a1c545 | |||
| bcb30ce933 | |||
| a4c3485440 | |||
| e8e223630a | |||
| 7b68bdce5f | |||
| 8884e47051 | |||
| 7c352e2038 | |||
| 2b20d3ef64 | |||
| 0d5a7f3224 | |||
| 4bc0cdd8b3 | |||
| 3511c95836 | |||
| 5456ada1bd | |||
| 1fa3ef37c3 | |||
| a5d8c49d75 | |||
| 0e69125217 | |||
| 046ecb794d | |||
| d61ebcf446 | |||
| cfb3c942d7 | |||
| e49a3275e2 | |||
| 30964aec70 | |||
| 4e39d09d1d | |||
| 162b70ce5d | |||
| 4b49d5d355 | |||
| 3e18a46758 | |||
| d6edc898c5 | |||
| 1dcaf135e5 | |||
| 25919e8393 | |||
| 1080a4e6f9 | |||
| b97769bf5c | |||
| d17c1c57be | |||
| fd1fc0f1d1 | |||
| eeddfcbec2 | |||
| fe2b9bd444 | |||
| 5ebb4b54d9 | |||
| cdd2967087 | |||
| e61505149a | |||
| 8dbe249bf9 | |||
| 38a0857a69 | |||
| 2b1b586251 | |||
| f36cdde500 | |||
| 6de1bfb64c | |||
| a5e82117cb | |||
| 2b7d04368a | |||
| a9dbdbc822 | |||
| 6528829796 | |||
| 3ad682a898 | |||
| 7aca2ee5be | |||
| 1c99f118ff | |||
| b49be74501 | |||
| 55f69da613 | |||
| ae7966a20c | |||
| 2e92fdf272 | |||
| cf9a3cdc38 | |||
| 70951375c9 | |||
| 6329a0070d | |||
| 29fae88610 | |||
| ee0c0fa6ba | |||
| 33822213e6 | |||
| cb05bedf08 | |||
| 4cf328c50b | |||
| f44eb0f8ba | |||
| 76c9029ec3 | |||
| 68e3516075 | |||
| 19ff8e95e5 | |||
| 4bf49bf6a6 | |||
| 0e377e43cc | |||
| f9f23806ed | |||
| 3569e16519 | |||
| 2a40ddd5f9 | |||
| efcd8987d9 | |||
| e66a4ce337 | |||
| 6d19d7c257 | |||
| 988aee863c | |||
| 8253899a70 | |||
| 4edca43531 | |||
| a876fc788d | |||
| cc79e5ca83 | |||
| 8aeb204c8a | |||
| db73939504 | |||
| de90187eb0 | |||
| 8aa809d2bc | |||
| 9e28d91879 | |||
| 2e89516b6e | |||
| f690b8e505 | |||
| 5964e4c332 | |||
| 6033b200e6 | |||
| 0ee33d34f2 | |||
| 44cb99f663 | |||
| 99170bc25b | |||
| 07640b1961 | |||
| e5cb41601e | |||
| f9d8e64a31 | |||
| 7bfdb82225 | |||
| 04aefeae55 | |||
| d6cad30c9f | |||
| 28358306e1 | |||
| 5539a982b5 | |||
| ed22433178 | |||
| 127876bd1b | |||
| c5cae05683 | |||
| 2f3cbdd7c5 | |||
| 9c682e2cc0 | |||
| f31dfd49d9 | |||
| 731b356c95 | |||
| 6d48a01801 | |||
| 3ec06fa3cc | |||
| 5a1d4ad491 | |||
| 581d67177d | |||
| ac6347fece | |||
| ebb42aa419 | |||
| 8223f9742e | |||
| dfdacba649 | |||
| eeeffd1ad1 | |||
| 93fc797b2e | |||
| 094d6de8e0 | |||
| 3d9fc4c40f | |||
| 3cdc207b50 | |||
| 5acd895e0d | |||
| 3715af2172 | |||
| be4d7a6249 | |||
| 04db1ff7cb | |||
| 5f1a04cfa0 | |||
| 4783e22fdc | |||
| db4903cdc4 | |||
| 248e37c292 | |||
| 8a8ba43bde | |||
| 5c0bc4913e | |||
| ca84ed7e63 | |||
| a64fb40d7e | |||
| d11102c643 | |||
| 745b5328eb | |||
| 5fefc74da4 | |||
| a3a73426bf | |||
| 276d867ab2 | |||
| 49b6a1725f | |||
| 4c67f4cc26 | |||
| b369cc4afc | |||
| 52a7f3e2dc | |||
| 85d1048762 | |||
| 8b80c79feb | |||
| 9bef4cb797 | |||
| 39edd3bdcd | |||
| b4585ce13a | |||
| e47790c3f8 | |||
| 5098088237 | |||
| b1c0d614a3 | |||
| 66c9d29539 | |||
| 655c8e609d | |||
| 948a0713d5 | |||
| b43d883db6 | |||
| 73367a10ea | |||
| b9eba042c0 | |||
| 17a33166a4 | |||
| ffbaf87dc9 | |||
| 8ea74c38c3 | |||
| 5789f20794 | |||
| 133e60410c | |||
| 57a8622e9a | |||
| 634039d81a | |||
| b9c9990bdb | |||
| 1e31e737f5 | |||
| 5e3f579431 | |||
| e9e4df8d01 | |||
| a3cdc4fb83 | |||
| c034e5922f | |||
| 3d8d726a52 | |||
| 1b09ac4757 | |||
| f7012d8275 | |||
| e61950267b | |||
| 4c9ff08f4f | |||
| 8668488a20 | |||
| 31f8dc5cbf | |||
| a477129bc1 | |||
| c46b8aecbc | |||
| a010b6177c | |||
| d38b7012e9 | |||
| 6a6152eb0a | |||
| 15121e6d4e | |||
| a8e44d0093 | |||
| fd8f74cf43 | |||
| 472e4da100 | |||
| 607fe8ed4b | |||
| a0a479eb53 | |||
| 04cdb15ceb | |||
| 180e0a3645 | |||
| c931800642 | |||
| e839d1a129 | |||
| 1efec52b33 | |||
| 3799481c35 | |||
| c1025612d1 | |||
| e07a8fbe31 | |||
| 2d52cb1d55 | |||
| a1cdbe5762 | |||
| 2f3bbf1f59 | |||
| 7ceb13d041 | |||
| d04d93eb9b | |||
| f6a3bc9168 | |||
| dca79490da | |||
| abf37168de | |||
| 67fadf0c94 | |||
| 1b29805fc9 | |||
| fcd3bbecdf | |||
| 3d767ffcc7 | |||
| f88711ebf9 | |||
| 17cd564ba6 | |||
| 8bb3bba7e8 | |||
| 5d3dda7a9d | |||
| 5761c182ee | |||
| 0e23e23a7c | |||
| e2736f4db1 | |||
| 1ea78293d0 | |||
| df0a195f38 | |||
| b00d23c46c | |||
| ed4966a3ff | |||
| b03359a3db | |||
| d4e07e981a | |||
| 2d097d0fd7 | |||
| 278b4547f4 | |||
| ee84127892 | |||
| 3724c40afd | |||
| eaada4cf1f | |||
| 033b25de32 | |||
| 32a12d1d6f | |||
| fe27b0e2ba | |||
| 66fcd4c5a2 | |||
| ccdeb6dc0a | |||
| b579262869 | |||
| 11f1dd1623 | |||
| 6a9a25fc54 | |||
| ef47f6cfd2 | |||
| cecd75063e | |||
| 6dad482efa | |||
| 4aae4489b9 | |||
| 1b00dede02 | |||
| 5700075b7a | |||
| 5a461f5bb3 | |||
| a6cbdccadc | |||
| b662a577ea | |||
| 128b1a423f | |||
| 5e41599d13 | |||
| 2cab94f56c | |||
| eedd673d4c | |||
| 25ffde5a42 | |||
| a06134cd6c | |||
| fa57fee9bb | |||
| 404bfdcf30 | |||
| 87d81a6d92 | |||
| 7d41dc1616 | |||
| c1e1502d35 | |||
| 73949712f6 | |||
| 61778974a4 | |||
| c817deb652 | |||
| 802a0117a7 | |||
| 9b2a450133 | |||
| fcfbe920d5 | |||
| b57331f450 | |||
| 944a61100b | |||
| f8ae1a9997 | |||
| 8ea015aaab | |||
| e38019d74e | |||
| 7da892b49a | |||
| 60c84abfe4 | |||
| efa1ac3807 | |||
| f6b7ab7994 | |||
| c0b6d159fc | |||
| fa85685baa | |||
| d1883bdd9d | |||
| b4ff4df808 | |||
| 3254bfa619 | |||
| bf26cf175f | |||
| 2c287965fc | |||
| 4551ded37e | |||
| b4d05af28f | |||
| eac742e3db | |||
| 57a1201b11 | |||
| 85a8a71fc5 | |||
| bd6bb510f8 | |||
| 0cf8221e62 | |||
| 36d4e8fa62 | |||
| a384290356 | |||
| 8b9226d820 | |||
| 35e639c599 | |||
| 3a7f5fcf03 | |||
| 881cbd6d2f | |||
| b319b710df | |||
| dd1ad34cea | |||
| 9406893722 | |||
| cea4d89697 | |||
| 7bbd31fa2a | |||
| c6d9a04dba | |||
| 77fc1aecb2 | |||
| 24da541747 | |||
| 02f7e9c800 | |||
| cbbc2f42e8 | |||
| 7e73dad7b0 | |||
| bc67fc338e | |||
| 6054e7be0a | |||
| a7f31c59a8 | |||
| 345e97f296 | |||
| 7716d4592d | |||
| 7e4eba9eed | |||
| a1089c9dd6 | |||
| 9a032e7422 | |||
| 55dddb69f7 | |||
| 580d42a63e | |||
| 1a1416aaa4 | |||
| 1d74450216 | |||
| 446a0a174e | |||
| 6405273059 | |||
| bbd0a41191 | |||
| 7bc9003fb8 | |||
| 7c745cd9c6 | |||
| 202f7f9107 | |||
| 1e1fbb4ccf | |||
| 0b17e5d288 | |||
| 3b046c409b | |||
| 9eeb56fe3e | |||
| 3124f8133a | |||
| f99ca77461 | |||
| 0bc1c08d4f | |||
| 3fcf44ae32 | |||
| 4d1dc14b45 | |||
| e4710f54f8 | |||
| ce983ec34a | |||
| bf9b535f66 | |||
| a2f0110f3d | |||
| 367924e669 | |||
| 9c6998c6bc | |||
| 1bf848e418 | |||
| d62e474850 | |||
| 7546333fbc | |||
| 405bb0ad90 | |||
| b7e9f8ce1e | |||
| 00a2da7d18 | |||
| 86c29e23df | |||
| 8765d96c4b | |||
| ee6233b893 | |||
| cebdb43234 | |||
| f65da3d98f | |||
| e6e13b2609 | |||
| 96774bb98c | |||
| 681301ab9b | |||
| 0d68dfcbc1 | |||
| 0a17e9a236 | |||
| 8597d2c681 | |||
| eca53baf6f | |||
| b7bc4ea43e | |||
| 6ab2f35f74 | |||
| c015153e21 | |||
| 7a74418c39 | |||
| 6033b3599e | |||
| 37d98063f0 | |||
| 7fe85b44f9 | |||
| 68125a7f50 | |||
| 166879a1c8 | |||
| b518569674 | |||
| 6a25e05e3c | |||
| 179862b10a | |||
| 339cf51c0c | |||
| c8d06997f5 | |||
| 57979f3c9b | |||
| e70a0e4e0e | |||
| 6268fe957a | |||
| 49ce5eecdf | |||
| 4e1da2b6d0 | |||
| 3f7d24bccf | |||
| de0c051e51 | |||
| 1ef99e657f | |||
| 7cbe1c0a44 | |||
| 8c45f18409 | |||
| ae3c02abae | |||
| 543d4af682 | |||
| 19c49fa82b | |||
| a723b8de7a | |||
| 21c3926714 | |||
| 3d79bf82f4 | |||
| 6338f88db1 | |||
| fdfe60dd09 | |||
| cdff2d0d41 | |||
| eb290bf362 | |||
| 18618deea3 | |||
| 67b64f5ec6 | |||
| f394f2c57f | |||
| 46670c7eeb | |||
| eefc79b5b2 | |||
| 744dd4893d | |||
| 7eed86de38 | |||
| 1c04f5a03c | |||
| 9d9d74faad | |||
| c2342776e1 | |||
| 09aa89f3f9 | |||
| a8430e09f5 | |||
| 768b039cde | |||
| 3f1b9a6b4a | |||
| 638e29b5d6 | |||
| 5abc48269b | |||
| c81b17c1cb | |||
| c928bc8ce3 | |||
| f33a4975ef | |||
| 5920137968 | |||
| f636e1d45f | |||
| 7e6a243df9 | |||
| ad7ba8f029 | |||
| 3096a26b59 | |||
| ff2a719bf7 | |||
| b6c4aaac8e | |||
| f7ad4ca025 | |||
| 4666b7fb69 | |||
| 125ce48525 | |||
| 114d12b060 | |||
| bf1566884c | |||
| fa7b6a8cec | |||
| 9855104120 | |||
| 36f7125513 | |||
| 6ebd5ddc53 | |||
| 2bc4103ea9 | |||
| 01eab7dccb | |||
| a95dee3d09 | |||
| 891c85a2c1 | |||
| 386f9b2074 | |||
| 325d5a6bcd | |||
| f05d7f4176 | |||
| a8ea2e05a4 | |||
| 8bcb88d6fd | |||
| f9bd431d56 | |||
| 0c6e180937 | |||
| 2c5fcd7d2c | |||
| 1a19c761ae | |||
| 71b8823625 | |||
| 24cab0eabd | |||
| 3e5c236942 | |||
| a3f74b2f68 | |||
| 2d09237bd7 | |||
| d26b94db61 | |||
| 017c41bc5f | |||
| d7857dd026 | |||
| 7ac5a172fa | |||
| f44a64a705 | |||
| 490b630e2d | |||
| 1265dc6334 | |||
| 69f994e1b2 | |||
| 0f841f194f | |||
| db6aecda47 | |||
| 83ca78a5fb | |||
| 2f0ae47c8e | |||
| 11a2d81738 | |||
| bb4ea2db67 | |||
| 70a2321cc1 | |||
| 2331742384 | |||
| d41ea73765 | |||
| 5a5616f258 | |||
| bd3108a40c | |||
| 8c9a12e3a1 | |||
| fe45fa81fc | |||
| 3e30600f70 | |||
| 5c05ec5b98 | |||
| 7024117709 | |||
| fd38b708fb | |||
| 153020283c | |||
| b41d1e0eaf | |||
| fcbfd00b98 | |||
| 51edb08796 | |||
| bb087fdc45 | |||
| a4a2196cc2 | |||
| 8ab96afd5b | |||
| f5b230a2ef | |||
| 076defb0a5 | |||
| 76660ff15b | |||
| 60471ecc1e | |||
| 9e68ba1ea3 | |||
| 414dddbf59 | |||
| a0c61484d2 | |||
| 7f6787c8b8 | |||
| 8c74dcde28 | |||
| 27332a8a17 | |||
| 8733da346b | |||
| e644f5be05 | |||
| 7007601655 | |||
| b1fc1cd11e | |||
| 919edcf1e1 | |||
| d99260c614 | |||
| cf9d1ba541 | |||
| d6628419c9 | |||
| 75eb5491d5 | |||
| c32d8f38ed | |||
| 9f22c35519 | |||
| f775500932 | |||
| fdbdb76c39 | |||
| af26e17fa7 | |||
| 769bf51359 | |||
| c81c316a46 | |||
| e5192ceddd | |||
| 89ddf97fa0 | |||
| 79b2eb0ff7 | |||
| 0ab0c7b8ed | |||
| 1d582a515c | |||
| a4a6064316 | |||
| 910d95a7b6 | |||
| 3cedadd738 | |||
| 3ba2d4428b | |||
| 7a545df299 | |||
| 2b3d6075e2 | |||
| 1073a524b9 | |||
| 6dd9cb6fb8 | |||
| 6789755b06 | |||
| e7dae3a9c1 | |||
| 1f78a15db2 | |||
| 79a4f42ef9 | |||
| 8fdf3799a2 | |||
| 4b095ab61f | |||
| 757d617ef3 | |||
| 17923c0d9e | |||
| c9f9db9069 | |||
| 90d03c784c | |||
| ea436444f2 | |||
| 209bb4290f | |||
| 7d9d2e508d | |||
| 5bd8e7d4e8 | |||
| 30f19be555 | |||
| 3e140ddcfe | |||
| 81143324a5 | |||
| fabb646a0b | |||
| 85131e359e | |||
| 5a0f8019c7 | |||
| f067dc8b32 | |||
| 14110cdea8 | |||
| f885296fb2 | |||
| a6c5f46f2d | |||
| 145ea35ac3 | |||
| 1399ed198c | |||
| c2fb99ce49 | |||
| 53542a9d37 | |||
| e77690c268 | |||
| d8e45ef866 | |||
| ffc24ad518 | |||
| b79c17b43c | |||
| be415dab1d | |||
| d0278dad15 | |||
| 927ff2bca7 | |||
| fc7b9029c9 | |||
| 187b529dbb | |||
| 2061947138 | |||
| 04c24cb686 | |||
| f38935459b | |||
| a6ce907a4f | |||
| f1dbfffd82 | |||
| a46d344db2 | |||
| 5476a03799 | |||
| d4569d66ac | |||
| c4ce6d9ab1 | |||
| fa083142a7 | |||
| 8aa8451434 | |||
| a1f81bbe97 | |||
| e9669c6594 | |||
| 690e7144c1 | |||
| a53b3d496c | |||
| be7f436951 | |||
| 7708753ed3 | |||
| 95d5ab706a | |||
| 7afb4e68f1 | |||
| 4caad33c9a | |||
| 1ece12b907 | |||
| 88c2f8504e | |||
| 9137a9ec80 | |||
| fad35e7e00 | |||
| 009925724e | |||
| 8504f30594 | |||
| 96116659be | |||
| 1e7df3606a | |||
| 603029b106 | |||
| 4ca54b2f1d | |||
| 555e24dc59 | |||
| a651aaea00 | |||
| 258b804941 | |||
| dbb4e67737 | |||
| ec1a5d1318 | |||
| cdab6cfdbe | |||
| 33b3d5edfb | |||
| e1aa6f7e84 | |||
| bfc1665d87 | |||
| 9e937f8113 | |||
| d114d9e386 | |||
| 4e8d1366b6 | |||
| 8afb0255f0 | |||
| dac6c662c5 | |||
| 577229bb6e | |||
| b5fdf4f1da | |||
| bf7d383066 | |||
| 6e977b668c | |||
| fdc52d933a | |||
| 316f7309a1 | |||
| ff75a28080 | |||
| e7b5e816d0 | |||
| db41bc2870 | |||
| 585aeb7f91 | |||
| 1b644a164e | |||
| c4e42f46a9 | |||
| bff4d1239c | |||
| 8a89e160ed | |||
| 198052358e | |||
| 6730b7d656 | |||
| f917efd430 | |||
| 7d51fc7dfb | |||
| b192495bbc | |||
| 34a697fc37 | |||
| 2dda514cb0 | |||
| 82d667e30c | |||
| 29b0b9cfcd | |||
| ed7f92ebc7 | |||
| 93ae8f4066 | |||
| 6b030ac9be | |||
| 8470c44bb0 | |||
| 4c75540ca2 | |||
| 70f43b0003 | |||
| 91452f3b58 | |||
| daeb396fd8 | |||
| ad649d9670 | |||
| 0038722d0f | |||
| 6a00664b2a | |||
| 2956543d27 | |||
| 0fcf722af4 | |||
| ceebdbfdd3 | |||
| 1b05af7f8e | |||
| 123b7b5537 | |||
| 5fa1257e2c | |||
| 5c405a6f40 | |||
| 03b5d6125b | |||
| 2376811df8 | |||
| c48997608d | |||
| 8a5285db41 | |||
| c4d6fc943a | |||
| 3655df08ea | |||
| 7858e6aa7c | |||
| c909988aa5 | |||
| 5deaba9669 | |||
| f162b6662b | |||
| 2d5f342ee8 | |||
| 85a2aee79c | |||
| a4cc671c22 | |||
| 2912138ef2 | |||
| cdae489afa | |||
| 51ad0c18ff | |||
| 998255fb1b | |||
| edfb5811cf | |||
| c733b32672 | |||
| 38862c1a09 | |||
| 03161c81df | |||
| 264c73747a | |||
| 5e53e410ce | |||
| b42ec57f6f | |||
| 4d0f664f50 | |||
| 2ea3b8b068 | |||
| 0810492a2c | |||
| c5178979ce | |||
| 08bdaf07be | |||
| 832764aa3a | |||
| 43c87d0cb6 | |||
| 6a6b944c00 | |||
| 90eb83dcb2 | |||
| 31b722f9d3 | |||
| e3351a9686 | |||
| 19dea9095e | |||
| 3b023da602 | |||
| 33d0a72fce | |||
| 5136fc535f | |||
| 16a21ade8f | |||
| ec2b2dc291 | |||
| 2703a5aebd | |||
| 4bdd21b281 | |||
| 499d41206e | |||
| ece008e790 | |||
| d1cfa88bc0 | |||
| 0e28b55184 | |||
| afccbbe04d | |||
| a4cec09781 | |||
| 54d70ec738 | |||
| 39c3a38e2d | |||
| 699897ddf8 | |||
| 00d3af4816 | |||
| ceadbbcdc1 | |||
| e703b53b3a | |||
| f037cc3c74 | |||
| 7dec942ef7 | |||
| 1d0ca22572 | |||
| a6decc3cc7 | |||
| b58cc107e6 | |||
| a593306a06 | |||
| 0177590699 | |||
| 787fe28fd0 | |||
| 541568e09f | |||
| 5dd7ef6895 | |||
| 153df79699 | |||
| 4ad9af71f5 | |||
| d76671a601 | |||
| ea094a4fbc | |||
| cb11dad4de | |||
| 817cf192c8 | |||
| aec00ab96f | |||
| 48b288cdc2 | |||
| 66d257f620 | |||
| dd14218c34 | |||
| 918231795b | |||
| 9f71172437 | |||
| 69e3b23960 | |||
| 7b426e8103 | |||
| 27e1043fc4 | |||
| 76518712c4 | |||
| 64843d6b0a | |||
| 87fa661591 | |||
| 2ec6d22131 | |||
| f6ac92dc39 | |||
| be69f7ad20 | |||
| 9a7cc494f7 | |||
| 8c3d4d4eda | |||
| 636ca7a74b | |||
| c57c1e94d1 | |||
| 1e1c2cbb7d | |||
| 5399b6f438 | |||
| 41b6c8434a | |||
| 3031b9e6a5 | |||
| 0d5331df59 | |||
| bca75d4930 | |||
| a70965eb6d | |||
| ad21bfda4d | |||
| fef46ffacf | |||
| f803745fc6 | |||
| c36ab1c6ed | |||
| 28f9d7f28f | |||
| 5b225186c4 | |||
| 09bb2a6054 | |||
| e1ea1237b7 | |||
| fb65f5d1ae | |||
| ff439ecd7f | |||
| 4cc4df87ff | |||
| 56aabe20bc | |||
| 4b624381e0 | |||
| c5508f34b3 | |||
| 3c667d7652 | |||
| 4664427784 | |||
| c747ffef95 | |||
| b5b1777304 | |||
| 228004b472 | |||
| a1f91c08ad | |||
| 96dc27d9e6 | |||
| 11f9f15199 | |||
| 991a92429e | |||
| 4f17dc0716 | |||
| 37c7fa9fb4 | |||
| fd2f700390 | |||
| 97255b2b7f | |||
| 8d32141b8f | |||
| 7700779e2c | |||
| 1cc9d2ce5a | |||
| b9980df1b7 | |||
| af8b256a00 | |||
| 324c39931c | |||
| 113325673f | |||
| 857b02706e | |||
| 1e0f1b39b0 | |||
| 6a429facb6 | |||
| 8663a6c7a0 | |||
| b6ec124ceb | |||
| 85a3b72c71 | |||
| d9b489d471 | |||
| 3289c6c305 | |||
| ec83adde3f | |||
| 206c8e1189 | |||
| 07545ba49c | |||
| 8312497d6c | |||
| eed2bed0bd | |||
| 49045cf08c | |||
| 55f7a99d1b | |||
| 98addf78b4 | |||
| 4b42ec3218 | |||
| e469d9d1f9 | |||
| d53d9d88fb | |||
| ed484deec6 | |||
| df9502dd06 | |||
| 6001254160 | |||
| 2b0c4ba215 | |||
| 1e9088f7d2 | |||
| ec9e283d34 | |||
| 20e7d431a6 | |||
| 6c745e6e9b | |||
| d1635e17f6 | |||
| f9e5881b45 | |||
| 869505a659 | |||
| 895d265603 | |||
| e5e60c6bed | |||
| 568e6c8093 | |||
| cf01f1a264 | |||
| be7de02a1d | |||
| b8d88f0dc5 | |||
| 698bc0cdac | |||
| 48a7a863ae | |||
| f2c4fa2b46 | |||
| f996d6cc7a | |||
| 0dbf3ef30a | |||
| 76b558c831 | |||
| c10bb66b12 | |||
| 89a391d001 | |||
| 0fef63956f | |||
| 63c2af4fa4 | |||
| 3ff7ddbea7 | |||
| 21733e7bda | |||
| 3fa60aaed8 | |||
| 9422e37c45 | |||
| c074c8c9d4 | |||
| 27c4956046 | |||
| ebbd7c48d3 | |||
| 079edee146 | |||
| 87f9452bbe | |||
| 9c0c64e87b | |||
| 3b65c120e8 | |||
| 3289835b53 | |||
| 7745d37d6c | |||
| 37e440b093 | |||
| 7792364e8c | |||
| 3a4ad03492 | |||
| cac7dbc607 | |||
| 7326c9cb73 | |||
| beb8e76bb4 | |||
| 43e37caf46 | |||
| a985798a86 | |||
| d09cca948f | |||
| 3f52031b86 | |||
| 7448116f37 | |||
| 4e0d54fe21 | |||
| 10d8275962 | |||
| 157cbc2f68 | |||
| 7d64d2e92a | |||
| f86261c812 | |||
| e1eb33a320 | |||
| cadcc20ea6 | |||
| 56ad7642c9 | |||
| d1695d3408 | |||
| b51fbe5c50 | |||
| 04c0ba65d2 | |||
| c2f5e7d88c | |||
| f456a92f08 | |||
| 48419d8fd9 | |||
| 0ef5dbac4a | |||
| 8014e0d993 | |||
| 739238659e | |||
| 6de593c771 | |||
| 4e9fd3ee9d | |||
| 900056be44 | |||
| 221cb6d5b2 | |||
| 83e693c78a | |||
| 8db5848e91 | |||
| 27807f02c5 | |||
| 30e31ff164 | |||
| ee0fe85cd0 | |||
| b2270b2f4f | |||
| 141252b73f | |||
| 7c4ac2e3a4 | |||
| 46b731b2d3 | |||
| bd76e47976 | |||
| bd2c878b35 | |||
| 84ee9591d1 | |||
| 15b27fa35f | |||
| e41536484b | |||
| d3004fc833 | |||
| 395c5fc922 | |||
| c20de314cc | |||
| 4881e6477f | |||
| 93609837dd | |||
| a8b3c20e66 | |||
| db2fba1faa | |||
| bf9cbb4491 | |||
| 18f32cfbd6 | |||
| a5a3ef17b8 | |||
| 326b827cc6 | |||
| 961efac8e2 | |||
| 418d26d250 | |||
| 07fb2a3e93 | |||
| 5006cca67b | |||
| 735e3b71d6 | |||
| d9da8228d4 | |||
| b5a7e66134 | |||
| 00bc96a2b7 | |||
| 5dd66771fb | |||
| 6f19a7deac | |||
| 811585b00f | |||
| f610377363 | |||
| 8c549a28df | |||
| cab22ffeac | |||
| 60c9f576f6 | |||
| b619c2069f | |||
| 3efdcb95cd | |||
| 4b11862ecc | |||
| c5e9b187ae | |||
| 04fc574229 | |||
| f6b6665fed | |||
| 0da9086397 | |||
| c5852c1237 | |||
| 5bbd7cb013 | |||
| a3b4a09fd2 | |||
| bf783c42bd | |||
| 57e832dc65 | |||
| ab2d301968 | |||
| f1f961a43e | |||
| 8e345bd09c | |||
| 0996c307ac | |||
| fb8e505590 | |||
| ec2804a78a | |||
| 29d2ee3273 | |||
| 6e3e6a1944 | |||
| 1005fd2872 | |||
| ab666cc267 | |||
| e79df21353 | |||
| ff0ddbcac0 | |||
| d1604137cc | |||
| 969efff611 | |||
| 293f7cca28 | |||
| 45a48cfcb2 | |||
| 822cc6a781 | |||
| 658f02a6b9 | |||
| 8d675d9bc0 | |||
| fdf135d877 | |||
| a2bb144556 | |||
| c867ed9de4 | |||
| 39ef596bdc | |||
| a9bcaa1493 | |||
| f05163fbeb | |||
| 7ad3e0c544 | |||
| 24882a9324 | |||
| 9bb6ead2b1 | |||
| d6bcbc5cdf | |||
| dc4b261c68 | |||
| 9262f13eef | |||
| 82998d0cc0 | |||
| 8949cfe584 | |||
| c10d1fe279 | |||
| 9ed5ee8310 | |||
| 7b266ef475 | |||
| 09f1a4fbb8 | |||
| c7f55381a5 | |||
| 81f35ffe73 | |||
| 597b362603 | |||
| 0163e4b4e4 | |||
| 98a77ee649 | |||
| c9edd2c8de | |||
| 379ad3a8e7 | |||
| aca64b5dda | |||
| d34639b79b | |||
| 0d4b157207 | |||
| 58160d9624 | |||
| 57e34dfb3c | |||
| 67ab19289d | |||
| 7718bf6858 | |||
| ee467d0203 | |||
| 9b7265810b | |||
| 24dc1092b1 | |||
| ab953f1381 | |||
| 83174e996e | |||
| 38069048fd | |||
| 9fda651595 | |||
| cb13ae57bc | |||
| 6a45d30715 | |||
| a43f24617d | |||
| f11a148d2d | |||
| 73cf4c0e49 | |||
| 8ea3cd1cb5 | |||
| 62979ae06d | |||
| 5e998288d6 | |||
| e01b851e1c | |||
| 2e6a40be96 | |||
| 02c1ec5efc | |||
| 78a6ba31d8 | |||
| 1ae23df0ba | |||
| 36ba9a7309 | |||
| 7ee129b21a | |||
| b3d4123007 | |||
| 5bfd330692 | |||
| 49125d1a7d | |||
| 6050ef41a9 | |||
| 0d809688ee | |||
| da20e80de6 | |||
| 1f46bf2e28 | |||
| f345dbe7e4 | |||
| 490c8d856e | |||
| 897a5b8de6 | |||
| 155cb4f158 | |||
| 445cf5860a | |||
| 6cb1bae032 | |||
| c0c9d667cd | |||
| b946032f56 | |||
| df8826240f | |||
| 5dda4f95a6 | |||
| f3822e6ffa | |||
| 084ad26b73 | |||
| fafecb491e | |||
| 0e6a590305 | |||
| 0e8c9fda5e | |||
| d2ac283570 | |||
| 69bdc16751 | |||
| b8325a38a1 | |||
| 403a1a7e1f | |||
| cf481d2fc4 | |||
| c3e3fc4dba | |||
| 254ad1b26b | |||
| 2c642afd04 | |||
| e43fab7c01 | |||
| 55f2914163 | |||
| 96d7ac7c6a | |||
| c9be096e88 | |||
| e18b8642c4 | |||
| dad83c9004 | |||
| f0a86c360c | |||
| c6444b7d05 | |||
| 6b81b6931f | |||
| b391fb3faf | |||
| 2649c38bf7 | |||
| 81266f2f71 | |||
| 05189f9ff5 | |||
| a3f8783dca | |||
| c20d23a552 | |||
| d2ed926077 | |||
| c0b3ad8253 | |||
| 30495f780a | |||
| a2114c44ad | |||
| 0f06a927ff | |||
| c5c41b8ab5 | |||
| 1f4ca54938 | |||
| 720e3e9272 | |||
| a42400272d | |||
| 19558b48c1 | |||
| 744d875838 | |||
| 59d2523c49 | |||
| 13fdde5e5d | |||
| 86e73c1bae | |||
| 6cd558fd5c | |||
| 8f45c7d27e | |||
| 3518b18351 | |||
| 6dea106650 | |||
| 123a29d126 | |||
| 9a8383de24 | |||
| 2453201d7b | |||
| 14deef3adf | |||
| 8c191e5ba8 | |||
| 20fc4a2efe | |||
| 49a577dd59 | |||
| 8b8f5d45c9 | |||
| cec687bad2 | |||
| 9891e2d986 | |||
| 24b23e2383 | |||
| 413aa106a2 | |||
| 097dcd724f | |||
| 1454880fb7 | |||
| c6a712dec3 | |||
| 2c888b86f5 | |||
| 7481dcf520 | |||
| 435a34cd60 | |||
| 23ffcf8f89 | |||
| 89d6a09401 | |||
| b8fce6a8e1 | |||
| 523e7eb397 | |||
| 30a3668779 | |||
| d95ea479c4 | |||
| baf18a6379 | |||
| 92831ee7d4 | |||
| de823996b5 | |||
| 936974f12c | |||
| 0c88507dcf | |||
| 9184095b34 | |||
| f1eea58b6b | |||
| 49f2206ef0 | |||
| 8f94a14063 | |||
| 9843e0c436 | |||
| e3149cd2b0 | |||
| 7c5d2ab029 | |||
| 6422be116b | |||
| 50eef193ff | |||
| 8092d98ea3 | |||
| ed42891509 | |||
| 6124226428 | |||
| 6c22590d4a | |||
| 950d9ae23a | |||
| a12ff75fee | |||
| 681413bb97 | |||
| 1ebe2c8728 | |||
| 41dd21ac7b | |||
| 6b6d9706bd | |||
| 1b57a79636 | |||
| a1f3b7d53f | |||
| 1118ef8f19 | |||
| 4b9526adb1 | |||
| ef3f42dfab | |||
| 6f018668c2 | |||
| f20d6e8d05 | |||
| 0574bf8aba | |||
| 7ea9f8ddcc | |||
| e4d9cb77fc | |||
| 7eee33a6a0 | |||
| 3bbafe14f5 | |||
| 1dc048662b | |||
| 7546651a30 | |||
| 6d16131b03 | |||
| 7eb196b4d1 | |||
| 1e8f7f7ba8 | |||
| eefbd1610e | |||
| 0f8af51da6 | |||
| c14dad91b2 | |||
| 2538262531 | |||
| 453a135a3e | |||
| 0cfa6d8097 | |||
| 7e77f3b902 | |||
| 71d2467963 | |||
| a6140c799d | |||
| bd7217b090 | |||
| cc45f4f212 | |||
| d95710f8e0 | |||
| b3703f1f91 | |||
| 104d63fd7c | |||
| df994764a5 | |||
| 764ef2dcc9 | |||
| 1dddc22a9b | |||
| ebac5c4a70 | |||
| 59a3715e40 | |||
| 86bb2f325e | |||
| eb370afe4a | |||
| fc06b1762f | |||
| a1fed86b28 | |||
| a96a265a7b | |||
| a2d65bb523 | |||
| 7c966fa775 | |||
| 8042d6f892 | |||
| d4c8c0bb52 | |||
| 148d567aa4 | |||
| 85e96c92ed | |||
| b25e440ba9 | |||
| c4d874cdb1 | |||
| 4e96cc4bbb | |||
| 78f928544f | |||
| 0edbe77903 | |||
| ccf8c3bd83 | |||
| f8020f4728 | |||
| 23bded5697 | |||
| 9df7292af6 | |||
| bcb05fbc14 | |||
| 7adc495692 | |||
| 69f8ee8ee2 | |||
| 4acb97e02e | |||
| 7cd840bf83 | |||
| 9577736788 | |||
| f7ec499ee9 | |||
| a64e1b3397 | |||
| abeba63ed5 | |||
| 0dd05887d2 | |||
| f8b3873b83 | |||
| 63362c97f5 | |||
| b07b214293 | |||
| e368ae3230 | |||
| 9cf627a656 | |||
| 5d383f1885 | |||
| f9b7ede7ff | |||
| a2a44bb7ef | |||
| 1f37ca437b | |||
| ac77e047f4 | |||
| 02a6baad8a | |||
| 799ef3bc0d | |||
| b337dccd0c | |||
| 8867bf262b | |||
| 0543670734 | |||
| 9c66afb6fe | |||
| 0dc8241605 | |||
| 7ca5c4099e | |||
| e40c8fa164 | |||
| df88d0cbea | |||
| f73e785662 | |||
| 1bb685cc57 | |||
| 5d4da5ede9 | |||
| fe295788e7 | |||
| f8b3eaedb5 | |||
| e5e83eba05 | |||
| 28a35c9883 | |||
| d8a6c7c1bf | |||
| c8f6806287 | |||
| 8bf57814a4 | |||
| c2d4338024 | |||
| 6410862b15 | |||
| 4845668a4a | |||
| 146adbf831 | |||
| d1f291acb8 | |||
| 4b7c3010e0 | |||
| 4039f66530 | |||
| 4ce6362f4c | |||
| 5765ebef08 | |||
| a3eb501225 | |||
| 82706bf152 | |||
| 5e852ba1fd | |||
| d49cdb2ded | |||
| a8ad1f8097 | |||
| 2ea3c4acac | |||
| d1e3bad24f | |||
| 06f46e4b14 | |||
| 54714fd989 | |||
| 912d308b9d | |||
| 0b71e4a98a | |||
| 900bef9ccf | |||
| 7106d1e605 | |||
| 6840ec0d09 | |||
| 0e8e811b14 | |||
| 3dc986bbf6 | |||
| 34813dc07c | |||
| f79d75076c | |||
| 57b5ce84a5 | |||
| 395338f46a | |||
| c33cd27626 | |||
| 2ca4512443 | |||
| 76b4dc7346 | |||
| 53609d2ecd | |||
| d24054ac00 | |||
| 2c0619f69d | |||
| f039aeb4c8 | |||
| ab0e47d402 | |||
| 03128b7530 | |||
| ed3e79325f | |||
| c4c715fcd0 | |||
| 86b83ddbc9 | |||
| 62c43eaf53 | |||
| 33cf2243a8 | |||
| 02a1c2f096 | |||
| b841150c23 | |||
| 3db19ba2eb | |||
| 22d1f50455 | |||
| baee140518 | |||
| deaa4529ae | |||
| bed29749f2 | |||
| e57cbd3348 | |||
| 2f788445a9 | |||
| d4e55c69c1 | |||
| d07351c8ba | |||
| 2412caf494 | |||
| 9b6f75afd3 | |||
| a4b2a6537c | |||
| cfaa7d9e54 | |||
| 0ca3012c67 | |||
| 42ebece808 | |||
| 0d7510c129 | |||
| ebe697f62a | |||
| 29240fd14b | |||
| 97f4d18a13 | |||
| 8ef0dd69da | |||
| 30d41b33d1 | |||
| 2ce06cfe08 | |||
| 3b1a1125d2 | |||
| 93cdfb566b | |||
| b61ac2069d | |||
| 6e8a71ec34 | |||
| 3b3fc0151e | |||
| f5643f2332 | |||
| 38e5d961f6 | |||
| 5be15bed82 | |||
| deb6aa8cc5 | |||
| 3b3e19ee8a | |||
| a713e47713 | |||
| abbc83bd51 | |||
| 7d4aaa8cdb | |||
| 06b3172333 | |||
| 2062cf8fe4 | |||
| 3e15da5bcc | |||
| 520eace689 | |||
| 9ed3c5dc46 | |||
| 7db3834f0b | |||
| 5979b1a1b6 | |||
| d283a8c878 | |||
| 3f2a258930 | |||
| 550d36dc33 | |||
| 46b9d9e359 | |||
| 3e084a3b0e | |||
| 391a663360 | |||
| 068ae2f344 | |||
| 64dfea78b8 | |||
| 3bbcd30396 | |||
| 09bfd3311c | |||
| fdd0e02c35 | |||
| 10b5322b87 | |||
| f01feef636 | |||
| 1aed2b3114 | |||
| adc9b70d72 | |||
| 5f86a70891 | |||
| ea9a84b748 | |||
| c73ca9a6da | |||
| e467e58857 | |||
| bb73777a4a | |||
| a63a62f827 | |||
| 1c6574e69d | |||
| 313785b421 | |||
| b6261f3d80 | |||
| 3dc4de85b5 | |||
| bb0711eb3f | |||
| 0cb647ee1e | |||
| 5a0c37e2b9 | |||
| 4a3ddd5b2c | |||
| e6095e6fd8 | |||
| 33d1d0f8e4 | |||
| d02025b0ed | |||
| 28af99d95d | |||
| 619c8e689a | |||
| c03355d67f | |||
| 417572f3c5 | |||
| c5ed76f104 | |||
| 5721a279c8 | |||
| 0cf8553b2e | |||
| 6d5b865741 | |||
| 7b08e81991 | |||
| 6d4e0ff665 | |||
| bd6ea96ed6 | |||
| 9feccc625b | |||
| 65949662f6 | |||
| 22defb9ad4 | |||
| 37cb4d00df | |||
| a48c0ece4b | |||
| b8c77dc417 | |||
| ed42ae5a79 | |||
| 20f83297ce | |||
| 896dc0fcf6 | |||
| f8a238e670 | |||
| 3b8f2a551b | |||
| 2263633df8 | |||
| 59b7a8ff8f | |||
| 9e6b63e3da | |||
| 5eb63c42f1 | |||
| 1bba1c5ee0 | |||
| f7047d3cfa | |||
| cb16951519 | |||
| 14dc5709ee | |||
| 7d03b0af33 | |||
| 33f7d83c71 | |||
| e469a6b3d8 | |||
| 2971ea6564 | |||
| 02ced9a339 | |||
| 1960a8768e | |||
| f4c8abb1b4 | |||
| ab9630b825 | |||
| e79d6ae971 | |||
| 0348e13258 | |||
| 40c7c7dae8 | |||
| 396695c866 | |||
| a07ae76bcc | |||
| 0221700226 | |||
| d8f3424554 | |||
| 623234c7c2 | |||
| 49aff4eba3 | |||
| 9281d15c70 | |||
| e482826ac3 | |||
| 49e2e292dd | |||
| d721f176f8 | |||
| 58532cd8c5 | |||
| 37fe3ca01a | |||
| 1a01535313 | |||
| 2ba0f5d807 | |||
| 48fa8fd20b | |||
| eeb179fc9a | |||
| 76d1abb9ca | |||
| 68d2aed8af | |||
| dfdecb7e0b | |||
| 2b54414e60 | |||
| 2f03f95e9d | |||
| a828d714c6 | |||
| e36a3dd460 | |||
| b60fda3fec | |||
| 590b237338 | |||
| 237592fbda | |||
| 9a6a301c4f | |||
| 064c057200 | |||
| d1077e6171 | |||
| b90e483117 | |||
| ad25f4c43a | |||
| de22ae4a99 | |||
| d166463bca | |||
| ef326260c2 | |||
| a969e87f13 | |||
| 532fb73c43 | |||
| 0c79aa30ab | |||
| cd68572df5 | |||
| a37cc75bd7 | |||
| 3b8118ac0b | |||
| bdf725f86b | |||
| c8866b7d4c | |||
| 552b211124 | |||
| 680fe999b2 | |||
| 1e380374eb | |||
| 25705ad61b | |||
| 6351d5a283 | |||
| 1666e12db2 | |||
| 728cbcdff4 | |||
| bd047624e5 | |||
| 0e8f5b8147 | |||
| 45d4353cf4 | |||
| c7455ca776 | |||
| 5def0c2eea | |||
| 9e4090f601 | |||
| d1a8ecca70 | |||
| 69415616f8 | |||
| 7eec35e4ea | |||
| f76bf37229 | |||
| 5c335f3acc | |||
| 98f91f8b0a | |||
| 93e568b254 | |||
| e86579b576 | |||
| 672ffefb5f | |||
| c500a6704e | |||
| 3e0c355d7b | |||
| 87da1b2d0c | |||
| 0d45084914 | |||
| 9097433898 | |||
| 0b704e356f | |||
| d847d5b942 | |||
| 694c900cd4 | |||
| 9204086f41 | |||
| d8395dfeb6 | |||
| 39f84d7fe4 | |||
| bbc8c1121f | |||
| 383ffdfe0a | |||
| 8c89c1daf5 | |||
| 706337b8ea | |||
| 9f67477858 | |||
| b703d81561 | |||
| 9e8be6cd28 | |||
| 250960f771 | |||
| bbfb0d669c | |||
| ad14802227 | |||
| d5b1087fb8 | |||
| 150b7cd4e2 | |||
| 20fc8ee3cc | |||
| 47877ec70c | |||
| 91e8aca0a9 | |||
| f809cc2db7 | |||
| b07caa93c9 | |||
| a65c42b7d8 | |||
| 583006b599 | |||
| 29b5837a91 | |||
| 26eadad611 | |||
| 0aafa5a591 | |||
| 0a42863bd1 | |||
| a1f23f3a4c | |||
| badef10f41 | |||
| f1284bd73c | |||
| d2926d2edf | |||
| da45f02f6a | |||
| 67a3a7521f | |||
| 699f87c617 | |||
| a568ed2bd8 | |||
| 6b4366a0a4 | |||
| 5aa957bcff | |||
| f22b5abfac | |||
| 8811f5053d | |||
| b16571bb86 | |||
| d12cf29322 | |||
| 7c8c7984a1 | |||
| a35ddcd0e1 | |||
| ddc95bc7f7 | |||
| ce99a71a52 | |||
| 9882eef93a | |||
| 140667308d | |||
| f50859fd09 | |||
| 86267bd8d6 | |||
| e5f6738280 | |||
| d6acc8debe | |||
| 84c562de1c | |||
| ddd6bb632a | |||
| 85b69b8689 | |||
| b2837d38b8 | |||
| 06582b4cf9 | |||
| f5d0863b2e | |||
| f05c0cd6ce | |||
| 223642904f | |||
| 8317e918d9 | |||
| d497b62fb3 | |||
| 014ba087a8 | |||
| dfa1f480b5 | |||
| 9ce8fcd268 | |||
| 6bd07d3d63 | |||
| 125d820dac | |||
| f77f7e645b | |||
| 82bee848a1 | |||
| 41aa30c93f | |||
| 594c4102f6 | |||
| cf1ae599f1 | |||
| 9fbc499361 | |||
| 3d747571d6 | |||
| 036e02e052 | |||
| d03a9188ae | |||
| a07e6e4013 | |||
| ea0562c124 | |||
| 215b6cc634 | |||
| f7460dfa9c | |||
| 92a285378a | |||
| d033f2235f | |||
| 29016a1fe4 | |||
| d75596c9b8 | |||
| 8ef3f8ade3 | |||
| cdce807375 | |||
| 4c9cf84dff | |||
| f878e38d12 | |||
| 24c572b806 | |||
| abb05eae40 | |||
| 934271b272 | |||
| a3366e6c95 | |||
| 8971bf7546 | |||
| 3a673cc06e | |||
| 8bf09f65cf | |||
| b7f5699b3e | |||
| 7d01550649 | |||
| 05aedc7c57 | |||
| 9af5367aee | |||
| 3c1015942d | |||
| 98329144a0 | |||
| dc990a5309 | |||
| c28dc2bb13 | |||
| c3fa406d60 | |||
| 3c84312ac5 | |||
| a88656ea5a | |||
| 86ad0d2c62 | |||
| 5512567d74 | |||
| d14d7f67b3 | |||
| f6b8a150bb | |||
| ba8ab188d8 | |||
| b188f76b65 | |||
| 48a745e934 | |||
| e1c9cbedd7 | |||
| c53c5b47ea | |||
| 487ac04a1b | |||
| c98771f683 | |||
| 9f990349ff | |||
| 3aed6de76e | |||
| 1be7a45f18 | |||
| 531228f3c0 | |||
| 15a53269d2 | |||
| 7187639286 | |||
| fd72c74184 | |||
| 9912fce370 | |||
| 063850bc20 | |||
| fb8c1ad75b | |||
| 805c6b9711 | |||
| e3fbd46a79 | |||
| 9fc9ca3265 | |||
| 40aee428b5 | |||
| b7fe42a545 | |||
| 5cbd311e80 | |||
| 4f74bf88f1 | |||
| 4df999cbe2 | |||
| 039fe4bddf | |||
| 833bbc5b88 | |||
| c0dfc5bb89 | |||
| b1866205ed | |||
| 50067840c7 | |||
| aa6c9e7f21 | |||
| cf4991979d | |||
| 09cfdfd756 | |||
| 72970d8c7d | |||
| c3d320aa8c | |||
| 3fcbc847a9 | |||
| 151fc3065b | |||
| 7eeb8a2c0c | |||
| 93437e3539 | |||
| ae81396710 | |||
| 7a61b1f4b9 | |||
| 6fd2e6ced0 | |||
| f3ddaf5dce | |||
| 961b408f10 | |||
| 18c5a9aef4 | |||
| 880844d178 | |||
| f55cf6f90d | |||
| ea90b73781 | |||
| e81576b74e | |||
| 4de3380ca5 | |||
| 7f2ecfe721 | |||
| 62c00ba871 | |||
| d55c34f662 | |||
| 76821902c8 | |||
| 504fd3e282 | |||
| 86da74e0bc | |||
| 484bbcbfba | |||
| 500e3b9d85 | |||
| b299c85f98 | |||
| 6a39f5bd1c | |||
| 2cecd66a50 | |||
| ca15df807c | |||
| ce4d8d902d | |||
| 0f83413a8f | |||
| 12a5a2da41 | |||
| 15f53f6d97 | |||
| 40d78f97e6 | |||
| cbe9446e50 | |||
| 890e7beb26 | |||
| 72926fd4ee | |||
| 0d62f4706a | |||
| da20193852 | |||
| cdc07b5d4e | |||
| df0d018b40 | |||
| d02e5ecdc5 | |||
| 7ee96336d7 | |||
| 89ce14bfee | |||
| b5b6e9997d | |||
| 9ea12cf091 | |||
| 5d6ca51ea8 | |||
| 2d0a80bcbb | |||
| a2eea79ea8 | |||
| fe52062f04 | |||
| 6c4f5c78d0 | |||
| d7a65ae09f | |||
| e97a630235 | |||
| f66f15ce90 | |||
| 7b6b9a6e22 | |||
| 4d471306f4 | |||
| e3dbc609d1 | |||
| 67bb18921b | |||
| 83c75f9291 | |||
| fce606ed94 | |||
| 24a9663db4 | |||
| b7dba5f72b | |||
| 60d245e968 | |||
| 689324ad24 | |||
| 5a2d655c4a | |||
| a6b258c953 | |||
| 765df72a6e | |||
| 2b5b1b2a40 | |||
| 55b3776f42 | |||
| f36217fb92 | |||
| 6881dae3bc | |||
| 02c7630bbb | |||
| d80207d69e | |||
| 09a999c8a1 | |||
| e3dd66ddb4 | |||
| f36ffece70 | |||
| d6d74ef77f | |||
| 279c944628 | |||
| ff624c35e3 | |||
| a6deca4da8 | |||
| 14d5685528 | |||
| cb13201fd5 | |||
| e56b50474a | |||
| 83b94092b6 | |||
| fe8318d336 | |||
| 898c009f50 | |||
| b8bdc638bf | |||
| 3537b47ba8 | |||
| 9bde5a6482 | |||
| f8b7583de5 | |||
| d484fbd93c | |||
| 214e5cc6e3 | |||
| a6c123d4e4 | |||
| 363a438fc6 | |||
| 2c4975c5b5 | |||
| f8d96846d5 | |||
| a57fd395fe | |||
| 9feea24516 | |||
| 41f2b5ec8d | |||
| a8e9046c6c | |||
| 67b1db7123 | |||
| 2a59f5ce00 | |||
| 14cf2d9532 | |||
| c10d526385 | |||
| 32efce9f86 | |||
| 533d885923 | |||
| 9903dd5ad9 | |||
| ad5a85ed51 | |||
| f25e5a1012 | |||
| acb7148ac4 | |||
| 585c87a8c6 | |||
| 9d651f85f1 | |||
| ddef0a729d | |||
| 7a0b449ac3 | |||
| f8bcc9966d | |||
| f300ddcada | |||
| c28013930e | |||
| 45b820abe2 | |||
| 034177f0c0 | |||
| 5edbac54d3 | |||
| 09bf5ca5a0 | |||
| 814f9ebc5b | |||
| 6680975105 | |||
| dfdbcd8325 | |||
| 2820371a00 | |||
| 5f1d1869e3 | |||
| a60a4405c8 | |||
| 24d596ee53 | |||
| 0c37fcebe8 | |||
| 1ca7408701 | |||
| eceaf3bfb4 | |||
| 68f8d44e0d | |||
| ab5f27c5af | |||
| f7d074d64c | |||
| 6ad9366be0 | |||
| 32cea2e656 | |||
| 17cf16dd19 | |||
| f533541b67 | |||
| f4ccffc754 | |||
| 6a51e74319 | |||
| eb99d460a3 | |||
| 25a92406ce | |||
| e2f76ff8e3 | |||
| a7cfb276a6 | |||
| a26ea8134c | |||
| 892cf8be29 | |||
| 4880bc49e1 | |||
| 068eb252c5 | |||
| e784171e11 | |||
| 98db29d939 | |||
| 6fddeb89bc | |||
| e51810cb65 | |||
| 27ae0785c1 | |||
| 1dabea71da | |||
| e6fe79daca | |||
| dd54429ff6 | |||
| 47c9866131 | |||
| c39e8b142e | |||
| 1b54306b2f | |||
| 1a193d24ef | |||
| d27bdd02ef | |||
| 9474623ff0 | |||
| caf2439116 | |||
| 4ad507b4e9 | |||
| 9e61e71cb1 | |||
| 1176351701 | |||
| ed835a4973 | |||
| 641c7a6d57 | |||
| 8bfbdc8cf5 | |||
| eae27b0baa | |||
| 6281f981fa | |||
| ee08bfb6aa | |||
| 6a07109e10 | |||
| 28d18a4f70 | |||
| 14e81fca0e | |||
| 6d0cb74b64 | |||
| 29b40bc75f | |||
| d78bf5a93c | |||
| f37b21bf6c | |||
| 7309784487 | |||
| 55426fb047 | |||
| a1172b6211 | |||
| 271a865d01 | |||
| 5050dd13f4 | |||
| 5ce81bf386 | |||
| 40fd3e9ae2 | |||
| d8bffe12d7 | |||
| 7566aa2824 | |||
| c97ede5c34 | |||
| a2416f0b3f | |||
| 89eefbdc6a | |||
| 44f64a852b | |||
| 11ecb09eab | |||
| e6f686533f | |||
| c8dd7d95de | |||
| 81a7af5704 | |||
| e0dd754995 | |||
| 178e024721 | |||
| 99877adb39 | |||
| 5d8779fac2 | |||
| 34e07ef245 | |||
| c2f006f37a | |||
| f19506c3ce | |||
| 313a40875a | |||
| c49acaddf4 | |||
| e2487270e5 | |||
| 2a29b56b12 | |||
| 746c533c3c | |||
| 3ddd2445e5 | |||
| a682132503 | |||
| 00bee0fa54 | |||
| 4d25d2ffcc | |||
| 1db4a96c2c | |||
| 8fef15cd56 | |||
| 64396d15c8 | |||
| 5d209f798a | |||
| 811006ed8f | |||
| 555e9ed5fe | |||
| 49eb11e135 | |||
| a40cc0d9fc | |||
| 23078fe9c4 | |||
| 254c6dc993 | |||
| 66d0b809da | |||
| d0223dc1a0 | |||
| 876b58cebc | |||
| a21c2b4144 | |||
| b38bde7e12 | |||
| 5cce143273 | |||
| 75b97c9e0d | |||
| 91d3e9d924 | |||
| b6819aa8dd | |||
| 60cb12c062 | |||
| 8ea57a4b36 | |||
| dd96425a72 | |||
| 1bdcac1aac | |||
| 70443d06a2 | |||
| e23512d815 | |||
| 8db20a6589 | |||
| e7787b18d3 | |||
| 7f7bbbcfb4 | |||
| 6a966bdb61 | |||
| 702ac16d12 | |||
| 8c9150c223 | |||
| af4e13e528 | |||
| 8951032d07 | |||
| a5a64daf75 | |||
| b3e7510d31 | |||
| 4bc6b69a96 | |||
| 00b0d03dee | |||
| 1c24f3b14a | |||
| 65383f28a2 | |||
| ef1c63169e | |||
| 7cf1f011ef | |||
| 4aeeaed4c7 | |||
| ebe2f2b950 | |||
| 9998946886 | |||
| 0b16a37675 | |||
| f860b5a058 | |||
| 4f982ee3d1 | |||
| 5f4acdee0e | |||
| e640cc187b | |||
| d52fa9bcfc | |||
| 3029f0dd16 | |||
| 9f69d80b12 | |||
| 573e154c18 | |||
| ad49eea20d | |||
| 1dfb8ee3ce | |||
| bca57a4330 | |||
| ea483333f4 | |||
| 9f2d83c148 | |||
| 4a59e203cb | |||
| 697137585e | |||
| 8031ec9d89 | |||
| 54310ba2bc | |||
| 60a894bded | |||
| f40cbb06d6 | |||
| 01576229fe | |||
| 6ad505b6e4 | |||
| 9c79b55078 | |||
| aac231c39a | |||
| 6b577e1516 | |||
| 79b4503d01 | |||
| 1673a59a65 | |||
| ae395070d9 | |||
| eced38791a | |||
| 7d3c3cc1e3 | |||
| a26fdf3b54 | |||
| b162585beb | |||
| 77fb880f2d | |||
| 46222d488e | |||
| c0abe47d87 | |||
| d6321ab2a1 | |||
| ca1cc1c76e | |||
| 92593c3ea9 | |||
| 4b2a89683a | |||
| a830db6d86 | |||
| 7fb62aedc7 | |||
| c7fa954449 | |||
| a002e04838 | |||
| fe38bab63e | |||
| 86e0c29c25 | |||
| e554792ea5 | |||
| a82f60e302 | |||
| 072a7ac84a | |||
| 8dcfd7be61 | |||
| a401afe52e | |||
| f2ccc83a29 | |||
| b0ccf97226 | |||
| 77cccbc405 | |||
| 6370db0587 | |||
| b5c71915c7 | |||
| c96777369d | |||
| 9d663c5819 | |||
| 218eaf92ec | |||
| bbc31e07e9 | |||
| db889737be | |||
| d16ddf42cb | |||
| fa0f0bfad9 | |||
| 23e28fdd93 | |||
| cb62a3b039 | |||
| 0cb15dba0a | |||
| 48112f1a50 | |||
| b99290a060 | |||
| ce013119b9 | |||
| 851643110f | |||
| 45d9f292f9 | |||
| b3723ae020 | |||
| 498bb81c0a | |||
| cfbc1d6b70 | |||
| 7355272818 | |||
| 3c49b63a6b | |||
| db7b0a2272 | |||
| 42e99ac2eb | |||
| 6f86b4ec95 | |||
| 574b492479 | |||
| c9cf188e08 | |||
| b459a204a4 | |||
| a8ca4dbc3a | |||
| 21c4e4940b | |||
| ee6e44669f | |||
| b84cab3fc0 | |||
| a9edcb5f10 | |||
| ee207e2249 | |||
| 28f06953fc | |||
| 90e3024517 | |||
| 6222a3a8f7 | |||
| 14482a174b | |||
| a2395a0417 | |||
| fb2fc2f43f | |||
| dccd6a0499 | |||
| 01ffe94974 | |||
| 67f51b6e69 | |||
| 105eec0693 | |||
| ea4dd30143 | |||
| abfa841a98 | |||
| 1003c372bf | |||
| ff99823130 | |||
| fe431f1e8e | |||
| 2ee49802a9 | |||
| 2ab46f7fa3 | |||
| 77e721f7ce | |||
| d4d1491a81 | |||
| b2b86d2e04 | |||
| 3f3e7fd9f5 | |||
| deec9e9ac8 | |||
| 5634eaaf7a | |||
| 05f8a7bfb7 | |||
| c1aa4fc1d0 | |||
| 51570c73e1 | |||
| 6afafe1114 | |||
| c431a1e701 | |||
| 177103021e | |||
| 5dd4e8ff47 | |||
| 8b36b16b03 | |||
| b04ea483a8 | |||
| 55bb147862 | |||
| f2ba32a950 | |||
| 35c893e84f | |||
| cca9777064 | |||
| 2f386b6be2 | |||
| 6d19312f51 | |||
| a16b8a5474 | |||
| 27b72c4c89 | |||
| dbdce87679 | |||
| 2fd37df46a | |||
| 32a55c5c6e | |||
| 481a3f1ba1 | |||
| 74f6c56d27 | |||
| bcaf8c7e70 | |||
| d1f4eecc3a | |||
| 7f5fef431a | |||
| f6a0f2743e | |||
| 9b49ee6208 | |||
| 198e472ba3 | |||
| 4226ac02dc | |||
| 4606630f5a | |||
| 5d8d561565 | |||
| 6a6ac8b47b | |||
| 6417d7f882 | |||
| 93ee368556 | |||
| d89171768b | |||
| b73037a282 | |||
| 1888ac386f | |||
| 535958a274 | |||
| 35e1f2abed | |||
| 6e5cfde4b1 | |||
| 52828730cb | |||
| e3eae253df | |||
| 104123aa88 | |||
| 71224984bb | |||
| 181f4ab54c | |||
| 5d1f303a16 | |||
| 6a48348831 | |||
| 33be36f175 | |||
| 1a63b68990 | |||
| 1e3963b75d | |||
| ca290eeb97 | |||
| dbe7934931 | |||
| ca12278e90 | |||
| db0e93fa8e | |||
| c8a041fbeb | |||
| 273d14d8a0 | |||
| 024592281f | |||
| 5dbcca1543 | |||
| b57b079c9b |
+45
-30
@@ -1,30 +1,45 @@
|
||||
common/netlist_keywords.*
|
||||
common/netlist_lexer.h
|
||||
include/netlist_lexer.h
|
||||
eeschema/cmp_library_lexer.h
|
||||
eeschema/cmp_library_keywords.*
|
||||
eeschema/template_fieldnames_keywords.*
|
||||
eeschema/template_fieldnames_lexer.h
|
||||
pcbnew/dialogs/dialog_freeroute_exchange_help_html.h
|
||||
Makefile
|
||||
CMakeFiles
|
||||
CMakeCache.txt
|
||||
auto_renamed_to_cpp
|
||||
Testing
|
||||
version.h
|
||||
config.h
|
||||
install_manifest.txt
|
||||
Documentation/doxygen
|
||||
*.cmake
|
||||
*.bak
|
||||
pcbnew/pcb_plot_params_keywords.cpp
|
||||
pcbnew/pcb_plot_params_lexer.h
|
||||
pcbnew/specctra_keywords.cpp
|
||||
pcbnew/specctra_lexer.h
|
||||
new/html
|
||||
new/sch_lib_table_keywords.cpp
|
||||
new/sch_lib_table_lexer.h
|
||||
new/sweet_keywords.cpp
|
||||
new/sweet_lexer.h
|
||||
bitmaps_png/png*
|
||||
bitmaps_png/tmp
|
||||
boost_root
|
||||
.downloads-by-cmake
|
||||
common/netlist_keywords.*
|
||||
common/netlist_lexer.h
|
||||
common/pcb_plot_params_lexer.h
|
||||
common/page_layout/page_layout_reader_keywords.cpp
|
||||
common/fp_lib_table_keywords.*
|
||||
common/gal/opengl/shader_src.h
|
||||
include/fp_lib_table_lexer.h
|
||||
include/netlist_lexer.h
|
||||
include/page_layout_reader_lexer.h
|
||||
eeschema/cmp_library_lexer.h
|
||||
eeschema/cmp_library_keywords.*
|
||||
eeschema/dialogs/dialog_bom_cfg_keywords.cpp
|
||||
eeschema/dialogs/dialog_bom_cfg_lexer.h
|
||||
eeschema/dialogs/dialog_bom_help_html.h
|
||||
eeschema/template_fieldnames_keywords.*
|
||||
eeschema/template_fieldnames_lexer.h
|
||||
pcbnew/dialogs/dialog_freeroute_exchange_help_html.h
|
||||
pcbnew/pcb_plot_params_keywords.cpp
|
||||
pcbnew/pcb_plot_params_lexer.h
|
||||
Makefile
|
||||
CMakeCache.txt
|
||||
auto_renamed_to_cpp
|
||||
Testing
|
||||
version.h
|
||||
config.h
|
||||
install_manifest.txt
|
||||
Documentation/doxygen
|
||||
*.bak
|
||||
common/pcb_plot_params_keywords.cpp
|
||||
include/pcb_plot_params_lexer.h
|
||||
pcbnew/specctra_keywords.cpp
|
||||
pcbnew/specctra_lexer.h
|
||||
pcb_calculator/pcb_calculator_datafile_keywords.cpp
|
||||
pcb_calculator/pcb_calculator_datafile_lexer.h
|
||||
new/html
|
||||
new/sch_lib_table_keywords.cpp
|
||||
new/sch_lib_table_lexer.h
|
||||
new/sweet_keywords.cpp
|
||||
new/sweet_lexer.h
|
||||
bitmaps_png/png*
|
||||
bitmaps_png/tmp
|
||||
common/pcb_keywords.cpp
|
||||
include/pcb_lexer.h
|
||||
|
||||
+110
-148
@@ -1,68 +1,101 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: 3d_aux.cpp
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2012 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 "fctsys.h"
|
||||
/**
|
||||
* @file 3d_aux.cpp
|
||||
*/
|
||||
|
||||
#if !wxUSE_GLCANVAS
|
||||
#error Please set wxUSE_GLCANVAS to 1 in setup.h.
|
||||
#endif
|
||||
#include <fctsys.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "trigo.h"
|
||||
#include <common.h>
|
||||
#include <trigo.h>
|
||||
#include <wxBasePcbFrame.h>
|
||||
|
||||
#include "3d_viewer.h"
|
||||
#include "trackball.h"
|
||||
#include <class_board_design_settings.h>
|
||||
#include <class_zone.h>
|
||||
#include <class_text_mod.h>
|
||||
#include <class_module.h>
|
||||
#include <class_drawsegment.h>
|
||||
#include <class_pcb_text.h>
|
||||
|
||||
#include <3d_viewer.h>
|
||||
#include <3d_canvas.h>
|
||||
#include <info3d_visu.h>
|
||||
#include <trackball.h>
|
||||
|
||||
// Exported function:
|
||||
void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );
|
||||
|
||||
|
||||
void S3D_MASTER::Set_Object_Coords( S3D_Vertex* coord, int nbcoord )
|
||||
void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices )
|
||||
{
|
||||
int ii;
|
||||
|
||||
unsigned ii;
|
||||
|
||||
/* adjust object scale, rotation and offset position */
|
||||
for( ii = 0; ii < nbcoord; ii++ )
|
||||
for( ii = 0; ii < aVertices.size(); ii++ )
|
||||
{
|
||||
coord[ii].x *= m_MatScale.x;
|
||||
coord[ii].y *= m_MatScale.y;
|
||||
coord[ii].z *= m_MatScale.z;
|
||||
aVertices[ii].x *= m_MatScale.x;
|
||||
aVertices[ii].y *= m_MatScale.y;
|
||||
aVertices[ii].z *= m_MatScale.z;
|
||||
|
||||
/* adjust rotation */
|
||||
// adjust rotation
|
||||
if( m_MatRotation.x )
|
||||
RotatePoint( &coord[ii].y, &coord[ii].z, (int) (m_MatRotation.x * 10) );
|
||||
RotatePoint( &aVertices[ii].y, &aVertices[ii].z, m_MatRotation.x * 10 );
|
||||
|
||||
if( m_MatRotation.y )
|
||||
RotatePoint( &coord[ii].z, &coord[ii].x, (int) (m_MatRotation.y * 10) );
|
||||
RotatePoint( &aVertices[ii].z, &aVertices[ii].x, m_MatRotation.y * 10 );
|
||||
|
||||
if( m_MatRotation.z )
|
||||
RotatePoint( &coord[ii].x, &coord[ii].y, (int) (m_MatRotation.z * 10) );
|
||||
RotatePoint( &aVertices[ii].x, &aVertices[ii].y, m_MatRotation.z * 10 );
|
||||
|
||||
/* adjust offset position (offset is given in UNIT 3D (0.1 inch) */
|
||||
#define SCALE_3D_CONV (PCB_INTERNAL_UNIT / UNITS3D_TO_UNITSPCB)
|
||||
coord[ii].x += m_MatPosition.x * SCALE_3D_CONV;
|
||||
coord[ii].y += m_MatPosition.y * SCALE_3D_CONV;
|
||||
coord[ii].z += m_MatPosition.z * SCALE_3D_CONV;
|
||||
#define SCALE_3D_CONV ((IU_PER_MILS * 1000) / UNITS3D_TO_UNITSPCB)
|
||||
aVertices[ii].x += m_MatPosition.x * SCALE_3D_CONV;
|
||||
aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV;
|
||||
aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Set_Object_Data( const S3D_Vertex* coord, int nbcoord )
|
||||
void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits )
|
||||
{
|
||||
int ii;
|
||||
unsigned ii;
|
||||
GLfloat ax, ay, az, bx, by, bz, nx, ny, nz, r;
|
||||
|
||||
/* ignore faces with less than 3 points */
|
||||
if( nbcoord < 3 )
|
||||
if( aVertices.size() < 3 )
|
||||
return;
|
||||
|
||||
/* calculate normal direction */
|
||||
ax = coord[1].x - coord[0].x;
|
||||
ay = coord[1].y - coord[0].y;
|
||||
az = coord[1].z - coord[0].z;
|
||||
ax = aVertices[1].x - aVertices[0].x;
|
||||
ay = aVertices[1].y - aVertices[0].y;
|
||||
az = aVertices[1].z - aVertices[0].z;
|
||||
|
||||
bx = coord[nbcoord - 1].x - coord[0].x;
|
||||
by = coord[nbcoord - 1].y - coord[0].y;
|
||||
bz = coord[nbcoord - 1].z - coord[0].z;
|
||||
bx = aVertices[aVertices.size() - 1].x - aVertices[0].x;
|
||||
by = aVertices[aVertices.size() - 1].y - aVertices[0].y;
|
||||
bz = aVertices[aVertices.size() - 1].z - aVertices[0].z;
|
||||
|
||||
nx = ay * bz - az * by;
|
||||
ny = az * bx - ax * bz;
|
||||
@@ -72,12 +105,14 @@ void Set_Object_Data( const S3D_Vertex* coord, int nbcoord )
|
||||
|
||||
if( r >= 0.000001 ) /* avoid division by zero */
|
||||
{
|
||||
nx /= r; ny /= r; nz /= r;
|
||||
nx /= r;
|
||||
ny /= r;
|
||||
nz /= r;
|
||||
glNormal3f( nx, ny, nz );
|
||||
}
|
||||
|
||||
/* glBegin/glEnd */
|
||||
switch( nbcoord )
|
||||
switch( aVertices.size() )
|
||||
{
|
||||
case 3:
|
||||
glBegin( GL_TRIANGLES );
|
||||
@@ -93,11 +128,11 @@ void Set_Object_Data( const S3D_Vertex* coord, int nbcoord )
|
||||
}
|
||||
|
||||
/* draw polygon/triangle/quad */
|
||||
for( ii = 0; ii < nbcoord; ii++ )
|
||||
for( ii = 0; ii < aVertices.size(); ii++ )
|
||||
{
|
||||
glVertex3f( coord[ii].x * DataScale3D,
|
||||
coord[ii].y * DataScale3D,
|
||||
coord[ii].z * DataScale3D );
|
||||
glVertex3d( aVertices[ii].x * aBiuTo3DUnits,
|
||||
aVertices[ii].y * aBiuTo3DUnits,
|
||||
aVertices[ii].z * aBiuTo3DUnits );
|
||||
}
|
||||
|
||||
glEnd();
|
||||
@@ -141,123 +176,50 @@ GLuint EDA_3D_CANVAS::DisplayCubeforTest()
|
||||
return gllist;
|
||||
}
|
||||
|
||||
|
||||
/**********************/
|
||||
/* class Info_3D_Visu */
|
||||
/**********************/
|
||||
|
||||
Info_3D_Visu::Info_3D_Visu()
|
||||
VERTEX_VALUE_CTRL::VERTEX_VALUE_CTRL( wxWindow* aParent, wxBoxSizer* aBoxSizer )
|
||||
{
|
||||
int ii;
|
||||
wxString text;
|
||||
|
||||
m_Beginx = m_Beginy = 0.0; /* position of mouse */
|
||||
m_Zoom = 1.0; /* field of view in degrees */
|
||||
trackball( m_Quat, 0.0, 0.0, 0.0, 0.0 );
|
||||
wxFlexGridSizer* gridSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
|
||||
gridSizer->AddGrowableCol( 1 );
|
||||
gridSizer->SetFlexibleDirection( wxHORIZONTAL );
|
||||
gridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
for( ii = 0; ii < 4; ii++ )
|
||||
m_Rot[ii] = 0.0;
|
||||
aBoxSizer->Add( gridSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
m_Layers = 1;
|
||||
m_BoardSettings = NULL;
|
||||
m_Draw3DAxis = true;
|
||||
m_Draw3DModule = true;
|
||||
m_Draw3DZone = true;
|
||||
m_Draw3DComments = true;
|
||||
m_Draw3DDrawings = true;
|
||||
m_Draw3DEco1 = true;
|
||||
m_Draw3DEco2 = true;
|
||||
wxStaticText* msgtitle = new wxStaticText( aParent, wxID_ANY, wxT( "X:" ) );
|
||||
gridSizer->Add( msgtitle, 0, wxALL , 5 );
|
||||
|
||||
m_XValueCtrl = new wxTextCtrl( aParent, wxID_ANY, wxEmptyString,
|
||||
wxDefaultPosition,wxDefaultSize, 0 );
|
||||
gridSizer->Add( m_XValueCtrl, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
msgtitle = new wxStaticText( aParent, wxID_ANY, wxT( "Y:" ), wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
gridSizer->Add( msgtitle, 0, wxALL, 5 );
|
||||
|
||||
m_YValueCtrl = new wxTextCtrl( aParent, wxID_ANY, wxEmptyString,
|
||||
wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gridSizer->Add( m_YValueCtrl, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
msgtitle = new wxStaticText( aParent, wxID_ANY, wxT( "Z:" ), wxDefaultPosition,
|
||||
wxDefaultSize, 0 );
|
||||
gridSizer->Add( msgtitle, 0, wxALL, 5 );
|
||||
|
||||
m_ZValueCtrl = new wxTextCtrl( aParent, wxID_ANY, wxEmptyString,
|
||||
wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gridSizer->Add( m_ZValueCtrl, 0, wxALL|wxEXPAND, 5 );
|
||||
}
|
||||
|
||||
|
||||
Info_3D_Visu::~Info_3D_Visu()
|
||||
VERTEX_VALUE_CTRL::~VERTEX_VALUE_CTRL()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* Display and edit a Vertex (triplet of values) in INCHES or MM or without
|
||||
* units */
|
||||
WinEDA_VertexCtrl::WinEDA_VertexCtrl( wxWindow* parent, const wxString& title,
|
||||
wxBoxSizer* BoxSizer,
|
||||
EDA_UNITS_T units, int internal_unit )
|
||||
S3D_VERTEX VERTEX_VALUE_CTRL::GetValue()
|
||||
{
|
||||
wxString text;
|
||||
wxStaticText* msgtitle;
|
||||
|
||||
m_Units = units;
|
||||
m_Internal_Unit = internal_unit;
|
||||
|
||||
if( title.IsEmpty() )
|
||||
text = _( "Vertex " );
|
||||
else
|
||||
text = title;
|
||||
|
||||
text += ReturnUnitSymbol( units );
|
||||
|
||||
msgtitle = new wxStaticText( parent, -1, text, wxDefaultPosition, wxSize( -1, -1 ), 0 );
|
||||
|
||||
BoxSizer->Add( msgtitle, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxBOTTOM | wxADJUST_MINSIZE );
|
||||
|
||||
wxFlexGridSizer* GridSizer = new wxFlexGridSizer( 3, 2, 0, 0 );
|
||||
|
||||
BoxSizer->Add( GridSizer, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
msgtitle = new wxStaticText( parent, -1, wxT( "X:" ) );
|
||||
|
||||
GridSizer->Add( msgtitle, 0,
|
||||
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
|
||||
wxLEFT | wxRIGHT | wxADJUST_MINSIZE,
|
||||
5 );
|
||||
m_XValueCtrl = new wxTextCtrl( parent, -1, wxEmptyString,
|
||||
wxDefaultPosition, wxSize( -1, -1 ), 0 );
|
||||
|
||||
GridSizer->Add( m_XValueCtrl,
|
||||
0,
|
||||
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
|
||||
wxLEFT | wxRIGHT,
|
||||
5 );
|
||||
|
||||
msgtitle = new wxStaticText( parent, -1, wxT( "Y:" ), wxDefaultPosition,
|
||||
wxSize( -1, -1 ), 0 );
|
||||
|
||||
GridSizer->Add( msgtitle,
|
||||
0,
|
||||
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
|
||||
wxLEFT | wxRIGHT | wxADJUST_MINSIZE,
|
||||
5 );
|
||||
m_YValueCtrl = new wxTextCtrl( parent, -1, wxEmptyString,
|
||||
wxDefaultPosition, wxSize( -1, -1 ), 0 );
|
||||
|
||||
GridSizer->Add( m_YValueCtrl, 0,
|
||||
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
|
||||
wxLEFT | wxRIGHT,
|
||||
5 );
|
||||
|
||||
msgtitle = new wxStaticText( parent, -1, wxT( "Z:" ), wxDefaultPosition,
|
||||
wxSize( -1, -1 ), 0 );
|
||||
|
||||
GridSizer->Add( msgtitle, 0,
|
||||
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
|
||||
wxLEFT | wxRIGHT | wxADJUST_MINSIZE,
|
||||
5 );
|
||||
m_ZValueCtrl = new wxTextCtrl( parent, -1, wxEmptyString,
|
||||
wxDefaultPosition, wxSize( -1, -1 ), 0 );
|
||||
|
||||
GridSizer->Add( m_ZValueCtrl, 0,
|
||||
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
|
||||
wxLEFT | wxRIGHT,
|
||||
5 );
|
||||
}
|
||||
|
||||
|
||||
WinEDA_VertexCtrl::~WinEDA_VertexCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* Returns (in internal units) to coordinate between (in user units) */
|
||||
S3D_Vertex WinEDA_VertexCtrl::GetValue()
|
||||
{
|
||||
S3D_Vertex value;
|
||||
S3D_VERTEX value;
|
||||
double dtmp;
|
||||
|
||||
m_XValueCtrl->GetValue().ToDouble( &dtmp );
|
||||
@@ -270,7 +232,7 @@ S3D_Vertex WinEDA_VertexCtrl::GetValue()
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_VertexCtrl::SetValue( S3D_Vertex vertex )
|
||||
void VERTEX_VALUE_CTRL::SetValue( S3D_VERTEX vertex )
|
||||
{
|
||||
wxString text;
|
||||
|
||||
@@ -288,7 +250,7 @@ void WinEDA_VertexCtrl::SetValue( S3D_Vertex vertex )
|
||||
}
|
||||
|
||||
|
||||
void WinEDA_VertexCtrl::Enable( bool onoff )
|
||||
void VERTEX_VALUE_CTRL::Enable( bool onoff )
|
||||
{
|
||||
m_XValueCtrl->Enable( onoff );
|
||||
m_YValueCtrl->Enable( onoff );
|
||||
|
||||
+55
-77
@@ -1,23 +1,26 @@
|
||||
/**
|
||||
* @file 3d_canvas.cpp
|
||||
*/
|
||||
#include "fctsys.h"
|
||||
#include "trigo.h"
|
||||
#include <fctsys.h>
|
||||
#include <trigo.h>
|
||||
|
||||
#include "wx/image.h"
|
||||
#include <wx/image.h>
|
||||
|
||||
#if !wxUSE_GLCANVAS
|
||||
#error Please set wxUSE_GLCANVAS to 1 in setup.h.
|
||||
#endif
|
||||
|
||||
#include "wx/dataobj.h"
|
||||
#include "wx/clipbrd.h"
|
||||
#include <wx/dataobj.h>
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/wupdlock.h>
|
||||
|
||||
#include "gestfich.h"
|
||||
#include <gestfich.h>
|
||||
|
||||
#include "3d_viewer.h"
|
||||
#include "trackball.h"
|
||||
#include <3d_viewer.h>
|
||||
#include <3d_canvas.h>
|
||||
#include <info3d_visu.h>
|
||||
#include <trackball.h>
|
||||
#include <3d_viewer_id.h>
|
||||
|
||||
|
||||
// -----------------
|
||||
@@ -71,24 +74,13 @@ END_EVENT_TABLE()
|
||||
|
||||
|
||||
EDA_3D_CANVAS::EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList ) :
|
||||
#if wxCHECK_VERSION( 2, 7, 0 )
|
||||
wxGLCanvas( parent, -1, attribList, wxDefaultPosition, wxDefaultSize,
|
||||
wxGLCanvas( parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize,
|
||||
wxFULL_REPAINT_ON_RESIZE )
|
||||
#else
|
||||
wxGLCanvas( parent, -1, wxDefaultPosition, wxDefaultSize,
|
||||
wxFULL_REPAINT_ON_RESIZE )
|
||||
#endif
|
||||
{
|
||||
m_init = false;
|
||||
m_gllist = 0;
|
||||
m_Parent = parent;
|
||||
m_ortho = false;
|
||||
|
||||
#if wxCHECK_VERSION( 2, 7, 0 )
|
||||
|
||||
// Explicitly create a new rendering context instance for this canvas.
|
||||
m_glRC = new wxGLContext( this );
|
||||
#endif
|
||||
|
||||
DisplayStatus();
|
||||
}
|
||||
@@ -98,10 +90,7 @@ EDA_3D_CANVAS::~EDA_3D_CANVAS()
|
||||
{
|
||||
ClearLists();
|
||||
m_init = false;
|
||||
|
||||
#if wxCHECK_VERSION( 2, 7, 0 )
|
||||
delete m_glRC;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -129,24 +118,24 @@ void EDA_3D_CANVAS::SetView3D( int keycode )
|
||||
switch( keycode )
|
||||
{
|
||||
case WXK_LEFT:
|
||||
g_Draw3d_dx -= delta_move;
|
||||
m_draw3dOffset.x -= delta_move;
|
||||
break;
|
||||
|
||||
case WXK_RIGHT:
|
||||
g_Draw3d_dx += delta_move;
|
||||
m_draw3dOffset.x += delta_move;
|
||||
break;
|
||||
|
||||
case WXK_UP:
|
||||
g_Draw3d_dy += delta_move;
|
||||
m_draw3dOffset.y += delta_move;
|
||||
break;
|
||||
|
||||
case WXK_DOWN:
|
||||
g_Draw3d_dy -= delta_move;
|
||||
m_draw3dOffset.y -= delta_move;
|
||||
break;
|
||||
|
||||
case WXK_HOME:
|
||||
g_Parm_3D_Visu.m_Zoom = 1.0;
|
||||
g_Draw3d_dx = g_Draw3d_dy = 0;
|
||||
m_draw3dOffset.x = m_draw3dOffset.y = 0;
|
||||
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
|
||||
break;
|
||||
|
||||
@@ -171,7 +160,7 @@ void EDA_3D_CANVAS::SetView3D( int keycode )
|
||||
|
||||
case 'r':
|
||||
case 'R':
|
||||
g_Draw3d_dx = g_Draw3d_dy = 0;
|
||||
m_draw3dOffset.x = m_draw3dOffset.y = 0;
|
||||
for( ii = 0; ii < 4; ii++ )
|
||||
g_Parm_3D_Visu.m_Rot[ii] = 0.0;
|
||||
|
||||
@@ -239,8 +228,6 @@ void EDA_3D_CANVAS::SetView3D( int keycode )
|
||||
|
||||
void EDA_3D_CANVAS::OnMouseWheel( wxMouseEvent& event )
|
||||
{
|
||||
wxSize size( GetClientSize() );
|
||||
|
||||
if( event.ShiftDown() )
|
||||
{
|
||||
if( event.GetWheelRotation() < 0 )
|
||||
@@ -313,9 +300,9 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event )
|
||||
/* Current zoom and an additional factor are taken into account
|
||||
* for the amount of panning. */
|
||||
const double PAN_FACTOR = 8.0 * g_Parm_3D_Visu.m_Zoom;
|
||||
g_Draw3d_dx -= PAN_FACTOR *
|
||||
m_draw3dOffset.x -= PAN_FACTOR *
|
||||
( g_Parm_3D_Visu.m_Beginx - event.GetX() ) / size.x;
|
||||
g_Draw3d_dy -= PAN_FACTOR *
|
||||
m_draw3dOffset.y -= PAN_FACTOR *
|
||||
(event.GetY() - g_Parm_3D_Visu.m_Beginy) / size.y;
|
||||
}
|
||||
|
||||
@@ -336,69 +323,58 @@ void EDA_3D_CANVAS::OnRightClick( wxMouseEvent& event )
|
||||
wxPoint pos;
|
||||
wxMenu PopUpMenu;
|
||||
|
||||
pos.x = event.GetX(); pos.y = event.GetY();
|
||||
wxMenuItem* item = new wxMenuItem( &PopUpMenu, ID_POPUP_ZOOMIN,
|
||||
_( "Zoom +" ) );
|
||||
pos.x = event.GetX();
|
||||
pos.y = event.GetY();
|
||||
|
||||
wxMenuItem* item = new wxMenuItem( &PopUpMenu, ID_POPUP_ZOOMIN, _( "Zoom +" ) );
|
||||
item->SetBitmap( KiBitmap( zoom_in_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_ZOOMOUT,
|
||||
_( "Zoom -" ) );
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_ZOOMOUT, _( "Zoom -" ) );
|
||||
item->SetBitmap( KiBitmap( zoom_out_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
PopUpMenu.AppendSeparator();
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_ZPOS,
|
||||
_( "Top View" ) );
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_ZPOS, _( "Top View" ) );
|
||||
item->SetBitmap( KiBitmap( axis3d_top_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_ZNEG,
|
||||
_( "Bottom View" ) );
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_ZNEG, _( "Bottom View" ) );
|
||||
item->SetBitmap( KiBitmap( axis3d_bottom_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
PopUpMenu.AppendSeparator();
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_XPOS,
|
||||
_( "Right View" ) );
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_XPOS, _( "Right View" ) );
|
||||
item->SetBitmap( KiBitmap( axis3d_right_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_XNEG,
|
||||
_( "Left View" ) );
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_XNEG, _( "Left View" ) );
|
||||
item->SetBitmap( KiBitmap( axis3d_left_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
|
||||
PopUpMenu.AppendSeparator();
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_YPOS,
|
||||
_( "Front View" ) );
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_YPOS, _( "Front View" ) );
|
||||
item->SetBitmap( KiBitmap( axis3d_front_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_YNEG,
|
||||
_( "Back View" ) );
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_YNEG, _( "Back View" ) );
|
||||
item->SetBitmap( KiBitmap( axis3d_back_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
PopUpMenu.AppendSeparator();
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_LEFT,
|
||||
_( "Move left <-" ) );
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_LEFT, _( "Move left <-" ) );
|
||||
item->SetBitmap( KiBitmap( left_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_RIGHT,
|
||||
_( "Move right ->" ) );
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_RIGHT, _( "Move right ->" ) );
|
||||
item->SetBitmap( KiBitmap( right_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_UP,
|
||||
_( "Move Up ^" ) );
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_UP, _( "Move Up ^" ) );
|
||||
item->SetBitmap( KiBitmap( up_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_DOWN,
|
||||
_( "Move Down" ) );
|
||||
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_DOWN, _( "Move Down" ) );
|
||||
item->SetBitmap( KiBitmap( down_xpm ));
|
||||
PopUpMenu.Append( item );
|
||||
|
||||
@@ -472,14 +448,14 @@ void EDA_3D_CANVAS::DisplayStatus()
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( wxT( "dx %3.2f" ), g_Draw3d_dx );
|
||||
m_Parent->SetStatusText( msg, 1 );
|
||||
msg.Printf( wxT( "dx %3.2f" ), m_draw3dOffset.x );
|
||||
Parent()->SetStatusText( msg, 1 );
|
||||
|
||||
msg.Printf( wxT( "dy %3.2f" ), g_Draw3d_dy );
|
||||
m_Parent->SetStatusText( msg, 2 );
|
||||
msg.Printf( wxT( "dy %3.2f" ), m_draw3dOffset.y );
|
||||
Parent()->SetStatusText( msg, 2 );
|
||||
|
||||
msg.Printf( wxT( "View: %3.1f" ), 45 * g_Parm_3D_Visu.m_Zoom );
|
||||
m_Parent->SetStatusText( msg, 3 );
|
||||
Parent()->SetStatusText( msg, 3 );
|
||||
}
|
||||
|
||||
|
||||
@@ -507,26 +483,28 @@ void EDA_3D_CANVAS::InitGL()
|
||||
{
|
||||
m_init = true;
|
||||
g_Parm_3D_Visu.m_Zoom = 1.0;
|
||||
ZBottom = 1.0; ZTop = 10.0;
|
||||
m_ZBottom = 1.0;
|
||||
m_ZTop = 10.0;
|
||||
|
||||
glDisable( GL_CULL_FACE ); // show back faces
|
||||
|
||||
glEnable( GL_DEPTH_TEST ); // Enable z-buferring
|
||||
|
||||
glEnable( GL_ALPHA_TEST );
|
||||
glEnable( GL_LINE_SMOOTH );
|
||||
// glEnable(GL_POLYGON_SMOOTH); // creates issues with some graphic cards
|
||||
glShadeModel( GL_SMOOTH );
|
||||
glEnable( GL_COLOR_MATERIAL );
|
||||
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
|
||||
|
||||
/* speedups */
|
||||
// speedups
|
||||
glEnable( GL_DITHER );
|
||||
glShadeModel( GL_SMOOTH );
|
||||
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST );
|
||||
glHint( GL_POLYGON_SMOOTH_HINT, GL_FASTEST );
|
||||
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_DONT_CARE );
|
||||
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
|
||||
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
|
||||
|
||||
/* blend */
|
||||
// Initialize alpha blending function.
|
||||
glEnable( GL_BLEND );
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||
}
|
||||
}
|
||||
|
||||
// set viewing projection
|
||||
|
||||
@@ -537,7 +515,7 @@ void EDA_3D_CANVAS::InitGL()
|
||||
if( g_Parm_3D_Visu.m_Zoom > MAX_VIEW_ANGLE )
|
||||
g_Parm_3D_Visu.m_Zoom = MAX_VIEW_ANGLE;
|
||||
|
||||
if( ModeIsOrtho() )
|
||||
if( Parent()->ModeIsOrtho() )
|
||||
{
|
||||
// OrthoReductionFactor is chosen so as to provide roughly the same size as
|
||||
// Perspective View
|
||||
@@ -560,7 +538,7 @@ void EDA_3D_CANVAS::InitGL()
|
||||
// position viewer
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
glTranslatef( 0.0F, 0.0F, -( ZBottom + ZTop) / 2 );
|
||||
glTranslatef( 0.0F, 0.0F, -( m_ZBottom + m_ZTop) / 2 );
|
||||
|
||||
// clear color and depth buffers
|
||||
glClearColor( g_Parm_3D_Visu.m_BgColor.m_Red,
|
||||
@@ -606,7 +584,7 @@ void EDA_3D_CANVAS::SetLights()
|
||||
*/
|
||||
void EDA_3D_CANVAS::TakeScreenshot( wxCommandEvent& event )
|
||||
{
|
||||
wxFileName fn( m_Parent->m_Parent->GetScreen()->GetFileName() );
|
||||
wxFileName fn( Parent()->GetDefaultFileName() );
|
||||
wxString FullFileName;
|
||||
wxString file_ext, mask;
|
||||
bool fmt_is_jpeg = false;
|
||||
@@ -618,7 +596,7 @@ void EDA_3D_CANVAS::TakeScreenshot( wxCommandEvent& event )
|
||||
{
|
||||
file_ext = fmt_is_jpeg ? wxT( "jpg" ) : wxT( "png" );
|
||||
mask = wxT( "*." ) + file_ext;
|
||||
FullFileName = m_Parent->m_Parent->GetScreen()->GetFileName();
|
||||
FullFileName = Parent()->GetDefaultFileName();
|
||||
fn.SetExt( file_ext );
|
||||
|
||||
FullFileName = EDA_FileSelector( _( "3D Image filename:" ), wxEmptyString,
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2012 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file 3d_viewer.h
|
||||
*/
|
||||
|
||||
#ifndef _3D_CANVAS_H_
|
||||
#define _3D_CANVAS_H_
|
||||
|
||||
#include <wx/glcanvas.h>
|
||||
|
||||
#ifdef __WXMAC__
|
||||
# ifdef __DARWIN__
|
||||
# include <OpenGL/glu.h>
|
||||
# else
|
||||
# include <glu.h>
|
||||
# endif
|
||||
#else
|
||||
# include <GL/glu.h>
|
||||
#endif
|
||||
|
||||
#include <3d_struct.h>
|
||||
|
||||
class BOARD_DESIGN_SETTINGS;
|
||||
class EDA_3D_FRAME;
|
||||
class S3D_VERTEX;
|
||||
class SEGVIA;
|
||||
class D_PAD;
|
||||
|
||||
|
||||
class EDA_3D_CANVAS : public wxGLCanvas
|
||||
{
|
||||
private:
|
||||
bool m_init;
|
||||
GLuint m_gllist;
|
||||
wxGLContext* m_glRC;
|
||||
wxRealPoint m_draw3dOffset; // offset to draw the 3 mesh.
|
||||
double m_ZBottom; // position of the back layer
|
||||
double m_ZTop; // position of the front layer
|
||||
|
||||
public:
|
||||
EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList = 0 );
|
||||
~EDA_3D_CANVAS();
|
||||
|
||||
EDA_3D_FRAME* Parent() { return (EDA_3D_FRAME*)GetParent(); }
|
||||
|
||||
void ClearLists();
|
||||
|
||||
// Event functions:
|
||||
void OnPaint( wxPaintEvent& event );
|
||||
void OnEraseBackground( wxEraseEvent& event );
|
||||
void OnChar( wxKeyEvent& event );
|
||||
void OnMouseWheel( wxMouseEvent& event );
|
||||
void OnMouseMove( wxMouseEvent& event );
|
||||
void OnRightClick( wxMouseEvent& event );
|
||||
void OnPopUpMenu( wxCommandEvent& event );
|
||||
void TakeScreenshot( wxCommandEvent& event );
|
||||
void OnEnterWindow( wxMouseEvent& event );
|
||||
|
||||
// Display functions
|
||||
GLuint DisplayCubeforTest(); // Just a test function
|
||||
void SetView3D( int keycode );
|
||||
void DisplayStatus();
|
||||
void Redraw( bool finish = false );
|
||||
void Render();
|
||||
|
||||
/**
|
||||
* Function CreateDrawGL_List
|
||||
* Prepares the parameters of the OpenGL draw list
|
||||
* creates the OpenGL draw list items (board, grid ...
|
||||
*/
|
||||
GLuint CreateDrawGL_List();
|
||||
void InitGL();
|
||||
void SetLights();
|
||||
void SetOffset(double aPosX, double aPosY)
|
||||
{
|
||||
m_draw3dOffset.x = aPosX;
|
||||
m_draw3dOffset.y = aPosY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function BuildBoard3DView
|
||||
* Called by CreateDrawGL_List()
|
||||
* Fills the OpenGL draw list with board items draw list.
|
||||
*/
|
||||
void BuildBoard3DView();
|
||||
|
||||
void DrawGrid( double aGriSizeMM );
|
||||
void Draw3DViaHole( SEGVIA * aVia );
|
||||
void Draw3DPadHole( D_PAD * aPad );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif /* _3D_CANVAS_H_ */
|
||||
+71
-14
@@ -1,17 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: 3d_class.cpp
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* @file 3d_class.cpp
|
||||
*/
|
||||
|
||||
#include "fctsys.h"
|
||||
|
||||
#include "3d_viewer.h"
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2012 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
|
||||
*/
|
||||
|
||||
|
||||
S3D_Vertex::S3D_Vertex()
|
||||
{
|
||||
x = y = z = 0.0;
|
||||
}
|
||||
#include <fctsys.h>
|
||||
|
||||
#include <3d_viewer.h>
|
||||
|
||||
S3D_MATERIAL::S3D_MATERIAL( S3D_MASTER* father, const wxString& name ) :
|
||||
EDA_ITEM( father, NOT_USED )
|
||||
@@ -42,7 +59,7 @@ void S3D_MATERIAL::SetMaterial()
|
||||
|
||||
void S3D_MASTER::Copy( S3D_MASTER* pattern )
|
||||
{
|
||||
m_Shape3DName = pattern->m_Shape3DName;
|
||||
SetShape3DName( pattern->GetShape3DName() );
|
||||
m_MatScale = pattern->m_MatScale;
|
||||
m_MatRotation = pattern->m_MatRotation;
|
||||
m_MatPosition = pattern->m_MatPosition;
|
||||
@@ -57,12 +74,13 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) :
|
||||
m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
|
||||
m_3D_Drawings = NULL;
|
||||
m_Materials = NULL;
|
||||
m_ShapeType = FILE3D_NONE;
|
||||
}
|
||||
|
||||
|
||||
S3D_MASTER:: ~S3D_MASTER()
|
||||
{
|
||||
Struct3D_Shape* next;
|
||||
STRUCT_3D_SHAPE* next;
|
||||
S3D_MATERIAL* nextmat;
|
||||
|
||||
for( ; m_3D_Drawings != NULL; m_3D_Drawings = next )
|
||||
@@ -79,7 +97,46 @@ S3D_MASTER:: ~S3D_MASTER()
|
||||
}
|
||||
|
||||
|
||||
Struct3D_Shape::Struct3D_Shape( EDA_ITEM* aParent ) :
|
||||
bool S3D_MASTER::Is3DType( enum FILE3D_TYPE aShapeType )
|
||||
{
|
||||
// type 'none' is not valid and will always return false
|
||||
if( aShapeType == FILE3D_NONE )
|
||||
return false;
|
||||
|
||||
// no one is interested if we have no file
|
||||
if( m_Shape3DName.empty() )
|
||||
return false;
|
||||
|
||||
if( aShapeType == m_ShapeType )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void S3D_MASTER::SetShape3DName( const wxString& aShapeName )
|
||||
{
|
||||
m_ShapeType = FILE3D_NONE;
|
||||
m_Shape3DName = aShapeName;
|
||||
|
||||
if( m_Shape3DName.empty() )
|
||||
return;
|
||||
|
||||
wxFileName fn = m_Shape3DName;
|
||||
wxString ext = fn.GetExt();
|
||||
|
||||
if( ext == wxT( "wrl" ) || ext == wxT( "x3d" ) )
|
||||
m_ShapeType = FILE3D_VRML;
|
||||
else if( ext == wxT( "idf" ) )
|
||||
m_ShapeType = FILE3D_IDF;
|
||||
else
|
||||
m_ShapeType = FILE3D_UNKNOWN;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
STRUCT_3D_SHAPE::STRUCT_3D_SHAPE( EDA_ITEM* aParent ) :
|
||||
EDA_ITEM( aParent, NOT_USED )
|
||||
{
|
||||
m_3D_Coord = NULL;
|
||||
@@ -88,7 +145,7 @@ Struct3D_Shape::Struct3D_Shape( EDA_ITEM* aParent ) :
|
||||
}
|
||||
|
||||
|
||||
Struct3D_Shape:: ~Struct3D_Shape()
|
||||
STRUCT_3D_SHAPE:: ~STRUCT_3D_SHAPE()
|
||||
{
|
||||
delete m_3D_Coord;
|
||||
delete m_3D_CoordIndex;
|
||||
|
||||
+822
-1307
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,419 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2012 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file 3d_draw_basic_functions.cpp
|
||||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <trigo.h>
|
||||
#include <convert_basic_shapes_to_polygon.h>
|
||||
|
||||
#include <3d_viewer.h>
|
||||
#include <info3d_visu.h>
|
||||
#include <3d_draw_basic_functions.h>
|
||||
|
||||
// Imported function:
|
||||
extern void Set_Object_Data( std::vector<S3D_VERTEX>& aVertices, double aBiuTo3DUnits );
|
||||
extern void CheckGLError();
|
||||
|
||||
// Number of segments to approximate a circle by segments
|
||||
#define SEGM_PER_CIRCLE 16
|
||||
|
||||
#ifndef CALLBACK
|
||||
#define CALLBACK
|
||||
#endif
|
||||
|
||||
// CALLBACK functions for GLU_TESS
|
||||
static void CALLBACK tessBeginCB( GLenum which );
|
||||
static void CALLBACK tessEndCB();
|
||||
static void CALLBACK tessErrorCB( GLenum errorCode );
|
||||
static void CALLBACK tessCPolyPt2Vertex( const GLvoid* data );
|
||||
|
||||
// 2 helper functions to set the current normal vector for gle items
|
||||
static inline void SetNormalZpos()
|
||||
{
|
||||
glNormal3f( 0.0, 0.0, 1.0 );
|
||||
}
|
||||
|
||||
static inline void SetNormalZneg()
|
||||
{
|
||||
glNormal3f( 0.0, 0.0, -1.0 );
|
||||
}
|
||||
|
||||
|
||||
/* Draw3D_VerticalPolygonalCylinder is a helper function.
|
||||
*
|
||||
* draws a "vertical cylinder" having a polygon shape
|
||||
* from Z position = aZpos to aZpos + aHeight
|
||||
* Used to create the vertical sides of 3D horizontal shapes with thickness.
|
||||
*/
|
||||
static void Draw3D_VerticalPolygonalCylinder( const CPOLYGONS_LIST& aPolysList,
|
||||
int aHeight, int aZpos,
|
||||
bool aInside, double aBiuTo3DUnits )
|
||||
{
|
||||
if( aHeight == 0 )
|
||||
return;
|
||||
|
||||
std::vector<S3D_VERTEX> coords;
|
||||
coords.resize( 4 );
|
||||
|
||||
// Init Z position of the 4 points of a GL_QUAD
|
||||
if( aInside )
|
||||
{
|
||||
coords[0].z = aZpos;
|
||||
coords[1].z = aZpos + aHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
coords[0].z = aZpos + aHeight;
|
||||
coords[1].z = aZpos;
|
||||
}
|
||||
coords[2].z = coords[1].z;
|
||||
coords[3].z = coords[0].z;
|
||||
|
||||
// Draw the vertical polygonal side
|
||||
int startContour = 0;
|
||||
for( unsigned ii = 0; ii < aPolysList.GetCornersCount(); ii++ )
|
||||
{
|
||||
unsigned jj = ii + 1;
|
||||
|
||||
if( aPolysList.IsEndContour( ii ) || jj >= aPolysList.GetCornersCount() )
|
||||
{
|
||||
jj = startContour;
|
||||
startContour = ii + 1;
|
||||
}
|
||||
|
||||
// Build the 4 vertices of each GL_QUAD
|
||||
coords[0].x = aPolysList.GetX( ii );
|
||||
coords[0].y = -aPolysList.GetY( ii );
|
||||
coords[1].x = coords[0].x;
|
||||
coords[1].y = coords[0].y; // only z change
|
||||
coords[2].x = aPolysList.GetX( jj );
|
||||
coords[2].y = -aPolysList.GetY( jj );
|
||||
coords[3].x = coords[2].x;
|
||||
coords[3].y = coords[2].y; // only z change
|
||||
|
||||
// Creates the GL_QUAD
|
||||
Set_Object_Data( coords, aBiuTo3DUnits );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SetGLColor( EDA_COLOR_T color, double alpha )
|
||||
{
|
||||
double red, green, blue;
|
||||
const StructColors &colordata = g_ColorRefs[ColorGetBase( color )];
|
||||
|
||||
red = colordata.m_Red / 255.0;
|
||||
blue = colordata.m_Blue / 255.0;
|
||||
green = colordata.m_Green / 255.0;
|
||||
glColor4f( red, green, blue, alpha );
|
||||
}
|
||||
|
||||
|
||||
/* draw all solid polygons found in aPolysList
|
||||
* aZpos = z position in board internal units
|
||||
* aThickness = thickness in board internal units
|
||||
* If aThickness = 0, a polygon area is drawn in a XY plane at Z position = aZpos.
|
||||
* If aThickness > 0, a solid object is drawn.
|
||||
* The top side is located at aZpos + aThickness / 2
|
||||
* The bottom side is located at aZpos - aThickness / 2
|
||||
*/
|
||||
void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList,
|
||||
int aZpos, int aThickness, double aBiuTo3DUnits )
|
||||
{
|
||||
GLUtesselator* tess = gluNewTess();
|
||||
|
||||
gluTessCallback( tess, GLU_TESS_BEGIN, ( void (CALLBACK*) () )tessBeginCB );
|
||||
gluTessCallback( tess, GLU_TESS_END, ( void (CALLBACK*) () )tessEndCB );
|
||||
gluTessCallback( tess, GLU_TESS_ERROR, ( void (CALLBACK*) () )tessErrorCB );
|
||||
gluTessCallback( tess, GLU_TESS_VERTEX, ( void (CALLBACK*) () )tessCPolyPt2Vertex );
|
||||
|
||||
GLdouble v_data[3];
|
||||
double zpos = ( aZpos + (aThickness / 2) ) * aBiuTo3DUnits;
|
||||
g_Parm_3D_Visu.m_CurrentZpos = zpos;
|
||||
v_data[2] = aZpos + (aThickness / 2);
|
||||
|
||||
// Set normal to toward positive Z axis, for a solid object only (to draw the top side)
|
||||
if( aThickness )
|
||||
SetNormalZpos();
|
||||
|
||||
// gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_ODD);
|
||||
|
||||
// Draw solid areas contained in this list
|
||||
CPOLYGONS_LIST polylist = aPolysList; // temporary copy for gluTessVertex
|
||||
|
||||
for( int side = 0; side < 2; side++ )
|
||||
{
|
||||
int startContour = 1;
|
||||
|
||||
for( unsigned ii = 0; ii < polylist.GetCornersCount(); ii++ )
|
||||
{
|
||||
if( startContour == 1 )
|
||||
{
|
||||
gluTessBeginPolygon( tess, NULL );
|
||||
gluTessBeginContour( tess );
|
||||
startContour = 0;
|
||||
}
|
||||
|
||||
v_data[0] = polylist.GetX( ii ) * aBiuTo3DUnits;
|
||||
v_data[1] = -polylist.GetY( ii ) * aBiuTo3DUnits;
|
||||
// gluTessVertex store pointers on data, not data, so do not store
|
||||
// different corners values in a temporary variable
|
||||
// but send pointer on each CPolyPt value in polylist
|
||||
// before calling gluDeleteTess
|
||||
gluTessVertex( tess, v_data, &polylist[ii] );
|
||||
|
||||
if( polylist.IsEndContour( ii ) )
|
||||
{
|
||||
gluTessEndContour( tess );
|
||||
gluTessEndPolygon( tess );
|
||||
startContour = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if( aThickness == 0 )
|
||||
break;
|
||||
|
||||
// Prepare the bottom side of solid areas
|
||||
zpos = ( aZpos - (aThickness / 2) ) * aBiuTo3DUnits;
|
||||
g_Parm_3D_Visu.m_CurrentZpos = zpos;
|
||||
v_data[2] = zpos;
|
||||
// Now;, set normal to toward negative Z axis, for the solid object bottom side
|
||||
SetNormalZneg();
|
||||
}
|
||||
|
||||
gluDeleteTess( tess );
|
||||
|
||||
if( aThickness == 0 )
|
||||
return;
|
||||
|
||||
// Build the 3D data : vertical side
|
||||
Draw3D_VerticalPolygonalCylinder( polylist, aThickness, aZpos - (aThickness / 2), false, aBiuTo3DUnits );
|
||||
}
|
||||
|
||||
|
||||
/* draw the solid polygon found in aPolysList
|
||||
* The first polygon is the main polygon, others are holes
|
||||
* See Draw3D_SolidHorizontalPolyPolygons for more info
|
||||
*/
|
||||
void Draw3D_SolidHorizontalPolygonWithHoles( const CPOLYGONS_LIST& aPolysList,
|
||||
int aZpos, int aThickness,
|
||||
double aBiuTo3DUnits )
|
||||
{
|
||||
CPOLYGONS_LIST polygon;
|
||||
|
||||
ConvertPolysListWithHolesToOnePolygon( aPolysList, polygon );
|
||||
Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos, aThickness, aBiuTo3DUnits );
|
||||
}
|
||||
|
||||
|
||||
/* draw a cylinder (a tube) using 3D primitives.
|
||||
* the cylinder axis is parallel to the Z axis
|
||||
* If aHeight = height of the cylinder is 0, only one ring will be drawn
|
||||
* If aThickness = 0, only one cylinder will be drawn
|
||||
*/
|
||||
void Draw3D_ZaxisCylinder( wxPoint aCenterPos, int aRadius,
|
||||
int aHeight, int aThickness,
|
||||
int aZpos, double aBiuTo3DUnits )
|
||||
{
|
||||
const int slice = SEGM_PER_CIRCLE;
|
||||
CPOLYGONS_LIST outer_cornerBuffer;
|
||||
|
||||
TransformCircleToPolygon( outer_cornerBuffer, aCenterPos,
|
||||
aRadius + (aThickness / 2), slice );
|
||||
|
||||
std::vector<S3D_VERTEX> coords;
|
||||
coords.resize( 4 );
|
||||
|
||||
CPOLYGONS_LIST inner_cornerBuffer;
|
||||
if( aThickness ) // build the the vertical inner polygon (hole)
|
||||
TransformCircleToPolygon( inner_cornerBuffer, aCenterPos,
|
||||
aRadius - (aThickness / 2), slice );
|
||||
|
||||
if( aHeight )
|
||||
{
|
||||
// Draw the vertical outer side
|
||||
Draw3D_VerticalPolygonalCylinder( outer_cornerBuffer,
|
||||
aHeight, aZpos, false, aBiuTo3DUnits );
|
||||
if( aThickness )
|
||||
// Draws the vertical inner side (hole)
|
||||
Draw3D_VerticalPolygonalCylinder( inner_cornerBuffer,
|
||||
aHeight, aZpos, true, aBiuTo3DUnits );
|
||||
}
|
||||
|
||||
if( aThickness )
|
||||
{
|
||||
// draw top (front) and bottom (back) horizontal sides (rings)
|
||||
SetNormalZpos();
|
||||
outer_cornerBuffer.Append( inner_cornerBuffer );
|
||||
CPOLYGONS_LIST polygon;
|
||||
|
||||
ConvertPolysListWithHolesToOnePolygon( outer_cornerBuffer, polygon );
|
||||
// draw top (front) horizontal ring
|
||||
Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos + aHeight, 0, aBiuTo3DUnits );
|
||||
|
||||
if( aHeight )
|
||||
{
|
||||
// draw bottom (back) horizontal ring
|
||||
SetNormalZneg();
|
||||
Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos, 0, aBiuTo3DUnits );
|
||||
}
|
||||
}
|
||||
|
||||
SetNormalZpos();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Function Draw3D_ZaxisOblongCylinder:
|
||||
* draw a segment with an oblong hole.
|
||||
* Used to draw oblong holes
|
||||
* If aHeight = height of the cylinder is 0, only one ring will be drawn
|
||||
* If aThickness = 0, only one cylinder will be drawn
|
||||
*/
|
||||
void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
|
||||
int aRadius, int aHeight, int aThickness,
|
||||
int aZpos, double aBiuTo3DUnits )
|
||||
{
|
||||
const int slice = SEGM_PER_CIRCLE;
|
||||
|
||||
// Build the points to approximate oblong cylinder by segments
|
||||
CPOLYGONS_LIST outer_cornerBuffer;
|
||||
|
||||
int segm_width = (aRadius * 2) + aThickness;
|
||||
TransformRoundedEndsSegmentToPolygon( outer_cornerBuffer, aAxis1Pos,
|
||||
aAxis2Pos, slice, segm_width );
|
||||
|
||||
// Draw the oblong outer cylinder
|
||||
if( aHeight )
|
||||
Draw3D_VerticalPolygonalCylinder( outer_cornerBuffer, aHeight, aZpos,
|
||||
false, aBiuTo3DUnits );
|
||||
|
||||
if( aThickness )
|
||||
{
|
||||
CPOLYGONS_LIST inner_cornerBuffer;
|
||||
segm_width = aRadius * 2;
|
||||
TransformRoundedEndsSegmentToPolygon( inner_cornerBuffer, aAxis1Pos,
|
||||
aAxis2Pos, slice, segm_width );
|
||||
|
||||
// Draw the oblong inner cylinder
|
||||
if( aHeight )
|
||||
Draw3D_VerticalPolygonalCylinder( inner_cornerBuffer, aHeight,
|
||||
aZpos, true, aBiuTo3DUnits );
|
||||
|
||||
// Build the horizontal full polygon shape
|
||||
// (outer polygon shape - inner polygon shape)
|
||||
outer_cornerBuffer.Append( inner_cornerBuffer );
|
||||
|
||||
CPOLYGONS_LIST polygon;
|
||||
ConvertPolysListWithHolesToOnePolygon( outer_cornerBuffer, polygon );
|
||||
|
||||
// draw top (front) horizontal side (ring)
|
||||
SetNormalZpos();
|
||||
Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos + aHeight, 0, aBiuTo3DUnits );
|
||||
|
||||
if( aHeight )
|
||||
{
|
||||
// draw bottom (back) horizontal side (ring)
|
||||
SetNormalZneg();
|
||||
Draw3D_SolidHorizontalPolyPolygons( polygon, aZpos, 0, aBiuTo3DUnits );
|
||||
}
|
||||
}
|
||||
|
||||
SetNormalZpos();
|
||||
}
|
||||
|
||||
|
||||
/* draw a thick segment using 3D primitives, in a XY plane
|
||||
* wxPoint aStart, wxPoint aEnd = YX position of end in board units
|
||||
* aWidth = width of segment in board units
|
||||
* aThickness = thickness of segment in board units
|
||||
* aZpos = z position of segment in board units
|
||||
*/
|
||||
void Draw3D_SolidSegment( const wxPoint& aStart, const wxPoint& aEnd,
|
||||
int aWidth, int aThickness, int aZpos, double aBiuTo3DUnits )
|
||||
{
|
||||
CPOLYGONS_LIST cornerBuffer;
|
||||
const int slice = SEGM_PER_CIRCLE;
|
||||
|
||||
TransformRoundedEndsSegmentToPolygon( cornerBuffer, aStart, aEnd, slice, aWidth );
|
||||
|
||||
Draw3D_SolidHorizontalPolyPolygons( cornerBuffer, aZpos, aThickness, aBiuTo3DUnits );
|
||||
}
|
||||
|
||||
|
||||
void Draw3D_ArcSegment( const wxPoint& aCenterPos, const wxPoint& aStartPoint,
|
||||
double aArcAngle, int aWidth, int aThickness,
|
||||
int aZpos, double aBiuTo3DUnits )
|
||||
{
|
||||
const int slice = SEGM_PER_CIRCLE;
|
||||
|
||||
CPOLYGONS_LIST cornerBuffer;
|
||||
TransformArcToPolygon( cornerBuffer, aCenterPos, aStartPoint, aArcAngle,
|
||||
slice, aWidth );
|
||||
|
||||
Draw3D_SolidHorizontalPolyPolygons( cornerBuffer, aZpos, aThickness, aBiuTo3DUnits );
|
||||
}
|
||||
|
||||
|
||||
// /////////////////////////////////////////////////////////////////////////////
|
||||
// GLU_TESS CALLBACKS
|
||||
// /////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CALLBACK tessBeginCB( GLenum which )
|
||||
{
|
||||
glBegin( which );
|
||||
}
|
||||
|
||||
|
||||
void CALLBACK tessEndCB()
|
||||
{
|
||||
glEnd();
|
||||
}
|
||||
|
||||
|
||||
void CALLBACK tessCPolyPt2Vertex( const GLvoid* data )
|
||||
{
|
||||
// cast back to double type
|
||||
const CPolyPt* ptr = (const CPolyPt*) data;
|
||||
|
||||
glVertex3d( ptr->x * g_Parm_3D_Visu.m_BiuTo3Dunits,
|
||||
-ptr->y * g_Parm_3D_Visu.m_BiuTo3Dunits,
|
||||
g_Parm_3D_Visu.m_CurrentZpos );
|
||||
}
|
||||
|
||||
|
||||
void CALLBACK tessErrorCB( GLenum errorCode )
|
||||
{
|
||||
#if defined(DEBUG)
|
||||
const GLubyte* errorStr;
|
||||
|
||||
errorStr = gluErrorString( errorCode );
|
||||
|
||||
// DEBUG //
|
||||
DBG( printf( "Tess ERROR: %s\n", errorStr ); )
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2012 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file 3d_draw_basic_functions.h
|
||||
*/
|
||||
#ifndef _3D_DRAW_BASIC_FUNCTIONS_H_
|
||||
#define _3D_DRAW_BASIC_FUNCTIONS_H_
|
||||
|
||||
// angle increment to draw a circle, approximated by segments
|
||||
#define ANGLE_INC( x ) ( 3600 / (x) )
|
||||
|
||||
/** draw all solid polygons found in aPolysList
|
||||
* @param aPolysList = the poligon list to draw
|
||||
* @param aZpos = z position in board internal units
|
||||
* @param aThickness = thickness in board internal units
|
||||
* @param aBiuTo3DUnits = board internal units to 3D units scaling value
|
||||
* If aThickness = 0, a polygon area is drawn in a XY plane at Z position = aZpos.
|
||||
* If aThickness > 0, a solid object is drawn.
|
||||
* The top side is located at aZpos + aThickness / 2
|
||||
* The bottom side is located at aZpos - aThickness / 2
|
||||
*/
|
||||
void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList,
|
||||
int aZpos, int aThickness, double aBiuTo3DUnits );
|
||||
|
||||
/** draw the solid polygon found in aPolysList
|
||||
* The first polygonj is the main polygon, others are holes
|
||||
* @param aPolysList = the polygon with holes to draw
|
||||
* @param aZpos = z position in board internal units
|
||||
* @param aThickness = thickness in board internal units
|
||||
* @param aBiuTo3DUnits = board internal units to 3D units scaling value
|
||||
* If aThickness = 0, a polygon area is drawn in a XY plane at Z position = aZpos.
|
||||
* If aThickness > 0, a solid object is drawn.
|
||||
* The top side is located at aZpos + aThickness / 2
|
||||
* The bottom side is located at aZpos - aThickness / 2
|
||||
*/
|
||||
void Draw3D_SolidHorizontalPolygonWithHoles( const CPOLYGONS_LIST& aPolysList,
|
||||
int aZpos, int aThickness, double aBiuTo3DUnits );
|
||||
|
||||
/** draw a thick segment using 3D primitives, in a XY plane
|
||||
* @param aStart = YX position of start point in board units
|
||||
* @param aEnd = YX position of end point in board units
|
||||
* @param aWidth = width of segment in board units
|
||||
* @param aThickness = thickness of segment in board units
|
||||
* @param aZpos = z position of segment in board units
|
||||
* @param aBiuTo3DUnits = board internal units to 3D units scaling value
|
||||
* If aThickness = 0, a polygon area is drawn in a XY plane at Z position = aZpos.
|
||||
* If aThickness > 0, a solid object is drawn.
|
||||
* The top side is located at aZpos + aThickness / 2
|
||||
* The bottom side is located at aZpos - aThickness / 2
|
||||
*/
|
||||
void Draw3D_SolidSegment( const wxPoint& aStart, const wxPoint& aEnd,
|
||||
int aWidth, int aThickness, int aZpos,
|
||||
double aBiuTo3DUnits );
|
||||
|
||||
/** draw an arc using 3D primitives, in a XY plane
|
||||
* @param aCenterPos = XY position of the center in board units
|
||||
* @param aStartPoint = start point coordinate of arc in board units
|
||||
* @param aWidth = width of the circle in board units
|
||||
* @param aArcAngle = arc angle in 1/10 degrees
|
||||
* @param aWidth = thickness of arc
|
||||
* @param aThickness = thickness of segment in board units
|
||||
* @param aZpos = z position of segment in board units
|
||||
* @param aBiuTo3DUnits = board internal units to 3D units scaling value
|
||||
*/
|
||||
void Draw3D_ArcSegment( const wxPoint& aCenterPos, const wxPoint& aStartPoint,
|
||||
double aArcAngle, int aWidth, int aThickness,
|
||||
int aZpos, double aBiuTo3DUnits );
|
||||
|
||||
|
||||
/** draw a thick cylinder (a tube) using 3D primitives.
|
||||
* the cylinder axis is parallel to the Z axis
|
||||
* @param aCenterPos = XY position of the axis cylinder ( board internal units)
|
||||
* @param aRadius = radius of the cylinder ( board internal units)
|
||||
* @param aHeight = height of the cylinder ( boardinternal units)
|
||||
* @param aThickness = tichkness of tube ( boardinternal units)
|
||||
* @param aZpos = Z position of the bottom side of the cylinder ( board internal units)
|
||||
* @param aBiuTo3DUnits = board internal units to 3D units scaling value
|
||||
*
|
||||
* If aHeight = height of the cylinder is 0, only one ring will be drawn
|
||||
* If aThickness = 0, only one cylinder (not a tube) will be drawn
|
||||
*/
|
||||
void Draw3D_ZaxisCylinder( wxPoint aCenterPos, int aRadius,
|
||||
int aHeight, int aThickness,
|
||||
int aZpos, double aBiuTo3DUnits );
|
||||
|
||||
/** draw an oblong cylinder (oblong tube) using 3D primitives.
|
||||
* the cylinder axis are parallel to the Z axis
|
||||
* @param aAxis1Pos = position of the first axis cylinder
|
||||
* @param aAxis2Pos = position of the second axis cylinder
|
||||
* @param aRadius = radius of the cylinder ( board internal units )
|
||||
* @param aHeight = height of the cylinder ( board internal units )
|
||||
* @param aThickness = tichkness of tube ( board internal units )
|
||||
* @param aZpos = Z position of the bottom side of the cylinder ( board internal units )
|
||||
* @param aBiuTo3DUnits = board internal units to 3D units scaling value
|
||||
*/
|
||||
void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
|
||||
int aRadius, int aHeight, int aThickness,
|
||||
int aZpos, double aBiuTo3DUnits );
|
||||
/**
|
||||
* Set the current 3D color from a Kicad color, with optional transparency
|
||||
* @param aColor = a EDA_COLOR_T kicad color index
|
||||
* @param aTransparency = the color transparency (default = 1.0 = no transparency)
|
||||
*/
|
||||
void SetGLColor( EDA_COLOR_T aColor, double aTransparency = 1.0 );
|
||||
|
||||
|
||||
#endif // _3D_DRAW_BASIC_FUNCTIONS_H_
|
||||
+276
-209
@@ -1,53 +1,89 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: 3d_frame.cpp
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* @file 3d_frame.cpp
|
||||
*/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2012 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
|
||||
*/
|
||||
|
||||
#if !wxUSE_GLCANVAS
|
||||
#error Please set wxUSE_GLCANVAS to 1 in setup.h.
|
||||
#endif
|
||||
#include <fctsys.h>
|
||||
#include <appl_wxstruct.h>
|
||||
|
||||
#include "3d_viewer.h"
|
||||
#include "trackball.h"
|
||||
#include <3d_viewer.h>
|
||||
#include <3d_canvas.h>
|
||||
#include <info3d_visu.h>
|
||||
#include <trackball.h>
|
||||
|
||||
#include <wx/colordlg.h>
|
||||
#include <wxstruct.h>
|
||||
#include <3d_viewer_id.h>
|
||||
#include <wxBasePcbFrame.h>
|
||||
|
||||
Info_3D_Visu g_Parm_3D_Visu;
|
||||
double g_Draw3d_dx;
|
||||
double g_Draw3d_dy;
|
||||
double ZBottom;
|
||||
double ZTop;
|
||||
double DataScale3D; // 3D conversion units.
|
||||
INFO3D_VISU g_Parm_3D_Visu;
|
||||
|
||||
// Key to store 3D Viewer config:
|
||||
static const wxString keyBgColor_Red( wxT( "BgColor_Red" ) );
|
||||
static const wxString keyBgColor_Green( wxT( "BgColor_Green" ) );
|
||||
static const wxString keyBgColor_Blue( wxT( "BgColor_Blue" ) );
|
||||
static const wxString keyShowRealisticMode( wxT( "ShowRealisticMode" ) );
|
||||
static const wxString keyShowAxis( wxT( "ShowAxis" ) );
|
||||
static const wxString keyShowZones( wxT( "ShowZones" ) );
|
||||
static const wxString keyShowFootprints( wxT( "ShowFootprints" ) );
|
||||
static const wxString keyShowCopperThickness( wxT( "ShowCopperThickness" ) );
|
||||
static const wxString keyShowAdhesiveLayers( wxT( "ShowAdhesiveLayers" ) );
|
||||
static const wxString keyShowSilkScreenLayers( wxT( "ShowSilkScreenLayers" ) );
|
||||
static const wxString keyShowSolderMaskLayers( wxT( "ShowSolderMasLayers" ) );
|
||||
static const wxString keyShowSolderPasteLayers( wxT( "ShowSolderPasteLayers" ) );
|
||||
static const wxString keyShowCommentsLayer( wxT( "ShowCommentsLayers" ) );
|
||||
static const wxString keyShowBoardBody( wxT( "ShowBoardBody" ) );
|
||||
static const wxString keyShowEcoLayers( wxT( "ShowEcoLayers" ) );
|
||||
|
||||
BEGIN_EVENT_TABLE( EDA_3D_FRAME, wxFrame )
|
||||
EVT_ACTIVATE( EDA_3D_FRAME::OnActivate )
|
||||
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, EDA_3D_FRAME::Process_Zoom )
|
||||
EVT_TOOL_RANGE( ID_START_COMMAND_3D, ID_END_COMMAND_3D,
|
||||
EDA_3D_FRAME::Process_Special_Functions )
|
||||
EVT_MENU( wxID_EXIT, EDA_3D_FRAME::Exit3DFrame )
|
||||
EVT_MENU( ID_MENU_SCREENCOPY_PNG, EDA_3D_FRAME::Process_Special_Functions )
|
||||
EVT_MENU( ID_MENU_SCREENCOPY_JPEG, EDA_3D_FRAME::Process_Special_Functions )
|
||||
EVT_CLOSE( EDA_3D_FRAME::OnCloseWindow )
|
||||
END_EVENT_TABLE()
|
||||
BEGIN_EVENT_TABLE( EDA_3D_FRAME, EDA_BASE_FRAME )
|
||||
EVT_ACTIVATE( EDA_3D_FRAME::OnActivate )
|
||||
|
||||
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, EDA_3D_FRAME::Process_Zoom )
|
||||
EVT_TOOL_RANGE( ID_START_COMMAND_3D, ID_END_COMMAND_3D,
|
||||
EDA_3D_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_TOOL_SET_VISIBLE_ITEMS, EDA_3D_FRAME::Process_Special_Functions )
|
||||
EVT_MENU( wxID_EXIT, EDA_3D_FRAME::Exit3DFrame )
|
||||
EVT_MENU( ID_MENU_SCREENCOPY_PNG, EDA_3D_FRAME::Process_Special_Functions )
|
||||
EVT_MENU( ID_MENU_SCREENCOPY_JPEG, EDA_3D_FRAME::Process_Special_Functions )
|
||||
|
||||
EDA_3D_FRAME::EDA_3D_FRAME( PCB_BASE_FRAME* parent, const wxString& title, long style ) :
|
||||
wxFrame( parent, DISPLAY3D_FRAME, title, wxPoint( -1, -1 ), wxSize( -1, -1 ), style )
|
||||
EVT_MENU_RANGE( ID_MENU3D_GRID, ID_MENU3D_GRID_END,
|
||||
EDA_3D_FRAME::On3DGridSelection )
|
||||
|
||||
EVT_CLOSE( EDA_3D_FRAME::OnCloseWindow )
|
||||
|
||||
END_EVENT_TABLE() EDA_3D_FRAME::EDA_3D_FRAME( PCB_BASE_FRAME* parent,
|
||||
const wxString& title,
|
||||
long style ) :
|
||||
EDA_BASE_FRAME( parent, DISPLAY3D_FRAME_TYPE, title,
|
||||
wxDefaultPosition, wxDefaultSize, style, wxT( "Frame3D" ) )
|
||||
{
|
||||
m_FrameName = wxT( "Frame3D" );
|
||||
m_Canvas = NULL;
|
||||
m_Parent = parent;
|
||||
m_HToolBar = NULL;
|
||||
m_VToolBar = NULL;
|
||||
m_InternalUnits = 10000; // Internal units = 1/10000 inch
|
||||
m_canvas = NULL;
|
||||
m_reloadRequest = false;
|
||||
m_ortho = false;
|
||||
|
||||
// Give it an icon
|
||||
wxIcon icon;
|
||||
wxIcon icon;
|
||||
icon.CopyFromBitmap( KiBitmap( icon_3d_xpm ) );
|
||||
SetIcon( icon );
|
||||
|
||||
@@ -60,26 +96,23 @@ EDA_3D_FRAME::EDA_3D_FRAME( PCB_BASE_FRAME* parent, const wxString& title, long
|
||||
CreateStatusBar( 5 );
|
||||
SetStatusWidths( 5, dims );
|
||||
|
||||
ReCreateMenuBar();
|
||||
ReCreateHToolbar();
|
||||
|
||||
// ReCreateAuxiliaryToolbar();
|
||||
ReCreateVToolbar();
|
||||
CreateMenuBar();
|
||||
ReCreateMainToolbar();
|
||||
|
||||
// Make a EDA_3D_CANVAS
|
||||
int attrs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0 };
|
||||
m_Canvas = new EDA_3D_CANVAS( this, attrs );
|
||||
m_canvas = new EDA_3D_CANVAS( this, attrs );
|
||||
|
||||
m_auimgr.SetManagedWindow( this );
|
||||
|
||||
|
||||
EDA_PANEINFO horiz;
|
||||
horiz.HorizontalToolbarPane();
|
||||
EDA_PANEINFO horiztb;
|
||||
horiztb.HorizontalToolbarPane();
|
||||
|
||||
m_auimgr.AddPane( m_HToolBar,
|
||||
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top() );
|
||||
m_auimgr.AddPane( m_mainToolBar,
|
||||
wxAuiPaneInfo( horiztb ).Name( wxT( "m_mainToolBar" ) ).Top() );
|
||||
|
||||
m_auimgr.AddPane( m_Canvas,
|
||||
m_auimgr.AddPane( m_canvas,
|
||||
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
|
||||
|
||||
m_auimgr.Update();
|
||||
@@ -87,7 +120,7 @@ EDA_3D_FRAME::EDA_3D_FRAME( PCB_BASE_FRAME* parent, const wxString& title, long
|
||||
// Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
|
||||
// in order to receive mouse events. Otherwise, the user has to click somewhere on
|
||||
// the canvas before it will respond to mouse wheel events.
|
||||
m_Canvas->SetFocus();
|
||||
m_canvas->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
@@ -99,12 +132,8 @@ void EDA_3D_FRAME::Exit3DFrame( wxCommandEvent& event )
|
||||
|
||||
void EDA_3D_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
||||
{
|
||||
SaveSettings();
|
||||
|
||||
if( m_Parent )
|
||||
{
|
||||
m_Parent->m_Draw3DFrame = NULL;
|
||||
}
|
||||
if( Parent() )
|
||||
Parent()->m_Draw3DFrame = NULL;
|
||||
|
||||
Destroy();
|
||||
}
|
||||
@@ -112,57 +141,82 @@ void EDA_3D_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
||||
|
||||
void EDA_3D_FRAME::GetSettings()
|
||||
{
|
||||
wxString text;
|
||||
wxConfig* config = wxGetApp().m_EDA_Config; // Current config used by application
|
||||
wxConfig* config = wxGetApp().GetSettings(); // Current config used by application
|
||||
class INFO3D_VISU& prms = g_Parm_3D_Visu;
|
||||
|
||||
if( config )
|
||||
{
|
||||
text = m_FrameName + wxT( "Pos_x" );
|
||||
config->Read( text, &m_FramePos.x );
|
||||
text = m_FrameName + wxT( "Pos_y" );
|
||||
config->Read( text, &m_FramePos.y );
|
||||
text = m_FrameName + wxT( "Size_x" );
|
||||
config->Read( text, &m_FrameSize.x, 600 );
|
||||
text = m_FrameName + wxT( "Size_y" );
|
||||
config->Read( text, &m_FrameSize.y, 400 );
|
||||
config->Read( wxT( "BgColor_Red" ), &g_Parm_3D_Visu.m_BgColor.m_Red, 0.0 );
|
||||
config->Read( wxT( "BgColor_Green" ), &g_Parm_3D_Visu.m_BgColor.m_Green, 0.0 );
|
||||
config->Read( wxT( "BgColor_Blue" ), &g_Parm_3D_Visu.m_BgColor.m_Blue, 0.0 );
|
||||
EDA_BASE_FRAME::LoadSettings();
|
||||
|
||||
config->Read( keyBgColor_Red, &g_Parm_3D_Visu.m_BgColor.m_Red, 0.0 );
|
||||
config->Read( keyBgColor_Green, &g_Parm_3D_Visu.m_BgColor.m_Green, 0.0 );
|
||||
config->Read( keyBgColor_Blue, &g_Parm_3D_Visu.m_BgColor.m_Blue, 0.0 );
|
||||
|
||||
bool tmp;
|
||||
config->Read( keyShowRealisticMode, &tmp, false );
|
||||
prms.SetFlag( FL_USE_REALISTIC_MODE, tmp );
|
||||
|
||||
config->Read( keyShowAxis, &tmp, true );
|
||||
prms.SetFlag( FL_AXIS, tmp );
|
||||
|
||||
config->Read( keyShowFootprints, &tmp, true );
|
||||
prms.SetFlag( FL_MODULE, tmp );
|
||||
|
||||
config->Read( keyShowCopperThickness, &tmp, false );
|
||||
prms.SetFlag( FL_USE_COPPER_THICKNESS, tmp );
|
||||
|
||||
config->Read( keyShowZones, &tmp, true );
|
||||
prms.SetFlag( FL_ZONE, tmp );
|
||||
|
||||
config->Read( keyShowAdhesiveLayers, &tmp, true );
|
||||
prms.SetFlag( FL_ADHESIVE, tmp );
|
||||
|
||||
config->Read( keyShowSilkScreenLayers, &tmp, true );
|
||||
prms.SetFlag( FL_SILKSCREEN, tmp );
|
||||
|
||||
config->Read( keyShowSolderMaskLayers, &tmp, true );
|
||||
prms.SetFlag( FL_SOLDERMASK, tmp );
|
||||
|
||||
config->Read( keyShowSolderPasteLayers, &tmp, true );
|
||||
prms.SetFlag( FL_SOLDERPASTE, tmp );
|
||||
|
||||
config->Read( keyShowCommentsLayer, &tmp, true );
|
||||
prms.SetFlag( FL_COMMENTS, tmp );
|
||||
|
||||
config->Read( keyShowEcoLayers, &tmp, true );
|
||||
prms.SetFlag( FL_ECO, tmp );
|
||||
|
||||
config->Read( keyShowBoardBody, &tmp, true );
|
||||
prms.SetFlag( FL_SHOW_BOARD_BODY, tmp );
|
||||
}
|
||||
#if defined( __WXMAC__ )
|
||||
// for macOSX, the window must be below system (macOSX) toolbar
|
||||
if( m_FramePos.y < 20 )
|
||||
m_FramePos.y = 20;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::SaveSettings()
|
||||
{
|
||||
wxString text;
|
||||
wxConfig* Config = wxGetApp().m_EDA_Config; // Current config used by application
|
||||
wxConfig* config = wxGetApp().GetSettings(); // Current config used by application
|
||||
|
||||
if( !Config )
|
||||
if( !config )
|
||||
return;
|
||||
|
||||
Config->Write( wxT( "BgColor_Red" ), g_Parm_3D_Visu.m_BgColor.m_Red );
|
||||
Config->Write( wxT( "BgColor_Green" ), g_Parm_3D_Visu.m_BgColor.m_Green );
|
||||
Config->Write( wxT( "BgColor_Blue" ), g_Parm_3D_Visu.m_BgColor.m_Blue );
|
||||
EDA_BASE_FRAME::SaveSettings();
|
||||
|
||||
if( IsIconized() )
|
||||
return;
|
||||
|
||||
m_FrameSize = GetSize();
|
||||
m_FramePos = GetPosition();
|
||||
|
||||
text = m_FrameName + wxT( "Pos_x" );
|
||||
Config->Write( text, (long) m_FramePos.x );
|
||||
text = m_FrameName + wxT( "Pos_y" );
|
||||
Config->Write( text, (long) m_FramePos.y );
|
||||
text = m_FrameName + wxT( "Size_x" );
|
||||
Config->Write( text, (long) m_FrameSize.x );
|
||||
text = m_FrameName + wxT( "Size_y" );
|
||||
Config->Write( text, (long) m_FrameSize.y );
|
||||
config->Write( keyBgColor_Red, g_Parm_3D_Visu.m_BgColor.m_Red );
|
||||
config->Write( keyBgColor_Green, g_Parm_3D_Visu.m_BgColor.m_Green );
|
||||
config->Write( keyBgColor_Blue, g_Parm_3D_Visu.m_BgColor.m_Blue );
|
||||
class INFO3D_VISU& prms = g_Parm_3D_Visu;
|
||||
config->Write( keyShowRealisticMode, prms.GetFlag( FL_USE_REALISTIC_MODE ) );
|
||||
config->Write( keyShowAxis, prms.GetFlag( FL_AXIS ) );
|
||||
config->Write( keyShowFootprints, prms.GetFlag( FL_MODULE ) );
|
||||
config->Write( keyShowCopperThickness, prms.GetFlag( FL_USE_COPPER_THICKNESS ) );
|
||||
config->Write( keyShowZones, prms.GetFlag( FL_ZONE ) );
|
||||
config->Write( keyShowAdhesiveLayers, prms.GetFlag( FL_ADHESIVE ) );
|
||||
config->Write( keyShowSilkScreenLayers, prms.GetFlag( FL_SILKSCREEN ) );
|
||||
config->Write( keyShowSolderMaskLayers, prms.GetFlag( FL_SOLDERMASK ) );
|
||||
config->Write( keyShowSolderPasteLayers, prms.GetFlag( FL_SOLDERPASTE ) );
|
||||
config->Write( keyShowCommentsLayer, prms.GetFlag( FL_COMMENTS ) );
|
||||
config->Write( keyShowEcoLayers, prms.GetFlag( FL_ECO ) );
|
||||
config->Write( keyShowBoardBody, prms.GetFlag( FL_SHOW_BOARD_BODY ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -173,18 +227,21 @@ void EDA_3D_FRAME::Process_Zoom( wxCommandEvent& event )
|
||||
switch( event.GetId() )
|
||||
{
|
||||
case ID_ZOOM_PAGE:
|
||||
|
||||
for( ii = 0; ii < 4; ii++ )
|
||||
g_Parm_3D_Visu.m_Rot[ii] = 0.0;
|
||||
|
||||
g_Parm_3D_Visu.m_Zoom = 1.0;
|
||||
g_Draw3d_dx = g_Draw3d_dy = 0;
|
||||
m_canvas->SetOffset( 0.0, 0.0 );
|
||||
trackball( g_Parm_3D_Visu.m_Quat, 0.0, 0.0, 0.0, 0.0 );
|
||||
break;
|
||||
|
||||
case ID_ZOOM_IN:
|
||||
g_Parm_3D_Visu.m_Zoom /= 1.2;
|
||||
|
||||
if( g_Parm_3D_Visu.m_Zoom <= 0.01 )
|
||||
g_Parm_3D_Visu.m_Zoom = 0.01;
|
||||
|
||||
break;
|
||||
|
||||
case ID_ZOOM_OUT:
|
||||
@@ -198,8 +255,8 @@ void EDA_3D_FRAME::Process_Zoom( wxCommandEvent& event )
|
||||
return;
|
||||
}
|
||||
|
||||
m_Canvas->Refresh( false );
|
||||
m_Canvas->DisplayStatus();
|
||||
m_canvas->Refresh( false );
|
||||
m_canvas->DisplayStatus();
|
||||
}
|
||||
|
||||
|
||||
@@ -227,9 +284,15 @@ void EDA_3D_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
||||
void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||
{
|
||||
#define ROT_ANGLE 10.0
|
||||
int id = event.GetId();
|
||||
bool isChecked = event.IsChecked();
|
||||
|
||||
switch( event.GetId() )
|
||||
switch( id )
|
||||
{
|
||||
case ID_TOOL_SET_VISIBLE_ITEMS:
|
||||
Install_3D_ViewOptionDialog( event );
|
||||
break;
|
||||
|
||||
case ID_RELOAD3D_BOARD:
|
||||
NewDisplay();
|
||||
return;
|
||||
@@ -260,70 +323,150 @@ void EDA_3D_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||
break;
|
||||
|
||||
case ID_MOVE3D_LEFT:
|
||||
m_Canvas->SetView3D( WXK_LEFT );
|
||||
m_canvas->SetView3D( WXK_LEFT );
|
||||
return;
|
||||
|
||||
case ID_MOVE3D_RIGHT:
|
||||
m_Canvas->SetView3D( WXK_RIGHT );
|
||||
m_canvas->SetView3D( WXK_RIGHT );
|
||||
return;
|
||||
|
||||
case ID_MOVE3D_UP:
|
||||
m_Canvas->SetView3D( WXK_UP );
|
||||
m_canvas->SetView3D( WXK_UP );
|
||||
return;
|
||||
|
||||
case ID_MOVE3D_DOWN:
|
||||
m_Canvas->SetView3D( WXK_DOWN );
|
||||
m_canvas->SetView3D( WXK_DOWN );
|
||||
return;
|
||||
|
||||
case ID_ORTHO:
|
||||
m_Canvas->ToggleOrtho();
|
||||
ToggleOrtho();
|
||||
return;
|
||||
|
||||
case ID_TOOL_SCREENCOPY_TOCLIBBOARD:
|
||||
case ID_MENU_SCREENCOPY_PNG:
|
||||
case ID_MENU_SCREENCOPY_JPEG:
|
||||
m_Canvas->TakeScreenshot( event );
|
||||
m_canvas->TakeScreenshot( event );
|
||||
break;
|
||||
|
||||
case ID_MENU3D_BGCOLOR_SELECTION:
|
||||
Set3DBgColor();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_REALISTIC_MODE:
|
||||
g_Parm_3D_Visu.SetFlag( FL_USE_REALISTIC_MODE, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_SHOW_BOARD_BODY:
|
||||
g_Parm_3D_Visu.SetFlag( FL_SHOW_BOARD_BODY, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_AXIS_ONOFF:
|
||||
Set3DAxisOnOff();
|
||||
g_Parm_3D_Visu.SetFlag( FL_AXIS, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_MODULE_ONOFF:
|
||||
Set3DModuleOnOff();
|
||||
g_Parm_3D_Visu.SetFlag( FL_MODULE, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_USE_COPPER_THICKNESS:
|
||||
g_Parm_3D_Visu.SetFlag( FL_USE_COPPER_THICKNESS, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_ZONE_ONOFF:
|
||||
Set3DZoneOnOff();
|
||||
g_Parm_3D_Visu.SetFlag( FL_ZONE, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_ADHESIVE_ONOFF:
|
||||
g_Parm_3D_Visu.SetFlag( FL_ADHESIVE, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_SILKSCREEN_ONOFF:
|
||||
g_Parm_3D_Visu.SetFlag( FL_SILKSCREEN, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_SOLDER_MASK_ONOFF:
|
||||
g_Parm_3D_Visu.SetFlag( FL_SOLDERMASK, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_SOLDER_PASTE_ONOFF:
|
||||
g_Parm_3D_Visu.SetFlag( FL_SOLDERPASTE, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_COMMENTS_ONOFF:
|
||||
Set3DCommentsOnOff();
|
||||
g_Parm_3D_Visu.SetFlag( FL_COMMENTS, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_DRAWINGS_ONOFF:
|
||||
Set3DDrawingsOnOff();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_ECO1_ONOFF:
|
||||
Set3DEco1OnOff();
|
||||
return;
|
||||
|
||||
case ID_MENU3D_ECO2_ONOFF:
|
||||
Set3DEco2OnOff();
|
||||
case ID_MENU3D_ECO_ONOFF:
|
||||
g_Parm_3D_Visu.SetFlag( FL_ECO, isChecked );
|
||||
NewDisplay();
|
||||
return;
|
||||
|
||||
default:
|
||||
wxMessageBox( wxT( "EDA_3D_FRAME::Process_Special_Functions() error: unknown command" ) );
|
||||
wxLogMessage( wxT( "EDA_3D_FRAME::Process_Special_Functions() error: unknown command" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
m_Canvas->Refresh( true );
|
||||
m_Canvas->DisplayStatus();
|
||||
m_canvas->Refresh( true );
|
||||
m_canvas->DisplayStatus();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::On3DGridSelection( wxCommandEvent& event )
|
||||
{
|
||||
int id = event.GetId();
|
||||
|
||||
for( int ii = ID_MENU3D_GRID; ii < ID_MENU3D_GRID_END; ii++ )
|
||||
{
|
||||
if( event.GetId() == ii )
|
||||
continue;
|
||||
|
||||
GetMenuBar()->Check( ii, false );
|
||||
}
|
||||
|
||||
|
||||
switch( id )
|
||||
{
|
||||
case ID_MENU3D_GRID_NOGRID:
|
||||
g_Parm_3D_Visu.SetFlag( FL_GRID, false );
|
||||
break;
|
||||
|
||||
case ID_MENU3D_GRID_10_MM:
|
||||
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
|
||||
g_Parm_3D_Visu.m_3D_Grid = 10.0;
|
||||
break;
|
||||
|
||||
case ID_MENU3D_GRID_5_MM:
|
||||
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
|
||||
g_Parm_3D_Visu.m_3D_Grid = 5.0;
|
||||
break;
|
||||
|
||||
case ID_MENU3D_GRID_2P5_MM:
|
||||
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
|
||||
g_Parm_3D_Visu.m_3D_Grid = 2.5;
|
||||
break;
|
||||
|
||||
case ID_MENU3D_GRID_1_MM:
|
||||
g_Parm_3D_Visu.SetFlag( FL_GRID, true );
|
||||
g_Parm_3D_Visu.m_3D_Grid = 1.0;
|
||||
break;
|
||||
|
||||
default:
|
||||
wxLogMessage( wxT( "EDA_3D_FRAME::On3DGridSelection() error: unknown command" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
NewDisplay();
|
||||
}
|
||||
|
||||
|
||||
@@ -331,12 +474,12 @@ void EDA_3D_FRAME::NewDisplay()
|
||||
{
|
||||
m_reloadRequest = false;
|
||||
|
||||
m_Canvas->ClearLists();
|
||||
m_Canvas->CreateDrawGL_List();
|
||||
m_canvas->ClearLists();
|
||||
m_canvas->CreateDrawGL_List();
|
||||
|
||||
// m_Canvas->InitGL();
|
||||
m_Canvas->Refresh( true );
|
||||
m_Canvas->DisplayStatus();
|
||||
// m_canvas->InitGL();
|
||||
m_canvas->Refresh( true );
|
||||
m_canvas->DisplayStatus();
|
||||
}
|
||||
|
||||
|
||||
@@ -347,7 +490,7 @@ void EDA_3D_FRAME::OnActivate( wxActivateEvent& event )
|
||||
if( m_reloadRequest )
|
||||
NewDisplay();
|
||||
|
||||
event.Skip(); // required under wxMAC
|
||||
event.Skip(); // required under wxMAC
|
||||
}
|
||||
|
||||
|
||||
@@ -355,96 +498,20 @@ void EDA_3D_FRAME::OnActivate( wxActivateEvent& event )
|
||||
*/
|
||||
void EDA_3D_FRAME::Set3DBgColor()
|
||||
{
|
||||
S3D_Color color;
|
||||
wxColour newcolor, oldcolor;
|
||||
S3D_COLOR color;
|
||||
wxColour newcolor, oldcolor;
|
||||
|
||||
oldcolor.Set( wxRound( g_Parm_3D_Visu.m_BgColor.m_Red * 255 ),
|
||||
wxRound( g_Parm_3D_Visu.m_BgColor.m_Green * 255 ),
|
||||
wxRound( g_Parm_3D_Visu.m_BgColor.m_Blue * 255 ) );
|
||||
oldcolor.Set( KiROUND( g_Parm_3D_Visu.m_BgColor.m_Red * 255 ),
|
||||
KiROUND( g_Parm_3D_Visu.m_BgColor.m_Green * 255 ),
|
||||
KiROUND( g_Parm_3D_Visu.m_BgColor.m_Blue * 255 ) );
|
||||
|
||||
newcolor = wxGetColourFromUser( this, oldcolor );
|
||||
|
||||
if( newcolor != oldcolor )
|
||||
{
|
||||
g_Parm_3D_Visu.m_BgColor.m_Red = (double) newcolor.Red() / 255.0;
|
||||
g_Parm_3D_Visu.m_BgColor.m_Green = (double) newcolor.Green() / 255.0;
|
||||
g_Parm_3D_Visu.m_BgColor.m_Blue = (double) newcolor.Blue() / 255.0;
|
||||
g_Parm_3D_Visu.m_BgColor.m_Red = (double) newcolor.Red() / 255.0;
|
||||
g_Parm_3D_Visu.m_BgColor.m_Green = (double) newcolor.Green() / 255.0;
|
||||
g_Parm_3D_Visu.m_BgColor.m_Blue = (double) newcolor.Blue() / 255.0;
|
||||
NewDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::Set3DAxisOnOff()
|
||||
{
|
||||
if( g_Parm_3D_Visu.m_Draw3DAxis )
|
||||
g_Parm_3D_Visu.m_Draw3DAxis = false;
|
||||
else
|
||||
g_Parm_3D_Visu.m_Draw3DAxis = true;
|
||||
|
||||
NewDisplay();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::Set3DModuleOnOff()
|
||||
{
|
||||
if( g_Parm_3D_Visu.m_Draw3DModule )
|
||||
g_Parm_3D_Visu.m_Draw3DModule = false;
|
||||
else
|
||||
g_Parm_3D_Visu.m_Draw3DModule = true;
|
||||
|
||||
NewDisplay();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::Set3DZoneOnOff()
|
||||
{
|
||||
if( g_Parm_3D_Visu.m_Draw3DZone )
|
||||
g_Parm_3D_Visu.m_Draw3DZone = false;
|
||||
else
|
||||
g_Parm_3D_Visu.m_Draw3DZone = true;
|
||||
NewDisplay();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::Set3DCommentsOnOff()
|
||||
{
|
||||
if( g_Parm_3D_Visu.m_Draw3DComments )
|
||||
g_Parm_3D_Visu.m_Draw3DComments = false;
|
||||
else
|
||||
g_Parm_3D_Visu.m_Draw3DComments = true;
|
||||
|
||||
NewDisplay();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::Set3DDrawingsOnOff()
|
||||
{
|
||||
if( g_Parm_3D_Visu.m_Draw3DDrawings )
|
||||
g_Parm_3D_Visu.m_Draw3DDrawings = false;
|
||||
else
|
||||
g_Parm_3D_Visu.m_Draw3DDrawings = true;
|
||||
|
||||
NewDisplay();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::Set3DEco1OnOff()
|
||||
{
|
||||
if( g_Parm_3D_Visu.m_Draw3DEco1 )
|
||||
g_Parm_3D_Visu.m_Draw3DEco1 = false;
|
||||
else
|
||||
g_Parm_3D_Visu.m_Draw3DEco1 = true;
|
||||
|
||||
NewDisplay();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::Set3DEco2OnOff()
|
||||
{
|
||||
if( g_Parm_3D_Visu.m_Draw3DEco2 )
|
||||
g_Parm_3D_Visu.m_Draw3DEco2 = false;
|
||||
else
|
||||
g_Parm_3D_Visu.m_Draw3DEco2 = true;
|
||||
|
||||
NewDisplay();
|
||||
}
|
||||
|
||||
+78
-532
@@ -1,565 +1,111 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras@wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file 3d_read_mesh.cpp
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "macros.h"
|
||||
#include "kicad_string.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include <fctsys.h>
|
||||
#include <common.h>
|
||||
#include <macros.h>
|
||||
#include <kicad_string.h>
|
||||
#include <appl_wxstruct.h>
|
||||
|
||||
#include "3d_viewer.h"
|
||||
#include <3d_viewer.h>
|
||||
#include <info3d_visu.h>
|
||||
#include "3d_struct.h"
|
||||
#include "modelparsers.h"
|
||||
|
||||
// Imported function:
|
||||
extern void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );
|
||||
|
||||
|
||||
S3D_MODEL_PARSER* S3D_MODEL_PARSER::Create( S3D_MASTER* aMaster,
|
||||
const wxString aExtension )
|
||||
{
|
||||
if ( aExtension == wxT( "x3d" ) )
|
||||
{
|
||||
return new X3D_MODEL_PARSER( aMaster );
|
||||
}
|
||||
else if ( aExtension == wxT( "wrl" ) )
|
||||
{
|
||||
return new VRML_MODEL_PARSER( aMaster );
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int S3D_MASTER::ReadData()
|
||||
{
|
||||
char line[1024], * text;
|
||||
wxFileName fn;
|
||||
wxString FullFilename;
|
||||
FILE* file;
|
||||
int LineNum = 0;
|
||||
|
||||
if( m_Shape3DName.IsEmpty() )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( wxFileName::FileExists( m_Shape3DName ) )
|
||||
{
|
||||
FullFilename = m_Shape3DName;
|
||||
}
|
||||
else
|
||||
{
|
||||
fn = m_Shape3DName;
|
||||
FullFilename = wxGetApp().FindLibraryPath( fn );
|
||||
// Expand any environment variables embedded in footprint's m_Shape3DName field.
|
||||
wxString filename = wxExpandEnvVars( m_Shape3DName );
|
||||
|
||||
if( FullFilename.IsEmpty() )
|
||||
{
|
||||
wxLogDebug( wxT( "3D part library <%s> could not be found." ),
|
||||
GetChars( fn.GetFullPath() ) );
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#ifdef __WINDOWS__
|
||||
filename.Replace( wxT( "/" ), wxT( "\\" ) );
|
||||
#else
|
||||
filename.Replace( wxT( "\\" ), wxT( "/" ) );
|
||||
#endif
|
||||
|
||||
file = wxFopen( FullFilename, wxT( "rt" ) );
|
||||
|
||||
if( file == NULL )
|
||||
if( !wxFileName::FileExists( filename ) )
|
||||
{
|
||||
wxLogDebug( wxT( "3D shape '%s' not found, even tried '%s' after env var substitution." ),
|
||||
GetChars( m_Shape3DName ),
|
||||
GetChars( filename )
|
||||
);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Switch the locale to standard C (needed to print floating point
|
||||
// numbers like 1.3)
|
||||
SetLocaleTo_C_standard();
|
||||
wxFileName fn( filename );
|
||||
|
||||
while( GetLine( file, line, &LineNum, 512 ) )
|
||||
wxString extension = fn.GetExt();
|
||||
S3D_MODEL_PARSER* parser = S3D_MODEL_PARSER::Create( this, extension );
|
||||
|
||||
if( parser )
|
||||
{
|
||||
text = strtok( line, " \t\n\r" );
|
||||
|
||||
if( stricmp( text, "DEF" ) == 0 )
|
||||
{
|
||||
while( GetLine( file, line, &LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, " \t\n\r" );
|
||||
|
||||
if( text == NULL )
|
||||
continue;
|
||||
|
||||
if( *text == '}' )
|
||||
break;
|
||||
|
||||
if( stricmp( text, "children" ) == 0 )
|
||||
{
|
||||
ReadChildren( file, &LineNum );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose( file );
|
||||
SetLocaleTo_Default(); // revert to the current locale
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Analyzes the description of the type:
|
||||
* DEF yellow material Material (
|
||||
* DiffuseColor 1.00000 1.00000 0.00000e 0
|
||||
* EmissiveColor 0.00000e 0 0.00000e 0 0.00000e 0
|
||||
* SpecularColor 1.00000 1.00000 1.00000
|
||||
* AmbientIntensity 1.00000
|
||||
* Transparency 0.00000e 0
|
||||
* Shininess 1.00000
|
||||
*)
|
||||
* Or type:
|
||||
* USE yellow material
|
||||
*/
|
||||
int S3D_MASTER:: ReadMaterial( FILE* file, int* LineNum )
|
||||
{
|
||||
char line[512], * text, * command;
|
||||
wxString mat_name;
|
||||
S3D_MATERIAL* material = NULL;
|
||||
|
||||
command = strtok( NULL, " \t\n\r" );
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
mat_name = FROM_UTF8( text );
|
||||
|
||||
if( stricmp( command, "USE" ) == 0 )
|
||||
{
|
||||
for( material = m_Materials; material; material = material->Next() )
|
||||
{
|
||||
if( material->m_Name == mat_name )
|
||||
{
|
||||
material->SetMaterial();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
printf( "ReadMaterial error: material not found\n" );
|
||||
parser->Load( filename );
|
||||
delete parser;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( stricmp( command, "DEF" ) == 0 )
|
||||
else
|
||||
{
|
||||
material = new S3D_MATERIAL( this, mat_name );
|
||||
|
||||
Insert( material );
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, " \t\n\r" );
|
||||
|
||||
if( text == NULL )
|
||||
continue;
|
||||
|
||||
if( text[0] == '}' )
|
||||
{
|
||||
material->SetMaterial();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( stricmp( text, "diffuseColor" ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_DiffuseColor.x = atof( text );
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_DiffuseColor.y = atof( text );
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_DiffuseColor.z = atof( text );
|
||||
}
|
||||
else if( stricmp( text, "emissiveColor" ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_EmissiveColor.x = atof( text );
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_EmissiveColor.y = atof( text );
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_EmissiveColor.z = atof( text );
|
||||
}
|
||||
else if( strnicmp( text, "specularColor", 13 ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_SpecularColor.x = atof( text );
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_SpecularColor.y = atof( text );
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_SpecularColor.z = atof( text );
|
||||
}
|
||||
else if( strnicmp( text, "ambientIntensity", 16 ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_AmbientIntensity = atof( text );
|
||||
}
|
||||
else if( strnicmp( text, "transparency", 12 ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_Transparency = atof( text );
|
||||
}
|
||||
else if( strnicmp( text, "shininess", 9 ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, " \t\n\r" );
|
||||
material->m_Shininess = atof( text );
|
||||
}
|
||||
}
|
||||
wxLogDebug( wxT( "Unknown file type '%s'" ), GetChars( extension ) );
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int S3D_MASTER::ReadChildren( FILE* file, int* LineNum )
|
||||
{
|
||||
char line[1024], * text;
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, " \t\n\r" );
|
||||
|
||||
if( *text == ']' )
|
||||
return 0;
|
||||
|
||||
if( *text == ',' )
|
||||
continue;
|
||||
|
||||
if( stricmp( text, "Shape" ) == 0 )
|
||||
{
|
||||
ReadShape( file, LineNum );
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "ReadChildren error line %d <%s> \n", *LineNum, text );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int S3D_MASTER::ReadShape( FILE* file, int* LineNum )
|
||||
{
|
||||
char line[1024], * text;
|
||||
int err = 1;
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, " \t\n\r" );
|
||||
|
||||
if( *text == '}' )
|
||||
{
|
||||
err = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if( stricmp( text, "appearance" ) == 0 )
|
||||
{
|
||||
ReadAppearance( file, LineNum );
|
||||
}
|
||||
else if( stricmp( text, "geometry" ) == 0 )
|
||||
{
|
||||
ReadGeometry( file, LineNum );
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "ReadShape error line %d <%s> \n", *LineNum, text );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
int S3D_MASTER::ReadAppearance( FILE* file, int* LineNum )
|
||||
{
|
||||
char line[1024], * text;
|
||||
int err = 1;
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, " \t\n\r" );
|
||||
|
||||
if( *text == '}' )
|
||||
{
|
||||
err = 0; break;
|
||||
}
|
||||
|
||||
if( stricmp( text, "material" ) == 0 )
|
||||
{
|
||||
ReadMaterial( file, LineNum );
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "ReadAppearance error line %d <%s> \n", *LineNum, text );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
#define BUFSIZE 2000
|
||||
|
||||
/* Read a coordinate list like:
|
||||
* coord Coordinate { point [
|
||||
* -5.24489 6.57640e-3 -9.42129e-2,
|
||||
* -5.11821 6.57421e-3 0.542654,
|
||||
* -3.45868 0.256565 1.32000 ] }
|
||||
* or:
|
||||
* normal Normal { vector [
|
||||
* 0.995171 -6.08102e-6 9.81541e-2,
|
||||
* 0.923880 -4.09802e-6 0.382683,
|
||||
* 0.707107 -9.38186e-7 0.707107]
|
||||
* }
|
||||
*
|
||||
* Return the coordinate list
|
||||
* text_buffer contains the first line of this node :
|
||||
* "coord Coordinate { point ["
|
||||
*/
|
||||
double* ReadCoordsList( FILE* file, char* text_buffer, int* bufsize, int* LineNum )
|
||||
{
|
||||
double* data_list = NULL;
|
||||
unsigned int ii = 0, jj = 0, nn = BUFSIZE;
|
||||
char* text;
|
||||
bool HasData = false;
|
||||
bool StartData = false;
|
||||
bool EndNode = false;
|
||||
char string_num[512];
|
||||
|
||||
text = text_buffer;
|
||||
|
||||
while( !EndNode )
|
||||
{
|
||||
if( *text == 0 ) // Needs data !
|
||||
{
|
||||
text = text_buffer;
|
||||
GetLine( file, text_buffer, LineNum, 512 );
|
||||
}
|
||||
|
||||
while( !EndNode && *text )
|
||||
{
|
||||
switch( *text )
|
||||
{
|
||||
case '[':
|
||||
StartData = true;
|
||||
jj = 0; string_num[jj] = 0;
|
||||
data_list = (double*) MyZMalloc( nn * sizeof(double) );
|
||||
break;
|
||||
|
||||
case '}':
|
||||
EndNode = true;
|
||||
break;
|
||||
|
||||
case ']':
|
||||
case '\t':
|
||||
case ' ':
|
||||
case ',':
|
||||
jj = 0;
|
||||
|
||||
if( !StartData || !HasData )
|
||||
break;
|
||||
|
||||
data_list[ii] = atof( string_num );
|
||||
string_num[jj] = 0;
|
||||
ii++;
|
||||
|
||||
if( ii >= nn )
|
||||
{
|
||||
nn *= 2;
|
||||
data_list = (double*) realloc( data_list, ( nn * sizeof(double) ) );
|
||||
}
|
||||
|
||||
HasData = false;
|
||||
|
||||
if( *text == ']' )
|
||||
{
|
||||
StartData = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if( !StartData )
|
||||
break;
|
||||
|
||||
if( jj >= sizeof(string_num) )
|
||||
break;
|
||||
|
||||
string_num[jj] = *text;
|
||||
jj++; string_num[jj] = 0;
|
||||
HasData = true;
|
||||
break;
|
||||
}
|
||||
|
||||
text++;
|
||||
}
|
||||
}
|
||||
|
||||
if( data_list )
|
||||
data_list = (double*) realloc( data_list, ( ii * sizeof(double) ) );
|
||||
|
||||
if( bufsize )
|
||||
*bufsize = ii;
|
||||
|
||||
return data_list;
|
||||
}
|
||||
|
||||
|
||||
int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum )
|
||||
{
|
||||
char line[1024], buffer[1024], * text;
|
||||
int err = 1;
|
||||
int nn = BUFSIZE;
|
||||
double* points = NULL;
|
||||
int* index = NULL;
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
strcpy( buffer, line );
|
||||
text = strtok( buffer, " \t\n\r" );
|
||||
|
||||
if( *text == '}' )
|
||||
{
|
||||
err = 0; break;
|
||||
}
|
||||
|
||||
if( stricmp( text, "normalPerVertex" ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, " ,\t\n\r" );
|
||||
|
||||
if( stricmp( text, "true" ) == 0 )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "colorPerVertex" ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, " ,\t\n\r" );
|
||||
|
||||
if( stricmp( text, "true" ) == 0 )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "normal" ) == 0 )
|
||||
{
|
||||
int coord_number;
|
||||
double* buf_points = ReadCoordsList( file, line, &coord_number, LineNum );
|
||||
|
||||
// Do something if needed
|
||||
free( buf_points );
|
||||
continue;
|
||||
}
|
||||
if( stricmp( text, "normalIndex" ) == 0 )
|
||||
{
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, " ,\t\n\r" );
|
||||
|
||||
while( text )
|
||||
{
|
||||
if( *text == ']' )
|
||||
break;
|
||||
|
||||
text = strtok( NULL, " ,\t\n\r" );
|
||||
}
|
||||
|
||||
if( text && (*text == ']') )
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "color" ) == 0 )
|
||||
{
|
||||
int coord_number;
|
||||
double* buf_points = ReadCoordsList( file, line, &coord_number, LineNum );
|
||||
|
||||
// Do something if needed
|
||||
free( buf_points );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "colorIndex" ) == 0 )
|
||||
{
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, " ,\t\n\r" );
|
||||
|
||||
while( text )
|
||||
{
|
||||
if( *text == ']' )
|
||||
break;
|
||||
|
||||
text = strtok( NULL, " ,\t\n\r" );
|
||||
}
|
||||
|
||||
if( text && (*text == ']') )
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "coord" ) == 0 )
|
||||
{
|
||||
int coord_number;
|
||||
points = ReadCoordsList( file, line, &coord_number, LineNum );
|
||||
}
|
||||
else if( stricmp( text, "coordIndex" ) == 0 )
|
||||
{
|
||||
index = (int*) MyMalloc( nn * sizeof(int) );
|
||||
S3D_Vertex* coords = (S3D_Vertex*) MyMalloc( nn * sizeof(S3D_Vertex) );
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
int coord_count = 0, jj;
|
||||
text = strtok( line, " ,\t\n\r" );
|
||||
|
||||
while( text )
|
||||
{
|
||||
if( *text == ']' )
|
||||
break;
|
||||
|
||||
jj = atoi( text );
|
||||
|
||||
if( jj < 0 )
|
||||
{
|
||||
S3D_Vertex* curr_coord = coords;
|
||||
|
||||
for( jj = 0; jj < coord_count; jj++ )
|
||||
{
|
||||
int kk = index[jj] * 3;
|
||||
curr_coord->x = points[kk];
|
||||
curr_coord->y = points[kk + 1];
|
||||
curr_coord->z = points[kk + 2];
|
||||
curr_coord++;
|
||||
}
|
||||
|
||||
Set_Object_Coords( coords, coord_count );
|
||||
Set_Object_Data( coords, coord_count );
|
||||
coord_count = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
index[coord_count++] = jj;
|
||||
}
|
||||
|
||||
text = strtok( NULL, " ,\t\n\r" );
|
||||
}
|
||||
|
||||
if( text && (*text == ']') )
|
||||
break;
|
||||
}
|
||||
|
||||
free( index );
|
||||
free( coords );
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "ReadGeometry error line %d <%s> \n", *LineNum, text );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( points )
|
||||
free( points );
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
int Struct3D_Shape::ReadData( FILE* file, int* LineNum )
|
||||
int STRUCT_3D_SHAPE::ReadData( FILE* file, int* LineNum )
|
||||
{
|
||||
char line[512];
|
||||
|
||||
|
||||
+119
-57
@@ -1,56 +1,90 @@
|
||||
/*****************/
|
||||
/* 3d_struct.h */
|
||||
/*****************/
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file 3d_struct.h
|
||||
*/
|
||||
|
||||
#ifndef STRUCT_3D_H
|
||||
#define STRUCT_3D_H
|
||||
|
||||
#include "base_struct.h"
|
||||
#include <common.h>
|
||||
#include <base_struct.h>
|
||||
|
||||
|
||||
/* 3D modeling units -> PCB units conversion scale:
|
||||
* 1 "3D model unit" wings3d = 1 unit = 2.54 mm = 0.1 inch
|
||||
* 1 "3D model unit" wings3d = 1 unit = 2.54 mm = 0.1 inch = 100 mils
|
||||
*/
|
||||
#define UNITS3D_TO_UNITSPCB 1000
|
||||
#define UNITS3D_TO_UNITSPCB (IU_PER_MILS * 100)
|
||||
|
||||
|
||||
class S3D_MASTER;
|
||||
class Struct3D_Shape;
|
||||
class STRUCT_3D_SHAPE;
|
||||
|
||||
class S3D_Color /* 3D color (R, G, G) 3 floats range 0 to 1.0*/
|
||||
{
|
||||
public:
|
||||
double m_Red, m_Green, m_Blue;
|
||||
public: S3D_Color()
|
||||
{
|
||||
m_Red = m_Green = m_Blue = 0;
|
||||
}
|
||||
};
|
||||
|
||||
class S3D_Vertex /* 3D coordinate (3 float numbers: x,y,z coordinates)*/
|
||||
/* S3D_VERTEX manages a 3D coordinate (3 float numbers: x,y,z coordinates)*/
|
||||
class S3D_VERTEX
|
||||
{
|
||||
public:
|
||||
double x, y, z;
|
||||
public: S3D_Vertex();
|
||||
|
||||
public:
|
||||
S3D_VERTEX()
|
||||
{
|
||||
x = y = z = 0.0;
|
||||
}
|
||||
|
||||
S3D_VERTEX( double px, double py, double pz)
|
||||
{
|
||||
x = px;
|
||||
y = py;
|
||||
z = pz;
|
||||
}
|
||||
};
|
||||
|
||||
class S3D_MATERIAL : public EDA_ITEM /* openGL "material" data*/
|
||||
{
|
||||
public:
|
||||
wxString m_Name;
|
||||
S3D_Vertex m_DiffuseColor;
|
||||
S3D_Vertex m_EmissiveColor;
|
||||
S3D_Vertex m_SpecularColor;
|
||||
S3D_VERTEX m_DiffuseColor;
|
||||
S3D_VERTEX m_EmissiveColor;
|
||||
S3D_VERTEX m_SpecularColor;
|
||||
float m_AmbientIntensity;
|
||||
float m_Transparency;
|
||||
float m_Shininess;
|
||||
|
||||
public: S3D_MATERIAL( S3D_MASTER* father, const wxString& name );
|
||||
public:
|
||||
S3D_MATERIAL( S3D_MASTER* father, const wxString& name );
|
||||
|
||||
S3D_MATERIAL* Next() const { return (S3D_MATERIAL*) Pnext; }
|
||||
S3D_MATERIAL* Back() const { return (S3D_MATERIAL*) Pback; }
|
||||
|
||||
void SetMaterial();
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -58,14 +92,26 @@ public: S3D_MATERIAL( S3D_MASTER* father, const wxString& name );
|
||||
class S3D_MASTER : public EDA_ITEM
|
||||
{
|
||||
public:
|
||||
wxString m_Shape3DName; /* 3D shape name in 3D library */
|
||||
S3D_Vertex m_MatScale;
|
||||
S3D_Vertex m_MatRotation;
|
||||
S3D_Vertex m_MatPosition;
|
||||
Struct3D_Shape* m_3D_Drawings;
|
||||
S3D_VERTEX m_MatScale;
|
||||
S3D_VERTEX m_MatRotation;
|
||||
S3D_VERTEX m_MatPosition;
|
||||
STRUCT_3D_SHAPE* m_3D_Drawings;
|
||||
S3D_MATERIAL* m_Materials;
|
||||
|
||||
public: S3D_MASTER( EDA_ITEM* aParent );
|
||||
enum FILE3D_TYPE
|
||||
{
|
||||
FILE3D_NONE = 0,
|
||||
FILE3D_VRML,
|
||||
FILE3D_IDF,
|
||||
FILE3D_UNKNOWN
|
||||
};
|
||||
|
||||
private:
|
||||
wxString m_Shape3DName; /* 3D shape name in 3D library */
|
||||
FILE3D_TYPE m_ShapeType;
|
||||
|
||||
public:
|
||||
S3D_MASTER( EDA_ITEM* aParent );
|
||||
~S3D_MASTER();
|
||||
|
||||
S3D_MASTER* Next() const { return (S3D_MASTER*) Pnext; }
|
||||
@@ -80,58 +126,74 @@ public: S3D_MASTER( EDA_ITEM* aParent );
|
||||
|
||||
void Copy( S3D_MASTER* pattern );
|
||||
int ReadData();
|
||||
int ReadMaterial( FILE* file, int* LineNum );
|
||||
int ReadChildren( FILE* file, int* LineNum );
|
||||
int ReadShape( FILE* file, int* LineNum );
|
||||
int ReadAppearance( FILE* file, int* LineNum );
|
||||
int ReadGeometry( FILE* file, int* LineNum );
|
||||
void Set_Object_Coords( S3D_Vertex* coord, int nbcoord );
|
||||
void Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices );
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Function Is3DType
|
||||
* returns true if the argument matches the type of model referred to
|
||||
* by m_Shape3DName
|
||||
*/
|
||||
bool Is3DType( enum FILE3D_TYPE aShapeType );
|
||||
|
||||
const wxString& GetShape3DName( void )
|
||||
{
|
||||
return m_Shape3DName;
|
||||
}
|
||||
|
||||
void SetShape3DName( const wxString& aShapeName );
|
||||
};
|
||||
|
||||
|
||||
/* Describes a complex 3D */
|
||||
class Struct3D_Shape : public EDA_ITEM
|
||||
class STRUCT_3D_SHAPE : public EDA_ITEM
|
||||
{
|
||||
public:
|
||||
S3D_Vertex* m_3D_Coord;
|
||||
S3D_VERTEX* m_3D_Coord;
|
||||
int* m_3D_CoordIndex;
|
||||
int m_3D_Points;
|
||||
|
||||
public: Struct3D_Shape( EDA_ITEM* aParent );
|
||||
~Struct3D_Shape();
|
||||
public:
|
||||
STRUCT_3D_SHAPE( EDA_ITEM* aParent );
|
||||
~STRUCT_3D_SHAPE();
|
||||
|
||||
Struct3D_Shape* Next() const { return (Struct3D_Shape*) Pnext; }
|
||||
Struct3D_Shape* Back() const { return (Struct3D_Shape*) Pback; }
|
||||
STRUCT_3D_SHAPE* Next() const { return (STRUCT_3D_SHAPE*) Pnext; }
|
||||
STRUCT_3D_SHAPE* Back() const { return (STRUCT_3D_SHAPE*) Pback; }
|
||||
|
||||
int ReadData( FILE* file, int* LineNum );
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/* Display and edit a Vertex (triplet of values) in INCHES or MM or without
|
||||
* units.
|
||||
* internal_unit is the internal unit number by inch:
|
||||
* - 1000 for EESchema
|
||||
* - 10000 for PcbNew
|
||||
/**
|
||||
* Class VERTEX_VALUE_CTRL
|
||||
* displays a vertex for editing. A vertex is a triplet of values
|
||||
* Values can be scale, rotation, offset...
|
||||
*/
|
||||
class WinEDA_VertexCtrl
|
||||
class VERTEX_VALUE_CTRL
|
||||
{
|
||||
private:
|
||||
int m_Units;
|
||||
int m_Internal_Unit;
|
||||
wxTextCtrl* m_XValueCtrl, * m_YValueCtrl, * m_ZValueCtrl;
|
||||
wxStaticText* m_Text;
|
||||
|
||||
public:
|
||||
WinEDA_VertexCtrl( wxWindow* parent, const wxString& title,
|
||||
wxBoxSizer* BoxSizer, EDA_UNITS_T units, int internal_unit );
|
||||
VERTEX_VALUE_CTRL( wxWindow* parent, wxBoxSizer* BoxSizer );
|
||||
|
||||
~WinEDA_VertexCtrl();
|
||||
~VERTEX_VALUE_CTRL();
|
||||
|
||||
S3D_Vertex GetValue();
|
||||
void SetValue( S3D_Vertex vertex );
|
||||
/**
|
||||
* Function GetValue
|
||||
* @return the vertex in internal units.
|
||||
*/
|
||||
S3D_VERTEX GetValue();
|
||||
void SetValue( S3D_VERTEX vertex );
|
||||
void Enable( bool enbl );
|
||||
void SetToolTip( const wxString& text );
|
||||
};
|
||||
|
||||
|
||||
#endif /* STRUCT_3D_H */
|
||||
#endif // STRUCT_3D_H
|
||||
|
||||
+172
-76
@@ -1,119 +1,140 @@
|
||||
/********************/
|
||||
/* 3d_toolbar.cpp */
|
||||
/********************/
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2013 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 "fctsys.h"
|
||||
/**
|
||||
* @file 3d_toolbar.cpp
|
||||
*/
|
||||
|
||||
#include "3d_viewer.h"
|
||||
#include <fctsys.h>
|
||||
|
||||
#include <3d_viewer.h>
|
||||
#include <info3d_visu.h>
|
||||
#include <menus_helpers.h>
|
||||
#include <3d_viewer_id.h>
|
||||
|
||||
|
||||
void EDA_3D_FRAME::ReCreateHToolbar()
|
||||
void EDA_3D_FRAME::ReCreateMainToolbar()
|
||||
{
|
||||
if( m_HToolBar != NULL )
|
||||
if( m_mainToolBar != NULL )
|
||||
{
|
||||
// Simple update to the list of old files.
|
||||
SetToolbars();
|
||||
return;
|
||||
}
|
||||
|
||||
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
|
||||
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
||||
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
|
||||
|
||||
// Set up toolbar
|
||||
m_HToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
|
||||
KiBitmap( import3d_xpm ),
|
||||
_( "Reload board" ) );
|
||||
m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
|
||||
KiBitmap( import3d_xpm ), _( "Reload board" ) );
|
||||
|
||||
#if (defined(__WINDOWS__) || defined(__APPLE__ ) )
|
||||
|
||||
// Does not work properly under linux
|
||||
m_HToolBar->AddSeparator();
|
||||
m_mainToolBar->AddSeparator();
|
||||
|
||||
m_HToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
|
||||
m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
|
||||
KiBitmap( copy_button_xpm ),
|
||||
_( "Copy 3D Image to Clipboard" ) );
|
||||
#endif
|
||||
|
||||
m_HToolBar->AddSeparator();
|
||||
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ),
|
||||
m_mainToolBar->AddSeparator();
|
||||
|
||||
m_mainToolBar->AddTool( ID_TOOL_SET_VISIBLE_ITEMS, wxEmptyString,
|
||||
KiBitmap( read_setup_xpm ),
|
||||
_( "Set display options, and some layers visibility" ) );
|
||||
m_mainToolBar->AddSeparator();
|
||||
|
||||
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ),
|
||||
_( "Zoom in" ) );
|
||||
|
||||
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ),
|
||||
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ),
|
||||
_( "Zoom out" ) );
|
||||
|
||||
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
|
||||
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
|
||||
KiBitmap( zoom_redraw_xpm ),
|
||||
_( "Redraw view" ) );
|
||||
|
||||
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ),
|
||||
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ),
|
||||
_( "Fit in page" ) );
|
||||
|
||||
m_HToolBar->AddSeparator();
|
||||
m_HToolBar->AddTool( ID_ROTATE3D_X_NEG, wxEmptyString,
|
||||
m_mainToolBar->AddSeparator();
|
||||
m_mainToolBar->AddTool( ID_ROTATE3D_X_NEG, wxEmptyString,
|
||||
KiBitmap( rotate_neg_x_xpm ),
|
||||
_( "Rotate X <-" ) );
|
||||
|
||||
m_HToolBar->AddTool( ID_ROTATE3D_X_POS, wxEmptyString,
|
||||
m_mainToolBar->AddTool( ID_ROTATE3D_X_POS, wxEmptyString,
|
||||
KiBitmap( rotate_pos_x_xpm ),
|
||||
_( "Rotate X ->" ) );
|
||||
|
||||
m_HToolBar->AddSeparator();
|
||||
m_HToolBar->AddTool( ID_ROTATE3D_Y_NEG, wxEmptyString,
|
||||
m_mainToolBar->AddSeparator();
|
||||
m_mainToolBar->AddTool( ID_ROTATE3D_Y_NEG, wxEmptyString,
|
||||
KiBitmap( rotate_neg_y_xpm ),
|
||||
_( "Rotate Y <-" ) );
|
||||
|
||||
m_HToolBar->AddTool( ID_ROTATE3D_Y_POS, wxEmptyString,
|
||||
m_mainToolBar->AddTool( ID_ROTATE3D_Y_POS, wxEmptyString,
|
||||
KiBitmap( rotate_pos_y_xpm ),
|
||||
_( "Rotate Y ->" ) );
|
||||
|
||||
m_HToolBar->AddSeparator();
|
||||
m_HToolBar->AddTool( ID_ROTATE3D_Z_NEG, wxEmptyString,
|
||||
m_mainToolBar->AddSeparator();
|
||||
m_mainToolBar->AddTool( ID_ROTATE3D_Z_NEG, wxEmptyString,
|
||||
KiBitmap( rotate_neg_z_xpm ),
|
||||
_( "Rotate Z <-" ) );
|
||||
|
||||
m_HToolBar->AddTool( ID_ROTATE3D_Z_POS, wxEmptyString,
|
||||
m_mainToolBar->AddTool( ID_ROTATE3D_Z_POS, wxEmptyString,
|
||||
KiBitmap( rotate_pos_z_xpm ),
|
||||
_( "Rotate Z ->" ) );
|
||||
|
||||
m_HToolBar->AddSeparator();
|
||||
m_HToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString, KiBitmap( left_xpm ),
|
||||
_( "Move left <-" ) );
|
||||
m_mainToolBar->AddSeparator();
|
||||
m_mainToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString, KiBitmap( left_xpm ),
|
||||
_( "Move left" ) );
|
||||
|
||||
m_HToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString, KiBitmap( right_xpm ),
|
||||
_( "Move right ->" ) );
|
||||
m_mainToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString, KiBitmap( right_xpm ),
|
||||
_( "Move right" ) );
|
||||
|
||||
m_HToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString, KiBitmap( up_xpm ),
|
||||
_( "Move up ^" ) );
|
||||
m_mainToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString, KiBitmap( up_xpm ),
|
||||
_( "Move up" ) );
|
||||
|
||||
m_HToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, KiBitmap( down_xpm ),
|
||||
_( "Move down v" ) );
|
||||
m_mainToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, KiBitmap( down_xpm ),
|
||||
_( "Move down" ) );
|
||||
|
||||
m_HToolBar->AddSeparator();
|
||||
m_HToolBar->AddTool( ID_ORTHO, wxEmptyString, KiBitmap( ortho_xpm ),
|
||||
m_mainToolBar->AddSeparator();
|
||||
m_mainToolBar->AddTool( ID_ORTHO, wxEmptyString, KiBitmap( ortho_xpm ),
|
||||
_( "Enable/Disable orthographic projection" ),
|
||||
wxITEM_CHECK );
|
||||
|
||||
m_HToolBar->Realize();
|
||||
m_mainToolBar->Realize();
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::ReCreateVToolbar()
|
||||
void EDA_3D_FRAME::CreateMenuBar()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_FRAME::ReCreateMenuBar()
|
||||
{
|
||||
bool full_options = true;
|
||||
|
||||
// If called from the display frame of cvpcb, only some options are
|
||||
// relevant
|
||||
if( m_Parent->m_FrameName == wxT( "CmpFrame" ) )
|
||||
// Called from cvpcb: do not display all options
|
||||
full_options = false;
|
||||
|
||||
wxMenuBar* menuBar = new wxMenuBar;
|
||||
|
||||
wxMenu* fileMenu = new wxMenu;
|
||||
wxMenuBar* menuBar = new wxMenuBar;
|
||||
wxMenu* fileMenu = new wxMenu;
|
||||
wxMenu* prefsMenu = new wxMenu;
|
||||
|
||||
menuBar->Append( fileMenu, _( "&File" ) );
|
||||
|
||||
@@ -125,42 +146,117 @@ void EDA_3D_FRAME::ReCreateMenuBar()
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->Append( ID_TOOL_SCREENCOPY_TOCLIBBOARD, _( "Copy 3D Image to Clipboard" ) );
|
||||
#endif
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->Append( wxID_EXIT, _( "&Exit" ) );
|
||||
|
||||
wxMenu* referencesMenu = new wxMenu;
|
||||
menuBar->Append( referencesMenu, _( "&Preferences" ) );
|
||||
menuBar->Append( prefsMenu, _( "&Preferences" ) );
|
||||
|
||||
AddMenuItem( referencesMenu, ID_MENU3D_BGCOLOR_SELECTION,
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_REALISTIC_MODE,
|
||||
_( "Realistic Mode" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
|
||||
prefsMenu->AppendSeparator();
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_BGCOLOR_SELECTION,
|
||||
_( "Choose background color" ), KiBitmap( palette_xpm ) );
|
||||
|
||||
AddMenuItem( referencesMenu, ID_MENU3D_AXIS_ONOFF,
|
||||
_( "3D Axis On/Off" ), KiBitmap( axis3d_front_xpm ) );
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_AXIS_ONOFF,
|
||||
_( "Show 3D &Axis" ), KiBitmap( axis3d_front_xpm ), wxITEM_CHECK );
|
||||
|
||||
if( full_options )
|
||||
{
|
||||
AddMenuItem( referencesMenu, ID_MENU3D_MODULE_ONOFF,
|
||||
_( "3D Footprints Shapes On/Off" ), KiBitmap( shape_3d_xpm ) );
|
||||
// Creates grid menu
|
||||
wxMenu * gridlistMenu = new wxMenu;
|
||||
AddMenuItem( prefsMenu, gridlistMenu, ID_MENU3D_GRID,
|
||||
_( "3D Grid" ), KiBitmap( grid_xpm ) );
|
||||
gridlistMenu->Append( ID_MENU3D_GRID_NOGRID, _( "No 3D Grid" ), wxEmptyString, true );
|
||||
gridlistMenu->Check( ID_MENU3D_GRID_NOGRID, true );
|
||||
|
||||
AddMenuItem( referencesMenu, ID_MENU3D_ZONE_ONOFF,
|
||||
_( "Zone Filling On/Off" ), KiBitmap( add_zone_xpm ) );
|
||||
gridlistMenu->Append( ID_MENU3D_GRID_10_MM, _( "3D Grid 10 mm" ), wxEmptyString, true );
|
||||
gridlistMenu->Append( ID_MENU3D_GRID_5_MM, _( "3D Grid 5 mm" ), wxEmptyString, true );
|
||||
gridlistMenu->Append( ID_MENU3D_GRID_2P5_MM, _( "3D Grid 2.5 mm" ), wxEmptyString, true );
|
||||
gridlistMenu->Append( ID_MENU3D_GRID_1_MM, _( "3D Grid 1 mm" ), wxEmptyString, true );
|
||||
|
||||
AddMenuItem( referencesMenu, ID_MENU3D_COMMENTS_ONOFF,
|
||||
_( "Comments Layer On/Off" ), KiBitmap( edit_sheet_xpm ) );
|
||||
prefsMenu->AppendSeparator();
|
||||
|
||||
AddMenuItem( referencesMenu, ID_MENU3D_DRAWINGS_ONOFF,
|
||||
_( "Drawings Layer On/Off" ), KiBitmap( add_polygon_xpm ) );
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_SHOW_BOARD_BODY,
|
||||
_( "Show Board Body" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
|
||||
|
||||
AddMenuItem( referencesMenu, ID_MENU3D_ECO1_ONOFF,
|
||||
_( "Eco1 Layer On/Off" ), KiBitmap( tools_xpm ) );
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_USE_COPPER_THICKNESS,
|
||||
_( "Show Copper Thickness" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
|
||||
|
||||
AddMenuItem( referencesMenu, ID_MENU3D_ECO2_ONOFF,
|
||||
_( "Eco2 Layer On/Off" ), KiBitmap( tools_xpm ) );
|
||||
}
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_MODULE_ONOFF,
|
||||
_( "Show 3D F&ootprints" ), KiBitmap( shape_3d_xpm ), wxITEM_CHECK );
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_ZONE_ONOFF,
|
||||
_( "Show Zone &Filling" ), KiBitmap( add_zone_xpm ), wxITEM_CHECK );
|
||||
|
||||
prefsMenu->AppendSeparator();
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_ADHESIVE_ONOFF,
|
||||
_( "Show &Adhesive Layers" ), KiBitmap( tools_xpm ), wxITEM_CHECK );
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_SILKSCREEN_ONOFF,
|
||||
_( "Show &Silkscreen Layer" ), KiBitmap( add_text_xpm ), wxITEM_CHECK );
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_SOLDER_MASK_ONOFF,
|
||||
_( "Show Solder &Mask Layers" ), KiBitmap( pads_mask_layers_xpm ), wxITEM_CHECK );
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_SOLDER_PASTE_ONOFF,
|
||||
_( "Show Solder &Paste Layers" ), KiBitmap( pads_mask_layers_xpm ), wxITEM_CHECK );
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_COMMENTS_ONOFF,
|
||||
_( "Show &Comments and Drawings Layer" ), KiBitmap( edit_sheet_xpm ), wxITEM_CHECK );
|
||||
|
||||
AddMenuItem( prefsMenu, ID_MENU3D_ECO_ONOFF,
|
||||
_( "Show &Eco Layers" ), KiBitmap( edit_sheet_xpm ), wxITEM_CHECK );
|
||||
|
||||
SetMenuBar( menuBar );
|
||||
SetMenuBarOptionsState();
|
||||
}
|
||||
|
||||
void EDA_3D_FRAME::SetMenuBarOptionsState()
|
||||
{
|
||||
wxMenuBar* menuBar = GetMenuBar();
|
||||
|
||||
if( menuBar == NULL )
|
||||
return;
|
||||
|
||||
wxMenuItem* item;
|
||||
// Set the state of toggle menus according to the current display options
|
||||
item = menuBar->FindItem( ID_MENU3D_REALISTIC_MODE );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_USE_REALISTIC_MODE ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_SHOW_BOARD_BODY );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_SHOW_BOARD_BODY ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_USE_COPPER_THICKNESS );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_USE_COPPER_THICKNESS ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_MODULE_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_MODULE ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_ZONE_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_ZONE ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_AXIS_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_AXIS ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_ADHESIVE_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_ADHESIVE ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_SILKSCREEN_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_SILKSCREEN ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_SOLDER_MASK_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_SOLDERMASK ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_SOLDER_PASTE_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_SOLDERPASTE ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_COMMENTS_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_COMMENTS ) );
|
||||
|
||||
item = menuBar->FindItem( ID_MENU3D_ECO_ONOFF );
|
||||
item->Check(g_Parm_3D_Visu.GetFlag( FL_ECO ));
|
||||
}
|
||||
|
||||
void EDA_3D_FRAME::SetToolbars()
|
||||
{
|
||||
|
||||
+76
-220
@@ -1,14 +1,42 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file 3d_viewer.h
|
||||
*/
|
||||
|
||||
#ifndef __3D_VIEWER_H__
|
||||
#define __3D_VIEWER_H__
|
||||
|
||||
#include <wxstruct.h> // for EDA_BASE_FRAME.
|
||||
|
||||
#if !wxUSE_GLCANVAS
|
||||
#error Please set wxUSE_GLCANVAS to 1 in setup.h.
|
||||
#error Please build wxWidgets with Opengl support (./configure --with-opengl)
|
||||
#endif
|
||||
|
||||
#include "wx/glcanvas.h"
|
||||
#include <wx/glcanvas.h>
|
||||
|
||||
#ifdef __WXMAC__
|
||||
# ifdef __DARWIN__
|
||||
@@ -20,202 +48,22 @@
|
||||
# include <GL/glu.h>
|
||||
#endif
|
||||
|
||||
#include "pcbstruct.h"
|
||||
#include "3d_struct.h"
|
||||
#include "id.h"
|
||||
|
||||
|
||||
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS
|
||||
|
||||
|
||||
#define LIB3D_PATH wxT( "packages3d" )
|
||||
|
||||
/**
|
||||
* Command IDs for the 3D viewer.
|
||||
*
|
||||
* Please add IDs that are unique to the 3D viewer here and not in the global
|
||||
* id.h file. This will prevent the entire project from being rebuilt when
|
||||
* adding new commands to the 3D viewer.
|
||||
*/
|
||||
enum id_3dview_frm
|
||||
{
|
||||
ID_START_COMMAND_3D = ID_END_LIST,
|
||||
ID_ROTATE3D_X_NEG,
|
||||
ID_ROTATE3D_X_POS,
|
||||
ID_ROTATE3D_Y_NEG,
|
||||
ID_ROTATE3D_Y_POS,
|
||||
ID_ROTATE3D_Z_NEG,
|
||||
ID_ROTATE3D_Z_POS,
|
||||
ID_RELOAD3D_BOARD,
|
||||
ID_TOOL_SCREENCOPY_TOCLIBBOARD,
|
||||
ID_MOVE3D_LEFT,
|
||||
ID_MOVE3D_RIGHT,
|
||||
ID_MOVE3D_UP,
|
||||
ID_MOVE3D_DOWN,
|
||||
ID_ORTHO,
|
||||
ID_MENU3D_BGCOLOR_SELECTION,
|
||||
ID_MENU3D_AXIS_ONOFF,
|
||||
ID_MENU3D_MODULE_ONOFF,
|
||||
ID_MENU3D_UNUSED,
|
||||
ID_MENU3D_ZONE_ONOFF,
|
||||
ID_MENU3D_DRAWINGS_ONOFF,
|
||||
ID_MENU3D_COMMENTS_ONOFF,
|
||||
ID_MENU3D_ECO1_ONOFF,
|
||||
ID_MENU3D_ECO2_ONOFF,
|
||||
ID_END_COMMAND_3D,
|
||||
|
||||
ID_MENU_SCREENCOPY_PNG,
|
||||
ID_MENU_SCREENCOPY_JPEG,
|
||||
ID_MENU_SCREENCOPY_TOCLIBBOARD,
|
||||
|
||||
ID_POPUP_3D_VIEW_START,
|
||||
ID_POPUP_ZOOMIN,
|
||||
ID_POPUP_ZOOMOUT,
|
||||
ID_POPUP_VIEW_XPOS,
|
||||
ID_POPUP_VIEW_XNEG,
|
||||
ID_POPUP_VIEW_YPOS,
|
||||
ID_POPUP_VIEW_YNEG,
|
||||
ID_POPUP_VIEW_ZPOS,
|
||||
ID_POPUP_VIEW_ZNEG,
|
||||
ID_POPUP_MOVE3D_LEFT,
|
||||
ID_POPUP_MOVE3D_RIGHT,
|
||||
ID_POPUP_MOVE3D_UP,
|
||||
ID_POPUP_MOVE3D_DOWN,
|
||||
ID_POPUP_3D_VIEW_END
|
||||
};
|
||||
|
||||
#include <3d_struct.h>
|
||||
|
||||
class EDA_3D_CANVAS;
|
||||
class EDA_3D_FRAME;
|
||||
class Info_3D_Visu;
|
||||
class S3D_Vertex;
|
||||
class SEGVIA;
|
||||
class PCB_BASE_FRAME;
|
||||
|
||||
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS
|
||||
#define LIB3D_PATH wxT( "packages3d" )
|
||||
|
||||
#define m_ROTX m_Rot[0]
|
||||
#define m_ROTY m_Rot[1]
|
||||
#define m_ROTZ m_Rot[2]
|
||||
|
||||
/* information needed to display 3D board */
|
||||
class Info_3D_Visu
|
||||
class EDA_3D_FRAME : public EDA_BASE_FRAME
|
||||
{
|
||||
public:
|
||||
double m_Beginx, m_Beginy; /* position of mouse */
|
||||
double m_Quat[4]; /* orientation of object */
|
||||
double m_Rot[4]; /* man rotation of object */
|
||||
double m_Zoom; /* field of view in degrees */
|
||||
S3D_Color m_BgColor;
|
||||
bool m_Draw3DAxis;
|
||||
bool m_Draw3DModule;
|
||||
bool m_Draw3DZone;
|
||||
bool m_Draw3DComments;
|
||||
bool m_Draw3DDrawings;
|
||||
bool m_Draw3DEco1;
|
||||
bool m_Draw3DEco2;
|
||||
wxPoint m_BoardPos;
|
||||
wxSize m_BoardSize;
|
||||
int m_Layers;
|
||||
BOARD_DESIGN_SETTINGS* m_BoardSettings; // Link to current board design settings
|
||||
double m_Epoxy_Width; // Epoxy thickness (normalized)
|
||||
|
||||
double m_BoardScale; /* Normalization scale for coordinates:
|
||||
* when scaled between -1.0 and +1.0 */
|
||||
double m_LayerZcoord[32];
|
||||
double m_ActZpos;
|
||||
|
||||
public: Info_3D_Visu();
|
||||
~Info_3D_Visu();
|
||||
};
|
||||
|
||||
|
||||
class EDA_3D_CANVAS : public wxGLCanvas
|
||||
{
|
||||
public:
|
||||
EDA_3D_FRAME* m_Parent;
|
||||
|
||||
private:
|
||||
bool m_init;
|
||||
GLuint m_gllist;
|
||||
/// Tracks whether to use Orthographic or Perspective projection
|
||||
//TODO: Does this belong here, or in EDA_3D_FRAME ???
|
||||
bool m_ortho;
|
||||
|
||||
#if wxCHECK_VERSION( 2, 7, 0 )
|
||||
wxGLContext* m_glRC;
|
||||
#endif
|
||||
|
||||
public:
|
||||
EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList = 0 );
|
||||
~EDA_3D_CANVAS();
|
||||
|
||||
void ClearLists();
|
||||
|
||||
void OnPaint( wxPaintEvent& event );
|
||||
void OnEraseBackground( wxEraseEvent& event );
|
||||
void OnChar( wxKeyEvent& event );
|
||||
void OnMouseWheel( wxMouseEvent& event );
|
||||
void OnMouseMove( wxMouseEvent& event );
|
||||
void OnRightClick( wxMouseEvent& event );
|
||||
void OnPopUpMenu( wxCommandEvent& event );
|
||||
void TakeScreenshot( wxCommandEvent& event );
|
||||
void SetView3D( int keycode );
|
||||
void DisplayStatus();
|
||||
void Redraw( bool finish = false );
|
||||
GLuint DisplayCubeforTest();
|
||||
|
||||
void OnEnterWindow( wxMouseEvent& event );
|
||||
|
||||
void Render();
|
||||
GLuint CreateDrawGL_List();
|
||||
void InitGL();
|
||||
void SetLights();
|
||||
void Draw3D_Track( TRACK* track );
|
||||
|
||||
/**
|
||||
* Function Draw3D_SolidPolygonsInZones
|
||||
* draw all solid polygons used as filled areas in a zone
|
||||
* @param aZone = the zone to draw
|
||||
*/
|
||||
void Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone );
|
||||
|
||||
/**
|
||||
* Function Draw3D_Polygon
|
||||
* draw one solid polygon
|
||||
* @param aCornersList = a std::vector<wxPoint> list of corners, in physical coordinates
|
||||
* @param aZpos = the z position in 3D units
|
||||
*/
|
||||
void Draw3D_Polygon( std::vector<wxPoint>& aCornersList, double aZpos );
|
||||
void Draw3D_Via( SEGVIA* via );
|
||||
void Draw3D_DrawSegment( DRAWSEGMENT* segment );
|
||||
void Draw3D_DrawText( TEXTE_PCB* text );
|
||||
|
||||
/// Toggles ortographic projection on and off
|
||||
void ToggleOrtho(){ m_ortho = !m_ortho ; Refresh(true);};
|
||||
|
||||
/// Returns the orthographic projection flag
|
||||
bool ModeIsOrtho() { return m_ortho ;};
|
||||
|
||||
|
||||
//int Get3DLayerEnable(int act_layer);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
class EDA_3D_FRAME : public wxFrame
|
||||
{
|
||||
public:
|
||||
PCB_BASE_FRAME* m_Parent;
|
||||
private:
|
||||
wxString m_FrameName; // name used for writing and reading setup. It is "Frame3D"
|
||||
EDA_3D_CANVAS* m_Canvas;
|
||||
EDA_TOOLBAR* m_HToolBar;
|
||||
EDA_TOOLBAR* m_VToolBar;
|
||||
int m_InternalUnits;
|
||||
wxPoint m_FramePos;
|
||||
wxSize m_FrameSize;
|
||||
wxAuiManager m_auimgr;
|
||||
EDA_3D_CANVAS* m_canvas;
|
||||
bool m_reloadRequest;
|
||||
wxString m_defaultFileName; /// Filename to propose for screenshot
|
||||
/// Tracks whether to use Orthographic or Perspective projection
|
||||
bool m_ortho;
|
||||
|
||||
public:
|
||||
EDA_3D_FRAME( PCB_BASE_FRAME* parent, const wxString& title,
|
||||
@@ -225,14 +73,7 @@ public:
|
||||
m_auimgr.UnInit();
|
||||
};
|
||||
|
||||
void Exit3DFrame( wxCommandEvent& event );
|
||||
void OnCloseWindow( wxCloseEvent& Event );
|
||||
void ReCreateMenuBar();
|
||||
void ReCreateHToolbar();
|
||||
void ReCreateVToolbar();
|
||||
void SetToolbars();
|
||||
void GetSettings();
|
||||
void SaveSettings();
|
||||
PCB_BASE_FRAME* Parent() { return (PCB_BASE_FRAME*)GetParent(); }
|
||||
|
||||
/**
|
||||
* Function ReloadRequest
|
||||
@@ -245,36 +86,51 @@ public:
|
||||
m_reloadRequest = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function NewDisplay
|
||||
* Rebuild the display list.
|
||||
* must be called when 3D opengl data is modified
|
||||
*/
|
||||
void NewDisplay();
|
||||
|
||||
void SetDefaultFileName(const wxString &aFn) { m_defaultFileName = aFn; }
|
||||
const wxString &GetDefaultFileName() const { return m_defaultFileName; }
|
||||
|
||||
/// Toggles orthographic projection on and off
|
||||
void ToggleOrtho(){ m_ortho = !m_ortho ; Refresh(true);};
|
||||
|
||||
/// Returns the orthographic projection flag
|
||||
bool ModeIsOrtho() { return m_ortho ;};
|
||||
|
||||
private:
|
||||
// Event handlers:
|
||||
void Exit3DFrame( wxCommandEvent& event );
|
||||
void OnCloseWindow( wxCloseEvent& Event );
|
||||
void Process_Special_Functions( wxCommandEvent& event );
|
||||
void On3DGridSelection( wxCommandEvent& event );
|
||||
void Process_Zoom( wxCommandEvent& event );
|
||||
void OnActivate( wxActivateEvent& event );
|
||||
void Install_3D_ViewOptionDialog( wxCommandEvent& event );
|
||||
|
||||
// initialisation
|
||||
void CreateMenuBar();
|
||||
void SetMenuBarOptionsState(); // Set the state of toggle menus according
|
||||
// to the current display options
|
||||
void ReCreateMainToolbar();
|
||||
void SetToolbars();
|
||||
void GetSettings();
|
||||
void SaveSettings();
|
||||
|
||||
// Other functions
|
||||
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
||||
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
||||
void OnKeyEvent( wxKeyEvent& event );
|
||||
double BestZoom();
|
||||
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
|
||||
void Process_Special_Functions( wxCommandEvent& event );
|
||||
void Process_Zoom( wxCommandEvent& event );
|
||||
void OnActivate( wxActivateEvent& event );
|
||||
|
||||
void NewDisplay();
|
||||
void Set3DBgColor();
|
||||
void Set3DAxisOnOff();
|
||||
void Set3DModuleOnOff();
|
||||
void Set3DPlaceOnOff();
|
||||
void Set3DZoneOnOff();
|
||||
void Set3DCommentsOnOff();
|
||||
void Set3DDrawingsOnOff();
|
||||
void Set3DEco1OnOff();
|
||||
void Set3DEco2OnOff();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
void SetGLColor( int color );
|
||||
void Set_Object_Data( const S3D_Vertex* coord, int nbcoord );
|
||||
|
||||
extern Info_3D_Visu g_Parm_3D_Visu;
|
||||
extern double g_Draw3d_dx, g_Draw3d_dy;
|
||||
extern double ZBottom, ZTop;
|
||||
extern double DataScale3D; // 3D scale units.
|
||||
extern int gl_attrib[];
|
||||
|
||||
#endif /* __3D_VIEWER_H__ */
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* @file 3d_viewer_id.h
|
||||
*/
|
||||
|
||||
/**
|
||||
* Command IDs for the 3D viewer.
|
||||
*
|
||||
* Please add IDs that are unique to the 3D viewer here and not in the global
|
||||
* id.h file. This will prevent the entire project from being rebuilt when
|
||||
* adding new commands to the 3D viewer.
|
||||
*/
|
||||
|
||||
#include <id.h> // Generic Id.
|
||||
|
||||
enum id_3dview_frm
|
||||
{
|
||||
ID_START_COMMAND_3D = ID_END_LIST,
|
||||
ID_ROTATE3D_X_NEG,
|
||||
ID_ROTATE3D_X_POS,
|
||||
ID_ROTATE3D_Y_NEG,
|
||||
ID_ROTATE3D_Y_POS,
|
||||
ID_ROTATE3D_Z_NEG,
|
||||
ID_ROTATE3D_Z_POS,
|
||||
ID_RELOAD3D_BOARD,
|
||||
ID_TOOL_SCREENCOPY_TOCLIBBOARD,
|
||||
ID_MOVE3D_LEFT,
|
||||
ID_MOVE3D_RIGHT,
|
||||
ID_MOVE3D_UP,
|
||||
ID_MOVE3D_DOWN,
|
||||
ID_ORTHO,
|
||||
ID_MENU3D_BGCOLOR_SELECTION,
|
||||
ID_MENU3D_USE_COPPER_THICKNESS,
|
||||
ID_MENU3D_AXIS_ONOFF,
|
||||
ID_MENU3D_MODULE_ONOFF,
|
||||
ID_MENU3D_ZONE_ONOFF,
|
||||
ID_MENU3D_ADHESIVE_ONOFF,
|
||||
ID_MENU3D_SILKSCREEN_ONOFF,
|
||||
ID_MENU3D_SOLDER_PASTE_ONOFF,
|
||||
ID_MENU3D_SOLDER_MASK_ONOFF,
|
||||
ID_MENU3D_COMMENTS_ONOFF,
|
||||
ID_MENU3D_ECO_ONOFF,
|
||||
ID_MENU3D_SHOW_BOARD_BODY,
|
||||
ID_MENU3D_REALISTIC_MODE,
|
||||
ID_END_COMMAND_3D,
|
||||
|
||||
ID_TOOL_SET_VISIBLE_ITEMS,
|
||||
|
||||
ID_MENU3D_GRID,
|
||||
ID_MENU3D_GRID_NOGRID,
|
||||
ID_MENU3D_GRID_10_MM,
|
||||
ID_MENU3D_GRID_5_MM,
|
||||
ID_MENU3D_GRID_2P5_MM,
|
||||
ID_MENU3D_GRID_1_MM,
|
||||
ID_MENU3D_GRID_END,
|
||||
|
||||
ID_MENU_SCREENCOPY_PNG,
|
||||
ID_MENU_SCREENCOPY_JPEG,
|
||||
ID_MENU_SCREENCOPY_TOCLIBBOARD,
|
||||
|
||||
ID_POPUP_3D_VIEW_START,
|
||||
ID_POPUP_ZOOMIN,
|
||||
ID_POPUP_ZOOMOUT,
|
||||
ID_POPUP_VIEW_XPOS,
|
||||
ID_POPUP_VIEW_XNEG,
|
||||
ID_POPUP_VIEW_YPOS,
|
||||
ID_POPUP_VIEW_YNEG,
|
||||
ID_POPUP_VIEW_ZPOS,
|
||||
ID_POPUP_VIEW_ZNEG,
|
||||
ID_POPUP_MOVE3D_LEFT,
|
||||
ID_POPUP_MOVE3D_RIGHT,
|
||||
ID_POPUP_MOVE3D_UP,
|
||||
ID_POPUP_MOVE3D_DOWN,
|
||||
ID_POPUP_3D_VIEW_END
|
||||
};
|
||||
@@ -1,17 +1,27 @@
|
||||
add_definitions(-DPCBNEW)
|
||||
|
||||
include_directories(${Boost_INCLUDE_DIR}
|
||||
../pcbnew
|
||||
../polygon)
|
||||
include_directories(BEFORE ${INC_BEFORE})
|
||||
include_directories(
|
||||
../pcbnew
|
||||
../polygon
|
||||
${INC_AFTER}
|
||||
)
|
||||
|
||||
set(3D-VIEWER_SRCS
|
||||
dialogs/dialog_3D_view_option_base.cpp
|
||||
dialogs/dialog_3D_view_option.cpp
|
||||
3d_aux.cpp
|
||||
3d_canvas.cpp
|
||||
3d_class.cpp
|
||||
3d_draw.cpp
|
||||
3d_draw_basic_functions.cpp
|
||||
3d_frame.cpp
|
||||
3d_read_mesh.cpp
|
||||
3d_toolbar.cpp
|
||||
trackball.cpp)
|
||||
info3d_visu.cpp
|
||||
trackball.cpp
|
||||
x3dmodelparser.cpp
|
||||
vrmlmodelparser.cpp
|
||||
)
|
||||
|
||||
add_library(3d-viewer ${3D-VIEWER_SRCS})
|
||||
add_library(3d-viewer STATIC ${3D-VIEWER_SRCS})
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
|
||||
#include "dialog_3D_view_option_base.h"
|
||||
#include <3d_viewer.h>
|
||||
#include <info3d_visu.h>
|
||||
|
||||
class DIALOG_3D_VIEW_OPTIONS : public DIALOG_3D_VIEW_OPTIONS_BASE
|
||||
{
|
||||
public:
|
||||
DIALOG_3D_VIEW_OPTIONS( EDA_3D_FRAME* parent );
|
||||
|
||||
private:
|
||||
EDA_3D_FRAME* m_parent;
|
||||
INFO3D_VISU & m_3Dprms;
|
||||
|
||||
void initDialog();
|
||||
|
||||
// Event functions:
|
||||
void OnShowAllClick( wxCommandEvent& event );
|
||||
void OnShowNoneClick( wxCommandEvent& event );
|
||||
void OnOKClick( wxCommandEvent& event );
|
||||
};
|
||||
|
||||
void EDA_3D_FRAME::Install_3D_ViewOptionDialog( wxCommandEvent& event )
|
||||
{
|
||||
DIALOG_3D_VIEW_OPTIONS dlg( this );
|
||||
if( dlg.ShowModal() == wxID_OK )
|
||||
{
|
||||
SetMenuBarOptionsState();
|
||||
NewDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DIALOG_3D_VIEW_OPTIONS::DIALOG_3D_VIEW_OPTIONS( EDA_3D_FRAME* parent )
|
||||
:DIALOG_3D_VIEW_OPTIONS_BASE( parent ), m_3Dprms( g_Parm_3D_Visu )
|
||||
{
|
||||
m_parent = parent;
|
||||
|
||||
initDialog();
|
||||
|
||||
Layout();
|
||||
GetSizer()->SetSizeHints(this);
|
||||
Centre();
|
||||
}
|
||||
|
||||
void DIALOG_3D_VIEW_OPTIONS::initDialog()
|
||||
{
|
||||
m_bitmapCuThickness->SetBitmap( KiBitmap( use_3D_copper_thickness_xpm ) );
|
||||
m_bitmap3Dshapes->SetBitmap( KiBitmap( shape_3d_xpm ) );
|
||||
m_bitmapAreas->SetBitmap( KiBitmap( add_zone_xpm ) );
|
||||
m_bitmapSilkscreen->SetBitmap( KiBitmap( add_text_xpm ) );
|
||||
m_bitmapSolderMask->SetBitmap( KiBitmap( pads_mask_layers_xpm ) );
|
||||
m_bitmapSolderPaste->SetBitmap( KiBitmap( pads_mask_layers_xpm ) );
|
||||
m_bitmapAdhesive->SetBitmap( KiBitmap( tools_xpm ) );
|
||||
m_bitmapComments->SetBitmap( KiBitmap( edit_sheet_xpm ) );
|
||||
m_bitmapECO->SetBitmap( KiBitmap( edit_sheet_xpm ) );
|
||||
|
||||
// Check/uncheck checkboxes
|
||||
m_checkBoxCuThickness->SetValue( m_3Dprms.GetFlag( FL_USE_COPPER_THICKNESS ) );
|
||||
m_checkBox3Dshapes->SetValue( m_3Dprms.GetFlag( FL_MODULE ) );
|
||||
m_checkBoxAreas->SetValue( m_3Dprms.GetFlag( FL_ZONE ) );
|
||||
m_checkBoxSilkscreen->SetValue( m_3Dprms.GetFlag( FL_SILKSCREEN ) );
|
||||
m_checkBoxSolderMask->SetValue( m_3Dprms.GetFlag( FL_SOLDERMASK ) );
|
||||
m_checkBoxSolderpaste->SetValue( m_3Dprms.GetFlag( FL_SOLDERPASTE ) );
|
||||
m_checkBoxAdhesive->SetValue( m_3Dprms.GetFlag( FL_ADHESIVE ) );
|
||||
m_checkBoxComments->SetValue( m_3Dprms.GetFlag( FL_COMMENTS ) );
|
||||
m_checkBoxECO->SetValue( m_3Dprms.GetFlag( FL_ECO ) );
|
||||
}
|
||||
|
||||
void DIALOG_3D_VIEW_OPTIONS::OnShowAllClick( wxCommandEvent& event )
|
||||
{
|
||||
bool state = true;
|
||||
m_checkBoxCuThickness->SetValue( state );
|
||||
m_checkBox3Dshapes->SetValue( state );
|
||||
m_checkBoxAreas->SetValue( state );
|
||||
m_checkBoxSilkscreen->SetValue( state );
|
||||
m_checkBoxSolderMask->SetValue( state );
|
||||
m_checkBoxSolderpaste->SetValue( state );
|
||||
m_checkBoxAdhesive->SetValue( state );
|
||||
m_checkBoxComments->SetValue( state );
|
||||
m_checkBoxECO->SetValue( state );
|
||||
}
|
||||
|
||||
void DIALOG_3D_VIEW_OPTIONS::OnShowNoneClick( wxCommandEvent& event )
|
||||
{
|
||||
bool state = false;
|
||||
m_checkBoxCuThickness->SetValue( state );
|
||||
m_checkBox3Dshapes->SetValue( state );
|
||||
m_checkBoxAreas->SetValue( state );
|
||||
m_checkBoxSilkscreen->SetValue( state );
|
||||
m_checkBoxSolderMask->SetValue( state );
|
||||
m_checkBoxSolderpaste->SetValue( state );
|
||||
m_checkBoxAdhesive->SetValue( state );
|
||||
m_checkBoxComments->SetValue( state );
|
||||
m_checkBoxECO->SetValue( state );
|
||||
}
|
||||
|
||||
void DIALOG_3D_VIEW_OPTIONS::OnOKClick( wxCommandEvent& event )
|
||||
{
|
||||
m_3Dprms.SetFlag( FL_USE_COPPER_THICKNESS,
|
||||
m_checkBoxCuThickness->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_MODULE, m_checkBox3Dshapes->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_ZONE, m_checkBoxAreas->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_SILKSCREEN, m_checkBoxSilkscreen->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_SOLDERMASK, m_checkBoxSolderMask->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_SOLDERPASTE, m_checkBoxSolderpaste->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_ADHESIVE, m_checkBoxAdhesive->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_COMMENTS, m_checkBoxComments->GetValue() );
|
||||
m_3Dprms.SetFlag( FL_ECO, m_checkBoxECO->GetValue( ) );
|
||||
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 8 2012)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialog_3D_view_option_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxBoxSizer* bSizerLeft;
|
||||
bSizerLeft = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxFlexGridSizer* fgSizeShowOpts;
|
||||
fgSizeShowOpts = new wxFlexGridSizer( 9, 2, 0, 0 );
|
||||
fgSizeShowOpts->SetFlexibleDirection( wxBOTH );
|
||||
fgSizeShowOpts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_bitmapCuThickness = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_bitmapCuThickness, 0, wxALL, 5 );
|
||||
|
||||
m_checkBoxCuThickness = new wxCheckBox( this, wxID_ANY, _("Show copper thickness"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_checkBoxCuThickness, 0, wxALL, 5 );
|
||||
|
||||
m_bitmap3Dshapes = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_bitmap3Dshapes, 0, wxALL, 5 );
|
||||
|
||||
m_checkBox3Dshapes = new wxCheckBox( this, wxID_ANY, _("Show component 3D shapes"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_checkBox3Dshapes, 0, wxALL, 5 );
|
||||
|
||||
m_bitmapAreas = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_bitmapAreas, 0, wxALL, 5 );
|
||||
|
||||
m_checkBoxAreas = new wxCheckBox( this, wxID_ANY, _("Show filled areas in zones"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_checkBoxAreas, 0, wxALL, 5 );
|
||||
|
||||
m_bitmapSilkscreen = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_bitmapSilkscreen, 0, wxALL, 5 );
|
||||
|
||||
m_checkBoxSilkscreen = new wxCheckBox( this, wxID_ANY, _("Show silkscreen layers"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_checkBoxSilkscreen, 0, wxALL, 5 );
|
||||
|
||||
m_bitmapSolderMask = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_bitmapSolderMask, 0, wxALL, 5 );
|
||||
|
||||
m_checkBoxSolderMask = new wxCheckBox( this, wxID_ANY, _("Show solder mask layers"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_checkBoxSolderMask, 0, wxALL, 5 );
|
||||
|
||||
m_bitmapSolderPaste = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_bitmapSolderPaste, 0, wxALL, 5 );
|
||||
|
||||
m_checkBoxSolderpaste = new wxCheckBox( this, wxID_ANY, _("Show solder paste layers"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_checkBoxSolderpaste, 0, wxALL, 5 );
|
||||
|
||||
m_bitmapAdhesive = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_bitmapAdhesive, 0, wxALL, 5 );
|
||||
|
||||
m_checkBoxAdhesive = new wxCheckBox( this, wxID_ANY, _("Show adhesive layers"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_checkBoxAdhesive, 0, wxALL, 5 );
|
||||
|
||||
m_bitmapComments = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_bitmapComments, 0, wxALL, 5 );
|
||||
|
||||
m_checkBoxComments = new wxCheckBox( this, wxID_ANY, _("Show comments and drawings Layers"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_checkBoxComments, 0, wxALL, 5 );
|
||||
|
||||
m_bitmapECO = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_bitmapECO, 0, wxALL, 5 );
|
||||
|
||||
m_checkBoxECO = new wxCheckBox( this, wxID_ANY, _("Show ECOs layers"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizeShowOpts->Add( m_checkBoxECO, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizerLeft->Add( fgSizeShowOpts, 1, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizerRight;
|
||||
bSizerRight = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_buttonShowAll = new wxButton( this, wxID_ANY, _("Show All"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonShowAll, 0, wxALL, 5 );
|
||||
|
||||
m_buttonShowNone = new wxButton( this, wxID_ANY, _("Show None"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerRight->Add( m_buttonShowNone, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizerLeft->Add( bSizerRight, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( bSizerLeft, 1, wxEXPAND, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
this->Layout();
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
// Connect Events
|
||||
m_buttonShowAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowAllClick ), NULL, this );
|
||||
m_buttonShowNone->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowNoneClick ), NULL, this );
|
||||
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnCancelClick ), NULL, this );
|
||||
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnOKClick ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_3D_VIEW_OPTIONS_BASE::~DIALOG_3D_VIEW_OPTIONS_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_buttonShowAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowAllClick ), NULL, this );
|
||||
m_buttonShowNone->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnShowNoneClick ), NULL, this );
|
||||
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnCancelClick ), NULL, this );
|
||||
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_3D_VIEW_OPTIONS_BASE::OnOKClick ), NULL, this );
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,82 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 8 2012)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIALOG_3D_VIEW_OPTION_BASE_H__
|
||||
#define __DIALOG_3D_VIEW_OPTION_BASE_H__
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class DIALOG_SHIM;
|
||||
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/statbmp.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_3D_VIEW_OPTIONS_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class DIALOG_3D_VIEW_OPTIONS_BASE : public DIALOG_SHIM
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxStaticBitmap* m_bitmapCuThickness;
|
||||
wxCheckBox* m_checkBoxCuThickness;
|
||||
wxStaticBitmap* m_bitmap3Dshapes;
|
||||
wxCheckBox* m_checkBox3Dshapes;
|
||||
wxStaticBitmap* m_bitmapAreas;
|
||||
wxCheckBox* m_checkBoxAreas;
|
||||
wxStaticBitmap* m_bitmapSilkscreen;
|
||||
wxCheckBox* m_checkBoxSilkscreen;
|
||||
wxStaticBitmap* m_bitmapSolderMask;
|
||||
wxCheckBox* m_checkBoxSolderMask;
|
||||
wxStaticBitmap* m_bitmapSolderPaste;
|
||||
wxCheckBox* m_checkBoxSolderpaste;
|
||||
wxStaticBitmap* m_bitmapAdhesive;
|
||||
wxCheckBox* m_checkBoxAdhesive;
|
||||
wxStaticBitmap* m_bitmapComments;
|
||||
wxCheckBox* m_checkBoxComments;
|
||||
wxStaticBitmap* m_bitmapECO;
|
||||
wxCheckBox* m_checkBoxECO;
|
||||
wxButton* m_buttonShowAll;
|
||||
wxButton* m_buttonShowNone;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxStdDialogButtonSizer* m_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
wxButton* m_sdbSizerCancel;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnShowAllClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnShowNoneClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("3D Display Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 340,344 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_3D_VIEW_OPTIONS_BASE();
|
||||
|
||||
};
|
||||
|
||||
#endif //__DIALOG_3D_VIEW_OPTION_BASE_H__
|
||||
@@ -0,0 +1,202 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2011 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file info3d_visu.cpp
|
||||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#include <class_board_design_settings.h>
|
||||
#include <class_board.h>
|
||||
|
||||
#include <3d_viewer.h>
|
||||
#include <info3d_visu.h>
|
||||
#include <trackball.h>
|
||||
|
||||
// Thickness of copper
|
||||
// TODO: define the actual copper thickness by user
|
||||
#define COPPER_THICKNESS KiROUND( 0.035 * IU_PER_MM ) // for 35 um
|
||||
#define TECH_LAYER_THICKNESS KiROUND( 0.04 * IU_PER_MM )
|
||||
#define EPOXY_THICKNESS KiROUND( 1.6 * IU_PER_MM ) // for 1.6 mm
|
||||
|
||||
|
||||
/* INFO3D_VISU in an helper class to store parameters like scaling factors,
|
||||
* board size, Z coordinates of layers ...
|
||||
* to create the 3D GLList
|
||||
*/
|
||||
INFO3D_VISU::INFO3D_VISU()
|
||||
{
|
||||
int ii;
|
||||
|
||||
m_Beginx = m_Beginy = 0.0; // position of mouse
|
||||
m_Zoom = 1.0;
|
||||
m_3D_Grid = 10.0; // Grid value in mm
|
||||
trackball( m_Quat, 0.0, 0.0, 0.0, 0.0 );
|
||||
|
||||
for( ii = 0; ii < 4; ii++ )
|
||||
m_Rot[ii] = 0.0;
|
||||
|
||||
m_CopperLayersCount = 2;
|
||||
m_BoardSettings = NULL;
|
||||
m_CopperThickness = 0;
|
||||
m_EpoxyThickness = 0;
|
||||
m_NonCopperLayerThickness = 0;
|
||||
|
||||
// default all special item layers Visible
|
||||
for( ii = 0; ii < FL_LAST; ii++ )
|
||||
m_drawFlags[ii] = true;
|
||||
|
||||
SetFlag( FL_GRID, false );
|
||||
SetFlag( FL_USE_COPPER_THICKNESS, false );
|
||||
}
|
||||
|
||||
|
||||
INFO3D_VISU::~INFO3D_VISU()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* Initialize info 3D Parameters from aBoard
|
||||
*/
|
||||
void INFO3D_VISU::InitSettings( BOARD* aBoard )
|
||||
{
|
||||
EDA_RECT bbbox = aBoard->ComputeBoundingBox( false );
|
||||
|
||||
if( bbbox.GetWidth() == 0 && bbbox.GetHeight() == 0 )
|
||||
{
|
||||
bbbox.SetWidth( 100 * IU_PER_MM );
|
||||
bbbox.SetHeight( 100 * IU_PER_MM );
|
||||
}
|
||||
|
||||
m_BoardSettings = &aBoard->GetDesignSettings();
|
||||
|
||||
m_BoardSize = bbbox.GetSize();
|
||||
m_BoardPos = bbbox.Centre();
|
||||
|
||||
m_BoardPos.y = -m_BoardPos.y;
|
||||
m_CopperLayersCount = aBoard->GetCopperLayerCount();
|
||||
|
||||
// Ensure the board has 2 sides for 3D views, because it is hard to find
|
||||
// a *really* single side board in the true life...
|
||||
if( m_CopperLayersCount < 2 )
|
||||
m_CopperLayersCount = 2;
|
||||
|
||||
m_BiuTo3Dunits = 2.0 / std::max( m_BoardSize.x, m_BoardSize.y );
|
||||
|
||||
m_EpoxyThickness = aBoard->GetDesignSettings().GetBoardThickness() * m_BiuTo3Dunits;
|
||||
|
||||
// TODO use value defined by user (currently use default values by ctor
|
||||
m_CopperThickness = COPPER_THICKNESS * m_BiuTo3Dunits;
|
||||
m_NonCopperLayerThickness = TECH_LAYER_THICKNESS * m_BiuTo3Dunits;
|
||||
|
||||
// Init Z position of each layer
|
||||
// calculate z position for each copper layer
|
||||
int layer;
|
||||
int copper_layers_cnt = m_CopperLayersCount;
|
||||
|
||||
for( layer = 0; layer < copper_layers_cnt; layer++ )
|
||||
{
|
||||
m_LayerZcoord[layer] =
|
||||
m_EpoxyThickness * layer / (copper_layers_cnt - 1);
|
||||
}
|
||||
|
||||
#define layerThicknessMargin 1.1
|
||||
double zpos_offset = m_NonCopperLayerThickness * layerThicknessMargin;
|
||||
double zpos_copper_back = m_LayerZcoord[0] - layerThicknessMargin*m_CopperThickness/2;
|
||||
double zpos_copper_front = m_EpoxyThickness + layerThicknessMargin*m_CopperThickness/2;
|
||||
|
||||
// Fill remaining unused copper layers and front layer zpos
|
||||
// with m_EpoxyThickness
|
||||
for( ; layer <= LAST_COPPER_LAYER; layer++ )
|
||||
{
|
||||
m_LayerZcoord[layer] = m_EpoxyThickness;
|
||||
}
|
||||
|
||||
// calculate z position for each non copper layer
|
||||
for( int layer_id = FIRST_NON_COPPER_LAYER; layer_id < NB_PCB_LAYERS; layer_id++ )
|
||||
{
|
||||
double zpos;
|
||||
|
||||
switch( layer_id )
|
||||
{
|
||||
case ADHESIVE_N_BACK:
|
||||
zpos = zpos_copper_back - 4 * zpos_offset;
|
||||
break;
|
||||
|
||||
case ADHESIVE_N_FRONT:
|
||||
zpos = zpos_copper_front + 4 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SOLDERPASTE_N_BACK:
|
||||
zpos = zpos_copper_back - 3 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SOLDERPASTE_N_FRONT:
|
||||
zpos = zpos_copper_front + 3 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SOLDERMASK_N_BACK:
|
||||
zpos = zpos_copper_back - 1 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SOLDERMASK_N_FRONT:
|
||||
zpos = zpos_copper_front + 1 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SILKSCREEN_N_BACK:
|
||||
zpos = zpos_copper_back - 2 * zpos_offset;
|
||||
break;
|
||||
|
||||
case SILKSCREEN_N_FRONT:
|
||||
zpos = zpos_copper_front + 2 * zpos_offset;
|
||||
break;
|
||||
|
||||
default:
|
||||
zpos = zpos_copper_front +
|
||||
(layer_id - FIRST_NON_COPPER_LAYER + 5) * zpos_offset;
|
||||
break;
|
||||
}
|
||||
|
||||
m_LayerZcoord[layer_id] = zpos;
|
||||
}
|
||||
}
|
||||
|
||||
/* return the Z position of 3D shapes, in 3D Units
|
||||
* aIsFlipped: true for modules on Front (top) layer, false
|
||||
* if on back (bottom) layer
|
||||
* Note: in draw functions, the copper has a thickness = m_CopperThickness
|
||||
* Vias and tracks are draw with the top side position = m_CopperThickness/2
|
||||
* and the bottom side position = -m_CopperThickness/2 from the Z layer position
|
||||
*/
|
||||
double INFO3D_VISU::GetModulesZcoord3DIU( bool aIsFlipped )
|
||||
{
|
||||
if( aIsFlipped )
|
||||
return m_LayerZcoord[LAYER_N_BACK] - ( m_CopperThickness / 2 );
|
||||
else
|
||||
return m_LayerZcoord[LAYER_N_FRONT] + ( m_CopperThickness / 2 );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file info3d_visu.h
|
||||
*/
|
||||
|
||||
#ifndef __INFO3D_VISU_H__
|
||||
#define __INFO3D_VISU_H__
|
||||
|
||||
#include <layers_id_colors_and_visibility.h> // Layers id definitions
|
||||
|
||||
#include <wx/glcanvas.h>
|
||||
|
||||
#ifdef __WXMAC__
|
||||
# ifdef __DARWIN__
|
||||
# include <OpenGL/glu.h>
|
||||
# else
|
||||
# include <glu.h>
|
||||
# endif
|
||||
#else
|
||||
# include <GL/glu.h>
|
||||
#endif
|
||||
|
||||
#include <3d_struct.h>
|
||||
|
||||
#define m_ROTX m_Rot[0]
|
||||
#define m_ROTY m_Rot[1]
|
||||
#define m_ROTZ m_Rot[2]
|
||||
|
||||
class BOARD_DESIGN_SETTINGS;
|
||||
|
||||
class S3D_COLOR /* 3D color (R, G, B) 3 floats range 0 to 1.0*/
|
||||
{
|
||||
public:
|
||||
double m_Red, m_Green, m_Blue;
|
||||
public: S3D_COLOR()
|
||||
{
|
||||
m_Red = m_Green = m_Blue = 0;
|
||||
}
|
||||
};
|
||||
|
||||
/* information needed to display 3D board */
|
||||
enum DISPLAY3D_FLG {
|
||||
FL_AXIS=0, FL_MODULE, FL_ZONE,
|
||||
FL_ADHESIVE, FL_SILKSCREEN, FL_SOLDERMASK, FL_SOLDERPASTE,
|
||||
FL_COMMENTS, FL_ECO,
|
||||
FL_GRID,
|
||||
FL_USE_COPPER_THICKNESS,
|
||||
FL_SHOW_BOARD_BODY,
|
||||
FL_USE_REALISTIC_MODE,
|
||||
FL_LAST
|
||||
};
|
||||
|
||||
|
||||
class INFO3D_VISU
|
||||
{
|
||||
public:
|
||||
double m_Beginx, m_Beginy; // position of mouse (used in drag commands)
|
||||
double m_Quat[4]; // orientation of 3D view
|
||||
double m_Rot[4]; // rotation parameters of 3D view
|
||||
double m_Zoom; // 3D zoom value
|
||||
double m_3D_Grid; // 3D grid value, in mm
|
||||
S3D_COLOR m_BgColor;
|
||||
wxPoint m_BoardPos; // center board actual position in board units
|
||||
wxSize m_BoardSize; // board actual size in board units
|
||||
int m_CopperLayersCount; // Number of copper layers actually used by the board
|
||||
|
||||
const BOARD_DESIGN_SETTINGS* m_BoardSettings; // Link to current board design settings
|
||||
|
||||
double m_BiuTo3Dunits; // Normalization scale to convert board
|
||||
// internal units to 3D units
|
||||
// to scale 3D units between -1.0 and +1.0
|
||||
double m_CurrentZpos; // temporary storage of current value of Z position,
|
||||
// used in some calculation
|
||||
private:
|
||||
double m_LayerZcoord[NB_LAYERS]; // Z position of each layer (normalized)
|
||||
double m_CopperThickness; // Copper thickness (normalized)
|
||||
double m_EpoxyThickness; // Epoxy thickness (normalized)
|
||||
double m_NonCopperLayerThickness; // Non copper layers thickness
|
||||
bool m_drawFlags[FL_LAST]; // Enable/disable flags (see DISPLAY3D_FLG list)
|
||||
|
||||
public: INFO3D_VISU();
|
||||
~INFO3D_VISU();
|
||||
|
||||
// Accessors
|
||||
bool GetFlag( DISPLAY3D_FLG aFlag ) const { return m_drawFlags[aFlag]; }
|
||||
bool SetFlag( DISPLAY3D_FLG aFlag, bool aState )
|
||||
{
|
||||
return m_drawFlags[aFlag] = aState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function InitSettings
|
||||
* Initialize info 3D Parameters from aBoard
|
||||
* @param aBoard: the board to display
|
||||
*/
|
||||
void InitSettings( BOARD* aBoard );
|
||||
|
||||
/**
|
||||
* function GetModulesZcoord3DIU
|
||||
* @return the Z position of 3D shapes, in 3D Units
|
||||
* @param aIsFlipped: true for modules on Front (top) layer, false
|
||||
* if on back (bottom) layer
|
||||
*/
|
||||
double GetModulesZcoord3DIU( bool aIsFlipped );
|
||||
|
||||
/**
|
||||
* function GetLayerZcoordBIU
|
||||
* @return the Z coordinate of the layer aLayer, in Board Internal Units
|
||||
* @param aLayerId: the layer number
|
||||
*/
|
||||
int GetLayerZcoordBIU( int aLayerId )
|
||||
{
|
||||
return KiROUND( m_LayerZcoord[aLayerId] / m_BiuTo3Dunits );
|
||||
}
|
||||
|
||||
/**
|
||||
* function GetCopperThicknessBIU
|
||||
* @return the thickness (Z size) of the copper, in Board Internal Units
|
||||
* note: the thickness (Z size) of the copper is not the thickness
|
||||
* of the layer (the thickness of the layer is the epoxy thickness / layer count)
|
||||
*
|
||||
* Note: if m_drawFlags[FL_USE_COPPER_THICKNESS] is not set,
|
||||
* and normal mode, returns 0
|
||||
*/
|
||||
int GetCopperThicknessBIU() const
|
||||
{
|
||||
bool use_copper_thickness = GetFlag( FL_USE_COPPER_THICKNESS ) ||
|
||||
GetFlag( FL_USE_REALISTIC_MODE );
|
||||
return use_copper_thickness ?
|
||||
KiROUND( m_CopperThickness / m_BiuTo3Dunits )
|
||||
: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* function GetEpoxyThicknessBIU
|
||||
* @return the thickness (Z size) of the epoxy board, in Board Internal Units
|
||||
*/
|
||||
int GetEpoxyThicknessBIU() const
|
||||
{
|
||||
return KiROUND( m_EpoxyThickness / m_BiuTo3Dunits );
|
||||
}
|
||||
|
||||
/**
|
||||
* function GetNonCopperLayerThicknessBIU
|
||||
* @return the thickness (Z size) of a technical layer,
|
||||
* in Board Internal Units
|
||||
*
|
||||
* Note: if m_drawFlags[FL_USE_COPPER_THICKNESS] is not set, returns 0
|
||||
*/
|
||||
int GetNonCopperLayerThicknessBIU() const
|
||||
{
|
||||
bool use_copper_thickness = GetFlag( FL_USE_COPPER_THICKNESS ) ||
|
||||
GetFlag( FL_USE_REALISTIC_MODE );
|
||||
return use_copper_thickness ?
|
||||
KiROUND( m_NonCopperLayerThickness / m_BiuTo3Dunits )
|
||||
: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* function GetNonCopperLayerThicknessBIU
|
||||
* @return the thickness (Z size) of the copper or a technical layer,
|
||||
* in Board Internal Units, depending on the layer id
|
||||
*
|
||||
* Note: if m_drawFlags[FL_USE_COPPER_THICKNESS] is not set, returns 0
|
||||
*/
|
||||
int GetLayerObjectThicknessBIU( int aLayerId) const
|
||||
{
|
||||
return aLayerId >= FIRST_NON_COPPER_LAYER ?
|
||||
GetNonCopperLayerThicknessBIU() :
|
||||
GetCopperThicknessBIU();
|
||||
}
|
||||
|
||||
bool IsRealisticMode() { return GetFlag( FL_USE_REALISTIC_MODE ); }
|
||||
};
|
||||
|
||||
extern INFO3D_VISU g_Parm_3D_Visu;
|
||||
|
||||
#endif /* __INFO3D_VISU_H__ */
|
||||
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013 Tuomas Vaherkoski <tuomasvaherkoski@gmail.com>
|
||||
* Copyright (C) 1992-2013 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file modelparsers.h
|
||||
*/
|
||||
|
||||
#ifndef MODELPARSERS_H
|
||||
#define MODELPARSERS_H
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <wx/string.h>
|
||||
|
||||
|
||||
class S3D_MASTER;
|
||||
class S3D_VERTEX;
|
||||
|
||||
extern void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );
|
||||
|
||||
class S3D_MODEL_PARSER;
|
||||
class X3D_MODEL_PARSER;
|
||||
|
||||
/**
|
||||
* abstract class S3D_MODEL_PARSER
|
||||
* Base class for 3D model parsers.
|
||||
*/
|
||||
class S3D_MODEL_PARSER
|
||||
{
|
||||
public:
|
||||
S3D_MODEL_PARSER(S3D_MASTER* aMaster) :
|
||||
master( aMaster )
|
||||
{}
|
||||
|
||||
virtual ~S3D_MODEL_PARSER()
|
||||
{}
|
||||
|
||||
S3D_MASTER* GetMaster()
|
||||
{
|
||||
return master;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function Create
|
||||
* Factory method for creating concrete 3D model parsers
|
||||
* Notice that the caller is responsible to delete created parser.
|
||||
*
|
||||
* @param aMaster is master object that the parser will fill.
|
||||
* @param aExtension is file extension of the file you are going to parse.
|
||||
*/
|
||||
static S3D_MODEL_PARSER* Create( S3D_MASTER* aMaster, const wxString aExtension );
|
||||
/**
|
||||
* Function Load
|
||||
*
|
||||
* Concrete parsers should implement this function
|
||||
*/
|
||||
virtual void Load( const wxString aFilename ) = 0;
|
||||
|
||||
private:
|
||||
S3D_MASTER* master;
|
||||
};
|
||||
|
||||
|
||||
class wxXmlNode;
|
||||
|
||||
/**
|
||||
* class X3D_MODEL_PARSER
|
||||
* Implements parser for X3D file format (VRML2.0 successor)
|
||||
* X3D files can be exported from eg. Blender */
|
||||
class X3D_MODEL_PARSER: public S3D_MODEL_PARSER
|
||||
{
|
||||
public:
|
||||
X3D_MODEL_PARSER( S3D_MASTER* aMaster );
|
||||
~X3D_MODEL_PARSER();
|
||||
void Load( const wxString aFilename );
|
||||
|
||||
typedef std::map< wxString, wxString > PROPERTY_MAP;
|
||||
typedef std::vector< wxXmlNode* > NODE_LIST;
|
||||
|
||||
/**
|
||||
* Function GetChildsByName
|
||||
* Searches all child nodes with aName.
|
||||
*
|
||||
* @param aParent is node to search from
|
||||
* @param aName is the name of node you try to find
|
||||
* @param aResult contains found nodes
|
||||
*/
|
||||
static void GetChildsByName( wxXmlNode* aParent, const wxString aName, NODE_LIST& aResult );
|
||||
|
||||
/**
|
||||
* Function GetNodeProperties
|
||||
* Collects all node properties to map.
|
||||
*
|
||||
* @param aNode is an XML node.
|
||||
* @param aProps contains map of found properties.
|
||||
*/
|
||||
static void GetNodeProperties( wxXmlNode* aNode, PROPERTY_MAP& aProps );
|
||||
|
||||
/**
|
||||
* Return string representing x3d file in vrml format
|
||||
* Function Load must be called before this function, otherwise empty
|
||||
* data set is returned.
|
||||
*/
|
||||
wxString VRML_representation();
|
||||
|
||||
private:
|
||||
std::vector< wxString > vrml_materials;
|
||||
std::vector< wxString > vrml_points;
|
||||
std::vector< wxString > vrml_coord_indexes;
|
||||
|
||||
void readTransform( wxXmlNode* aTransformNode );
|
||||
void readMaterial( wxXmlNode* aMatNode );
|
||||
void readIndexedFaceSet( wxXmlNode* aFaceNode, PROPERTY_MAP& aTransfromProps );
|
||||
bool parseDoubleTriplet( const wxString& aData, S3D_VERTEX& aResult );
|
||||
|
||||
void rotate( S3D_VERTEX& aCoordinate, S3D_VERTEX& aRotAxis, double angle );
|
||||
};
|
||||
|
||||
/**
|
||||
* class WRL_MODEL_PARSER
|
||||
* Parses
|
||||
*/
|
||||
class VRML_MODEL_PARSER: public S3D_MODEL_PARSER
|
||||
{
|
||||
public:
|
||||
VRML_MODEL_PARSER( S3D_MASTER* aMaster );
|
||||
~VRML_MODEL_PARSER();
|
||||
void Load( const wxString aFilename );
|
||||
|
||||
private:
|
||||
/**
|
||||
* Function ReadMaterial
|
||||
* read the description of a 3D material definition in the form:
|
||||
* DEF yellow material Material (
|
||||
* DiffuseColor 1.00000 1.00000 0.00000e 0
|
||||
* EmissiveColor 0.00000e 0 0.00000e 0 0.00000e 0
|
||||
* SpecularColor 1.00000 1.00000 1.00000
|
||||
* AmbientIntensity 1.00000
|
||||
* Transparency 0.00000e 0
|
||||
* Shininess 1.00000
|
||||
*)
|
||||
* Or type:
|
||||
* USE yellow material
|
||||
*/
|
||||
int readMaterial( FILE* file, int* LineNum );
|
||||
int readChildren( FILE* file, int* LineNum );
|
||||
int readShape( FILE* file, int* LineNum );
|
||||
int readAppearance( FILE* file, int* LineNum );
|
||||
int readGeometry( FILE* file, int* LineNum );
|
||||
|
||||
/**
|
||||
* Function ReadCoordList
|
||||
* reads 3D coordinate lists like:
|
||||
* coord Coordinate { point [
|
||||
* -5.24489 6.57640e-3 -9.42129e-2,
|
||||
* -5.11821 6.57421e-3 0.542654,
|
||||
* -3.45868 0.256565 1.32000 ] }
|
||||
* or:
|
||||
* normal Normal { vector [
|
||||
* 0.995171 -6.08102e-6 9.81541e-2,
|
||||
* 0.923880 -4.09802e-6 0.382683,
|
||||
* 0.707107 -9.38186e-7 0.707107]
|
||||
* }
|
||||
*
|
||||
* text_buffer contains the first line of this node :
|
||||
* "coord Coordinate { point ["
|
||||
*/
|
||||
void readCoordsList( FILE* file, char* text_buffer, std::vector< double >& aList,
|
||||
int* LineNum );
|
||||
};
|
||||
|
||||
#endif // MODELPARSERS_H
|
||||
@@ -49,9 +49,9 @@
|
||||
* Much mucking with by:
|
||||
* Gavin Bell
|
||||
*/
|
||||
#include <math.h>
|
||||
#include "wx/glcanvas.h" // used only to define GLfloat
|
||||
#include "trackball.h"
|
||||
#include <cmath>
|
||||
#include <wx/glcanvas.h> // used only to define GLfloat
|
||||
#include <trackball.h>
|
||||
|
||||
/*
|
||||
* This size should really be based on the distance from the center of
|
||||
|
||||
@@ -0,0 +1,546 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013 Tuomas Vaherkoski <tuomasvaherkoski@gmail.com>
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras@wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file vrmlmodelparser.cpp
|
||||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <vector>
|
||||
#include <macros.h>
|
||||
#include <kicad_string.h>
|
||||
#include <info3d_visu.h>
|
||||
|
||||
#include "3d_struct.h"
|
||||
#include "modelparsers.h"
|
||||
|
||||
// separator chars
|
||||
static const char* sep_chars = " \t\n\r";
|
||||
|
||||
VRML_MODEL_PARSER::VRML_MODEL_PARSER( S3D_MASTER* aMaster ) :
|
||||
S3D_MODEL_PARSER( aMaster )
|
||||
{}
|
||||
|
||||
|
||||
VRML_MODEL_PARSER::~VRML_MODEL_PARSER()
|
||||
{}
|
||||
|
||||
|
||||
void VRML_MODEL_PARSER::Load( const wxString aFilename )
|
||||
{
|
||||
char line[1024], * text;
|
||||
FILE* file;
|
||||
int LineNum = 0;
|
||||
|
||||
file = wxFopen( aFilename, wxT( "rt" ) );
|
||||
|
||||
if( file == NULL )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
|
||||
SetLocaleTo_C_standard();
|
||||
|
||||
while( GetLine( file, line, &LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, sep_chars );
|
||||
|
||||
if( stricmp( text, "DEF" ) == 0 || stricmp( text, "Group" ) == 0 )
|
||||
{
|
||||
while( GetLine( file, line, &LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, sep_chars );
|
||||
|
||||
if( text == NULL )
|
||||
continue;
|
||||
|
||||
if( *text == '}' )
|
||||
break;
|
||||
|
||||
if( stricmp( text, "children" ) == 0 )
|
||||
{
|
||||
readChildren( file, &LineNum );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose( file );
|
||||
SetLocaleTo_Default(); // revert to the current locale
|
||||
}
|
||||
|
||||
|
||||
int VRML_MODEL_PARSER::readMaterial( FILE* file, int* LineNum )
|
||||
{
|
||||
char line[512], * text, * command;
|
||||
wxString mat_name;
|
||||
S3D_MATERIAL* material = NULL;
|
||||
|
||||
command = strtok( NULL, sep_chars );
|
||||
text = strtok( NULL, sep_chars );
|
||||
mat_name = FROM_UTF8( text );
|
||||
|
||||
if( stricmp( command, "USE" ) == 0 )
|
||||
{
|
||||
for( material = GetMaster()->m_Materials; material; material = material->Next() )
|
||||
{
|
||||
if( material->m_Name == mat_name )
|
||||
{
|
||||
material->SetMaterial();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
DBG( printf( "ReadMaterial error: material not found\n" ) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( stricmp( command, "DEF" ) == 0 || stricmp( command, "Material") == 0)
|
||||
{
|
||||
material = new S3D_MATERIAL( GetMaster(), mat_name );
|
||||
|
||||
GetMaster()->Insert( material );
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, sep_chars );
|
||||
|
||||
if( text == NULL )
|
||||
continue;
|
||||
|
||||
if( text[0] == '}' )
|
||||
{
|
||||
material->SetMaterial();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( stricmp( text, "diffuseColor" ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_DiffuseColor.x = atof( text );
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_DiffuseColor.y = atof( text );
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_DiffuseColor.z = atof( text );
|
||||
}
|
||||
else if( stricmp( text, "emissiveColor" ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_EmissiveColor.x = atof( text );
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_EmissiveColor.y = atof( text );
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_EmissiveColor.z = atof( text );
|
||||
}
|
||||
else if( strnicmp( text, "specularColor", 13 ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_SpecularColor.x = atof( text );
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_SpecularColor.y = atof( text );
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_SpecularColor.z = atof( text );
|
||||
}
|
||||
else if( strnicmp( text, "ambientIntensity", 16 ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_AmbientIntensity = atof( text );
|
||||
}
|
||||
else if( strnicmp( text, "transparency", 12 ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_Transparency = atof( text );
|
||||
}
|
||||
else if( strnicmp( text, "shininess", 9 ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, sep_chars );
|
||||
material->m_Shininess = atof( text );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int VRML_MODEL_PARSER::readChildren( FILE* file, int* LineNum )
|
||||
{
|
||||
char line[1024], * text;
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, sep_chars );
|
||||
|
||||
if( *text == ']' )
|
||||
return 0;
|
||||
|
||||
if( *text == ',' )
|
||||
continue;
|
||||
|
||||
if( stricmp( text, "Shape" ) == 0 )
|
||||
{
|
||||
readShape( file, LineNum );
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG( printf( "ReadChildren error line %d <%s> \n", *LineNum, text ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int VRML_MODEL_PARSER::readShape( FILE* file, int* LineNum )
|
||||
{
|
||||
char line[1024], * text;
|
||||
int err = 1;
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, sep_chars );
|
||||
|
||||
if( *text == '}' )
|
||||
{
|
||||
err = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if( stricmp( text, "appearance" ) == 0 )
|
||||
{
|
||||
readAppearance( file, LineNum );
|
||||
}
|
||||
else if( stricmp( text, "geometry" ) == 0 )
|
||||
{
|
||||
readGeometry( file, LineNum );
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG( printf( "ReadShape error line %d <%s> \n", *LineNum, text ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
int VRML_MODEL_PARSER::readAppearance( FILE* file, int* LineNum )
|
||||
{
|
||||
char line[1024], * text;
|
||||
int err = 1;
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, sep_chars );
|
||||
|
||||
if( *text == '}' )
|
||||
{
|
||||
err = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if( stricmp( text, "material" ) == 0 )
|
||||
{
|
||||
readMaterial( file, LineNum );
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG( printf( "ReadAppearance error line %d <%s> \n", *LineNum, text ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
#define BUFSIZE 2000
|
||||
|
||||
void VRML_MODEL_PARSER::readCoordsList( FILE* file, char* text_buffer,
|
||||
std::vector< double >& aList, int* LineNum )
|
||||
{
|
||||
unsigned int ii = 0, jj = 0;
|
||||
char* text;
|
||||
bool HasData = false;
|
||||
bool StartData = false;
|
||||
bool EndNode = false;
|
||||
char string_num[512];
|
||||
|
||||
text = text_buffer;
|
||||
|
||||
while( !EndNode )
|
||||
{
|
||||
if( *text == 0 ) // Needs data !
|
||||
{
|
||||
text = text_buffer;
|
||||
GetLine( file, text_buffer, LineNum, 512 );
|
||||
}
|
||||
|
||||
while( !EndNode && *text )
|
||||
{
|
||||
switch( *text )
|
||||
{
|
||||
case '[':
|
||||
StartData = true;
|
||||
jj = 0;
|
||||
string_num[jj] = 0;
|
||||
break;
|
||||
|
||||
case '}':
|
||||
EndNode = true;
|
||||
break;
|
||||
|
||||
case ']':
|
||||
case '\t':
|
||||
case ' ':
|
||||
case ',':
|
||||
jj = 0;
|
||||
|
||||
if( !StartData || !HasData )
|
||||
break;
|
||||
|
||||
aList.push_back( atof( string_num ) );
|
||||
string_num[jj] = 0;
|
||||
ii++;
|
||||
|
||||
HasData = false;
|
||||
|
||||
if( *text == ']' )
|
||||
{
|
||||
StartData = false;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
if( !StartData )
|
||||
break;
|
||||
|
||||
if( jj >= sizeof( string_num ) )
|
||||
break;
|
||||
|
||||
string_num[jj] = *text;
|
||||
jj++;
|
||||
string_num[jj] = 0;
|
||||
HasData = true;
|
||||
break;
|
||||
}
|
||||
|
||||
text++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int VRML_MODEL_PARSER::readGeometry( FILE* file, int* LineNum )
|
||||
{
|
||||
char line[1024], buffer[1024], * text;
|
||||
int err = 1;
|
||||
std::vector< double > points;
|
||||
std::vector< double > list;
|
||||
double vrmlunits_to_3Dunits = g_Parm_3D_Visu.m_BiuTo3Dunits * UNITS3D_TO_UNITSPCB;
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
strcpy( buffer, line );
|
||||
text = strtok( buffer, sep_chars );
|
||||
|
||||
if( *text == '}' )
|
||||
{
|
||||
err = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if( stricmp( text, "normalPerVertex" ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, " ,\t\n\r" );
|
||||
|
||||
if( stricmp( text, "true" ) == 0 )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "colorPerVertex" ) == 0 )
|
||||
{
|
||||
text = strtok( NULL, " ,\t\n\r" );
|
||||
|
||||
if( stricmp( text, "true" ) == 0 )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "normal" ) == 0 )
|
||||
{
|
||||
readCoordsList( file, line, list, LineNum );
|
||||
list.clear();
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "normalIndex" ) == 0 )
|
||||
{
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, " ,\t\n\r" );
|
||||
|
||||
while( text )
|
||||
{
|
||||
if( *text == ']' )
|
||||
break;
|
||||
|
||||
text = strtok( NULL, " ,\t\n\r" );
|
||||
}
|
||||
|
||||
if( text && (*text == ']') )
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "color" ) == 0 )
|
||||
{
|
||||
readCoordsList( file, line, list, LineNum );
|
||||
list.clear();
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "solid" ) == 0 )
|
||||
{
|
||||
// ignore solid
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "colorIndex" ) == 0 )
|
||||
{
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
text = strtok( line, " ,\t\n\r" );
|
||||
|
||||
while( text )
|
||||
{
|
||||
if( *text == ']' )
|
||||
break;
|
||||
|
||||
text = strtok( NULL, " ,\t\n\r" );
|
||||
}
|
||||
|
||||
if( text && (*text == ']') )
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if( stricmp( text, "coord" ) == 0 )
|
||||
{
|
||||
readCoordsList( file, line, points, LineNum );
|
||||
}
|
||||
else if( stricmp( text, "coordIndex" ) == 0 )
|
||||
{
|
||||
if( points.size() < 3 || points.size() % 3 != 0 )
|
||||
{
|
||||
wxLogError( wxT( "3D geometry read error <%s> at line %d." ),
|
||||
GetChars( FROM_UTF8( text ) ), *LineNum );
|
||||
err = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
std::vector< int > coordIndex;
|
||||
std::vector< S3D_VERTEX > vertices;
|
||||
|
||||
while( GetLine( file, line, LineNum, 512 ) )
|
||||
{
|
||||
int jj;
|
||||
text = strtok( line, " ,\t\n\r" );
|
||||
|
||||
while( text )
|
||||
{
|
||||
if( *text == ']' )
|
||||
break;
|
||||
|
||||
jj = atoi( text );
|
||||
|
||||
if( jj < 0 )
|
||||
{
|
||||
for( jj = 0; jj < (int) coordIndex.size(); jj++ )
|
||||
{
|
||||
int kk = coordIndex[jj] * 3;
|
||||
|
||||
if( (kk < 0) || ((kk + 3) > (int)points.size()) )
|
||||
{
|
||||
wxLogError( wxT( "3D geometry index read error <%s> at line %d." ),
|
||||
GetChars( FROM_UTF8( text ) ), *LineNum );
|
||||
err = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
S3D_VERTEX vertex;
|
||||
vertex.x = points[kk];
|
||||
vertex.y = points[kk + 1];
|
||||
vertex.z = points[kk + 2];
|
||||
vertices.push_back( vertex );
|
||||
}
|
||||
|
||||
GetMaster()->Set_Object_Coords( vertices );
|
||||
Set_Object_Data( vertices, vrmlunits_to_3Dunits );
|
||||
vertices.clear();
|
||||
coordIndex.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
coordIndex.push_back( jj );
|
||||
}
|
||||
|
||||
text = strtok( NULL, " ,\t\n\r" );
|
||||
}
|
||||
|
||||
if( text && (*text == ']') )
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogError( wxT( "3D geometry read error <%s> at line %d." ),
|
||||
GetChars( FROM_UTF8( text ) ), *LineNum );
|
||||
err = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -0,0 +1,497 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013 Tuomas Vaherkoski <tuomasvaherkoski@gmail.com>
|
||||
* Copyright (C) 1992-2013 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file x3dmodelparser.cpp
|
||||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <macros.h>
|
||||
#include <info3d_visu.h>
|
||||
#include <wx/xml/xml.h>
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/string.h>
|
||||
#include <map>
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
|
||||
#include <3d_struct.h>
|
||||
#include <modelparsers.h>
|
||||
#include <xnode.h>
|
||||
|
||||
|
||||
X3D_MODEL_PARSER::X3D_MODEL_PARSER( S3D_MASTER* aMaster ) :
|
||||
S3D_MODEL_PARSER( aMaster )
|
||||
{}
|
||||
|
||||
|
||||
X3D_MODEL_PARSER::~X3D_MODEL_PARSER()
|
||||
{}
|
||||
|
||||
|
||||
void X3D_MODEL_PARSER::Load( const wxString aFilename )
|
||||
{
|
||||
wxXmlDocument doc;
|
||||
|
||||
if( !doc.Load( aFilename ) )
|
||||
{
|
||||
wxLogError( wxT( "Error while parsing file '%s'" ), GetChars( aFilename ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if( doc.GetRoot()->GetName() != wxT( "X3D" ) )
|
||||
{
|
||||
wxLogError( wxT( "Filetype is not X3D '%s'" ), GetChars( aFilename ) );
|
||||
return;
|
||||
}
|
||||
|
||||
// Shapes are inside of Transform nodes
|
||||
// Transform node contains information about
|
||||
// transition, scale and rotation of the shape
|
||||
NODE_LIST transforms;
|
||||
GetChildsByName( doc.GetRoot(), wxT( "Transform" ), transforms );
|
||||
|
||||
for( NODE_LIST::iterator node_it = transforms.begin();
|
||||
node_it != transforms.end();
|
||||
node_it++ )
|
||||
{
|
||||
readTransform( *node_it );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wxString X3D_MODEL_PARSER::VRML_representation()
|
||||
{
|
||||
wxString output;
|
||||
|
||||
for( unsigned i = 0; i < vrml_points.size(); i++ )
|
||||
{
|
||||
output +=
|
||||
wxT( "Shape {\n"
|
||||
" appearance Appearance {\n"
|
||||
" material Material {\n" ) +
|
||||
vrml_materials[i] +
|
||||
wxT( " }\n"
|
||||
" }\n"
|
||||
" geometry IndexedFaceSet {\n"
|
||||
" solid TRUE\n"
|
||||
" coord Coordinate {\n"
|
||||
" point [\n") +
|
||||
vrml_points[i] +
|
||||
wxT( " ]\n"
|
||||
" }\n"
|
||||
" coordIndex [\n" ) +
|
||||
vrml_coord_indexes[i] +
|
||||
wxT( " ]\n"
|
||||
" }\n"
|
||||
"},\n" );
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
void X3D_MODEL_PARSER::GetChildsByName( wxXmlNode* aParent,
|
||||
const wxString aName,
|
||||
std::vector< wxXmlNode* >& aResult )
|
||||
{
|
||||
// Breadth-first search (BFS)
|
||||
std::queue< wxXmlNode* > found;
|
||||
|
||||
found.push( aParent );
|
||||
|
||||
while( !found.empty() )
|
||||
{
|
||||
wxXmlNode *elem = found.front();
|
||||
|
||||
for( wxXmlNode *child = elem->GetChildren();
|
||||
child != NULL;
|
||||
child = child->GetNext() )
|
||||
{
|
||||
if( child->GetName() == aName )
|
||||
{
|
||||
aResult.push_back( child );
|
||||
}
|
||||
|
||||
found.push( child );
|
||||
}
|
||||
|
||||
found.pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void X3D_MODEL_PARSER::GetNodeProperties( wxXmlNode* aNode, PROPERTY_MAP& aProps )
|
||||
{
|
||||
wxXmlAttribute* prop;
|
||||
|
||||
for( prop = aNode->GetAttributes();
|
||||
prop != NULL;
|
||||
prop = prop->GetNext() )
|
||||
{
|
||||
aProps[ prop->GetName() ] = prop->GetValue();
|
||||
}
|
||||
}
|
||||
|
||||
/* Private ----- */
|
||||
|
||||
void X3D_MODEL_PARSER::readTransform( wxXmlNode* aTransformNode )
|
||||
{
|
||||
NODE_LIST childnodes;
|
||||
GetChildsByName( aTransformNode, wxT( "Material" ), childnodes );
|
||||
|
||||
for( NODE_LIST::iterator node = childnodes.begin();
|
||||
node != childnodes.end();
|
||||
node++ )
|
||||
{
|
||||
readMaterial( *node );
|
||||
}
|
||||
|
||||
childnodes.clear();
|
||||
|
||||
PROPERTY_MAP properties;
|
||||
|
||||
GetNodeProperties( aTransformNode, properties );
|
||||
GetChildsByName( aTransformNode, wxT("IndexedFaceSet"), childnodes );
|
||||
|
||||
for( NODE_LIST::iterator node = childnodes.begin();
|
||||
node != childnodes.end();
|
||||
node++ )
|
||||
{
|
||||
readIndexedFaceSet( *node, properties );
|
||||
}
|
||||
|
||||
childnodes.clear();
|
||||
}
|
||||
|
||||
|
||||
void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode )
|
||||
{
|
||||
PROPERTY_MAP properties;
|
||||
GetNodeProperties( aMatNode, properties );
|
||||
|
||||
// DEFine new Material named as value of DEF
|
||||
if( properties.find( wxT( "DEF" ) ) != properties.end() )
|
||||
{
|
||||
double amb, shine, transp;
|
||||
|
||||
S3D_MATERIAL* material = new S3D_MATERIAL( GetMaster(), properties[ wxT( "DEF" ) ] );
|
||||
GetMaster()->Insert( material );
|
||||
|
||||
if( !parseDoubleTriplet( properties[ wxT( "diffuseColor" ) ],
|
||||
material->m_DiffuseColor ) )
|
||||
{
|
||||
DBG( printf("diffuseColor parsing error") );
|
||||
}
|
||||
|
||||
if( !parseDoubleTriplet( properties[ wxT( "specularColor" ) ],
|
||||
material->m_SpecularColor ) )
|
||||
{
|
||||
DBG( printf("specularColor parsing error") );
|
||||
}
|
||||
|
||||
if( !parseDoubleTriplet( properties[ wxT( "emissiveColor" ) ],
|
||||
material->m_EmissiveColor ) )
|
||||
{
|
||||
DBG( printf("emissiveColor parsing error") );
|
||||
}
|
||||
|
||||
wxStringTokenizer values;
|
||||
values.SetString( properties[ wxT( "ambientIntensity" ) ] );
|
||||
|
||||
if( values.GetNextToken().ToDouble( &amb ) )
|
||||
{
|
||||
material->m_AmbientIntensity = amb;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG( printf( "ambienterror" ) );
|
||||
}
|
||||
|
||||
values.SetString( properties[ wxT( "shininess" ) ] );
|
||||
|
||||
if( values.GetNextToken().ToDouble( &shine ) )
|
||||
{
|
||||
material->m_Shininess = shine;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG( printf( "shininess error" ) );
|
||||
}
|
||||
|
||||
values.SetString( properties[ wxT( "transparency" ) ] );
|
||||
|
||||
if( values.GetNextToken().ToDouble( &transp ) )
|
||||
{
|
||||
material->m_Transparency = transp;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG( printf( "trans error") );
|
||||
}
|
||||
|
||||
material->SetMaterial();
|
||||
|
||||
// VRML
|
||||
wxString vrml_material;
|
||||
PROPERTY_MAP::const_iterator p = ++properties.begin(); // skip DEF
|
||||
|
||||
for( ; p != properties.end(); p++ )
|
||||
{
|
||||
vrml_material.Append( p->first + wxT( " " ) + p->second + wxT( "\n" ) );
|
||||
}
|
||||
|
||||
vrml_materials.push_back( vrml_material );
|
||||
}
|
||||
|
||||
// USE existing material named by value of USE
|
||||
else if( properties.find( wxT( "USE" ) ) != properties.end() )
|
||||
{
|
||||
S3D_MATERIAL* material = NULL;
|
||||
wxString mat_name = properties[ wxT( "USE" ) ];
|
||||
|
||||
for( material = GetMaster()->m_Materials; material; material = material->Next() )
|
||||
{
|
||||
if( material->m_Name == mat_name )
|
||||
{
|
||||
wxString vrml_material;
|
||||
|
||||
vrml_material.Append( wxString::Format( wxT( "specularColor %f %f %f\n" ),
|
||||
material->m_SpecularColor.x,
|
||||
material->m_SpecularColor.y,
|
||||
material->m_SpecularColor.z ) );
|
||||
|
||||
vrml_material.Append( wxString::Format( wxT( "diffuseColor %f %f %f\n" ),
|
||||
material->m_DiffuseColor.x,
|
||||
material->m_DiffuseColor.y,
|
||||
material->m_DiffuseColor.z ) );
|
||||
|
||||
vrml_material.Append( wxString::Format( wxT( "emissiveColor %f %f %f\n" ),
|
||||
material->m_EmissiveColor.x,
|
||||
material->m_EmissiveColor.y,
|
||||
material->m_EmissiveColor.z ) );
|
||||
|
||||
vrml_material.Append( wxString::Format( wxT( "ambientIntensity %f\n"),
|
||||
material->m_AmbientIntensity ) );
|
||||
|
||||
vrml_material.Append( wxString::Format( wxT( "shininess %f\n"),
|
||||
material->m_Shininess ) );
|
||||
|
||||
vrml_material.Append( wxString::Format( wxT( "transparency %f\n"),
|
||||
material->m_Transparency ) );
|
||||
|
||||
vrml_materials.push_back( vrml_material );
|
||||
|
||||
material->SetMaterial();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DBG( printf( "ReadMaterial error: material not found\n" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool X3D_MODEL_PARSER::parseDoubleTriplet( const wxString& aData,
|
||||
S3D_VERTEX& aResult )
|
||||
{
|
||||
wxStringTokenizer tokens(aData);
|
||||
|
||||
return tokens.GetNextToken().ToDouble( &aResult.x ) &&
|
||||
tokens.GetNextToken().ToDouble( &aResult.y ) &&
|
||||
tokens.GetNextToken().ToDouble( &aResult.z );
|
||||
}
|
||||
|
||||
|
||||
void X3D_MODEL_PARSER::rotate( S3D_VERTEX& aV,
|
||||
S3D_VERTEX& aU,
|
||||
double angle )
|
||||
{
|
||||
S3D_VERTEX rotated;
|
||||
double C = cos( angle );
|
||||
double S = sin( angle );
|
||||
double t = 1.0 - C;
|
||||
|
||||
rotated.x = ( t * aU.x * aU.x + C ) * aV.x +
|
||||
( t * aU.x * aU.y - S * aU.z ) * aV.y +
|
||||
( t * aU.x * aU.z + S * aU.y ) * aV.z;
|
||||
|
||||
rotated.y = ( t * aU.x * aU.y + S * aU.z ) * aV.x +
|
||||
( t * aU.y * aU.y + C ) * aV.y +
|
||||
( t * aU.y * aU.z - S * aU.x ) * aV.z;
|
||||
|
||||
rotated.z = ( t * aU.x * aU.z - S * aU.y ) * aV.x +
|
||||
( t * aU.y * aU.z + S * aU.x ) * aV.y +
|
||||
( t * aU.z * aU.z + C) * aV.z;
|
||||
|
||||
aV.x = rotated.x;
|
||||
aV.y = rotated.y;
|
||||
aV.z = rotated.z;
|
||||
}
|
||||
|
||||
|
||||
/* Steps:
|
||||
* 1. Read transform data
|
||||
* 2. Read vertex triplets
|
||||
* 3. Read coordinate indexes
|
||||
* 4. Apply geometry to Master object
|
||||
*/
|
||||
void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode,
|
||||
PROPERTY_MAP& aTransformProps)
|
||||
{
|
||||
/* Step 1: Read transform data
|
||||
* --------------------------- */
|
||||
|
||||
S3D_VERTEX translation;
|
||||
parseDoubleTriplet( aTransformProps[ wxT( "translation" ) ], translation );
|
||||
|
||||
S3D_VERTEX scale;
|
||||
parseDoubleTriplet( aTransformProps[ wxT( "scale" ) ], scale );
|
||||
|
||||
S3D_VERTEX rotation;
|
||||
double angle = 0.0;
|
||||
wxStringTokenizer tokens(aTransformProps[ wxT( "rotation" ) ]);
|
||||
|
||||
if( !(tokens.GetNextToken().ToDouble( &rotation.x ) &&
|
||||
tokens.GetNextToken().ToDouble( &rotation.y ) &&
|
||||
tokens.GetNextToken().ToDouble( &rotation.z ) &&
|
||||
tokens.GetNextToken().ToDouble( &angle ) ) )
|
||||
{
|
||||
DBG( printf("rotation read error") );
|
||||
}
|
||||
|
||||
double vrmlunits_to_3Dunits = g_Parm_3D_Visu.m_BiuTo3Dunits *
|
||||
UNITS3D_TO_UNITSPCB;
|
||||
|
||||
/* Step 2: Read all coordinate points
|
||||
* ---------------------------- */
|
||||
std::vector< double > points;
|
||||
NODE_LIST coordinates;
|
||||
GetChildsByName( aFaceNode, wxT( "Coordinate" ), coordinates);
|
||||
|
||||
PROPERTY_MAP coordinate_properties;
|
||||
// IndexedFaceSet has one Coordinate child node
|
||||
GetNodeProperties( coordinates[0], coordinate_properties );
|
||||
|
||||
// Save points to vector as doubles
|
||||
wxStringTokenizer point_tokens( coordinate_properties[ wxT("point") ] );
|
||||
double point = 0.0;
|
||||
|
||||
while( point_tokens.HasMoreTokens() )
|
||||
{
|
||||
if( point_tokens.GetNextToken().ToDouble( &point ) )
|
||||
{
|
||||
points.push_back( point );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogError( wxT( "Error converting to double" ) );
|
||||
}
|
||||
}
|
||||
|
||||
if( points.size() % 3 != 0 )
|
||||
{
|
||||
DBG( printf( "Number of points is incorrect" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Create 3D vertex from 3 points and
|
||||
* apply transforms in order of SCALE, ROTATION, TRANSLATION
|
||||
*/
|
||||
wxString vrml_pointlist;
|
||||
std::vector< S3D_VERTEX > triplets;
|
||||
|
||||
for( unsigned id = 0; id < points.size() / 3; id++ )
|
||||
{
|
||||
int triplet_indx = id * 3;
|
||||
S3D_VERTEX point( points[ triplet_indx ],
|
||||
points[ triplet_indx + 1 ],
|
||||
points[ triplet_indx + 2 ] );
|
||||
|
||||
point.x *= scale.x;
|
||||
point.y *= scale.y;
|
||||
point.z *= scale.z;
|
||||
|
||||
rotate( point, rotation, angle );
|
||||
|
||||
point.x += translation.x;
|
||||
point.y += translation.y;
|
||||
point.z += translation.z;
|
||||
|
||||
triplets.push_back(point);
|
||||
|
||||
// VRML
|
||||
vrml_pointlist.Append( wxString::Format( wxT( "%f %f %f\n" ), point.x, point.y, point.z ) );
|
||||
}
|
||||
|
||||
vrml_points.push_back( vrml_pointlist );
|
||||
|
||||
/* -- Read coordinate indexes -- */
|
||||
PROPERTY_MAP faceset_properties;
|
||||
GetNodeProperties( aFaceNode, faceset_properties );
|
||||
|
||||
std::vector< S3D_VERTEX > vertices;
|
||||
std::vector< int > coordIndex;
|
||||
|
||||
wxString coordIndex_str = faceset_properties[ wxT( "coordIndex" ) ];
|
||||
wxStringTokenizer index_tokens( coordIndex_str );
|
||||
|
||||
wxString vrml_coord_indx_list;
|
||||
|
||||
while( index_tokens.HasMoreTokens() )
|
||||
{
|
||||
long index = 0;
|
||||
|
||||
index_tokens.GetNextToken().ToLong( &index );
|
||||
|
||||
// -1 marks the end of polygon
|
||||
if( index < 0 )
|
||||
{
|
||||
/* Step 4: Apply geometry to Master object
|
||||
* --------------------------------------- */
|
||||
std::vector<int>::const_iterator id;
|
||||
|
||||
for( id = coordIndex.begin();
|
||||
id != coordIndex.end();
|
||||
id++ )
|
||||
{
|
||||
vertices.push_back( triplets.at( *id ) );
|
||||
}
|
||||
|
||||
GetMaster()->Set_Object_Coords( vertices );
|
||||
Set_Object_Data( vertices, vrmlunits_to_3Dunits );
|
||||
|
||||
vertices.clear();
|
||||
coordIndex.clear();
|
||||
vrml_coord_indx_list.Append( wxT( "-1\n" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
coordIndex.push_back( index );
|
||||
vrml_coord_indx_list.Append( wxString::Format( wxT( "%u " ), index ) );
|
||||
}
|
||||
}
|
||||
|
||||
vrml_coord_indexes.push_back( vrml_coord_indx_list );
|
||||
}
|
||||
+14
-5
@@ -11,34 +11,43 @@ Wayne Stambaugh <stambaughw[at]verizon-dot-net>
|
||||
Hauptmech <hauptmech[at]gmail-dot-com>
|
||||
Jerry Jacobs <xor.gate.engineering[at]gmail-dot-com>
|
||||
Jonas Diemer <diemer[at]gmx-dot-de>
|
||||
KBool Library http://boolean.klaasholwerda.nl/bool.html
|
||||
Lorenzo <lomarcan[at]tin-dot-it>
|
||||
Marco Serantoni <marco.serantoni[at]gmail-dot-com> (OSX maintener)
|
||||
Rok Markovic <rok[at]kanardia.eu>
|
||||
Tim Hanson <sideskate[at]gmail-dot-com>
|
||||
Vesa Solonen <vesa.solonen[at]hut-dot-fi>
|
||||
Alexander Zakamaldin <zaka62[at]mail.ru>
|
||||
Miguel Angel Ajo Pelayo <miguelangel@nbee.es> (Python Scripting)
|
||||
Alexander Lunev <al.lunev@yahoo.com> (Pcad to Kicad converter)
|
||||
Jacobo Aragunde Perez <jaragunde@igalia.com> for Igalia and the CERN
|
||||
|
||||
See also CHANGELOG.txt for contributors.
|
||||
|
||||
== Document Writers
|
||||
Jean-Pierre Charras <jean-pierre.charras[at]gipsa-lab.inpg.fr>
|
||||
Igor Plyatov <plyatov[at]gmail.com>
|
||||
Fabrizio Tappero <fabrizio-dot-tappero[at]gmail-dot-com>
|
||||
|
||||
== Translators
|
||||
Czech (CZ) Martin Kratoška <martin[at]ok1rr-dot-com>
|
||||
Czech (CZ) Martin Kratoška <martin[at]ok1rr-dot-com>
|
||||
Dutch (NL) Jerry Jacobs <xor.gate.engineering[at]gmail-dot-com>
|
||||
Finnish (FI) Vesa Solonen <vesa.solonen[at]hut-dot-fi>
|
||||
French (FR) Jean-Pierre Charras <jean-pierre.charras[at]inpg-dot-fr>
|
||||
Polish (PL) Mateusz Skowro¿ski <skowri[at]gmail-dot-com>
|
||||
Polish (PL) Mateusz Skowro¿ski <skowri[at]gmail-dot-com>
|
||||
Polish (PL) Kerusey Karyu <keruseykaryu@o2.pl>
|
||||
Portuguese (PT) Renie Marquet <reniemarquet[at]uol-dot-com-dot-br>"
|
||||
Russian (RU) Igor Plyatov <plyatov[at]gmail-dot-com>
|
||||
Russian (RU) Andrey Fedorushkov <andrf@mail.ru>
|
||||
Spanish (ES) Pedro Martin del Valle <pkicad[at]yahoo-dot-es>
|
||||
Spanish (ES) Iñigo Zuluaga <inigo_zuluaga[at]yahoo-dot-es>
|
||||
Spanish (ES) Iñigo Zuluaga <inigo_zuluaga[at]yahoo-dot-es>
|
||||
German (DE) Rafael Sokolowski <Rafael.Sokolowski[at]web-dot-de
|
||||
Japanese (JA) Kenta Yonekura <midpika@hotmail.com>
|
||||
Japanese (JA) yoneken <midpika@hotmail.com>
|
||||
|
||||
Remy Halvick, David Briscoe, Dominique Laigle, Paul Burke
|
||||
|
||||
== Programm credits for icons and others
|
||||
Icons by Iñigo Zuluagaz <inigo_zuluaga[at]yahoo-dot-es>
|
||||
Icons by Iñigo Zuluagaz <inigo_zuluaga[at]yahoo-dot-es>
|
||||
New Icons by Fabrizio Tappero <fabrizio-dot-tappero[at]gmail-dot-com>
|
||||
3D modules by Renie Marquet <reniemarquet[at]uol.com-dot-br>
|
||||
3D modules by Christophe Boschat <nox454[at]hotmail-dot-fr>
|
||||
|
||||
+174
-1175
File diff suppressed because it is too large
Load Diff
+573
-229
@@ -1,187 +1,416 @@
|
||||
project(kicad)
|
||||
|
||||
# The minimum CMake version requirement could be different under unix, OSX, or Windows
|
||||
if(WIN32)
|
||||
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR) # win32 and win64
|
||||
elseif(APPLE)
|
||||
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR) # OSX
|
||||
else(WIN32)
|
||||
cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) # Linux, Unix, and everything else.
|
||||
endif(WIN32)
|
||||
# Default to CMAKE_BUILD_TYPE = Release unless overridden on command line
|
||||
# http://www.cmake.org/pipermail/cmake/2008-September/023808.html
|
||||
if( DEFINED CMAKE_BUILD_TYPE )
|
||||
set( CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Set to either \"Release\" or \"Debug\"" )
|
||||
else()
|
||||
set( CMAKE_BUILD_TYPE Release CACHE STRING "Set to either \"Release\" or \"Debug\"" )
|
||||
endif()
|
||||
|
||||
project( kicad )
|
||||
|
||||
cmake_minimum_required( VERSION 2.8.4 FATAL_ERROR )
|
||||
# because of http://public.kitware.com/Bug/view.php?id=10395
|
||||
|
||||
# Path to local CMake modules.
|
||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
|
||||
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules )
|
||||
|
||||
option(USE_PNG_BITMAPS "use PNG bitmaps instead of XPM (default ON)" ON)
|
||||
#
|
||||
# KiCad build options should be added below.
|
||||
#
|
||||
# If you add a new build option, please add it's state to the CopyVersionInfoToClipboard()
|
||||
# function in common/basicframe.cpp so that build option settings can be included in bug
|
||||
# reports.
|
||||
#
|
||||
|
||||
# Russian GOST patch
|
||||
option(wxUSE_UNICODE "enable/disable building unicode (default OFF)")
|
||||
option(KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)")
|
||||
option( USE_KIWAY_DLLS
|
||||
"Build the major modules as KIFACE DLLs or DSOs, will soon be the norm." OFF )
|
||||
|
||||
#for those who bored with uppercase
|
||||
option(KICAD_KEEPCASE "turn-off automatic component name conversion to uppercase if selected")
|
||||
# The desire is to migrate designs *away from* case independence, and to create designs which use
|
||||
# literally (case specific) interpreted component names. But for backwards compatibility,
|
||||
# you may turn OFF this option if you really must. (Remember that with KiCad using text
|
||||
# data files, typically you would be better off simply doctoring those files into
|
||||
# a case literal state with a text editor and move forward into the brave new
|
||||
# world of case specificity. Also, BOM generators may not work properly when you
|
||||
# have this option turned OFF, the xml export's referential integrity is broken
|
||||
# on library part name. Hence the default is ON now, as of 29-Jan-2014.
|
||||
option( KICAD_KEEPCASE
|
||||
"ON= case specific string matching on component names, OFF= match names as if they were spelt using uppercase."
|
||||
ON
|
||||
)
|
||||
|
||||
option(USE_WX_GRAPHICS_CONTEXT
|
||||
"Use wxGraphicsContext for rendering (default OFF). Warning, this is experimental")
|
||||
option( USE_WX_GRAPHICS_CONTEXT
|
||||
"Use wxGraphicsContext for rendering ( default OFF). Warning, this is experimental" )
|
||||
|
||||
option(USE_WX_OVERLAY
|
||||
"Use wxOverlay: Always ON for MAC (default OFF). Warning, this is experimental")
|
||||
option( USE_WX_OVERLAY
|
||||
"Use wxOverlay: Always ON for MAC ( default OFF). Warning, this is experimental" )
|
||||
|
||||
option(USE_BOOST_POLYGON_LIBRARY
|
||||
"Use boost polygon library instead of Kbool to calculate filled areas in zones (default ON)."
|
||||
ON )
|
||||
option( KICAD_SCRIPTING
|
||||
"set this option ON to build the scripting support inside kicad binaries"
|
||||
)
|
||||
|
||||
#One of these 2 option *must* be set to ON:
|
||||
option(KICAD_STABLE_VERSION
|
||||
"set this option to ON to build the stable version of KICAD. mainly used to set version ID (default OFF)"
|
||||
)
|
||||
option( KICAD_SCRIPTING_MODULES
|
||||
"set this option ON to build kicad modules that can be used from scripting languages"
|
||||
)
|
||||
|
||||
option(KICAD_TESTING_VERSION
|
||||
"set this option to ON to build the stable version of KICAD. mainly used to set version ID (default OFF)"
|
||||
)
|
||||
option( KICAD_SCRIPTING_WXPYTHON
|
||||
"set this option ON to build wxpython implementation for wx interface building in python and py.shell"
|
||||
)
|
||||
|
||||
#Set version option (stable or testing)
|
||||
option( KICAD_BUILD_STATIC
|
||||
"Builds Kicad and all libraries static (except wx-widgets)"
|
||||
)
|
||||
|
||||
if (KICAD_STABLE_VERSION )
|
||||
if ( KICAD_TESTING_VERSION )
|
||||
message( FATAL_ERROR
|
||||
"Please set to ON only one option KICAD_TESTING_VERSION or KICAD_STABLE_VERSION" )
|
||||
endif( KICAD_TESTING_VERSION )
|
||||
add_definitions(-DKICAD_STABLE_VERSION)
|
||||
message( "Build stable version of Kicad" )
|
||||
else (KICAD_STABLE_VERSION )
|
||||
if (KICAD_TESTING_VERSION )
|
||||
add_definitions(-DKICAD_TESTING_VERSION)
|
||||
message( "Build testing (unstable) version of Kicad" )
|
||||
else (KICAD_TESTING_VERSION )
|
||||
message( "Please set to ON one option of KICAD_TESTING_VERSION or KICAD_STABLE_VERSION" )
|
||||
message( "When calling cmake add option -DKICAD_STABLE_VERSION=ON" )
|
||||
message( "or add option -DKICAD_TESTING_VERSION=ON" )
|
||||
message( FATAL_ERROR "one option of KICAD_TESTING_VERSION or KICAD_STABLE_VERSION must be defined" )
|
||||
endif(KICAD_TESTING_VERSION )
|
||||
endif(KICAD_STABLE_VERSION )
|
||||
# WARNING: KiCad developers strongly advise you to build Boost with supplied patches,
|
||||
# as it is known to work with KiCad. Other versions may contain bugs that may result
|
||||
# in KiCad errors.
|
||||
option( KICAD_SKIP_BOOST
|
||||
"Skip building downloaded Boost library components, use Boost from your system."
|
||||
)
|
||||
mark_as_advanced( KICAD_SKIP_BOOST ) # Normal builders should build Boost.
|
||||
|
||||
|
||||
# when option KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES is enabled:
|
||||
# PYTHON_EXECUTABLE can be defined when invoking cmake
|
||||
# ( use -DPYTHON_EXECUTABLE=<python path>/python.exe or python2 )
|
||||
# when not defined by user, the default is python.exe under Windows and python2 for others
|
||||
# python binary file should be is exec path.
|
||||
|
||||
option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." OFF )
|
||||
|
||||
# This can be set to a custom name to brag about a particular branch in the "About" dialog:
|
||||
set( KICAD_REPO_NAME "product" CACHE STRING "Name of the tree from which this build came." )
|
||||
|
||||
|
||||
# All CMake downloads go here. Suggested is up in the source tree, not in the build dir where they
|
||||
# would have to be downloaded over and over again. The default is to choose a directory that is
|
||||
# hidden on linux (starts with a '.') because there is a way to exclude this directory when grepping
|
||||
# the source tree.
|
||||
set( DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/.downloads-by-cmake
|
||||
CACHE PATH "Location of KiCad downloads, suggested is a dir common to all builds, i.e. global." )
|
||||
|
||||
#Add option to add user directories for linker, if any
|
||||
LINK_DIRECTORIES( ${LINK_DIRECTORIES_PATH} )
|
||||
|
||||
if( UNIX )
|
||||
set( KICAD_USER_CONFIG_DIR $ENV{HOME} CACHE PATH "Location of user specifig KiCad config files" )
|
||||
elseif( MINGW )
|
||||
set( KICAD_USER_CONFIG_DIR $ENV{%APPDATA%} CACHE PATH "Location of user specifig KiCad config files" )
|
||||
endif()
|
||||
mark_as_advanced( KICAD_USER_CONFIG_DIR )
|
||||
|
||||
|
||||
#================================================
|
||||
# Set flags for GCC.
|
||||
# Set flags for GCC, or treat llvm as GCC
|
||||
#================================================
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# Set default flags for Release build.
|
||||
set(CMAKE_C_FLAGS_RELEASE "-Wall -O2 -DNDEBUG ")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -O2 -DNDEBUG")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s -static-libgcc")
|
||||
if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||
|
||||
# Set default flags for Debug build.
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
|
||||
execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
|
||||
if( USE_PNG_BITMAPS )
|
||||
#Add -DUSE_PNG_BITMAPS to windres.exe command line
|
||||
set(CMAKE_RC_COMPILER windres.exe -DUSE_PNG_BITMAPS)
|
||||
endif( USE_PNG_BITMAPS )
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# Establish -Wall early, so specialized relaxations of this may come
|
||||
# subsequently on the command line, such as in pcbnew/github/CMakeLists.txt
|
||||
set( CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}" )
|
||||
set( CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}" )
|
||||
|
||||
if(wxUSE_UNICODE)
|
||||
add_definitions(-DwxUSE_UNICODE)
|
||||
endif(wxUSE_UNICODE)
|
||||
# The optimization level is -O1 instead of the usual -O2 level because
|
||||
# boost::polygon has a function (inflate polygon) broken by the -O2 level
|
||||
# with GCC 4.7.0 to 4.7.2 (works fine with with GCC 4.6 and 4.7.3).
|
||||
# This lower optimization level does not have a significant change on the speed.
|
||||
# See also:
|
||||
# https://bugs.launchpad.net/kicad/+bug/1056926
|
||||
# https://svn.boost.org/trac/boost/ticket/7983
|
||||
if( GCC_VERSION VERSION_EQUAL 4.7.0 OR ( GCC_VERSION VERSION_GREATER 4.7.0 AND GCC_VERSION VERSION_LESS 4.7.3 ) )
|
||||
set( CMAKE_C_FLAGS_RELEASE "-O1" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "-O1" )
|
||||
else()
|
||||
set( CMAKE_C_FLAGS_RELEASE "-O2" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "-O2" )
|
||||
endif()
|
||||
|
||||
if(KICAD_GOST)
|
||||
add_definitions(-DKICAD_GOST)
|
||||
endif(KICAD_GOST)
|
||||
set( CMAKE_C_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG -Wno-deprecated-declarations" )
|
||||
|
||||
if(KICAD_KEEPCASE)
|
||||
add_definitions(-DKICAD_KEEPCASE)
|
||||
endif(KICAD_KEEPCASE)
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG" )
|
||||
|
||||
if(USE_WX_OVERLAY OR APPLE)
|
||||
add_definitions(-DUSE_WX_OVERLAY)
|
||||
endif(USE_WX_OVERLAY OR APPLE)
|
||||
if( GXX_HAS_VISIBILITY_FLAG AND NOT APPLE )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden" )
|
||||
endif()
|
||||
|
||||
if( GXX_HAS_VISIBILITY_INLINES_FLAG AND NOT APPLE )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden" )
|
||||
endif()
|
||||
|
||||
if( MINGW )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
|
||||
|
||||
# _UNICODE definition seems needed under mingw/gcc 4.8
|
||||
# (Kicad uses unicode, and on Windows, wxWidgets >= 2.9.4 is mandatory
|
||||
# and uses unicode)
|
||||
if( GCC_VERSION VERSION_EQUAL 4.8.0 OR GCC_VERSION VERSION_GREATER 4.8.0 )
|
||||
add_definitions(-D_UNICODE)
|
||||
endif()
|
||||
|
||||
# Since version 2.8.5, Cmake uses a response file (.rsp) to
|
||||
# pass the list of include paths to gcc
|
||||
# unfortunately, under mingw32+msys, at least with gcc 4.8 and previous,
|
||||
# this file is not expanded and include paths defined in this file are not taken in account
|
||||
# this is the case of wxWidgets includes
|
||||
# Disable this response file for includes ( See Windows-GNU.cmake module )
|
||||
if( WIN32 AND MSYS AND NOT CMAKE_CROSSCOMPILING )
|
||||
# fixme: it is needed only with MSYS+MINGW32? or always under MINGW
|
||||
if( ${CMAKE_SIZEOF_VOID_P} MATCHES 4 )
|
||||
set( CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 0 )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
else()
|
||||
# We build DLL/DSOs from static libraries, so create position independent
|
||||
# code for all cases, since we do not have DLL/DSO specific static
|
||||
# libraries. Subdirectories via add_subdirectores() reference this
|
||||
# variable, and it is either set or empty, empty for Windows.
|
||||
set( PIC_FLAG -fPIC )
|
||||
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PIC_FLAG}" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PIC_FLAG}" )
|
||||
|
||||
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||
set( TO_LINKER -XLinker )
|
||||
else()
|
||||
set( TO_LINKER -Wl )
|
||||
endif()
|
||||
|
||||
# Thou shalt not link vaporware and tell us it's a valid DSO:
|
||||
set( CMAKE_SHARED_LINKER_FLAGS "${TO_LINKER},--no-undefined" )
|
||||
set( CMAKE_MODULE_LINKER_FLAGS "${TO_LINKER},--no-undefined" )
|
||||
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
|
||||
endif()
|
||||
|
||||
# quiet GCC while in boost
|
||||
if( GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8 )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" )
|
||||
endif()
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing" )
|
||||
|
||||
if( APPLE )
|
||||
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__ASSERTMACROS__ -mmacosx-version-min=10.5" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__ASSERTMACROS__ -mmacosx-version-min=10.5" )
|
||||
|
||||
# Allows .dylib relocation in the future
|
||||
set( CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -headerpad_max_install_names")
|
||||
|
||||
if( NOT CMAKE_CXX_COMPILER )
|
||||
EXEC_PROGRAM( wx-config ARGS --cc OUTPUT_VARIABLE CMAKE_C_COMPILER )
|
||||
endif( NOT CMAKE_CXX_COMPILER )
|
||||
|
||||
if( NOT CMAKE_CXX_COMPILER )
|
||||
EXEC_PROGRAM( wx-config ARGS --cxx OUTPUT_VARIABLE CMAKE_CXX_COMPILER )
|
||||
endif( NOT CMAKE_CXX_COMPILER )
|
||||
|
||||
endif()
|
||||
|
||||
endif( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||
|
||||
if( KICAD_KEEPCASE )
|
||||
add_definitions( -DKICAD_KEEPCASE )
|
||||
endif()
|
||||
|
||||
if( USE_WX_OVERLAY OR APPLE )
|
||||
add_definitions( -DUSE_WX_OVERLAY )
|
||||
endif()
|
||||
|
||||
if( KICAD_SCRIPTING )
|
||||
add_definitions( -DKICAD_SCRIPTING )
|
||||
endif()
|
||||
|
||||
if( KICAD_SCRIPTING_MODULES )
|
||||
add_definitions( -DKICAD_SCRIPTING_MODULES )
|
||||
endif()
|
||||
|
||||
if( KICAD_SCRIPTING_WXPYTHON )
|
||||
add_definitions( -DKICAD_SCRIPTING_WXPYTHON )
|
||||
endif()
|
||||
|
||||
if( USE_WX_GRAPHICS_CONTEXT )
|
||||
add_definitions( -DUSE_WX_GRAPHICS_CONTEXT )
|
||||
endif()
|
||||
|
||||
|
||||
if(USE_WX_GRAPHICS_CONTEXT)
|
||||
add_definitions(-DUSE_WX_GRAPHICS_CONTEXT)
|
||||
endif(USE_WX_GRAPHICS_CONTEXT)
|
||||
|
||||
if(USE_BOOST_POLYGON_LIBRARY)
|
||||
set( USE_BOOST_POLYGON_LIBRARY ON )
|
||||
add_definitions(-DUSE_BOOST_POLYGON_LIBRARY)
|
||||
endif(USE_BOOST_POLYGON_LIBRARY)
|
||||
|
||||
# Allow user to override the default settings for adding images to menu items. By default
|
||||
# images in menu items are enabled on all plaforms except OSX. This can be over ridden by
|
||||
# images in menu items are enabled on all platforms except OSX. This can be over ridden by
|
||||
# defining -DUSE_IMAGES_IN_MENUS=ON/OFF to force the preferred behavior.
|
||||
if(NOT DEFINED USE_IMAGES_IN_MENUS)
|
||||
if(NOT APPLE)
|
||||
set(USE_IMAGES_IN_MENUS ON)
|
||||
endif(NOT APPLE)
|
||||
else(NOT DEFINED USE_IMAGES_IN_MENUS)
|
||||
if(USE_IMAGES_IN_MENUS)
|
||||
set(USE_IMAGES_IN_MENUS ON)
|
||||
endif(USE_IMAGES_IN_MENUS)
|
||||
endif(NOT DEFINED USE_IMAGES_IN_MENUS)
|
||||
if( NOT DEFINED USE_IMAGES_IN_MENUS )
|
||||
if( NOT APPLE )
|
||||
set( USE_IMAGES_IN_MENUS ON )
|
||||
endif()
|
||||
else()
|
||||
if( USE_IMAGES_IN_MENUS )
|
||||
set( USE_IMAGES_IN_MENUS ON )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# KIFACE_SUFFIX is the file extension used for top level program modules which
|
||||
# implement the KIFACE interface. A valid suffix starts with a period '.'.
|
||||
|
||||
if( false )
|
||||
# This is the eventual situation near milestone C) of modular-kicad blueprint.
|
||||
# Until then we use .kiface extension so we don't collide with python DSO.
|
||||
set( KIFACE_SUFFIX ${CMAKE_SHARED_MODULE_SUFFIX} )
|
||||
else()
|
||||
# Temporary situation until we can dovetail the python DSO into the kiface DSO.
|
||||
set( KIFACE_SUFFIX ".kiface" )
|
||||
endif()
|
||||
|
||||
# KIFACE_PREFIX is a basename prefix used for top level program modules which
|
||||
# implement the KIFACE.
|
||||
set( KIFACE_PREFIX "_" )
|
||||
#message( STATUS "KIFACE_SUFFIX:${KIFACE_SUFFIX} KIFACE_PREFIX:${KIFACE_PREFIX}" )
|
||||
|
||||
|
||||
#================================================
|
||||
# Locations for install targets.
|
||||
set(KICAD_BIN bin
|
||||
CACHE PATH "Location of KiCad binaries.")
|
||||
set( KICAD_BIN bin
|
||||
CACHE PATH "Location of KiCad binaries." )
|
||||
|
||||
if(UNIX)
|
||||
set( KICAD_FP_LIB_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}"
|
||||
CACHE PATH "Default path where footprint libraries are installed." )
|
||||
|
||||
if( UNIX )
|
||||
# Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
|
||||
set(KICAD_PLUGINS lib/kicad/plugins
|
||||
CACHE PATH "Location of KiCad plugins.")
|
||||
set(KICAD_DATA share/kicad
|
||||
CACHE PATH "Location of KiCad data files.")
|
||||
set(KICAD_DOCS share/doc/kicad
|
||||
CACHE PATH "Location of KiCad documentation files.")
|
||||
endif(UNIX)
|
||||
set( KICAD_PLUGINS lib/kicad/plugins
|
||||
CACHE PATH "Location of KiCad plugins." )
|
||||
set( KICAD_DATA share/kicad
|
||||
CACHE PATH "Location of KiCad data files." )
|
||||
set( KICAD_DOCS share/doc/kicad
|
||||
CACHE PATH "Location of KiCad documentation files." )
|
||||
set( KICAD_FP_LIB_INSTALL_PATH "${KICAD_FP_LIB_INSTALL_PATH}/share/kicad/modules" )
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
# Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
|
||||
set(CMAKE_INSTALL_PREFIX c:/kicad
|
||||
CACHE PATH "")
|
||||
if( MINGW )
|
||||
# Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
|
||||
set(KICAD_PLUGINS ${KICAD_BIN}/plugins
|
||||
CACHE PATH "Location of KiCad plugins.")
|
||||
set(KICAD_DATA share
|
||||
CACHE PATH "Location of KiCad data files.")
|
||||
set(KICAD_DOCS doc
|
||||
CACHE PATH "Location of KiCad documentation files.")
|
||||
endif(WIN32)
|
||||
set( KICAD_PLUGINS ${KICAD_BIN}/plugins
|
||||
CACHE PATH "Location of KiCad plugins." )
|
||||
set( KICAD_DATA share
|
||||
CACHE PATH "Location of KiCad data files." )
|
||||
set( KICAD_DOCS doc
|
||||
CACHE PATH "Location of KiCad documentation files." )
|
||||
set( KICAD_FP_LIB_INSTALL_PATH "${KICAD_FP_LIB_INSTALL_PATH}/modules" )
|
||||
endif()
|
||||
|
||||
set(KICAD_DEMOS ${KICAD_DATA}/demos
|
||||
CACHE PATH "Location of KiCad demo files.")
|
||||
set(KICAD_TEMPLATE ${KICAD_DATA}/template
|
||||
CACHE PATH "Location of KiCad template files.")
|
||||
set( KICAD_DEMOS ${KICAD_DATA}/demos
|
||||
CACHE PATH "Location of KiCad demo files." )
|
||||
set( KICAD_TEMPLATE ${KICAD_DATA}/template
|
||||
CACHE PATH "Location of KiCad template files." )
|
||||
|
||||
mark_as_advanced(KICAD_BIN
|
||||
KICAD_PLUGINS
|
||||
KICAD_DATA
|
||||
KICAD_DOCS
|
||||
KICAD_DEMOS
|
||||
KICAD_TEMPLATE)
|
||||
mark_as_advanced( KICAD_BIN
|
||||
KICAD_PLUGINS
|
||||
KICAD_DATA
|
||||
KICAD_DOCS
|
||||
KICAD_DEMOS
|
||||
KICAD_TEMPLATE )
|
||||
|
||||
include(Functions)
|
||||
include( Functions )
|
||||
|
||||
include( ExternalProject )
|
||||
|
||||
#================================================
|
||||
# Find libraries that are needed to build KiCad.
|
||||
#================================================
|
||||
include(CheckFindPackageResult)
|
||||
include( CheckFindPackageResult )
|
||||
|
||||
# Turn on wxWidgets compatibility mode for some classes
|
||||
add_definitions(-DWX_COMPATIBILITY)
|
||||
|
||||
#######################
|
||||
# Find OpenGL library #
|
||||
#######################
|
||||
find_package(OpenGL QUIET)
|
||||
check_find_package_result(OPENGL_FOUND "OpenGL")
|
||||
find_package( OpenGL QUIET )
|
||||
check_find_package_result( OPENGL_FOUND "OpenGL" )
|
||||
|
||||
if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
|
||||
|
||||
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib;.dll")
|
||||
|
||||
if( KICAD_BUILD_STATIC AND KICAD_BUILD_DYNAMIC )
|
||||
message(FATAL_ERROR "You can't build STATIC and DYNAMIC together")
|
||||
endif()
|
||||
|
||||
if( KICAD_BUILD_STATIC )
|
||||
message(STATUS "KICAD_BUILD_STATIC set")
|
||||
endif()
|
||||
|
||||
if( KICAD_BUILD_DYNAMIC )
|
||||
message(STATUS "KICAD_BUILD_DYNAMIC set")
|
||||
# TODO - Library packaging/relocation
|
||||
endif()
|
||||
|
||||
add_custom_target( lib-dependencies
|
||||
DEPENDS boost cairo glew libpng pixman pkgconfig
|
||||
)
|
||||
|
||||
include( download_libpng )
|
||||
|
||||
if( KICAD_SCRIPTING_WXPYTHON )
|
||||
message( FATAL_ERROR "KICAD_BUILD_* and SCRIPTING Not Implemented Yet!" )
|
||||
else()
|
||||
include( download_wxwidgets )
|
||||
add_dependencies( lib-dependencies libwx )
|
||||
endif()
|
||||
|
||||
include( download_pkgconfig )
|
||||
set( PKG_CONFIG_EXECUTABLE "${PKGCONFIG_ROOT}/bin/pkg-config" )
|
||||
include( download_glew )
|
||||
set( GLEW_GLEW_LIBRARY "${GLEW_ROOT}/lib/libGLEW.a" )
|
||||
set( GLEW_INCLUDE_DIR "${GLEW_ROOT}/include" )
|
||||
include( download_pixman )
|
||||
set( PIXMAN_LIBRARY "${PIXMAN_ROOT}/lib/libpixman-1.a" )
|
||||
include( download_cairo )
|
||||
set( CAIRO_INCLUDE_DIR "${CAIRO_ROOT}/include/cairo" )
|
||||
set( CAIRO_LIBRARY "${CAIRO_ROOT}/lib/libcairo.a" )
|
||||
|
||||
if( KICAD_BUILD_DYNAMIC AND APPLE )
|
||||
add_custom_target( osx_fix_bundles ALL DEPENDS cvpcb eeschema gerbview kicad pcbnew bitmap2component pcb_calculator pl_editor)
|
||||
add_custom_command(TARGET osx_fix_bundles POST_BUILD COMMAND scripts/osx_fixbundle.sh COMMENT "Migrating dylibs to bundles")
|
||||
endif()
|
||||
|
||||
endif( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC)
|
||||
|
||||
#####################
|
||||
# Find GLEW library #
|
||||
#####################
|
||||
find_package(GLEW)
|
||||
check_find_package_result(GLEW_FOUND "GLEW")
|
||||
|
||||
######################
|
||||
# Find Boost library #
|
||||
# Find Cairo library #
|
||||
######################
|
||||
# kicad now includes needed boost files.
|
||||
# the two next lines can be uncommented to use the native boost lib.
|
||||
# but this is not a good idea
|
||||
#find_package(Boost 1.36 QUIET)
|
||||
#check_find_package_result(Boost_FOUND "Boost")
|
||||
find_package(Cairo 1.8.1 QUIET)
|
||||
check_find_package_result(CAIRO_FOUND "Cairo")
|
||||
|
||||
# Download boost and possibly build parts of it
|
||||
#################################################
|
||||
if( KICAD_SKIP_BOOST )
|
||||
find_package( Boost 1.54.0 REQUIRED COMPONENTS context date_time filesystem iostreams locale
|
||||
program_options regex system thread )
|
||||
|
||||
if( NOT Boost_FOUND )
|
||||
message( FATAL_ERROR "Boost 1.54+ libraries are required." )
|
||||
endif()
|
||||
|
||||
message( WARNING "
|
||||
WARNING: You decided to skip building boost library.
|
||||
KiCad developers strongly advise you to build the bundled boost library, as it is known to work with KiCad.
|
||||
Other versions may contain bugs that may result in KiCad errors." )
|
||||
else()
|
||||
include( download_boost )
|
||||
endif()
|
||||
|
||||
##########################
|
||||
# Find wxWidgets library #
|
||||
@@ -191,47 +420,102 @@ check_find_package_result(OPENGL_FOUND "OpenGL")
|
||||
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
|
||||
|
||||
# On Apple only wxwidgets 2.9 or higher doesn't need to find aui part of base
|
||||
if(APPLE)
|
||||
find_package(wxWidgets COMPONENTS gl adv html core net base xml QUIET)
|
||||
else(APPLE)
|
||||
find_package(wxWidgets COMPONENTS gl aui adv html core net base xml QUIET)
|
||||
endif(APPLE)
|
||||
check_find_package_result(wxWidgets_FOUND "wxWidgets")
|
||||
# Seems no more needed on wx-3
|
||||
if( APPLE AND NOT (KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC) )
|
||||
find_package( wxWidgets COMPONENTS gl adv html core net base xml QUIET )
|
||||
else()
|
||||
find_package( wxWidgets COMPONENTS gl aui adv html core net base xml QUIET )
|
||||
endif()
|
||||
|
||||
if( NOT (KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC) )
|
||||
check_find_package_result( wxWidgets_FOUND "wxWidgets" )
|
||||
endif( NOT (KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC) )
|
||||
|
||||
# Include wxWidgets macros.
|
||||
include(${wxWidgets_USE_FILE})
|
||||
include( ${wxWidgets_USE_FILE} )
|
||||
|
||||
# Include MinGW resource compiler.
|
||||
include(MinGWResourceCompiler)
|
||||
include( MinGWResourceCompiler )
|
||||
|
||||
# Generate build system specific header file.
|
||||
include(PerformFeatureChecks)
|
||||
include( PerformFeatureChecks )
|
||||
perform_feature_checks()
|
||||
|
||||
# Find GDI+ on windows if wxGraphicsContext is available.
|
||||
if(WIN32 AND USE_WX_GRAPHICS_CONTEXT)
|
||||
find_package(GdiPlus)
|
||||
check_find_package_result(GDI_PLUS_FOUND "GDI+")
|
||||
endif(WIN32 AND USE_WX_GRAPHICS_CONTEXT)
|
||||
if( MINGW AND USE_WX_GRAPHICS_CONTEXT )
|
||||
find_package( GdiPlus )
|
||||
check_find_package_result( GDI_PLUS_FOUND "GDI+" )
|
||||
endif()
|
||||
|
||||
# Assist with header file searching optimization:
|
||||
# INC_BEFORE and INC_AFTER are two lists which go at the front and back of the
|
||||
# header file search lists, respectively.
|
||||
# INC_BEFORE is for use with "include_directories( BEFORE ...)", which _reverses_
|
||||
# the order during insertion. (So put first wanted last, which is
|
||||
# ${CMAKE_SOURCE_DIR/include.) Use '.' for current source dir since
|
||||
# we don't want expansion here and now, which would happen if using ${CMAKE_CURRENT_SOURCE_DIR}.
|
||||
# Instead we use '.' which is applicable to any source directory below here as a result of
|
||||
# this lack of expansion.
|
||||
set( INC_BEFORE
|
||||
.
|
||||
${CMAKE_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
set( INC_AFTER
|
||||
${Boost_INCLUDE_DIR}
|
||||
#include <config.h>
|
||||
${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
|
||||
# Find Python and other scripting resources
|
||||
if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
|
||||
set( PythonInterp_FIND_VERSION )
|
||||
find_package( PythonInterp )
|
||||
check_find_package_result( PYTHONINTERP_FOUND "Python Interpreter" )
|
||||
|
||||
# Get the correct Python site package install path from the Python interpreter found by
|
||||
# FindPythonInterp unless the user specifically defined a custom path.
|
||||
if( NOT PYTHON_SITE_PACKAGE_PATH )
|
||||
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig;print\"%s\"%distutils.sysconfig.get_python_lib()"
|
||||
OUTPUT_VARIABLE PYTHON_SITE_PACKAGE_PATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if( NOT PYTHON_SITE_PACKAGE_PATH )
|
||||
message( FATAL_ERROR "Error occurred while attemping to find the Python site library path." )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set( PYTHON_DEST "${PYTHON_SITE_PACKAGE_PATH}" CACHE PATH "Python module install path." )
|
||||
mark_as_advanced( PYTHON_DEST )
|
||||
message( STATUS "Python module install path: ${PYTHON_DEST}" )
|
||||
|
||||
find_package( PythonLibs )
|
||||
|
||||
#message( STATUS "PYTHON_INCLUDE_DIRS:${PYTHON_INCLUDE_DIRS}" )
|
||||
|
||||
# Infrequently needed headers go at end of search paths, append to INC_AFTER which
|
||||
# although is used for all components, should be a harmless hit for something like eeschema
|
||||
# so long as unused search paths are at the end like this.
|
||||
set( INC_AFTER ${INC_AFTER} ${PYTHON_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/scripting )
|
||||
|
||||
#message( STATUS "/ INC_AFTER:${INC_AFTER}" )
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
# Automagically create version header file.
|
||||
include(CreateBzrVersionHeader)
|
||||
include( CreateBzrVersionHeader )
|
||||
create_bzr_version_header()
|
||||
|
||||
if(EXISTS ${CMAKE_SOURCE_DIR}/include/config.h)
|
||||
# This file may exist (created by an alternate process to the svn test above),
|
||||
if( EXISTS ${CMAKE_SOURCE_DIR}/include/config.h )
|
||||
# This file may exist ( created by an alternate process to the svn test above),
|
||||
# e.g. could be created by a checkout script that produces a source tar file.
|
||||
# This directive means the about box will have the svn date & revision in it,
|
||||
# but the hard coded release date (program version) will be preserved.
|
||||
add_definitions(-DHAVE_SVN_REVISION)
|
||||
endif(EXISTS ${CMAKE_SOURCE_DIR}/include/config.h)
|
||||
|
||||
|
||||
# Include paths.
|
||||
include_directories(${CMAKE_SOURCE_DIR}/include
|
||||
${CMAKE_SOURCE_DIR}/share
|
||||
${CMAKE_BINARY_DIR})
|
||||
# but the hard coded release date ( program version) will be preserved.
|
||||
add_definitions( -DHAVE_SVN_REVISION )
|
||||
endif()
|
||||
|
||||
|
||||
#================================================
|
||||
@@ -239,113 +523,173 @@ include_directories(${CMAKE_SOURCE_DIR}/include
|
||||
# 'CMakeLists.txt' files to process
|
||||
#================================================
|
||||
|
||||
############
|
||||
# Binaries #
|
||||
############
|
||||
add_subdirectory(3d-viewer)
|
||||
############################
|
||||
# Binaries ( CMake targets ) #
|
||||
############################
|
||||
|
||||
if( USE_PNG_BITMAPS )
|
||||
add_subdirectory(bitmaps_png)
|
||||
else()
|
||||
add_subdirectory(bitmaps_xpm)
|
||||
add_subdirectory( bitmaps_png )
|
||||
add_subdirectory( common )
|
||||
add_subdirectory( 3d-viewer )
|
||||
add_subdirectory( cvpcb )
|
||||
add_subdirectory( eeschema )
|
||||
add_subdirectory( gerbview )
|
||||
add_subdirectory( kicad )
|
||||
add_subdirectory( lib_dxf )
|
||||
add_subdirectory( pcbnew )
|
||||
add_subdirectory( polygon )
|
||||
add_subdirectory( pagelayout_editor )
|
||||
add_subdirectory( potrace )
|
||||
add_subdirectory( bitmap2component )
|
||||
add_subdirectory( pcb_calculator )
|
||||
add_subdirectory( tools )
|
||||
add_subdirectory( qa )
|
||||
#add_subdirectory( new )
|
||||
|
||||
|
||||
# Make all libs and executables depend on ExternalProject_Add( boost ),
|
||||
# except perhaps bitmap lib. This allows a multi-threaded build to succeed.
|
||||
add_dependencies( pcbnew boost )
|
||||
add_dependencies( eeschema boost )
|
||||
add_dependencies( cvpcb boost )
|
||||
add_dependencies( gal boost )
|
||||
add_dependencies( common boost )
|
||||
add_dependencies( pcbcommon boost )
|
||||
add_dependencies( 3d-viewer boost )
|
||||
add_dependencies( pcad2kicadpcb boost )
|
||||
add_dependencies( polygon boost )
|
||||
add_dependencies( pl_editor boost )
|
||||
add_dependencies( pnsrouter boost )
|
||||
|
||||
|
||||
if ( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
|
||||
add_dependencies( pcbnew lib-dependencies )
|
||||
add_dependencies( eeschema lib-dependencies )
|
||||
add_dependencies( cvpcb lib-dependencies )
|
||||
add_dependencies( gal lib-dependencies )
|
||||
add_dependencies( common lib-dependencies )
|
||||
add_dependencies( pcbcommon lib-dependencies )
|
||||
add_dependencies( 3d-viewer lib-dependencies )
|
||||
add_dependencies( pcad2kicadpcb lib-dependencies )
|
||||
add_dependencies( polygon lib-dependencies )
|
||||
add_dependencies( pl_editor lib-dependencies )
|
||||
add_dependencies( pnsrouter lib-dependencies )
|
||||
if ( BUILD_GITHUB_PLUGIN )
|
||||
add_dependencies( github_plugin lib-dependencies )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_subdirectory(common)
|
||||
add_subdirectory(cvpcb)
|
||||
add_subdirectory(eeschema)
|
||||
add_subdirectory(gerbview)
|
||||
add_subdirectory(kicad)
|
||||
add_subdirectory(pcbnew)
|
||||
add_subdirectory(polygon)
|
||||
add_subdirectory(polygon/kbool/src)
|
||||
add_subdirectory(potrace)
|
||||
add_subdirectory(bitmap2component)
|
||||
add_subdirectory(pcb_calculator)
|
||||
#add_subdirectory(new)
|
||||
if ( KICAD_BUILD_DYNAMIC )
|
||||
endif()
|
||||
|
||||
#############
|
||||
# Resources #
|
||||
#############
|
||||
add_subdirectory(demos)
|
||||
add_subdirectory(template)
|
||||
add_subdirectory( demos )
|
||||
add_subdirectory( template )
|
||||
|
||||
#================================================
|
||||
# Doxygen Output
|
||||
#================================================
|
||||
find_package(Doxygen)
|
||||
if(DOXYGEN_FOUND)
|
||||
add_custom_target( doxygen-docs ${DOXYGEN_EXECUTABLE}
|
||||
find_package( Doxygen )
|
||||
if( DOXYGEN_FOUND )
|
||||
add_custom_target( doxygen-docs
|
||||
${CMAKE_COMMAND} -E remove_directory Documentation/doxygen
|
||||
COMMAND ${DOXYGEN_EXECUTABLE}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPENDS Doxyfile )
|
||||
else(DOXYGEN_FOUND)
|
||||
DEPENDS Doxyfile
|
||||
COMMENT "building doxygen docs into directory Documentation/doxygen/html"
|
||||
)
|
||||
else()
|
||||
message( STATUS "WARNING: Doxygen not found - doxygen-docs (Source Docs) target not created" )
|
||||
endif()
|
||||
|
||||
|
||||
#================================================
|
||||
# make uninstall rules
|
||||
# "make uninstall" rules
|
||||
#================================================
|
||||
configure_file(
|
||||
"${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
"${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY )
|
||||
|
||||
add_custom_target(uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
add_custom_target( uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" )
|
||||
|
||||
|
||||
#================================================
|
||||
# Installation parameters
|
||||
# Installation
|
||||
#================================================
|
||||
install(FILES INSTALL.txt
|
||||
DESTINATION ${KICAD_DOCS}
|
||||
COMPONENT resources)
|
||||
install(FILES resources/freeroute.jnlp
|
||||
DESTINATION ${KICAD_BIN}
|
||||
COMPONENT resources)
|
||||
|
||||
install( FILES INSTALL.txt
|
||||
DESTINATION ${KICAD_DOCS}
|
||||
COMPONENT resources )
|
||||
|
||||
install( FILES resources/freeroute.jnlp
|
||||
DESTINATION ${KICAD_BIN}
|
||||
COMPONENT resources )
|
||||
|
||||
###
|
||||
# Install scripts
|
||||
###
|
||||
if(UNIX)
|
||||
install(DIRECTORY scripts
|
||||
DESTINATION ${KICAD_DOCS}
|
||||
COMPONENT resources
|
||||
PATTERN ".svn" EXCLUDE)
|
||||
endif(UNIX)
|
||||
if( UNIX )
|
||||
install( DIRECTORY scripts
|
||||
DESTINATION ${KICAD_DOCS}
|
||||
COMPONENT resources
|
||||
)
|
||||
endif()
|
||||
|
||||
###
|
||||
# FreeDesktop .desktop and MIME resources
|
||||
###
|
||||
if(UNIX)
|
||||
if( UNIX )
|
||||
|
||||
# Set paths
|
||||
set(UNIX_MIME_DIR resources/linux/mime)
|
||||
set(UNIX_MIMELNK_FILES ${UNIX_MIME_DIR}/mimelnk)
|
||||
set(UNIX_MIME_FILES ${UNIX_MIME_DIR}/mime)
|
||||
set(UNIX_ICONS_FILES ${UNIX_MIME_DIR}/icons)
|
||||
set(UNIX_APPLICATIONS_FILES ${UNIX_MIME_DIR}/applications)
|
||||
set( UNIX_MIME_DIR resources/linux/mime )
|
||||
set( UNIX_MIMELNK_FILES ${UNIX_MIME_DIR}/mimelnk )
|
||||
set( UNIX_MIME_FILES ${UNIX_MIME_DIR}/mime )
|
||||
set( UNIX_ICON_FILES ${UNIX_MIME_DIR}/icons )
|
||||
set( UNIX_APPLICATIONS_FILES ${UNIX_MIME_DIR}/applications )
|
||||
|
||||
# Install Mimelnk directory
|
||||
install(DIRECTORY ${UNIX_MIMELNK_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
PATTERN ".svn" EXCLUDE)
|
||||
install( DIRECTORY ${UNIX_MIMELNK_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
)
|
||||
|
||||
# Install Mime directory
|
||||
install(DIRECTORY ${UNIX_ICONS_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
PATTERN ".svn" EXCLUDE)
|
||||
install( DIRECTORY ${UNIX_ICON_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
)
|
||||
|
||||
# Install Icons
|
||||
install(DIRECTORY ${UNIX_MIME_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
PATTERN ".svn" EXCLUDE)
|
||||
install( DIRECTORY ${UNIX_MIME_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
)
|
||||
|
||||
# Install Applications directory (.desktop files)
|
||||
install(DIRECTORY ${UNIX_APPLICATIONS_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
PATTERN ".svn" EXCLUDE)
|
||||
endif(UNIX)
|
||||
install( DIRECTORY ${UNIX_APPLICATIONS_FILES}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share
|
||||
COMPONENT resources
|
||||
)
|
||||
endif()
|
||||
|
||||
include(CTest)
|
||||
#include( CTest )
|
||||
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
|
||||
# Create a *.deb file:
|
||||
set( CPACK_GENERATOR "DEB" )
|
||||
set( CPACK_DEBIAN_PACKAGE_MAINTAINER "http://launchpad.net/kicad" )
|
||||
|
||||
set( CPACK_PACKAGE_VERSION_MAJOR 1 )
|
||||
set( CPACK_PACKAGE_VERSION_MINOR 0 )
|
||||
set( CPACK_PACKAGE_VERSION_PATCH 0 )
|
||||
#set( CPACK_PACKAGE_CONTACT Firstname Lastname <email@company.com> )
|
||||
set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "KiCad built by CMake build system." )
|
||||
|
||||
include( CPack )
|
||||
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# - helper module to find OSX frameworks
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2003-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
|
||||
set(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
|
||||
macro(CMAKE_FIND_FRAMEWORKS fwk)
|
||||
set(${fwk}_FRAMEWORKS)
|
||||
if(APPLE)
|
||||
foreach(dir
|
||||
~/Library/Frameworks/${fwk}.framework
|
||||
/Library/Frameworks/${fwk}.framework
|
||||
/System/Library/Frameworks/${fwk}.framework
|
||||
/Network/Library/Frameworks/${fwk}.framework)
|
||||
if(EXISTS ${dir})
|
||||
set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
endif()
|
||||
@@ -0,0 +1,42 @@
|
||||
# - Check if a symbol exists as a function, variable, or macro in C++
|
||||
# CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
|
||||
#
|
||||
# Check that the <symbol> is available after including given header
|
||||
# <files> and store the result in a <variable>. Specify the list
|
||||
# of files in one argument as a semicolon-separated list.
|
||||
# CHECK_CXX_SYMBOL_EXISTS() can be used to check in C++ files, as opposed
|
||||
# to CHECK_SYMBOL_EXISTS(), which works only for C.
|
||||
#
|
||||
# If the header files define the symbol as a macro it is considered
|
||||
# available and assumed to work. If the header files declare the
|
||||
# symbol as a function or variable then the symbol must also be
|
||||
# available for linking. If the symbol is a type or enum value
|
||||
# it will not be recognized (consider using CheckTypeSize or
|
||||
# CheckCSourceCompiles).
|
||||
#
|
||||
# The following variables may be set before calling this macro to
|
||||
# modify the way the check is run:
|
||||
#
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2003-2011 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
include(CheckSymbolExists)
|
||||
|
||||
macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
|
||||
_CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
|
||||
endmacro()
|
||||
@@ -30,8 +30,15 @@ macro( create_bzr_version_header )
|
||||
set( _Bazaar_SAVED_LC_ALL "$ENV{LC_ALL}" )
|
||||
set( ENV{LC_ALL} C )
|
||||
|
||||
# Get the tree revison
|
||||
execute_process( COMMAND
|
||||
${Bazaar_EXECUTABLE} log -r-1 ${PROJECT_SOURCE_DIR}
|
||||
${Bazaar_EXECUTABLE} revno --tree ${PROJECT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE _bazaar_TREE_DATE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# Get more info about that revision
|
||||
execute_process( COMMAND
|
||||
${Bazaar_EXECUTABLE} log -r${_bazaar_TREE_DATE} ${PROJECT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE _bazaar_LAST_CHANGE_LOG
|
||||
ERROR_VARIABLE _bazaar_log_error
|
||||
RESULT_VARIABLE _bazaar_log_result
|
||||
@@ -56,11 +63,7 @@ macro( create_bzr_version_header )
|
||||
if( Kicad_REPO_LAST_CHANGED_DATE )
|
||||
string( REGEX REPLACE "^([0-9]+)\\-([0-9]+)\\-([0-9]+)" "\\1-\\2-\\3"
|
||||
_kicad_bzr_date ${Kicad_REPO_LAST_CHANGED_DATE} )
|
||||
if( KICAD_GOST )
|
||||
set( KICAD_BUILD_VERSION "(${_kicad_bzr_date} BZR ${Kicad_REPO_REVISION} GOST)" )
|
||||
else( KICAD_GOST )
|
||||
set( KICAD_BUILD_VERSION "(${_kicad_bzr_date} BZR ${Kicad_REPO_REVISION})" )
|
||||
endif( KICAD_GOST )
|
||||
set( KICAD_BUILD_VERSION "(${_kicad_bzr_date} BZR ${Kicad_REPO_REVISION})" )
|
||||
|
||||
# Definition to conditionally use date and revision returned from the
|
||||
# Bazaar log command instead of hand coded date and revision in
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
# - Try to find the CAIRO library
|
||||
# Once done this will define
|
||||
#
|
||||
# CAIRO_ROOT_DIR - Set this variable to the root installation of CAIRO
|
||||
#
|
||||
# Read-Only variables:
|
||||
# CAIRO_FOUND - system has the CAIRO library
|
||||
# CAIRO_INCLUDE_DIR - the CAIRO include directory
|
||||
# CAIRO_LIBRARIES - The libraries needed to use CAIRO
|
||||
# CAIRO_VERSION - This is set to $major.$minor.$revision (eg. 0.9.8)
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2012 Dmitry Baryshnikov <polimax at mail dot ru>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
if (UNIX)
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_CAIRO cairo)
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
endif (UNIX)
|
||||
|
||||
SET(_CAIRO_ROOT_HINTS
|
||||
$ENV{CAIRO}
|
||||
${CAIRO_ROOT_DIR}
|
||||
)
|
||||
SET(_CAIRO_ROOT_PATHS
|
||||
$ENV{CAIRO}/src
|
||||
/usr
|
||||
/usr/local
|
||||
)
|
||||
SET(_CAIRO_ROOT_HINTS_AND_PATHS
|
||||
HINTS ${_CAIRO_ROOT_HINTS}
|
||||
PATHS ${_CAIRO_ROOT_PATHS}
|
||||
)
|
||||
|
||||
FIND_PATH(CAIRO_INCLUDE_DIR
|
||||
NAMES
|
||||
cairo.h
|
||||
HINTS
|
||||
${_CAIRO_INCLUDEDIR}
|
||||
${_CAIRO_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
"include/cairo"
|
||||
)
|
||||
|
||||
IF(WIN32 AND NOT CYGWIN)
|
||||
# MINGW should go here too
|
||||
IF(MSVC)
|
||||
# Implementation details:
|
||||
# We are using the libraries located in the VC subdir instead of the parent directory eventhough :
|
||||
FIND_LIBRARY(CAIRO_DEBUG
|
||||
NAMES
|
||||
cairod
|
||||
${_CAIRO_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib"
|
||||
"VC"
|
||||
"lib/VC"
|
||||
)
|
||||
|
||||
FIND_LIBRARY(CAIRO_RELEASE
|
||||
NAMES
|
||||
cairo
|
||||
${_CAIRO_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib"
|
||||
"VC"
|
||||
"lib/VC"
|
||||
)
|
||||
|
||||
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
|
||||
if(NOT CAIRO_DEBUG)
|
||||
set(CAIRO_DEBUG ${CAIRO_RELEASE})
|
||||
endif(NOT CAIRO_DEBUG)
|
||||
set( CAIRO_LIBRARIES
|
||||
optimized ${CAIRO_RELEASE} debug ${CAIRO_DEBUG}
|
||||
)
|
||||
else()
|
||||
set( CAIRO_LIBRARIES ${CAIRO_RELEASE})
|
||||
endif()
|
||||
MARK_AS_ADVANCED(CAIRO_DEBUG CAIRO_RELEASE)
|
||||
ELSEIF(MINGW)
|
||||
# same player, for MingW
|
||||
FIND_LIBRARY(CAIRO
|
||||
NAMES
|
||||
cairo
|
||||
${_CAIRO_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib"
|
||||
"lib/MinGW"
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(CAIRO)
|
||||
set( CAIRO_LIBRARIES ${CAIRO})
|
||||
ELSE(MSVC)
|
||||
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
|
||||
FIND_LIBRARY(CAIRO
|
||||
NAMES
|
||||
cairo
|
||||
HINTS
|
||||
${_CAIRO_LIBDIR}
|
||||
${_CAIRO_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
lib
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(CAIRO)
|
||||
set( CAIRO_LIBRARIES ${CAIRO} )
|
||||
ENDIF(MSVC)
|
||||
ELSE(WIN32 AND NOT CYGWIN)
|
||||
|
||||
FIND_LIBRARY(CAIRO_LIBRARY
|
||||
NAMES
|
||||
cairo
|
||||
HINTS
|
||||
${_CAIRO_LIBDIR}
|
||||
${_CAIRO_ROOT_HINTS_AND_PATHS}
|
||||
PATH_SUFFIXES
|
||||
"lib"
|
||||
"local/lib"
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(CAIRO_LIBRARY)
|
||||
|
||||
# compat defines
|
||||
SET(CAIRO_LIBRARIES ${CAIRO_LIBRARY})
|
||||
|
||||
ENDIF(WIN32 AND NOT CYGWIN)
|
||||
|
||||
# if (CAIRO_INCLUDE_DIR)
|
||||
# file(READ "${CAIRO_INCLUDE_DIR}/gcore/gdal_version.h" _wxgisgdal_VERSION_H_CONTENTS)
|
||||
# string(REGEX REPLACE ".*# define[ \t]+GDAL_RELEASE_NAME[ \t]+\"([0-9A-Za-z.]+)\".*"
|
||||
# "\\1" CAIRO_VERSION ${_wxgisgdal_VERSION_H_CONTENTS})
|
||||
# set(CAIRO_VERSION ${CAIRO_VERSION} CACHE INTERNAL "The version number for wxgisgdal libraries")
|
||||
# endif (CAIRO_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# if (CAIRO_VERSION)
|
||||
# find_package_handle_standard_args(CAIRO
|
||||
# REQUIRED_VARS
|
||||
# CAIRO_LIBRARIES
|
||||
# CAIRO_INCLUDE_DIR
|
||||
# VERSION_VAR
|
||||
# CAIRO_VERSION
|
||||
# FAIL_MESSAGE
|
||||
# "Could NOT find CAIRO, try to set the path to CAIRO root folder in the system variable CAIRO_ROOT_DIR"
|
||||
# )
|
||||
# else (CAIRO_VERSION)
|
||||
find_package_handle_standard_args(CAIRO "Could NOT find CAIRO, try to set the path to CAIRO root folder in the system variable CAIRO"
|
||||
CAIRO_LIBRARIES
|
||||
CAIRO_INCLUDE_DIR
|
||||
)
|
||||
# endif (CAIRO_VERSION)
|
||||
|
||||
MARK_AS_ADVANCED(CAIRO_INCLUDE_DIR CAIRO_LIBRARIES)
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
# Copyright (c) 2009 Boudewijn Rempt <boud@valdyas.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
# - try to find glew library and include files
|
||||
# GLEW_INCLUDE_DIR, where to find GL/glew.h, etc.
|
||||
# GLEW_LIBRARIES, the libraries to link against
|
||||
# GLEW_FOUND, If false, do not try to use GLEW.
|
||||
# Also defined, but not for general use are:
|
||||
# GLEW_GLEW_LIBRARY = the full path to the glew library.
|
||||
|
||||
IF (WIN32)
|
||||
|
||||
IF(CYGWIN)
|
||||
|
||||
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h)
|
||||
|
||||
FIND_LIBRARY( GLEW_GLEW_LIBRARY glew32
|
||||
${OPENGL_LIBRARY_DIR}
|
||||
/usr/lib/w32api
|
||||
/usr/X11R6/lib
|
||||
)
|
||||
|
||||
|
||||
ELSE(CYGWIN)
|
||||
|
||||
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
|
||||
$ENV{GLEW_ROOT_PATH}/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY( GLEW_GLEW_LIBRARY
|
||||
NAMES glew glew32 glew32s
|
||||
PATHS
|
||||
$ENV{GLEW_ROOT_PATH}/lib
|
||||
${OPENGL_LIBRARY_DIR}
|
||||
)
|
||||
|
||||
ENDIF(CYGWIN)
|
||||
|
||||
ELSE (WIN32)
|
||||
|
||||
IF (APPLE)
|
||||
# These values for Apple could probably do with improvement.
|
||||
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
|
||||
/System/Library/Frameworks/GLEW.framework/Versions/A/Headers
|
||||
/opt/local/include
|
||||
${OPENGL_LIBRARY_DIR}
|
||||
)
|
||||
|
||||
FIND_LIBRARY( GLEW_GLEW_LIBRARY GLEW
|
||||
/opt/local/lib
|
||||
)
|
||||
|
||||
ELSE (APPLE)
|
||||
|
||||
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
|
||||
/usr/include/GL
|
||||
/usr/openwin/share/include
|
||||
/usr/openwin/include
|
||||
/usr/X11R6/include
|
||||
/usr/include/X11
|
||||
/opt/graphics/OpenGL/include
|
||||
/opt/graphics/OpenGL/contrib/libglew
|
||||
)
|
||||
|
||||
FIND_LIBRARY( GLEW_GLEW_LIBRARY GLEW
|
||||
/usr/openwin/lib
|
||||
/usr/X11R6/lib
|
||||
/usr/lib
|
||||
/usr/lib/x86_64-linux-gnu
|
||||
)
|
||||
|
||||
ENDIF (APPLE)
|
||||
|
||||
ENDIF (WIN32)
|
||||
|
||||
SET( GLEW_FOUND "NO" )
|
||||
IF(GLEW_INCLUDE_DIR)
|
||||
IF(GLEW_GLEW_LIBRARY)
|
||||
# Is -lXi and -lXmu required on all platforms that have it?
|
||||
# If not, we need some way to figure out what platform we are on.
|
||||
SET( GLEW_LIBRARIES
|
||||
${GLEW_GLEW_LIBRARY}
|
||||
${GLEW_cocoa_LIBRARY}
|
||||
)
|
||||
SET( GLEW_FOUND "YES" )
|
||||
|
||||
#The following deprecated settings are for backwards compatibility with CMake1.4
|
||||
SET (GLEW_LIBRARY ${GLEW_LIBRARIES})
|
||||
SET (GLEW_INCLUDE_PATH ${GLEW_INCLUDE_DIR})
|
||||
|
||||
ENDIF(GLEW_GLEW_LIBRARY)
|
||||
ENDIF(GLEW_INCLUDE_DIR)
|
||||
|
||||
IF(GLEW_FOUND)
|
||||
IF(NOT GLEW_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Glew: ${GLEW_LIBRARIES}")
|
||||
ENDIF(NOT GLEW_FIND_QUIETLY)
|
||||
ELSE(GLEW_FOUND)
|
||||
IF(GLEW_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find Glew")
|
||||
ENDIF(GLEW_FIND_REQUIRED)
|
||||
ENDIF(GLEW_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
GLEW_INCLUDE_DIR
|
||||
GLEW_GLEW_LIBRARY
|
||||
GLEW_Xmu_LIBRARY
|
||||
GLEW_Xi_LIBRARY
|
||||
)
|
||||
@@ -1,22 +1,22 @@
|
||||
# - Try to find Microsoft GDI+ build files.
|
||||
# Once done this will define
|
||||
#
|
||||
# GDI_PLUS_FOUND - system has GDI+
|
||||
# GDI_PLUS_INCLUDE_DIR - the GDI+ include directory
|
||||
# GDI_PLUS_LIBRARIES - Link these to use GDI+
|
||||
|
||||
if(GDI_PLUS_INCLUDE_DIR AND GDI_PLUS_LIBRARIES)
|
||||
set(GDI_PLUS_FIND_QUIETLY TRUE)
|
||||
endif(GDI_PLUS_INCLUDE_DIR AND GDI_PLUS_LIBRARIES)
|
||||
|
||||
find_path(GDI_PLUS_INCLUDE_DIR GdiPlus.h )
|
||||
|
||||
find_library(GDI_PLUS_LIBRARIES gdiplus )
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set GDI_PLUS_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(GDI_PLUS DEFAULT_MSG GDI_PLUS_LIBRARIES GDI_PLUS_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(GDI_PLUS_INCLUDE_DIR GDI_PLUS_LIBRARIES)
|
||||
# - Try to find Microsoft GDI+ build files.
|
||||
# Once done this will define
|
||||
#
|
||||
# GDI_PLUS_FOUND - system has GDI+
|
||||
# GDI_PLUS_INCLUDE_DIR - the GDI+ include directory
|
||||
# GDI_PLUS_LIBRARIES - Link these to use GDI+
|
||||
|
||||
if(GDI_PLUS_INCLUDE_DIR AND GDI_PLUS_LIBRARIES)
|
||||
set(GDI_PLUS_FIND_QUIETLY TRUE)
|
||||
endif(GDI_PLUS_INCLUDE_DIR AND GDI_PLUS_LIBRARIES)
|
||||
|
||||
find_path(GDI_PLUS_INCLUDE_DIR GdiPlus.h )
|
||||
|
||||
find_library(GDI_PLUS_LIBRARIES gdiplus )
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set GDI_PLUS_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(GDI_PLUS DEFAULT_MSG GDI_PLUS_LIBRARIES GDI_PLUS_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(GDI_PLUS_INCLUDE_DIR GDI_PLUS_LIBRARIES)
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
|
||||
#
|
||||
# This function is intended to be used in FindXXX.cmake modules files.
|
||||
# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE().
|
||||
# It also sets the <UPPERCASED_NAME>_FOUND variable.
|
||||
# The package is considered found if all variables <var1>... listed contain
|
||||
# valid results, e.g. valid filepaths.
|
||||
#
|
||||
# There are two modes of this function. The first argument in both modes is
|
||||
# the name of the Find-module where it is called (in original casing).
|
||||
#
|
||||
# The first simple mode looks like this:
|
||||
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
|
||||
# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND
|
||||
# will be set to TRUE.
|
||||
# If DEFAULT_MSG is given as second argument, then the function will generate
|
||||
# itself useful success and error messages. You can also supply a custom error message
|
||||
# for the failure case. This is not recommended.
|
||||
#
|
||||
# The second mode is more powerful and also supports version checking:
|
||||
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
|
||||
# [VERSION_VAR <versionvar>
|
||||
# [CONFIG_MODE]
|
||||
# [FAIL_MESSAGE "Custom failure message"] )
|
||||
#
|
||||
# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND
|
||||
# will be set to TRUE.
|
||||
# After REQUIRED_VARS the variables which are required for this package are listed.
|
||||
# Following VERSION_VAR the name of the variable can be specified which holds
|
||||
# the version of the package which has been found. If this is done, this version
|
||||
# will be checked against the (potentially) specified required version used
|
||||
# in the find_package() call. The EXACT keyword is also handled. The default
|
||||
# messages include information about the required version and the version
|
||||
# which has been actually found, both if the version is ok or not.
|
||||
# Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
|
||||
# a find_package(... NO_MODULE) call, in this case all the information
|
||||
# provided by the config-mode of find_package() will be evaluated
|
||||
# automatically.
|
||||
# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
|
||||
# used, the default message will be displayed.
|
||||
#
|
||||
# Example for mode 1:
|
||||
#
|
||||
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
|
||||
#
|
||||
# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
|
||||
# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
|
||||
# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
|
||||
# independent whether QUIET was used or not.
|
||||
# If it is found, success will be reported, including the content of <var1>.
|
||||
# On repeated Cmake runs, the same message won't be printed again.
|
||||
#
|
||||
# Example for mode 2:
|
||||
#
|
||||
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
|
||||
# VERSION_VAR BISON_VERSION)
|
||||
# In this case, BISON is considered to be found if the variable(s) listed
|
||||
# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case.
|
||||
# Also the version of BISON will be checked by using the version contained
|
||||
# in BISON_VERSION.
|
||||
# Since no FAIL_MESSAGE is given, the default messages will be printed.
|
||||
#
|
||||
# Another example for mode 2:
|
||||
#
|
||||
# FIND_PACKAGE(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
|
||||
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4 CONFIG_MODE)
|
||||
# In this case, FindAutmoc4.cmake wraps a call to FIND_PACKAGE(Automoc4 NO_MODULE)
|
||||
# and adds an additional search directory for automoc4.
|
||||
# The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
|
||||
# success/error message.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2007-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
INCLUDE(FindPackageMessage)
|
||||
INCLUDE(CMakeParseArguments)
|
||||
|
||||
# internal helper macro
|
||||
MACRO(_FPHSA_FAILURE_MESSAGE _msg)
|
||||
IF (${_NAME}_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "${_msg}")
|
||||
ELSE (${_NAME}_FIND_REQUIRED)
|
||||
IF (NOT ${_NAME}_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "${_msg}")
|
||||
ENDIF (NOT ${_NAME}_FIND_QUIETLY)
|
||||
ENDIF (${_NAME}_FIND_REQUIRED)
|
||||
ENDMACRO(_FPHSA_FAILURE_MESSAGE _msg)
|
||||
|
||||
|
||||
# internal helper macro to generate the failure message when used in CONFIG_MODE:
|
||||
MACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
|
||||
# <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
|
||||
IF(${_NAME}_CONFIG)
|
||||
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
|
||||
ELSE(${_NAME}_CONFIG)
|
||||
# If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
|
||||
# List them all in the error message:
|
||||
IF(${_NAME}_CONSIDERED_CONFIGS)
|
||||
SET(configsText "")
|
||||
LIST(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
|
||||
MATH(EXPR configsCount "${configsCount} - 1")
|
||||
FOREACH(currentConfigIndex RANGE ${configsCount})
|
||||
LIST(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
|
||||
LIST(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
|
||||
SET(configsText "${configsText} ${filename} (version ${version})\n")
|
||||
ENDFOREACH(currentConfigIndex)
|
||||
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
|
||||
|
||||
ELSE(${_NAME}_CONSIDERED_CONFIGS)
|
||||
# Simple case: No Config-file was found at all:
|
||||
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
|
||||
ENDIF(${_NAME}_CONSIDERED_CONFIGS)
|
||||
ENDIF(${_NAME}_CONFIG)
|
||||
ENDMACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
|
||||
|
||||
|
||||
FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
|
||||
|
||||
# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
|
||||
# new extended or in the "old" mode:
|
||||
SET(options CONFIG_MODE)
|
||||
SET(oneValueArgs FAIL_MESSAGE VERSION_VAR)
|
||||
SET(multiValueArgs REQUIRED_VARS)
|
||||
SET(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
|
||||
LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
|
||||
|
||||
IF(${INDEX} EQUAL -1)
|
||||
SET(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
|
||||
SET(FPHSA_REQUIRED_VARS ${ARGN})
|
||||
SET(FPHSA_VERSION_VAR)
|
||||
ELSE(${INDEX} EQUAL -1)
|
||||
|
||||
CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
|
||||
|
||||
IF(FPHSA_UNPARSED_ARGUMENTS)
|
||||
MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
|
||||
ENDIF(FPHSA_UNPARSED_ARGUMENTS)
|
||||
|
||||
IF(NOT FPHSA_FAIL_MESSAGE)
|
||||
SET(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
|
||||
ENDIF(NOT FPHSA_FAIL_MESSAGE)
|
||||
ENDIF(${INDEX} EQUAL -1)
|
||||
|
||||
# now that we collected all arguments, process them
|
||||
|
||||
IF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
|
||||
SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
|
||||
ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
|
||||
|
||||
# In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
|
||||
# when it successfully found the config-file, including version checking:
|
||||
IF(FPHSA_CONFIG_MODE)
|
||||
LIST(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
|
||||
LIST(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
|
||||
SET(FPHSA_VERSION_VAR ${_NAME}_VERSION)
|
||||
ENDIF(FPHSA_CONFIG_MODE)
|
||||
|
||||
IF(NOT FPHSA_REQUIRED_VARS)
|
||||
MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
|
||||
ENDIF(NOT FPHSA_REQUIRED_VARS)
|
||||
|
||||
LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
|
||||
|
||||
STRING(TOUPPER ${_NAME} _NAME_UPPER)
|
||||
STRING(TOLOWER ${_NAME} _NAME_LOWER)
|
||||
|
||||
# collect all variables which were not found, so they can be printed, so the
|
||||
# user knows better what went wrong (#6375)
|
||||
SET(MISSING_VARS "")
|
||||
SET(DETAILS "")
|
||||
SET(${_NAME_UPPER}_FOUND TRUE)
|
||||
# check if all passed variables are valid
|
||||
FOREACH(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
|
||||
IF(NOT ${_CURRENT_VAR})
|
||||
SET(${_NAME_UPPER}_FOUND FALSE)
|
||||
SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
|
||||
ELSE(NOT ${_CURRENT_VAR})
|
||||
SET(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
|
||||
ENDIF(NOT ${_CURRENT_VAR})
|
||||
ENDFOREACH(_CURRENT_VAR)
|
||||
|
||||
|
||||
# version handling:
|
||||
SET(VERSION_MSG "")
|
||||
SET(VERSION_OK TRUE)
|
||||
SET(VERSION ${${FPHSA_VERSION_VAR}} )
|
||||
IF (${_NAME}_FIND_VERSION)
|
||||
|
||||
IF(VERSION)
|
||||
|
||||
IF(${_NAME}_FIND_VERSION_EXACT) # exact version required
|
||||
IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
|
||||
SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
|
||||
SET(VERSION_OK FALSE)
|
||||
ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
|
||||
SET(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
|
||||
ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
|
||||
|
||||
ELSE(${_NAME}_FIND_VERSION_EXACT) # minimum version specified:
|
||||
IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
|
||||
SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
|
||||
SET(VERSION_OK FALSE)
|
||||
ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
|
||||
SET(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
|
||||
ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
|
||||
ENDIF(${_NAME}_FIND_VERSION_EXACT)
|
||||
|
||||
ELSE(VERSION)
|
||||
|
||||
# if the package was not found, but a version was given, add that to the output:
|
||||
IF(${_NAME}_FIND_VERSION_EXACT)
|
||||
SET(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
|
||||
ELSE(${_NAME}_FIND_VERSION_EXACT)
|
||||
SET(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
|
||||
ENDIF(${_NAME}_FIND_VERSION_EXACT)
|
||||
|
||||
ENDIF(VERSION)
|
||||
ELSE (${_NAME}_FIND_VERSION)
|
||||
IF(VERSION)
|
||||
SET(VERSION_MSG "(found version \"${VERSION}\")")
|
||||
ENDIF(VERSION)
|
||||
ENDIF (${_NAME}_FIND_VERSION)
|
||||
|
||||
IF(VERSION_OK)
|
||||
SET(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
|
||||
ELSE(VERSION_OK)
|
||||
SET(${_NAME_UPPER}_FOUND FALSE)
|
||||
ENDIF(VERSION_OK)
|
||||
|
||||
|
||||
# print the result:
|
||||
IF (${_NAME_UPPER}_FOUND)
|
||||
FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}")
|
||||
ELSE (${_NAME_UPPER}_FOUND)
|
||||
|
||||
IF(FPHSA_CONFIG_MODE)
|
||||
_FPHSA_HANDLE_FAILURE_CONFIG_MODE()
|
||||
ELSE(FPHSA_CONFIG_MODE)
|
||||
IF(NOT VERSION_OK)
|
||||
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
|
||||
ELSE(NOT VERSION_OK)
|
||||
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
|
||||
ENDIF(NOT VERSION_OK)
|
||||
ENDIF(FPHSA_CONFIG_MODE)
|
||||
|
||||
ENDIF (${_NAME_UPPER}_FOUND)
|
||||
|
||||
SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
|
||||
|
||||
ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
|
||||
@@ -0,0 +1,175 @@
|
||||
# - Find python interpreter
|
||||
# This module finds if Python interpreter is installed and determines where the
|
||||
# executables are. This code sets the following variables:
|
||||
#
|
||||
# PYTHONINTERP_FOUND - Was the Python executable found
|
||||
# PYTHON_EXECUTABLE - path to the Python interpreter
|
||||
#
|
||||
# PYTHON_VERSION_STRING - Python version found e.g. 2.5.2
|
||||
# PYTHON_VERSION_MAJOR - Python major version found e.g. 2
|
||||
# PYTHON_VERSION_MINOR - Python minor version found e.g. 5
|
||||
# PYTHON_VERSION_PATCH - Python patch version found e.g. 2
|
||||
#
|
||||
# The Python_ADDITIONAL_VERSIONS variable can be used to specify a list of
|
||||
# version numbers that should be taken into account when searching for Python.
|
||||
# You need to set this variable before calling find_package(PythonInterp).
|
||||
#
|
||||
# You can point to a preferred python install to use by setting the following
|
||||
# to the point at the root directory of the python install:
|
||||
#
|
||||
# PYTHON_ROOT_DIR - The root directory of the python install
|
||||
#=============================================================================
|
||||
# Copyright 2005-2010 Kitware, Inc.
|
||||
# Copyright 2011 Bjoern Ricks <bjoern.ricks@gmail.com>
|
||||
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
unset(_Python_NAMES)
|
||||
|
||||
set(_PYTHON1_VERSIONS 1.6 1.5)
|
||||
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
|
||||
set(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)
|
||||
|
||||
if(PythonInterp_FIND_VERSION)
|
||||
if(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
|
||||
string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonInterp_FIND_VERSION}")
|
||||
string(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
|
||||
list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN} python${_PYTHON_FIND_MAJ})
|
||||
unset(_PYTHON_FIND_OTHER_VERSIONS)
|
||||
if(NOT PythonInterp_FIND_VERSION_EXACT)
|
||||
foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
|
||||
if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
|
||||
list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
unset(_PYTHON_FIND_MAJ_MIN)
|
||||
unset(_PYTHON_FIND_MAJ)
|
||||
else()
|
||||
list(APPEND _Python_NAMES python${PythonInterp_FIND_VERSION})
|
||||
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonInterp_FIND_VERSION}_VERSIONS})
|
||||
endif()
|
||||
else()
|
||||
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
|
||||
endif()
|
||||
|
||||
list(APPEND _Python_NAMES python)
|
||||
|
||||
# Search for the preferred executable first
|
||||
if( ${PYTHON_ROOT_DIR} )
|
||||
# Search for any of the executable names solely in the directory we've
|
||||
# been pointed to. Failure to find the python executable here is a fatal
|
||||
# fail.
|
||||
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES}
|
||||
PATHS ${PYTHON_ROOT_DIR}
|
||||
NO_DEFAULT_PATH )
|
||||
else()
|
||||
# If there is no specific path given, look for python in the path
|
||||
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
|
||||
endif()
|
||||
|
||||
# Set up the versions we know about, in the order we will search. Always add
|
||||
# the user supplied additional versions to the front.
|
||||
set(_Python_VERSIONS
|
||||
${Python_ADDITIONAL_VERSIONS}
|
||||
${_PYTHON_FIND_OTHER_VERSIONS}
|
||||
)
|
||||
|
||||
unset(_PYTHON_FIND_OTHER_VERSIONS)
|
||||
unset(_PYTHON1_VERSIONS)
|
||||
unset(_PYTHON2_VERSIONS)
|
||||
unset(_PYTHON3_VERSIONS)
|
||||
|
||||
# Search for newest python version if python executable isn't found
|
||||
if(NOT PYTHON_EXECUTABLE)
|
||||
|
||||
# If using the MINGW compiler, we mustn't find the standard python
|
||||
# distribution because of multiple C-Runtime errors. We must instead
|
||||
# use the Python-a-mingw-us distribution
|
||||
if(MINGW)
|
||||
list( APPEND _Python_PPATHS ${PYTHON_ROOT_DIR} )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.9" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.8" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.7" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.6" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.5" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.4" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.3" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.2" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.1" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.0" )
|
||||
else()
|
||||
list( APPEND _Python_PPATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] )
|
||||
endif()
|
||||
|
||||
foreach(_CURRENT_VERSION ${_Python_VERSIONS})
|
||||
set(_Python_NAMES python${_CURRENT_VERSION})
|
||||
if(WIN32)
|
||||
list(APPEND _Python_NAMES python)
|
||||
endif()
|
||||
find_program(PYTHON_EXECUTABLE
|
||||
NAMES ${_Python_NAMES}
|
||||
PATHS ${_Python_PPATHS}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# determine python version string
|
||||
if(PYTHON_EXECUTABLE)
|
||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
|
||||
"import sys; sys.stdout.write(';'.join([str(x) for x in sys.version_info[:3]]))"
|
||||
OUTPUT_VARIABLE _VERSION
|
||||
RESULT_VARIABLE _PYTHON_VERSION_RESULT
|
||||
ERROR_QUIET)
|
||||
if(NOT _PYTHON_VERSION_RESULT)
|
||||
string(REPLACE ";" "." PYTHON_VERSION_STRING "${_VERSION}")
|
||||
list(GET _VERSION 0 PYTHON_VERSION_MAJOR)
|
||||
list(GET _VERSION 1 PYTHON_VERSION_MINOR)
|
||||
list(GET _VERSION 2 PYTHON_VERSION_PATCH)
|
||||
if(PYTHON_VERSION_PATCH EQUAL 0)
|
||||
# it's called "Python 2.7", not "2.7.0"
|
||||
string(REGEX REPLACE "\\.0$" "" PYTHON_VERSION_STRING "${PYTHON_VERSION_STRING}")
|
||||
endif()
|
||||
else()
|
||||
# sys.version predates sys.version_info, so use that
|
||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import sys; sys.stdout.write(sys.version)"
|
||||
OUTPUT_VARIABLE _VERSION
|
||||
RESULT_VARIABLE _PYTHON_VERSION_RESULT
|
||||
ERROR_QUIET)
|
||||
if(NOT _PYTHON_VERSION_RESULT)
|
||||
string(REGEX REPLACE " .*" "" PYTHON_VERSION_STRING "${_VERSION}")
|
||||
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION_STRING}")
|
||||
string(REGEX REPLACE "^[0-9]+\\.([0-9])+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION_STRING}")
|
||||
if(PYTHON_VERSION_STRING MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+.*")
|
||||
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION_STRING}")
|
||||
else()
|
||||
set(PYTHON_VERSION_PATCH "0")
|
||||
endif()
|
||||
else()
|
||||
# sys.version was first documented for Python 1.5, so assume
|
||||
# this is older.
|
||||
set(PYTHON_VERSION_STRING "1.4")
|
||||
set(PYTHON_VERSION_MAJOR "1")
|
||||
set(PYTHON_VERSION_MAJOR "4")
|
||||
set(PYTHON_VERSION_MAJOR "0")
|
||||
endif()
|
||||
endif()
|
||||
unset(_PYTHON_VERSION_RESULT)
|
||||
unset(_VERSION)
|
||||
endif()
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonInterp REQUIRED_VARS PYTHON_EXECUTABLE VERSION_VAR PYTHON_VERSION_STRING)
|
||||
|
||||
mark_as_advanced(PYTHON_EXECUTABLE)
|
||||
@@ -0,0 +1,338 @@
|
||||
# - Find python libraries
|
||||
# This module finds if Python is installed and determines where the
|
||||
# include files and libraries are. It also determines what the name of
|
||||
# the library is. This code sets the following variables:
|
||||
#
|
||||
# PYTHONLIBS_FOUND - have the Python libs been found
|
||||
# PYTHON_LIBRARIES - path to the python library
|
||||
# PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
|
||||
# PYTHON_INCLUDE_DIRS - path to where Python.h is found
|
||||
# PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated)
|
||||
# PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8)
|
||||
#
|
||||
# The Python_ADDITIONAL_VERSIONS variable can be used to specify a list of
|
||||
# version numbers that should be taken into account when searching for Python.
|
||||
# You need to set this variable before calling find_package(PythonLibs).
|
||||
#
|
||||
# You can point to a preferred python install to use by setting the following
|
||||
# to the point at the root directory of the python install:
|
||||
#
|
||||
# PYTHON_ROOT_DIR - The root directory of the python install
|
||||
#
|
||||
# If you'd like to specify the installation of Python to use, you should modify
|
||||
# the following cache variables:
|
||||
# PYTHON_LIBRARY - path to the python library
|
||||
# PYTHON_INCLUDE_DIR - path to where Python.h is found
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2001-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindFrameworks.cmake)
|
||||
# Search for the python framework on Apple.
|
||||
CMAKE_FIND_FRAMEWORKS(Python)
|
||||
|
||||
set(_PYTHON1_VERSIONS 1.6 1.5)
|
||||
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
|
||||
set(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)
|
||||
|
||||
if(PythonLibs_FIND_VERSION)
|
||||
if(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
|
||||
string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}")
|
||||
string(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
|
||||
unset(_PYTHON_FIND_OTHER_VERSIONS)
|
||||
if(PythonLibs_FIND_VERSION_EXACT)
|
||||
if(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
|
||||
set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}")
|
||||
else()
|
||||
set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}")
|
||||
endif()
|
||||
else()
|
||||
foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
|
||||
if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
|
||||
list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
unset(_PYTHON_FIND_MAJ_MIN)
|
||||
unset(_PYTHON_FIND_MAJ)
|
||||
else()
|
||||
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS})
|
||||
endif()
|
||||
else()
|
||||
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
|
||||
endif()
|
||||
|
||||
# Set up the versions we know about, in the order we will search. Always add
|
||||
# the user supplied additional versions to the front.
|
||||
set(_Python_VERSIONS
|
||||
${Python_ADDITIONAL_VERSIONS}
|
||||
${_PYTHON_FIND_OTHER_VERSIONS}
|
||||
)
|
||||
|
||||
unset(_PYTHON_FIND_OTHER_VERSIONS)
|
||||
unset(_PYTHON1_VERSIONS)
|
||||
unset(_PYTHON2_VERSIONS)
|
||||
unset(_PYTHON3_VERSIONS)
|
||||
|
||||
foreach(_CURRENT_VERSION ${_Python_VERSIONS})
|
||||
string(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
|
||||
if(WIN32)
|
||||
if(MINGW)
|
||||
find_library(PYTHON_DEBUG_LIBRARY
|
||||
NAMES python{$_CURRENT_VERSION}_d
|
||||
PATHS
|
||||
"${PYTHON_ROOT_DIR}"
|
||||
"C:/python/${_CURRENT_VERSION}.9"
|
||||
"C:/python/${_CURRENT_VERSION}.8"
|
||||
"C:/python/${_CURRENT_VERSION}.7"
|
||||
"C:/python/${_CURRENT_VERSION}.6"
|
||||
"C:/python/${_CURRENT_VERSION}.5"
|
||||
"C:/python/${_CURRENT_VERSION}.4"
|
||||
"C:/python/${_CURRENT_VERSION}.3"
|
||||
"C:/python/${_CURRENT_VERSION}.2"
|
||||
"C:/python/${_CURRENT_VERSION}.1"
|
||||
"C:/python/${_CURRENT_VERSION}.0"
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
else()
|
||||
find_library(PYTHON_DEBUG_LIBRARY
|
||||
NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
find_library(PYTHON_LIBRARY
|
||||
NAMES python${_CURRENT_VERSION}
|
||||
PATHS
|
||||
"${PYTHON_ROOT_DIR}"
|
||||
"C:/python/${_CURRENT_VERSION}.9"
|
||||
"C:/python/${_CURRENT_VERSION}.8"
|
||||
"C:/python/${_CURRENT_VERSION}.7"
|
||||
"C:/python/${_CURRENT_VERSION}.6"
|
||||
"C:/python/${_CURRENT_VERSION}.5"
|
||||
"C:/python/${_CURRENT_VERSION}.4"
|
||||
"C:/python/${_CURRENT_VERSION}.3"
|
||||
"C:/python/${_CURRENT_VERSION}.2"
|
||||
"C:/python/${_CURRENT_VERSION}.1"
|
||||
"C:/python/${_CURRENT_VERSION}.0"
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
else()
|
||||
find_library(PYTHON_LIBRARY
|
||||
NAMES
|
||||
python${_CURRENT_VERSION_NO_DOTS}
|
||||
python${_CURRENT_VERSION}mu
|
||||
python${_CURRENT_VERSION}m
|
||||
python${_CURRENT_VERSION}u
|
||||
python${_CURRENT_VERSION}
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
|
||||
# Avoid finding the .dll in the PATH. We want the .lib.
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
endif()
|
||||
|
||||
# Look for the static library in the Python config directory
|
||||
find_library(PYTHON_LIBRARY
|
||||
NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
|
||||
# Avoid finding the .dll in the PATH. We want the .lib.
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
# This is where the static library is usually located
|
||||
PATH_SUFFIXES python${_CURRENT_VERSION}/config
|
||||
)
|
||||
|
||||
|
||||
# For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if
|
||||
# PYTHON_INCLUDE_DIR is not set.
|
||||
if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
|
||||
set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
|
||||
"Path to where Python.h is found" FORCE)
|
||||
endif()
|
||||
|
||||
set(PYTHON_FRAMEWORK_INCLUDES)
|
||||
if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
|
||||
foreach(dir ${Python_FRAMEWORKS})
|
||||
set(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
|
||||
${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
find_path(PYTHON_INCLUDE_DIR
|
||||
NAMES Python.h
|
||||
PATHS
|
||||
"${PYTHON_ROOT_DIR}/include"
|
||||
"C:/python/${_CURRENT_VERSION}.9/include"
|
||||
"C:/python/${_CURRENT_VERSION}.8/include"
|
||||
"C:/python/${_CURRENT_VERSION}.7/include"
|
||||
"C:/python/${_CURRENT_VERSION}.6/include"
|
||||
"C:/python/${_CURRENT_VERSION}.5/include"
|
||||
"C:/python/${_CURRENT_VERSION}.4/include"
|
||||
"C:/python/${_CURRENT_VERSION}.3/include"
|
||||
"C:/python/${_CURRENT_VERSION}.2/include"
|
||||
"C:/python/${_CURRENT_VERSION}.1/include"
|
||||
"C:/python/${_CURRENT_VERSION}.0/include"
|
||||
)
|
||||
else()
|
||||
find_path(PYTHON_INCLUDE_DIR
|
||||
NAMES Python.h
|
||||
PATHS
|
||||
${PYTHON_FRAMEWORK_INCLUDES}
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
|
||||
PATH_SUFFIXES
|
||||
python${_CURRENT_VERSION}mu
|
||||
python${_CURRENT_VERSION}m
|
||||
python${_CURRENT_VERSION}u
|
||||
python${_CURRENT_VERSION}
|
||||
)
|
||||
endif()
|
||||
|
||||
# For backward compatibility, set PYTHON_INCLUDE_PATH.
|
||||
set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
|
||||
|
||||
if(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
|
||||
file(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str
|
||||
REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
|
||||
string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
|
||||
PYTHONLIBS_VERSION_STRING "${python_version_str}")
|
||||
unset(python_version_str)
|
||||
endif()
|
||||
|
||||
if(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
mark_as_advanced(
|
||||
PYTHON_DEBUG_LIBRARY
|
||||
PYTHON_LIBRARY
|
||||
PYTHON_INCLUDE_DIR
|
||||
)
|
||||
|
||||
# We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the
|
||||
# cache entries because they are meant to specify the location of a single
|
||||
# library. We now set the variables listed by the documentation for this
|
||||
# module.
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
|
||||
set(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
|
||||
|
||||
# These variables have been historically named in this module different from
|
||||
# what SELECT_LIBRARY_CONFIGURATIONS() expects.
|
||||
set(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}")
|
||||
set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}")
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
|
||||
SELECT_LIBRARY_CONFIGURATIONS(PYTHON)
|
||||
# SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library.
|
||||
# Unset this, this prefix doesn't match the module prefix, they are different
|
||||
# for historical reasons.
|
||||
unset(PYTHON_FOUND)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
|
||||
REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS
|
||||
VERSION_VAR PYTHONLIBS_VERSION_STRING)
|
||||
|
||||
# PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.
|
||||
# PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include
|
||||
# in your sources to initialize the static python modules
|
||||
function(PYTHON_ADD_MODULE _NAME )
|
||||
get_property(_TARGET_SUPPORTS_SHARED_LIBS
|
||||
GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
|
||||
option(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
|
||||
option(PYTHON_MODULE_${_NAME}_BUILD_SHARED
|
||||
"Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS})
|
||||
|
||||
# Mark these options as advanced
|
||||
mark_as_advanced(PYTHON_ENABLE_MODULE_${_NAME}
|
||||
PYTHON_MODULE_${_NAME}_BUILD_SHARED)
|
||||
|
||||
if(PYTHON_ENABLE_MODULE_${_NAME})
|
||||
if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
|
||||
set(PY_MODULE_TYPE MODULE)
|
||||
else()
|
||||
set(PY_MODULE_TYPE STATIC)
|
||||
set_property(GLOBAL APPEND PROPERTY PY_STATIC_MODULES_LIST ${_NAME})
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY PY_MODULES_LIST ${_NAME})
|
||||
add_library(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
|
||||
# target_link_libraries(${_NAME} ${PYTHON_LIBRARIES})
|
||||
|
||||
if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
|
||||
set_target_properties(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
|
||||
if(WIN32 AND NOT CYGWIN)
|
||||
set_target_properties(${_NAME} PROPERTIES SUFFIX ".pyd")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(PYTHON_WRITE_MODULES_HEADER _filename)
|
||||
|
||||
get_property(PY_STATIC_MODULES_LIST GLOBAL PROPERTY PY_STATIC_MODULES_LIST)
|
||||
|
||||
get_filename_component(_name "${_filename}" NAME)
|
||||
string(REPLACE "." "_" _name "${_name}")
|
||||
string(TOUPPER ${_name} _nameUpper)
|
||||
set(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename})
|
||||
|
||||
set(_filenameTmp "${_filename}.in")
|
||||
file(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")
|
||||
file(APPEND ${_filenameTmp}
|
||||
"#ifndef ${_nameUpper}
|
||||
#define ${_nameUpper}
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern \"C\" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
")
|
||||
|
||||
foreach(_currentModule ${PY_STATIC_MODULES_LIST})
|
||||
file(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${_filenameTmp}
|
||||
"#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
")
|
||||
|
||||
|
||||
foreach(_currentModule ${PY_STATIC_MODULES_LIST})
|
||||
file(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n")
|
||||
foreach(_currentModule ${PY_STATIC_MODULES_LIST})
|
||||
file(APPEND ${_filenameTmp} " ${_name}_${_currentModule}();\n")
|
||||
endforeach()
|
||||
file(APPEND ${_filenameTmp} "}\n\n")
|
||||
file(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")
|
||||
|
||||
# with configure_file() cmake complains that you may not use a file created using file(WRITE) as input file for configure_file()
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
|
||||
|
||||
endfunction()
|
||||
+1072
-1044
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,10 @@
|
||||
|
||||
|
||||
# Function make_lexer
|
||||
# is a standard way to invoke TokenList2DsnLexer.cmake
|
||||
# is a standard way to invoke TokenList2DsnLexer.cmake.
|
||||
# Extra arguments are treated as source files which depend on the generated
|
||||
# outHeaderFile
|
||||
|
||||
function( make_lexer inputFile outHeaderFile outCppFile enum )
|
||||
add_custom_command(
|
||||
OUTPUT ${outHeaderFile}
|
||||
@@ -41,5 +44,28 @@ function( make_lexer inputFile outHeaderFile outCppFile enum )
|
||||
${outCppFile} from
|
||||
${inputFile}"
|
||||
)
|
||||
|
||||
# extra_args, if any, are treated as source files (typically headers) which
|
||||
# are known to depend on the generated outHeader.
|
||||
foreach( extra_arg ${ARGN} )
|
||||
set_source_files_properties( ${extra_arg}
|
||||
PROPERTIES OBJECT_DEPENDS ${outHeaderFile}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
endfunction()
|
||||
|
||||
|
||||
# Is a macro instead of function so there's a higher probability that the
|
||||
# scope of CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA is global
|
||||
macro( add_conffiles )
|
||||
if( ${ARGC} STREQUAL "0" )
|
||||
# remove the file when user passes no arguments, which he should do exactly once at top
|
||||
file( REMOVE ${CMAKE_CURRENT_BINARY_DIR}/conffiles )
|
||||
else()
|
||||
foreach( filename ${ARGV} )
|
||||
file( APPEND ${CMAKE_CURRENT_BINARY_DIR}/conffiles "${filename}\n" )
|
||||
endforeach()
|
||||
set( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_CURRENT_BINARY_DIR}/conffiles )
|
||||
endif()
|
||||
endmacro( add_conffiles )
|
||||
|
||||
@@ -8,5 +8,6 @@ file( STRINGS ${inputFile} lines )
|
||||
file( WRITE ${outputFile} "// Do not edit this file, it is autogenerated by CMake from an HTML file\n" )
|
||||
|
||||
foreach( line ${lines} )
|
||||
file( APPEND ${outputFile} "\"" ${line} "\"\n" )
|
||||
STRING(REGEX REPLACE "\"" "\\\\\"" linem ${line})
|
||||
file( APPEND ${outputFile} "\"" ${linem} "\\n\"\n" )
|
||||
endforeach( line ${lines} )
|
||||
|
||||
@@ -47,7 +47,7 @@ set( output_begin "
|
||||
* PNG2cpp CMake script, using a *.png file as input.
|
||||
*/
|
||||
|
||||
#include \"bitmaps.h\"
|
||||
#include <bitmaps.h>
|
||||
|
||||
static const unsigned char png[] = {"
|
||||
)
|
||||
|
||||
@@ -1,77 +1,117 @@
|
||||
#
|
||||
# Check for platform specific features and generate configuration header..
|
||||
#
|
||||
# This cmake file was written to create a platform specific configuration
|
||||
# header to handle differences between build platforms. Please add new
|
||||
# feature checks to this file. Always check the wxWidgets headers first
|
||||
# before adding new feature checks. The wxWidgets build system does a
|
||||
# very good job of handling platform and compiler differences.
|
||||
#
|
||||
# Should you feel the need to do this:
|
||||
#
|
||||
# #ifdef SYSTEM_A
|
||||
# # include <some_header_for_system_a.h>
|
||||
# #elif SYSTEM_B
|
||||
# # include <some_other_header_for_system_b.h>
|
||||
# #elif SYSTEM_C
|
||||
# # include <yet_another_header_for_system_c.h>
|
||||
# #endif
|
||||
#
|
||||
# in your source, don't. It is not portable nor is it maintainable.
|
||||
# Use cmake to detect system specific dependencies and update the
|
||||
# configuration header instead.
|
||||
#
|
||||
# See this link for information on writing cmake system checks:
|
||||
#
|
||||
# http://www.vtk.org/Wiki/CMake_HowToDoPlatformChecks
|
||||
#
|
||||
# More importantly see "Recommendations for Writing Autoconf Macros" in:
|
||||
#
|
||||
# http://www.lrde.epita.fr/~adl/dl/autotools.pdf
|
||||
#
|
||||
# for an explanation of why you should do this. Even though this is an
|
||||
# autotools tutorial. This section clearly explains why checking for
|
||||
# features is superior to checking for systems. The previous section of
|
||||
# this tutorial shows how to create a system independent check for _mkdir().
|
||||
# Consider it a benchmark when writing your own feature tests.
|
||||
#
|
||||
|
||||
macro(perform_feature_checks)
|
||||
|
||||
include(CheckIncludeFile)
|
||||
|
||||
check_include_file("malloc.h" HAVE_MALLOC_H)
|
||||
|
||||
# FIXME: Visual C++ does not support the "not" keyword natively. It is
|
||||
# defined as a macro in <iso646.h>. There should be a cmake macro
|
||||
# to check if compiler supports the not keyword natively. If not,
|
||||
# then check for <iso646.h> and include it. Although it doesn't
|
||||
# appear to cause any problems with other compilers, that doesn't
|
||||
# mean won't fail somewhere down the line.
|
||||
check_include_file("iso646.h" HAVE_ISO646_H)
|
||||
|
||||
# no place is this used, and "HAVE_STRINGS_H", if present in config.h then
|
||||
# conflicts with /usr/include/python2.6/Python.h. Please rename the macro if
|
||||
# re-introduce this.
|
||||
# check_include_file("strings.h" HAVE_STRINGS_H)
|
||||
|
||||
include(CheckSymbolExists)
|
||||
check_symbol_exists(strcasecmp "string.h" HAVE_STRCASECMP)
|
||||
check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)
|
||||
check_symbol_exists(strncasecmp "string.h" HAVE_STRNCASECMP)
|
||||
check_symbol_exists(strncasecmp "strings.h" HAVE_STRNCASECMP)
|
||||
|
||||
# Some platforms define malloc and free in malloc.h instead of stdlib.h.
|
||||
check_symbol_exists(malloc "stdlib.h" MALLOC_IN_STDLIB_H)
|
||||
|
||||
# Use ISO C++ conformant names to disable Visual C++ warnings.
|
||||
check_symbol_exists(_stricmp "string.h" HAVE_ISO_STRICMP)
|
||||
check_symbol_exists(_strnicmp "string.h" HAVE_ISO_STRNICMP)
|
||||
check_symbol_exists(_snprintf "stdio.h" HAVE_ISO_SNPRINTF)
|
||||
check_symbol_exists(_hypot "math.h" HAVE_ISO_HYPOT)
|
||||
|
||||
# Generate config.h.
|
||||
configure_file(${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake
|
||||
${CMAKE_BINARY_DIR}/config.h)
|
||||
|
||||
endmacro(perform_feature_checks)
|
||||
#
|
||||
# Check for platform specific features and generate configuration header..
|
||||
#
|
||||
# This cmake file was written to create a platform specific configuration
|
||||
# header to handle differences between build platforms. Please add new
|
||||
# feature checks to this file. Always check the wxWidgets headers first
|
||||
# before adding new feature checks. The wxWidgets build system does a
|
||||
# very good job of handling platform and compiler differences.
|
||||
#
|
||||
# Should you feel the need to do this:
|
||||
#
|
||||
# #ifdef SYSTEM_A
|
||||
# # include <some_header_for_system_a.h>
|
||||
# #elif SYSTEM_B
|
||||
# # include <some_other_header_for_system_b.h>
|
||||
# #elif SYSTEM_C
|
||||
# # include <yet_another_header_for_system_c.h>
|
||||
# #endif
|
||||
#
|
||||
# in your source, don't. It is not portable nor is it maintainable.
|
||||
# Use cmake to detect system specific dependencies and update the
|
||||
# configuration header instead.
|
||||
#
|
||||
# See this link for information on writing cmake system checks:
|
||||
#
|
||||
# http://www.vtk.org/Wiki/CMake_HowToDoPlatformChecks
|
||||
#
|
||||
# More importantly see "Recommendations for Writing Autoconf Macros" in:
|
||||
#
|
||||
# http://www.lrde.epita.fr/~adl/dl/autotools.pdf
|
||||
#
|
||||
# for an explanation of why you should do this. Even though this is an
|
||||
# autotools tutorial. This section clearly explains why checking for
|
||||
# features is superior to checking for systems. The previous section of
|
||||
# this tutorial shows how to create a system independent check for _mkdir().
|
||||
# Consider it a benchmark when writing your own feature tests.
|
||||
#
|
||||
|
||||
macro( perform_feature_checks )
|
||||
|
||||
include( CheckIncludeFile )
|
||||
#include( CheckFunctionExists )
|
||||
include( CheckLibraryExists )
|
||||
include( CheckSymbolExists )
|
||||
include( CheckIncludeFileCXX )
|
||||
include( CheckCXXSymbolExists )
|
||||
include( CheckCXXSourceCompiles )
|
||||
include( CheckCXXCompilerFlag )
|
||||
|
||||
check_cxx_compiler_flag( -fvisibility=hidden GXX_HAS_VISIBILITY_FLAG )
|
||||
check_cxx_compiler_flag( -fvisibility-inlines-hidden GXX_HAS_VISIBILITY_INLINES_FLAG )
|
||||
|
||||
check_include_file( "malloc.h" HAVE_MALLOC_H )
|
||||
|
||||
# FIXME: Visual C++ does not support the "not" keyword natively. It is
|
||||
# defined as a macro in <iso646.h>. There should be a cmake macro
|
||||
# to check if compiler supports the not keyword natively. If not,
|
||||
# then check for <iso646.h> and include it. Although it doesn't
|
||||
# appear to cause any problems with other compilers, that doesn't
|
||||
# mean won't fail somewhere down the line.
|
||||
check_include_file( "iso646.h" HAVE_ISO646_H )
|
||||
|
||||
# The STDINT header file test is required because MinGW under Windows
|
||||
# doesn't define HAVE_STDINT_H even though it does have it.
|
||||
#
|
||||
# We need to add it to the global compiler definitions as config.h is not
|
||||
# included in pyport.h which is where the problem ocurrs without this
|
||||
# fix.
|
||||
check_include_file( "stdint.h" HAVE_STDINT_H )
|
||||
|
||||
if( HAVE_STDINT_H )
|
||||
add_definitions( -DHAVE_STDINT_H )
|
||||
endif()
|
||||
|
||||
# no place is this used, and "HAVE_STRINGS_H", if present in config.h then
|
||||
# conflicts with /usr/include/python2.6/Python.h. Please rename the macro if
|
||||
# re-introduce this.
|
||||
# check_include_file("strings.h" HAVE_STRINGS_H)
|
||||
|
||||
check_symbol_exists( strcasecmp "string.h" HAVE_STRCASECMP )
|
||||
check_symbol_exists( strcasecmp "strings.h" HAVE_STRCASECMP )
|
||||
check_symbol_exists( strncasecmp "string.h" HAVE_STRNCASECMP )
|
||||
check_symbol_exists( strncasecmp "strings.h" HAVE_STRNCASECMP )
|
||||
check_symbol_exists( strtok_r "string.h" HAVE_STRTOKR )
|
||||
|
||||
# Some platforms define malloc and free in malloc.h instead of stdlib.h.
|
||||
check_symbol_exists( malloc "stdlib.h" MALLOC_IN_STDLIB_H )
|
||||
|
||||
# Check for functions in math.h.
|
||||
check_include_file( "math.h" HAVE_MATH_H )
|
||||
|
||||
# Check for functions in C++ cmath.
|
||||
check_include_file_cxx( cmath HAVE_CXX_CMATH )
|
||||
check_cxx_symbol_exists( asinh cmath HAVE_CMATH_ASINH )
|
||||
check_cxx_symbol_exists( acosh cmath HAVE_CMATH_ACOSH )
|
||||
check_cxx_symbol_exists( atanh cmath HAVE_CMATH_ATANH )
|
||||
|
||||
# CMakes check_cxx_symbol_exists() doesn't work for templates so we must create a
|
||||
# small program to verify isinf() exists in cmath.
|
||||
check_cxx_source_compiles( "#include <cmath>\nint main(int argc, char** argv)\n{\n (void)argv;\n std::isinf(1.0); (void)argc;\n return 0;\n}\n" HAVE_CMATH_ISINF )
|
||||
|
||||
#check_symbol_exists( clock_gettime "time.h" HAVE_CLOCK_GETTIME ) non-standard library, does not work
|
||||
check_library_exists( rt clock_gettime "" HAVE_CLOCK_GETTIME )
|
||||
|
||||
# HAVE_GETTIMEOFDAY is already in use within 2.9 wxWidgets, so use HAVE_GETTIMEOFDAY_FUNC
|
||||
check_symbol_exists( gettimeofday "sys/time.h" HAVE_GETTIMEOFDAY_FUNC )
|
||||
|
||||
# Check for Posix getc_unlocked() for improved performance over getc(). Fall back to
|
||||
# getc() on platforms where getc_unlocked() doesn't exist.
|
||||
check_symbol_exists( getc_unlocked "stdio.h" HAVE_FGETC_NOLOCK )
|
||||
|
||||
# Generate config.h.
|
||||
configure_file( ${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake
|
||||
${CMAKE_BINARY_DIR}/config.h
|
||||
)
|
||||
|
||||
endmacro( perform_feature_checks )
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
# select_library_configurations( basename )
|
||||
#
|
||||
# This macro takes a library base name as an argument, and will choose good
|
||||
# values for basename_LIBRARY, basename_LIBRARIES, basename_LIBRARY_DEBUG, and
|
||||
# basename_LIBRARY_RELEASE depending on what has been found and set. If only
|
||||
# basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG,
|
||||
# and basename_LIBRARY_RELEASE will be set to the release value. If only
|
||||
# basename_LIBRARY_DEBUG is defined, then basename_LIBRARY,
|
||||
# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
|
||||
#
|
||||
# If the generator supports configuration types, then basename_LIBRARY and
|
||||
# basename_LIBRARIES will be set with debug and optimized flags specifying the
|
||||
# library to be used for the given configuration. If no build type has been set
|
||||
# or the generator in use does not support configuration types, then
|
||||
# basename_LIBRARY and basename_LIBRARIES will take only the release values.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2009 Will Dicharry <wdicharry@stellarscience.com>
|
||||
# Copyright 2005-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
|
||||
# Dicharry <wdicharry@stellarscience.com>.
|
||||
|
||||
# Utility macro to check if one variable exists while another doesn't, and set
|
||||
# one that doesn't exist to the one that exists.
|
||||
macro( _set_library_name basename GOOD BAD )
|
||||
if( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
|
||||
set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} )
|
||||
set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} )
|
||||
set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} )
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro( select_library_configurations basename )
|
||||
# if only the release version was found, set the debug to be the release
|
||||
# version.
|
||||
_set_library_name( ${basename} RELEASE DEBUG )
|
||||
# if only the debug version was found, set the release value to be the
|
||||
# debug value.
|
||||
_set_library_name( ${basename} DEBUG RELEASE )
|
||||
|
||||
# Set a default case, which will come into effect if
|
||||
# -no build type is set and the generator only supports one build type
|
||||
# at a time (i.e. CMAKE_CONFIGURATION_TYPES is false)
|
||||
# -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are the same
|
||||
# -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are both empty
|
||||
set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
|
||||
set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
|
||||
|
||||
if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
|
||||
NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE )
|
||||
# if the generator supports configuration types or CMAKE_BUILD_TYPE
|
||||
# is set, then set optimized and debug options.
|
||||
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
|
||||
set( ${basename}_LIBRARY "" )
|
||||
foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
|
||||
list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
|
||||
endforeach()
|
||||
foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
|
||||
list( APPEND ${basename}_LIBRARY debug "${_libname}" )
|
||||
endforeach()
|
||||
set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
|
||||
"The ${basename} library" )
|
||||
|
||||
if( ${basename}_LIBRARY )
|
||||
set( ${basename}_FOUND TRUE )
|
||||
endif()
|
||||
|
||||
mark_as_advanced( ${basename}_LIBRARY
|
||||
${basename}_LIBRARY_RELEASE
|
||||
${basename}_LIBRARY_DEBUG
|
||||
)
|
||||
endmacro()
|
||||
@@ -0,0 +1,57 @@
|
||||
# CMake script file to process a GLSL source file, so it can be included
|
||||
# in C array and compiled in to an application.
|
||||
|
||||
# number of input files
|
||||
list( LENGTH inputFiles shadersNumber )
|
||||
|
||||
# check if GLSL source files were updated since the last time
|
||||
set( update "FALSE" )
|
||||
foreach( inputFile ${inputFiles} )
|
||||
if( ${inputFile} IS_NEWER_THAN ${outputFile} )
|
||||
set( update "TRUE" )
|
||||
endif( ${inputFile} IS_NEWER_THAN ${outputFile} )
|
||||
endforeach( inputFile ${inputFiles} )
|
||||
|
||||
if( NOT update )
|
||||
message( "Headers are up-to-date" )
|
||||
return()
|
||||
endif( NOT update )
|
||||
|
||||
# write header
|
||||
file( WRITE ${outputFile} "// Do not edit this file, it is autogenerated by CMake.
|
||||
|
||||
#ifndef SHADER_SRC_H
|
||||
#define SHADER_SRC_H
|
||||
|
||||
const unsigned int shaders_number = ${shadersNumber};
|
||||
const char* shaders_src[] =
|
||||
{\n" )
|
||||
|
||||
foreach( inputFile ${inputFiles} )
|
||||
# put the input file name into the output file
|
||||
file( APPEND ${outputFile} "\n// ${inputFile}" )
|
||||
|
||||
# process the input file
|
||||
file( READ ${inputFile} contents )
|
||||
|
||||
# remove /* */ comments
|
||||
string( REGEX REPLACE "/\\*.*\\*/" "" contents "${contents}" )
|
||||
# remove // comments
|
||||
string( REGEX REPLACE "//[^\n]*" "" contents "${contents}" )
|
||||
# remove whitespaces at the beginning of each line
|
||||
string( REGEX REPLACE "\n([\t ])*" "\n" contents "${contents}" )
|
||||
# remove unnecessary spaces
|
||||
string( REGEX REPLACE " *([\\*/+&\\|,=<>\(\)]) *" "\\1" contents "${contents}" )
|
||||
# remove empty lines & wrap every line in "" and add '\n' at the end of each line
|
||||
string( REGEX REPLACE "\n+" "\\\\n\"\n\"" contents "${contents}" )
|
||||
# remove unnecessary " & \n from the beginning and the end of contents
|
||||
string( REGEX REPLACE "^\\\\n\"" "" contents "${contents}" )
|
||||
string( REGEX REPLACE "\"$" "," contents "${contents}" )
|
||||
|
||||
file( APPEND ${outputFile} "${contents}" )
|
||||
endforeach( inputFile ${inputFiles} )
|
||||
|
||||
# write footer
|
||||
file( APPEND ${outputFile} "};
|
||||
#endif /* SHADER_SRC_H */" )
|
||||
|
||||
@@ -1,391 +1,391 @@
|
||||
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2010 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
# Copyright (C) 2010 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
|
||||
#
|
||||
#
|
||||
# This script converts a plain text file with a line feed separated list
|
||||
# of token names into the appropriate source and header files required by
|
||||
# the DSN lexer. See files "<base_source_path>/common/dsnlexer.cpp" and
|
||||
# "<base_source_path>/include/dsnlexer.h" for more information about how
|
||||
# the DSN lexer works. The token list file format requires a single token
|
||||
# per line. Tokens can only contain lower case letters, numbers, and
|
||||
# underscores. The first letter of each token must be a lower case letter.
|
||||
# Tokens must be unique. If any of the above criteria are not met, the
|
||||
# source and header files will not be generated and a build error will
|
||||
# occur.
|
||||
#
|
||||
# Valid tokens: a a1 foo_1 foo_bar2
|
||||
# Invalid tokens: 1 A _foo bar_ foO
|
||||
#
|
||||
# Invocation Parameters are: enum, inputFile, outCppFile, outHeaderFile
|
||||
#
|
||||
# enum - Required, namespace in which the enum T will be placed.
|
||||
# Keep it short because from outside the class you want a short enum name
|
||||
# like enum::T. Enums are contained in their own namespace to avoid
|
||||
# collisions on enum value names, a problem with C++ unless the enum
|
||||
# itself is in a separate namespace.
|
||||
#
|
||||
# inputFile - Required, name of the token list file, or "*.keywords" file.
|
||||
# Choose the basefilename carefully, it decides the class name
|
||||
# used in the generated *_lexer.h file.
|
||||
#
|
||||
# outCppFile - Optional, full path and file name of where to save the generated
|
||||
# cpp keywords file. If not defined, the output path is the same
|
||||
# path as the token list file path, with a file name of *_keywords.cpp
|
||||
#
|
||||
# outHeaderFile - Optional, full path and file name of where to save the generated
|
||||
# *.h lexfer file. If not defined, the output path is the same
|
||||
# path as the token list file path, with a file name of *_lexer.h
|
||||
#
|
||||
# Use the max_lexer() CMake function from functions.cmake for invocation convenience.
|
||||
|
||||
|
||||
#message( STATUS "TokenList2DsnLexer.cmake" ) # indicate we are running
|
||||
|
||||
set( tokens "" )
|
||||
set( lineCount 0 )
|
||||
set( dsnErrorMsg "TokenList2DsnLexer.cmake failure:" )
|
||||
|
||||
if( NOT EXISTS ${inputFile} )
|
||||
message( FATAL_ERROR "${dsnErrorMsg} file ${inputFile} cannot be found." )
|
||||
endif()
|
||||
|
||||
if( NOT DEFINED enum )
|
||||
message( FATAL_ERROR "${dsnErrorMsg} missing \"enum\" processing ${inputFile}." )
|
||||
endif()
|
||||
|
||||
get_filename_component( outputPath "${inputFile}" PATH )
|
||||
|
||||
# the keywords filename without extension is important, it sets the classname into RESULT
|
||||
get_filename_component( result "${inputFile}" NAME_WE )
|
||||
string( TOUPPER "${result}" RESULT )
|
||||
|
||||
set( LEXERCLASS "${RESULT}_LEXER" )
|
||||
set( PARSERCLASS "${RESULT}_PARSER" )
|
||||
|
||||
#message( "enum:'${enum}' result:'${result}' outputPath:'${outputPath}' inputFile:'${inputFile}'" )
|
||||
|
||||
if( NOT DEFINED outCppFile )
|
||||
set( outCppFile "${outputPath}/${result}_keywords.cpp" )
|
||||
endif()
|
||||
|
||||
if( NOT DEFINED outHeaderFile )
|
||||
set( outHeaderFile "${outputPath}/${result}_lexer.h" )
|
||||
endif()
|
||||
|
||||
# Create tag for generating header file.
|
||||
set( headerTag "${LEXERCLASS}_H_" )
|
||||
|
||||
set( includeFileHeader
|
||||
"
|
||||
/* Do not modify this file it was automatically generated by the
|
||||
* TokenList2DsnLexer CMake script.
|
||||
*/
|
||||
|
||||
#ifndef ${headerTag}
|
||||
#define ${headerTag}
|
||||
|
||||
#include \"dsnlexer.h\"
|
||||
|
||||
/**
|
||||
* C++ does not put enum _values_ in separate namespaces unless the enum itself
|
||||
* is in a separate namespace. All the token enums must be in separate namespaces
|
||||
* otherwise the C++ compiler will eventually complain if it sees more than one
|
||||
* DSNLEXER in the same compilation unit, say by mutliple header file inclusion.
|
||||
* Plus this also enables re-use of the same enum name T. A typedef can always be used
|
||||
* to clarify which enum T is in play should that ever be a problem. This is
|
||||
* unlikely since Parse() functions will usually only be exposed to one header
|
||||
* file like this one. But if there is a problem, then use:
|
||||
* typedef ${enum}::T T;
|
||||
* within that problem area.
|
||||
*/
|
||||
namespace ${enum}
|
||||
{
|
||||
/// enum T contains all this lexer's tokens.
|
||||
enum T
|
||||
{
|
||||
// these first few are negative special ones for syntax, and are
|
||||
// inherited from DSNLEXER.
|
||||
T_NONE = DSN_NONE,
|
||||
T_COMMENT = DSN_COMMENT,
|
||||
T_STRING_QUOTE = DSN_STRING_QUOTE,
|
||||
T_QUOTE_DEF = DSN_QUOTE_DEF,
|
||||
T_DASH = DSN_DASH,
|
||||
T_SYMBOL = DSN_SYMBOL,
|
||||
T_NUMBER = DSN_NUMBER,
|
||||
T_RIGHT = DSN_RIGHT, // right bracket: ')'
|
||||
T_LEFT = DSN_LEFT, // left bracket: '('
|
||||
T_STRING = DSN_STRING, // a quoted string, stripped of the quotes
|
||||
T_EOF = DSN_EOF, // special case for end of file
|
||||
|
||||
"
|
||||
)
|
||||
|
||||
|
||||
set( sourceFileHeader
|
||||
"
|
||||
/* Do not modify this file it was automatically generated by the
|
||||
* TokenList2DsnLexer CMake script.
|
||||
*
|
||||
* Include this file in your lexer class to provide the keywords for
|
||||
* your DSN lexer.
|
||||
*/
|
||||
|
||||
#include \"${result}_lexer.h\"
|
||||
|
||||
using namespace ${enum};
|
||||
|
||||
#define TOKDEF(x) { #x, T_##x }
|
||||
|
||||
const KEYWORD ${LEXERCLASS}::keywords[] = {
|
||||
"
|
||||
)
|
||||
|
||||
file( STRINGS ${inputFile} lines NO_HEX_CONVERSION )
|
||||
|
||||
foreach( line ${lines} )
|
||||
math( EXPR lineCount "${lineCount} + 1" )
|
||||
|
||||
# strip any comment from # to end of line
|
||||
string( REGEX REPLACE "#.*$" "" tmpToken "${line}" )
|
||||
string( STRIP "${tmpToken}" token )
|
||||
|
||||
# Ignore empty lines.
|
||||
if( NOT token STREQUAL "" ) # if token is "off" simple if( token) does not work
|
||||
# Make sure token is valid.
|
||||
|
||||
#message( "token=${token}" )
|
||||
|
||||
string( REGEX MATCH "[a-z][_0-9a-z]*" validToken "${token}" )
|
||||
#message( "validToken=${validToken}" )
|
||||
|
||||
if( validToken STREQUAL token )
|
||||
list( APPEND tokens "${validToken}" )
|
||||
else()
|
||||
message( FATAL_ERROR
|
||||
"Invalid token string \"${tmpToken}\" at line ${lineCount} in file "
|
||||
"<${inputFile}>." )
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list( SORT tokens )
|
||||
|
||||
# Check for duplicates.
|
||||
list( LENGTH tokens tokensBefore )
|
||||
list( REMOVE_DUPLICATES tokens )
|
||||
list( LENGTH tokens tokensAfter )
|
||||
|
||||
if( NOT ( tokensBefore EQUAL tokensAfter ) )
|
||||
message( FATAL_ERROR "Duplicate tokens found in file <${inputFile}>." )
|
||||
endif()
|
||||
|
||||
file( WRITE "${outHeaderFile}" "${includeFileHeader}" )
|
||||
file( WRITE "${outCppFile}" "${sourceFileHeader}" )
|
||||
|
||||
set( lineCount 1 )
|
||||
|
||||
foreach( token ${tokens} )
|
||||
if( lineCount EQUAL 1 )
|
||||
file( APPEND "${outHeaderFile}" " T_${token} = 0" )
|
||||
else( lineCount EQUAL 1 )
|
||||
file( APPEND "${outHeaderFile}" " T_${token}" )
|
||||
endif( lineCount EQUAL 1 )
|
||||
|
||||
file(APPEND "${outCppFile}" " TOKDEF( ${token} )" )
|
||||
|
||||
if( lineCount EQUAL tokensAfter )
|
||||
file( APPEND "${outHeaderFile}" "\n" )
|
||||
file( APPEND "${outCppFile}" "\n" )
|
||||
else( lineCount EQUAL tokensAfter )
|
||||
file( APPEND "${outHeaderFile}" ",\n" )
|
||||
file( APPEND "${outCppFile}" ",\n" )
|
||||
endif( lineCount EQUAL tokensAfter )
|
||||
math( EXPR lineCount "${lineCount} + 1" )
|
||||
endforeach()
|
||||
|
||||
file( APPEND "${outHeaderFile}"
|
||||
" };
|
||||
} // namespace ${enum}
|
||||
|
||||
|
||||
/**
|
||||
* Class ${LEXERCLASS}
|
||||
* is an automatically generated class using the TokenList2DnsLexer.cmake
|
||||
* technology, based on keywords provided by file:
|
||||
* ${inputFile}
|
||||
*/
|
||||
class ${LEXERCLASS} : public DSNLEXER
|
||||
{
|
||||
/// Auto generated lexer keywords table and length:
|
||||
static const KEYWORD keywords[];
|
||||
static const unsigned keyword_count;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor ( const std::string&, const wxString& )
|
||||
* @param aSExpression is (utf8) text possibly from the clipboard that you want to parse.
|
||||
* @param aSource is a description of the origin of @a aSExpression, such as a filename.
|
||||
* If left empty, then _("clipboard") is used.
|
||||
*/
|
||||
${LEXERCLASS}( const std::string& aSExpression, const wxString& aSource = wxEmptyString ) :
|
||||
DSNLEXER( keywords, keyword_count, aSExpression, aSource )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor ( FILE* )
|
||||
* takes @a aFile already opened for reading and @a aFilename as parameters.
|
||||
* The opened file is assumed to be positioned at the beginning of the file
|
||||
* for purposes of accurate line number reporting in error messages. The
|
||||
* FILE is closed by this instance when its destructor is called.
|
||||
* @param aFile is a FILE already opened for reading.
|
||||
* @param aFilename is the name of the opened file, needed for error reporting.
|
||||
*/
|
||||
${LEXERCLASS}( FILE* aFile, const wxString& aFilename ) :
|
||||
DSNLEXER( keywords, keyword_count, aFile, aFilename )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor ( LINE_READER* )
|
||||
* intializes a lexer and prepares to read from @a aLineReader which
|
||||
* is assumed ready, and may be in use by other DSNLEXERs also. No ownership
|
||||
* is taken of @a aLineReader. This enables it to be used by other lexers also.
|
||||
* The transition between grammars in such a case, must happen on a text
|
||||
* line boundary, not within the same line of text.
|
||||
*
|
||||
* @param aLineReader is any subclassed instance of LINE_READER, such as
|
||||
* STRING_LINE_READER or FILE_LINE_READER. No ownership is taken of aLineReader.
|
||||
*/
|
||||
${LEXERCLASS}( LINE_READER* aLineReader ) :
|
||||
DSNLEXER( keywords, keyword_count, aLineReader )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Function TokenName
|
||||
* returns the name of the token in ASCII form.
|
||||
*/
|
||||
static const char* TokenName( ${enum}::T aTok );
|
||||
|
||||
/**
|
||||
* Function NextTok
|
||||
* returns the next token found in the input file or T_EOF when reaching
|
||||
* the end of file. Users should wrap this function to return an enum
|
||||
* to aid in grammar debugging while running under a debugger, but leave
|
||||
* this lower level function returning an int (so the enum does not collide
|
||||
* with another usage).
|
||||
* @return ${enum}::T - the type of token found next.
|
||||
* @throw IO_ERROR - only if the LINE_READER throws it.
|
||||
*/
|
||||
${enum}::T NextTok() throw( IO_ERROR )
|
||||
{
|
||||
return (${enum}::T) DSNLEXER::NextTok();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function NeedSYMBOL
|
||||
* calls NextTok() and then verifies that the token read in
|
||||
* satisfies bool IsSymbol().
|
||||
* If not, an IO_ERROR is thrown.
|
||||
* @return int - the actual token read in.
|
||||
* @throw IO_ERROR, if the next token does not satisfy IsSymbol()
|
||||
*/
|
||||
${enum}::T NeedSYMBOL() throw( IO_ERROR )
|
||||
{
|
||||
return (${enum}::T) DSNLEXER::NeedSYMBOL();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function NeedSYMBOLorNUMBER
|
||||
* calls NextTok() and then verifies that the token read in
|
||||
* satisfies bool IsSymbol() or tok==T_NUMBER.
|
||||
* If not, an IO_ERROR is thrown.
|
||||
* @return int - the actual token read in.
|
||||
* @throw IO_ERROR, if the next token does not satisfy the above test
|
||||
*/
|
||||
${enum}::T NeedSYMBOLorNUMBER() throw( IO_ERROR )
|
||||
{
|
||||
return (${enum}::T) DSNLEXER::NeedSYMBOLorNUMBER();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function CurTok
|
||||
* returns whatever NextTok() returned the last time it was called.
|
||||
*/
|
||||
${enum}::T CurTok()
|
||||
{
|
||||
return (${enum}::T) DSNLEXER::CurTok();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function PrevTok
|
||||
* returns whatever NextTok() returned the 2nd to last time it was called.
|
||||
*/
|
||||
${enum}::T PrevTok()
|
||||
{
|
||||
return (${enum}::T) DSNLEXER::PrevTok();
|
||||
}
|
||||
};
|
||||
|
||||
// example usage
|
||||
|
||||
/**
|
||||
* Class ${LEXCLASS}_PARSER
|
||||
* holds data and functions pertinent to parsing a S-expression file .
|
||||
*
|
||||
class ${PARSERCLASS} : public ${LEXERCLASS}
|
||||
{
|
||||
|
||||
};
|
||||
*/
|
||||
|
||||
#endif // ${headerTag}
|
||||
"
|
||||
)
|
||||
|
||||
file( APPEND "${outCppFile}"
|
||||
"};
|
||||
|
||||
const unsigned ${LEXERCLASS}::keyword_count = unsigned( sizeof( ${LEXERCLASS}::keywords )/sizeof( ${LEXERCLASS}::keywords[0] ) );
|
||||
|
||||
|
||||
const char* ${LEXERCLASS}::TokenName( T aTok )
|
||||
{
|
||||
const char* ret;
|
||||
|
||||
if( (unsigned) aTok < keyword_count )
|
||||
{
|
||||
ret = keywords[aTok].name;
|
||||
}
|
||||
else if( aTok < 0 )
|
||||
{
|
||||
ret = DSNLEXER::Syntax( aTok );
|
||||
}
|
||||
else
|
||||
ret = \"token too big\";
|
||||
|
||||
return ret;
|
||||
}
|
||||
"
|
||||
)
|
||||
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2010 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
# Copyright (C) 2010 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
|
||||
#
|
||||
#
|
||||
# This script converts a plain text file with a line feed separated list
|
||||
# of token names into the appropriate source and header files required by
|
||||
# the DSN lexer. See files "<base_source_path>/common/dsnlexer.cpp" and
|
||||
# "<base_source_path>/include/dsnlexer.h" for more information about how
|
||||
# the DSN lexer works. The token list file format requires a single token
|
||||
# per line. Tokens can only contain lower case letters, numbers, and
|
||||
# underscores. The first letter of each token must be a lower case letter.
|
||||
# Tokens must be unique. If any of the above criteria are not met, the
|
||||
# source and header files will not be generated and a build error will
|
||||
# occur.
|
||||
#
|
||||
# Valid tokens: a a1 foo_1 foo_bar2
|
||||
# Invalid tokens: 1 A _foo bar_ foO
|
||||
#
|
||||
# Invocation Parameters are: enum, inputFile, outCppFile, outHeaderFile
|
||||
#
|
||||
# enum - Required, namespace in which the enum T will be placed.
|
||||
# Keep it short because from outside the class you want a short enum name
|
||||
# like enum::T. Enums are contained in their own namespace to avoid
|
||||
# collisions on enum value names, a problem with C++ unless the enum
|
||||
# itself is in a separate namespace.
|
||||
#
|
||||
# inputFile - Required, name of the token list file, or "*.keywords" file.
|
||||
# Choose the basefilename carefully, it decides the class name
|
||||
# used in the generated *_lexer.h file.
|
||||
#
|
||||
# outCppFile - Optional, full path and file name of where to save the generated
|
||||
# cpp keywords file. If not defined, the output path is the same
|
||||
# path as the token list file path, with a file name of *_keywords.cpp
|
||||
#
|
||||
# outHeaderFile - Optional, full path and file name of where to save the generated
|
||||
# *.h lexfer file. If not defined, the output path is the same
|
||||
# path as the token list file path, with a file name of *_lexer.h
|
||||
#
|
||||
# Use the max_lexer() CMake function from functions.cmake for invocation convenience.
|
||||
|
||||
|
||||
#message( STATUS "TokenList2DsnLexer.cmake" ) # indicate we are running
|
||||
|
||||
set( tokens "" )
|
||||
set( lineCount 0 )
|
||||
set( dsnErrorMsg "TokenList2DsnLexer.cmake failure:" )
|
||||
|
||||
if( NOT EXISTS ${inputFile} )
|
||||
message( FATAL_ERROR "${dsnErrorMsg} file ${inputFile} cannot be found." )
|
||||
endif()
|
||||
|
||||
if( NOT DEFINED enum )
|
||||
message( FATAL_ERROR "${dsnErrorMsg} missing \"enum\" processing ${inputFile}." )
|
||||
endif()
|
||||
|
||||
get_filename_component( outputPath "${inputFile}" PATH )
|
||||
|
||||
# the keywords filename without extension is important, it sets the classname into RESULT
|
||||
get_filename_component( result "${inputFile}" NAME_WE )
|
||||
string( TOUPPER "${result}" RESULT )
|
||||
|
||||
set( LEXERCLASS "${RESULT}_LEXER" )
|
||||
set( PARSERCLASS "${RESULT}_PARSER" )
|
||||
|
||||
#message( "enum:'${enum}' result:'${result}' outputPath:'${outputPath}' inputFile:'${inputFile}'" )
|
||||
|
||||
if( NOT DEFINED outCppFile )
|
||||
set( outCppFile "${outputPath}/${result}_keywords.cpp" )
|
||||
endif()
|
||||
|
||||
if( NOT DEFINED outHeaderFile )
|
||||
set( outHeaderFile "${outputPath}/${result}_lexer.h" )
|
||||
endif()
|
||||
|
||||
# Create tag for generating header file.
|
||||
set( headerTag "${LEXERCLASS}_H_" )
|
||||
|
||||
set( includeFileHeader
|
||||
"
|
||||
/* Do not modify this file it was automatically generated by the
|
||||
* TokenList2DsnLexer CMake script.
|
||||
*/
|
||||
|
||||
#ifndef ${headerTag}
|
||||
#define ${headerTag}
|
||||
|
||||
#include <dsnlexer.h>
|
||||
|
||||
/**
|
||||
* C++ does not put enum _values_ in separate namespaces unless the enum itself
|
||||
* is in a separate namespace. All the token enums must be in separate namespaces
|
||||
* otherwise the C++ compiler will eventually complain if it sees more than one
|
||||
* DSNLEXER in the same compilation unit, say by mutliple header file inclusion.
|
||||
* Plus this also enables re-use of the same enum name T. A typedef can always be used
|
||||
* to clarify which enum T is in play should that ever be a problem. This is
|
||||
* unlikely since Parse() functions will usually only be exposed to one header
|
||||
* file like this one. But if there is a problem, then use:
|
||||
* typedef ${enum}::T T;
|
||||
* within that problem area.
|
||||
*/
|
||||
namespace ${enum}
|
||||
{
|
||||
/// enum T contains all this lexer's tokens.
|
||||
enum T
|
||||
{
|
||||
// these first few are negative special ones for syntax, and are
|
||||
// inherited from DSNLEXER.
|
||||
T_NONE = DSN_NONE,
|
||||
T_COMMENT = DSN_COMMENT,
|
||||
T_STRING_QUOTE = DSN_STRING_QUOTE,
|
||||
T_QUOTE_DEF = DSN_QUOTE_DEF,
|
||||
T_DASH = DSN_DASH,
|
||||
T_SYMBOL = DSN_SYMBOL,
|
||||
T_NUMBER = DSN_NUMBER,
|
||||
T_RIGHT = DSN_RIGHT, // right bracket: ')'
|
||||
T_LEFT = DSN_LEFT, // left bracket: '('
|
||||
T_STRING = DSN_STRING, // a quoted string, stripped of the quotes
|
||||
T_EOF = DSN_EOF, // special case for end of file
|
||||
|
||||
"
|
||||
)
|
||||
|
||||
|
||||
set( sourceFileHeader
|
||||
"
|
||||
/* Do not modify this file it was automatically generated by the
|
||||
* TokenList2DsnLexer CMake script.
|
||||
*
|
||||
* Include this file in your lexer class to provide the keywords for
|
||||
* your DSN lexer.
|
||||
*/
|
||||
|
||||
#include <${result}_lexer.h>
|
||||
|
||||
using namespace ${enum};
|
||||
|
||||
#define TOKDEF(x) { #x, T_##x }
|
||||
|
||||
const KEYWORD ${LEXERCLASS}::keywords[] = {
|
||||
"
|
||||
)
|
||||
|
||||
file( STRINGS ${inputFile} lines NO_HEX_CONVERSION )
|
||||
|
||||
foreach( line ${lines} )
|
||||
math( EXPR lineCount "${lineCount} + 1" )
|
||||
|
||||
# strip any comment from # to end of line
|
||||
string( REGEX REPLACE "#.*$" "" tmpToken "${line}" )
|
||||
string( STRIP "${tmpToken}" token )
|
||||
|
||||
# Ignore empty lines.
|
||||
if( NOT token STREQUAL "" ) # if token is "off" simple if( token) does not work
|
||||
# Make sure token is valid.
|
||||
|
||||
#message( "token=${token}" )
|
||||
|
||||
string( REGEX MATCH "[a-z][_0-9a-z]*" validToken "${token}" )
|
||||
#message( "validToken=${validToken}" )
|
||||
|
||||
if( validToken STREQUAL token )
|
||||
list( APPEND tokens "${validToken}" )
|
||||
else()
|
||||
message( FATAL_ERROR
|
||||
"Invalid token string \"${tmpToken}\" at line ${lineCount} in file "
|
||||
"<${inputFile}>." )
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list( SORT tokens )
|
||||
|
||||
# Check for duplicates.
|
||||
list( LENGTH tokens tokensBefore )
|
||||
list( REMOVE_DUPLICATES tokens )
|
||||
list( LENGTH tokens tokensAfter )
|
||||
|
||||
if( NOT ( tokensBefore EQUAL tokensAfter ) )
|
||||
message( FATAL_ERROR "Duplicate tokens found in file <${inputFile}>." )
|
||||
endif()
|
||||
|
||||
file( WRITE "${outHeaderFile}" "${includeFileHeader}" )
|
||||
file( WRITE "${outCppFile}" "${sourceFileHeader}" )
|
||||
|
||||
set( lineCount 1 )
|
||||
|
||||
foreach( token ${tokens} )
|
||||
if( lineCount EQUAL 1 )
|
||||
file( APPEND "${outHeaderFile}" " T_${token} = 0" )
|
||||
else( lineCount EQUAL 1 )
|
||||
file( APPEND "${outHeaderFile}" " T_${token}" )
|
||||
endif( lineCount EQUAL 1 )
|
||||
|
||||
file(APPEND "${outCppFile}" " TOKDEF( ${token} )" )
|
||||
|
||||
if( lineCount EQUAL tokensAfter )
|
||||
file( APPEND "${outHeaderFile}" "\n" )
|
||||
file( APPEND "${outCppFile}" "\n" )
|
||||
else( lineCount EQUAL tokensAfter )
|
||||
file( APPEND "${outHeaderFile}" ",\n" )
|
||||
file( APPEND "${outCppFile}" ",\n" )
|
||||
endif( lineCount EQUAL tokensAfter )
|
||||
math( EXPR lineCount "${lineCount} + 1" )
|
||||
endforeach()
|
||||
|
||||
file( APPEND "${outHeaderFile}"
|
||||
" };
|
||||
} // namespace ${enum}
|
||||
|
||||
|
||||
/**
|
||||
* Class ${LEXERCLASS}
|
||||
* is an automatically generated class using the TokenList2DnsLexer.cmake
|
||||
* technology, based on keywords provided by file:
|
||||
* ${inputFile}
|
||||
*/
|
||||
class ${LEXERCLASS} : public DSNLEXER
|
||||
{
|
||||
/// Auto generated lexer keywords table and length:
|
||||
static const KEYWORD keywords[];
|
||||
static const unsigned keyword_count;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor ( const std::string&, const wxString& )
|
||||
* @param aSExpression is (utf8) text possibly from the clipboard that you want to parse.
|
||||
* @param aSource is a description of the origin of @a aSExpression, such as a filename.
|
||||
* If left empty, then _(\"clipboard\") is used.
|
||||
*/
|
||||
${LEXERCLASS}( const std::string& aSExpression, const wxString& aSource = wxEmptyString ) :
|
||||
DSNLEXER( keywords, keyword_count, aSExpression, aSource )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor ( FILE* )
|
||||
* takes @a aFile already opened for reading and @a aFilename as parameters.
|
||||
* The opened file is assumed to be positioned at the beginning of the file
|
||||
* for purposes of accurate line number reporting in error messages. The
|
||||
* FILE is closed by this instance when its destructor is called.
|
||||
* @param aFile is a FILE already opened for reading.
|
||||
* @param aFilename is the name of the opened file, needed for error reporting.
|
||||
*/
|
||||
${LEXERCLASS}( FILE* aFile, const wxString& aFilename ) :
|
||||
DSNLEXER( keywords, keyword_count, aFile, aFilename )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor ( LINE_READER* )
|
||||
* intializes a lexer and prepares to read from @a aLineReader which
|
||||
* is assumed ready, and may be in use by other DSNLEXERs also. No ownership
|
||||
* is taken of @a aLineReader. This enables it to be used by other lexers also.
|
||||
* The transition between grammars in such a case, must happen on a text
|
||||
* line boundary, not within the same line of text.
|
||||
*
|
||||
* @param aLineReader is any subclassed instance of LINE_READER, such as
|
||||
* STRING_LINE_READER or FILE_LINE_READER. No ownership is taken of aLineReader.
|
||||
*/
|
||||
${LEXERCLASS}( LINE_READER* aLineReader ) :
|
||||
DSNLEXER( keywords, keyword_count, aLineReader )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Function TokenName
|
||||
* returns the name of the token in ASCII form.
|
||||
*/
|
||||
static const char* TokenName( ${enum}::T aTok );
|
||||
|
||||
/**
|
||||
* Function NextTok
|
||||
* returns the next token found in the input file or T_EOF when reaching
|
||||
* the end of file. Users should wrap this function to return an enum
|
||||
* to aid in grammar debugging while running under a debugger, but leave
|
||||
* this lower level function returning an int (so the enum does not collide
|
||||
* with another usage).
|
||||
* @return ${enum}::T - the type of token found next.
|
||||
* @throw IO_ERROR - only if the LINE_READER throws it.
|
||||
*/
|
||||
${enum}::T NextTok() throw( IO_ERROR )
|
||||
{
|
||||
return (${enum}::T) DSNLEXER::NextTok();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function NeedSYMBOL
|
||||
* calls NextTok() and then verifies that the token read in
|
||||
* satisfies bool IsSymbol().
|
||||
* If not, an IO_ERROR is thrown.
|
||||
* @return int - the actual token read in.
|
||||
* @throw IO_ERROR, if the next token does not satisfy IsSymbol()
|
||||
*/
|
||||
${enum}::T NeedSYMBOL() throw( IO_ERROR )
|
||||
{
|
||||
return (${enum}::T) DSNLEXER::NeedSYMBOL();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function NeedSYMBOLorNUMBER
|
||||
* calls NextTok() and then verifies that the token read in
|
||||
* satisfies bool IsSymbol() or tok==T_NUMBER.
|
||||
* If not, an IO_ERROR is thrown.
|
||||
* @return int - the actual token read in.
|
||||
* @throw IO_ERROR, if the next token does not satisfy the above test
|
||||
*/
|
||||
${enum}::T NeedSYMBOLorNUMBER() throw( IO_ERROR )
|
||||
{
|
||||
return (${enum}::T) DSNLEXER::NeedSYMBOLorNUMBER();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function CurTok
|
||||
* returns whatever NextTok() returned the last time it was called.
|
||||
*/
|
||||
${enum}::T CurTok()
|
||||
{
|
||||
return (${enum}::T) DSNLEXER::CurTok();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function PrevTok
|
||||
* returns whatever NextTok() returned the 2nd to last time it was called.
|
||||
*/
|
||||
${enum}::T PrevTok()
|
||||
{
|
||||
return (${enum}::T) DSNLEXER::PrevTok();
|
||||
}
|
||||
};
|
||||
|
||||
// example usage
|
||||
|
||||
/**
|
||||
* Class ${LEXCLASS}_PARSER
|
||||
* holds data and functions pertinent to parsing a S-expression file .
|
||||
*
|
||||
class ${PARSERCLASS} : public ${LEXERCLASS}
|
||||
{
|
||||
|
||||
};
|
||||
*/
|
||||
|
||||
#endif // ${headerTag}
|
||||
"
|
||||
)
|
||||
|
||||
file( APPEND "${outCppFile}"
|
||||
"};
|
||||
|
||||
const unsigned ${LEXERCLASS}::keyword_count = unsigned( sizeof( ${LEXERCLASS}::keywords )/sizeof( ${LEXERCLASS}::keywords[0] ) );
|
||||
|
||||
|
||||
const char* ${LEXERCLASS}::TokenName( T aTok )
|
||||
{
|
||||
const char* ret;
|
||||
|
||||
if( (unsigned) aTok < keyword_count )
|
||||
{
|
||||
ret = keywords[aTok].name;
|
||||
}
|
||||
else if( aTok < 0 )
|
||||
{
|
||||
ret = DSNLEXER::Syntax( aTok );
|
||||
}
|
||||
else
|
||||
ret = \"token too big\";
|
||||
|
||||
return ret;
|
||||
}
|
||||
"
|
||||
)
|
||||
|
||||
@@ -1,89 +1,89 @@
|
||||
# - Convenience include for using wxWidgets library.
|
||||
# Determines if wxWidgets was FOUND and sets the appropriate libs, incdirs,
|
||||
# flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are called.
|
||||
#
|
||||
# USAGE
|
||||
# # Note that for MinGW users the order of libs is important!
|
||||
# FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
|
||||
# INCLUDE(${wxWidgets_USE_FILE})
|
||||
# # and for each of your dependant executable/library targets:
|
||||
# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
|
||||
#
|
||||
# DEPRECATED
|
||||
# LINK_LIBRARIES is not called in favor of adding dependencies per target.
|
||||
#
|
||||
# AUTHOR
|
||||
# Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2004-2009 Kitware, Inc.
|
||||
# Copyright 2006 Jan Woetzel
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# debug message and logging.
|
||||
# comment these out for distribution
|
||||
IF (NOT LOGFILE )
|
||||
# SET(LOGFILE "${PROJECT_BINARY_DIR}/CMakeOutput.log")
|
||||
ENDIF (NOT LOGFILE )
|
||||
MACRO(MSG _MSG)
|
||||
# FILE(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}\n")
|
||||
# MESSAGE(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
|
||||
ENDMACRO(MSG)
|
||||
|
||||
|
||||
MSG("wxWidgets_FOUND=${wxWidgets_FOUND}")
|
||||
IF (wxWidgets_FOUND)
|
||||
IF (wxWidgets_INCLUDE_DIRS)
|
||||
IF(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
|
||||
INCLUDE_DIRECTORIES(${wxWidgets_INCLUDE_DIRS})
|
||||
ELSE(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
|
||||
INCLUDE_DIRECTORIES(SYSTEM ${wxWidgets_INCLUDE_DIRS})
|
||||
ENDIF(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
|
||||
MSG("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
|
||||
ENDIF(wxWidgets_INCLUDE_DIRS)
|
||||
|
||||
IF (wxWidgets_LIBRARY_DIRS)
|
||||
LINK_DIRECTORIES(${wxWidgets_LIBRARY_DIRS})
|
||||
MSG("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}")
|
||||
ENDIF(wxWidgets_LIBRARY_DIRS)
|
||||
|
||||
IF (wxWidgets_DEFINITIONS)
|
||||
SET_PROPERTY(DIRECTORY APPEND
|
||||
PROPERTY COMPILE_DEFINITIONS ${wxWidgets_DEFINITIONS})
|
||||
MSG("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
|
||||
ENDIF(wxWidgets_DEFINITIONS)
|
||||
|
||||
IF (wxWidgets_DEFINITIONS_DEBUG)
|
||||
SET_PROPERTY(DIRECTORY APPEND
|
||||
PROPERTY COMPILE_DEFINITIONS_DEBUG ${wxWidgets_DEFINITIONS_DEBUG})
|
||||
MSG("wxWidgets_DEFINITIONS_DEBUG=${wxWidgets_DEFINITIONS_DEBUG}")
|
||||
ENDIF(wxWidgets_DEFINITIONS_DEBUG)
|
||||
|
||||
IF (wxWidgets_CXX_FLAGS)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS}")
|
||||
MSG("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
|
||||
ENDIF(wxWidgets_CXX_FLAGS)
|
||||
|
||||
# DEPRECATED JW
|
||||
# just for backward compatibility: add deps to all targets
|
||||
# library projects better use advanced FIND_PACKAGE(wxWidgets) directly.
|
||||
#IF(wxWidgets_LIBRARIES)
|
||||
# LINK_LIBRARIES(${wxWidgets_LIBRARIES})
|
||||
# # BUG: str too long: MSG("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}")
|
||||
# IF(LOGFILE)
|
||||
# FILE(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${wxWidgets_LIBRARIES}\n")
|
||||
# ENDIF(LOGFILE)
|
||||
#ENDIF(wxWidgets_LIBRARIES)
|
||||
|
||||
ELSE (wxWidgets_FOUND)
|
||||
MESSAGE("wxWidgets requested but not found.")
|
||||
ENDIF(wxWidgets_FOUND)
|
||||
# - Convenience include for using wxWidgets library.
|
||||
# Determines if wxWidgets was FOUND and sets the appropriate libs, incdirs,
|
||||
# flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are called.
|
||||
#
|
||||
# USAGE
|
||||
# # Note that for MinGW users the order of libs is important!
|
||||
# FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
|
||||
# INCLUDE(${wxWidgets_USE_FILE})
|
||||
# # and for each of your dependant executable/library targets:
|
||||
# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
|
||||
#
|
||||
# DEPRECATED
|
||||
# LINK_LIBRARIES is not called in favor of adding dependencies per target.
|
||||
#
|
||||
# AUTHOR
|
||||
# Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2004-2009 Kitware, Inc.
|
||||
# Copyright 2006 Jan Woetzel
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# debug message and logging.
|
||||
# comment these out for distribution
|
||||
IF (NOT LOGFILE )
|
||||
# SET(LOGFILE "${PROJECT_BINARY_DIR}/CMakeOutput.log")
|
||||
ENDIF (NOT LOGFILE )
|
||||
MACRO(MSG _MSG)
|
||||
# FILE(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}\n")
|
||||
# MESSAGE(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
|
||||
ENDMACRO(MSG)
|
||||
|
||||
|
||||
MSG("wxWidgets_FOUND=${wxWidgets_FOUND}")
|
||||
IF (wxWidgets_FOUND)
|
||||
IF (wxWidgets_INCLUDE_DIRS)
|
||||
IF(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
|
||||
INCLUDE_DIRECTORIES(${wxWidgets_INCLUDE_DIRS})
|
||||
ELSE(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
|
||||
INCLUDE_DIRECTORIES(SYSTEM ${wxWidgets_INCLUDE_DIRS})
|
||||
ENDIF(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
|
||||
MSG("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
|
||||
ENDIF(wxWidgets_INCLUDE_DIRS)
|
||||
|
||||
IF (wxWidgets_LIBRARY_DIRS)
|
||||
LINK_DIRECTORIES(${wxWidgets_LIBRARY_DIRS})
|
||||
MSG("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}")
|
||||
ENDIF(wxWidgets_LIBRARY_DIRS)
|
||||
|
||||
IF (wxWidgets_DEFINITIONS)
|
||||
SET_PROPERTY(DIRECTORY APPEND
|
||||
PROPERTY COMPILE_DEFINITIONS ${wxWidgets_DEFINITIONS})
|
||||
MSG("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
|
||||
ENDIF(wxWidgets_DEFINITIONS)
|
||||
|
||||
IF (wxWidgets_DEFINITIONS_DEBUG)
|
||||
SET_PROPERTY(DIRECTORY APPEND
|
||||
PROPERTY COMPILE_DEFINITIONS_DEBUG ${wxWidgets_DEFINITIONS_DEBUG})
|
||||
MSG("wxWidgets_DEFINITIONS_DEBUG=${wxWidgets_DEFINITIONS_DEBUG}")
|
||||
ENDIF(wxWidgets_DEFINITIONS_DEBUG)
|
||||
|
||||
IF (wxWidgets_CXX_FLAGS)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS}")
|
||||
MSG("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
|
||||
ENDIF(wxWidgets_CXX_FLAGS)
|
||||
|
||||
# DEPRECATED JW
|
||||
# just for backward compatibility: add deps to all targets
|
||||
# library projects better use advanced FIND_PACKAGE(wxWidgets) directly.
|
||||
#IF(wxWidgets_LIBRARIES)
|
||||
# LINK_LIBRARIES(${wxWidgets_LIBRARIES})
|
||||
# # BUG: str too long: MSG("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}")
|
||||
# IF(LOGFILE)
|
||||
# FILE(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${wxWidgets_LIBRARIES}\n")
|
||||
# ENDIF(LOGFILE)
|
||||
#ENDIF(wxWidgets_LIBRARIES)
|
||||
|
||||
ELSE (wxWidgets_FOUND)
|
||||
MESSAGE("wxWidgets requested but not found.")
|
||||
ENDIF(wxWidgets_FOUND)
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
if( NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" )
|
||||
message( FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"" )
|
||||
endif()
|
||||
|
||||
FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
STRING(REGEX REPLACE "\n" ";" files "${files}")
|
||||
FOREACH(file ${files})
|
||||
MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||
IF(EXISTS "$ENV{DESTDIR}${file}")
|
||||
EXEC_PROGRAM(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
IF(NOT "${rm_retval}" STREQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||
ENDIF(NOT "${rm_retval}" STREQUAL 0)
|
||||
ELSE(EXISTS "$ENV{DESTDIR}${file}")
|
||||
MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
||||
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
|
||||
ENDFOREACH(file)
|
||||
file( READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files )
|
||||
string( REGEX REPLACE "\n" ";" files "${files}" )
|
||||
|
||||
foreach( file ${files} )
|
||||
message( STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"" )
|
||||
if( EXISTS "$ENV{DESTDIR}${file}" )
|
||||
exec_program(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
if( NOT "${rm_retval}" STREQUAL "0" )
|
||||
message( STATUS "Problem when removing \"$ENV{DESTDIR}${file}\"" )
|
||||
endif()
|
||||
else()
|
||||
message( STATUS "File \"$ENV{DESTDIR}${file}\" does not exist." )
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
+46
-22
@@ -1,27 +1,31 @@
|
||||
/* Do not modify this file, it was automatically generated by CMake. */
|
||||
// Do not modify this file, it was automatically generated by CMake.
|
||||
|
||||
#ifndef __CONFIG_H__
|
||||
#define __CONFIG_H__
|
||||
#ifndef CONFIG_H_
|
||||
#define CONFIG_H_
|
||||
|
||||
#cmakedefine HAVE_STRCASECMP
|
||||
|
||||
#cmakedefine HAVE_STRNCASECMP
|
||||
|
||||
#cmakedefine HAVE_ISO_STRICMP
|
||||
#cmakedefine HAVE_STRTOKR // spelled odly to differ from wx's similar test
|
||||
|
||||
#cmakedefine HAVE_ISO_STRNICMP
|
||||
// Handle platform differences in math.h
|
||||
#cmakedefine HAVE_MATH_H
|
||||
|
||||
#cmakedefine HAVE_ISO_SNPRINTF
|
||||
// Handle platform differences in C++ cmath.
|
||||
#cmakedefine HAVE_CXX_CMATH
|
||||
|
||||
#if defined( HAVE_ISO_SNPRINTF )
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#cmakedefine HAVE_CMATH_ASINH
|
||||
|
||||
#cmakedefine HAVE_ISO_HYPOT
|
||||
#cmakedefine HAVE_CMATH_ACOSH
|
||||
|
||||
#if defined( HAVE_ISO_HYPOT )
|
||||
#define hypot _hypot
|
||||
#endif
|
||||
#cmakedefine HAVE_CMATH_ATANH
|
||||
|
||||
#cmakedefine HAVE_CMATH_ISINF
|
||||
|
||||
#cmakedefine HAVE_CLOCK_GETTIME
|
||||
|
||||
#cmakedefine HAVE_GETTIMEOFDAY_FUNC
|
||||
|
||||
#cmakedefine MALLOC_IN_STDLIB_H
|
||||
|
||||
@@ -37,21 +41,41 @@
|
||||
|
||||
#if defined( HAVE_STRCASECMP )
|
||||
#define stricmp strcasecmp
|
||||
#elif defined( HAVE_ISO_STRICMP )
|
||||
#define stricmp _stricmp
|
||||
#endif
|
||||
|
||||
#if defined( HAVE_STRNCASECMP )
|
||||
#define strnicmp strncasecmp
|
||||
#elif defined( HAVE_ISO_STRNICMP )
|
||||
#define strnicmp _strnicmp
|
||||
#endif
|
||||
|
||||
/* Warning!!! Using wxGraphicContext for rendering is experimental. */
|
||||
#cmakedefine USE_WX_GRAPHICS_CONTEXT 1
|
||||
// Use Posix getc_unlocked() instead of getc() when it's available.
|
||||
#cmakedefine HAVE_FGETC_NOLOCK
|
||||
|
||||
#cmakedefine USE_IMAGES_IN_MENUS 1
|
||||
// Warning!!! Using wxGraphicContext for rendering is experimental.
|
||||
#cmakedefine USE_WX_GRAPHICS_CONTEXT 1
|
||||
|
||||
#cmakedefine USE_PNG_BITMAPS 1
|
||||
#cmakedefine USE_IMAGES_IN_MENUS 1
|
||||
|
||||
#endif /* __CONFIG_H__ */
|
||||
/// The legacy file format revision of the *.brd file created by this build
|
||||
#define LEGACY_BOARD_FILE_VERSION 2
|
||||
|
||||
/// The install prefix defined in CMAKE_INSTALL_PREFIX.
|
||||
#define DEFAULT_INSTALL_PATH "@CMAKE_INSTALL_PREFIX@"
|
||||
|
||||
/// Default footprint library install path when installed with `make install`.
|
||||
#define DEFAULT_FP_LIB_PATH "@KICAD_FP_LIB_INSTALL_PATH@"
|
||||
|
||||
/// When defined, build the GITHUB_PLUGIN for pcbnew.
|
||||
#cmakedefine BUILD_GITHUB_PLUGIN
|
||||
|
||||
/// When defined, use KIWAY and KIFACE DSOs
|
||||
#cmakedefine USE_KIWAY_DLLS
|
||||
|
||||
/// A file extension with a leading '.' is a suffix, and this one is used on
|
||||
/// top level program modules which implement the KIFACE.
|
||||
#define KIFACE_SUFFIX wxT( "@KIFACE_SUFFIX@" )
|
||||
#define KIFACE_PREFIX wxT( "@KIFACE_PREFIX@" )
|
||||
|
||||
/// Name of repo from which this build came.
|
||||
#define KICAD_REPO_NAME "@KICAD_REPO_NAME@"
|
||||
|
||||
#endif // CONFIG_H_
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
# Copyright (C) 2013 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
|
||||
|
||||
|
||||
|
||||
# Download av_http and install into ${PREFIX}, typically in our KiCad source tree.
|
||||
# Assumes include( ExternalProject ) was done inline previous to this file
|
||||
# and that set( DOWNLOAD_DIR ... ) was set in a higher context.
|
||||
|
||||
#-----<configure>-------------------------------------------------------------------------------------
|
||||
|
||||
# soon cmake will have https support, switch to a true download then:
|
||||
#set( AVHTTP_RELEASE ??? )
|
||||
#set( AVHTTP_MD5 ???? ) # re-calc this on every RELEASE change
|
||||
|
||||
#-----</configure>-----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Where the library is to be installed.
|
||||
set( PREFIX ${DOWNLOAD_DIR}/avhttp )
|
||||
|
||||
|
||||
# Install the AVHTTP header only library ${PREFIX}
|
||||
ExternalProject_Add( avhttp
|
||||
PREFIX ${PREFIX}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR} # no true download yet
|
||||
|
||||
# grab it from a local zip file for now, cmake caller's source dir
|
||||
URL ${CMAKE_CURRENT_SOURCE_DIR}/avhttp-master.zip
|
||||
DEPENDS boost
|
||||
|
||||
CONFIGURE_COMMAND ""
|
||||
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR> <INSTALL_DIR>
|
||||
)
|
||||
|
||||
|
||||
set( AVHTTP_INCLUDE_DIR "${PREFIX}/include" CACHE FILEPATH "AVHTTP include directory" )
|
||||
mark_as_advanced( AVHTTP_INCLUDE_DIR )
|
||||
@@ -0,0 +1,305 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
# Copyright (C) 2013 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
|
||||
|
||||
|
||||
|
||||
# Download a particular boost version, and patch it [and build it if BUILD_GITHUB_PLUGIN].
|
||||
# Assumes include( ExternalProject ) was done inline previous to this file
|
||||
# and that set( DOWNLOAD_DIR ... ) was set in a higher context.
|
||||
|
||||
|
||||
#-----<configure>----------------------------------------------------------------
|
||||
|
||||
set( BOOST_RELEASE 1.54.0 )
|
||||
set( BOOST_MD5 15cb8c0803064faef0c4ddf5bc5ca279 ) # re-calc this on every RELEASE change
|
||||
|
||||
# The boost headers [and static libs if built] go here, at the top of KiCad
|
||||
# source tree in boost_root.
|
||||
set( BOOST_ROOT "${PROJECT_SOURCE_DIR}/boost_root" )
|
||||
|
||||
|
||||
# Space separated list which indicates the subset of boost libraries to compile.
|
||||
# Chosen libraries are based on AVHTTP requirements, and possibly
|
||||
# unit_test_framework for its own worth.
|
||||
# tool_manager.cpp -> coroutine -> context (_jump_fcontext) (on OSX)
|
||||
|
||||
set( BOOST_LIBS_BUILT
|
||||
context
|
||||
#coroutine
|
||||
date_time
|
||||
#exception
|
||||
filesystem
|
||||
iostreams
|
||||
locale
|
||||
program_options
|
||||
regex
|
||||
#signals
|
||||
system
|
||||
thread
|
||||
#unit_test_framework
|
||||
)
|
||||
#-----</configure>---------------------------------------------------------------
|
||||
|
||||
find_package( BZip2 REQUIRED )
|
||||
|
||||
string( REGEX REPLACE "\\." "_" BOOST_VERS "${BOOST_RELEASE}" )
|
||||
set( PREFIX ${DOWNLOAD_DIR}/boost_${BOOST_VERS} )
|
||||
|
||||
# <SOURCE_DIR> = ${PREFIX}/src/boost
|
||||
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
|
||||
# download, the patch is applied. This lets you regenerate a new patch at any time
|
||||
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
|
||||
|
||||
# path to the boost headers in the repo.
|
||||
# repo = "${headers_src}/../.bzr" = "<SOURCE_DIR>/.bzr"
|
||||
set( headers_src "${PREFIX}/src/boost/boost" )
|
||||
|
||||
|
||||
function( set_boost_lib_names libs output )
|
||||
foreach( lib ${libs} )
|
||||
set( fullpath_lib "${BOOST_ROOT}/lib/libboost_${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}" )
|
||||
list( APPEND results ${fullpath_lib} )
|
||||
endforeach()
|
||||
# set the results into variable represented by output into caller's scope
|
||||
set( ${output} ${results} PARENT_SCOPE )
|
||||
endfunction()
|
||||
|
||||
|
||||
# (BTW "test" yields "unit_test_framework" when passed to bootstrap.sh ).
|
||||
#message( STATUS "BOOST_LIBS_BUILT:${BOOST_LIBS_BUILT}" )
|
||||
string( REPLACE "unit_test_framework" "test" boost_libs_list "${BOOST_LIBS_BUILT}" )
|
||||
#message( STATUS "REPLACE libs_csv:${boost_libs_list}" )
|
||||
|
||||
# Default Toolset
|
||||
set( BOOST_TOOLSET "toolset=gcc" )
|
||||
|
||||
if( KICAD_BUILD_STATIC OR APPLE )
|
||||
set( BOOST_LINKTYPE "link=static" )
|
||||
else()
|
||||
unset( BOOST_LINKTYPE )
|
||||
endif()
|
||||
|
||||
|
||||
if( MINGW )
|
||||
if( MSYS )
|
||||
# The Boost system does not build properly on MSYS using bootstrap.sh. Running
|
||||
# bootstrap.bat with cmd.exe does. It's ugly but it works. At least for Boost
|
||||
# version 1.54.
|
||||
set( bootstrap cmd.exe /c "bootstrap.bat mingw" )
|
||||
else()
|
||||
set( bootstrap ./bootstrap.bat mingw )
|
||||
endif()
|
||||
|
||||
foreach( lib ${boost_libs_list} )
|
||||
set( b2_libs ${b2_libs} --with-${lib} )
|
||||
endforeach()
|
||||
unset( BOOST_CFLAGS )
|
||||
else()
|
||||
string( REGEX REPLACE "\\;" "," libs_csv "${boost_libs_list}" )
|
||||
#message( STATUS "libs_csv:${libs_csv}" )
|
||||
|
||||
set( bootstrap ./bootstrap.sh --with-libraries=${libs_csv} )
|
||||
# pass to *both* C and C++ compilers
|
||||
set( BOOST_CFLAGS "cflags=${PIC_FLAG}" )
|
||||
set( BOOST_INCLUDE "${BOOST_ROOT}/include" )
|
||||
unset( b2_libs )
|
||||
endif()
|
||||
|
||||
|
||||
if( APPLE )
|
||||
# I set this to being compatible with wxWidgets
|
||||
# wxWidgets still using libstdc++ (gcc), meanwhile OSX
|
||||
# has switched to libc++ (llvm) by default
|
||||
set( BOOST_CXXFLAGS "cxxflags=-mmacosx-version-min=10.5 -fno-common" )
|
||||
set( BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=10.5 -fno-common" )
|
||||
set( BOOST_TOOLSET "toolset=darwin" )
|
||||
|
||||
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||
set(BOOST_CXXFLAGS "${BOOST_CXXFLAGS} -fno-lto" )
|
||||
set(BOOST_LINKFLAGS "${BOOST_LINKFLAGS} -fno-lto" )
|
||||
endif()
|
||||
|
||||
if( CMAKE_OSX_ARCHITECTURES )
|
||||
|
||||
if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc ") AND
|
||||
(CMAKE_OSX_ARCHITECTURES MATCHES "64"))
|
||||
message( "-- BOOST found 32/64 Address Model" )
|
||||
|
||||
set( BOOST_ADDRESSMODEL "address-model=32_64" )
|
||||
endif()
|
||||
|
||||
if( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") AND
|
||||
(CMAKE_OSX_ARCHITECTURES MATCHES "ppc"))
|
||||
message("-- BOOST found ppc/x86 Architecture")
|
||||
|
||||
set(BOOST_ARCHITECTURE "architecture=combined")
|
||||
elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") )
|
||||
message("-- BOOST found x86 Architecture")
|
||||
|
||||
set(BOOST_ARCHITECTURE "architecture=x86")
|
||||
elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "ppc64" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc") )
|
||||
message("-- BOOST found ppc Architecture")
|
||||
|
||||
set(BOOST_ARCHITECTURE "architecture=ppc")
|
||||
endif()
|
||||
|
||||
set( BOOST_CFLAGS "${BOOST_CFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
|
||||
set( BOOST_CXXFLAGS "${BOOST_CXXFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
|
||||
set( BOOST_LINKFLAGS "${BOOST_LINKFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ExternalProject_Add( boost
|
||||
PREFIX "${PREFIX}"
|
||||
|
||||
URL http://downloads.sourceforge.net/project/boost/boost/${BOOST_RELEASE}/boost_${BOOST_VERS}.tar.bz2
|
||||
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
|
||||
TIMEOUT 600 # 10 minutes
|
||||
URL_MD5 ${BOOST_MD5}
|
||||
# If download fails, then enable "LOG_DOWNLOAD ON" and try again.
|
||||
# Upon a second failure with logging enabled, then look at these logs:
|
||||
# <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-out.log
|
||||
# <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-err.log
|
||||
# If out.log does not show 100%, then try increasing TIMEOUT even more, or download the URL manually and put it
|
||||
# into <src>/.downloads-by-cmake/ dir.
|
||||
# LOG_DOWNLOAD ON
|
||||
|
||||
INSTALL_DIR "${BOOST_ROOT}"
|
||||
|
||||
# The patch command executes with the working directory set to <SOURCE_DIR>
|
||||
# Revert the branch to pristine before applying patch sets as bzr patch
|
||||
# fails when applying a patch to the branch twice and doesn't have a switch
|
||||
# to ignore previously applied patches
|
||||
PATCH_COMMAND bzr revert
|
||||
# bzr revert is insufficient to remove "added" files:
|
||||
COMMAND bzr clean-tree -q --force
|
||||
|
||||
COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch"
|
||||
COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_cstdint.patch"
|
||||
|
||||
COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86.patch" #https://svn.boost.org/trac/boost/ticket/8266
|
||||
# tell bzr about "added" files by last patch:
|
||||
COMMAND bzr add libs/context/src/asm/jump_i386_x86_64_sysv_macho_gas.S
|
||||
COMMAND bzr add libs/context/src/asm/make_i386_x86_64_sysv_macho_gas.S
|
||||
|
||||
COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86_build.patch" #https://svn.boost.org/trac/boost/ticket/8266
|
||||
COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_macosx_older_openssl.patch" #https://svn.boost.org/trac/boost/ticket/9273
|
||||
|
||||
COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_mingw.patch" #https://svn.boost.org/trac/boost/ticket/7262
|
||||
# tell bzr about "added" files by last patch:
|
||||
COMMAND bzr add libs/context/src/asm/make_i386_ms_pe_gas.S
|
||||
COMMAND bzr add libs/context/src/asm/jump_i386_ms_pe_gas.S
|
||||
COMMAND bzr add libs/context/src/asm/make_x86_64_ms_pe_gas.S
|
||||
COMMAND bzr add libs/context/src/asm/jump_x86_64_ms_pe_gas.S
|
||||
|
||||
COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/patch_macosx_context_ppc_v2.patch" #https://svn.boost.org/trac/boost/ticket/8266
|
||||
COMMAND bzr add libs/context/build/Jamfile.v2
|
||||
COMMAND bzr add libs/context/build/architecture.jam
|
||||
COMMAND bzr add libs/context/src/asm/jump_combined_sysv_macho_gas.S
|
||||
COMMAND bzr add libs/context/src/asm/jump_ppc32_sysv_macho_gas.S
|
||||
COMMAND bzr add libs/context/src/asm/jump_ppc64_sysv_macho_gas.S
|
||||
COMMAND bzr add libs/context/src/asm/make_combined_sysv_macho_gas.S
|
||||
COMMAND bzr add libs/context/src/asm/make_ppc32_sysv_macho_gas.S
|
||||
COMMAND bzr add libs/context/src/asm/make_ppc64_sysv_macho_gas.S
|
||||
|
||||
# [Mis-]use this step to erase all the boost headers and libraries before
|
||||
# replacing them below.
|
||||
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${BOOST_ROOT}"
|
||||
|
||||
BINARY_DIR "${PREFIX}/src/boost/"
|
||||
CONFIGURE_COMMAND ${bootstrap}
|
||||
|
||||
BUILD_COMMAND ./b2
|
||||
variant=release
|
||||
threading=multi
|
||||
${BOOST_CFLAGS}
|
||||
${BOOST_TOOLSET}
|
||||
${BOOST_CXXFLAGS}
|
||||
${BOOST_LINKFLAGS}
|
||||
${BOOST_ADDRESSMODEL}
|
||||
${BOOST_ARCHITECTURE}
|
||||
${b2_libs}
|
||||
${BOOST_LINKTYPE}
|
||||
--prefix=<INSTALL_DIR>
|
||||
install
|
||||
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
|
||||
if( MINGW )
|
||||
execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
|
||||
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.[0-9]+.*" "\\1\\2" BOOST_GCC_VERSION ${GCC_VERSION} )
|
||||
#message( STATUS "BOOST_GCC_VERSION: ${BOOST_GCC_VERSION}" )
|
||||
|
||||
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9])" "\\1_\\2" BOOST_LIB_VERSION ${BOOST_RELEASE} )
|
||||
#message( STATUS "BOOST_LIB_VERSION: ${BOOST_LIB_VERSION}" )
|
||||
|
||||
# adjust the names of the libraries to suit the build. There's no
|
||||
# symbolic links provided on the MinGW build to allow us to use
|
||||
# generic names for the libs
|
||||
foreach( lib ${BOOST_LIBS_BUILT} )
|
||||
set( mingw_boost_libs ${mingw_boost_libs} ${lib}-mgw${BOOST_GCC_VERSION}-mt-${BOOST_LIB_VERSION} )
|
||||
endforeach()
|
||||
|
||||
set( BOOST_LIBS_BUILT ${mingw_boost_libs} )
|
||||
set( BOOST_INCLUDE "${BOOST_ROOT}/include/boost-${BOOST_LIB_VERSION}" )
|
||||
unset( mingw_boost_libs )
|
||||
endif()
|
||||
|
||||
set( boost_libs "" )
|
||||
set_boost_lib_names( "${BOOST_LIBS_BUILT}" boost_libs )
|
||||
|
||||
set( Boost_LIBRARIES ${boost_libs} )
|
||||
set( Boost_INCLUDE_DIR "${BOOST_INCLUDE}" )
|
||||
|
||||
mark_as_advanced( Boost_LIBRARIES Boost_INCLUDE_DIR )
|
||||
|
||||
#message( STATUS "BOOST_ROOT:${BOOST_ROOT} BOOST_LIBRARIES:${BOOST_LIBRARIES}" )
|
||||
#message( STATUS "Boost_INCLUDE_DIR: ${Boost_INCLUDE_DIR}" )
|
||||
|
||||
|
||||
|
||||
ExternalProject_Add_Step( boost bzr_commit_boost
|
||||
COMMAND bzr ci -q -m pristine <SOURCE_DIR>
|
||||
COMMENT "committing pristine boost files to 'boost scratch repo'"
|
||||
DEPENDERS patch
|
||||
)
|
||||
|
||||
|
||||
ExternalProject_Add_Step( boost bzr_add_boost
|
||||
# add only the headers to the scratch repo, repo = "../.bzr" from ${headers_src}
|
||||
COMMAND bzr add -q ${PREFIX}/src/boost
|
||||
COMMENT "adding pristine boost files to 'boost scratch repo'"
|
||||
DEPENDERS bzr_commit_boost
|
||||
)
|
||||
|
||||
|
||||
ExternalProject_Add_Step( boost bzr_init_boost
|
||||
COMMAND bzr init -q <SOURCE_DIR>
|
||||
COMMENT "creating 'boost scratch repo' specifically for boost to track boost patches"
|
||||
DEPENDERS bzr_add_boost
|
||||
DEPENDEES download
|
||||
)
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
# Copyright (C) 2013 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
|
||||
|
||||
# Downloads and builds CAIRO
|
||||
|
||||
#-----<configure>----------------------------------------------------------------
|
||||
|
||||
set( CAIRO_RELEASE 1.12.0 )
|
||||
set( CAIRO_MD5 e6c85575ba7094f88b637bdfd835a751 ) # re-calc this on every RELEASE change
|
||||
|
||||
# The boost headers [and static libs if built] go here, at the top of KiCad
|
||||
# source tree in boost_root.
|
||||
set( CAIRO_ROOT "${PROJECT_SOURCE_DIR}/cairo_root" )
|
||||
|
||||
#-----</configure>---------------------------------------------------------------
|
||||
|
||||
find_package( BZip2 REQUIRED )
|
||||
|
||||
set( PREFIX ${DOWNLOAD_DIR}/cairo )
|
||||
|
||||
if ( KICAD_BUILD_STATIC )
|
||||
set( CAIRO_BUILDTYPE --disable-shared )
|
||||
endif( KICAD_BUILD_STATIC )
|
||||
|
||||
|
||||
if (APPLE)
|
||||
|
||||
set( CAIRO_CFLAGS "CFLAGS=" )
|
||||
set( CAIRO_LDFLAGS "LDFLAGS=-framework CoreServices -framework Cocoa" )
|
||||
set( CAIRO_OPTS --enable-ft=no )
|
||||
|
||||
if( CMAKE_OSX_ARCHITECTURES )
|
||||
set( CAIRO_CFLAGS "${CAIRO_CFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
|
||||
set( CAIRO_LDFLAGS "${CAIRO_LDFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
|
||||
endif( CMAKE_OSX_ARCHITECTURES )
|
||||
|
||||
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||
set(CAIRO_CFLAGS "${CAIRO_CFLAGS} -fno-lto" )
|
||||
endif()
|
||||
|
||||
if( CMAKE_OSX_SYSROOT )
|
||||
#set( CAIRO_CFLAGS "${CAIRO_CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}")
|
||||
set( CAIRO_LDFLAGS "${CAIRO_LDFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}")
|
||||
endif( CMAKE_OSX_SYSROOT)
|
||||
|
||||
endif(APPLE)
|
||||
|
||||
# <SOURCE_DIR> = ${PREFIX}/src/glew
|
||||
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
|
||||
# download, the patch is applied. This lets you regenerate a new patch at any time
|
||||
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
|
||||
|
||||
ExternalProject_Add( cairo
|
||||
PREFIX "${PREFIX}"
|
||||
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
|
||||
URL http://cairographics.org/releases/cairo-${CAIRO_RELEASE}.tar.gz
|
||||
URL_MD5 ${CAIRO_MD5}
|
||||
STAMP_DIR "${PREFIX}"
|
||||
|
||||
DEPENDS pkgconfig pixman libpng
|
||||
|
||||
BUILD_IN_SOURCE 1
|
||||
#SOURCE_DIR "${PREFIX}"
|
||||
#PATCH_COMMAND ""
|
||||
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${CAIRO_ROOT}"
|
||||
|
||||
CONFIGURE_COMMAND ./configure --prefix=${CAIRO_ROOT} --enable-static ${CAIRO_BUILDTYPE}
|
||||
PKG_CONFIG=${PROJECT_SOURCE_DIR}/pkgconfig_root/bin/pkg-config
|
||||
PKG_CONFIG_PATH=${PROJECT_SOURCE_DIR}/pixman_root/lib/pkgconfig:${PROJECT_SOURCE_DIR}/libpng_root/lib/pkgconfig
|
||||
--enable-png=yes --enable-svg=yes
|
||||
--disable-silent-rules --disable-dependency-tracking
|
||||
${CAIRO_CFLAGS}
|
||||
${CAIRO_LDFLAGS}
|
||||
${CAIRO_OPTS}
|
||||
|
||||
#BINARY_DIR "${PREFIX}"
|
||||
|
||||
BUILD_COMMAND $(MAKE)
|
||||
|
||||
INSTALL_DIR "${CAIRO_ROOT}"
|
||||
INSTALL_COMMAND $(MAKE) install
|
||||
)
|
||||
@@ -0,0 +1,87 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
# Copyright (C) 2013 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
|
||||
|
||||
# Downloads and builds GLEW
|
||||
|
||||
#-----<configure>----------------------------------------------------------------
|
||||
|
||||
set( GLEW_RELEASE 1.10.0 )
|
||||
set( GLEW_MD5 2f09e5e6cb1b9f3611bcac79bc9c2d5d ) # re-calc this on every RELEASE change
|
||||
|
||||
# The boost headers [and static libs if built] go here, at the top of KiCad
|
||||
# source tree in boost_root.
|
||||
set( GLEW_ROOT "${PROJECT_SOURCE_DIR}/glew_root" )
|
||||
|
||||
#-----</configure>---------------------------------------------------------------
|
||||
|
||||
find_package( BZip2 REQUIRED )
|
||||
|
||||
set( PREFIX ${DOWNLOAD_DIR}/glew )
|
||||
|
||||
if (APPLE)
|
||||
if( CMAKE_OSX_ARCHITECTURES )
|
||||
set( GLEW_CFLAGS "CFLAGS.EXTRA=-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.5" )
|
||||
set( GLEW_LDFLAGS "LDFLAGS.EXTRA=-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.5" )
|
||||
set( GLEW_STRIP "STRIP=")
|
||||
endif( CMAKE_OSX_ARCHITECTURES )
|
||||
endif(APPLE)
|
||||
|
||||
# <SOURCE_DIR> = ${PREFIX}/src/glew
|
||||
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
|
||||
# download, the patch is applied. This lets you regenerate a new patch at any time
|
||||
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
|
||||
|
||||
ExternalProject_Add( glew
|
||||
PREFIX "${PREFIX}"
|
||||
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
|
||||
URL http://sourceforge.net/projects/glew/files/glew/1.10.0/glew-${GLEW_RELEASE}.tgz
|
||||
URL_MD5 ${GLEW_MD5}
|
||||
STAMP_DIR "${PREFIX}"
|
||||
|
||||
#SOURCE_DIR "${PREFIX}"
|
||||
BUILD_IN_SOURCE 1
|
||||
|
||||
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${GLEW_ROOT}"
|
||||
|
||||
#PATCH_COMMAND "true"
|
||||
CONFIGURE_COMMAND ""
|
||||
|
||||
#BINARY_DIR "${PREFIX}"
|
||||
|
||||
BUILD_COMMAND $(MAKE) ${GLEW_CFLAGS} ${GLEW_LDFLAGS} ${GLEW_STRIP}
|
||||
|
||||
INSTALL_DIR "${GLEW_ROOT}"
|
||||
INSTALL_COMMAND $(MAKE) GLEW_DEST="${GLEW_ROOT}" install
|
||||
)
|
||||
|
||||
#
|
||||
# Optional Steps
|
||||
#
|
||||
|
||||
if( APPLE )
|
||||
# On OSX is needed to run ranlib to make .a indexes for all platforms
|
||||
ExternalProject_Add_Step( glew glew_osx_ranlib
|
||||
COMMAND ranlib "${GLEW_ROOT}/lib/libGLEW.a"
|
||||
COMMENT "ranlib ${GLEW_ROOT}/lib/libGLEW.a - Needed on OSX only"
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,76 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
# Copyright (C) 2013 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
|
||||
|
||||
# Downloads and builds LIBPNG
|
||||
|
||||
#-----<configure>----------------------------------------------------------------
|
||||
|
||||
set( LIBPNG_RELEASE 1.4.12 )
|
||||
set( LIBPNG_MD5 849b14d88e1240a1b9f2cb39dd39701e ) # re-calc this on every RELEASE change
|
||||
|
||||
# The boost headers [and static libs if built] go here, at the top of KiCad
|
||||
# source tree in boost_root.
|
||||
set( LIBPNG_ROOT "${PROJECT_SOURCE_DIR}/libpng_root" )
|
||||
|
||||
#-----</configure>---------------------------------------------------------------
|
||||
|
||||
find_package( BZip2 REQUIRED )
|
||||
|
||||
set( PREFIX ${DOWNLOAD_DIR}/libpng )
|
||||
|
||||
if (APPLE)
|
||||
if( CMAKE_OSX_ARCHITECTURES )
|
||||
SET( LIBPNG_CFLAGS "CFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES}")
|
||||
endif( CMAKE_OSX_ARCHITECTURES )
|
||||
endif(APPLE)
|
||||
|
||||
if (KICAD_BUILD_STATIC)
|
||||
set(LIBPNG_OPTS --enable-static --disable-shared)
|
||||
else()
|
||||
set(LIBPNG_OPTS --enable-static --enable-shared)
|
||||
endif(KICAD_BUILD_STATIC)
|
||||
|
||||
# <SOURCE_DIR> = ${PREFIX}/src/glew
|
||||
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
|
||||
# download, the patch is applied. This lets you regenerate a new patch at any time
|
||||
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
|
||||
|
||||
ExternalProject_Add( libpng
|
||||
PREFIX "${PREFIX}"
|
||||
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
|
||||
URL http://sourceforge.net/projects/libpng/files/libpng14/${LIBPNG_RELEASE}/libpng-${LIBPNG_RELEASE}.tar.bz2
|
||||
URL_MD5 ${LIBPNG_MD5}
|
||||
STAMP_DIR "${PREFIX}"
|
||||
|
||||
#SOURCE_DIR "${PREFIX}"
|
||||
BUILD_IN_SOURCE 1
|
||||
|
||||
#PATCH_COMMAND "true"
|
||||
CONFIGURE_COMMAND ./configure --prefix=${LIBPNG_ROOT} ${LIBPNG_OPTS} ${LIBPNG_CFLAGS} --disable-dependency-tracking
|
||||
#BINARY_DIR "${PREFIX}"
|
||||
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${LIBPNG_ROOT}"
|
||||
|
||||
BUILD_COMMAND $(MAKE)
|
||||
|
||||
INSTALL_DIR "${LIBPNG_ROOT}"
|
||||
INSTALL_COMMAND $(MAKE) install
|
||||
)
|
||||
@@ -0,0 +1,119 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
# Copyright (C) 2013 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
|
||||
|
||||
|
||||
|
||||
# Download OPENSSL and install into ${PREFIX}, typically in our KiCad source tree.
|
||||
# Assumes include( ExternalProject ) was done inline previous to this file
|
||||
# and that set( DOWNLOAD_DIR ... ) was set in a higher context.
|
||||
|
||||
#-----<configure>-------------------------------------------------------------------------------------
|
||||
|
||||
set( OPENSSL_RELEASE "1.0.1e" )
|
||||
set( OPENSSL_MD5 08bec482fe1c4795e819bfcfcb9647b9 ) # re-calc on every RELEASE change
|
||||
|
||||
#-----</configure>-----------------------------------------------------------------------------------
|
||||
|
||||
set( PREFIX ${DOWNLOAD_DIR}/openssl-${OPENSSL_RELEASE} )
|
||||
|
||||
# CMake barfs if we pass in an empty CMAKE_TOOLCHAIN_FILE, so we only set it up
|
||||
# if it has a non-empty value
|
||||
unset( TOOLCHAIN )
|
||||
if( CMAKE_TOOLCHAIN_FILE )
|
||||
set( TOOLCHAIN "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" )
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(
|
||||
openssl
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
PREFIX ${PREFIX}
|
||||
TIMEOUT 60
|
||||
URL http://launchpad.net/openssl-cmake/1.0.1e/1.0.1e-1/+download/openssl-cmake-1.0.1e-src.tar.gz
|
||||
URL_MD5 ${OPENSSL_MD5}
|
||||
|
||||
# mingw uses msvcrt.dll's printf() which cannot handle %zd, so having
|
||||
# BIO_snprintf() reference printf()'s formating attributes is a bug, since
|
||||
# BIO_snprintf() does its own formatting and is different from msvcrt's printf().
|
||||
|
||||
# This one would be easier if Windows folks could be asked to install "patch.exe"
|
||||
# PATCH_COMMAND patch -p0 < ${PROJECT_SOURCE_DIR}/patches/openssl-1.0.1e.patch
|
||||
|
||||
# This one requires the bzr commit below, since bzr patch only knows a working tree.
|
||||
|
||||
# Revert the branch to pristine before applying patch sets as bzr patch
|
||||
# fails when applying a patch to the branch twice and doesn't have a switch
|
||||
# to ignore previously applied patches
|
||||
PATCH_COMMAND bzr revert
|
||||
# PATCH_COMMAND continuation (any *_COMMAND here can be continued with COMMAND):
|
||||
COMMAND bzr patch -p0 ${PROJECT_SOURCE_DIR}/patches/openssl-1.0.1e.patch
|
||||
|
||||
CONFIGURE_COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
-G ${CMAKE_GENERATOR}
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
${TOOLCHAIN}
|
||||
<SOURCE_DIR>
|
||||
|
||||
BUILD_IN_SOURCE 1
|
||||
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
|
||||
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install
|
||||
)
|
||||
|
||||
# In order to use "bzr patch", we have to have a bzr working tree, this means a bzr repo
|
||||
# must be created and source committed to it. These extra steps do that.
|
||||
|
||||
set( target "openssl" )
|
||||
|
||||
ExternalProject_Add_Step( ${target} bzr_commit_${target}
|
||||
COMMAND bzr ci -q -m pristine <SOURCE_DIR>
|
||||
COMMENT "committing pristine ${target} files to '${target} scratch repo'"
|
||||
DEPENDERS patch
|
||||
)
|
||||
|
||||
ExternalProject_Add_Step( ${target} bzr_add_${target}
|
||||
COMMAND bzr add -q <SOURCE_DIR>
|
||||
COMMENT "adding pristine ${target} files to '${target} scratch repo'"
|
||||
DEPENDERS bzr_commit_${target}
|
||||
)
|
||||
|
||||
ExternalProject_Add_Step( ${target} bzr_init_${target}
|
||||
COMMAND bzr init -q <SOURCE_DIR>
|
||||
COMMENT "creating '${target} scratch repo' specifically for tracking ${target} patches"
|
||||
DEPENDERS bzr_add_${target}
|
||||
DEPENDEES download
|
||||
)
|
||||
|
||||
# The spelling of these is always taken from CMake Module's FindXYZ.cmake file:
|
||||
set( OPENSSL_INCLUDE_DIR
|
||||
${PREFIX}/include
|
||||
CACHE FILEPATH "OPENSSL include directory"
|
||||
)
|
||||
|
||||
set( OPENSSL_LIBRARIES
|
||||
${PREFIX}/lib/libssl${CMAKE_IMPORT_LIBRARY_SUFFIX}
|
||||
${PREFIX}/lib/libcrypto${CMAKE_IMPORT_LIBRARY_SUFFIX}
|
||||
CACHE STRING "OPENSSL libraries"
|
||||
)
|
||||
set( OPENSSL_FOUND true )
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
# Copyright (C) 2013 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
|
||||
|
||||
# Downloads and builds PIXMAN
|
||||
|
||||
#-----<configure>----------------------------------------------------------------
|
||||
|
||||
set( PIXMAN_RELEASE 0.32.4 )
|
||||
set( PIXMAN_MD5 eba449138b972fbf4547a8c152fea162 ) # re-calc this on every RELEASE change
|
||||
|
||||
# The boost headers [and static libs if built] go here, at the top of KiCad
|
||||
# source tree in boost_root.
|
||||
set( PIXMAN_ROOT "${PROJECT_SOURCE_DIR}/pixman_root" )
|
||||
|
||||
#-----</configure>---------------------------------------------------------------
|
||||
|
||||
find_package( BZip2 REQUIRED )
|
||||
|
||||
set( PREFIX ${DOWNLOAD_DIR}/pixman )
|
||||
|
||||
set(PIXMAN_CPPFLAGS "CFLAGS=")
|
||||
|
||||
if (APPLE)
|
||||
if( CMAKE_OSX_ARCHITECTURES )
|
||||
set(PIXMAN_CPPFLAGS "${PIXMAN_CPPFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES} -fno-common -mmacosx-version-min=10.5")
|
||||
else()
|
||||
set(PIXMAN_CPPFLAGS "${PIXMAN_CPPFLAGS} -fno-common -mmacosx-version-min=10.5")
|
||||
endif( CMAKE_OSX_ARCHITECTURES )
|
||||
endif(APPLE)
|
||||
|
||||
if (KICAD_BUILD_STATIC)
|
||||
set(PIXMAN_OPTS --enable-static=yes --enable-shared=no)
|
||||
else()
|
||||
set(PIXMAN_OPTS --enable-static=yes --enable-shared=yes)
|
||||
endif(KICAD_BUILD_STATIC)
|
||||
|
||||
# <SOURCE_DIR> = ${PREFIX}/src/glew
|
||||
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
|
||||
# download, the patch is applied. This lets you regenerate a new patch at any time
|
||||
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
|
||||
|
||||
ExternalProject_Add( pixman
|
||||
PREFIX "${PREFIX}"
|
||||
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
|
||||
URL http://cairographics.org/releases/pixman-${PIXMAN_RELEASE}.tar.gz
|
||||
URL_MD5 ${PIXMAN_MD5}
|
||||
STAMP_DIR "${PREFIX}"
|
||||
|
||||
#SOURCE_DIR "${PREFIX}"
|
||||
BUILD_IN_SOURCE 1
|
||||
|
||||
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${PIXMAN_ROOT}"
|
||||
|
||||
#PATCH_COMMAND "true"
|
||||
CONFIGURE_COMMAND ./configure --prefix=${PIXMAN_ROOT} ${PIXMAN_OPTS} ${PIXMAN_CPPFLAGS} --disable-dependency-tracking
|
||||
#BINARY_DIR "${PREFIX}"
|
||||
|
||||
BUILD_COMMAND $(MAKE)
|
||||
|
||||
INSTALL_DIR "${PIXMAN_ROOT}"
|
||||
INSTALL_COMMAND $(MAKE) install
|
||||
)
|
||||
@@ -0,0 +1,78 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
# Copyright (C) 2013 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
|
||||
|
||||
# Downloads and builds CAIRO
|
||||
|
||||
#-----<configure>----------------------------------------------------------------
|
||||
|
||||
set( PKGCONFIG_RELEASE 0.28 )
|
||||
set( PKGCONFIG_MD5 aa3c86e67551adc3ac865160e34a2a0d ) # re-calc this on every RELEASE change
|
||||
|
||||
# The boost headers [and static libs if built] go here, at the top of KiCad
|
||||
# source tree in boost_root.
|
||||
set( PKGCONFIG_ROOT "${PROJECT_SOURCE_DIR}/pkgconfig_root" )
|
||||
|
||||
#-----</configure>---------------------------------------------------------------
|
||||
|
||||
find_package( BZip2 REQUIRED )
|
||||
|
||||
set( PREFIX ${DOWNLOAD_DIR}/pkgconfig )
|
||||
|
||||
if ( KICAD_BUILD_STATIC )
|
||||
set( PKGCONFIG_BUILDTYPE --enable-shared=no --enable-static=yes )
|
||||
else()
|
||||
set( PKGCONFIG_BUILDTYPE --enable-shared=yes --enable-static=yes )
|
||||
endif( KICAD_BUILD_STATIC )
|
||||
|
||||
# <SOURCE_DIR> = ${PREFIX}/src/glew
|
||||
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
|
||||
# download, the patch is applied. This lets you regenerate a new patch at any time
|
||||
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
|
||||
|
||||
ExternalProject_Add( pkgconfig
|
||||
PREFIX "${PREFIX}"
|
||||
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
|
||||
URL http://pkgconfig.freedesktop.org/releases/pkg-config-${PKGCONFIG_RELEASE}.tar.gz
|
||||
URL_MD5 ${PKGCONFIG_MD5}
|
||||
STAMP_DIR "${PREFIX}"
|
||||
|
||||
#SOURCE_DIR "${PREFIX}"
|
||||
BUILD_IN_SOURCE 1
|
||||
|
||||
#PATCH_COMMAND "true"
|
||||
CONFIGURE_COMMAND ./configure --prefix=${PKGCONFIG_ROOT} --with-internal-glib ${PKGCONFIG_BUILDTYPE} --disable-silent-rules
|
||||
#BINARY_DIR "${PREFIX}"
|
||||
|
||||
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${PKGCONFIG_ROOT}"
|
||||
|
||||
BUILD_COMMAND $(MAKE)
|
||||
|
||||
INSTALL_DIR "${PKGCONFIG_ROOT}"
|
||||
INSTALL_COMMAND $(MAKE) install
|
||||
)
|
||||
|
||||
ExternalProject_Add_Step( pkgconfig pkgconfig_cleanup
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PKGCONFIG_ROOT}"
|
||||
COMMENT "pkgconfig - cleanup destination before proceeding in install"
|
||||
DEPENDEES build
|
||||
)
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
# Copyright (C) 2013 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
|
||||
|
||||
# Downloads and builds LIBWX
|
||||
|
||||
#-----<configure>----------------------------------------------------------------
|
||||
|
||||
set( LIBWX_RELEASE 3.0.0 )
|
||||
set( LIBWX_MD5 241998efc12205172ed24c18788ea2cd ) # re-calc this on every RELEASE change
|
||||
|
||||
# The boost headers [and static libs if built] go here, at the top of KiCad
|
||||
# source tree in boost_root.
|
||||
set( LIBWX_ROOT "${PROJECT_SOURCE_DIR}/libwx_root" )
|
||||
|
||||
#-----</configure>---------------------------------------------------------------
|
||||
|
||||
find_package( BZip2 REQUIRED )
|
||||
|
||||
set( PREFIX ${DOWNLOAD_DIR}/libwx )
|
||||
|
||||
if (APPLE)
|
||||
if( CMAKE_OSX_ARCHITECTURES )
|
||||
STRING(REGEX REPLACE " -arch " "," LIBWX_ARCHITECTURES ${CMAKE_OSX_ARCHITECTURES})
|
||||
SET( LIBWX_ARCHITECTURES --enable-universal_binary=${LIBWX_ARCHITECTURES})
|
||||
endif( CMAKE_OSX_ARCHITECTURES )
|
||||
endif(APPLE)
|
||||
|
||||
if ( KICAD_BUILD_STATIC )
|
||||
set( LIBWX_BUILDTYPE "--disable-shared" )
|
||||
endif( KICAD_BUILD_STATIC )
|
||||
|
||||
# <SOURCE_DIR> = ${PREFIX}/src/libwx
|
||||
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
|
||||
# download, the patch is applied. This lets you regenerate a new patch at any time
|
||||
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
|
||||
|
||||
ExternalProject_Add( libwx
|
||||
PREFIX "${PREFIX}"
|
||||
DOWNLOAD_DIR "${DOWNLOAD_DIR}"
|
||||
URL http://downloads.sourceforge.net/project/wxwindows/${LIBWX_RELEASE}/wxWidgets-${LIBWX_RELEASE}.tar.bz2
|
||||
URL_MD5 ${LIBWX_MD5}
|
||||
STAMP_DIR "${PREFIX}"
|
||||
|
||||
BUILD_IN_SOURCE 1
|
||||
|
||||
PATCH_COMMAND bzr revert
|
||||
COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/wxwidgets-3.0.0_macosx.patch"
|
||||
COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/wxwidgets-3.0.0_macosx_bug_15908.patch"
|
||||
|
||||
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${LIBWX_ROOT}"
|
||||
|
||||
CONFIGURE_COMMAND ./configure --prefix=${LIBWX_ROOT} -with-opengl --enable-aui --enable-debug_info -with-expat=builtin --with-regex=builtin --enable-utf8 ${LIBWX_ARCHITECTURES} ${LIBWX_BUILDTYPE}
|
||||
#BINARY_DIR "${PREFIX}"
|
||||
|
||||
BUILD_COMMAND $(MAKE) VERBOSE=1
|
||||
|
||||
INSTALL_DIR "${LIBWX_ROOT}"
|
||||
INSTALL_COMMAND make install
|
||||
)
|
||||
|
||||
#SET directories
|
||||
set(wxWidgets_BIN_DIR ${LIBWX_ROOT}/bin)
|
||||
set(wxWidgets_CONFIG_EXECUTABLE ${LIBWX_ROOT}/bin/wx-config)
|
||||
set(wxWidgets_INCLUDE_DIRS ${LIBWX_ROOT}/include)
|
||||
set(wxWidgets_LIBRARY_DIRS ${LIBWX_ROOT}/lib)
|
||||
|
||||
|
||||
ExternalProject_Add_Step( libwx bzr_commit_libwx
|
||||
COMMAND bzr ci -q -m pristine <SOURCE_DIR>
|
||||
COMMENT "committing pristine libwx files to 'libwx scratch repo'"
|
||||
DEPENDERS patch
|
||||
)
|
||||
|
||||
|
||||
ExternalProject_Add_Step( libwx bzr_add_libwx
|
||||
COMMAND bzr add -q ${PREFIX}/src/libwx
|
||||
COMMENT "adding pristine libwx files to 'libwx scratch repo'"
|
||||
DEPENDERS bzr_commit_libwx
|
||||
)
|
||||
|
||||
|
||||
ExternalProject_Add_Step( libwx bzr_init_libwx
|
||||
COMMAND bzr init -q <SOURCE_DIR>
|
||||
COMMENT "creating 'libwx scratch repo' specifically for libwx to track libwx patches"
|
||||
DEPENDERS bzr_add_libwx
|
||||
DEPENDEES download
|
||||
)
|
||||
|
||||
######
|
||||
# Now is time to search what we have built
|
||||
######
|
||||
|
||||
ExternalProject_Add_Step( libwx libwx_recursive_message
|
||||
COMMAND cmake .
|
||||
COMMENT "*** RERUN CMAKE - wxWidgets built, now reissue a cmake to build Kicad"
|
||||
DEPENDEES install
|
||||
)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* Do not modify this file, it was automatically generated by CMake. */
|
||||
|
||||
/*
|
||||
* Define the current source code Subversion commit number. The version
|
||||
* string defined below does not update automatically when building the
|
||||
* source with make. Run make rebuild_cache to update version strings.
|
||||
*/
|
||||
#ifndef __KICAD_SVN_VERSION_H__
|
||||
#define __KICAD_SVN_VERSION_H__
|
||||
|
||||
#cmakedefine KICAD_BUILD_VERSION "@KICAD_BUILD_VERSION@"
|
||||
|
||||
#endif /* __KICAD_SVN_VERSION_H__ */
|
||||
/* Do not modify this file, it was automatically generated by CMake. */
|
||||
|
||||
/*
|
||||
* Define the current source code Subversion commit number. The version
|
||||
* string defined below does not update automatically when building the
|
||||
* source with make. Run make rebuild_cache to update version strings.
|
||||
*/
|
||||
#ifndef __KICAD_SVN_VERSION_H__
|
||||
#define __KICAD_SVN_VERSION_H__
|
||||
|
||||
#cmakedefine KICAD_BUILD_VERSION "@KICAD_BUILD_VERSION@"
|
||||
|
||||
#endif /* __KICAD_SVN_VERSION_H__ */
|
||||
|
||||
+243
-370
@@ -1,25 +1,37 @@
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
Note that the GPL below is copyrighted by the Free Software
|
||||
Foundation, but the instance of code that it refers to (KiCad)
|
||||
is copyrighted by the KiCad developers, those who actually wrote it.
|
||||
The various CHANGELOG*.txt files and more importantly the Bazaar
|
||||
repository contain a record of who wrote what.
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Also note that the only valid version of the GPL as far as KiCad
|
||||
is concerned is _this_ particular version of the license (ie v2, not
|
||||
v2.2 or v3.x or whatever), unless explicitly otherwise stated.
|
||||
|
||||
Dick Hollenbeck
|
||||
|
||||
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
@@ -30,347 +42,195 @@ in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library, or if you modify it.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
modification follow.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the source code distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
the Program or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
@@ -381,101 +241,114 @@ impose that choice.
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
NO WARRANTY
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
NO WARRANTY
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library 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 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 library is distributed in the hope that it will be useful,
|
||||
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
|
||||
Library General Public License for more details.
|
||||
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 Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,243 @@
|
||||
Proposed Plan for adding Nano Meters into PCBNEW as the Board Internal Unit
|
||||
===========================================================================
|
||||
|
||||
Author: Dick Hollenbeck November 25, 2011
|
||||
|
||||
Introduction:
|
||||
============
|
||||
|
||||
This document sketches out a plan to move KiCad's PCBNEW program from deci-mil
|
||||
internal units to nanometer internal units. The changes to the code are
|
||||
significant enough to describe the basic process before the work is started.
|
||||
|
||||
Definitions:
|
||||
===========
|
||||
|
||||
*) Board Internal Units (BIU). This is a pseudonym for the engineering units
|
||||
used by a BOARD when it is in RAM, and only when it is in RAM. BIU is
|
||||
essentially equal to nanometers in the future, and equal to deci-mils currently.
|
||||
A BIU refers typically to a measurement or a position on an XY grid, and this is
|
||||
because this grid is dimensioned in BIUs along both its X and Y axes. Both X and
|
||||
Y can be either positive or negative on this grid. In the case of measurements
|
||||
or scalars, there can be a radius, a diameter, a distance (length), and all of
|
||||
these can and should be expressed in BIUs, so long we are in RAM and so long as
|
||||
we are talking about the objects within the class BOARD instance. One special
|
||||
feature of XY points within the BIU coordinate system is that they will always
|
||||
be integers. In contrast, distances and other forms of measurements are not
|
||||
subject to the same limitation by the very nature of physics. Coordinates are
|
||||
always integers because we used signed whole numbers to represent these BIU
|
||||
coordinates.
|
||||
|
||||
*) Snap grid. A snap grid is a subset of the full set of possible XY coordinates
|
||||
in the BIU coordinate system. Points falling on the snap grid are evenly spaced
|
||||
in X and Y directions and are some integer multiple apart in this 2D space,
|
||||
greater than one BIU.
|
||||
|
||||
Assumptions:
|
||||
===========
|
||||
|
||||
a) It is ok to modify the board file format in order to handle the BIU change.
|
||||
|
||||
b) Boards saved on disk in the new format will not be readable using old software.
|
||||
|
||||
c) Since we have no backwards compatibility obligation (see b) above), we can
|
||||
make significant changes to the file format while we have this disruption
|
||||
opportunity.
|
||||
|
||||
General:
|
||||
=======
|
||||
|
||||
With nano meters as the Board Internal Unit (BIU), a 32 bit signed integer can
|
||||
only hold about 2 meters of positive length and 2 meters of negative length.
|
||||
Moreover, because most of the bits within a 32 bit integer can be "used up" to
|
||||
hold a typical length within a board, it is very likely that if pure 32 bit
|
||||
integer math is done, such as the multiplication of two integers in order to
|
||||
calculate a hypotenuse, then there will be an overflow within the 32 bit
|
||||
integer. (Another way to think of the BIU acronym is "Board Integer Unit" instead
|
||||
of as Board Internal Unit, to pave the way for the BFU, discussed below.)
|
||||
|
||||
Therefore all intermediate products, quotients, trig, and exponential
|
||||
calculations should be done using some larger floating point type. By larger,
|
||||
bitness or number of bits is meant. Distances that do not have to be rounded
|
||||
back to integer immediately can and should stay in the larger floating point
|
||||
"value container" for as long as possible. The typedef name of this floating
|
||||
point type is BFU (Board Float Unit). The engineering units on a BFU are the
|
||||
same as on a BIU. A typedef is nice so that we can toggle between double and
|
||||
"long double" for various compilations, and so that when performing casts, these
|
||||
are brief textual expressions.
|
||||
|
||||
Format Strings:
|
||||
==============
|
||||
|
||||
Because all our save to disk functions use printf() style format strings, we
|
||||
discuss how to construct a format string in the most usable way. There should be
|
||||
a printf() style format string like "%.6g" for the BFU (cast to a hard coded
|
||||
double) enclosed within a #define and its name should be FMT_ENG. This format
|
||||
string will be used at least for saving BOARD and MODULE files, and perhaps
|
||||
more.
|
||||
|
||||
FMT_ENG stands for "format string for ENGineering units used out in the file". A
|
||||
define is needed simply to provide consistency across many sites of usage. BIUs
|
||||
will be scaled before being written to disk in most every case, and since
|
||||
scaling is a multiplication, it means casting one of the factors to BFU, and
|
||||
then this product is output with a printf() style function using the FMT_ENG
|
||||
string segment.
|
||||
|
||||
That is, the FMT_ENG will be suitable for use with a BFU type. When BFU is set
|
||||
to double, then FMT_ENG will be set to "%.6g". When BFU is set to long double
|
||||
then FMT_ENG will be set to "%.6Lg". For example:
|
||||
|
||||
#if USE_DOUBLE_BFU
|
||||
typedef double BFU;
|
||||
#define FMT_ENG ".%10g"
|
||||
#else
|
||||
typedef long double BFU;
|
||||
#define FMT_ENG ".%10Lg"
|
||||
#endif
|
||||
|
||||
A format string can then be built up using compile time concatenation of
|
||||
strings, like this:
|
||||
|
||||
fprintf( fp, "Value: " FMT_ENG " " FMT_ENG "\n", BFU( biu1 * scale), BFU( biu2 * scale ) );
|
||||
|
||||
The 3rd and 4th arguments are BFUs, and the casting is done after the multiply
|
||||
since the scaling factor is already a double or perhaps even a long double. The
|
||||
final argument needs to match the format string, so the final product is wrapped
|
||||
in a BFU, which could actually be a truncation down to 64 bit float from 80 bit
|
||||
float. The key points are: the calculation must be done in a float type at least
|
||||
as bit-wide as BFU, and that the value actually passed to fprintf() must match
|
||||
the format string.
|
||||
|
||||
Choosing BIU Units:
|
||||
==================
|
||||
|
||||
BIUs are only used when a BOARD or MODULE is in RAM. A BIU is equivalent to
|
||||
either a 1) deci-mil or 2) nanometer, depending on how the source code is
|
||||
compiled. It is not a runtime decision. Form 1) is needed only during the
|
||||
preparation phase of the source code transition to nanometers. After the
|
||||
transition, only nanometers will be used in the compilation. No runtime
|
||||
switching is needed or wanted. Again, BIUs can only be one or the other for a
|
||||
given compilation, and this will swing based on a single #define.
|
||||
|
||||
Eventually we may want to actually use "BIU" as our integer type in source code
|
||||
for those lengths which pertain to the board coordinate space. This would give
|
||||
us the ability to easily modify it, go to a larger bitness, make the source code
|
||||
more readable, and keep the type information out of the variable name. This
|
||||
would mean having a point and/or size class based on BIU as the contained
|
||||
integer types. This is a nice to have, but not immediately mandatory.
|
||||
|
||||
There will be a number of places within the source code which will have to be
|
||||
doctored up to use the BFU casting. It will take some time to find all these
|
||||
sites. During this time it should be possible to continue using deci-mils as the
|
||||
BIU for source compilation.
|
||||
|
||||
There are a quite a number of path ways in and out of BOARDs and MODULEs. Most
|
||||
everyone of these pathways involve conversion or scaling of BIUs. An example of
|
||||
a pathway in is a BOARD disk file loading function. An example of a pathway out
|
||||
of a BOARD is a disk file saving function. Likewise for MODULEs. We can
|
||||
characterize the load and save functions by their source and destination
|
||||
representations of lengths.
|
||||
|
||||
BOARDs and MODULEs will soon have a new format, which is basically the existing
|
||||
format expressed in um or nm (TBD) rather than in deci-mils. For discussion, we
|
||||
will say this new format is in mm, even though it may end up being in um. In
|
||||
another year or two we will switch to s-expressions, or sooner if there is a
|
||||
volunteer.
|
||||
|
||||
Here are the required immediate need BOARD load functions:
|
||||
|
||||
1) Legacy to deci-mil loader. This loader uses a floating point scaling factor
|
||||
of unity, since destination is a RAM BOARD using deci-mils as its BIU.
|
||||
|
||||
2) Legacy to nanometer loader. This loader uses a floating point scaling factor
|
||||
of 2540, since destination is a RAM BOARD using nanometers as its BIU, and
|
||||
the source format is using deci-mils.
|
||||
|
||||
3) mm to nanometer loader. This loader uses a floating point scaling factor
|
||||
of 1000000, since the destination is a RAM BOARD using nanometers as its BIU.
|
||||
|
||||
There is no need for a nm to deci-mil loader. (Once somebody saves a file in the
|
||||
new format, that format is used going forward, or its backup in the old format.)
|
||||
|
||||
Now duplicate the above 3 loader types for MODULEs.
|
||||
|
||||
Here are the required immediate need BOARD save functions:
|
||||
|
||||
1) deci-mil to deci-mil, using a floating point scaling factor of unity. It
|
||||
should be possible to use trailing zero suppression on the deci-mils to get a
|
||||
BOARD that is identical to an old BOARD, and this can be used to test the new
|
||||
save function, using "diff" with whitespace ignore. This saver is only in play
|
||||
when the BIU is compiled to be deci-mils.
|
||||
|
||||
2) nanometer to mm, using a floating point scaling factor of 1/1000000. This
|
||||
saver is only in play when the BIU is compiled to be nanometers.
|
||||
|
||||
Now duplicate the above 3 saver types for MODULEs.
|
||||
|
||||
New BOARD and MODULE files will have a new field in them identifying the
|
||||
engineering units used, say mm.
|
||||
|
||||
In actuality, the source code to all 3 loaders, and to all 3 savers can be the
|
||||
same source code with a single variable in each case for scaling.
|
||||
|
||||
All 6 loaders and all 6 savers should be written in parallel with existing
|
||||
loaders and savers, so that we can toggle usage back and forth between the two
|
||||
for awhile. This means we do not gut existing savers and loaders until the new
|
||||
ones are debugged and stable.
|
||||
|
||||
The new savers and loaders are to be done in the context of a plug-in
|
||||
architecture, described elsewhere.
|
||||
|
||||
Angles and Rotations:
|
||||
====================
|
||||
|
||||
Internally we are switching from using an int to hold 1/10 of degrees angle to a
|
||||
typedef called DEGREES. The allowed values that DEGREES can hold will be
|
||||
enforced by the user interface policy, decided elsewhere. The engineering units
|
||||
in the DEGREES type is degrees, no longer tenths of degrees.
|
||||
|
||||
/// a value used to hold rotations or angles.
|
||||
typedef double DEGREES;
|
||||
|
||||
|
||||
User Interface Changes:
|
||||
======================
|
||||
|
||||
All these changes have to be done in a way where they hinge on one #ifdef.
|
||||
|
||||
*) The grid dimension choices will have to be changed.
|
||||
|
||||
*) The drawing routines will have to be changed to handle the case that BIU is
|
||||
compiled to be nm. Work towards getting legacy drawing code capable of handling
|
||||
a compile time #define to control a single scaling factor. Only the scaling
|
||||
factor should need be changed in the final state. Up until then, the work
|
||||
required is to inject the BFU casting where needed along with the scaling
|
||||
factor(s).
|
||||
|
||||
*) Remove any funky imperial to metric conversion functions which tried to hide/mask
|
||||
problems with lack of BIU precision.
|
||||
|
||||
*) There may be some fix ups pertaining to "near enough" type testing involving
|
||||
the user's mouse position, other than bounding box hit testing which should take
|
||||
care of itself (in BIUs). This has more to do with near-ness to a line type
|
||||
tests, and these are thought to best be done in screen coordinates anyway, not
|
||||
BIUs.
|
||||
|
||||
Work Tasks:
|
||||
==========
|
||||
|
||||
*) Within PCBNEW, find math expressions involving BIUs and cast them to BFUs
|
||||
early enough so that the compiler generates code in the BFU realm.
|
||||
|
||||
*) Find a way to consistently round values from BFUs back to BIUs, and put that
|
||||
code in place. This could be done using a set accessor on a BIU, or other way.
|
||||
|
||||
*) Fix the User Interface issues mentioned above, and more found later.
|
||||
|
||||
*) Write the 4 new load and save functions. Vladimir recently committed code
|
||||
which can be a starting point for some of these functions, except that the new
|
||||
ones should reside within a PLUGIN object where we can save the scaling factor
|
||||
variable as a member field of the plugin. In order to meet the requirements
|
||||
of all 3 board loaders, we may have to dynamically change the scaling factor
|
||||
depending on what we find in the *.brd file and how the plugin is compiled.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,297 @@
|
||||
KiCad ChangeLog 2011
|
||||
====================
|
||||
|
||||
Please add newer entries at the top, list the date and your name with
|
||||
email address.
|
||||
|
||||
|
||||
2011-Dec-19, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
|
||||
================================================================================
|
||||
Pcbnew:
|
||||
Enhanced algorithms to calculate board connections:
|
||||
- A track is seen connected to a pad if the track end is inside the pad shape.
|
||||
- Pads inside pads are now seen connected, if the center of the pad is
|
||||
*inside* the other pad.
|
||||
(this is made to be sure a large copper area is shared by the 2 pads,
|
||||
and to keep algorithm fast).
|
||||
Algorithm to calculate pads connections is still very fast.
|
||||
However some other functions (drag pads, track len calculation ...)
|
||||
still need the track end exactly on the pad position.
|
||||
|
||||
|
||||
2011-Dec-13 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
++common
|
||||
* changed all the RotatePoint() functions in trigo.{h,cpp} to take a double as the
|
||||
angle, which is still in tenths of degrees for now.
|
||||
* EDA_TEXT::m_Orient is now double, still in tenths of degrees (for a short while),
|
||||
but the double means parsing files and saving them use a different format string.
|
||||
++pcbnew
|
||||
* DRAWSEGMENT::GetStart() and GetEnd() do not operate for S_ARC like they used to.
|
||||
They are now simply accessors for m_Start and m_End. Use DRAWSEGMENT::GetArcStart()
|
||||
and GetArcEnd() and GetCenter() for arcs. specctra_export.cpp was the only
|
||||
source file dependent on the old behavior.
|
||||
* DIMENSION::m_Text is now contained, not dynamically allocated.
|
||||
* more kicad_plugin work.
|
||||
|
||||
|
||||
2011-Dec-9 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
++PCBNew
|
||||
* added BOARD::GetPad(int), made BOARD::m_NetInfo private, and contained
|
||||
within the BOARD, not dynamically allocated and owned via pointer.
|
||||
* added BOARD::GetPadCount()
|
||||
* changed NETINFO_LIST::GetCount() to GetNetCount()
|
||||
* added BOARD::GetNetCount()
|
||||
* more kicad_plugin work.
|
||||
|
||||
2011-Dec-5 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
++PCBNew
|
||||
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
|
||||
having a BOARD being edited by more than one editor, it was a bad design.
|
||||
And this meant removing m_PcbFrame from BOARD.
|
||||
* removed BOARD::SetWindowFrame(), since BOARD::m_PcbFrame gone.
|
||||
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
|
||||
* Added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
|
||||
* A couple of dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
|
||||
such as dialog_mask_clearance, dialog_drc, etc.
|
||||
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
|
||||
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
|
||||
better place for this constant.
|
||||
* Made the public functions in PARAM_CFG_ARRAY be type const.
|
||||
void SaveParam(..) const and void ReadParam(..) const
|
||||
* PARAM_CFG_BASE now has virtual destructor since we have various ways of
|
||||
destroying the derived classes and boost::ptr_vector must be told about this.
|
||||
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
|
||||
an automatic PARAM_CFG_ARRAY which is on the stack.
|
||||
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
|
||||
since it has to access the current BOARD and the BOARD can change.
|
||||
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
|
||||
* Made the m_BoundingBox member private, this was a brutally hard task,
|
||||
and indicative of the lack of commitment to accessors and object oriented
|
||||
design on the part of KiCad developers. We must do better.
|
||||
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
|
||||
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
|
||||
|
||||
|
||||
2011-Dec-04, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
|
||||
================================================================================
|
||||
Pcbnew:
|
||||
Enhanced algorithms to calculate board connections:
|
||||
Previously, a track was seen connected to a pad only if the track end is
|
||||
exactly on the pad position.
|
||||
Now a track is seen connected to a pad if the track end is inside the pad shape.
|
||||
Algorithm to calculate pads connections to track is still very fast.
|
||||
However some other functions (drag pads, track len calculation ...)
|
||||
still need the track end exactly on the pad position.
|
||||
|
||||
2011-Nov-27 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
++PCBNew
|
||||
* Add PLUGIN and IO_MGR classes.
|
||||
* Remove one argument from BOARD constructor,
|
||||
* add BOARD::SetWindowFrame()
|
||||
|
||||
2011-sept-13 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
|
||||
================================================================================
|
||||
PCBNew locate code refactoring.
|
||||
|
||||
* Move various locate functions into the appropriate board item object.
|
||||
* Unified best zoom for all frames derived from PCB_BASE_FRAME.
|
||||
* Remove track.cpp as it is no longer needed.
|
||||
* Dead code removal.
|
||||
* Remove scary frame window pointer member from board item objects.
|
||||
* Add draw bounding box to gerber draw item for debugging purposes.
|
||||
|
||||
2012-Sept-8 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
++all
|
||||
* Write an automatic bitmap generation script in cmake, PNG2cpp.cmake
|
||||
* Write an infrastructure generate *.png files from inkscape files, and do
|
||||
it maintaing the "as needed" change detection support.
|
||||
* Support an *.SVG maintainer mode, AND an *.SVG user mode.
|
||||
* Engineer a seemless switchover from old style xpm files, with minimal
|
||||
impact to system wide source code.
|
||||
|
||||
2011-Sept-07, UPDATE Andrey Fedorushkov <andrf@mail.ru>
|
||||
================================================================================
|
||||
Pcbnew:
|
||||
Add hotkey "P" - place item
|
||||
Add Roman Bashkov patch for record/play sequence hotkey macros
|
||||
Add record and play macros for sequence hotkey.
|
||||
Macros set to numeric key 0..9:
|
||||
<Ctrl>+<numkey> - start record macros
|
||||
<hotkey> <mouse move> ... <hotkey>|<mouse place>
|
||||
<Ctrl>+<numkey> - end record macros
|
||||
<numkey> - play macros
|
||||
Add menu save/read macros to/from xml-file
|
||||
Add configure rotate angle for rotate module: 45 or 90 deg.
|
||||
Fix segfault when move/drag segment if disconnected to pad
|
||||
|
||||
2011-Sept-01, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
|
||||
================================================================================
|
||||
Add Fabrizio Tappero <fabrizio-dot-tappero[at]gmail-dot-com> in contributors list.
|
||||
Eeschema:
|
||||
Graphic texts ans labels: fix fully broken undo/redo code relative to the way undo/redo command
|
||||
handles changes (maintly move) for labels
|
||||
Fix minor bug for undo command relative to block rotate
|
||||
Remove dead code.
|
||||
Add new class BITMAP_BASE, and (for Eeschema) SCH_BITMAP to handle bitmap images in schematic.
|
||||
Remember plot Bitmaps in not possble with all plotters.
|
||||
|
||||
|
||||
2011-Aug-19, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
|
||||
================================================================================
|
||||
Pcbnew:
|
||||
Add support for not plated through holes (NPTH) pads
|
||||
* These NPTH pads are used for mechanical purpose only, and cannot be connected to a net.
|
||||
* When these pads have a same size and shape for the hole and the pad, the pad is not plotted
|
||||
in GERBER files.
|
||||
|
||||
2011-Apr-12, UPDATE Jerry Jacobs <xor.gate.engineering@gmail.com>
|
||||
================================================================================
|
||||
Minor UI changes that affect OS X platform.
|
||||
- Fix for opening the help contents
|
||||
- Fix for opening files with the default editor
|
||||
- Fix for opening PDF files
|
||||
|
||||
Solved all with the BSD open command, for other OS'es which have X11 and
|
||||
utilities they can use the xdg-open command which I added to the pdf viewer tries
|
||||
list.
|
||||
|
||||
Kicad projectview:
|
||||
Remove not-existing files when a empty project is created, this confuses when
|
||||
users try to open it. Show a entry that the project is empty instead of these
|
||||
void files.
|
||||
|
||||
2011-Apr-6, UPDATE Jerry Jacobs <xor.gate.engineering@gmail.com>
|
||||
================================================================================
|
||||
Cleanup of all the menubar code to have the same style, remove the C comments.
|
||||
Make the wxMenu behave native on OSX for KiCad, CvPCB and Gerbview and remove
|
||||
unneeded ifdefs when using the wxIDs. Add a OnQuit for the gerber frame.
|
||||
Change item->SetBitmap( item ) to use macro SET_BITMAP for menu items.
|
||||
|
||||
2011-Apr-4, UPDATE Jerry Jacobs <xor.gate.engineering@gmail.com>
|
||||
================================================================================
|
||||
More native OSX changes, this removes some WXMAC defines replaced by wxID
|
||||
macros. These are handled by wxWidgets itself and reduces in-app platform
|
||||
defines. More work needs to be done for CvPCB and Gerbview.
|
||||
|
||||
All:
|
||||
Hotkey names in menu's all have tabs, this looks more uniform and pretty.
|
||||
|
||||
EESschema & PCBNew:
|
||||
Fix about and preferences wxMenu to be more native (remove unneeded WXMAC )
|
||||
Disable all icons in wxMenu on OSX with macro SETBITMAPS
|
||||
|
||||
jp charras:
|
||||
SETBITMAPS is incorrectly used here. change to SET_BITMAP
|
||||
|
||||
2011-Mar-25 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
|
||||
================================================================================
|
||||
EESchema multiple item hit testing and other minor improvements.
|
||||
|
||||
* Add item clarification context menu to EESchema when multiple unresolved
|
||||
items are found at the current cross hair position.
|
||||
* Add collector class SCH_COLLECTOR for supporting multiple item hit testing.
|
||||
* Removed bit wise masked filtering from schematic item hit testing.
|
||||
* Removed all old hit testing functions and methods scattered about the
|
||||
EESchema source code.
|
||||
* Move terminal point test function into SCH_SCREEN object.
|
||||
* Fixed bug in terminal point test when terminating a bus to a label.
|
||||
* Define the < operator for sorting schematic items.
|
||||
* Add area calculation method to EDA_Rect item.
|
||||
* Add method for returning an item's bitmap for menu display purposes.
|
||||
* Add method for returning an item's menu text for menu display purposes.
|
||||
* Changed EDA_ITEMS container from boost::ptr_vector to std::vector.
|
||||
* Factor coordinate string conversion code from EDA_DRAW_FRAME to function CoordinateToString().
|
||||
|
||||
2011-Mar-16, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
|
||||
================================================================================
|
||||
Gerbview:
|
||||
Added: read Excellon files created by Pcbnew.
|
||||
The full Excellon command set is not supported, but drill files created by Pcbnew are supported.
|
||||
|
||||
2011-Feb-05, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
|
||||
================================================================================
|
||||
CvPcb:
|
||||
Code cleanup. Rename WinEDA_CvpcbFrame to CVPCB_MAINFRAME,
|
||||
according to coding style policy.
|
||||
Change in CvPcb:
|
||||
CvPcb does not use now .dcm files, only .mod files,
|
||||
to read modules keywords and doc
|
||||
|
||||
|
||||
2011-Feb-2 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
++common:
|
||||
* macros.h now has TO_UTF8() and FROM_UTF8() which are working converters
|
||||
to and from UTF-8 encoding for any wxWidgets build mode. We can switch to
|
||||
them at any time. I am using them now for specctra conversions and
|
||||
elsewhere where I wanted gauranteed UTF8 encoding.
|
||||
* added OUTPUTFORMATTER::Quoted( const wxString& ) to simplify converting
|
||||
to UTF8 encoded s-expression atoms. The recommended technique is now simply:
|
||||
out->Quoted( wxString ).c_str()
|
||||
|
||||
2011-Jan-30 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
++all:
|
||||
* DSNLEXER::NextTok() now uses two separate modes to parse quoted strings.
|
||||
This gives us the freedom to control our own destiny separate from the
|
||||
constraints put on us by the Specctra DSN spec.
|
||||
* Added Documentation/s-expressions.txt to explain all this.
|
||||
* Enhanced our quoting protocol by moving away from doubling up double quotes
|
||||
to a C like escape mechanism.
|
||||
* Now support multi-line strings, which when properly escaped, can still be
|
||||
read in as a token originating on a single line.
|
||||
|
||||
2011-Jan-21 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
|
||||
================================================================================
|
||||
EESchema code refactoring and coding policy naming fixes.
|
||||
|
||||
* Move schematic wire and bus break code into schematic screen object.
|
||||
* Move schematic test for dangling ends into schematic screen object.
|
||||
* Remove left over debugging output in schematic screen object.
|
||||
* Remove unused file eeschema/cleanup.cpp.
|
||||
* Fix bug in schematic line object hit test algorithm.
|
||||
* Fix a string concatenation compile error added in r2752.
|
||||
* Rename class WinEDA_BasicFrame to EDA_BASE_FRAME.
|
||||
* Rename class WinEDA_DrawFrame to EDA_DRAW_FRAME.
|
||||
* Rename class WinEDA_DrawPanel to EDA_DRAW_PANEL.
|
||||
|
||||
2011-Jan-19 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
++all:
|
||||
* TokenList2DsnLexer.cmake now supports comments, which start with a leading
|
||||
# character, and may be either on their own line or on a line after a token.
|
||||
* DSNLEXER::PopReader() now pops even the last LINE_READER* and returns it.
|
||||
++pcbnew:
|
||||
* SPECCTRA_DB now inherits from new class SPECCTRA_LEXER, which led to a great
|
||||
deal of simplification and code factoring.
|
||||
* Moved specctra keywords into specctra.keywords.
|
||||
|
||||
2011-Jan-17 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
++all:
|
||||
* TokenList2DsnLexer.cmake now wraps each token enum in its own namespace. It
|
||||
also no longer setup of the "using" directive in the header file, which was
|
||||
bad behavior. C++ enum values will have name collisions unless the enums
|
||||
themselves are different namespaces.
|
||||
++new:
|
||||
* Sweet library is now a DSO/DLL.
|
||||
* Brought in SWIG to do a wrap of the Sweet DSO/DLL for unit testing
|
||||
and scripting. The SWIG DSO/DLLs are built separate from the Sweet DSO/DLL
|
||||
and are also optional.
|
||||
|
||||
2011-Jan-1 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
++new:
|
||||
* Added the basic structure to the Sweet parser in sch_part.cpp.
|
||||
* Got inheritence working off of the 'extends' keyword and PART::inherit()
|
||||
* Tossed the units support out of sweet.keywords, since we agreed to go dimensionless.
|
||||
++richio:
|
||||
* Added the problemInputLine support to PARSE_ERROR, so UI can show the
|
||||
offending line of bytes. Yes bytes, not even guaranteed to be characters.
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
Compiling KiCad from Source
|
||||
===========================
|
||||
KiCad Documentation Team
|
||||
Last revised on 31-Jan-2010 by Jerry Jacobs
|
||||
Last revised on 12-mars-2012 by jp Charras
|
||||
|
||||
Introduction
|
||||
------------
|
||||
@@ -25,11 +25,34 @@ On linux:
|
||||
Install "mesa". Use your package manager to install the
|
||||
development libaries.
|
||||
|
||||
Tools in PATH
|
||||
After a fresh install you need the following packages to compile and run
|
||||
KiCad from source.
|
||||
|
||||
* bzr - Bazaar version control system
|
||||
* CMake - Cross-platform make
|
||||
* GLUT - The OpenGL Utility Library
|
||||
* wxGTK or wxWidgets - The wxWidgets GUI toolkit with GTK+ bindings
|
||||
|
||||
* Boost - Collection of portable C++ source libraries
|
||||
boost will be automagically downloaded and copied in kicad sources tree,
|
||||
the first time you compile kicad.
|
||||
|
||||
Useful, but not required:
|
||||
* Doxygen - Documentation system for several programming languages
|
||||
|
||||
KiCad uses the Bazaar version control system to track source code changes,
|
||||
and download the boost libraries needed by Kicad.
|
||||
Be sure you bzr install also includes bzrtools.
|
||||
boost libraries will be downloaded the first time you build Kicad.
|
||||
|
||||
Compiler and basic development tools
|
||||
-------------
|
||||
Make sure g++, make and other tools are in your path.
|
||||
If windows, then try running g++ and make from within your msys bash shell.
|
||||
|
||||
PLEASE NOTE: g++ 4.7.1 at least (possibly the 4.7.x series) is known to
|
||||
miscompile pcbnew (it get zones wrong) with -O2; using -O1 is a suitable
|
||||
workaround until they fix the compiler.
|
||||
|
||||
Install or Build wxWidgets
|
||||
--------------------------
|
||||
@@ -37,78 +60,31 @@ Install or Build wxWidgets
|
||||
WARNING:
|
||||
see wxWidgets_patch_notes.txt for patches and issues in wxWidgets.
|
||||
|
||||
If on windows, download
|
||||
http://sourceforge.net/projects/wxwindows/files/wxAll/2.8.10/wxWidgets-2.8.12.zip/download
|
||||
If on Windows, download
|
||||
http://sourceforge.net/projects/wxwindows/files/wxAll/2.9.3/wxWidgets-2.9.3.zip/download
|
||||
or a newer version.
|
||||
Start msys so you have a bash shell. Decide where your wxWidgets build directory
|
||||
will be. It must be where you can access it from within the msys environment,
|
||||
such as home/<user>. Edit your msys/1.0/etc/fstab file if needed to provide
|
||||
access to this build directory from msys. (Note that if you want you can build
|
||||
a "debug" version of the wxWidgets library at this point, instead of the release
|
||||
version, or in addition to the the release version.)
|
||||
Unzip the wmMWS zip file into the build directory. Change directories into
|
||||
Do NOT use previous versions which all have annoying issues for KiCad.
|
||||
Start msys so you have a bash shell.
|
||||
Note also since 2.9 versions no need to build a "debug" version of the wxWidgets library,
|
||||
the release abd the debug version are same.
|
||||
|
||||
Unzip the wxWidgets zip file into the build directory. Change directories into
|
||||
there, and then:
|
||||
|
||||
mkdir build-release
|
||||
mkdir build-debug
|
||||
|
||||
.Release
|
||||
----
|
||||
cd build-release
|
||||
../configure --enable-unicode --enable-monolithic --disable-shared --with-msw --with-opengl
|
||||
mkdir Release
|
||||
cd Release
|
||||
../configure --enable-unicode --enable-monolithic=no --disable-shared --with-opengl
|
||||
make
|
||||
make install
|
||||
----
|
||||
|
||||
.Debug
|
||||
----
|
||||
cd build-debug
|
||||
../configure --enable-unicode --enable-monolithic --enable-debug --enable-debug_gdb --disable-shared --with-msw --with-opengl
|
||||
make
|
||||
make install
|
||||
----
|
||||
and under Linux, but not under Windows:
|
||||
sudo make install that install wxWidgets libs and headers in /usr/local/
|
||||
|
||||
The default install path is /usr/local. Generally speaking MinGW likes header
|
||||
files in /mingw/include and library link files in /mingw/lib. You can install
|
||||
path by setting --prefix=/mingw to configure above to change where "make install"
|
||||
puts everything. We will refer to the --prefix setting as <wxInstallDir> below.
|
||||
|
||||
Verify that wx-config is in your path. Modify your PATH environment variable
|
||||
if need be so you can run wx-config from a command prompt. You may have to
|
||||
restart your msys shell, depending on how you modify your PATH.
|
||||
|
||||
If on linux, use your package manager to install shared object libraries and the
|
||||
If on linux, you can use your package manager to install the
|
||||
development versions of the wxWidgets packages which include the C++ headers. An
|
||||
alternative is to build static libaries from source. Verify that wx-config is in
|
||||
your path by running it from a command prompt. Linux users then go to next step.
|
||||
|
||||
|
||||
Install or Build zlib
|
||||
---------------------
|
||||
If on windows, download http://www.zlib.net/zlib123.zip or a newer version.
|
||||
Start msys so you have a bash shell. Decide where your zlib build directory
|
||||
will be. It must be where you can access it from within the msys environment,
|
||||
such as home/<user>. Edit your msys/1.0/etc/fstab file if needed to provide
|
||||
access to this build directory from msys. Unzip the zlib123.zip file into this
|
||||
build directory. Change directories into there, and then:
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
|
||||
If linux, use your package manager to install zlib pre-built binaries.
|
||||
|
||||
Note (JP Charras):
|
||||
Under Linux, zlib is usually installed.
|
||||
If it is not found by the wxWidget installation, wxWidgets creates an alternate zlib library.
|
||||
Under Windows, if zlib is not installed, my cmake build will try to use the
|
||||
wxWidgets zlib build. So, under windows kicad build should work without
|
||||
zlib install.
|
||||
|
||||
If you are using the wxWidget zlib, make sure that the wxWidgets/src/zlib directory is copied
|
||||
to ${wxWidgets_ROOT_DIR}/src/zlib
|
||||
|
||||
Install CMake
|
||||
-------------
|
||||
If windows, download the installation binary for windows from cmake.org.
|
||||
@@ -117,20 +93,33 @@ will have to restart and command shells for the new path to take effect.
|
||||
Verify that cmake is in your path by trying to run it from a command prompt.
|
||||
|
||||
|
||||
If linux, use your package manager to install cmake. You should get cmake 2.6.1
|
||||
If linux, use your package manager to install cmake. You should get cmake 2.6.4
|
||||
or later. If only an older one is available in your package repository, build
|
||||
2.6.1 from source. Verify that cmake is in your path by trying to run it from a
|
||||
cmake from source. Verify that cmake is in your path by trying to run it from a
|
||||
command prompt.
|
||||
|
||||
|
||||
Obtain Sources
|
||||
--------------
|
||||
You can use the Launchpad repository or a tar file for this. See the wiki.
|
||||
To download files from Launchpad repository, you should install bazaar (bzr) that is a
|
||||
version control system like subversion, mercurial, git...
|
||||
|
||||
Launchpad repository handle 2 branches:
|
||||
Launchpad repository handle 2 branches for KiCda sources:
|
||||
- a testing branch (used by developers)
|
||||
- a stable branch (a copy of the testing branch, when this testing branch is near a stable state))
|
||||
|
||||
Testing branch:
|
||||
bzr branch lp:kicad kicad_testing
|
||||
|
||||
Stable branch:
|
||||
bzr branch lp:kicad/stable kicad_stable
|
||||
|
||||
Components and Footprints libraries
|
||||
bzr branch lp:~kicad-lib-committers/kicad/library kicad_libraries
|
||||
|
||||
Documentation and translations:
|
||||
bzr branch lp:~kicad-developers/kicad/doc kicad_doc
|
||||
|
||||
Create Makefiles with CMake
|
||||
---------------------------
|
||||
@@ -138,7 +127,7 @@ If windows, go into your msys shell. Linux and windows users both then make
|
||||
two "out of source" build directories:
|
||||
cd <kicadSource>
|
||||
mkdir -p build/release
|
||||
mkdir build/debug
|
||||
mkdir build/debug (if you want a debug version of KiCad)
|
||||
cd build/release
|
||||
|
||||
On either cmake command line shown below, you can optionally include
|
||||
@@ -178,7 +167,8 @@ Although normally you do not install the Debug binaries, you can debug them
|
||||
where they were built.
|
||||
|
||||
If windows, run the following command:
|
||||
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_USE_DEBUG=ON -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../
|
||||
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_ROOT_DIR=<wxInstallDir> ../../
|
||||
where <wxInstallDir> is <wxWidgets path>/Release
|
||||
|
||||
If linux, run instead the following command:
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_USE_DEBUG=ON ../../
|
||||
@@ -186,47 +176,8 @@ If linux, run instead the following command:
|
||||
Make the Debug binaries:
|
||||
make
|
||||
|
||||
|
||||
Fine-tune Build Process
|
||||
-----------------------
|
||||
These should be set from command line:
|
||||
|
||||
One of these 2 option *must* be set to ON:
|
||||
KICAD_STABLE_VERSION or KICAD_TESTING_VERSION
|
||||
** KICAD_STABLE_VERSION:
|
||||
set this option to ON to build the stable version of KICAD. mainly used to set version ID
|
||||
Usually set for kicad version downloaded from stable branch
|
||||
|
||||
** KICAD_TESTING_VERSION
|
||||
set this option to ON to build the stable version of KICAD. mainly used to set version ID
|
||||
Usually set for kicad version downloaded from testing branch
|
||||
|
||||
CMAKE_BUILD_TYPE Release/Debug (REQUIRED)
|
||||
Choose build type: Release/Debug.
|
||||
|
||||
wxWidgets_USE_DEBUG ON/OFF (REQUIRED)
|
||||
Should be set to ON only when CMAKE_BUILD_TYPE=Debug.
|
||||
|
||||
wxWidgets_USE_STATIC ON/OFF (OPTIONAL)
|
||||
|
||||
CMAKE_VERBOSE_MAKEFILE ON/OFF (OPTIONAL)
|
||||
Turns ON/OFF verbose build messages.
|
||||
You can also pass VERBOSE=1 to make for the same effect.
|
||||
|
||||
CMAKE_INSTALL_PREFIX (OPTIONAL)
|
||||
|
||||
KICAD_MINIZIP ON/OFF
|
||||
|
||||
USE_WX_GRAPHICS_CONTEXT ON/OFF (OPTIONAL)
|
||||
*Experimental* advanced drawing library code using wxGraphicsContext (for tests only).
|
||||
Under Windows, a very recent version of mingw is needed.
|
||||
It requires wxWidgets to be built with the --enable-graphics_ctx switch.
|
||||
See building wxWidgets above.
|
||||
|
||||
USE_IMAGES_IN_MENUS ON/OFF (OPTIONAL)
|
||||
Force building Kicad with or without images in menu items. If this is not defined on
|
||||
when CMake is used to create the build files, images will be included in menu items
|
||||
on all platforms except OSX.
|
||||
|
||||
Note: that it is easy to build only a specific binary such as pcbnew alone:
|
||||
make pcbnew
|
||||
|
||||
|
||||
See ./cmake_config.txt for customizing the KiCad build setting.
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
Bazaar
|
||||
------
|
||||
KiCad uses the Bazaar version control system to track source code changes,
|
||||
and download the boost libraries needed by Kicad.
|
||||
The easiest way to get a copy of the KiCad source is to use Bazaar.
|
||||
Bazaar can be download from http://wiki.bazaar.canonical.com.
|
||||
Your best bet is to use the stand alone version of Bazaar
|
||||
(which includes bzrtools, needed by Kicad) rather than one of
|
||||
the Python specific versions.
|
||||
Be sure bzrtools is also installed.
|
||||
boost libraries will be downloaded the first time you build Kicad.
|
||||
|
||||
CMake
|
||||
-----
|
||||
KiCad uses CMake to generate the build files specific for the target platform
|
||||
specified by the developer. This document attempts to define some of the more
|
||||
common CMake and KiCad build configuration settings. You can use CMake either
|
||||
by the command CMake on or the graphical version ccmake. This document only
|
||||
documents a very small subset of the total CMake documentation For all of the
|
||||
gory details, please see the complete CMake documentation at:
|
||||
|
||||
http://www.cmake.org/cmake/help/documentation.html.
|
||||
|
||||
|
||||
Useful CMake Build Settings.
|
||||
----------------------------
|
||||
This section defines some of the more common CMake build configuration setting
|
||||
used when configuring KiCad. These settings are valid for all projects that
|
||||
use CMake.
|
||||
|
||||
Changing the Build Generator.
|
||||
-----------------------------
|
||||
CMake attempts to create the project build system based on the platform. On
|
||||
Posix systems CMake will create Unix Makefiles to build KiCad. On Windows
|
||||
systems CMake will attempt to find the latest version of Visual C++ installed
|
||||
on the system and create the appropriate project files. This behavior can be
|
||||
changed by specifying the project generator using the -G "Project Generator"
|
||||
switch on the command line. Please note, only a small subset of these project
|
||||
generators are supported. If you want to use Eclipse on Linux to build KiCad,
|
||||
you may be in for a lot of work.
|
||||
|
||||
CMAKE_BUILD_TYPE (Release/Debug/RelWithDebInfo/MinSizeRel)
|
||||
----------------------------------------------------------
|
||||
When configuring the KiCad build for the command line you must specify build
|
||||
type. To create a debug build, set CMAKE_BUILD_TYPE to Debug. To create a
|
||||
release build, set CMAKE_BUILD_TYPE to Release. See the CMake documentation
|
||||
for other build types. For IDE project files, the build type can be selected
|
||||
by the IDE configuration manager.
|
||||
|
||||
CMAKE_INSTALL_PATH (InstallPath)
|
||||
--------------------------------
|
||||
By default CMake will select the correct install path for your platform. If
|
||||
you wish to install KiCad in a custom location, set CMAKE_INSTALL_PATH to the
|
||||
path where you want to install KiCad. Please note that the default install
|
||||
path that CMake chooses will likely overwrite the current version of KiCad
|
||||
installed on your system.
|
||||
|
||||
|
||||
wxWidgets Library Configuration.
|
||||
--------------------------------
|
||||
KiCad is built using the wxWidgets library. The following options allow you
|
||||
to specifically tailor the wxWidgets library configuration. For the complete
|
||||
list of wxWidgets setting see CMakeModules/FindwxWidgets.cmake in the KiCad
|
||||
source.
|
||||
|
||||
wxWidgets_ROOT_DIR (NonDefaultwxWidgetsPath)
|
||||
--------------------------------------------
|
||||
CMake looks in the standard platform locations to find the default version of
|
||||
the wxWidgets library. If you wish to use a custom built wxWidgets library,
|
||||
set wxWidgets_ROOT_DIR to the correct path.
|
||||
|
||||
wxWidgets_USE_DEBUG (ON/OFF)
|
||||
----------------------------
|
||||
When creating a debug build of KiCad, it is often useful to link against the
|
||||
debug build of the wxWidgets. To use the debug build of wxWidgets, set
|
||||
wxWidgets_USE_DEBUG to ON.
|
||||
|
||||
wxWidgets_USE_UNICODE (ON/OFF)
|
||||
------------------------------
|
||||
If your platform supports Unicode and you wish to build KiCad with Unicode
|
||||
support, set wxWidgets_USE_UNICODE to ON. Please note as of the 2.9 branch
|
||||
this option is not required.
|
||||
|
||||
|
||||
KiCad Specific Options
|
||||
----------------------
|
||||
All of the configuration settings below are specific to the KiCad project.
|
||||
If for any reason you add or remove a build option to the KiCad CMake files,
|
||||
please update the list below.
|
||||
|
||||
KICAD_SKIP_BOOST (ON/OFF)
|
||||
--------------------------
|
||||
Skips building the required boost library components.
|
||||
WARNING: KiCad developers strongly advise you to build the bundled boost library, as it is
|
||||
known to work with KiCad. Other versions may contain bugs that may result in KiCad errors.
|
||||
|
||||
USE_WX_GRAPHICS_CONTEXT (ON/OFF)
|
||||
--------------------------------
|
||||
This option is *Experimental* and used the advanced drawing library code
|
||||
using wxGraphicsContext and should only be used for testing purposes.
|
||||
Under Windows, a very recent version of mingw is needed. It also requires
|
||||
wxWidgets to be built with the --enable-graphics_ctx configuration switch.
|
||||
|
||||
USE_IMAGES_IN_MENUS (ON/OFF)
|
||||
----------------------------
|
||||
This option is used to enable or disable building KiCad with images in menu
|
||||
items. If this is not defined when CMake is used to create the build files,
|
||||
images will be included in menu items on all platforms except OSX.
|
||||
|
||||
KICAD_KEEPCASE (ON/OFF)
|
||||
-----------------------
|
||||
This option enables or disables turning off the automatic component name
|
||||
conversion to uppercase. The default is OFF which means component names will
|
||||
be converted to upper case.
|
||||
|
||||
USE_WX_OVERLAY (ON/OFF)
|
||||
-----------------------
|
||||
This option enables or disables wxOverlay for drawing operation on OSX. It is
|
||||
OFF by default on all platforms except OSX. Warning, this is experimental!
|
||||
|
||||
KICAD_SCRIPTING (ON/OFF)
|
||||
------------------------
|
||||
This option enables or disables building Python scripting support for KiCad.
|
||||
The default is OFF. Currently only Pcbnew is supported. This option requires
|
||||
that SWIG and Python are installed on the system.
|
||||
|
||||
KICAD_SCRIPTING_MODULES (ON/OFF)
|
||||
--------------------------------
|
||||
This option enables or disables building the KiCad modules that can be used
|
||||
from scripting languages. The default is OFF. Currently only Pcbnew is
|
||||
supported. This option requires that SWIG and Python are installed on the
|
||||
system.
|
||||
|
||||
KICAD_SCRIPTING_WXPYTHON (ON/OFF)
|
||||
---------------------------------
|
||||
This option enables or disables building wxPython support into KiCad for
|
||||
python and py.shell. The default is OFF. Currently only Pcbnew is
|
||||
supported. This option requires that SWIG, Python, and wxPython are
|
||||
installed on the system.
|
||||
|
||||
PYTHON_SITE_PACKAGE_PATH (PATH)
|
||||
-------------------------------
|
||||
When building KiCad with Python scripting enable, the Python site library path
|
||||
is used by default. If you want to install the KiCad Python extension in a
|
||||
different path, set this variable to the desired path.
|
||||
|
||||
|
||||
USE_FP_LIB_TABLE (ON/OFF)
|
||||
-------------------------
|
||||
This option enable or disables building KiCad with the new footprint library
|
||||
table support. The default setting (OFF) builds KiCad with the legacy library
|
||||
path support. This option is experimental until the library table support is
|
||||
ready for release.
|
||||
@@ -0,0 +1,226 @@
|
||||
Introduction
|
||||
------------
|
||||
|
||||
This document details how to build KiCad from source on Windows. The current
|
||||
supported method of building KiCad for Windows systems is to use the MinGW
|
||||
compiler, either from Windows or cross compiling from Linux. MSYS can be
|
||||
used on Windows to extend the range of subprojects that you can build, but
|
||||
is not needed to build KiCad itself.
|
||||
|
||||
Visual Studio is not supported, and don't ask about it, it is not supported
|
||||
and will not be, ever.
|
||||
|
||||
Install Build Tools
|
||||
-------------------
|
||||
This section describes the tools required to build KiCad from source and how
|
||||
to install them. Failure to install these tools properly will likely result
|
||||
in build errors.
|
||||
|
||||
MinGW/MSYS
|
||||
----------
|
||||
MinGW/MSYS provides the compiler tools and a partial Posix environment useful
|
||||
for building software. Download the MinGW installer from http://mingw.org.
|
||||
Run the installer and and verify MinGW and MSYS are checked. You will also
|
||||
need to expand the MinGW entry and select C++ from the list of supported
|
||||
languages. Only C is installed by default and C++ is required to build KiCad.
|
||||
|
||||
Bazaar
|
||||
------
|
||||
KiCad uses the Bazaar version control system to track source code changes,
|
||||
and download the boost libraries needed by Kicad.
|
||||
The easiest way to get a copy of the KiCad source is to use Bazaar. Bazaar
|
||||
can be download from http://wiki.bazaar.canonical.com/WindowsDownloads.
|
||||
Your best bet is to use the stand alone version of Bazaar
|
||||
(which includes bzrtools, needed Kicad) rather than one of
|
||||
the Python specific versions.
|
||||
|
||||
CMake
|
||||
-----
|
||||
The KiCad source uses CMake to make sure the system has the required software
|
||||
and libraries installed to properly compile the source. Download the latest
|
||||
CMake installer from http://cmake.org. Run the installer and make sure the
|
||||
add CMake to PATH variable check box is checked. If you fail to do this step,
|
||||
the CMake executable will not be found.
|
||||
|
||||
Doxygen (Optional)
|
||||
------------------
|
||||
Doxygen is used to generate HTML documentation of the KiCad source code. While
|
||||
it is not necessary to install Doxygen, it is a very good way to learn your way
|
||||
around the KiCad code base. It is highly recommended for new developers. The
|
||||
latest Doxygen installer can be downloaded from http://www.stack.nl/~dimitri/
|
||||
doxygen/
|
||||
|
||||
Python (Optional)
|
||||
-----------------
|
||||
KiCad supports the Python scripting language (currently only Pcbnew scripting
|
||||
exists). Currently the Python scripting support will only build against the
|
||||
version 2 branch of Python. The Python installer can be downloaded from http://
|
||||
www.python.org.
|
||||
|
||||
SWIG (Optional)
|
||||
---------------
|
||||
SWIG is used to generate the Python scripting code. It must be installed to
|
||||
build the Python scripting support. Unfortunately there in no installer for
|
||||
windows. You can download precompiled binaries from http://http://www.swig.
|
||||
org/download.html and install swig.exe. Make sure the folder you install the
|
||||
SWIG binary into is in the system PATH. Otherwise CMake will not be able to
|
||||
find it.
|
||||
|
||||
NullSoft Installer System (Optional)
|
||||
------------------------------------
|
||||
The NullSoft Installer System (NSIS) is used to create a Windows installer for
|
||||
end users from the binaries created from the KiCad source along with the
|
||||
library and documentation files. NSIS is typically only used be developers who
|
||||
create installers for end users and is not required if you install from source.
|
||||
NSIS can be downloaded from http://nsis.sourceforge.net/Download.
|
||||
|
||||
|
||||
Install and Build Libraries
|
||||
---------------------------
|
||||
This section documents installing and build all of the software libraries
|
||||
required to build KiCad. As of now, these libraries have to be built because
|
||||
MinGW builds of these libraries are not readily available Attempting to link
|
||||
programs built on MinGW with libraries from other compilers (namely Microsoft
|
||||
Visual C) is problematic. It can be done but it is not painless. As far as
|
||||
the author of this document knows, MinGW can only link to Visual Studio C
|
||||
libraries. The name mangling of Visual Studio C++ is not compatible with the
|
||||
MinGW linker.
|
||||
|
||||
Build and Install the wxWidgets Library
|
||||
---------------------------------------
|
||||
The wxWidgets library is the base that KiCad is built upon. Version 2.9.4
|
||||
or later of wxWidgets *should be* used on Windows. You may be able to build
|
||||
KiCad with older versions of wxWidgets but it is not recommended. wxWidgets
|
||||
can be downloaded from http://http://www.wxwidgets.org/downloads/
|
||||
|
||||
|
||||
Unzip the wxWidgets zip file into your preferred build directory. Avoid using
|
||||
spaces in the path names. Some MinGW tools do not play well with them. It is
|
||||
always best to error on the side of caution.
|
||||
|
||||
Open MinGW and change to the wxWidgets source directory. If you don't want to
|
||||
install the wxWidgets library into MinGW then enter the following commands:
|
||||
|
||||
#mkdir Release
|
||||
#cd Release
|
||||
#../configure --with-opengl
|
||||
#make
|
||||
|
||||
If you want to install wxWidgets in MinGW then enter the following commands:
|
||||
#mkdir Release
|
||||
#cd Release
|
||||
#../configure --prefix=/mingw --enable-monolithic=no --disable-shared --with-opengl
|
||||
#make && make install
|
||||
|
||||
wxWidgets will be statically linked to Kicad, which avoid issus with wxWidgets dlls
|
||||
|
||||
Download the KiCad Source Code
|
||||
------------------------------
|
||||
You can use the Launchpad repository or a tar file for this. See the wiki.
|
||||
To download files from Launchpad repository, you need to install the Bazaar
|
||||
(bzr) version control system.
|
||||
|
||||
Launchpad repository has two branches for KiCad sources:
|
||||
- a testing branch (used by developers)
|
||||
- a stable branch (a copy of the testing branch, when this testing branch is
|
||||
near a stable state)
|
||||
|
||||
To download the testing branch:
|
||||
#bzr branch lp:kicad kicad_testing
|
||||
|
||||
To download the stable branch:
|
||||
#bzr branch lp:kicad/stable kicad_stable
|
||||
|
||||
To download the component and footprint libraries
|
||||
#bzr branch lp:~kicad-lib-committers/kicad/library kicad_libraries
|
||||
|
||||
To download the documentation and translation files:
|
||||
#bzr branch lp:~kicad-developers/kicad/doc kicad_doc
|
||||
|
||||
Create Makefiles with CMake
|
||||
---------------------------
|
||||
Open your Msys shell. Create two "out of source" build directories at the
|
||||
command line enter the following commands:
|
||||
|
||||
#cd <kicadSource>
|
||||
#mkdir -p build/release # Build path can be anywhere you prefer.
|
||||
#mkdir build/debug # Only if you want a debug version of KiCad.
|
||||
|
||||
To create a release build of KiCad, run the following command:
|
||||
#cd build
|
||||
#cmake -G "MSYS Makefiles" \ # Back slashes are not required
|
||||
-DCMAKE_BUILD_TYPE=Release ../../ \ # and are for formatting only.
|
||||
|
||||
If the configuration fails, you have failed to install the required software
|
||||
on you system. The error message should give you a good indication of what is
|
||||
missing. You must resolve this before you can build KiCad.
|
||||
|
||||
Compiling the Code
|
||||
------------------
|
||||
To build KiCad, at the command line enter following comnands:
|
||||
|
||||
#cd <kicadSource>/build/release
|
||||
#make
|
||||
|
||||
Installing KiCad
|
||||
----------------
|
||||
To install Kicad, at the command line enter the following commands:
|
||||
|
||||
#cd <kicadSource>/build/release
|
||||
#make install
|
||||
|
||||
If you get any errors during the installation, you probably do not have the
|
||||
appropriate privileges to the install path. Take a look at CMakeCache.txt
|
||||
that was created when you ran CMake, and in particular look at the value of
|
||||
the CMAKE_INSTALL_PREFIX variable. This is where KiCad will be installed. If
|
||||
this not where you want KiCad installed, edit it with a text editor rerun the
|
||||
make install command. You do not have the appropriate privileges to install
|
||||
KiCad in the CMAKE_INSTALL_PATH, run the make install command as administrator.
|
||||
|
||||
You are now done unless you want to make a Debug build.
|
||||
|
||||
|
||||
Compiling a Debug version
|
||||
-------------------------
|
||||
To create a debug version of KiCad, enter the following commands:
|
||||
|
||||
#cd <kicadSource>/build/debug
|
||||
#cmake -G "MSYS Makefiles" \
|
||||
-DCMAKE_BUILD_TYPE=Debug ../../
|
||||
#make
|
||||
|
||||
Generally speaking you do not install debug binaries. They can be debugged in
|
||||
place. To monitor the debugging output, you can download the Windows debug
|
||||
viewer DbgView from http://technet.microsoft.com/en-us/sysinternals/
|
||||
bb896647.aspx
|
||||
|
||||
Compiling the Python Scripting Support.
|
||||
---------------------------------------
|
||||
|
||||
Before building KiCad Python scripting extension, you must create a MinGW
|
||||
compatible Python link library. The directions to do this can be found in
|
||||
the "How do I create Python extensions?" FAQ at http://www.mingw.org/wiki/FAQ.
|
||||
|
||||
To build KiCad with Python scripting support, run CMake as follows and then
|
||||
compile the source as described above.
|
||||
|
||||
#cmake -G "MSYS Makefiles" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DKICAD_PYTHON_SCRIPTING=ON \
|
||||
-DKICAD_PYTHON_MODULES=ON ../../
|
||||
|
||||
You only need to include the KICAD_PYTHON_MODULES option if you want to
|
||||
install the python modules that ship with KiCad. Also note that the wxPython
|
||||
support cannot be compiled on Windows at this time due to library conflicts
|
||||
between MinGW and Python. Work is currently underway by the KiCad developers
|
||||
to provide a MinGW build of Python which should resolve this issue.
|
||||
|
||||
Building the Developer Documentation
|
||||
------------------------------------
|
||||
To build the HTML developer documentation, run the following commands:
|
||||
|
||||
#cd <kicadSource>/build/debug
|
||||
#make doxygen-docs
|
||||
|
||||
The documentation will be created in the <kicadSouce>/Documentation/html
|
||||
directory.
|
||||
@@ -1,250 +0,0 @@
|
||||
Compiling KiCad on Debian & Ubuntu
|
||||
==================================
|
||||
|
||||
First written: 10-Mar-2009
|
||||
|
||||
Updated: 01-Oct-2009
|
||||
|
||||
Lasted edited by: Jerry Jacobs <jerkejacobs@gmail.com>
|
||||
|
||||
|
||||
Ubuntu 9.04
|
||||
-----------
|
||||
Special thanks to David J S Briscoe <david@djsbriscoe.vispa.com>
|
||||
|
||||
The first thing I did was follow this page up to the running kicad section
|
||||
|
||||
http://basicubuntu.blogspot.com/2009/02/installing-kicad-on-ubuntu.html
|
||||
|
||||
This resulted in the error message detailed in this post
|
||||
|
||||
http://tech.groups.yahoo.com/group/kicad-devel/message/3180
|
||||
|
||||
SNIPPET
|
||||
|
||||
The build fails with the following message
|
||||
|
||||
----------------------------------------------------------:
|
||||
|
||||
david@ubuntu:~/Desktop/KICAD_SVN$ fakeroot debian/rules binary
|
||||
test -d debian/patched || install -d debian/patched
|
||||
dpatch apply-all
|
||||
dpatch cat-all >>patch-stampT
|
||||
mv -f patch-stampT patch-stamp
|
||||
mkdir -p /home/david/Desktop/KICAD_SVN/build/kicad
|
||||
mkdir -p /home/david/Desktop/KICAD_SVN/build/bitmaps
|
||||
cd /home/david/Desktop/KICAD_SVN/build/kicad && cmake -DKICAD_MINIZIP=0 \
|
||||
|
||||
-DKICAD_DEMOS=/home/david/Desktop/KICAD_SVN/debian/kicad-common/usr/share/doc/ki\
|
||||
cad/demos ../../kicad \
|
||||
-DXPM_CPP_PATH=/home/david/Desktop/KICAD_SVN/build/bitmaps
|
||||
-- The C compiler identification is GNU
|
||||
-- The CXX compiler identification is GNU
|
||||
-- Check for working C compiler: /usr/bin/gcc
|
||||
-- Check for working C compiler: /usr/bin/gcc -- works
|
||||
-- Detecting C compiler ABI info
|
||||
-- Detecting C compiler ABI info - done
|
||||
-- Check for working CXX compiler: /usr/bin/c++
|
||||
-- Check for working CXX compiler: /usr/bin/c++ -- works
|
||||
-- Detecting CXX compiler ABI info
|
||||
-- Detecting CXX compiler ABI info - done
|
||||
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
|
||||
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
|
||||
-- Looking for gethostbyname
|
||||
-- Looking for gethostbyname - found
|
||||
-- Looking for connect
|
||||
-- Looking for connect - found
|
||||
-- Looking for remove
|
||||
-- Looking for remove - found
|
||||
-- Looking for shmat
|
||||
-- Looking for shmat - found
|
||||
-- Looking for IceConnectionNumber in ICE
|
||||
-- Looking for IceConnectionNumber in ICE - found
|
||||
-- Found X11: /usr/lib/libX11.so
|
||||
-- Check for installed OpenGL -- found
|
||||
-- Check for installed Boost -- not found
|
||||
CMake Error at CMakeModules/CheckFindPackageResult.cmake:6 (message):
|
||||
Boost was not found - it is required to build Kicad
|
||||
Call Stack (most recent call first):
|
||||
CMakeLists.txt:111 (check_find_package_result)
|
||||
|
||||
|
||||
-- Configuring incomplete, errors occurred!
|
||||
make: *** [configure-stamp] Error 1
|
||||
david@ubuntu:~/Desktop/KICAD_SVN$
|
||||
|
||||
-----------------------------------------------------------------:
|
||||
|
||||
|
||||
SNIPPET
|
||||
|
||||
The next step was to remove any libboost 1.34 libraries using the apt-get
|
||||
remove command (can't remember the exact commands I used) as the Ubuntu 9.04
|
||||
(Jaunty) repositories only had the 1.34 version available.
|
||||
|
||||
After this I installed the boost 1.37 libraries
|
||||
using this command
|
||||
|
||||
---------------------------------------
|
||||
sudo apt-get install libboost1.37-dev
|
||||
---------------------------------------
|
||||
|
||||
This pulled down all the required files and dependencies (as far as I
|
||||
know-how do I check this?)
|
||||
|
||||
I then entered the following command
|
||||
|
||||
---------------------------------------
|
||||
fakeroot debian/rules binary
|
||||
---------------------------------------
|
||||
|
||||
and everything was built properly (I saw a few warnings flash past-will
|
||||
these be logged anywhere?)
|
||||
|
||||
I was left with a bunch of debian packaged files. I installed the main one,
|
||||
the common one and an English language documentation one (I can supply more
|
||||
details if needed later as I am not using Ubuntu at the moment).
|
||||
|
||||
The first link above describes moving the libraries and other files into the
|
||||
same place as the compiled executables. I didn't do this, so I have a
|
||||
duplicate installation.
|
||||
The above method needs some fine tuning and improvements. If you can let me
|
||||
know of a tidier way of compiling Kicad please let me know.
|
||||
Maybe there is a way of automating things with scripts, my Linux knowledge
|
||||
doesn't go that far, yet.
|
||||
|
||||
|
||||
Ubuntu (8.04)
|
||||
-------------
|
||||
Original from:
|
||||
http://basicubuntu.blogspot.com/2009/02/installing-kicad-on-ubuntu.html
|
||||
|
||||
Required software and dependencies
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
We need to install the following packages: debhelper, dpatch, libx11-dev,
|
||||
libglu1-mesa-dev, libgl1-mesa-dev, mesa-common-dev, libwxbase2.8-dev,
|
||||
libwxgtk2.8-dev, libboost-dev, subversion, cmake (>= 2.6.0).
|
||||
|
||||
---------------------------------------
|
||||
sudo apt-get install debhelper dpatch libx11-dev libglu1-mesa-dev
|
||||
libgl1-mesa-dev mesa-common-dev libwxbase2.8-dev libwxgtk2.8-dev
|
||||
libboost-dev fakeroot subversion libboost-serialization-dev
|
||||
---------------------------------------
|
||||
|
||||
And finally, we need cmake, but we need atleast version 2.6, the one
|
||||
from the repository is not the updated one (atleast for ubuntu 8.04).
|
||||
You can download version 2.6 from newer ubuntu releases.
|
||||
Just search for cmake on http://packages.ubuntu.com then get a newer
|
||||
cmake .deb file and install the downloaded package on the console
|
||||
with:
|
||||
|
||||
---------------------------------------
|
||||
sudo dpkg -i <packagename.deb>
|
||||
---------------------------------------
|
||||
|
||||
But if what the repository gives you is atleast version 2.6, then
|
||||
simply
|
||||
|
||||
---------------------------------------
|
||||
sudo apt-get install cmake
|
||||
---------------------------------------
|
||||
|
||||
Get KiCad Sourcecode
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
We will be getting the source codes through subversion. Create a directory
|
||||
where you'll be downloading the source codes, and go to that
|
||||
directory. type the following:
|
||||
|
||||
---------------------------------------
|
||||
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad kicad
|
||||
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad-doc kicad-doc
|
||||
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad-library kicad-library
|
||||
---------------------------------------
|
||||
|
||||
Also we need the following to get the debian specific stuff
|
||||
|
||||
---------------------------------------
|
||||
svn checkout http://svn.flexserv.de/kicad/trunk/debian
|
||||
---------------------------------------
|
||||
|
||||
Compiling
|
||||
~~~~~~~~~
|
||||
To compile simply do the following on your terminal (make sure you're still in
|
||||
the same directory where you did the svn)
|
||||
|
||||
---------------------------------------
|
||||
fakeroot debian/rules binary
|
||||
---------------------------------------
|
||||
hopefully, there will be no errors.
|
||||
You'll find the compiled version of KiCad in the following directory:
|
||||
|
||||
---------------------------------------
|
||||
debian/kicad/usr/bin/
|
||||
---------------------------------------
|
||||
to complete things up, you'll need to copy the following folders
|
||||
|
||||
---------------------------------------
|
||||
debian/kicad-common/usr/share/kicad/library
|
||||
debian/kicad-common/usr/share/kicad/modules
|
||||
debian/kicad-common/usr/share/kicad/template
|
||||
---------------------------------------
|
||||
in here
|
||||
|
||||
---------------------------------------
|
||||
debian/kicad/usr/share
|
||||
---------------------------------------
|
||||
again, to run KiCad go to
|
||||
|
||||
---------------------------------------
|
||||
cd debian/kicad/usr/bin/
|
||||
---------------------------------------
|
||||
and double click KiCad
|
||||
|
||||
|
||||
Debian squeeze (testing)
|
||||
------------------------
|
||||
|
||||
Special Note
|
||||
~~~~~~~~~~~~
|
||||
After SVN trunk revision 1753 boost library 1.36 or higher is needed
|
||||
to compile KiCad.
|
||||
|
||||
Installing Packages
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
The following packages should be installed with
|
||||
synaptic, apt-get or aptitude:
|
||||
- build-essential
|
||||
- cmake
|
||||
- libboost-dev
|
||||
- libwxgtk2.8-dev
|
||||
- libglut3-dev
|
||||
|
||||
The following packages will also be installed then
|
||||
- cmake dependencies
|
||||
- boost development dependencies
|
||||
- wxwidgets development dependencies
|
||||
- opengl3 (glut) development dependencies
|
||||
|
||||
Get KiCad sourcecode
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
Checkout sourcecode using subversion or download latest release.
|
||||
|
||||
.*Subversion*
|
||||
---------------------------------------
|
||||
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad kicad
|
||||
---------------------------------------
|
||||
|
||||
.*Release*
|
||||
---------------------------------------
|
||||
wget http://iut-tice.ujf-grenoble.fr/cao/kicad-sources-2009-02-16.tar.gz
|
||||
tar -xvf kicad-sources-2009-02-16.tar.gz
|
||||
---------------------------------------
|
||||
|
||||
Compiling
|
||||
~~~~~~~~~
|
||||
Run 'cmake .' in the root of the source directory then build the
|
||||
binaries with 'make'.
|
||||
|
||||
Installing
|
||||
~~~~~~~~~~
|
||||
For installing you could use 'make install' or build a debian package.
|
||||
@@ -1,29 +0,0 @@
|
||||
Compiling KiCad on Fedora
|
||||
=========================
|
||||
|
||||
First written: 2011-03-09
|
||||
|
||||
Lasted edited by: Jerry Jacobs <xor.gate.engineering@gmail.com>
|
||||
|
||||
Fedora 14
|
||||
---------
|
||||
|
||||
First we need to install all the needed tools and libraries with yum. First
|
||||
become root with su.
|
||||
|
||||
Then invoke yum:
|
||||
yum install gcc gcc-c++ bzr cmake doxygen wxGTK-devel make
|
||||
|
||||
Create somewhere on your drive a kicad directory.
|
||||
|
||||
Then clone the bzr repository:
|
||||
bzr checkout lp:kicad testing
|
||||
|
||||
then cd into the build directory
|
||||
invoke cmake to generate the makefiles
|
||||
|
||||
cmake ../testing
|
||||
|
||||
If everything went well you should be able to build kicad with make.
|
||||
|
||||
make
|
||||
@@ -1,99 +0,0 @@
|
||||
Compiling KiCad on Gentoo
|
||||
=========================
|
||||
|
||||
Information
|
||||
-----------
|
||||
First written: 02-Mar-2010
|
||||
|
||||
Written by: calchan at gentoo dot org
|
||||
|
||||
|
||||
For regular users
|
||||
-----------------
|
||||
|
||||
In order to install Kicad from sources in Gentoo you just need to:
|
||||
----
|
||||
# emerge kicad
|
||||
----
|
||||
The package manager will resolve all dependencies, download the
|
||||
necessary source code, and then configure it, compile it and install
|
||||
it. You're done.
|
||||
|
||||
If you want to fine-tune your installation you can set some of the USE
|
||||
flags. Do the following to see them:
|
||||
----
|
||||
# emerge -vp kicad
|
||||
----
|
||||
The currently available USE flags are:
|
||||
debug: make a debug build
|
||||
doc: install documentation
|
||||
examples: install examples
|
||||
python: enable python
|
||||
minimal: do not install the default component libraries (unsupported)
|
||||
|
||||
Enable or disable whatever USE flag(s) you want or don't want, for
|
||||
example like this:
|
||||
----
|
||||
# echo "sci-electronics/kicad doc -python" >> /etc/portage/package.use
|
||||
----
|
||||
Here we've just enabled documentation and disabled python. After that
|
||||
you can emerge kicad.
|
||||
|
||||
|
||||
For advanced users
|
||||
------------------
|
||||
If you're running stable gentoo and want the unstable (more recent)
|
||||
version of kicad then do the following before running emerge:
|
||||
----
|
||||
# echo "sci-electronics/kicad ~arch" >> /usr/portage/package.keywords
|
||||
----
|
||||
where ~arch is either ~amd64, ~ppc, ~ppc64 or ~x86 depending on your
|
||||
architecture.
|
||||
|
||||
If you want to experiment with cmake flags to pass for compilation or
|
||||
override one that's set by default in the ebuild you can do so like
|
||||
this:
|
||||
----
|
||||
# MYCMAKEARGS="-DUSE_WX_GRAPHICS_CONTEXT=ON" emerge kicad
|
||||
----
|
||||
|
||||
|
||||
For Kicad developers and packagers
|
||||
----------------------------------
|
||||
|
||||
You can install from live sources instead of the latest package
|
||||
version by doing the following:
|
||||
----
|
||||
# echo "sci-electronics/kicad **" >> /etc/portage/package.keywords
|
||||
# emerge kicad
|
||||
----
|
||||
The version of Kicad that is going to be installed is called
|
||||
kicad-99999999. The package manager will then checkout all sources
|
||||
from the subversion repository, or update it to the latest revision if
|
||||
you had already installed the live version of Kicad, and then do its
|
||||
usual thing. You will get an additional USE flag called dev-doc which
|
||||
is to set if you want to build the Doxygen documentation.
|
||||
|
||||
If you want to build a specific revision of Kicad from the subversion
|
||||
repository, you can do:
|
||||
----
|
||||
# ESVN_REVISION="2400" emerge kicad
|
||||
----
|
||||
Note that you can combine that with MYCMAKEARGS on the same command-line.
|
||||
|
||||
If you have built and tested Kicad and want to package it, it's very simple:
|
||||
----
|
||||
# quickpkg kicad
|
||||
----
|
||||
This works for both live and standard installs of Kicad. The tarball
|
||||
will be in /usr/portage/packages.
|
||||
|
||||
Here is one way to find out which packages contain the shared
|
||||
libraries Kicad was built against, and what exact version they are:
|
||||
----
|
||||
# equery belongs $(cat /var/db/pkg/sci-electronics/kicad-99999999/NEEDED | cut -d ' ' -f 2 | tr ',' '\n' | sort -u) | sort -u
|
||||
----
|
||||
You should replace kicad-99999999 with the version you have just
|
||||
built. You might want to be careful with the interpretation of the
|
||||
results from the above one-liner, but if you made it this far you
|
||||
obviously know what you're dealing with.
|
||||
@@ -1,288 +0,0 @@
|
||||
Compiling KiCad on Debian & Ubuntu
|
||||
==================================
|
||||
|
||||
First written: 10-Mar-2009
|
||||
|
||||
Updated: 31-Oct-2009
|
||||
|
||||
Lasted edited by: Jerry Jacobs <xor.gate.engineering@gmail.com>
|
||||
|
||||
This file is AsciiDoc formatted to you can convert it to pdf/xhtml/xml
|
||||
|
||||
Ubuntu 9.10 (Karmic Koala)
|
||||
--------------------------
|
||||
After a fresh install you need the following packages to compile and run
|
||||
KiCad from source.
|
||||
|
||||
Boost - Collection of portable C++ source libraries
|
||||
CMake - Cross-platform make
|
||||
Doxygen - Documentation system for several programming languages
|
||||
GLUT - The OpenGL Utility Library
|
||||
wxGTK - The wxWidgets GUI toolkit with GTK+ bindings
|
||||
zlib - General purpose data compression library
|
||||
|
||||
Because boost is in the repository of kicad you don't need to install them.
|
||||
|
||||
Install these with aptitude:
|
||||
----
|
||||
sudo aptitude install build-essential cmake doxygen subversion libglut3 libglut3-dev libwxgtk libwxgtk-dev zlib1g zlib1g-dev
|
||||
----
|
||||
|
||||
Checkout the source
|
||||
----
|
||||
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad kicad
|
||||
----
|
||||
|
||||
Generate makefiles
|
||||
----
|
||||
cd /home/<you>/<kicad-src-dir>
|
||||
cmake .
|
||||
----
|
||||
|
||||
Compile
|
||||
----
|
||||
make
|
||||
----
|
||||
*Note* on multicore systems you can do parallel make jobs to speed
|
||||
up compiling by giving the option -j {JOBS} to make.
|
||||
|
||||
Ubuntu 9.04
|
||||
-----------
|
||||
Special thanks to David J S Briscoe <david@djsbriscoe.vispa.com>
|
||||
|
||||
The first thing I did was follow this page up to the running kicad section
|
||||
|
||||
http://basicubuntu.blogspot.com/2009/02/installing-kicad-on-ubuntu.html
|
||||
|
||||
This resulted in the error message detailed in this post
|
||||
|
||||
http://tech.groups.yahoo.com/group/kicad-devel/message/3180
|
||||
|
||||
SNIPPET
|
||||
|
||||
The build fails with the following message
|
||||
|
||||
----------------------------------------------------------:
|
||||
|
||||
david@ubuntu:~/Desktop/KICAD_SVN$ fakeroot debian/rules binary
|
||||
test -d debian/patched || install -d debian/patched
|
||||
dpatch apply-all
|
||||
dpatch cat-all >>patch-stampT
|
||||
mv -f patch-stampT patch-stamp
|
||||
mkdir -p /home/david/Desktop/KICAD_SVN/build/kicad
|
||||
mkdir -p /home/david/Desktop/KICAD_SVN/build/bitmaps
|
||||
cd /home/david/Desktop/KICAD_SVN/build/kicad && cmake -DKICAD_MINIZIP=0 \
|
||||
|
||||
-DKICAD_DEMOS=/home/david/Desktop/KICAD_SVN/debian/kicad-common/usr/share/doc/ki\
|
||||
cad/demos ../../kicad \
|
||||
-DXPM_CPP_PATH=/home/david/Desktop/KICAD_SVN/build/bitmaps
|
||||
-- The C compiler identification is GNU
|
||||
-- The CXX compiler identification is GNU
|
||||
-- Check for working C compiler: /usr/bin/gcc
|
||||
-- Check for working C compiler: /usr/bin/gcc -- works
|
||||
-- Detecting C compiler ABI info
|
||||
-- Detecting C compiler ABI info - done
|
||||
-- Check for working CXX compiler: /usr/bin/c++
|
||||
-- Check for working CXX compiler: /usr/bin/c++ -- works
|
||||
-- Detecting CXX compiler ABI info
|
||||
-- Detecting CXX compiler ABI info - done
|
||||
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
|
||||
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
|
||||
-- Looking for gethostbyname
|
||||
-- Looking for gethostbyname - found
|
||||
-- Looking for connect
|
||||
-- Looking for connect - found
|
||||
-- Looking for remove
|
||||
-- Looking for remove - found
|
||||
-- Looking for shmat
|
||||
-- Looking for shmat - found
|
||||
-- Looking for IceConnectionNumber in ICE
|
||||
-- Looking for IceConnectionNumber in ICE - found
|
||||
-- Found X11: /usr/lib/libX11.so
|
||||
-- Check for installed OpenGL -- found
|
||||
-- Check for installed Boost -- not found
|
||||
CMake Error at CMakeModules/CheckFindPackageResult.cmake:6 (message):
|
||||
Boost was not found - it is required to build Kicad
|
||||
Call Stack (most recent call first):
|
||||
CMakeLists.txt:111 (check_find_package_result)
|
||||
|
||||
|
||||
-- Configuring incomplete, errors occurred!
|
||||
make: *** [configure-stamp] Error 1
|
||||
david@ubuntu:~/Desktop/KICAD_SVN$
|
||||
|
||||
-----------------------------------------------------------------:
|
||||
|
||||
|
||||
SNIPPET
|
||||
|
||||
The next step was to remove any libboost 1.34 libraries using the apt-get
|
||||
remove command (can't remember the exact commands I used) as the Ubuntu 9.04
|
||||
(Jaunty) repositories only had the 1.34 version available.
|
||||
|
||||
After this I installed the boost 1.37 libraries
|
||||
using this command
|
||||
|
||||
---------------------------------------
|
||||
sudo apt-get install libboost1.37-dev
|
||||
---------------------------------------
|
||||
|
||||
This pulled down all the required files and dependencies (as far as I
|
||||
know-how do I check this?)
|
||||
|
||||
I then entered the following command
|
||||
|
||||
---------------------------------------
|
||||
fakeroot debian/rules binary
|
||||
---------------------------------------
|
||||
|
||||
and everything was built properly (I saw a few warnings flash past-will
|
||||
these be logged anywhere?)
|
||||
|
||||
I was left with a bunch of debian packaged files. I installed the main one,
|
||||
the common one and an English language documentation one (I can supply more
|
||||
details if needed later as I am not using Ubuntu at the moment).
|
||||
|
||||
The first link above describes moving the libraries and other files into the
|
||||
same place as the compiled executables. I didn't do this, so I have a
|
||||
duplicate installation.
|
||||
The above method needs some fine tuning and improvements. If you can let me
|
||||
know of a tidier way of compiling Kicad please let me know.
|
||||
Maybe there is a way of automating things with scripts, my Linux knowledge
|
||||
doesn't go that far, yet.
|
||||
|
||||
|
||||
Ubuntu (8.04)
|
||||
-------------
|
||||
Original from:
|
||||
http://basicubuntu.blogspot.com/2009/02/installing-kicad-on-ubuntu.html
|
||||
|
||||
Required software and dependencies
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
We need to install the following packages: debhelper, dpatch, libx11-dev,
|
||||
libglu1-mesa-dev, libgl1-mesa-dev, mesa-common-dev, libwxbase2.8-dev,
|
||||
libwxgtk2.8-dev, libboost-dev, subversion, cmake (>= 2.6.0).
|
||||
|
||||
---------------------------------------
|
||||
sudo apt-get install debhelper dpatch libx11-dev libglu1-mesa-dev
|
||||
libgl1-mesa-dev mesa-common-dev libwxbase2.8-dev libwxgtk2.8-dev
|
||||
libboost-dev fakeroot subversion libboost-serialization-dev
|
||||
---------------------------------------
|
||||
|
||||
And finally, we need cmake, but we need atleast version 2.6, the one
|
||||
from the repository is not the updated one (atleast for ubuntu 8.04).
|
||||
You can download version 2.6 from newer ubuntu releases.
|
||||
Just search for cmake on http://packages.ubuntu.com then get a newer
|
||||
cmake .deb file and install the downloaded package on the console
|
||||
with:
|
||||
|
||||
---------------------------------------
|
||||
sudo dpkg -i <packagename.deb>
|
||||
---------------------------------------
|
||||
|
||||
But if what the repository gives you is atleast version 2.6, then
|
||||
simply
|
||||
|
||||
---------------------------------------
|
||||
sudo apt-get install cmake
|
||||
---------------------------------------
|
||||
|
||||
Get KiCad Sourcecode
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
We will be getting the source codes through subversion. Create a directory
|
||||
where you'll be downloading the source codes, and go to that
|
||||
directory. type the following:
|
||||
|
||||
---------------------------------------
|
||||
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad kicad
|
||||
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad-doc kicad-doc
|
||||
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad-library kicad-library
|
||||
---------------------------------------
|
||||
|
||||
Also we need the following to get the debian specific stuff
|
||||
|
||||
---------------------------------------
|
||||
svn checkout http://svn.flexserv.de/kicad/trunk/debian
|
||||
---------------------------------------
|
||||
|
||||
Compiling
|
||||
~~~~~~~~~
|
||||
To compile simply do the following on your terminal (make sure you're still in
|
||||
the same directory where you did the svn)
|
||||
|
||||
---------------------------------------
|
||||
fakeroot debian/rules binary
|
||||
---------------------------------------
|
||||
hopefully, there will be no errors.
|
||||
You'll find the compiled version of KiCad in the following directory:
|
||||
|
||||
---------------------------------------
|
||||
debian/kicad/usr/bin/
|
||||
---------------------------------------
|
||||
to complete things up, you'll need to copy the following folders
|
||||
|
||||
---------------------------------------
|
||||
debian/kicad-common/usr/share/kicad/library
|
||||
debian/kicad-common/usr/share/kicad/modules
|
||||
debian/kicad-common/usr/share/kicad/template
|
||||
---------------------------------------
|
||||
in here
|
||||
|
||||
---------------------------------------
|
||||
debian/kicad/usr/share
|
||||
---------------------------------------
|
||||
again, to run KiCad go to
|
||||
|
||||
---------------------------------------
|
||||
cd debian/kicad/usr/bin/
|
||||
---------------------------------------
|
||||
and double click KiCad
|
||||
|
||||
|
||||
Debian squeeze (testing)
|
||||
------------------------
|
||||
|
||||
Special Note
|
||||
~~~~~~~~~~~~
|
||||
After SVN trunk revision 1753 boost library 1.36 or higher is needed
|
||||
to compile KiCad.
|
||||
|
||||
Installing Packages
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
The following packages should be installed with
|
||||
synaptic, apt-get or aptitude:
|
||||
- build-essential
|
||||
- cmake
|
||||
- libboost-dev
|
||||
- libwxgtk2.8-dev
|
||||
- libglut3-dev
|
||||
|
||||
The following packages will also be installed then
|
||||
- cmake dependencies
|
||||
- boost development dependencies
|
||||
- wxwidgets development dependencies
|
||||
- opengl3 (glut) development dependencies
|
||||
|
||||
Get KiCad sourcecode
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
Checkout sourcecode using subversion or download latest release.
|
||||
|
||||
.*Subversion*
|
||||
---------------------------------------
|
||||
svn checkout https://kicad.svn.sourceforge.net/svnroot/kicad/trunk/kicad kicad
|
||||
---------------------------------------
|
||||
|
||||
.*Release*
|
||||
---------------------------------------
|
||||
wget http://iut-tice.ujf-grenoble.fr/cao/kicad-sources-2009-02-16.tar.gz
|
||||
tar -xvf kicad-sources-2009-02-16.tar.gz
|
||||
---------------------------------------
|
||||
|
||||
Compiling
|
||||
~~~~~~~~~
|
||||
Run 'cmake .' in the root of the source directory then build the
|
||||
binaries with 'make'.
|
||||
|
||||
Installing
|
||||
~~~~~~~~~~
|
||||
For installing you could use 'make install' or build a debian package.
|
||||
@@ -9,6 +9,7 @@ Snow Leopard
|
||||
|
||||
Requirements
|
||||
* XCode Tools (http://developer.apple.com/tools/xcode)
|
||||
* bzr (bazaar)
|
||||
* CMake (http://www.cmake.org)
|
||||
* wxWidgets 2.9 (http://www.wxwidgets.org/downloads)
|
||||
* Doxygen (http://www.doxygen.nl)
|
||||
@@ -19,7 +20,7 @@ Building wxWidgets 2.9 Universal
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
To check if your tools and libraries are installed check with file for architectures.
|
||||
|
||||
user@macosx$ file /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystem.dylib
|
||||
user@macosx$ file /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystem.dylib
|
||||
|
||||
/Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystem.dylib: Mach-O universal binary with 4 architectures
|
||||
/Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystem.dylib (for architecture ppc7400): Mach-O dynamically linked shared library stub ppc
|
||||
@@ -37,7 +38,7 @@ At time of writing (2009-01-16) this is on line 18381
|
||||
into this: OSX_UNIV_OPTS="-arch ppc -arch i386 -arch x86_64"
|
||||
|
||||
Building a universal monolib wxWidgets 2.9 with the following parameters:
|
||||
./configure --enable-unicode=yes --enable-shared=no --enable-monolithic --with-opengl --with-expat=builtin --enable-universal_binary --enable-aui --enable-debug --with-osx_cocoa --with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk/ --prefix=/opt/wxwidgets/<rev>
|
||||
./configure --enable-unicode=yes --enable-shared=no --enable-monolithic --with-opengl --with-expat=builtin --enable-universal_binary --enable-aui --enable-debug --with-osx_cocoa --with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk/ --prefix=/opt/wxwidgets/<rev>
|
||||
|
||||
<rev> Should be subsituded with the revision from SVN
|
||||
|
||||
@@ -91,7 +92,7 @@ It depends on which CMake version you use:
|
||||
//This fixes also BOOST macro errors
|
||||
CMAKE_CXX_FLAGS:STRING=-D__ASSERTMACROS__
|
||||
|
||||
//Build architectures for OSX
|
||||
//Build architectures for OSX
|
||||
CMAKE_OSX_ARCHITECTURES:STRING=x86_64 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk/ -mmacosx-version-min=10.5
|
||||
|
||||
//The product will be built against the headers and libraries located
|
||||
@@ -114,7 +115,7 @@ user@mac-osx$ make
|
||||
|
||||
It is also possible to give all the options on the commandline and not to edit the CMakeCache.txt. This is a oneliner for Leopard and up:
|
||||
|
||||
cmake ~/Repositories/testing -DKICAD_TESTING_VERSION=ON -DCMAKE_OSX_ARCHITECTURES="i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6" -DCMAKE_CXX_FLAGS="-D__ASSERTMACROS__" -DCMAKE_OSX_SYSROOT="/Developer/SDKs/MacOSX10.6.sdk"
|
||||
cmake ~/Repositories/testing -DCMAKE_OSX_ARCHITECTURES="i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6" -DCMAKE_CXX_FLAGS="-D__ASSERTMACROS__" -DCMAKE_OSX_SYSROOT="/Developer/SDKs/MacOSX10.6.sdk"
|
||||
|
||||
Optional compiler cache
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
Here is the proposed copyright message to be added to all source files
|
||||
at their top. There is one line that represents the main copyright holder.
|
||||
|
||||
But in the future, the respective author of any newly coded module would be
|
||||
listed as the main copyright holder. Additional workers who might earn a
|
||||
partial copyright holder status of the respective module are simply left in the
|
||||
change_log.txt file, see the 2nd Copyright line below.
|
||||
|
||||
|
||||
/*
|
||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2010 <Creator>
|
||||
* Copyright (C) 1992-2010 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
|
||||
*/
|
||||
@@ -1,24 +1,34 @@
|
||||
|
||||
** General UI Guidelines for KICAD Development
|
||||
** General UI Guidelines for KiCad Development
|
||||
|
||||
|
||||
Capitalization:
|
||||
|
||||
For any visible text used within Kicad, follow recommendations here:
|
||||
http://library.gnome.org/devel/hig-book/2.20/design-text-labels.html.en#layout-capitalization
|
||||
This applies to all Menus, Titles, Labels, Tooltips, Buttons, etc.
|
||||
For any visible text used within KiCad, follow recommendations here:
|
||||
http://developer.gnome.org/hig-book/stable/design-text-labels.html.en
|
||||
in the "Capitalization" section. This applies to all Menus, Titles,
|
||||
Labels, Tooltips, Buttons, etc.
|
||||
|
||||
The capitalization for the application names is KiCad, Eeschema, CvPcb,
|
||||
GerbView, and Pcbnew. All strings that have application names that are
|
||||
visible to the user should be capitalized this way. It's also a good
|
||||
idea use this capitalization in source code comments as well to prevent
|
||||
confusion of new contributors.
|
||||
|
||||
|
||||
Dialogs:
|
||||
|
||||
Follow the recommendations here:
|
||||
http://library.gnome.org/devel/hig-book/2.20/windows-dialog.html.en
|
||||
|
||||
http://developer.gnome.org/hig-book/stable/design-window.html.en
|
||||
paying particular attention to "initial focus", "sensible default values",
|
||||
"default buttons", ESC key termination. Please note that the escape key
|
||||
termination only works properly if there is a dialog button defined with
|
||||
an ID of wxID_CANCEL or SetEscapeID( MY_ESCAPE_BUTTON_ID ) is called during
|
||||
dialog initialization. The former is the preferred method for handling
|
||||
escape key dialog termination.
|
||||
escape key dialog termination. There is a checkbox in wxformbuilder for
|
||||
the "default" control, and this is the one fired when the "enter" key
|
||||
is pressed.
|
||||
|
||||
Use wxWidgets "sizers" in all dialogs, no matter how simple they are:
|
||||
http://zetcode.com/tutorials/wxwidgetstutorial/layoutmanagement
|
||||
@@ -26,7 +36,7 @@ Dialogs:
|
||||
|
||||
Configure the sizers so that as the dialog window is expanded, the most
|
||||
sensible use of the increased dialog window occurs automatically by the
|
||||
sizers. For example, in the DRC dialog of PCBNEW, sizers should be used to
|
||||
sizers. For example, in the DRC dialog of Pcbnew, sizers should be used to
|
||||
expand the text control to use the full available free window area, so that
|
||||
the user's view of the items in the text control is maximized as he/she
|
||||
expands the dialog window, making it easier to read more DRC error messages.
|
||||
@@ -36,6 +46,14 @@ Dialogs:
|
||||
leaving them all bundled tightly together. The dialog box should look
|
||||
nice at any size large enough to show all the components.
|
||||
|
||||
When using wxFormBuilder, please add the following settings to the
|
||||
"Dialog" node:
|
||||
subclass.name <- DIALOG_SHIM
|
||||
subclass.header <- dialog_shim.h
|
||||
|
||||
This will provide for an override of the Show( bool ) wxWindow() function
|
||||
and provide retentitive size and position for the session.
|
||||
|
||||
Use tooltips to explain the functionality of each non-obvious control.
|
||||
This is important because the help files and the wiki often lag behind
|
||||
the source code.
|
||||
@@ -55,4 +73,13 @@ Dialogs:
|
||||
within the dialog, but for testing purposes please do not exceed this dialog
|
||||
size should the user have selected a font size of 13 points.
|
||||
|
||||
Quoting:
|
||||
Filenames, paths or other text should be with single quotes ''. e.g.:
|
||||
'filename.kicad_pcb'
|
||||
'longpath/subdir'
|
||||
'FOOTPRINTNAME'
|
||||
'anything else'
|
||||
|
||||
Often text strings like this end up in panels which use HTML rendering, and this
|
||||
can happen in the future. Previously used angle brackets only cause grief there.
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
So, finally we've got an integrated interactive, push-and-sometimes-shove router, although with a very limited user interface:
|
||||
|
||||
- Edit->Interactive router launches the tool,
|
||||
- while routing: 'V' key places a via,
|
||||
- '+' and '-' keys cycle through available layers,
|
||||
- '/' key switches track posture.
|
||||
|
||||
Via/track dimensions are taken from the netclasses.
|
||||
There are no other options available for the time being - promise to add them soon :)
|
||||
|
||||
Tom
|
||||
@@ -1,530 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="generator" content="AsciiDoc 8.4.5" />
|
||||
<title>KiCad 2010-xx-xx Release</title>
|
||||
<style type="text/css">
|
||||
/* Debug borders */
|
||||
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
|
||||
/*
|
||||
border: 1px solid red;
|
||||
*/
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 1em 5% 1em 5%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: blue;
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:visited {
|
||||
color: fuchsia;
|
||||
}
|
||||
|
||||
em {
|
||||
font-style: italic;
|
||||
color: navy;
|
||||
}
|
||||
|
||||
strong {
|
||||
font-weight: bold;
|
||||
color: #083194;
|
||||
}
|
||||
|
||||
tt {
|
||||
color: navy;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
color: #527bbd;
|
||||
font-family: sans-serif;
|
||||
margin-top: 1.2em;
|
||||
margin-bottom: 0.5em;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
h1, h2, h3 {
|
||||
border-bottom: 2px solid silver;
|
||||
}
|
||||
h2 {
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
h3 {
|
||||
float: left;
|
||||
}
|
||||
h3 + * {
|
||||
clear: left;
|
||||
}
|
||||
|
||||
div.sectionbody {
|
||||
font-family: serif;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: 1px solid silver;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
ul, ol, li > p {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
span#author {
|
||||
color: #527bbd;
|
||||
font-family: sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
span#email {
|
||||
}
|
||||
span#revnumber, span#revdate, span#revremark {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
div#footer {
|
||||
font-family: sans-serif;
|
||||
font-size: small;
|
||||
border-top: 2px solid silver;
|
||||
padding-top: 0.5em;
|
||||
margin-top: 4.0em;
|
||||
}
|
||||
div#footer-text {
|
||||
float: left;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
div#footer-badges {
|
||||
float: right;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
|
||||
div#preamble {
|
||||
margin-top: 1.5em;
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
|
||||
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
|
||||
div.admonitionblock {
|
||||
margin-top: 1.5em;
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
div.admonitionblock {
|
||||
margin-top: 2.5em;
|
||||
margin-bottom: 2.5em;
|
||||
}
|
||||
|
||||
div.content { /* Block element content. */
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Block element titles. */
|
||||
div.title, caption.title {
|
||||
color: #527bbd;
|
||||
font-family: sans-serif;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
margin-top: 1.0em;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
div.title + * {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
td div.title:first-child {
|
||||
margin-top: 0.0em;
|
||||
}
|
||||
div.content div.title:first-child {
|
||||
margin-top: 0.0em;
|
||||
}
|
||||
div.content + div.title {
|
||||
margin-top: 0.0em;
|
||||
}
|
||||
|
||||
div.sidebarblock > div.content {
|
||||
background: #ffffee;
|
||||
border: 1px solid silver;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
div.listingblock > div.content {
|
||||
border: 1px solid silver;
|
||||
background: #f4f4f4;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
div.quoteblock {
|
||||
padding-left: 2.0em;
|
||||
margin-right: 10%;
|
||||
}
|
||||
div.quoteblock > div.attribution {
|
||||
padding-top: 0.5em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.verseblock {
|
||||
padding-left: 2.0em;
|
||||
margin-right: 10%;
|
||||
}
|
||||
div.verseblock > div.content {
|
||||
white-space: pre;
|
||||
}
|
||||
div.verseblock > div.attribution {
|
||||
padding-top: 0.75em;
|
||||
text-align: left;
|
||||
}
|
||||
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
|
||||
div.verseblock + div.attribution {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.admonitionblock .icon {
|
||||
vertical-align: top;
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
color: #527bbd;
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
div.admonitionblock td.content {
|
||||
padding-left: 0.5em;
|
||||
border-left: 2px solid silver;
|
||||
}
|
||||
|
||||
div.exampleblock > div.content {
|
||||
border-left: 2px solid silver;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
div.imageblock div.content { padding-left: 0; }
|
||||
span.image img { border-style: none; }
|
||||
a.image:visited { color: white; }
|
||||
|
||||
dl {
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 0.8em;
|
||||
}
|
||||
dt {
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 0;
|
||||
font-style: normal;
|
||||
color: navy;
|
||||
}
|
||||
dd > *:first-child {
|
||||
margin-top: 0.1em;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
list-style-position: outside;
|
||||
}
|
||||
ol.arabic {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
ol.loweralpha {
|
||||
list-style-type: lower-alpha;
|
||||
}
|
||||
ol.upperalpha {
|
||||
list-style-type: upper-alpha;
|
||||
}
|
||||
ol.lowerroman {
|
||||
list-style-type: lower-roman;
|
||||
}
|
||||
ol.upperroman {
|
||||
list-style-type: upper-roman;
|
||||
}
|
||||
|
||||
div.compact ul, div.compact ol,
|
||||
div.compact p, div.compact p,
|
||||
div.compact div, div.compact div {
|
||||
margin-top: 0.1em;
|
||||
margin-bottom: 0.1em;
|
||||
}
|
||||
|
||||
div.tableblock > table {
|
||||
border: 3px solid #527bbd;
|
||||
}
|
||||
thead {
|
||||
font-family: sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
tfoot {
|
||||
font-weight: bold;
|
||||
}
|
||||
td > div.verse {
|
||||
white-space: pre;
|
||||
}
|
||||
p.table {
|
||||
margin-top: 0;
|
||||
}
|
||||
/* Because the table frame attribute is overriden by CSS in most browsers. */
|
||||
div.tableblock > table[frame="void"] {
|
||||
border-style: none;
|
||||
}
|
||||
div.tableblock > table[frame="hsides"] {
|
||||
border-left-style: none;
|
||||
border-right-style: none;
|
||||
}
|
||||
div.tableblock > table[frame="vsides"] {
|
||||
border-top-style: none;
|
||||
border-bottom-style: none;
|
||||
}
|
||||
|
||||
|
||||
div.hdlist {
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 0.8em;
|
||||
}
|
||||
div.hdlist tr {
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
dt.hdlist1.strong, td.hdlist1.strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
td.hdlist1 {
|
||||
vertical-align: top;
|
||||
font-style: normal;
|
||||
padding-right: 0.8em;
|
||||
color: navy;
|
||||
}
|
||||
td.hdlist2 {
|
||||
vertical-align: top;
|
||||
}
|
||||
div.hdlist.compact tr {
|
||||
margin: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.comment {
|
||||
background: yellow;
|
||||
}
|
||||
|
||||
@media print {
|
||||
div#footer-badges { display: none; }
|
||||
}
|
||||
|
||||
div#toctitle {
|
||||
color: #527bbd;
|
||||
font-family: sans-serif;
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
margin-top: 1.0em;
|
||||
margin-bottom: 0.1em;
|
||||
}
|
||||
|
||||
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
div.toclevel2 {
|
||||
margin-left: 2em;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
div.toclevel3 {
|
||||
margin-left: 4em;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
div.toclevel4 {
|
||||
margin-left: 6em;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
/* Workarounds for IE6's broken and incomplete CSS2. */
|
||||
|
||||
div.sidebar-content {
|
||||
background: #ffffee;
|
||||
border: 1px solid silver;
|
||||
padding: 0.5em;
|
||||
}
|
||||
div.sidebar-title, div.image-title {
|
||||
color: #527bbd;
|
||||
font-family: sans-serif;
|
||||
font-weight: bold;
|
||||
margin-top: 0.0em;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
div.listingblock div.content {
|
||||
border: 1px solid silver;
|
||||
background: #f4f4f4;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
div.quoteblock-attribution {
|
||||
padding-top: 0.5em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.verseblock-content {
|
||||
white-space: pre;
|
||||
}
|
||||
div.verseblock-attribution {
|
||||
padding-top: 0.75em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.exampleblock-content {
|
||||
border-left: 2px solid silver;
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
|
||||
/* IE6 sets dynamically generated links as visited. */
|
||||
div#toc a:visited { color: blue; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1>KiCad 2010-xx-xx Release</h1>
|
||||
</div>
|
||||
<h2 id="_common">Common</h2>
|
||||
<div class="sectionbody">
|
||||
<div class="ulist"><ul>
|
||||
<li>
|
||||
<p>
|
||||
Actions can now be undo and redo
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Menus and tooltips more clear
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
File history now in Open Recent submenu
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Many new hotkeys added
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Plot and print dialog rewritten
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Remember last dialog position and tab
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Better font shapes
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Generation of bill of materials
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Plot SVG output
|
||||
</p>
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<h2 id="_kicad">KiCad</h2>
|
||||
<div class="sectionbody">
|
||||
<div class="ulist"><ul>
|
||||
<li>
|
||||
<p>
|
||||
Issue fixed when opening a project in a directory with a lot of subdirectories
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
If project is noname.pro no <tt>error</tt> will be displayed
|
||||
</p>
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<h2 id="_eeschema">EESchema</h2>
|
||||
<div class="sectionbody">
|
||||
<div class="ulist"><ul>
|
||||
<li>
|
||||
<p>
|
||||
New pin properties dialog
|
||||
</p>
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<h2 id="_pcbnew">PCBNew</h2>
|
||||
<div class="sectionbody">
|
||||
<div class="ulist"><ul>
|
||||
<li>
|
||||
<p>
|
||||
Advanced layer setup
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
New panel for layer management
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Support for net classes
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Incorrect DRC error fixed, DRC min via and min track check
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Handle local mask clearance and local net clearance
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Handle zones in connectivity calculations
|
||||
</p>
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<h2 id="_core">Core</h2>
|
||||
<div class="sectionbody">
|
||||
<div class="ulist"><ul>
|
||||
<li>
|
||||
<p>
|
||||
Many many bugfixes and cleanups
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
All comments translated to English
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Moved to wxAUI and dialogs created with wxFormBuilder
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Full support for Mac OS X with wxWidgets 2.9
|
||||
</p>
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2010-02-21 13:41:09 CEST
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,40 +0,0 @@
|
||||
KiCad 2010-xx-xx Release
|
||||
========================
|
||||
|
||||
== Common
|
||||
* Actions can now be undo and redo
|
||||
* Menus and tooltips more clear
|
||||
* File history now in Open Recent submenu
|
||||
* Many new hotkeys added
|
||||
* Plot and print dialog rewritten
|
||||
* Remember last dialog position and tab
|
||||
* Better font shapes
|
||||
* Generation of bill of materials
|
||||
* Plot SVG output
|
||||
|
||||
== KiCad
|
||||
* Issue fixed when opening a project in a directory with a lot of subdirectories.
|
||||
* If project is noname.pro no `error` will be displayed
|
||||
|
||||
== EESchema
|
||||
* New pin properties dialog
|
||||
|
||||
== PCBNew
|
||||
* Plot DXF output
|
||||
* Advanced layer setup
|
||||
* New panel for layer management
|
||||
* Support for net classes
|
||||
* Incorrect DRC error fixed, DRC min via and min track check
|
||||
* Handle local mask clearance and local net clearance
|
||||
* Handle zones in connectivity calculations
|
||||
|
||||
== Core
|
||||
* Many many bugfixes and cleanups
|
||||
* All comments translated to English
|
||||
* Moved to wxAUI and dialogs created with wxFormBuilder
|
||||
* Full support for Mac OS X with wxWidgets 2.9
|
||||
|
||||
///////////////////////////////////////
|
||||
This is a asciidoc formatted file, it can be converted
|
||||
to PDF,(XHTML) and others. See asciidoc homepage.
|
||||
///////////////////////////////////////
|
||||
@@ -0,0 +1,48 @@
|
||||
Gnome rules, used in Kicad:
|
||||
|
||||
8.3.2. Capitalization
|
||||
|
||||
Two styles of capitalization are used in GNOME user interface elements:
|
||||
|
||||
Header capitalization
|
||||
Capitalize all words in the element, with the following exceptions:
|
||||
Articles: a, an, the.
|
||||
Conjunctions: and, but, for, not, so, yet ...
|
||||
Prepositions of three or fewer letters: at, for, by, in, to ...
|
||||
|
||||
Sentence capitalization
|
||||
Capitalize the first letter of the first word, and any other words normally capitalized in sentences,
|
||||
such as application names.
|
||||
|
||||
The following table indicates the capitalization style to use for each type of user interface element.
|
||||
Table 8-3 Capitalization Style Guidelines for User Interface Elements
|
||||
|
||||
Element Style
|
||||
|
||||
Check box labels Sentence
|
||||
Command button labels Header
|
||||
Column heading labels Header
|
||||
Desktop background object labels Header
|
||||
Dialog messages Sentence
|
||||
Drop-down combination box labels Sentence
|
||||
Drop-down list box labels Sentence
|
||||
Field labels Sentence
|
||||
Filenames Sentence
|
||||
Graphic equivalent text:
|
||||
for example, Alt text on web pages Sentence
|
||||
Group box or frame labels Header
|
||||
Items in drop-down combination boxes,
|
||||
drop-down list boxes, and list boxes Sentence
|
||||
List box labels Sentence
|
||||
Menu items Header
|
||||
Menu items in applications Header
|
||||
Menu titles in applications Header
|
||||
Radio button labels Sentence
|
||||
Slider labels Sentence
|
||||
Spin box labels Sentence
|
||||
Tabbed section titles Header
|
||||
Text box labels Sentence
|
||||
Titlebar labels Header
|
||||
Toolbar button labels Header
|
||||
Tooltips Sentence
|
||||
Webpage titles and navigational elements Header
|
||||
@@ -6,8 +6,9 @@ Kicad needs wxWidgets, the multi platform G.U.I.
|
||||
Known problems:
|
||||
wxMSW:
|
||||
*DO NOT* use wxMSW.2.8.1
|
||||
in fact: use wxWidgets >= 2.9.3
|
||||
|
||||
wxMSW and wxGTK
|
||||
wxGTK
|
||||
Use wxWidgets 2.8.10 or later
|
||||
|
||||
Linux and macOSX
|
||||
@@ -26,14 +27,7 @@ Some zoom values smaller than 3 to 5 create artifacts on screen, mainly values <
|
||||
|
||||
See http://trac.wxwidgets.org/ticket/9554 (and 11669).
|
||||
|
||||
This is fixed in version 2.9.x
|
||||
|
||||
This is a workaround that is not a full fix, but remaining artifacts are acceptable
|
||||
edit file edit file <wxWidgets>/src/msw/dc.cpp
|
||||
>> search for line
|
||||
static const int VIEWPORT_EXTENT = 1000;
|
||||
>> and replace by
|
||||
static const int VIEWPORT_EXTENT = 10000;
|
||||
This is fixed in version 2.9.3
|
||||
|
||||
|
||||
wxWidgets 2.9.1 (all platforms)
|
||||
@@ -43,7 +37,7 @@ after calling this conversion function, the comma is changed in point.
|
||||
(Happens after reading a parameter stored in a wxConfig structure, if this
|
||||
parameter is a double)
|
||||
Workaround:
|
||||
Use a version > 2.9.1
|
||||
Use a version >= 2.9.3
|
||||
|
||||
|
||||
*************************************************************************************
|
||||
@@ -54,7 +48,7 @@ Without this patch, printing boards and schematics under Linux, and perhaps OSX
|
||||
gives ugly drawings.
|
||||
|
||||
wxGTK-2.8.11/src/generic/dcpsg.cpp
|
||||
serach for:
|
||||
search for:
|
||||
line 1636
|
||||
PsPrint( "%%EndProlog\n" );
|
||||
|
||||
|
||||
+25
-21
@@ -2,40 +2,44 @@ Contribute to KiCad (under Linux)
|
||||
--------------------
|
||||
|
||||
1) make sure you have all the dependencies of KiCad:
|
||||
sudo apt-get install debhelper dpatch libx11-dev
|
||||
sudo apt-get install libglu1-mesa-dev libgl1-mesa-dev mesa-common-dev
|
||||
sudo apt-get install libwxbase2.8-dev libwxgtk2.8-dev libboost-dev fakeroot
|
||||
sudo apt-get install cmake bzr
|
||||
sudo apt-get install debhelper dpatch libx11-dev
|
||||
sudo apt-get install libglu1-mesa-dev libgl1-mesa-dev mesa-common-dev
|
||||
sudo apt-get install libwxbase2.8-dev libwxgtk2.8-dev libboost-dev fakeroot
|
||||
sudo apt-get install cmake bzr
|
||||
sudo apt-get install cmake bzr bzrtools
|
||||
|
||||
2) initialize Bazaar:
|
||||
bzr whoami "John Doe <john.doe@gmail.com>"
|
||||
bzr whoami "John Doe <john.doe@gmail.com>"
|
||||
|
||||
3) get LATEST KiCad source tree and name it, for instance, "kicad_john":
|
||||
cd ~/
|
||||
bzr branch lp:kicad kicad_john
|
||||
cd ~/
|
||||
bzr branch lp:kicad kicad_john
|
||||
|
||||
4) create a copy of this folder and zip it away (just in case).
|
||||
4) Read coding_style_policy.pdf, in <kicad_sources>/Documentation,
|
||||
and other docs.
|
||||
|
||||
5) Modify/add source code.
|
||||
cd kicad_john
|
||||
gedit .......
|
||||
cd kicad_john
|
||||
gedit .......
|
||||
|
||||
6) Compile:
|
||||
cd kicad_john
|
||||
mkdir build; cd build
|
||||
cmake ../ -DKICAD_TESTING_VERSION=ON -DCMAKE_BUILD_TYPE=Debug
|
||||
make -j 4 # this is for a 4 core machine
|
||||
cd kicad_john
|
||||
mkdir build; cd build
|
||||
cmake ../ -DCMAKE_BUILD_TYPE=Debug
|
||||
to build a debug version
|
||||
or
|
||||
cmake ../ -DCMAKE_BUILD_TYPE=Release
|
||||
to build a release version
|
||||
make
|
||||
|
||||
7) Repeat step 5 and 6 until satisfied.
|
||||
|
||||
8) Delete the "build" folder and create a patch:
|
||||
cd kicad_john
|
||||
rm -R ./build
|
||||
bzr add .
|
||||
bzr status
|
||||
bzr diff > gui_better_zoom.patch
|
||||
8) Create a patch:
|
||||
in kicad_john:
|
||||
if some files are added: bzr add [FILE...]
|
||||
bzr diff > my_changes.patch
|
||||
|
||||
9) Send the patch file "gui_better_zoom.patch" to the KiCad developers mailing list.
|
||||
9) Send the patch file "my_changes.patch" to the KiCad developers mailing list.
|
||||
in the subject of the e-mail include the keyword "[PATCH]".
|
||||
in the body of the e-mail clearly explain what you have done.
|
||||
|
||||
|
||||
+24
-21
@@ -77,6 +77,8 @@ view with pcbnew.
|
||||
|
||||
Linux KiCad tree
|
||||
----------------
|
||||
KiCad can use the Windows tree or the below tree.
|
||||
When Kicad is coming from Linux distribution, the tree is:
|
||||
|
||||
/usr/bin - Binaries (executable files).
|
||||
/usr/share/doc/kicad/ - Various documentation.
|
||||
@@ -87,9 +89,13 @@ Linux KiCad tree
|
||||
/usr/share/kicad/modules - Module libraries for printed boards.
|
||||
/usr/share/kicad/modules/packages3d - 3D component models (.wrl and .wings format).
|
||||
|
||||
if not found search kicad in
|
||||
/usr/local/
|
||||
and if found, kicad uses the same tree as the Windows KiCad tree above
|
||||
if KiCad does not found its files in usr/share, the search is made in
|
||||
/usr/local/kicad
|
||||
and kicad uses the same tree as the Windows KiCad tree above
|
||||
|
||||
*** When KiCad comes from .tgz archive from http://iut-tice.ujf-grenoble.fr/cao/,
|
||||
it must me installed in /usr/local and uses the Windows tree ***.
|
||||
|
||||
|
||||
Files '*.mod' are the libraries, and files '*.brd' are printed boards you can
|
||||
view with pcbnew.
|
||||
@@ -105,10 +111,10 @@ Mac OS X KiCad tree
|
||||
|
||||
System wide files
|
||||
|
||||
/Library/Application Support/kicad/demos
|
||||
/Library/Application Support/kicad/internat
|
||||
/Library/Application Support/kicad/demos
|
||||
/Library/Application Support/kicad/internat
|
||||
/Library/Application Support/kicad/library
|
||||
/Library/Application Support/kicad/modules
|
||||
/Library/Application Support/kicad/modules
|
||||
/Library/Application Support/kicad/modules/packages3d
|
||||
|
||||
User files can be the same as the system wide files but only inside the users home directory.
|
||||
@@ -116,17 +122,23 @@ User files can be the same as the system wide files but only inside the users ho
|
||||
$HOME/Library/Application Support/kicad
|
||||
|
||||
Warning:
|
||||
These paths are hardcoded into KiCad, if you put them somewhere else KiCad will not find them when a new
|
||||
project is created.
|
||||
These paths are hardcoded into KiCad, if you put them somewhere else KiCad will not find them when a new
|
||||
project is created.
|
||||
|
||||
Installation from source code
|
||||
-----------------------------
|
||||
|
||||
Some dependencies must be satisfied for the correct installation of KiCad:
|
||||
|
||||
Some dependencies must be satisfied for the correct installation of KiCad:
|
||||
under Linux:
|
||||
wxWidgets >= 2.8.11 http://www.wxwidgets.org/
|
||||
CMake >= 2.6.4 http://www.cmake.org/
|
||||
Boost C++ Libraries (files used by kicad are provided in kicad sources) http://www.boost.org/
|
||||
(needs to be compiled with unicode support)
|
||||
under Windows:MacOSX
|
||||
wxWidgets >= 2.9.4 http://www.wxwidgets.org/
|
||||
|
||||
CMake >= 2.8.1 http://www.cmake.org/
|
||||
Boost C++ Libraries:
|
||||
files used by kicad are autmatically downloaded and patched if needed
|
||||
from boost site ( http://www.boost.org/ )
|
||||
OpenGL
|
||||
Linux: Mesa 3D Graphics Library http://www.mesa3d.org/
|
||||
Windows: built-in
|
||||
@@ -178,15 +190,6 @@ configured and builded with "--enable-monolithic --disable-shared" parameters.
|
||||
For building dinamically linked executables. Can be used only if wxWidgets
|
||||
configured and builded with "--disable-monolithic --enable-shared" parameters.
|
||||
|
||||
-DKICAD_MINIZIP=ON
|
||||
Build the "minizip" executable. Use OFF to disable it building.
|
||||
|
||||
-DwxUSE_UNICODE=ON
|
||||
Require on locale utf8 for build the KiCad with cyrillic fonts support.
|
||||
|
||||
-DKICAD_GOST=ON
|
||||
Build the KiCad with russian GOST support.
|
||||
|
||||
-DKICAD_KEEPCASE=ON
|
||||
Build the KiCad with no component name conversion to uppercase (if you want your
|
||||
ADuC.../Si.../bq... components named as just so).
|
||||
|
||||
+10
-11
@@ -5,16 +5,15 @@ Documentation subfolder.
|
||||
|
||||
Files
|
||||
-----
|
||||
AUTHORS.txt - The authors, contributors, document writers and translators list
|
||||
CHANGELOG.txt - This years changelog (see for previous years Documentation/changelogs)
|
||||
CMakeList.txt - CMAKE build tool script
|
||||
COPYRIGHT.txt - A copy of the GNU General Public License Version 2
|
||||
CTestConfig.txt - Support for CTest and CDash testing tools
|
||||
Doxyfile - Doxygen preferences
|
||||
INSTALL.txt - The release (binairy) installation instructions
|
||||
TODO.txt - Todo list
|
||||
uncrustify.cfg - Uncrustify code formatting tool preferences
|
||||
version.txt - The current stable released version
|
||||
AUTHORS.txt - The authors, contributors, document writers and translators list
|
||||
CHANGELOG.txt - This years changelog (see for previous years Documentation/changelogs)
|
||||
CMakeList.txt - CMAKE build tool script
|
||||
COPYRIGHT.txt - A copy of the GNU General Public License Version 2
|
||||
CTestConfig.cmake - Support for CTest and CDash testing tools
|
||||
Doxyfile - Doxygen config file for Kicad
|
||||
INSTALL.txt - The release (binairy) installation instructions
|
||||
TODO.txt - Todo list
|
||||
uncrustify.cfg - Uncrustify config file for uncrustify sorces formatting tool
|
||||
|
||||
Subdirectories
|
||||
--------------
|
||||
@@ -37,6 +36,6 @@ packaging - Files for packaging on Windows and Mac OSX
|
||||
pcbnew - Sourcecode of the printed circuit board editor
|
||||
polygon - Sourcecode of the polygon library
|
||||
resources - Resources for installation, freedesktop mime-types for linux
|
||||
scripts - Helper scripts. For building, sourcecode packaging, font setting, pcb adjusting.
|
||||
scripts - Helper scripts. For building, sourcecode packaging.
|
||||
template - Project template(s)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ WXMAC Platform
|
||||
Common
|
||||
------
|
||||
* Grep for @TODO or TODO for sourcecode tasks
|
||||
* Use doxygen compatible comments on member functions (.h files)
|
||||
* Use Doxygen compatible comments on member functions (.h files)
|
||||
* Add tooltip text to all non-obvious controls in every dialog window.
|
||||
Use wxFormBuilder.
|
||||
* Component and module search displays in which library the
|
||||
@@ -19,19 +19,19 @@ Common
|
||||
* Push file open semantics down to one of the base frame classes ( likely candidate is
|
||||
WinEDA_BasicFrame ) so that file open behavior is consistent across all applications.
|
||||
|
||||
* Look over Brian's python BOM generation scripts, which are now in
|
||||
scripts/python/ky and sort them out.
|
||||
Code came from Brian in this posting's attachment, which is ky2.zip:
|
||||
https://lists.launchpad.net/kicad-developers/msg06763.html
|
||||
but is now in scripts/python/ky temporarily.
|
||||
|
||||
|
||||
CvPCB
|
||||
-----
|
||||
* Preview of the already assigned footprint.
|
||||
|
||||
|
||||
EESchema
|
||||
Eeschema
|
||||
--------
|
||||
* Drag and drop between two EESchema windows.
|
||||
* Drag and drop between two Eeschema windows.
|
||||
|
||||
Wayne:
|
||||
E2) Finish adding replace capability to new Find dialog.
|
||||
E3) Hook up perform last library search hot key to replace search libraries for
|
||||
component support removed from find dialog.
|
||||
E4) Change add component dialog search text control to combobox and add component
|
||||
@@ -48,6 +48,21 @@ E6) Start initial work for changing component library file format to use Dick's
|
||||
PCBNew
|
||||
------
|
||||
|
||||
Dick:
|
||||
*) Make the zone hit testing be done in screen coordinates, not internal units.
|
||||
See the @todos in class_zone.cpp. A fixed distance in internal units becomes
|
||||
a variable distance based on zoom factor, leading to inconsistent results at
|
||||
various zoom factors. I believe that a fixed distance in pixels might make
|
||||
for a friendlier UI.
|
||||
|
||||
* Use BOARD_ITEM::MenuIcon() in the onrightclick.cpp
|
||||
*) Add a hot key to toggle the 45 degree constraint on and off so that it can be
|
||||
changed when drawing a trace.
|
||||
|
||||
*) Paste (module ...) from clipboard into module editor.
|
||||
|
||||
|
||||
Dick's Final TODO List:
|
||||
======================
|
||||
*) Get licensing cleaned up.
|
||||
*) DLL-ization of pcbnew & eeschema
|
||||
http://www.eevblog.com/forum/open-source-kicad-geda/seriously-irritated-with-the-library-editor!/
|
||||
https://blueprints.launchpad.net/kicad/+spec/modular-kicad
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
|
||||
../potrace
|
||||
../polygon/kbool/include
|
||||
${CMAKE_SOURCE_DIR}/common
|
||||
)
|
||||
|
||||
include_directories(BEFORE ${INC_BEFORE})
|
||||
include_directories(
|
||||
../potrace
|
||||
../polygon/kbool/include
|
||||
../common
|
||||
${INC_AFTER}
|
||||
)
|
||||
|
||||
set(BITMAP2COMPONENT_SRCS
|
||||
bitmap2component.cpp
|
||||
@@ -43,7 +46,7 @@ endif(APPLE)
|
||||
target_link_libraries( bitmap2component common polygon bitmaps
|
||||
${wxWidgets_LIBRARIES}
|
||||
potrace
|
||||
kbool )
|
||||
)
|
||||
|
||||
install(TARGETS bitmap2component
|
||||
DESTINATION ${KICAD_BIN}
|
||||
|
||||
@@ -34,5 +34,7 @@
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<string>True</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -21,23 +21,24 @@
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "wxstruct.h"
|
||||
#include "confirm.h"
|
||||
#include "gestfich.h"
|
||||
#include <fctsys.h>
|
||||
#include <appl_wxstruct.h>
|
||||
#include <wxstruct.h>
|
||||
#include <confirm.h>
|
||||
#include <gestfich.h>
|
||||
|
||||
#include "wx/wx.h"
|
||||
#include "wx/config.h"
|
||||
#include "wx/filename.h"
|
||||
#include <wx/wx.h>
|
||||
#include <wx/config.h>
|
||||
#include <wx/filename.h>
|
||||
|
||||
#include "bitmap2cmp_gui_base.h"
|
||||
#include <bitmap2cmp_gui_base.h>
|
||||
|
||||
#include "potracelib.h"
|
||||
#include "bitmap_io.h"
|
||||
#include <potracelib.h>
|
||||
#include <bitmap_io.h>
|
||||
|
||||
#include "colors_selection.h"
|
||||
#include "build_version.h"
|
||||
#include <colors_selection.h>
|
||||
#include <build_version.h>
|
||||
#include <menus_helpers.h>
|
||||
|
||||
#define KEYWORD_FRAME_POSX wxT( "Bmconverter_Pos_x" )
|
||||
#define KEYWORD_FRAME_POSY wxT( "Bmconverter_Pos_y" )
|
||||
@@ -45,6 +46,9 @@
|
||||
#define KEYWORD_FRAME_SIZEY wxT( "Bmconverter_Size_y" )
|
||||
#define KEYWORD_LAST_INPUT_FILE wxT( "Last_input" )
|
||||
#define KEYWORD_LAST_OUTPUT_FILE wxT( "Last_output" )
|
||||
#define KEYWORD_LAST_FORMAT wxT( "Last_format" )
|
||||
#define KEYWORD_BINARY_THRESHOLD wxT( "Threshold" )
|
||||
#define KEYWORD_BW_NEGATIVE wxT( "Negative_choice" )
|
||||
|
||||
extern int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile, int aFormat );
|
||||
|
||||
@@ -76,11 +80,35 @@ private:
|
||||
void OnPaint( wxPaintEvent& event );
|
||||
void OnLoadFile( wxCommandEvent& event );
|
||||
bool LoadFile( wxString& aFullFileName );
|
||||
void OnExportEeschema( wxCommandEvent& event );
|
||||
void OnExportPcbnew( wxCommandEvent& event );
|
||||
void OnExport( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Generate a schematic library which comtains one component:
|
||||
* the logo
|
||||
*/
|
||||
void OnExportEeschema();
|
||||
|
||||
/**
|
||||
* Depending on the option:
|
||||
* Legacy format: generate a module library which comtains one component
|
||||
* New kicad_mod format: generate a module in S expr format
|
||||
*/
|
||||
void OnExportPcbnew( bool aLegacyFormat );
|
||||
|
||||
/**
|
||||
* Generate a postscript file
|
||||
*/
|
||||
void OnExportPostScript();
|
||||
|
||||
/**
|
||||
* Generate a file suitable to be copied into a page layout
|
||||
* description file (.kicad_wks file
|
||||
*/
|
||||
void OnExportLogo();
|
||||
|
||||
void Binarize( double aThreshold ); // aThreshold = 0.0 (black level) to 1.0 (white level)
|
||||
void OnOptionsSelection( wxCommandEvent& event );
|
||||
void OnThresholdChange( wxScrollEvent& event );
|
||||
void OnOptionsSelection( wxCommandEvent& event );
|
||||
void OnThresholdChange( wxScrollEvent& event );
|
||||
void NegateGreyscaleImage( );
|
||||
void ExportFile( FILE* aOutfile, int aFormat );
|
||||
};
|
||||
@@ -88,6 +116,7 @@ private:
|
||||
|
||||
BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL )
|
||||
{
|
||||
int tmp;
|
||||
m_Config = new wxConfig();
|
||||
m_Config->Read( KEYWORD_FRAME_POSX, & m_FramePos.x, -1 );
|
||||
m_Config->Read( KEYWORD_FRAME_POSY, & m_FramePos.y, -1 );
|
||||
@@ -95,6 +124,14 @@ BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL )
|
||||
m_Config->Read( KEYWORD_FRAME_SIZEY, & m_FrameSize.y, -1 );
|
||||
m_Config->Read( KEYWORD_LAST_INPUT_FILE, &m_BitmapFileName );
|
||||
m_Config->Read( KEYWORD_LAST_OUTPUT_FILE, &m_ConvertedFileName );
|
||||
if( m_Config->Read( KEYWORD_BINARY_THRESHOLD, &tmp ) )
|
||||
m_sliderThreshold->SetValue( tmp );
|
||||
if( m_Config->Read( KEYWORD_BW_NEGATIVE, &tmp ) )
|
||||
m_rbOptions->SetSelection( tmp ? 1 : 0 );
|
||||
|
||||
m_Config->Read( KEYWORD_LAST_FORMAT, &tmp );
|
||||
m_radioBoxFormat->SetSelection( tmp );
|
||||
|
||||
|
||||
// Give an icon
|
||||
wxIcon icon;
|
||||
@@ -105,8 +142,7 @@ BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL )
|
||||
|
||||
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
||||
|
||||
m_buttonExportEeschema->Enable( false );
|
||||
m_buttonExportPcbnew->Enable( false );
|
||||
m_buttonExport->Enable( false );
|
||||
|
||||
if ( m_FramePos == wxDefaultPosition )
|
||||
Centre();
|
||||
@@ -127,6 +163,9 @@ BM2CMP_FRAME::~BM2CMP_FRAME()
|
||||
m_Config->Write( KEYWORD_FRAME_SIZEY, (long) m_FrameSize.y );
|
||||
m_Config->Write( KEYWORD_LAST_INPUT_FILE, m_BitmapFileName );
|
||||
m_Config->Write( KEYWORD_LAST_OUTPUT_FILE, m_ConvertedFileName );
|
||||
m_Config->Write( KEYWORD_BINARY_THRESHOLD, m_sliderThreshold->GetValue() );
|
||||
m_Config->Write( KEYWORD_BW_NEGATIVE, m_rbOptions->GetSelection() );
|
||||
m_Config->Write( KEYWORD_LAST_FORMAT, m_radioBoxFormat->GetSelection() );
|
||||
|
||||
delete m_Config;
|
||||
|
||||
@@ -187,8 +226,7 @@ void BM2CMP_FRAME::OnLoadFile( wxCommandEvent& event )
|
||||
if( ! LoadFile( fullFilename ) )
|
||||
return;
|
||||
|
||||
m_buttonExportEeschema->Enable( true );
|
||||
m_buttonExportPcbnew->Enable( true );
|
||||
m_buttonExport->Enable( true );
|
||||
SetStatusText( fullFilename );
|
||||
Refresh();
|
||||
}
|
||||
@@ -243,8 +281,8 @@ void BM2CMP_FRAME::Binarize( double aThreshold )
|
||||
int w = m_Greyscale_Image.GetWidth();
|
||||
unsigned int threshold = (int)(aThreshold * 256);
|
||||
|
||||
for( int y = 1; y < h; y++ )
|
||||
for( int x = 1; x < w; x++ )
|
||||
for( int y = 0; y < h; y++ )
|
||||
for( int x = 0; x < w; x++ )
|
||||
{
|
||||
pixin = m_Greyscale_Image.GetGreen( x, y );
|
||||
|
||||
@@ -265,8 +303,8 @@ void BM2CMP_FRAME::NegateGreyscaleImage( )
|
||||
int h = m_Greyscale_Image.GetHeight();
|
||||
int w = m_Greyscale_Image.GetWidth();
|
||||
|
||||
for( int y = 1; y < h; y++ )
|
||||
for( int x = 1; x < w; x++ )
|
||||
for( int y = 0; y < h; y++ )
|
||||
for( int x = 0; x < w; x++ )
|
||||
{
|
||||
pix = m_Greyscale_Image.GetGreen( x, y );
|
||||
pix = ~pix;
|
||||
@@ -289,8 +327,103 @@ void BM2CMP_FRAME::OnThresholdChange( wxScrollEvent& event )
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void BM2CMP_FRAME::OnExport( wxCommandEvent& event )
|
||||
{
|
||||
int sel = m_radioBoxFormat->GetSelection();
|
||||
|
||||
void BM2CMP_FRAME::OnExportEeschema( wxCommandEvent& event )
|
||||
switch( sel )
|
||||
{
|
||||
case 0:
|
||||
OnExportEeschema();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
OnExportPcbnew( true );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
OnExportPcbnew( false );
|
||||
break;
|
||||
|
||||
case 3:
|
||||
OnExportPostScript();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
OnExportLogo();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void BM2CMP_FRAME::OnExportLogo()
|
||||
{
|
||||
wxFileName fn(m_ConvertedFileName);
|
||||
wxString path = fn.GetPath();
|
||||
|
||||
if( path.IsEmpty() || !wxDirExists(path) )
|
||||
path = ::wxGetCwd();
|
||||
|
||||
wxString msg = _( "Logo file (*.kicad_wks)|*.kicad_wks" );
|
||||
wxFileDialog FileDlg( this, _( "Create a logo file" ), path, wxEmptyString,
|
||||
msg,
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
int diag = FileDlg.ShowModal();
|
||||
|
||||
if( diag != wxID_OK )
|
||||
return;
|
||||
|
||||
m_ConvertedFileName = FileDlg.GetPath();
|
||||
|
||||
FILE* outfile;
|
||||
outfile = wxFopen( m_ConvertedFileName, wxT( "w" ) );
|
||||
|
||||
if( outfile == NULL )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "File %s could not be created" ), m_ConvertedFileName.c_str() );
|
||||
wxMessageBox( msg );
|
||||
return;
|
||||
}
|
||||
|
||||
ExportFile( outfile, 4 );
|
||||
fclose( outfile );
|
||||
}
|
||||
|
||||
void BM2CMP_FRAME::OnExportPostScript()
|
||||
{
|
||||
wxFileName fn(m_ConvertedFileName);
|
||||
wxString path = fn.GetPath();
|
||||
|
||||
if( path.IsEmpty() || !wxDirExists(path) )
|
||||
path = ::wxGetCwd();
|
||||
|
||||
wxString msg = _( "Postscript file (*.ps)|*.ps" );
|
||||
wxFileDialog FileDlg( this, _( "Create a Postscript file" ), path, wxEmptyString,
|
||||
msg,
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
||||
int diag = FileDlg.ShowModal();
|
||||
|
||||
if( diag != wxID_OK )
|
||||
return;
|
||||
|
||||
m_ConvertedFileName = FileDlg.GetPath();
|
||||
|
||||
FILE* outfile;
|
||||
outfile = wxFopen( m_ConvertedFileName, wxT( "w" ) );
|
||||
|
||||
if( outfile == NULL )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "File %s could not be created" ), m_ConvertedFileName.c_str() );
|
||||
wxMessageBox( msg );
|
||||
return;
|
||||
}
|
||||
|
||||
ExportFile( outfile, 3 );
|
||||
fclose( outfile );
|
||||
}
|
||||
|
||||
void BM2CMP_FRAME::OnExportEeschema()
|
||||
{
|
||||
wxFileName fn(m_ConvertedFileName);
|
||||
wxString path = fn.GetPath();
|
||||
@@ -320,12 +453,12 @@ void BM2CMP_FRAME::OnExportEeschema( wxCommandEvent& event )
|
||||
return;
|
||||
}
|
||||
|
||||
ExportFile( outfile, 1 );
|
||||
ExportFile( outfile, 2 );
|
||||
fclose( outfile );
|
||||
}
|
||||
|
||||
|
||||
void BM2CMP_FRAME::OnExportPcbnew( wxCommandEvent& event )
|
||||
void BM2CMP_FRAME::OnExportPcbnew( bool aLegacyFormat )
|
||||
{
|
||||
wxFileName fn(m_ConvertedFileName);
|
||||
wxString path = fn.GetPath();
|
||||
@@ -333,7 +466,9 @@ void BM2CMP_FRAME::OnExportPcbnew( wxCommandEvent& event )
|
||||
if( path.IsEmpty() || !wxDirExists(path) )
|
||||
path = ::wxGetCwd();
|
||||
|
||||
wxString msg = _( "Footprint file (*.mod)|*.mod" );
|
||||
wxString msg = aLegacyFormat ?
|
||||
_( "Footprint file (*.emp)|*.emp" ) :
|
||||
_( "Footprint file (*.kicad_mod)|*.kicad_mod" );
|
||||
wxFileDialog FileDlg( this, _( "Create a footprint file for PcbNew" ),
|
||||
path, wxEmptyString,
|
||||
msg,
|
||||
@@ -357,7 +492,7 @@ void BM2CMP_FRAME::OnExportPcbnew( wxCommandEvent& event )
|
||||
return;
|
||||
}
|
||||
|
||||
ExportFile( outfile, 0 );
|
||||
ExportFile( outfile, aLegacyFormat ? 0 : 1 );
|
||||
fclose( outfile );
|
||||
}
|
||||
|
||||
@@ -377,7 +512,7 @@ void BM2CMP_FRAME::ExportFile( FILE* aOutfile, int aFormat )
|
||||
}
|
||||
|
||||
/* fill the bitmap with data */
|
||||
for( int y = 0; y<h; y++ )
|
||||
for( int y = 0; y < h; y++ )
|
||||
{
|
||||
for( int x = 0; x<w; x++ )
|
||||
{
|
||||
@@ -390,16 +525,12 @@ void BM2CMP_FRAME::ExportFile( FILE* aOutfile, int aFormat )
|
||||
}
|
||||
|
||||
|
||||
// BM_TO_CMP_APP
|
||||
|
||||
void EDA_APP::MacOpenFile(const wxString &fileName)
|
||||
{
|
||||
}
|
||||
// EDA_APP
|
||||
|
||||
IMPLEMENT_APP( EDA_APP )
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
// BM_TO_CMP_APP
|
||||
// EDA_APP
|
||||
// main program
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -415,3 +546,8 @@ bool EDA_APP::OnInit()
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void EDA_APP::MacOpenFile( const wxString& aFileName )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,148 +1,151 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Sep 8 2010)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "bitmap2cmp_gui_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bMainSizer;
|
||||
bMainSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_InitialPicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
||||
m_InitialPicturePanel->SetScrollRate( 5, 5 );
|
||||
m_InitialPicturePanel->SetMinSize( wxSize( 400,300 ) );
|
||||
|
||||
m_notebook1->AddPage( m_InitialPicturePanel, _("Original Picture"), true );
|
||||
m_GreyscalePicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
||||
m_GreyscalePicturePanel->SetScrollRate( 5, 5 );
|
||||
m_GreyscalePicturePanel->SetMinSize( wxSize( 400,300 ) );
|
||||
|
||||
m_notebook1->AddPage( m_GreyscalePicturePanel, _("Greyscale Picture"), false );
|
||||
m_BNPicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
||||
m_BNPicturePanel->SetScrollRate( 5, 5 );
|
||||
m_notebook1->AddPage( m_BNPicturePanel, _("Black&&White Picture"), false );
|
||||
|
||||
bMainSizer->Add( m_notebook1, 1, wxEXPAND, 5 );
|
||||
|
||||
m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* brightSizer;
|
||||
brightSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxStaticBoxSizer* sbSizerInfo;
|
||||
sbSizerInfo = new wxStaticBoxSizer( new wxStaticBox( m_panelRight, wxID_ANY, _("Bitmap Info:") ), wxVERTICAL );
|
||||
|
||||
wxFlexGridSizer* fgSizerInfo;
|
||||
fgSizerInfo = new wxFlexGridSizer( 3, 3, 0, 0 );
|
||||
fgSizerInfo->SetFlexibleDirection( wxBOTH );
|
||||
fgSizerInfo->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticTextSizeX = new wxStaticText( m_panelRight, wxID_ANY, _("Size X:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextSizeX->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_staticTextSizeX, 0, wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_SizeXValue = new wxStaticText( m_panelRight, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SizeXValue->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_SizeXValue, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_SizeXunits = new wxStaticText( m_panelRight, wxID_ANY, _("pixels"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SizeXunits->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_SizeXunits, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_staticTextSizeY = new wxStaticText( m_panelRight, wxID_ANY, _("Size Y:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextSizeY->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_staticTextSizeY, 0, wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_SizeYValue = new wxStaticText( m_panelRight, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SizeYValue->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_SizeYValue, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_SizeYunits = new wxStaticText( m_panelRight, wxID_ANY, _("pixels"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SizeYunits->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_SizeYunits, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_staticTextBPP = new wxStaticText( m_panelRight, wxID_ANY, _("BPP:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextBPP->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_staticTextBPP, 0, wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_BPPValue = new wxStaticText( m_panelRight, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_BPPValue->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_BPPValue, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_BPPunits = new wxStaticText( m_panelRight, wxID_ANY, _("bits"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_BPPunits->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_BPPunits, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
sbSizerInfo->Add( fgSizerInfo, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
brightSizer->Add( sbSizerInfo, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_buttonLoad = new wxButton( m_panelRight, wxID_ANY, _("Load Bitmap"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
brightSizer->Add( m_buttonLoad, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||
|
||||
m_buttonExportEeschema = new wxButton( m_panelRight, wxID_ANY, _("Export to Eeschema"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonExportEeschema->SetToolTip( _("Create a library file for Eeschema\nThis library contains only one component: logo") );
|
||||
|
||||
brightSizer->Add( m_buttonExportEeschema, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||
|
||||
m_buttonExportPcbnew = new wxButton( m_panelRight, wxID_ANY, _("Export to Pcbnew"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonExportPcbnew->SetToolTip( _("Create a footprint file for PcbNew\nThis footprint contains only one footprint: logo") );
|
||||
|
||||
brightSizer->Add( m_buttonExportPcbnew, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||
|
||||
wxString m_rbOptionsChoices[] = { _("Normal"), _("Negative") };
|
||||
int m_rbOptionsNChoices = sizeof( m_rbOptionsChoices ) / sizeof( wxString );
|
||||
m_rbOptions = new wxRadioBox( m_panelRight, wxID_ANY, _("Options"), wxDefaultPosition, wxDefaultSize, m_rbOptionsNChoices, m_rbOptionsChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_rbOptions->SetSelection( 0 );
|
||||
brightSizer->Add( m_rbOptions, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_ThresholdText = new wxStaticText( m_panelRight, wxID_ANY, _("Threshold Value:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_ThresholdText->Wrap( -1 );
|
||||
brightSizer->Add( m_ThresholdText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_sliderThreshold = new wxSlider( m_panelRight, wxID_ANY, 25, 0, 50, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_TOP );
|
||||
m_sliderThreshold->SetToolTip( _("Adjust the level to convert the greyscale picture to a black and white picture.") );
|
||||
|
||||
brightSizer->Add( m_sliderThreshold, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_panelRight->SetSizer( brightSizer );
|
||||
m_panelRight->Layout();
|
||||
brightSizer->Fit( m_panelRight );
|
||||
bMainSizer->Add( m_panelRight, 0, wxEXPAND, 0 );
|
||||
|
||||
this->SetSizer( bMainSizer );
|
||||
this->Layout();
|
||||
m_statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
|
||||
|
||||
// Connect Events
|
||||
m_InitialPicturePanel->Connect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_GreyscalePicturePanel->Connect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_BNPicturePanel->Connect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_buttonLoad->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnLoadFile ), NULL, this );
|
||||
m_buttonExportEeschema->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExportEeschema ), NULL, this );
|
||||
m_buttonExportPcbnew->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExportPcbnew ), NULL, this );
|
||||
m_rbOptions->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnOptionsSelection ), NULL, this );
|
||||
m_sliderThreshold->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BM2CMP_FRAME_BASE::OnThresholdChange ), NULL, this );
|
||||
}
|
||||
|
||||
BM2CMP_FRAME_BASE::~BM2CMP_FRAME_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_InitialPicturePanel->Disconnect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_GreyscalePicturePanel->Disconnect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_BNPicturePanel->Disconnect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_buttonLoad->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnLoadFile ), NULL, this );
|
||||
m_buttonExportEeschema->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExportEeschema ), NULL, this );
|
||||
m_buttonExportPcbnew->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExportPcbnew ), NULL, this );
|
||||
m_rbOptions->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnOptionsSelection ), NULL, this );
|
||||
m_sliderThreshold->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BM2CMP_FRAME_BASE::OnThresholdChange ), NULL, this );
|
||||
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 8 2012)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "bitmap2cmp_gui_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bMainSizer;
|
||||
bMainSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_InitialPicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
||||
m_InitialPicturePanel->SetScrollRate( 5, 5 );
|
||||
m_InitialPicturePanel->SetMinSize( wxSize( 400,300 ) );
|
||||
|
||||
m_notebook1->AddPage( m_InitialPicturePanel, _("Original Picture"), true );
|
||||
m_GreyscalePicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
||||
m_GreyscalePicturePanel->SetScrollRate( 5, 5 );
|
||||
m_GreyscalePicturePanel->SetMinSize( wxSize( 400,300 ) );
|
||||
|
||||
m_notebook1->AddPage( m_GreyscalePicturePanel, _("Greyscale Picture"), false );
|
||||
m_BNPicturePanel = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
||||
m_BNPicturePanel->SetScrollRate( 5, 5 );
|
||||
m_notebook1->AddPage( m_BNPicturePanel, _("Black&&White Picture"), false );
|
||||
|
||||
bMainSizer->Add( m_notebook1, 1, wxEXPAND, 5 );
|
||||
|
||||
m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* brightSizer;
|
||||
brightSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxStaticBoxSizer* sbSizerInfo;
|
||||
sbSizerInfo = new wxStaticBoxSizer( new wxStaticBox( m_panelRight, wxID_ANY, _("Bitmap Info:") ), wxVERTICAL );
|
||||
|
||||
wxFlexGridSizer* fgSizerInfo;
|
||||
fgSizerInfo = new wxFlexGridSizer( 3, 3, 0, 0 );
|
||||
fgSizerInfo->SetFlexibleDirection( wxBOTH );
|
||||
fgSizerInfo->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticTextSizeX = new wxStaticText( m_panelRight, wxID_ANY, _("Size X:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextSizeX->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_staticTextSizeX, 0, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_SizeXValue = new wxStaticText( m_panelRight, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SizeXValue->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_SizeXValue, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_SizeXunits = new wxStaticText( m_panelRight, wxID_ANY, _("pixels"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SizeXunits->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_SizeXunits, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_staticTextSizeY = new wxStaticText( m_panelRight, wxID_ANY, _("Size Y:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextSizeY->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_staticTextSizeY, 0, wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_SizeYValue = new wxStaticText( m_panelRight, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SizeYValue->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_SizeYValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_SizeYunits = new wxStaticText( m_panelRight, wxID_ANY, _("pixels"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SizeYunits->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_SizeYunits, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_staticTextBPP = new wxStaticText( m_panelRight, wxID_ANY, _("BPP:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextBPP->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_staticTextBPP, 0, wxALIGN_RIGHT|wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_BPPValue = new wxStaticText( m_panelRight, wxID_ANY, _("0000"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_BPPValue->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_BPPValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_BPPunits = new wxStaticText( m_panelRight, wxID_ANY, _("bits"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_BPPunits->Wrap( -1 );
|
||||
fgSizerInfo->Add( m_BPPunits, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
sbSizerInfo->Add( fgSizerInfo, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
|
||||
brightSizer->Add( sbSizerInfo, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_buttonLoad = new wxButton( m_panelRight, wxID_ANY, _("Load Bitmap"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
brightSizer->Add( m_buttonLoad, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_buttonExport = new wxButton( m_panelRight, wxID_ANY, _("Export"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonExport->SetToolTip( _("Create a library file for Eeschema\nThis library contains only one component: logo") );
|
||||
|
||||
brightSizer->Add( m_buttonExport, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_radioBoxFormatChoices[] = { _("Eeschema"), _("Pcbnew old fmt (.emp)"), _("Pcbnew kicad_mod"), _("Postscript"), _("Logo for title block") };
|
||||
int m_radioBoxFormatNChoices = sizeof( m_radioBoxFormatChoices ) / sizeof( wxString );
|
||||
m_radioBoxFormat = new wxRadioBox( m_panelRight, wxID_ANY, _("Format"), wxDefaultPosition, wxDefaultSize, m_radioBoxFormatNChoices, m_radioBoxFormatChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_radioBoxFormat->SetSelection( 4 );
|
||||
brightSizer->Add( m_radioBoxFormat, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_rbOptionsChoices[] = { _("Normal"), _("Negative") };
|
||||
int m_rbOptionsNChoices = sizeof( m_rbOptionsChoices ) / sizeof( wxString );
|
||||
m_rbOptions = new wxRadioBox( m_panelRight, wxID_ANY, _("Options"), wxDefaultPosition, wxDefaultSize, m_rbOptionsNChoices, m_rbOptionsChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_rbOptions->SetSelection( 0 );
|
||||
brightSizer->Add( m_rbOptions, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_ThresholdText = new wxStaticText( m_panelRight, wxID_ANY, _("Threshold Value:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_ThresholdText->Wrap( -1 );
|
||||
brightSizer->Add( m_ThresholdText, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_sliderThreshold = new wxSlider( m_panelRight, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
|
||||
m_sliderThreshold->SetToolTip( _("Adjust the level to convert the greyscale picture to a black and white picture.") );
|
||||
|
||||
brightSizer->Add( m_sliderThreshold, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
m_panelRight->SetSizer( brightSizer );
|
||||
m_panelRight->Layout();
|
||||
brightSizer->Fit( m_panelRight );
|
||||
bMainSizer->Add( m_panelRight, 0, wxEXPAND, 0 );
|
||||
|
||||
|
||||
this->SetSizer( bMainSizer );
|
||||
this->Layout();
|
||||
m_statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
|
||||
|
||||
// Connect Events
|
||||
m_InitialPicturePanel->Connect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_GreyscalePicturePanel->Connect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_BNPicturePanel->Connect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_buttonLoad->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnLoadFile ), NULL, this );
|
||||
m_buttonExport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExport ), NULL, this );
|
||||
m_rbOptions->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnOptionsSelection ), NULL, this );
|
||||
m_sliderThreshold->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BM2CMP_FRAME_BASE::OnThresholdChange ), NULL, this );
|
||||
}
|
||||
|
||||
BM2CMP_FRAME_BASE::~BM2CMP_FRAME_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_InitialPicturePanel->Disconnect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_GreyscalePicturePanel->Disconnect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_BNPicturePanel->Disconnect( wxEVT_PAINT, wxPaintEventHandler( BM2CMP_FRAME_BASE::OnPaint ), NULL, this );
|
||||
m_buttonLoad->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnLoadFile ), NULL, this );
|
||||
m_buttonExport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnExport ), NULL, this );
|
||||
m_rbOptions->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( BM2CMP_FRAME_BASE::OnOptionsSelection ), NULL, this );
|
||||
m_sliderThreshold->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( BM2CMP_FRAME_BASE::OnThresholdChange ), NULL, this );
|
||||
|
||||
}
|
||||
|
||||
+1885
-1320
File diff suppressed because it is too large
Load Diff
@@ -1,82 +1,83 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Sep 8 2010)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __bitmap2cmp_gui_base__
|
||||
#define __bitmap2cmp_gui_base__
|
||||
|
||||
#include <wx/intl.h>
|
||||
|
||||
#include <wx/scrolwin.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/slider.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/statusbr.h>
|
||||
#include <wx/frame.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class BM2CMP_FRAME_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class BM2CMP_FRAME_BASE : public wxFrame
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxNotebook* m_notebook1;
|
||||
wxScrolledWindow* m_InitialPicturePanel;
|
||||
wxScrolledWindow* m_GreyscalePicturePanel;
|
||||
wxScrolledWindow* m_BNPicturePanel;
|
||||
wxPanel* m_panelRight;
|
||||
wxStaticText* m_staticTextSizeX;
|
||||
wxStaticText* m_SizeXValue;
|
||||
wxStaticText* m_SizeXunits;
|
||||
wxStaticText* m_staticTextSizeY;
|
||||
wxStaticText* m_SizeYValue;
|
||||
wxStaticText* m_SizeYunits;
|
||||
wxStaticText* m_staticTextBPP;
|
||||
wxStaticText* m_BPPValue;
|
||||
wxStaticText* m_BPPunits;
|
||||
wxButton* m_buttonLoad;
|
||||
wxButton* m_buttonExportEeschema;
|
||||
wxButton* m_buttonExportPcbnew;
|
||||
wxRadioBox* m_rbOptions;
|
||||
wxStaticText* m_ThresholdText;
|
||||
wxSlider* m_sliderThreshold;
|
||||
wxStatusBar* m_statusBar;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnPaint( wxPaintEvent& event ) { event.Skip(); }
|
||||
virtual void OnLoadFile( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnExportEeschema( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnExportPcbnew( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnOptionsSelection( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnThresholdChange( wxScrollEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Bitmap to Component Converter"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,419 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
|
||||
~BM2CMP_FRAME_BASE();
|
||||
|
||||
};
|
||||
|
||||
#endif //__bitmap2cmp_gui_base__
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 8 2012)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __BITMAP2CMP_GUI_BASE_H__
|
||||
#define __BITMAP2CMP_GUI_BASE_H__
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/scrolwin.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/slider.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/statusbr.h>
|
||||
#include <wx/frame.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class BM2CMP_FRAME_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class BM2CMP_FRAME_BASE : public wxFrame
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxNotebook* m_notebook1;
|
||||
wxScrolledWindow* m_InitialPicturePanel;
|
||||
wxScrolledWindow* m_GreyscalePicturePanel;
|
||||
wxScrolledWindow* m_BNPicturePanel;
|
||||
wxPanel* m_panelRight;
|
||||
wxStaticText* m_staticTextSizeX;
|
||||
wxStaticText* m_SizeXValue;
|
||||
wxStaticText* m_SizeXunits;
|
||||
wxStaticText* m_staticTextSizeY;
|
||||
wxStaticText* m_SizeYValue;
|
||||
wxStaticText* m_SizeYunits;
|
||||
wxStaticText* m_staticTextBPP;
|
||||
wxStaticText* m_BPPValue;
|
||||
wxStaticText* m_BPPunits;
|
||||
wxButton* m_buttonLoad;
|
||||
wxButton* m_buttonExport;
|
||||
wxRadioBox* m_radioBoxFormat;
|
||||
wxRadioBox* m_rbOptions;
|
||||
wxStaticText* m_ThresholdText;
|
||||
wxSlider* m_sliderThreshold;
|
||||
wxStatusBar* m_statusBar;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnPaint( wxPaintEvent& event ) { event.Skip(); }
|
||||
virtual void OnLoadFile( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnExport( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnOptionsSelection( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnThresholdChange( wxScrollEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Bitmap to Component Converter"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 527,470 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
|
||||
|
||||
~BM2CMP_FRAME_BASE();
|
||||
|
||||
};
|
||||
|
||||
#endif //__BITMAP2CMP_GUI_BASE_H__
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2010 jean-pierre.charras
|
||||
* Copyright (C) 1992-2010 Kicad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 1992-2013 jean-pierre.charras
|
||||
* Copyright (C) 1992-2013 Kicad Developers, see change_log.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
|
||||
@@ -21,56 +21,101 @@
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
#include <cmath>
|
||||
#include <algorithm> // std::max
|
||||
|
||||
#include "kbool/booleng.h"
|
||||
// For some unknown reasons, polygon.hpp should be included first
|
||||
#include <boost/polygon/polygon.hpp>
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
#include <potracelib.h>
|
||||
#include <auxiliary.h>
|
||||
|
||||
#include "potracelib.h"
|
||||
#include "auxiliary.h"
|
||||
|
||||
#ifndef max
|
||||
#define max( a, b ) ( ( (a) > (b) ) ? (a) : (b) )
|
||||
#endif
|
||||
#ifndef min
|
||||
#define min( a, b ) ( ( (a) < (b) ) ? (a) : (b) )
|
||||
#endif
|
||||
// Define some types used here from boost::polygon
|
||||
namespace bpl = boost::polygon; // bpl = boost polygon library
|
||||
using namespace bpl::operators; // +, -, =, ...
|
||||
|
||||
typedef int coordinate_type;
|
||||
|
||||
typedef bpl::polygon_data<coordinate_type> KPolygon; // define a basic polygon
|
||||
typedef std::vector<KPolygon> KPolygonSet; // define a set of polygons
|
||||
|
||||
typedef bpl::point_data<coordinate_type> KPolyPoint; // define a corner of a polygon
|
||||
|
||||
enum output_format {
|
||||
POSTSCRIPT_FMT = 1,
|
||||
PCBNEW_FMT,
|
||||
EESCHEMA_FMT
|
||||
PCBNEW_LEGACY_EMP,
|
||||
PCBNEW_KICAD_MOD,
|
||||
EESCHEMA_FMT,
|
||||
KICAD_LOGO
|
||||
};
|
||||
|
||||
/* free a potrace bitmap */
|
||||
static void bm_free(potrace_bitmap_t *bm) {
|
||||
if (bm != NULL) {
|
||||
free(bm->map);
|
||||
}
|
||||
free(bm);
|
||||
static void bm_free( potrace_bitmap_t* bm )
|
||||
{
|
||||
if( bm != NULL )
|
||||
{
|
||||
free( bm->map );
|
||||
}
|
||||
free( bm );
|
||||
}
|
||||
|
||||
|
||||
/* Helper class th handle useful info to convert a bitmpa to
|
||||
/* Helper class to handle useful info to convert a bitmap image to
|
||||
* a polygonal object description
|
||||
*/
|
||||
class BITMAPCONV_INFO
|
||||
{
|
||||
public:
|
||||
enum output_format m_Format;
|
||||
enum output_format m_Format; // File format
|
||||
int m_PixmapWidth;
|
||||
int m_PixmapHeight; // the bitmap size in pixels
|
||||
double m_ScaleX;
|
||||
double m_ScaleY; // the conversion scale
|
||||
potrace_path_t* m_Paths; // the list of paths, from potrace (list of lines and bezier curves)
|
||||
FILE* m_Outfile;
|
||||
FILE* m_Outfile; // File to create
|
||||
const char * m_CmpName; // The string used as cmp/footprint name
|
||||
|
||||
public:
|
||||
BITMAPCONV_INFO();
|
||||
|
||||
/**
|
||||
* Function CreateOutputFile
|
||||
* Creates the output file specified by m_Outfile,
|
||||
* depending on file format given by m_Format
|
||||
*/
|
||||
void CreateOutputFile();
|
||||
|
||||
|
||||
private:
|
||||
/**
|
||||
* Function OuputFileHeader
|
||||
* write to file the header depending on file format
|
||||
*/
|
||||
void OuputFileHeader();
|
||||
|
||||
/**
|
||||
* Function OuputFileEnd
|
||||
* write to file the last strings depending on file format
|
||||
*/
|
||||
void OuputFileEnd();
|
||||
|
||||
|
||||
/**
|
||||
* Function OuputOnePolygon
|
||||
* write one polygon to output file.
|
||||
* Polygon coordinates are expected scaled by the polugon extraction function
|
||||
*/
|
||||
void OuputOnePolygon( KPolygon & aPolygon );
|
||||
|
||||
};
|
||||
|
||||
static void BezierToPolyline( std::vector <potrace_dpoint_t>& aCornersBuffer,
|
||||
@@ -79,10 +124,6 @@ static void BezierToPolyline( std::vector <potrace_dpoint_t>& aCornersBuffer,
|
||||
potrace_dpoint_t p3,
|
||||
potrace_dpoint_t p4 );
|
||||
|
||||
static void CreateOutputFile( BITMAPCONV_INFO& aInfo );
|
||||
|
||||
static const char* CmpName = "LOGO";
|
||||
|
||||
|
||||
BITMAPCONV_INFO::BITMAPCONV_INFO()
|
||||
{
|
||||
@@ -93,111 +134,17 @@ BITMAPCONV_INFO::BITMAPCONV_INFO()
|
||||
m_ScaleY = 1.0;
|
||||
m_Paths = NULL;
|
||||
m_Outfile = NULL;
|
||||
m_CmpName = "LOGO";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function ArmBoolEng
|
||||
* Initialise parameters used in kbool
|
||||
* @param aBooleng = pointer to the Bool_Engine to initialise
|
||||
* @param aConvertHoles = mode for holes when a boolean operation is made
|
||||
* true: in resulting polygon, holes are linked into outer contours by double overlapping segments
|
||||
* false: in resulting polygons, holes are not linked: they are separate polygons
|
||||
*/
|
||||
void ArmBoolEng( Bool_Engine* aBooleng, bool aConvertHoles )
|
||||
int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile, int aFormat )
|
||||
{
|
||||
// set some global vals to arm the boolean engine
|
||||
|
||||
// input points are scaled up with GetDGrid() * GetGrid()
|
||||
|
||||
// DGRID is only meant to make fractional parts of input data which
|
||||
|
||||
/*
|
||||
* The input data scaled up with DGrid is related to the accuracy the user has in his input data.
|
||||
* User data with a minimum accuracy of 0.001, means set the DGrid to 1000.
|
||||
* The input data may contain data with a minimum accuracy much smaller, but by setting the DGrid
|
||||
* everything smaller than 1/DGrid is rounded.
|
||||
*
|
||||
* DGRID is only meant to make fractional parts of input data which can be
|
||||
* doubles, part of the integers used in vertexes within the boolean algorithm.
|
||||
* And therefore DGRID bigger than 1 is not usefull, you would only loose accuracy.
|
||||
* Within the algorithm all input data is multiplied with DGRID, and the result
|
||||
* is rounded to an integer.
|
||||
*/
|
||||
double DGRID = 1000.0; // round coordinate X or Y value in calculations to this (initial value = 1000.0 in kbool example)
|
||||
// kbool uses DGRID to convert float user units to integer
|
||||
// kbool unit = (int)(user unit * DGRID)
|
||||
// Note: in kicad, coordinates are already integer so DGRID could be set to 1
|
||||
// we can choose 1.0,
|
||||
// but choose DGRID = 1000.0 solves some filling problems
|
||||
// (perhaps because this allows a better precision in kbool internal calculations
|
||||
|
||||
double MARGE = 1.0 / DGRID; // snap with in this range points to lines in the intersection routines
|
||||
// should always be >= 1/DGRID a MARGE >= 10/DGRID is ok
|
||||
// this is also used to remove small segments and to decide when
|
||||
// two segments are in line. ( initial value = 0.001 )
|
||||
// For kicad we choose MARGE = 1/DGRID
|
||||
|
||||
double CORRECTIONFACTOR = 0.0; // correct the polygons by this number: used in BOOL_CORRECTION operation
|
||||
// this operation shrinks a polygon if CORRECTIONFACTOR < 0
|
||||
// or stretch it if CORRECTIONFACTOR > 0
|
||||
// the size change is CORRECTIONFACTOR (holes are correctly handled)
|
||||
double CORRECTIONABER = 1.0; // the accuracy for the rounded shapes used in correction
|
||||
double ROUNDFACTOR = 1.5; // when will we round the correction shape to a circle
|
||||
double SMOOTHABER = 10.0; // accuracy when smoothing a polygon
|
||||
double MAXLINEMERGE = 1000.0; // leave as is, segments of this length in smoothen
|
||||
potrace_param_t* param;
|
||||
potrace_state_t* st;
|
||||
|
||||
|
||||
/*
|
||||
* Grid makes sure that the integer data used within the algorithm has room for extra intersections
|
||||
* smaller than the smallest number within the input data.
|
||||
* The input data scaled up with DGrid is related to the accuracy the user has in his input data.
|
||||
* Another scaling with Grid is applied on top of it to create space in the integer number for
|
||||
* even smaller numbers.
|
||||
*/
|
||||
int GRID = (int) ( 10000 / DGRID ); // initial value = 10000 in kbool example
|
||||
|
||||
// But we use 10000/DGRID because the scalling is made
|
||||
// by DGRID on integer pcbnew units and
|
||||
// the global scalling ( GRID*DGRID) must be < 30000 to avoid
|
||||
// overflow in calculations (made in long long in kbool)
|
||||
if( GRID <= 1 ) // Cannot be null!
|
||||
GRID = 1;
|
||||
|
||||
aBooleng->SetMarge( MARGE );
|
||||
aBooleng->SetGrid( GRID );
|
||||
aBooleng->SetDGrid( DGRID );
|
||||
aBooleng->SetCorrectionFactor( CORRECTIONFACTOR );
|
||||
aBooleng->SetCorrectionAber( CORRECTIONABER );
|
||||
aBooleng->SetSmoothAber( SMOOTHABER );
|
||||
aBooleng->SetMaxlinemerge( MAXLINEMERGE );
|
||||
aBooleng->SetRoundfactor( ROUNDFACTOR );
|
||||
aBooleng->SetWindingRule( true ); // This is the default kbool value
|
||||
|
||||
if( aConvertHoles )
|
||||
{
|
||||
#if 1 // Can be set to 1 for kbool version >= 2.1, must be set to 0 for previous versions
|
||||
// SetAllowNonTopHoleLinking() exists only in kbool >= 2.1
|
||||
aBooleng->SetAllowNonTopHoleLinking( false ); // Default = , but i have problems (filling errors) when true
|
||||
#endif
|
||||
aBooleng->SetLinkHoles( true ); // holes will be connected by double overlapping segments
|
||||
aBooleng->SetOrientationEntryMode( false ); // all polygons are contours, not holes
|
||||
}
|
||||
else
|
||||
{
|
||||
aBooleng->SetLinkHoles( false ); // holes will not be connected by double overlapping segments
|
||||
aBooleng->SetOrientationEntryMode( true ); // holes are entered counter clockwise
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE * aOutfile, int aFormat )
|
||||
{
|
||||
potrace_param_t* param;
|
||||
potrace_state_t* st;
|
||||
|
||||
|
||||
/* set tracing parameters, starting from defaults */
|
||||
// set tracing parameters, starting from defaults
|
||||
param = potrace_param_default();
|
||||
if( !param )
|
||||
{
|
||||
@@ -222,29 +169,44 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE * aOutfile, int aF
|
||||
|
||||
switch( aFormat )
|
||||
{
|
||||
case 2:
|
||||
case 4:
|
||||
info.m_Format = KICAD_LOGO;
|
||||
info.m_ScaleX = 1e3 * 25.4 / 300; // the conversion scale from PPI to micro
|
||||
info.m_ScaleY = info.m_ScaleX; // Y axis is top to bottom
|
||||
info.CreateOutputFile();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
info.m_Format = POSTSCRIPT_FMT;
|
||||
info.m_ScaleX = info.m_ScaleY = 1.0; // the conversion scale
|
||||
/* output vector data, e.g. as a rudimentary EPS file */
|
||||
CreateOutputFile( info );
|
||||
info.m_ScaleX = 1.0; // the conversion scale
|
||||
info.m_ScaleY = info.m_ScaleX;
|
||||
// output vector data, e.g. as a rudimentary EPS file (mainly for tests)
|
||||
info.CreateOutputFile();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
info.m_Format = EESCHEMA_FMT;
|
||||
info.m_ScaleX = 1000.0 / 300; // the conversion scale from PPI to UI
|
||||
info.m_ScaleY = -info.m_ScaleX; // Y axis is bottom to Top for components in libs
|
||||
info.CreateOutputFile();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
info.m_Format = EESCHEMA_FMT;
|
||||
info.m_ScaleX = 1000.0 / 300; // the conversion scale
|
||||
info.m_ScaleY = - info.m_ScaleX; // Y axis is bottom to Top for components in libs
|
||||
CreateOutputFile( info );
|
||||
info.m_Format = PCBNEW_KICAD_MOD;
|
||||
info.m_ScaleX = 1e6 * 25.4 / 300; // the conversion scale from PPI to UI
|
||||
info.m_ScaleY = info.m_ScaleX; // Y axis is top to bottom in modedit
|
||||
info.CreateOutputFile();
|
||||
break;
|
||||
|
||||
case 0:
|
||||
info.m_Format = PCBNEW_FMT;
|
||||
info.m_ScaleX = 10000.0 / 300; // the conversion scale
|
||||
info.m_ScaleY = info.m_ScaleX; // Y axis is top to bottom in modedit
|
||||
CreateOutputFile( info );
|
||||
info.m_Format = PCBNEW_LEGACY_EMP;
|
||||
info.m_ScaleX = 10000.0 / 300; // the conversion scale
|
||||
info.m_ScaleY = info.m_ScaleX; // Y axis is top to bottom in modedit
|
||||
info.CreateOutputFile();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -256,170 +218,261 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE * aOutfile, int aF
|
||||
}
|
||||
|
||||
|
||||
static void OuputHeader( BITMAPCONV_INFO& aInfo )
|
||||
void BITMAPCONV_INFO::OuputFileHeader()
|
||||
{
|
||||
int Ypos = (int) ( aInfo.m_PixmapHeight / 2 * aInfo.m_ScaleY );
|
||||
int Ypos = (int) ( m_PixmapHeight / 2 * m_ScaleY );
|
||||
int fieldSize; // fields text size = 60 mils
|
||||
|
||||
switch( aInfo.m_Format )
|
||||
switch( m_Format )
|
||||
{
|
||||
case POSTSCRIPT_FMT:
|
||||
/* output vector data, e.g. as a rudimentary EPS file */
|
||||
fprintf( aInfo.m_Outfile, "%%!PS-Adobe-3.0 EPSF-3.0\n" );
|
||||
fprintf( aInfo.m_Outfile, "%%%%BoundingBox: 0 0 %d %d\n",
|
||||
aInfo.m_PixmapWidth, aInfo.m_PixmapHeight );
|
||||
fprintf( aInfo.m_Outfile, "gsave\n" );
|
||||
fprintf( m_Outfile, "%%!PS-Adobe-3.0 EPSF-3.0\n" );
|
||||
fprintf( m_Outfile, "%%%%BoundingBox: 0 0 %d %d\n",
|
||||
m_PixmapWidth, m_PixmapHeight );
|
||||
fprintf( m_Outfile, "gsave\n" );
|
||||
break;
|
||||
|
||||
case PCBNEW_FMT:
|
||||
case PCBNEW_LEGACY_EMP:
|
||||
#define FIELD_LAYER 21
|
||||
fieldSize = 600; // fields text size = 60 mils
|
||||
Ypos += fieldSize / 2;
|
||||
fprintf( aInfo.m_Outfile, "PCBNEW-LibModule-V1\n" );
|
||||
fprintf( aInfo.m_Outfile, "$INDEX\n%s\n$EndINDEX\n", CmpName );
|
||||
fprintf( m_Outfile, "PCBNEW-LibModule-V1\n" );
|
||||
fprintf( m_Outfile, "$INDEX\n%s\n$EndINDEX\n", m_CmpName );
|
||||
|
||||
fprintf( aInfo.m_Outfile, "#\n# %s\n", CmpName );
|
||||
fprintf( aInfo.m_Outfile, "# pixmap w = %d, h = %d\n#\n",
|
||||
aInfo.m_PixmapWidth, aInfo.m_PixmapHeight );
|
||||
fprintf( aInfo.m_Outfile, "$MODULE %s\n", CmpName );
|
||||
fprintf( aInfo.m_Outfile, "Po 0 0 0 15 00000000 00000000 ~~\n");
|
||||
fprintf( aInfo.m_Outfile, "Li %s\n", CmpName );
|
||||
fprintf( aInfo.m_Outfile, "T0 0 %d %d %d 0 %d N I %d \"G***\"\n",
|
||||
Ypos, fieldSize, fieldSize, fieldSize/5, FIELD_LAYER );
|
||||
fprintf( aInfo.m_Outfile, "T1 0 %d %d %d 0 %d N I %d \"%s\"\n",
|
||||
-Ypos, fieldSize, fieldSize, fieldSize/5, FIELD_LAYER, CmpName );
|
||||
fprintf( m_Outfile, "#\n# %s\n", m_CmpName );
|
||||
fprintf( m_Outfile, "# pixmap w = %d, h = %d\n#\n",
|
||||
m_PixmapWidth, m_PixmapHeight );
|
||||
fprintf( m_Outfile, "$MODULE %s\n", m_CmpName );
|
||||
fprintf( m_Outfile, "Po 0 0 0 15 00000000 00000000 ~~\n" );
|
||||
fprintf( m_Outfile, "Li %s\n", m_CmpName );
|
||||
fprintf( m_Outfile, "T0 0 %d %d %d 0 %d N I %d \"G***\"\n",
|
||||
Ypos, fieldSize, fieldSize, fieldSize / 5, FIELD_LAYER );
|
||||
fprintf( m_Outfile, "T1 0 %d %d %d 0 %d N I %d \"%s\"\n",
|
||||
-Ypos, fieldSize, fieldSize, fieldSize / 5, FIELD_LAYER, m_CmpName );
|
||||
break;
|
||||
|
||||
case PCBNEW_KICAD_MOD:
|
||||
// fields text size = 1.5 mm
|
||||
// fields text thickness = 1.5 / 5 = 0.3mm
|
||||
fprintf( m_Outfile, "(module %s (layer F.Cu)\n (at 0 0)\n",
|
||||
m_CmpName );
|
||||
fprintf( m_Outfile, " (fp_text reference \"G***\" (at 0 0) (layer F.SilkS) hide\n"
|
||||
" (effects (font (thickness 0.3)))\n )\n" );
|
||||
fprintf( m_Outfile, " (fp_text value \"%s\" (at 0.75 0) (layer F.SilkS) hide\n"
|
||||
" (effects (font (thickness 0.3)))\n )\n",
|
||||
m_CmpName );
|
||||
break;
|
||||
|
||||
case KICAD_LOGO:
|
||||
fprintf( m_Outfile, "(polygon (pos 0 0 rbcorner) (rotate 0) (linewidth 0.01)\n" );
|
||||
break;
|
||||
|
||||
case EESCHEMA_FMT:
|
||||
fprintf( aInfo.m_Outfile, "EESchema-LIBRARY Version 2.3\n" );
|
||||
fprintf( aInfo.m_Outfile, "#\n# %s\n", CmpName );
|
||||
fprintf( aInfo.m_Outfile, "# pixmap size w = %d, h = %d\n#\n",
|
||||
aInfo.m_PixmapWidth, aInfo.m_PixmapHeight );
|
||||
fprintf( m_Outfile, "EESchema-LIBRARY Version 2.3\n" );
|
||||
fprintf( m_Outfile, "#\n# %s\n", m_CmpName );
|
||||
fprintf( m_Outfile, "# pixmap size w = %d, h = %d\n#\n",
|
||||
m_PixmapWidth, m_PixmapHeight );
|
||||
|
||||
// print reference and value
|
||||
fieldSize = 60; // fields text size = 60 mils
|
||||
Ypos += fieldSize / 2;
|
||||
fprintf( aInfo.m_Outfile, "DEF %s G 0 40 Y Y 1 F N\n", CmpName );
|
||||
fprintf( aInfo.m_Outfile, "F0 \"#G\" 0 %d %d H I C CNN\n", Ypos, fieldSize );
|
||||
fprintf( aInfo.m_Outfile, "F1 \"%s\" 0 %d %d H I C CNN\n", CmpName, -Ypos, fieldSize );
|
||||
fprintf( aInfo.m_Outfile, "DRAW\n" );
|
||||
fprintf( m_Outfile, "DEF %s G 0 40 Y Y 1 F N\n", m_CmpName );
|
||||
fprintf( m_Outfile, "F0 \"#G\" 0 %d %d H I C CNN\n", Ypos, fieldSize );
|
||||
fprintf( m_Outfile, "F1 \"%s\" 0 %d %d H I C CNN\n", m_CmpName, -Ypos, fieldSize );
|
||||
fprintf( m_Outfile, "DRAW\n" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void OuputEnd( BITMAPCONV_INFO& aInfo )
|
||||
void BITMAPCONV_INFO::OuputFileEnd()
|
||||
{
|
||||
switch( aInfo.m_Format )
|
||||
switch( m_Format )
|
||||
{
|
||||
case POSTSCRIPT_FMT:
|
||||
fprintf( aInfo.m_Outfile, "grestore\n" );
|
||||
fprintf( aInfo.m_Outfile, "%%EOF\n" );
|
||||
fprintf( m_Outfile, "grestore\n" );
|
||||
fprintf( m_Outfile, "%%EOF\n" );
|
||||
break;
|
||||
|
||||
case PCBNEW_FMT:
|
||||
fprintf( aInfo.m_Outfile, "$EndMODULE %s\n", CmpName );
|
||||
fprintf( aInfo.m_Outfile, "$EndLIBRARY\n" );
|
||||
case PCBNEW_LEGACY_EMP:
|
||||
fprintf( m_Outfile, "$EndMODULE %s\n", m_CmpName );
|
||||
fprintf( m_Outfile, "$EndLIBRARY\n" );
|
||||
break;
|
||||
|
||||
case PCBNEW_KICAD_MOD:
|
||||
fprintf( m_Outfile, ")\n" );
|
||||
break;
|
||||
|
||||
case KICAD_LOGO:
|
||||
fprintf( m_Outfile, ")\n" );
|
||||
break;
|
||||
|
||||
case EESCHEMA_FMT:
|
||||
fprintf( aInfo.m_Outfile, "ENDDRAW\n" );
|
||||
fprintf( aInfo.m_Outfile, "ENDDEF\n" );
|
||||
fprintf( m_Outfile, "ENDDRAW\n" );
|
||||
fprintf( m_Outfile, "ENDDEF\n" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void OuputOnePolygon( BITMAPCONV_INFO& aInfo,
|
||||
std::vector <potrace_dpoint_t>& aPolygonBuffer )
|
||||
/**
|
||||
* Function OuputOnePolygon
|
||||
* write one polygon to output file.
|
||||
* Polygon coordinates are expected scaled by the polygon extraction function
|
||||
*/
|
||||
void BITMAPCONV_INFO::OuputOnePolygon( KPolygon & aPolygon )
|
||||
{
|
||||
unsigned ii;
|
||||
unsigned ii, jj;
|
||||
KPolyPoint currpoint;
|
||||
|
||||
double offsetX = aInfo.m_PixmapWidth / 2 * aInfo.m_ScaleX;
|
||||
double offsetY = aInfo.m_PixmapHeight / 2 * aInfo.m_ScaleY;
|
||||
int offsetX = (int)( m_PixmapWidth / 2 * m_ScaleX );
|
||||
int offsetY = (int)( m_PixmapHeight / 2 * m_ScaleY );
|
||||
|
||||
switch( aInfo.m_Format )
|
||||
KPolyPoint startpoint = *aPolygon.begin();
|
||||
|
||||
switch( m_Format )
|
||||
{
|
||||
case POSTSCRIPT_FMT:
|
||||
fprintf( aInfo.m_Outfile, "%f %f moveto\n",
|
||||
aPolygonBuffer[0].x * aInfo.m_ScaleX,
|
||||
aPolygonBuffer[0].y * aInfo.m_ScaleY );
|
||||
for( ii = 1; ii < aPolygonBuffer.size(); ii++ )
|
||||
fprintf( aInfo.m_Outfile, "%f %f lineto\n",
|
||||
aPolygonBuffer[ii].x * aInfo.m_ScaleX,
|
||||
aPolygonBuffer[ii].y * aInfo.m_ScaleY );
|
||||
offsetY = (int)( m_PixmapHeight * m_ScaleY );
|
||||
fprintf( m_Outfile, "newpath\n%d %d moveto\n",
|
||||
startpoint.x(), offsetY - startpoint.y() );
|
||||
jj = 0;
|
||||
for( ii = 1; ii < aPolygon.size(); ii++ )
|
||||
{
|
||||
currpoint = *(aPolygon.begin() + ii);
|
||||
fprintf( m_Outfile, " %d %d lineto",
|
||||
currpoint.x(), offsetY - currpoint.y() );
|
||||
|
||||
fprintf( aInfo.m_Outfile, "0 setgray fill\n" );
|
||||
if( jj++ > 6 )
|
||||
{
|
||||
jj = 0;
|
||||
fprintf( m_Outfile, ("\n") );
|
||||
}
|
||||
}
|
||||
|
||||
fprintf( m_Outfile, "\nclosepath fill\n" );
|
||||
break;
|
||||
|
||||
case PCBNEW_FMT:
|
||||
case PCBNEW_LEGACY_EMP:
|
||||
{
|
||||
#define SILKSCREEN_N_FRONT 21
|
||||
int layer = SILKSCREEN_N_FRONT;
|
||||
LAYER_NUM layer = SILKSCREEN_N_FRONT;
|
||||
int width = 1;
|
||||
fprintf( aInfo.m_Outfile, "DP %d %d %d %d %d %d %d\n",
|
||||
0, 0, 0, 0,
|
||||
int(aPolygonBuffer.size()+1),
|
||||
width, layer );
|
||||
fprintf( m_Outfile, "DP %d %d %d %d %d %d %d\n",
|
||||
0, 0, 0, 0,
|
||||
(int) aPolygon.size() + 1, width, layer );
|
||||
|
||||
for( ii = 0; ii < aPolygon.size(); ii++ )
|
||||
{
|
||||
currpoint = *( aPolygon.begin() + ii );
|
||||
fprintf( m_Outfile, "Dl %d %d\n",
|
||||
currpoint.x() - offsetX, currpoint.y() - offsetY );
|
||||
}
|
||||
|
||||
for( ii = 0; ii < aPolygonBuffer.size(); ii++ )
|
||||
fprintf( aInfo.m_Outfile, "Dl %d %d\n",
|
||||
(int) ( aPolygonBuffer[ii].x * aInfo.m_ScaleX - offsetX ),
|
||||
(int) ( aPolygonBuffer[ii].y * aInfo.m_ScaleY - offsetY ) );
|
||||
// Close polygon
|
||||
fprintf( aInfo.m_Outfile, "Dl %d %d\n",
|
||||
(int) ( aPolygonBuffer[0].x * aInfo.m_ScaleX - offsetX ),
|
||||
(int) ( aPolygonBuffer[0].y * aInfo.m_ScaleY - offsetY ) );
|
||||
fprintf( m_Outfile, "Dl %d %d\n",
|
||||
startpoint.x() - offsetX, startpoint.y() - offsetY );
|
||||
}
|
||||
break;
|
||||
|
||||
case PCBNEW_KICAD_MOD:
|
||||
{
|
||||
double width = 0.1;
|
||||
fprintf( m_Outfile, " (fp_poly (pts" );
|
||||
|
||||
jj = 0;
|
||||
for( ii = 0; ii < aPolygon.size(); ii++ )
|
||||
{
|
||||
currpoint = *( aPolygon.begin() + ii );
|
||||
fprintf( m_Outfile, " (xy %f %f)",
|
||||
(currpoint.x() - offsetX) / 1e6,
|
||||
(currpoint.y() - offsetY) / 1e6 );
|
||||
|
||||
if( jj++ > 6 )
|
||||
{
|
||||
jj = 0;
|
||||
fprintf( m_Outfile, ("\n ") );
|
||||
}
|
||||
}
|
||||
// Close polygon
|
||||
fprintf( m_Outfile, " (xy %f %f) )",
|
||||
(startpoint.x() - offsetX) / 1e6, (startpoint.y() - offsetY) / 1e6 );
|
||||
fprintf( m_Outfile, "(layer F.SilkS) (width %f)\n )\n", width );
|
||||
}
|
||||
break;
|
||||
|
||||
case KICAD_LOGO:
|
||||
fprintf( m_Outfile, " (pts" );
|
||||
// Internal units = micron, file unit = mm
|
||||
jj = 0;
|
||||
for( ii = 0; ii < aPolygon.size(); ii++ )
|
||||
{
|
||||
currpoint = *( aPolygon.begin() + ii );
|
||||
fprintf( m_Outfile, " (xy %.3f %.3f)",
|
||||
(currpoint.x() - offsetX) / 1e3,
|
||||
(currpoint.y() - offsetY) / 1e3 );
|
||||
|
||||
if( jj++ > 4 )
|
||||
{
|
||||
jj = 0;
|
||||
fprintf( m_Outfile, ("\n ") );
|
||||
}
|
||||
}
|
||||
// Close polygon
|
||||
fprintf( m_Outfile, " (xy %.3f %.3f) )\n",
|
||||
(startpoint.x() - offsetX) / 1e3, (startpoint.y() - offsetY) / 1e3 );
|
||||
break;
|
||||
|
||||
case EESCHEMA_FMT:
|
||||
fprintf( aInfo.m_Outfile, "P %d 0 0 1", int(aPolygonBuffer.size()+1) );
|
||||
for( ii = 0; ii < aPolygonBuffer.size(); ii++ )
|
||||
fprintf( aInfo.m_Outfile, " %d %d",
|
||||
(int) ( aPolygonBuffer[ii].x * aInfo.m_ScaleX - offsetX ),
|
||||
(int) ( aPolygonBuffer[ii].y * aInfo.m_ScaleY - offsetY ) );
|
||||
// Close polygon
|
||||
fprintf( aInfo.m_Outfile, " %d %d",
|
||||
(int) ( aPolygonBuffer[0].x * aInfo.m_ScaleX - offsetX ),
|
||||
(int) ( aPolygonBuffer[0].y * aInfo.m_ScaleY - offsetY ) );
|
||||
fprintf( m_Outfile, "P %d 0 0 1", (int) aPolygon.size() + 1 );
|
||||
for( ii = 0; ii < aPolygon.size(); ii++ )
|
||||
{
|
||||
currpoint = *(aPolygon.begin() + ii);
|
||||
fprintf( m_Outfile, " %d %d",
|
||||
currpoint.x() - offsetX, currpoint.y() - offsetY );
|
||||
}
|
||||
|
||||
fprintf( aInfo.m_Outfile, " F\n" );
|
||||
// Close polygon
|
||||
fprintf( m_Outfile, " %d %d",
|
||||
startpoint.x() - offsetX, startpoint.y() - offsetY );
|
||||
|
||||
fprintf( m_Outfile, " F\n" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void CreateOutputFile( BITMAPCONV_INFO& aInfo )
|
||||
void BITMAPCONV_INFO::CreateOutputFile()
|
||||
{
|
||||
unsigned int i, n;
|
||||
int* tag;
|
||||
KPolyPoint currpoint;
|
||||
|
||||
std::vector <potrace_dpoint_t> cornersBuffer;
|
||||
|
||||
potrace_dpoint_t( *c )[3];
|
||||
OuputHeader( aInfo );
|
||||
// This KPolygonSet polyset_areas is a complex polygon to draw
|
||||
// and can be complex depending on holes inside this polygon
|
||||
KPolygonSet polyset_areas;
|
||||
|
||||
bool main_outline = true;
|
||||
Bool_Engine* booleng = NULL;
|
||||
// This KPolygonSet polyset_holes is the set of holes inside polyset_areas
|
||||
KPolygonSet polyset_holes;
|
||||
|
||||
potrace_dpoint_t( *c )[3];
|
||||
|
||||
setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C
|
||||
|
||||
OuputFileHeader();
|
||||
|
||||
bool main_outline = true;
|
||||
|
||||
/* draw each as a polygon with no hole.
|
||||
* Bezier curves are approximated by a polyline
|
||||
*/
|
||||
potrace_path_t* paths = aInfo.m_Paths; // the list of paths
|
||||
potrace_path_t* paths = m_Paths; // the list of paths
|
||||
while( paths != NULL )
|
||||
{
|
||||
n = paths->curve.n;
|
||||
tag = paths->curve.tag;
|
||||
c = paths->curve.c;
|
||||
potrace_dpoint_t startpoint = c[n - 1][2];
|
||||
cornersBuffer.push_back( startpoint );
|
||||
if( booleng == NULL )
|
||||
{
|
||||
booleng = new Bool_Engine();
|
||||
ArmBoolEng( booleng, true );
|
||||
}
|
||||
for( i = 0; i < n; i++ )
|
||||
int cnt = paths->curve.n;
|
||||
int* tag = paths->curve.tag;
|
||||
c = paths->curve.c;
|
||||
potrace_dpoint_t startpoint = c[cnt - 1][2];
|
||||
for( int i = 0; i < cnt; i++ )
|
||||
{
|
||||
switch( tag[i] )
|
||||
{
|
||||
@@ -440,52 +493,61 @@ static void CreateOutputFile( BITMAPCONV_INFO& aInfo )
|
||||
if( main_outline )
|
||||
{
|
||||
main_outline = false;
|
||||
booleng->StartPolygonAdd( GROUP_A );
|
||||
for( i = 1; i < cornersBuffer.size(); i++ )
|
||||
booleng->AddPoint( cornersBuffer[i].x, cornersBuffer[i].y );
|
||||
|
||||
booleng->EndPolygonAdd();
|
||||
// build the current main polygon
|
||||
std::vector<KPolyPoint> cornerslist; // a simple boost polygon
|
||||
for( unsigned int i = 0; i < cornersBuffer.size(); i++ )
|
||||
{
|
||||
currpoint.x( (coordinate_type) (cornersBuffer[i].x * m_ScaleX) );
|
||||
currpoint.y( (coordinate_type) (cornersBuffer[i].y * m_ScaleY) );
|
||||
cornerslist.push_back( currpoint );
|
||||
}
|
||||
|
||||
KPolygon poly;
|
||||
bpl::set_points( poly, cornerslist.begin(), cornerslist.end() );
|
||||
polyset_areas.push_back( poly );
|
||||
}
|
||||
else
|
||||
{
|
||||
booleng->StartPolygonAdd( GROUP_B );
|
||||
for( i = 1; i < cornersBuffer.size(); i++ )
|
||||
booleng->AddPoint( cornersBuffer[i].x, cornersBuffer[i].y );
|
||||
// Add current hole in polyset_holes
|
||||
std::vector<KPolyPoint> cornerslist; // a simple boost polygon
|
||||
for( unsigned int i = 0; i < cornersBuffer.size(); i++ )
|
||||
{
|
||||
currpoint.x( (coordinate_type) (cornersBuffer[i].x * m_ScaleX) );
|
||||
currpoint.y( (coordinate_type) (cornersBuffer[i].y * m_ScaleY) );
|
||||
cornerslist.push_back( currpoint );
|
||||
}
|
||||
|
||||
booleng->EndPolygonAdd();
|
||||
KPolygon poly;
|
||||
bpl::set_points( poly, cornerslist.begin(), cornerslist.end() );
|
||||
polyset_holes.push_back( poly );
|
||||
}
|
||||
cornersBuffer.clear();
|
||||
|
||||
/* at the end of a group of a positive path and its negative
|
||||
* children, fill. */
|
||||
/* at the end of a group of a positive path and its negative children, fill.
|
||||
*/
|
||||
if( paths->next == NULL || paths->next->sign == '+' )
|
||||
{
|
||||
booleng->Do_Operation( BOOL_A_SUB_B );
|
||||
std::vector <potrace_dpoint_t> PolygonBuffer;
|
||||
while( booleng->StartPolygonGet() )
|
||||
{
|
||||
potrace_dpoint_t corner;
|
||||
PolygonBuffer.clear();
|
||||
while( booleng->PolygonHasMorePoints() )
|
||||
{
|
||||
corner.x = booleng->GetPolygonXPoint();
|
||||
corner.y = booleng->GetPolygonYPoint();
|
||||
PolygonBuffer.push_back( corner );
|
||||
}
|
||||
// Substract holes to main polygon:
|
||||
polyset_areas -= polyset_holes;
|
||||
|
||||
booleng->EndPolygonGet();
|
||||
OuputOnePolygon( aInfo, PolygonBuffer );
|
||||
PolygonBuffer.clear();
|
||||
// Output current resulting polygon(s)
|
||||
for( unsigned ii = 0; ii < polyset_areas.size(); ii++ )
|
||||
{
|
||||
KPolygon& poly = polyset_areas[ii];
|
||||
OuputOnePolygon(poly );
|
||||
}
|
||||
|
||||
delete booleng;
|
||||
booleng = NULL;
|
||||
polyset_areas.clear();
|
||||
polyset_holes.clear();
|
||||
main_outline = true;
|
||||
}
|
||||
paths = paths->next;
|
||||
}
|
||||
|
||||
OuputEnd( aInfo );
|
||||
OuputFileEnd();
|
||||
|
||||
setlocale( LC_NUMERIC, "" ); // revert to the current locale
|
||||
}
|
||||
|
||||
|
||||
@@ -505,7 +567,7 @@ void BezierToPolyline( std::vector <potrace_dpoint_t>& aCornersBuffer,
|
||||
* between the true curve and its approximation does not exceed the
|
||||
* desired accuracy delta. */
|
||||
|
||||
delta = 0.5; /* desired accuracy, in pixels */
|
||||
delta = 0.25; /* desired accuracy, in pixels */
|
||||
|
||||
/* let dd = maximal value of 2nd derivative over curve - this must
|
||||
* occur at an endpoint. */
|
||||
@@ -521,7 +583,7 @@ void BezierToPolyline( std::vector <potrace_dpoint_t>& aCornersBuffer,
|
||||
intermediate_point.x = p1.x * cu( 1 - t ) +
|
||||
3* p2.x* sq( 1 - t ) * t +
|
||||
3 * p3.x * (1 - t) * sq( t ) +
|
||||
p4.x* cu( t );
|
||||
p4.x* cu( t );
|
||||
|
||||
intermediate_point.y = p1.y * cu( 1 - t ) +
|
||||
3* p2.y* sq( 1 - t ) * t +
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,3 @@
|
||||
#ifdef USE_PNG_BITMAPS
|
||||
icon_bitmap2component ICON "../bitmaps_png/icons/icon_bitmap2component.ico"
|
||||
#else
|
||||
icon_bitmap2component ICON "../bitmaps_xpm/icons/icon_bitmap2component.ico"
|
||||
#endif
|
||||
|
||||
#include "wx/msw/wx.rc"
|
||||
|
||||
+107
-43
@@ -41,9 +41,8 @@
|
||||
# tools are required. If MAINTAIN_PNG is defined, then you are a PNG maintainer
|
||||
# and will need the following tools findable in your PATH:
|
||||
#
|
||||
# 1) imagemagick - all its programs must be on your PATH
|
||||
# 2) inkscape - command line mode is used, must be on your PATH
|
||||
# 3) pngcrush -
|
||||
# 1) inkscape - command line mode is used, must be on your PATH
|
||||
# 2) pngcrush - this program must be on your PATH
|
||||
#
|
||||
|
||||
# lower case is used for local variables, uppercase for global variables
|
||||
@@ -69,6 +68,15 @@ option( MAINTAIN_PNGS
|
||||
"Set to true if you are a PNG maintainer and have the required tools given in the bitmaps_png/CMakeLists.txt file (default OFF)."
|
||||
OFF)
|
||||
|
||||
# Used Only to maintain PNG files (and therefore to recreate .cpp files)
|
||||
# The png2cpp creates files with native End of Line format.
|
||||
|
||||
include_directories(BEFORE ${INC_BEFORE})
|
||||
include_directories(
|
||||
${INC_AFTER}
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
# Plan for three sizes of bitmaps:
|
||||
@@ -80,7 +88,34 @@ option( MAINTAIN_PNGS
|
||||
# A corresponding ${basename}.svg file must exist in 'sources' dir below here.
|
||||
|
||||
|
||||
# small icons (16x16) needed in listboxes
|
||||
set( BMAPS_SMALL
|
||||
pinorient_right
|
||||
pinorient_left
|
||||
pinorient_up
|
||||
pinorient_down
|
||||
pinshape_normal
|
||||
pinshape_invert
|
||||
pinshape_clock_normal
|
||||
pinshape_clock_invert
|
||||
pinshape_active_low_input
|
||||
pinshape_clock_active_low
|
||||
pinshape_active_low_output
|
||||
pinshape_clock_fall
|
||||
pinshape_nonlogic
|
||||
pintype_input
|
||||
pintype_output
|
||||
pintype_bidi
|
||||
pintype_3states
|
||||
pintype_passive
|
||||
pintype_notspecif
|
||||
pintype_powerinput
|
||||
pintype_poweroutput
|
||||
pintype_opencoll
|
||||
pintype_openemit
|
||||
pintype_noconnect
|
||||
tree_nosel
|
||||
tree_sel
|
||||
)
|
||||
|
||||
|
||||
@@ -100,6 +135,7 @@ set( BMAPS_MID
|
||||
add_hierar_pin
|
||||
add_hierarchical_subsheet
|
||||
add_junction
|
||||
add_keepout_area
|
||||
add_line2bus
|
||||
add_line_label
|
||||
add_line
|
||||
@@ -131,8 +167,8 @@ set( BMAPS_MID
|
||||
break_bus
|
||||
break_line
|
||||
browse_files
|
||||
cancel_tool
|
||||
cancel
|
||||
change_entry_orient
|
||||
create_cmp_file
|
||||
checked_ok
|
||||
component_select_unit
|
||||
@@ -148,7 +184,6 @@ set( BMAPS_MID
|
||||
cvpcb
|
||||
dashline
|
||||
datasheet
|
||||
delete_body
|
||||
delete_arc
|
||||
delete_association
|
||||
delete_bus
|
||||
@@ -199,6 +234,8 @@ set( BMAPS_MID
|
||||
ercwarn
|
||||
erc
|
||||
exit
|
||||
export_dsn
|
||||
export_idf
|
||||
export_footprint_names
|
||||
export_module
|
||||
export_options_pad
|
||||
@@ -207,6 +244,7 @@ set( BMAPS_MID
|
||||
file_footprint
|
||||
fill_zone
|
||||
find
|
||||
find_replace
|
||||
flag
|
||||
fonts
|
||||
footprint_text
|
||||
@@ -215,9 +253,12 @@ set( BMAPS_MID
|
||||
gbr_select_mode2
|
||||
gerber_file
|
||||
gerber_recent_files
|
||||
gerber_open_dcode_file
|
||||
gerbview_show_negative_objects
|
||||
gerbview_drill_file
|
||||
gerbview_clear_layers
|
||||
gerber_open_dcode_file
|
||||
gerbview_open_recent_drill_files
|
||||
general_deletions
|
||||
general_ratsnest
|
||||
glabel2label
|
||||
@@ -248,13 +289,13 @@ set( BMAPS_MID
|
||||
insert_module_board
|
||||
invert_module
|
||||
invisible_text
|
||||
jigsaw
|
||||
kicad_icon_small
|
||||
label2glabel
|
||||
label2text
|
||||
label
|
||||
lang_catalan
|
||||
lang_chinese
|
||||
lang_bg
|
||||
lang_cs
|
||||
lang_def
|
||||
lang_de
|
||||
@@ -283,26 +324,31 @@ set( BMAPS_MID
|
||||
library_browse
|
||||
library_update
|
||||
library
|
||||
library_table
|
||||
libview
|
||||
lines90
|
||||
load_module_board
|
||||
load_module_lib
|
||||
local_ratsnest
|
||||
locked
|
||||
macros_record
|
||||
mirepcb
|
||||
mirror_h
|
||||
mirror_v
|
||||
modedit
|
||||
mode_module
|
||||
mode_track
|
||||
modratsnest
|
||||
module_check
|
||||
modul_edit
|
||||
module_editor
|
||||
module_wizard
|
||||
module_filtered_list
|
||||
module_full_list
|
||||
module_options
|
||||
module_pin_filtered_list
|
||||
module_library_list
|
||||
module_ratsnest
|
||||
module
|
||||
modview_icon
|
||||
morgan1
|
||||
morgan2
|
||||
move_arc
|
||||
@@ -335,15 +381,16 @@ set( BMAPS_MID
|
||||
new_cvpcb
|
||||
new_footprint
|
||||
new_library
|
||||
new_module
|
||||
new_pcb
|
||||
new_project
|
||||
new_project_with_template
|
||||
new_sch
|
||||
new_txt
|
||||
new
|
||||
noconn
|
||||
normal
|
||||
online_help
|
||||
open_brd_file
|
||||
open_library
|
||||
open_project
|
||||
open_document
|
||||
@@ -368,7 +415,14 @@ set( BMAPS_MID
|
||||
ortho
|
||||
pad_sketch
|
||||
pad
|
||||
pad_dimensions
|
||||
pads_mask_layers
|
||||
pagelayout_load
|
||||
pagelayout_load_default
|
||||
pagelayout_new
|
||||
pagelayout_recent
|
||||
pagelayout_normal_view_mode
|
||||
pagelayout_special_view_mode
|
||||
palette
|
||||
part_properties
|
||||
paste
|
||||
@@ -378,35 +432,14 @@ set( BMAPS_MID
|
||||
pin_name_to
|
||||
pin_number_to
|
||||
pin_size_to
|
||||
pinorient_right
|
||||
pinorient_left
|
||||
pinorient_up
|
||||
pinorient_down
|
||||
pinshape_normal
|
||||
pinshape_invert
|
||||
pinshape_clock_normal
|
||||
pinshape_clock_invert
|
||||
pinshape_active_low_input
|
||||
pinshape_clock_active_low
|
||||
pinshape_active_low_output
|
||||
pinshape_clock_fall
|
||||
pinshape_nonlogic
|
||||
pintype_input
|
||||
pintype_output
|
||||
pintype_bidi
|
||||
pintype_3states
|
||||
pintype_passive
|
||||
pintype_notspecif
|
||||
pintype_powerinput
|
||||
pintype_poweroutput
|
||||
pintype_opencoll
|
||||
pintype_openemit
|
||||
pintype_noconnect
|
||||
pin_to
|
||||
pin
|
||||
plot_hpg
|
||||
plot_ps
|
||||
plot
|
||||
plot_dxf
|
||||
plot_hpg
|
||||
plot_pdf
|
||||
plot_ps
|
||||
plot_svg
|
||||
polar_coord
|
||||
post_compo
|
||||
post_drill
|
||||
@@ -455,6 +488,7 @@ set( BMAPS_MID
|
||||
show_zone
|
||||
show_zone_disable
|
||||
show_zone_outline_only
|
||||
svg_file
|
||||
swap_layer
|
||||
text_sketch
|
||||
three_d
|
||||
@@ -464,8 +498,6 @@ set( BMAPS_MID
|
||||
track_sketch
|
||||
track_unlocked
|
||||
transistor
|
||||
tree_nosel
|
||||
tree_sel
|
||||
undelete
|
||||
undo
|
||||
unit_inch
|
||||
@@ -475,6 +507,8 @@ set( BMAPS_MID
|
||||
unzip
|
||||
update_module_board
|
||||
up
|
||||
use_3D_copper_thickness
|
||||
via
|
||||
via_sketch
|
||||
warning
|
||||
web_support
|
||||
@@ -486,6 +520,8 @@ set( BMAPS_MID
|
||||
window_close
|
||||
zip_tool
|
||||
zip
|
||||
zone_duplicate
|
||||
zone_unfill
|
||||
zoom
|
||||
zoom_area
|
||||
zoom_fit_in_page
|
||||
@@ -499,6 +535,7 @@ set( BMAPS_MID
|
||||
|
||||
# 48 x 48 for now
|
||||
set( BMAPS_BIG
|
||||
dialog_warning
|
||||
icon_3d
|
||||
icon_cvpcb
|
||||
icon_eeschema
|
||||
@@ -510,6 +547,7 @@ set( BMAPS_BIG
|
||||
icon_pcbcalculator
|
||||
libedit_icon
|
||||
viewlibs_icon
|
||||
icon_pagelayout_editor
|
||||
)
|
||||
|
||||
|
||||
@@ -523,7 +561,8 @@ function( svg2png inputFile outFile pngWidth pngHeight )
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${outFile}
|
||||
COMMAND ${Inkscape_EXECUTABLE} --export-area-snap -f ${inputFile} -e ${outFile} -w ${pngWidth} -h ${pngHeight} > ${TMP_DIR}/${bmn}.inkscape.log
|
||||
COMMAND ${Inkscape_EXECUTABLE} --export-area-snap -f ${inputFile} -e ${outFile}
|
||||
-w ${pngWidth} -h ${pngHeight} > ${TMP_DIR}/${bmn}.inkscape.log
|
||||
DEPENDS ${inputFile}
|
||||
COMMENT "Creating ${pngHeight} pixel tall ${outFile}"
|
||||
)
|
||||
@@ -548,7 +587,6 @@ function( png2png inputFile outFile )
|
||||
)
|
||||
endfunction()
|
||||
|
||||
|
||||
# Function png2cpp
|
||||
# converts a single *.png to *.cpp
|
||||
function( png2cpp inputFile outFile )
|
||||
@@ -559,7 +597,6 @@ function( png2cpp inputFile outFile )
|
||||
-P ${CMAKE_MODULE_PATH}/PNG2cpp.cmake
|
||||
|
||||
DEPENDS ${inputFile} ${CMAKE_MODULE_PATH}/PNG2cpp.cmake
|
||||
|
||||
COMMENT "Creating ${outFile}"
|
||||
)
|
||||
endfunction()
|
||||
@@ -634,11 +671,34 @@ if( MAINTAIN_PNGS )
|
||||
endif( NOT pngcrush_EXECUTABLE )
|
||||
endif( NOT pngcrush_FOUND )
|
||||
|
||||
# these 2 cmake commands for each desired bitmap size set, repeat as needed:
|
||||
|
||||
# these 3 cmake commands for each desired bitmap size set, repeat as needed:
|
||||
bitmap_dir( 16 16 "${BMAPS_SMALL}" )
|
||||
|
||||
bitmap_dir( 26 26 "${BMAPS_MID}" )
|
||||
|
||||
bitmap_dir( 48 48 "${BMAPS_BIG}" )
|
||||
|
||||
if(CONVERT_EOL)
|
||||
# dos2unix is required to convert EOL format (CRLF) to unix EOL format (LF)
|
||||
set( eol2unix_FOUND FALSE )
|
||||
|
||||
if( NOT eol2unix_FOUND )
|
||||
find_program( eol2unix_EXECUTABLE ${eol2unix_converter} DOC "The EOL to LF converter program." )
|
||||
|
||||
if( NOT eol2unix_EXECUTABLE )
|
||||
message( FATAL_ERROR "Could not find the ${eol2unix_converter} EOL to LF converter program." )
|
||||
else( NOT eol2unix_EXECUTABLE )
|
||||
set( eol2unix_FOUND TRUE )
|
||||
set( eol2unix_EXECUTABLE ${eol2unix_EXECUTABLE}
|
||||
CACHE FILEPATH "Path and file name of the end of line converter program." )
|
||||
message( STATUS "The ${eol2unix_converter} EOL to LF converter program found." )
|
||||
endif( NOT eol2unix_EXECUTABLE )
|
||||
endif( NOT eol2unix_FOUND )
|
||||
elseif(APPLE)
|
||||
#TODO: see if a EOL converted is needed # OSX
|
||||
endif(CONVERT_EOL)
|
||||
|
||||
#message( "CPP_LIST: ${CPP_LIST}" )
|
||||
|
||||
# a target with no output, just so changes get built
|
||||
@@ -648,6 +708,11 @@ endif( MAINTAIN_PNGS )
|
||||
|
||||
set( CPP_LIST "" )
|
||||
|
||||
foreach( bmn ${BMAPS_SMALL} )
|
||||
#message( "library add cpp_16/${bmn}.cpp" )
|
||||
list( APPEND CPP_LIST cpp_16/${bmn}.cpp )
|
||||
endforeach()
|
||||
|
||||
foreach( bmn ${BMAPS_MID} )
|
||||
#message( "library add cpp_26/${bmn}.cpp" )
|
||||
list( APPEND CPP_LIST cpp_26/${bmn}.cpp )
|
||||
@@ -659,5 +724,4 @@ foreach( bmn ${BMAPS_BIG} )
|
||||
endforeach()
|
||||
|
||||
#add_library( bitmaps SHARED ${CPP_LIST} )
|
||||
add_library( bitmaps ${CPP_LIST} )
|
||||
|
||||
add_library( bitmaps STATIC ${CPP_LIST} )
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
/* Do not modify this file, it was automatically generated by the
|
||||
* PNG2cpp CMake script, using a *.png file as input.
|
||||
*/
|
||||
|
||||
#include <bitmaps.h>
|
||||
|
||||
static const unsigned char png[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x91, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x63, 0xf8, 0xff, 0xff, 0x3f,
|
||||
0x03, 0x25, 0x18, 0xa7, 0x04, 0x2b, 0x2b, 0xab, 0x01, 0x10, 0x2f, 0x65, 0x61, 0x61, 0xd9, 0xc3,
|
||||
0xcc, 0xcc, 0x1c, 0x41, 0x92, 0x01, 0x40, 0xc0, 0x09, 0xd4, 0xf8, 0x06, 0x88, 0x77, 0x03, 0xf1,
|
||||
0x44, 0x20, 0xfe, 0x0b, 0xc4, 0x0e, 0x44, 0x1b, 0x00, 0xb4, 0xd1, 0x13, 0xa4, 0x09, 0x68, 0x90,
|
||||
0x20, 0x88, 0x0f, 0x64, 0x1f, 0x05, 0x8a, 0xcd, 0x24, 0xc5, 0x05, 0x7c, 0x40, 0x4d, 0x1f, 0x81,
|
||||
0x5e, 0x58, 0x0e, 0xa4, 0x2b, 0x81, 0xf8, 0x17, 0xd0, 0x00, 0x1f, 0x92, 0xc2, 0x00, 0xa8, 0xc9,
|
||||
0x19, 0x88, 0x2f, 0x03, 0x35, 0xbe, 0x01, 0x1a, 0x54, 0x48, 0x72, 0x20, 0x42, 0x5d, 0x52, 0x01,
|
||||
0xc4, 0x27, 0xc8, 0x8a, 0x85, 0x51, 0x03, 0xe8, 0x6d, 0x00, 0x10, 0x28, 0x02, 0xf1, 0x06, 0x2c,
|
||||
0xf8, 0x1c, 0x10, 0x3f, 0xc2, 0x21, 0x17, 0x84, 0x6c, 0x80, 0x34, 0x10, 0x4f, 0x20, 0x11, 0x3b,
|
||||
0x13, 0xf4, 0x02, 0x31, 0x18, 0x00, 0x7c, 0x7c, 0x5c, 0xc2, 0x3f, 0x23, 0x70, 0x4a, 0x00, 0x00,
|
||||
0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
const BITMAP_OPAQUE pinorient_down_xpm[1] = {{ png, sizeof( png ), "pinorient_down_xpm" }};
|
||||
|
||||
//EOF
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
/* Do not modify this file, it was automatically generated by the
|
||||
* PNG2cpp CMake script, using a *.png file as input.
|
||||
*/
|
||||
|
||||
#include <bitmaps.h>
|
||||
|
||||
static const unsigned char png[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x98, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x63, 0xf8, 0xff, 0xff, 0x3f,
|
||||
0x03, 0x25, 0x18, 0x42, 0x30, 0x30, 0xa8, 0x02, 0x71, 0x01, 0x25, 0x06, 0x04, 0x00, 0xf1, 0x87,
|
||||
0x11, 0x60, 0x00, 0x1b, 0x1b, 0x9b, 0x36, 0x0b, 0x0b, 0x4b, 0x37, 0x33, 0x33, 0x73, 0x14, 0x50,
|
||||
0x3d, 0x0b, 0x49, 0x06, 0xb0, 0xb2, 0xb2, 0x1a, 0x00, 0x35, 0xff, 0x01, 0xe2, 0x33, 0x40, 0xfc,
|
||||
0x05, 0x68, 0xc8, 0x34, 0x74, 0x03, 0xbe, 0x01, 0xf1, 0x01, 0x5c, 0x98, 0x89, 0x89, 0xe9, 0x06,
|
||||
0x50, 0xe3, 0x01, 0x90, 0x7a, 0xa0, 0xe6, 0x00, 0x20, 0x1b, 0xa4, 0x9e, 0x1b, 0xd9, 0x80, 0x2f,
|
||||
0x40, 0xdc, 0x80, 0x0b, 0x03, 0x35, 0x6d, 0x05, 0x6a, 0xba, 0x09, 0x64, 0x0b, 0x03, 0xe9, 0x2a,
|
||||
0x20, 0x7e, 0x0e, 0xf2, 0x06, 0xd1, 0x5e, 0x00, 0x02, 0x49, 0xa0, 0x21, 0xf7, 0x80, 0x1a, 0xff,
|
||||
0x02, 0xf1, 0x2f, 0xa0, 0x97, 0xd2, 0x48, 0x0e, 0x44, 0x90, 0x8d, 0x40, 0x43, 0xbc, 0x80, 0xb4,
|
||||
0xec, 0x30, 0x4c, 0x48, 0xfc, 0x40, 0xac, 0x4b, 0xb6, 0x01, 0x94, 0x60, 0x00, 0xd3, 0xf5, 0x53,
|
||||
0xc0, 0x2a, 0x14, 0x68, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60,
|
||||
0x82,
|
||||
};
|
||||
|
||||
const BITMAP_OPAQUE pinorient_left_xpm[1] = {{ png, sizeof( png ), "pinorient_left_xpm" }};
|
||||
|
||||
//EOF
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
/* Do not modify this file, it was automatically generated by the
|
||||
* PNG2cpp CMake script, using a *.png file as input.
|
||||
*/
|
||||
|
||||
#include <bitmaps.h>
|
||||
|
||||
static const unsigned char png[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x8d, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x63, 0xf8, 0xff, 0xff, 0x3f,
|
||||
0x03, 0x25, 0x98, 0x3c, 0x4d, 0x0c, 0x0c, 0x1e, 0x40, 0x6c, 0x40, 0x89, 0x01, 0x07, 0x80, 0xb8,
|
||||
0x61, 0x90, 0x19, 0xc0, 0xc6, 0xc6, 0xa6, 0xcb, 0xc2, 0xc2, 0x52, 0x09, 0xa4, 0xb5, 0x48, 0x36,
|
||||
0x80, 0x99, 0x99, 0x39, 0x02, 0xa8, 0xf9, 0x3f, 0x90, 0xbe, 0x0f, 0xa4, 0xff, 0x01, 0xe9, 0x00,
|
||||
0x92, 0x0c, 0x00, 0x6a, 0x3a, 0x0d, 0xc4, 0x13, 0xa0, 0x86, 0xcd, 0x00, 0xe2, 0xbb, 0x40, 0x05,
|
||||
0x2b, 0xf0, 0xe0, 0xfb, 0xe8, 0x06, 0x1c, 0x03, 0x6a, 0x9a, 0x0d, 0x14, 0x64, 0x64, 0x65, 0x65,
|
||||
0x5d, 0x04, 0xe4, 0x5f, 0x07, 0xb2, 0x67, 0xe0, 0xc1, 0x77, 0xd0, 0xbd, 0xe0, 0x0b, 0xd4, 0xf4,
|
||||
0x0b, 0x88, 0xdf, 0x02, 0xf1, 0x4f, 0x20, 0x76, 0x23, 0x39, 0x10, 0x81, 0x40, 0x16, 0x68, 0x7b,
|
||||
0x26, 0x90, 0x96, 0x1e, 0xa2, 0xe9, 0x80, 0xde, 0x06, 0x98, 0x01, 0xb1, 0x0a, 0xd9, 0x06, 0x20,
|
||||
0x63, 0x00, 0x36, 0xc1, 0x5c, 0xcd, 0xe6, 0xd4, 0x98, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45,
|
||||
0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
const BITMAP_OPAQUE pinorient_right_xpm[1] = {{ png, sizeof( png ), "pinorient_right_xpm" }};
|
||||
|
||||
//EOF
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
/* Do not modify this file, it was automatically generated by the
|
||||
* PNG2cpp CMake script, using a *.png file as input.
|
||||
*/
|
||||
|
||||
#include <bitmaps.h>
|
||||
|
||||
static const unsigned char png[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x99, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x63, 0xf8, 0xff, 0xff, 0x3f,
|
||||
0x03, 0x25, 0x18, 0x42, 0x30, 0x30, 0x28, 0x02, 0xf1, 0x06, 0x12, 0x71, 0x10, 0xb2, 0x01, 0xd2,
|
||||
0x40, 0x3c, 0x01, 0x0b, 0x3e, 0x08, 0xc4, 0x0f, 0x71, 0xc8, 0x39, 0xc3, 0x0d, 0xc0, 0xe9, 0x3c,
|
||||
0x06, 0x86, 0x0a, 0x20, 0x3e, 0x41, 0xd0, 0x0b, 0xa3, 0x06, 0xd0, 0xd6, 0x80, 0x4a, 0x20, 0x3e,
|
||||
0x45, 0x96, 0x01, 0xcc, 0xcc, 0xcc, 0xb1, 0x2c, 0x2c, 0x2c, 0xcf, 0x81, 0xf8, 0x3b, 0x10, 0x4f,
|
||||
0x04, 0x1a, 0xc4, 0x4c, 0xb4, 0x01, 0x40, 0x20, 0x0e, 0xd4, 0xf4, 0x03, 0x88, 0xbb, 0x81, 0x06,
|
||||
0x45, 0x02, 0xe9, 0x2f, 0x40, 0x3a, 0x9a, 0x68, 0x03, 0x80, 0x1a, 0xdc, 0x80, 0xf8, 0x2f, 0xd0,
|
||||
0x20, 0x51, 0x28, 0xff, 0x04, 0xd0, 0x80, 0xa9, 0xa4, 0xb8, 0x80, 0x85, 0x95, 0x95, 0xf5, 0x01,
|
||||
0x50, 0xe3, 0x15, 0x20, 0xde, 0x08, 0x32, 0x0c, 0xc8, 0x37, 0x22, 0x29, 0x0c, 0x80, 0x40, 0x06,
|
||||
0xa8, 0xb1, 0x0b, 0xa8, 0x71, 0x31, 0x90, 0xb6, 0x26, 0x2b, 0x16, 0x88, 0xc1, 0x00, 0x39, 0x69,
|
||||
0x59, 0xdc, 0xf0, 0x39, 0x71, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
|
||||
0x60, 0x82,
|
||||
};
|
||||
|
||||
const BITMAP_OPAQUE pinorient_up_xpm[1] = {{ png, sizeof( png ), "pinorient_up_xpm" }};
|
||||
|
||||
//EOF
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user