Compare commits
667 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 930dd9a762 | |||
| fc12f15ee4 | |||
| aaee1b5e39 | |||
| 4fef2ad448 | |||
| 726ddc71f9 | |||
| 9415d2d0c4 | |||
| bbfe3aedce | |||
| 524bda9547 | |||
| ac182bf9d9 | |||
| 05789429cf | |||
| 15482dcad6 | |||
| effe30ba69 | |||
| 1bcb7275db | |||
| 9bf0c5890f | |||
| d17c9e35d5 | |||
| 2605b54d89 | |||
| 1621bd0deb | |||
| fd6c8382ee | |||
| f177aa6467 | |||
| c29228d785 | |||
| eec4a5975c | |||
| 10902d7d4f | |||
| fcaa312616 | |||
| a713eafc95 | |||
| acc94f3baf | |||
| 710a470706 | |||
| 087cdd8169 | |||
| fd544b4ba9 | |||
| 887fac2ab1 | |||
| 5223aff0fb | |||
| 757af860be | |||
| feec92c94a | |||
| c5723f1f89 | |||
| 3e0bd9e34a | |||
| af4c8ffa82 | |||
| 866e20543d | |||
| 7d9b3445a7 | |||
| c63cb3d9dc | |||
| ae653d1d5c | |||
| 3e981e0712 | |||
| c849e9970e | |||
| 31fe74b3a7 | |||
| 56d29f212b | |||
| 6f302d33fe | |||
| 7d457f189d | |||
| b601ed911c | |||
| 3aac13eacf | |||
| c8042bed16 | |||
| d60a737ae8 | |||
| a06533392b | |||
| 3569b135bb | |||
| d1ad3b4926 | |||
| 59177020a6 | |||
| f238295c2d | |||
| 68ac5c1c8c | |||
| 9647ac5fdd | |||
| a36c87c71d | |||
| 9a053b860d | |||
| 31b3358291 | |||
| 459790624f | |||
| 664bc12c9a | |||
| bc3a3d3c8c | |||
| 83f4b2c293 | |||
| 0bd3f9d8a9 | |||
| a22a8a00a1 | |||
| 1833ae86de | |||
| 75c515691d | |||
| 4b191ff830 | |||
| dd35d0d035 | |||
| d66b34050d | |||
| 641fd1b287 | |||
| 3f48031cb4 | |||
| 142e796244 | |||
| 9c5ff9164e | |||
| 92b8d8a690 | |||
| 293856b705 | |||
| 326ec081ce | |||
| cf6e561e5a | |||
| f7f717db9e | |||
| 1f08f07d38 | |||
| b7f66680ab | |||
| 3473e5d424 | |||
| 00a8a784ec | |||
| 8443756ff5 | |||
| 35a61883e1 | |||
| 1fc9b07a2e | |||
| a4f29eb509 | |||
| 570aac5399 | |||
| cb8926155c | |||
| c8f0338ae1 | |||
| 20a19b3245 | |||
| 07900daa07 | |||
| ae0ff4f405 | |||
| 8f2e08758d | |||
| a9d1b557ed | |||
| e81a31f638 | |||
| a01202aaa7 | |||
| 81b94827ee | |||
| d8bc205b75 | |||
| 77b5fd9a5d | |||
| d64ba16bbf | |||
| c6b3d2f688 | |||
| 344f88cb05 | |||
| 1e2806095c | |||
| 2db76146a7 | |||
| 6b3fefa166 | |||
| f7111e00a4 | |||
| 8fc35c5981 | |||
| 987ec6d705 | |||
| 1d80800838 | |||
| d8d521150d | |||
| 766f787d84 | |||
| e13e09b888 | |||
| a52eb0d4b9 | |||
| 8458569bda | |||
| 6e187c3b0e | |||
| de8de44276 | |||
| a019468c4a | |||
| 9b20f21792 | |||
| dcb8738f55 | |||
| 5c0cc8dc8a | |||
| 46cd5a3809 | |||
| bc5c7f80df | |||
| 914520becb | |||
| ecce035d2d | |||
| a00912ba77 | |||
| 18952f7a4b | |||
| c47bbd0cfe | |||
| 9364930948 | |||
| 71d47a137d | |||
| de1abd6719 | |||
| 0d5ec23d1f | |||
| 506dc005f4 | |||
| 754d82428f | |||
| 81fcd18e8d | |||
| 3a41e39de8 | |||
| 1d074847b6 | |||
| 83badab7c0 | |||
| 2f49c0979f | |||
| c0d54e0a49 | |||
| 5b9cfb2d32 | |||
| 44783edf98 | |||
| 09dd45aa7a | |||
| fe085edd79 | |||
| cba832d1e6 | |||
| 58d028b4ba | |||
| e6f9974235 | |||
| 0793fcccca | |||
| 9d5b46196e | |||
| 1ccdc547a9 | |||
| 5de0153a36 | |||
| 639546574e | |||
| 882ba47de7 | |||
| ad6353995e | |||
| a95fa37d3e | |||
| 56d6a02b1b | |||
| b14a90946b | |||
| adf84d0ecf | |||
| 64c79f51db | |||
| 3bb9491fba | |||
| 046f0384f4 | |||
| 279a2c3fb2 | |||
| fa62b41622 | |||
| dfac3dbe27 | |||
| 3cdbd61e9c | |||
| ee3e46d8d1 | |||
| aeab707a92 | |||
| 0cf4b544f0 | |||
| 5129e62ed2 | |||
| fe76983fd3 | |||
| 394f74cf9e | |||
| 6d621563aa | |||
| fbbe82ebfd | |||
| fb98d8611a | |||
| 74f63c8293 | |||
| 5511405272 | |||
| 398076fdde | |||
| 0974cab1a4 | |||
| d615b466d7 | |||
| 3fa1f515ee | |||
| 7d9855c849 | |||
| 51deef0dcd | |||
| 2e068fe4a8 | |||
| 7fb4ac2634 | |||
| 497600f8d0 | |||
| 6b1e7a3546 | |||
| 8af35dc211 | |||
| 877e77c09d | |||
| 5a179983a2 | |||
| 41f7c5f6c5 | |||
| 0a61c568a6 | |||
| a22a43b927 | |||
| 3ee4ffc404 | |||
| f5d13554ec | |||
| 57e0e6e769 | |||
| 31376b12ad | |||
| c96fe6b32e | |||
| c06f24122b | |||
| 88dc25d151 | |||
| ad7e780a1f | |||
| 4d5135ac4b | |||
| a00268b5ed | |||
| c31af916bc | |||
| 25b39419fd | |||
| 18bdc5c551 | |||
| 3c8404fd09 | |||
| 7f8c5bcd85 | |||
| b2fe784efd | |||
| ddbcc0b3d5 | |||
| 87953bf330 | |||
| 9e267241fe | |||
| 8fe6438ca8 | |||
| 855634a670 | |||
| 194902fb90 | |||
| b221137067 | |||
| 2be012c9c6 | |||
| 3e6f7cfc53 | |||
| 8714208cfb | |||
| 0ddacad17a | |||
| 73af68afc5 | |||
| 365230d313 | |||
| 898a57ca29 | |||
| c2ae76dd77 | |||
| 02d6b1dd51 | |||
| bcdc681755 | |||
| d8ed961e35 | |||
| 73132b3743 | |||
| 6da987a91b | |||
| 7fd0a19ed7 | |||
| 5922dd75bf | |||
| f99c270091 | |||
| 7fcf092632 | |||
| 93db713b0e | |||
| 1571a4817f | |||
| 9fd20de4b8 | |||
| a4d95722e2 | |||
| 59da0af311 | |||
| 7fbae8a314 | |||
| 8913921f5b | |||
| da88c7a6d3 | |||
| 002fcacd57 | |||
| 0c14bcb0d9 | |||
| bfe8b89da1 | |||
| eb4a62f945 | |||
| 40c4f6585b | |||
| 75d970afda | |||
| 655508d68e | |||
| c66e4b4772 | |||
| 2e3d9dadda | |||
| bfe4c724b4 | |||
| ff659b1352 | |||
| b06edfcb97 | |||
| d1d9a17a98 | |||
| 67c24b5749 | |||
| 426ff82c87 | |||
| 22e8085394 | |||
| b522212d71 | |||
| 6146311a94 | |||
| 68b5d8dbca | |||
| 3a424136ff | |||
| 67682e2bb3 | |||
| 65b1048463 | |||
| 6975093d6e | |||
| 2893474ab2 | |||
| 4430a1cce9 | |||
| 75b912b173 | |||
| 01ae4db181 | |||
| 8303a55092 | |||
| 9c7f869e3b | |||
| fdb3dd9de4 | |||
| 014ed4ccc5 | |||
| e51acb490c | |||
| 58c9ed6028 | |||
| bb55fe76db | |||
| 451d95d04a | |||
| c00740aa15 | |||
| 25ea7e41a6 | |||
| 191c95c0ea | |||
| f5096a17e2 | |||
| 130da19292 | |||
| 5df4501ccc | |||
| 919e31ea27 | |||
| 60499ffcd4 | |||
| 8811dc4a48 | |||
| 86686ab7ed | |||
| 55bcd7bf19 | |||
| 264227ae7b | |||
| 67cafa1453 | |||
| a181437a71 | |||
| 390461c581 | |||
| c1b350f117 | |||
| d5404eed47 | |||
| 75186322eb | |||
| 93fe24201a | |||
| 9d729cf114 | |||
| 0d10011b38 | |||
| f81f9e3bab | |||
| 4b092abdb0 | |||
| 341e017960 | |||
| aae0a70bb6 | |||
| ff1e67b44d | |||
| a3e00bd73e | |||
| 28773a081c | |||
| 632ac1521a | |||
| 53977e0220 | |||
| 6ba6463107 | |||
| 9cfbdbe96c | |||
| 7a9a7544ea | |||
| a1d57f9877 | |||
| 5bea268817 | |||
| add9dd377b | |||
| 6fd477d34b | |||
| 3b6a83e1b4 | |||
| 777bafbc1c | |||
| 03ad5fd551 | |||
| 25865955b1 | |||
| a5860ad542 | |||
| ca013f6af7 | |||
| 85c8aeb40c | |||
| 8c376a89f2 | |||
| 39fd2593c1 | |||
| fdeee21237 | |||
| 58a87e1ca4 | |||
| 34e60c6731 | |||
| fc33aed8c1 | |||
| 8ad3fc8ccc | |||
| a64469320c | |||
| 96ea0d266a | |||
| 832100482c | |||
| f9f753e321 | |||
| fb223c2587 | |||
| c98a03ecc6 | |||
| 7f39542a73 | |||
| cc3d165ed8 | |||
| 58d27e220f | |||
| 3b5dd5b852 | |||
| d385cbece7 | |||
| 98897fb356 | |||
| 8b433990ad | |||
| 0e7449aef1 | |||
| feab004970 | |||
| 136eb1d17a | |||
| 50f112eaff | |||
| a7dbbd5f21 | |||
| 89ecdae088 | |||
| 13c4de32f2 | |||
| abc61d3e14 | |||
| 6be3aef0e2 | |||
| 8cd18ce93e | |||
| 7979e8c639 | |||
| e0a8a7f306 | |||
| 233685616d | |||
| 22c971499a | |||
| e2ed278874 | |||
| c97f1afd72 | |||
| 8d5f274d03 | |||
| bd2a9b259d | |||
| c68d109db1 | |||
| c1bea323d2 | |||
| 179329d1ba | |||
| b0e55b69ed | |||
| fc13b150d5 | |||
| 9e3618005e | |||
| fcba255925 | |||
| f6e1aeabe3 | |||
| bbc5ca8a74 | |||
| 0e304cd22b | |||
| cc55bf7d83 | |||
| 9833f3fd99 | |||
| 6cd575600c | |||
| 23f39ad2da | |||
| 3dadeab9e0 | |||
| 1861868428 | |||
| 3ce1ce70c9 | |||
| 6e77b5ae3f | |||
| ebed2d0b33 | |||
| 74bbc3e1db | |||
| 020375256c | |||
| 323acb01cf | |||
| 8bb7cfe780 | |||
| d25478bb35 | |||
| ed94b600ca | |||
| ee78a3c046 | |||
| 6a44d1e8ff | |||
| cc90163850 | |||
| da1e2c22de | |||
| ed7c650f48 | |||
| ad181ce993 | |||
| c91c096235 | |||
| c06f0e9132 | |||
| 5930aac110 | |||
| 1d55d10a51 | |||
| 9a51cd0e34 | |||
| a0e5012ed0 | |||
| ad2c36b351 | |||
| 4c74687a6d | |||
| 0d510a837f | |||
| c219656919 | |||
| bb6ab2d7c2 | |||
| ebb5a2bdc6 | |||
| 7547f6c79b | |||
| f4bf59e000 | |||
| 79df3ea2eb | |||
| d0c9fec938 | |||
| de5e7f35e1 | |||
| a015548a88 | |||
| 8a56db68e7 | |||
| 3f2df77d3f | |||
| bb51742f33 | |||
| d07ca8c3b6 | |||
| 763ba9e149 | |||
| c62f6a7e4c | |||
| 3e375b6528 | |||
| 0a5a1803a5 | |||
| be9218a76a | |||
| e3865d5121 | |||
| 66d6379f7e | |||
| c7c9f630b3 | |||
| 6f0e049638 | |||
| 28f730a81e | |||
| 637472f105 | |||
| bd3d6aa3ed | |||
| bcd43070b3 | |||
| c6ab0be18e | |||
| 668570fc85 | |||
| 3c565e1307 | |||
| 68e337670e | |||
| 3158be46ad | |||
| 02b66ca461 | |||
| 74c2ad4bf0 | |||
| 522c91ce79 | |||
| e8d65c22d6 | |||
| 166eee5eed | |||
| 3af54a7dda | |||
| 7fa294fd7a | |||
| 7400b11870 | |||
| 915371aa70 | |||
| 7b225789da | |||
| c0cccf7f7e | |||
| 5219718eb0 | |||
| 4b1004b33a | |||
| 9aa14b36a3 | |||
| 876ef07480 | |||
| 9e68e5f290 | |||
| 27a36156f6 | |||
| 09f1b14cc9 | |||
| e0487b62a6 | |||
| 741fdc53c7 | |||
| 832f181ec0 | |||
| 2a8f85d95c | |||
| 227e568b4f | |||
| f0e735ed33 | |||
| ebd1afc5d9 | |||
| 9065058265 | |||
| 0a79760745 | |||
| ac3390de12 | |||
| c2cfccf268 | |||
| 505de3215b | |||
| 4f91499ada | |||
| 4813e30703 | |||
| 8bbf9b8347 | |||
| 3528c626e7 | |||
| a06cc956c5 | |||
| e2856395a3 | |||
| a3a97d7b5e | |||
| 0c43dab796 | |||
| 298fb8983d | |||
| 75546946db | |||
| 4d19e611f8 | |||
| 47a5a6302e | |||
| 7b0b83a2e4 | |||
| d81b016b2a | |||
| 5a432fe9ac | |||
| e6a6d838a6 | |||
| f3a8edcb5e | |||
| baa1105a53 | |||
| 6c1c63cffe | |||
| 9ef72fcd06 | |||
| 7521cfc7a0 | |||
| 6d23205704 | |||
| 30706f4d0f | |||
| 6a877f7e29 | |||
| 007a5b351a | |||
| 9010b88b22 | |||
| a106f55ebe | |||
| b8434f2ddc | |||
| 6e587d130d | |||
| 38ec63cba1 | |||
| fbb5555f27 | |||
| 9b5aabe458 | |||
| 9dc93b8f99 | |||
| c8337118ba | |||
| d13ecc1efa | |||
| 1b65b3f600 | |||
| f89f032231 | |||
| 083a27dc68 | |||
| d4c180e953 | |||
| fdaca02994 | |||
| 4c3c23776d | |||
| 19ffd1ca94 | |||
| fa9c78611e | |||
| 825d95314e | |||
| 10c6d6eabf | |||
| b54b3e6e32 | |||
| 6bb6bb4d24 | |||
| 8fb5ce3c43 | |||
| 43a14ab4df | |||
| dd00c46a8c | |||
| 10edc03ec1 | |||
| 53e02bc851 | |||
| d17954276c | |||
| c4fec57368 | |||
| d8bf4dfeb9 | |||
| 7225e5f0ba | |||
| 68e8c19aaf | |||
| 8d5a957eb0 | |||
| e5fb5a6f27 | |||
| ecb1b3c3cc | |||
| 9a4ab21f2b | |||
| 9d7b7af48c | |||
| 28c269cc5f | |||
| 0f9ea612b6 | |||
| 4148a33d15 | |||
| d7d22b1e7e | |||
| 5864e17d9d | |||
| 920e8e0469 | |||
| c9cffae11d | |||
| c143d91978 | |||
| f401cbe832 | |||
| 2e4dcfc22a | |||
| b06f247f9f | |||
| e05e9a7247 | |||
| 5792c502bf | |||
| ef1a835f4f | |||
| 18eb44d120 | |||
| d0323e13c1 | |||
| f31544dca8 | |||
| f256e3caf4 | |||
| 0c6c3e5211 | |||
| 9570d88a39 | |||
| 6449e1bcf7 | |||
| 47bb1408da | |||
| 77627bbc23 | |||
| b9b21ddac5 | |||
| 242083bbf7 | |||
| eff8ecaafc | |||
| 80bdc3f960 | |||
| b4489422a5 | |||
| 8349a78dde | |||
| fd47f2253a | |||
| 3cccd4d69e | |||
| 721f253c59 | |||
| 29cc754cfd | |||
| af811b34b3 | |||
| 07422d2abe | |||
| 6462cdf231 | |||
| 9156d591c9 | |||
| 4223e5d84d | |||
| 7955c0dfac | |||
| 681d961254 | |||
| 332cb9ec2f | |||
| 34300c600f | |||
| f7c64c7322 | |||
| 7e638a624e | |||
| b5b5375fe4 | |||
| 23d65cc9f2 | |||
| 75a8998432 | |||
| 6e97e9570c | |||
| 27e3f3c153 | |||
| a42e1b0223 | |||
| 176cf0d144 | |||
| 4d7e550d97 | |||
| 3fe354718c | |||
| 8567ef1849 | |||
| 67c506d39e | |||
| 9c8b21f5f4 | |||
| f37574e809 | |||
| 0d6b5b7f30 | |||
| f7f85464a3 | |||
| 31047be9fb | |||
| ca9355b5cb | |||
| fc7f3f4e3d | |||
| 704feadc7c | |||
| e41879c6ea | |||
| 2b0dd54fe7 | |||
| d73f9e3762 | |||
| 134fa8b7ea | |||
| e8f1bde367 | |||
| 2d32de3cd2 | |||
| 56d289997c | |||
| 4dab407fbe | |||
| 34502193a2 | |||
| d540de8bee | |||
| acfbc72f50 | |||
| 3c1e446c2f | |||
| 2d5400f923 | |||
| be16e1f52b | |||
| be8a4037db | |||
| 977127012e | |||
| 89432a969d | |||
| 7b204c01db | |||
| ee4f4e8cb7 | |||
| 297e3520ec | |||
| 8891394d5a | |||
| d223d4362c | |||
| 213bf1ec61 | |||
| d860c4bb2d | |||
| a0c0b2616c | |||
| 07e38636b9 | |||
| a4b2bf584d | |||
| 477eed10a4 | |||
| 9946a3916e | |||
| a67701b85b | |||
| 2de25dd04e | |||
| 3f04bf7b4d | |||
| 8c123bad50 | |||
| eda43a2ef9 | |||
| 81d6401455 | |||
| 5542bc9970 | |||
| 3dfb51d3ee | |||
| 79a5cde3b5 | |||
| 33556d8a56 | |||
| b8952aaeb8 | |||
| 819cfd7a11 | |||
| d447d75882 | |||
| d920a5bf4d | |||
| 35c872d4f2 | |||
| 98cb5d50af | |||
| 62f65e12e2 | |||
| f7b9a70ee5 | |||
| 03f3852617 | |||
| 537acfdddd | |||
| 307cb3cda8 | |||
| 0b574523e9 | |||
| 8edb3e64cc | |||
| e13e3bcea3 | |||
| c2e34be393 | |||
| c5296fbb92 | |||
| 1723196166 | |||
| 37d2492719 | |||
| 47125d8fda | |||
| d3d96816ce | |||
| 7907b0f8b3 | |||
| c4cd127499 | |||
| 919271ed5e | |||
| 79c218ad9a | |||
| 7b79c9697c | |||
| 30f8015e71 | |||
| f94ab3ec84 | |||
| b47f8d2605 | |||
| 8e1a23eadf | |||
| 391c9a6bbf | |||
| bf6dbd4606 | |||
| 8676d67a87 | |||
| a80d9e5ef8 | |||
| b07be87677 | |||
| bd853e5ef2 | |||
| 4c2972cb23 | |||
| 975b8eac52 | |||
| 836c6b889a | |||
| 4474db7f50 | |||
| ccdbf99341 | |||
| 18120f8bcd | |||
| a21a5a2032 | |||
| 5ae3a0866e | |||
| 07d7ced8ec | |||
| 7630ee024b |
@@ -0,0 +1,66 @@
|
||||
# Generated from CLion C/C++ Code Style settings
|
||||
BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: None
|
||||
AlignOperands: DontAlign
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowAllConstructorInitializersOnNextLine: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Always
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: true
|
||||
AfterControlStatement: Never
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterUnion: true
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: true
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakInheritanceList: BeforeColon
|
||||
ColumnLimit: 100
|
||||
CompactNamespaces: false
|
||||
ContinuationIndentWidth: 4
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 4
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: None
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PointerAlignment: Left
|
||||
ReflowComments: false
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 0
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
+491
@@ -0,0 +1,491 @@
|
||||
---
|
||||
Checks: 'clang-diagnostic-*,clang-analyzer-*,boost-*,bugprone-*,
|
||||
performance-*,readability-*,portability-*,modernize-*,cppcoreguidelines-*,
|
||||
concurrency-*,-modernize-use-trailing-return-type, -modernize-use-nodiscard,
|
||||
-readability-redundant-access-specifiers'
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: ''
|
||||
AnalyzeTemporaryDtors: false
|
||||
FormatStyle: file
|
||||
User: florians
|
||||
CheckOptions:
|
||||
- key: readability-suspicious-call-argument.PrefixSimilarAbove
|
||||
value: '30'
|
||||
- key: cppcoreguidelines-no-malloc.Reallocations
|
||||
value: '::realloc'
|
||||
- key: cppcoreguidelines-owning-memory.LegacyResourceConsumers
|
||||
value: '::free;::realloc;::freopen;::fclose'
|
||||
- key: bugprone-reserved-identifier.Invert
|
||||
value: 'false'
|
||||
- key: bugprone-narrowing-conversions.PedanticMode
|
||||
value: 'false'
|
||||
- key: bugprone-unused-return-value.CheckedFunctions
|
||||
value: '::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty;::std::back_inserter;::std::distance;::std::find;::std::find_if;::std::inserter;::std::lower_bound;::std::make_pair;::std::map::count;::std::map::find;::std::map::lower_bound;::std::multimap::equal_range;::std::multimap::upper_bound;::std::set::count;::std::set::find;::std::setfill;::std::setprecision;::std::setw;::std::upper_bound;::std::vector::at;::bsearch;::ferror;::feof;::isalnum;::isalpha;::isblank;::iscntrl;::isdigit;::isgraph;::islower;::isprint;::ispunct;::isspace;::isupper;::iswalnum;::iswprint;::iswspace;::isxdigit;::memchr;::memcmp;::strcmp;::strcoll;::strncmp;::strpbrk;::strrchr;::strspn;::strstr;::wcscmp;::access;::bind;::connect;::difftime;::dlsym;::fnmatch;::getaddrinfo;::getopt;::htonl;::htons;::iconv_open;::inet_addr;::isascii;::isatty;::mmap;::newlocale;::openat;::pathconf;::pthread_equal;::pthread_getspecific;::pthread_mutex_trylock;::readdir;::readlink;::recvmsg;::regexec;::scandir;::semget;::setjmp;::shm_open;::shmget;::sigismember;::strcasecmp;::strsignal;::ttyname'
|
||||
- key: modernize-use-auto.MinTypeNameLength
|
||||
value: '5'
|
||||
- key: cppcoreguidelines-macro-usage.CheckCapsOnly
|
||||
value: 'false'
|
||||
- key: readability-inconsistent-declaration-parameter-name.Strict
|
||||
value: 'false'
|
||||
- key: readability-suspicious-call-argument.DiceDissimilarBelow
|
||||
value: '60'
|
||||
- key: bugprone-assert-side-effect.IgnoredFunctions
|
||||
value: __builtin_expect
|
||||
- key: readability-suspicious-call-argument.Equality
|
||||
value: 'true'
|
||||
- key: bugprone-easily-swappable-parameters.QualifiersMix
|
||||
value: 'false'
|
||||
- key: bugprone-suspicious-string-compare.WarnOnImplicitComparison
|
||||
value: 'true'
|
||||
- key: bugprone-argument-comment.CommentNullPtrs
|
||||
value: '0'
|
||||
- key: cppcoreguidelines-narrowing-conversions.WarnOnFloatingPointNarrowingConversion
|
||||
value: 'true'
|
||||
- key: cppcoreguidelines-init-variables.IncludeStyle
|
||||
value: llvm
|
||||
- key: modernize-use-nodiscard.ReplacementString
|
||||
value: '[[nodiscard]]'
|
||||
- key: modernize-loop-convert.MakeReverseRangeHeader
|
||||
value: ''
|
||||
- key: readability-suspicious-call-argument.SuffixSimilarAbove
|
||||
value: '30'
|
||||
- key: cppcoreguidelines-narrowing-conversions.WarnOnIntegerNarrowingConversion
|
||||
value: 'true'
|
||||
- key: bugprone-easily-swappable-parameters.IgnoredParameterNames
|
||||
value: '"";iterator;Iterator;begin;Begin;end;End;first;First;last;Last;lhs;LHS;rhs;RHS'
|
||||
- key: modernize-loop-convert.UseCxx20ReverseRanges
|
||||
value: 'true'
|
||||
- key: cppcoreguidelines-prefer-member-initializer.UseAssignment
|
||||
value: 'false'
|
||||
- key: performance-type-promotion-in-math-fn.IncludeStyle
|
||||
value: llvm
|
||||
- key: readability-function-cognitive-complexity.DescribeBasicIncrements
|
||||
value: 'true'
|
||||
- key: bugprone-suspicious-include.ImplementationFileExtensions
|
||||
value: 'c;cc;cpp;cxx'
|
||||
- key: modernize-loop-convert.MakeReverseRangeFunction
|
||||
value: ''
|
||||
- key: readability-inconsistent-declaration-parameter-name.IgnoreMacros
|
||||
value: 'true'
|
||||
- key: bugprone-suspicious-missing-comma.SizeThreshold
|
||||
value: '5'
|
||||
- key: readability-identifier-naming.IgnoreFailedSplit
|
||||
value: 'false'
|
||||
- key: readability-qualified-auto.AddConstToQualified
|
||||
value: 'true'
|
||||
- key: bugprone-sizeof-expression.WarnOnSizeOfThis
|
||||
value: 'true'
|
||||
- key: bugprone-string-constructor.WarnOnLargeLength
|
||||
value: 'true'
|
||||
- key: cppcoreguidelines-explicit-virtual-functions.OverrideSpelling
|
||||
value: override
|
||||
- key: readability-uppercase-literal-suffix.IgnoreMacros
|
||||
value: 'true'
|
||||
- key: modernize-make-shared.IgnoreMacros
|
||||
value: 'true'
|
||||
- key: bugprone-dynamic-static-initializers.HeaderFileExtensions
|
||||
value: ';h;hh;hpp;hxx'
|
||||
- key: bugprone-suspicious-enum-usage.StrictMode
|
||||
value: 'false'
|
||||
- key: performance-unnecessary-copy-initialization.AllowedTypes
|
||||
value: ''
|
||||
- key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens
|
||||
value: '5'
|
||||
- key: modernize-use-transparent-functors.SafeMode
|
||||
value: 'false'
|
||||
- key: readability-suspicious-call-argument.Levenshtein
|
||||
value: 'true'
|
||||
- key: bugprone-not-null-terminated-result.WantToUseSafeFunctions
|
||||
value: 'true'
|
||||
- key: bugprone-string-constructor.LargeLengthThreshold
|
||||
value: '8388608'
|
||||
- key: readability-simplify-boolean-expr.ChainedConditionalAssignment
|
||||
value: 'false'
|
||||
- key: cppcoreguidelines-avoid-magic-numbers.IgnoreAllFloatingPointValues
|
||||
value: 'false'
|
||||
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
|
||||
value: 'false'
|
||||
- key: bugprone-exception-escape.FunctionsThatShouldNotThrow
|
||||
value: ''
|
||||
- key: performance-inefficient-vector-operation.EnableProto
|
||||
value: 'false'
|
||||
- key: modernize-make-shared.MakeSmartPtrFunction
|
||||
value: 'std::make_shared'
|
||||
- key: modernize-loop-convert.MaxCopySize
|
||||
value: '16'
|
||||
- key: readability-suspicious-call-argument.PrefixDissimilarBelow
|
||||
value: '25'
|
||||
- key: readability-function-size.LineThreshold
|
||||
value: '4294967295'
|
||||
- key: bugprone-easily-swappable-parameters.MinimumLength
|
||||
value: '2'
|
||||
- key: portability-simd-intrinsics.Suggest
|
||||
value: 'false'
|
||||
- key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader
|
||||
value: ''
|
||||
- key: modernize-use-override.IgnoreDestructors
|
||||
value: 'false'
|
||||
- key: modernize-make-shared.MakeSmartPtrFunctionHeader
|
||||
value: '<memory>'
|
||||
- key: bugprone-sizeof-expression.WarnOnSizeOfConstant
|
||||
value: 'true'
|
||||
- key: readability-redundant-string-init.StringNames
|
||||
value: '::std::basic_string_view;::std::basic_string'
|
||||
- key: modernize-make-unique.IgnoreDefaultInitialization
|
||||
value: 'true'
|
||||
- key: modernize-use-emplace.ContainersWithPushBack
|
||||
value: '::std::vector;::std::list;::std::deque'
|
||||
- key: readability-magic-numbers.IgnoreBitFieldsWidths
|
||||
value: 'true'
|
||||
- key: modernize-make-unique.IncludeStyle
|
||||
value: llvm
|
||||
- key: modernize-use-override.OverrideSpelling
|
||||
value: override
|
||||
- key: readability-suspicious-call-argument.LevenshteinDissimilarBelow
|
||||
value: '50'
|
||||
- key: bugprone-argument-comment.CommentStringLiterals
|
||||
value: '0'
|
||||
- key: concurrency-mt-unsafe.FunctionSet
|
||||
value: any
|
||||
- key: readability-identifier-length.IgnoredExceptionVariableNames
|
||||
value: '^[e]$'
|
||||
- key: google-readability-braces-around-statements.ShortStatementLines
|
||||
value: '1'
|
||||
- key: bugprone-reserved-identifier.AllowedIdentifiers
|
||||
value: ''
|
||||
- key: cppcoreguidelines-pro-type-member-init.IgnoreArrays
|
||||
value: 'false'
|
||||
- key: readability-else-after-return.WarnOnUnfixable
|
||||
value: 'true'
|
||||
- key: cppcoreguidelines-avoid-magic-numbers.IgnoredFloatingPointValues
|
||||
value: '1.0;100.0;'
|
||||
- key: modernize-use-emplace.IgnoreImplicitConstructors
|
||||
value: 'false'
|
||||
- key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros
|
||||
value: 'true'
|
||||
- key: readability-suspicious-call-argument.Substring
|
||||
value: 'true'
|
||||
- key: modernize-use-equals-delete.IgnoreMacros
|
||||
value: 'true'
|
||||
- key: readability-identifier-length.IgnoredVariableNames
|
||||
value: ''
|
||||
- key: readability-magic-numbers.IgnoreAllFloatingPointValues
|
||||
value: 'false'
|
||||
- key: cppcoreguidelines-pro-bounds-constant-array-index.IncludeStyle
|
||||
value: llvm
|
||||
- key: readability-suspicious-call-argument.Abbreviations
|
||||
value: 'arr=array;cnt=count;idx=index;src=source;stmt=statement;cpy=copy;dest=destination;dist=distancedst=distance;ptr=pointer;wdth=width;str=string;ln=line;srv=server;attr=attribute;ref=reference;buf=buffer;col=column;nr=number;vec=vector;len=length;elem=element;val=value;i=index;var=variable;hght=height;cl=client;num=number;pos=position;lst=list;addr=address'
|
||||
- key: bugprone-misplaced-widening-cast.CheckImplicitCasts
|
||||
value: 'false'
|
||||
- key: readability-uppercase-literal-suffix.NewSuffixes
|
||||
value: ''
|
||||
- key: modernize-loop-convert.MinConfidence
|
||||
value: reasonable
|
||||
- key: performance-unnecessary-value-param.AllowedTypes
|
||||
value: ''
|
||||
- key: readability-uniqueptr-delete-release.PreferResetCall
|
||||
value: 'false'
|
||||
- key: readability-identifier-length.MinimumExceptionNameLength
|
||||
value: '2'
|
||||
- key: cppcoreguidelines-avoid-magic-numbers.IgnorePowersOf2IntegerValues
|
||||
value: 'false'
|
||||
- key: google-readability-namespace-comments.SpacesBeforeComments
|
||||
value: '2'
|
||||
- key: cppcoreguidelines-avoid-magic-numbers.IgnoreBitFieldsWidths
|
||||
value: 'true'
|
||||
- key: cppcoreguidelines-avoid-magic-numbers.IgnoredIntegerValues
|
||||
value: '1;2;3;4;'
|
||||
- key: cppcoreguidelines-no-malloc.Allocations
|
||||
value: '::malloc;::calloc'
|
||||
- key: bugprone-narrowing-conversions.IgnoreConversionFromTypes
|
||||
value: ''
|
||||
- key: readability-function-size.BranchThreshold
|
||||
value: '4294967295'
|
||||
- key: bugprone-suspicious-missing-comma.RatioThreshold
|
||||
value: '0.200000'
|
||||
- key: readability-implicit-bool-conversion.AllowIntegerConditions
|
||||
value: 'false'
|
||||
- key: readability-identifier-length.IgnoredParameterNames
|
||||
value: '^[n]$'
|
||||
- key: readability-function-size.StatementThreshold
|
||||
value: '800'
|
||||
- key: readability-identifier-naming.IgnoreMainLikeFunctions
|
||||
value: 'false'
|
||||
- key: cppcoreguidelines-init-variables.MathHeader
|
||||
value: '<math.h>'
|
||||
- key: google-readability-function-size.StatementThreshold
|
||||
value: '800'
|
||||
- key: bugprone-reserved-identifier.AggressiveDependentMemberLookup
|
||||
value: 'false'
|
||||
- key: readability-suspicious-call-argument.DiceSimilarAbove
|
||||
value: '70'
|
||||
- key: modernize-use-equals-default.IgnoreMacros
|
||||
value: 'true'
|
||||
- key: readability-suspicious-call-argument.Abbreviation
|
||||
value: 'true'
|
||||
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
|
||||
value: 'false'
|
||||
- key: readability-identifier-length.MinimumLoopCounterNameLength
|
||||
value: '2'
|
||||
- key: modernize-use-emplace.SmartPointers
|
||||
value: '::std::shared_ptr;::std::unique_ptr;::std::auto_ptr;::std::weak_ptr'
|
||||
- key: cppcoreguidelines-no-malloc.Deallocations
|
||||
value: '::free'
|
||||
- key: bugprone-dangling-handle.HandleClasses
|
||||
value: 'std::basic_string_view;std::experimental::basic_string_view'
|
||||
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
|
||||
value: 'false'
|
||||
- key: readability-suspicious-call-argument.JaroWinklerSimilarAbove
|
||||
value: '85'
|
||||
- key: readability-simplify-subscript-expr.Types
|
||||
value: '::std::basic_string;::std::basic_string_view;::std::vector;::std::array'
|
||||
- key: performance-unnecessary-copy-initialization.ExcludedContainerTypes
|
||||
value: ''
|
||||
- key: modernize-replace-auto-ptr.IncludeStyle
|
||||
value: llvm
|
||||
- key: performance-move-const-arg.CheckTriviallyCopyableMove
|
||||
value: 'true'
|
||||
- key: readability-static-accessed-through-instance.NameSpecifierNestingThreshold
|
||||
value: '3'
|
||||
- key: readability-function-size.VariableThreshold
|
||||
value: '4294967295'
|
||||
- key: cert-dcl16-c.NewSuffixes
|
||||
value: 'L;LL;LU;LLU'
|
||||
- key: bugprone-narrowing-conversions.WarnOnFloatingPointNarrowingConversion
|
||||
value: 'true'
|
||||
- key: readability-identifier-naming.GetConfigPerFile
|
||||
value: 'true'
|
||||
- key: modernize-use-default-member-init.UseAssignment
|
||||
value: 'false'
|
||||
- key: readability-function-size.NestingThreshold
|
||||
value: '4294967295'
|
||||
- key: modernize-use-override.AllowOverrideAndFinal
|
||||
value: 'false'
|
||||
- key: cppcoreguidelines-narrowing-conversions.IgnoreConversionFromTypes
|
||||
value: ''
|
||||
- key: readability-function-size.ParameterThreshold
|
||||
value: '4294967295'
|
||||
- key: modernize-pass-by-value.ValuesOnly
|
||||
value: 'false'
|
||||
- key: readability-function-cognitive-complexity.IgnoreMacros
|
||||
value: 'false'
|
||||
- key: modernize-loop-convert.IncludeStyle
|
||||
value: llvm
|
||||
- key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons
|
||||
value: 'false'
|
||||
- key: bugprone-narrowing-conversions.WarnWithinTemplateInstantiation
|
||||
value: 'false'
|
||||
- key: cert-err33-c.CheckedFunctions
|
||||
value: '::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;'
|
||||
- key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison
|
||||
value: 'false'
|
||||
- key: readability-redundant-smartptr-get.IgnoreMacros
|
||||
value: 'true'
|
||||
- key: cppcoreguidelines-explicit-virtual-functions.AllowOverrideAndFinal
|
||||
value: 'false'
|
||||
- key: readability-identifier-naming.AggressiveDependentMemberLookup
|
||||
value: 'false'
|
||||
- key: readability-identifier-length.MinimumParameterNameLength
|
||||
value: '3'
|
||||
- key: modernize-use-emplace.TupleTypes
|
||||
value: '::std::pair;::std::tuple'
|
||||
- key: modernize-use-emplace.TupleMakeFunctions
|
||||
value: '::std::make_pair;::std::make_tuple'
|
||||
- key: bugprone-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion
|
||||
value: 'true'
|
||||
- key: cppcoreguidelines-owning-memory.LegacyResourceProducers
|
||||
value: '::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile'
|
||||
- key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether
|
||||
value: 'true'
|
||||
- key: bugprone-argument-comment.StrictMode
|
||||
value: '0'
|
||||
- key: modernize-replace-random-shuffle.IncludeStyle
|
||||
value: llvm
|
||||
- key: modernize-use-bool-literals.IgnoreMacros
|
||||
value: 'true'
|
||||
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField
|
||||
value: 'true'
|
||||
- key: google-readability-namespace-comments.ShortNamespaceLines
|
||||
value: '10'
|
||||
- key: bugprone-suspicious-string-compare.StringCompareLikeFunctions
|
||||
value: ''
|
||||
- key: modernize-avoid-bind.PermissiveParameterList
|
||||
value: 'false'
|
||||
- key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold
|
||||
value: '1'
|
||||
- key: readability-suspicious-call-argument.Suffix
|
||||
value: 'true'
|
||||
- key: readability-suspicious-call-argument.JaroWinklerDissimilarBelow
|
||||
value: '75'
|
||||
- key: modernize-use-noexcept.ReplacementString
|
||||
value: ''
|
||||
- key: modernize-use-override.FinalSpelling
|
||||
value: final
|
||||
- key: modernize-use-using.IgnoreMacros
|
||||
value: 'true'
|
||||
- key: cppcoreguidelines-explicit-virtual-functions.FinalSpelling
|
||||
value: final
|
||||
- key: readability-suspicious-call-argument.MinimumIdentifierNameLength
|
||||
value: '3'
|
||||
- key: bugprone-narrowing-conversions.WarnOnIntegerNarrowingConversion
|
||||
value: 'true'
|
||||
- key: modernize-loop-convert.NamingStyle
|
||||
value: CamelCase
|
||||
- key: cppcoreguidelines-pro-type-member-init.UseAssignment
|
||||
value: 'false'
|
||||
- key: bugprone-suspicious-include.HeaderFileExtensions
|
||||
value: ';h;hh;hpp;hxx'
|
||||
- key: performance-no-automatic-move.AllowedTypes
|
||||
value: ''
|
||||
- key: readability-suspicious-call-argument.SubstringDissimilarBelow
|
||||
value: '40'
|
||||
- key: bugprone-argument-comment.CommentIntegerLiterals
|
||||
value: '0'
|
||||
- key: bugprone-stringview-nullptr.IncludeStyle
|
||||
value: llvm
|
||||
- key: performance-for-range-copy.WarnOnAllAutoCopies
|
||||
value: 'false'
|
||||
- key: modernize-pass-by-value.IncludeStyle
|
||||
value: llvm
|
||||
- key: bugprone-argument-comment.CommentFloatLiterals
|
||||
value: '0'
|
||||
- key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit
|
||||
value: '16'
|
||||
- key: readability-simplify-boolean-expr.ChainedConditionalReturn
|
||||
value: 'false'
|
||||
- key: readability-else-after-return.WarnOnConditionVariables
|
||||
value: 'true'
|
||||
- key: modernize-use-nullptr.NullMacros
|
||||
value: 'NULL'
|
||||
- key: readability-suspicious-call-argument.SuffixDissimilarBelow
|
||||
value: '25'
|
||||
- key: bugprone-argument-comment.CommentCharacterLiterals
|
||||
value: '0'
|
||||
- key: cppcoreguidelines-macro-usage.AllowedRegexp
|
||||
value: '^DEBUG_*'
|
||||
- key: readability-suspicious-call-argument.LevenshteinSimilarAbove
|
||||
value: '66'
|
||||
- key: cppcoreguidelines-narrowing-conversions.PedanticMode
|
||||
value: 'false'
|
||||
- key: modernize-make-shared.IgnoreDefaultInitialization
|
||||
value: 'true'
|
||||
- key: readability-suspicious-call-argument.JaroWinkler
|
||||
value: 'true'
|
||||
- key: bugprone-implicit-widening-of-multiplication-result.UseCXXHeadersInCppSources
|
||||
value: 'true'
|
||||
- key: modernize-make-shared.IncludeStyle
|
||||
value: llvm
|
||||
- key: readability-suspicious-call-argument.Prefix
|
||||
value: 'true'
|
||||
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions
|
||||
value: 'false'
|
||||
- key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources
|
||||
value: 'true'
|
||||
- key: bugprone-signed-char-misuse.CharTypdefsToIgnore
|
||||
value: ''
|
||||
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
|
||||
value: 'false'
|
||||
- key: modernize-make-unique.IgnoreMacros
|
||||
value: 'true'
|
||||
- key: performance-for-range-copy.AllowedTypes
|
||||
value: ''
|
||||
- key: bugprone-argument-comment.CommentBoolLiterals
|
||||
value: '0'
|
||||
- key: readability-braces-around-statements.ShortStatementLines
|
||||
value: '0'
|
||||
- key: bugprone-argument-comment.CommentUserDefinedLiterals
|
||||
value: '0'
|
||||
- key: readability-magic-numbers.IgnoredFloatingPointValues
|
||||
value: '1.0;100.0;'
|
||||
- key: performance-inefficient-string-concatenation.StrictMode
|
||||
value: 'false'
|
||||
- key: readability-redundant-declaration.IgnoreMacros
|
||||
value: 'true'
|
||||
- key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes
|
||||
value: 'bool;Bool;_Bool;it;It;iterator;Iterator;inputit;InputIt;forwardit;ForwardIt;bidirit;BidirIt;constiterator;const_iterator;Const_Iterator;Constiterator;ConstIterator;RandomIt;randomit;random_iterator;ReverseIt;reverse_iterator;reverse_const_iterator;ConstReverseIterator;Const_Reverse_Iterator;const_reverse_iterator;Constreverseiterator;constreverseiterator'
|
||||
- key: modernize-make-unique.MakeSmartPtrFunction
|
||||
value: 'std::make_unique'
|
||||
- key: portability-restrict-system-includes.Includes
|
||||
value: '*'
|
||||
- key: readability-implicit-bool-conversion.AllowPointerConditions
|
||||
value: 'false'
|
||||
- key: modernize-make-unique.MakeSmartPtrFunctionHeader
|
||||
value: '<memory>'
|
||||
- key: bugprone-signal-handler.AsyncSafeFunctionSet
|
||||
value: POSIX
|
||||
- key: bugprone-easily-swappable-parameters.ModelImplicitConversions
|
||||
value: 'true'
|
||||
- key: readability-suspicious-call-argument.SubstringSimilarAbove
|
||||
value: '50'
|
||||
- key: cppcoreguidelines-narrowing-conversions.WarnWithinTemplateInstantiation
|
||||
value: 'false'
|
||||
- key: readability-identifier-length.MinimumVariableNameLength
|
||||
value: '3'
|
||||
- key: cppcoreguidelines-narrowing-conversions.WarnOnEquivalentBitWidth
|
||||
value: 'true'
|
||||
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnorePublicMemberVariables
|
||||
value: 'false'
|
||||
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted
|
||||
value: 'false'
|
||||
- key: modernize-use-noexcept.UseNoexceptFalse
|
||||
value: 'true'
|
||||
- key: readability-function-cognitive-complexity.Threshold
|
||||
value: '25'
|
||||
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
|
||||
value: 'true'
|
||||
- key: bugprone-argument-comment.IgnoreSingleArgument
|
||||
value: '0'
|
||||
- key: bugprone-narrowing-conversions.WarnOnEquivalentBitWidth
|
||||
value: 'true'
|
||||
- key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression
|
||||
value: 'false'
|
||||
- key: performance-faster-string-find.StringLikeClasses
|
||||
value: '::std::basic_string;::std::basic_string_view'
|
||||
- key: cppcoreguidelines-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion
|
||||
value: 'true'
|
||||
- key: bugprone-assert-side-effect.CheckFunctionCalls
|
||||
value: 'false'
|
||||
- key: bugprone-string-constructor.StringNames
|
||||
value: '::std::basic_string;::std::basic_string_view'
|
||||
- key: bugprone-assert-side-effect.AssertMacros
|
||||
value: assert,NSAssert,NSCAssert
|
||||
- key: bugprone-exception-escape.IgnoredExceptions
|
||||
value: ''
|
||||
- key: bugprone-signed-char-misuse.DiagnoseSignedUnsignedCharComparisons
|
||||
value: 'true'
|
||||
- key: modernize-use-default-member-init.IgnoreMacros
|
||||
value: 'true'
|
||||
- key: llvm-qualified-auto.AddConstToQualified
|
||||
value: 'false'
|
||||
- key: llvm-else-after-return.WarnOnConditionVariables
|
||||
value: 'false'
|
||||
- key: bugprone-sizeof-expression.WarnOnSizeOfCompareToConstant
|
||||
value: 'true'
|
||||
- key: modernize-raw-string-literal.DelimiterStem
|
||||
value: lit
|
||||
- key: readability-suspicious-call-argument.Dice
|
||||
value: 'true'
|
||||
- key: readability-identifier-length.IgnoredLoopCounterNames
|
||||
value: '^[ijk_]$'
|
||||
- key: modernize-raw-string-literal.ReplaceShorterLiterals
|
||||
value: 'false'
|
||||
- key: readability-magic-numbers.IgnoredIntegerValues
|
||||
value: '1;2;3;4;'
|
||||
- key: performance-inefficient-vector-operation.VectorLikeClasses
|
||||
value: '::std::vector'
|
||||
- key: modernize-use-auto.RemoveStars
|
||||
value: 'false'
|
||||
- key: bugprone-implicit-widening-of-multiplication-result.IncludeStyle
|
||||
value: llvm
|
||||
- key: portability-simd-intrinsics.Std
|
||||
value: ''
|
||||
- key: performance-unnecessary-value-param.IncludeStyle
|
||||
value: llvm
|
||||
- key: readability-redundant-member-init.IgnoreBaseInCopyConstructors
|
||||
value: 'false'
|
||||
- key: modernize-replace-disallow-copy-and-assign-macro.MacroName
|
||||
value: DISALLOW_COPY_AND_ASSIGN
|
||||
- key: llvm-else-after-return.WarnOnUnfixable
|
||||
value: 'false'
|
||||
...
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "black-warning",
|
||||
"severity": "warning",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(would reformat (.*))$",
|
||||
"file": 2,
|
||||
"message": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "clang",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(.+):([0-9]+):([0-9]+): (error|warning|note): (.+)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "codespell-matcher",
|
||||
"severity": "warning",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(.+):(\\d+):\\s+(.+)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"message": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "cpplint",
|
||||
"severity": "warning",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(.+):([0-9]+): (.+)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"message": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "grepMatcher-warning",
|
||||
"severity": "warning",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(.+):([0-9]+):(.+)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"message": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "pylint-error",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(.+?):([0-9]+):([0-9]+): ([([E|F][0-9]+): (.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"code": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "pylint-warning",
|
||||
"severity": "warning",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(.+?):([0-9]+):([0-9]+): ([^E|F][0-9]+): (.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"code": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,31 +0,0 @@
|
||||
# GitHub Action to automate the identification of common misspellings in text files.
|
||||
# https://github.com/codespell-project/actions-codespell
|
||||
# https://github.com/codespell-project/codespell
|
||||
|
||||
name: Codespell
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
codespell:
|
||||
name: Check for spelling errors
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
|
||||
- name: List all changed files
|
||||
run: |
|
||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||
echo "$file was changed"
|
||||
done
|
||||
|
||||
- uses: codespell-project/actions-codespell@master
|
||||
with:
|
||||
check_filenames: true
|
||||
ignore_words_file: .github/codespellignore
|
||||
skip: ./.git,*.po,*.ts,*.svg,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/
|
||||
path: ${{ steps.changed-files.outputs.all_changed_files }}
|
||||
+8
-4
@@ -1,5 +1,11 @@
|
||||
# file types to ignore
|
||||
|
||||
.*
|
||||
!/.gitignore
|
||||
!/.travis/
|
||||
!/.travis.yml
|
||||
!/.clang-format
|
||||
!/.git-blame-ignore-revs
|
||||
!/.gitattributes
|
||||
*.DS_Store
|
||||
*.pyc
|
||||
*.obj
|
||||
@@ -34,12 +40,10 @@ install_manifest.txt
|
||||
/src/Tools/offlinedoc/localwiki/
|
||||
/src/Tools/offlinedoc/*.txt
|
||||
OpenSCAD_rc.py
|
||||
/\.idea/
|
||||
.tags
|
||||
tags
|
||||
/\.vscode/
|
||||
|
||||
# crowdin file
|
||||
src/Tools/freecad.zip
|
||||
tsupdate_stderr.log
|
||||
tsupdate_stdout.log
|
||||
files_to_translate.txt
|
||||
|
||||
@@ -0,0 +1,614 @@
|
||||
[MAIN]
|
||||
|
||||
# Analyse import fallback blocks. This can be used to support both Python 2 and
|
||||
# 3 compatible code, which means that the block might have code that exists
|
||||
# only in one or another interpreter, leading to false positives when analysed.
|
||||
analyse-fallback-blocks=no
|
||||
|
||||
# Load and enable all available extensions. Use --list-extensions to see a list
|
||||
# all available extensions.
|
||||
#enable-all-extensions=
|
||||
|
||||
# In error mode, messages with a category besides ERROR or FATAL are
|
||||
# suppressed, and no reports are done by default. Error mode is compatible with
|
||||
# disabling specific errors.
|
||||
#errors-only=
|
||||
|
||||
# Always return a 0 (non-error) status code, even if lint errors are found.
|
||||
# This is primarily useful in continuous integration scripts.
|
||||
#exit-zero=
|
||||
|
||||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code.
|
||||
extension-pkg-allow-list=
|
||||
|
||||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
|
||||
# for backward compatibility.)
|
||||
extension-pkg-whitelist=
|
||||
|
||||
# Return non-zero exit code if any of these messages/categories are detected,
|
||||
# even if score is above --fail-under value. Syntax same as enable. Messages
|
||||
# specified are enabled, while categories only check already-enabled messages.
|
||||
fail-on=
|
||||
|
||||
# Specify a score threshold to be exceeded before program exits with error.
|
||||
fail-under=10
|
||||
|
||||
# Interpret the stdin as a python script, whose filename needs to be passed as
|
||||
# the module_or_package argument.
|
||||
#from-stdin=
|
||||
|
||||
# Files or directories to be skipped. They should be base names, not paths.
|
||||
ignore=CVS
|
||||
|
||||
# Add files or directories matching the regex patterns to the ignore-list. The
|
||||
# regex matches against paths and can be in Posix or Windows format.
|
||||
ignore-paths=
|
||||
|
||||
# Files or directories matching the regex patterns are skipped. The regex
|
||||
# matches against base names, not paths. The default value ignores Emacs file
|
||||
# locks
|
||||
ignore-patterns=^\.#
|
||||
|
||||
# List of module names for which member attributes should not be checked
|
||||
# (useful for modules/projects where namespaces are manipulated during runtime
|
||||
# and thus existing member attributes cannot be deduced by static analysis). It
|
||||
# supports qualified module names, as well as Unix pattern matching.
|
||||
ignored-modules=
|
||||
|
||||
# Python code to execute, usually for sys.path manipulation such as
|
||||
# pygtk.require().
|
||||
#init-hook=
|
||||
|
||||
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
|
||||
# number of processors available to use, and will cap the count on Windows to
|
||||
# avoid hangs.
|
||||
jobs=1
|
||||
|
||||
# Control the amount of potential inferred values when inferring a single
|
||||
# object. This can help the performance when dealing with large functions or
|
||||
# complex, nested conditions.
|
||||
limit-inference-results=100
|
||||
|
||||
# List of plugins (as comma separated values of python module names) to load,
|
||||
# usually to register additional checkers.
|
||||
load-plugins=
|
||||
|
||||
# Pickle collected data for later comparisons.
|
||||
persistent=yes
|
||||
|
||||
# Minimum Python version to use for version dependent checks. Will default to
|
||||
# the version used to run pylint.
|
||||
py-version=3.10
|
||||
|
||||
# Discover python modules and packages in the file system subtree.
|
||||
recursive=no
|
||||
|
||||
# When enabled, pylint would attempt to guess common misconfiguration and emit
|
||||
# user-friendly hints instead of false-positive error messages.
|
||||
suggestion-mode=yes
|
||||
|
||||
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
||||
# active Python interpreter and may run arbitrary code.
|
||||
unsafe-load-any-extension=no
|
||||
|
||||
# In verbose mode, extra non-checker-related info will be displayed.
|
||||
#verbose=
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
||||
# Python expression which should return a score less than or equal to 10. You
|
||||
# have access to the variables 'fatal', 'error', 'warning', 'refactor',
|
||||
# 'convention', and 'info' which contain the number of messages in each
|
||||
# category, as well as 'statement' which is the total number of statements
|
||||
# analyzed. This score is used by the global evaluation report (RP0004).
|
||||
evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))
|
||||
|
||||
# Template used to display messages. This is a python new-style format string
|
||||
# used to format the message information. See doc for all details.
|
||||
msg-template=
|
||||
|
||||
# Set the output format. Available formats are text, parseable, colorized, json
|
||||
# and msvs (visual studio). You can also give a reporter class, e.g.
|
||||
# mypackage.mymodule.MyReporterClass.
|
||||
#output-format=
|
||||
|
||||
# Tells whether to display a full report or only the messages.
|
||||
reports=yes
|
||||
|
||||
# Activate the evaluation score.
|
||||
score=yes
|
||||
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
# Only show warnings with the listed confidence levels. Leave empty to show
|
||||
# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
|
||||
# UNDEFINED.
|
||||
confidence=HIGH,
|
||||
CONTROL_FLOW,
|
||||
INFERENCE,
|
||||
INFERENCE_FAILURE,
|
||||
UNDEFINED
|
||||
|
||||
# Disable the message, report, category or checker with the given id(s). You
|
||||
# can either give multiple identifiers separated by comma (,) or put this
|
||||
# option multiple times (only on the command line, not in the configuration
|
||||
# file where it should appear only once). You can also use "--disable=all" to
|
||||
# disable everything first and then re-enable specific checks. For example, if
|
||||
# you want to run only the similarities checker, you can use "--disable=all
|
||||
# --enable=similarities". If you want to run only the classes checker, but have
|
||||
# no Warning level messages displayed, use "--disable=all --enable=classes
|
||||
# --disable=W".
|
||||
disable=raw-checker-failed,
|
||||
bad-inline-option,
|
||||
locally-disabled,
|
||||
file-ignored,
|
||||
suppressed-message,
|
||||
useless-suppression,
|
||||
deprecated-pragma,
|
||||
use-symbolic-message-instead,
|
||||
invalid-name,
|
||||
wrong-import-order,
|
||||
import-error,
|
||||
undefined-variable
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
# multiple time (only on the command line, not in the configuration file where
|
||||
# it should appear only once). See also the "--disable" option for examples.
|
||||
enable=c-extension-no-member
|
||||
|
||||
|
||||
[BASIC]
|
||||
|
||||
# Naming style matching correct argument names.
|
||||
argument-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct argument names. Overrides argument-
|
||||
# naming-style. If left empty, argument names will be checked with the set
|
||||
# naming style.
|
||||
#argument-rgx=
|
||||
|
||||
# Naming style matching correct attribute names.
|
||||
attr-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct attribute names. Overrides attr-naming-
|
||||
# style. If left empty, attribute names will be checked with the set naming
|
||||
# style.
|
||||
#attr-rgx=
|
||||
|
||||
# Bad variable names which should always be refused, separated by a comma.
|
||||
bad-names=foo,
|
||||
bar,
|
||||
baz,
|
||||
toto,
|
||||
tutu,
|
||||
tata
|
||||
|
||||
# Bad variable names regexes, separated by a comma. If names match any regex,
|
||||
# they will always be refused
|
||||
bad-names-rgxs=
|
||||
|
||||
# Naming style matching correct class attribute names.
|
||||
class-attribute-naming-style=any
|
||||
|
||||
# Regular expression matching correct class attribute names. Overrides class-
|
||||
# attribute-naming-style. If left empty, class attribute names will be checked
|
||||
# with the set naming style.
|
||||
#class-attribute-rgx=
|
||||
|
||||
# Naming style matching correct class constant names.
|
||||
class-const-naming-style=UPPER_CASE
|
||||
|
||||
# Regular expression matching correct class constant names. Overrides class-
|
||||
# const-naming-style. If left empty, class constant names will be checked with
|
||||
# the set naming style.
|
||||
#class-const-rgx=
|
||||
|
||||
# Naming style matching correct class names.
|
||||
class-naming-style=PascalCase
|
||||
|
||||
# Regular expression matching correct class names. Overrides class-naming-
|
||||
# style. If left empty, class names will be checked with the set naming style.
|
||||
#class-rgx=
|
||||
|
||||
# Naming style matching correct constant names.
|
||||
const-naming-style=UPPER_CASE
|
||||
|
||||
# Regular expression matching correct constant names. Overrides const-naming-
|
||||
# style. If left empty, constant names will be checked with the set naming
|
||||
# style.
|
||||
#const-rgx=
|
||||
|
||||
# Minimum line length for functions/classes that require docstrings, shorter
|
||||
# ones are exempt.
|
||||
docstring-min-length=-1
|
||||
|
||||
# Naming style matching correct function names.
|
||||
function-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct function names. Overrides function-
|
||||
# naming-style. If left empty, function names will be checked with the set
|
||||
# naming style.
|
||||
#function-rgx=
|
||||
|
||||
# Good variable names which should always be accepted, separated by a comma.
|
||||
good-names=i,
|
||||
j,
|
||||
k,
|
||||
ex,
|
||||
Run,
|
||||
_
|
||||
|
||||
# Good variable names regexes, separated by a comma. If names match any regex,
|
||||
# they will always be accepted
|
||||
good-names-rgxs=
|
||||
|
||||
# Include a hint for the correct naming format with invalid-name.
|
||||
include-naming-hint=no
|
||||
|
||||
# Naming style matching correct inline iteration names.
|
||||
inlinevar-naming-style=any
|
||||
|
||||
# Regular expression matching correct inline iteration names. Overrides
|
||||
# inlinevar-naming-style. If left empty, inline iteration names will be checked
|
||||
# with the set naming style.
|
||||
#inlinevar-rgx=
|
||||
|
||||
# Naming style matching correct method names.
|
||||
method-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct method names. Overrides method-naming-
|
||||
# style. If left empty, method names will be checked with the set naming style.
|
||||
#method-rgx=
|
||||
|
||||
# Naming style matching correct module names.
|
||||
module-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct module names. Overrides module-naming-
|
||||
# style. If left empty, module names will be checked with the set naming style.
|
||||
#module-rgx=
|
||||
|
||||
# Colon-delimited sets of names that determine each other's naming style when
|
||||
# the name regexes allow several styles.
|
||||
name-group=
|
||||
|
||||
# Regular expression which should only match function or class names that do
|
||||
# not require a docstring.
|
||||
no-docstring-rgx=^_
|
||||
|
||||
# List of decorators that produce properties, such as abc.abstractproperty. Add
|
||||
# to this list to register other decorators that produce valid properties.
|
||||
# These decorators are taken in consideration only for invalid-name.
|
||||
property-classes=abc.abstractproperty
|
||||
|
||||
# Regular expression matching correct type variable names. If left empty, type
|
||||
# variable names will be checked with the set naming style.
|
||||
#typevar-rgx=
|
||||
|
||||
# Naming style matching correct variable names.
|
||||
variable-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct variable names. Overrides variable-
|
||||
# naming-style. If left empty, variable names will be checked with the set
|
||||
# naming style.
|
||||
#variable-rgx=
|
||||
|
||||
|
||||
[CLASSES]
|
||||
|
||||
# Warn about protected attribute access inside special methods
|
||||
check-protected-access-in-special-methods=no
|
||||
|
||||
# List of method names used to declare (i.e. assign) instance attributes.
|
||||
defining-attr-methods=__init__,
|
||||
__new__,
|
||||
setUp,
|
||||
__post_init__
|
||||
|
||||
# List of member names, which should be excluded from the protected access
|
||||
# warning.
|
||||
exclude-protected=_asdict,
|
||||
_fields,
|
||||
_replace,
|
||||
_source,
|
||||
_make
|
||||
|
||||
# List of valid names for the first argument in a class method.
|
||||
valid-classmethod-first-arg=cls
|
||||
|
||||
# List of valid names for the first argument in a metaclass class method.
|
||||
valid-metaclass-classmethod-first-arg=cls
|
||||
|
||||
|
||||
[REFACTORING]
|
||||
|
||||
# Maximum number of nested blocks for function / method body
|
||||
max-nested-blocks=5
|
||||
|
||||
# Complete name of functions that never returns. When checking for
|
||||
# inconsistent-return-statements if a never returning function is called then
|
||||
# it will be considered as an explicit return statement and no message will be
|
||||
# printed.
|
||||
never-returning-functions=sys.exit,argparse.parse_error
|
||||
|
||||
|
||||
[DESIGN]
|
||||
|
||||
# List of regular expressions of class ancestor names to ignore when counting
|
||||
# public methods (see R0903)
|
||||
exclude-too-few-public-methods=
|
||||
|
||||
# List of qualified class names to ignore when counting class parents (see
|
||||
# R0901)
|
||||
ignored-parents=
|
||||
|
||||
# Maximum number of arguments for function / method.
|
||||
max-args=5
|
||||
|
||||
# Maximum number of attributes for a class (see R0902).
|
||||
max-attributes=7
|
||||
|
||||
# Maximum number of boolean expressions in an if statement (see R0916).
|
||||
max-bool-expr=5
|
||||
|
||||
# Maximum number of branch for function / method body.
|
||||
max-branches=12
|
||||
|
||||
# Maximum number of locals for function / method body.
|
||||
max-locals=15
|
||||
|
||||
# Maximum number of parents for a class (see R0901).
|
||||
max-parents=7
|
||||
|
||||
# Maximum number of public methods for a class (see R0904).
|
||||
max-public-methods=20
|
||||
|
||||
# Maximum number of return / yield for function / method body.
|
||||
max-returns=6
|
||||
|
||||
# Maximum number of statements in function / method body.
|
||||
max-statements=50
|
||||
|
||||
# Minimum number of public methods for a class (see R0903).
|
||||
min-public-methods=2
|
||||
|
||||
|
||||
[EXCEPTIONS]
|
||||
|
||||
# Exceptions that will emit a warning when caught.
|
||||
overgeneral-exceptions=BaseException,
|
||||
Exception
|
||||
|
||||
|
||||
[FORMAT]
|
||||
|
||||
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
|
||||
expected-line-ending-format=
|
||||
|
||||
# Regexp for a line that is allowed to be longer than the limit.
|
||||
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
|
||||
|
||||
# Number of spaces of indent required inside a hanging or continued line.
|
||||
indent-after-paren=4
|
||||
|
||||
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
|
||||
# tab).
|
||||
indent-string=' '
|
||||
|
||||
# Maximum number of characters on a single line.
|
||||
max-line-length=100
|
||||
|
||||
# Maximum number of lines in a module.
|
||||
max-module-lines=1000
|
||||
|
||||
# Allow the body of a class to be on the same line as the declaration if body
|
||||
# contains single statement.
|
||||
single-line-class-stmt=no
|
||||
|
||||
# Allow the body of an if to be on the same line as the test if there is no
|
||||
# else.
|
||||
single-line-if-stmt=no
|
||||
|
||||
|
||||
[IMPORTS]
|
||||
|
||||
# List of modules that can be imported at any level, not just the top level
|
||||
# one.
|
||||
allow-any-import-level=
|
||||
|
||||
# Allow wildcard imports from modules that define __all__.
|
||||
allow-wildcard-with-all=no
|
||||
|
||||
# Deprecated modules which should not be used, separated by a comma.
|
||||
deprecated-modules=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of external dependencies
|
||||
# to the given file (report RP0402 must not be disabled).
|
||||
ext-import-graph=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of all (i.e. internal and
|
||||
# external) dependencies to the given file (report RP0402 must not be
|
||||
# disabled).
|
||||
import-graph=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of internal dependencies
|
||||
# to the given file (report RP0402 must not be disabled).
|
||||
int-import-graph=
|
||||
|
||||
# Force import order to recognize a module as part of the standard
|
||||
# compatibility libraries.
|
||||
known-standard-library=
|
||||
|
||||
# Force import order to recognize a module as part of a third party library.
|
||||
known-third-party=enchant
|
||||
|
||||
# Couples of modules and preferred modules, separated by a comma.
|
||||
preferred-modules=
|
||||
|
||||
|
||||
[LOGGING]
|
||||
|
||||
# The type of string formatting that logging methods do. `old` means using %
|
||||
# formatting, `new` is for `{}` formatting.
|
||||
logging-format-style=old
|
||||
|
||||
# Logging modules to check that the string format arguments are in logging
|
||||
# function parameter format.
|
||||
logging-modules=logging
|
||||
|
||||
|
||||
[MISCELLANEOUS]
|
||||
|
||||
# List of note tags to take in consideration, separated by a comma.
|
||||
notes=FIXME,
|
||||
XXX,
|
||||
TODO
|
||||
|
||||
# Regular expression of note tags to take in consideration.
|
||||
notes-rgx=
|
||||
|
||||
|
||||
[SIMILARITIES]
|
||||
|
||||
# Comments are removed from the similarity computation
|
||||
ignore-comments=yes
|
||||
|
||||
# Docstrings are removed from the similarity computation
|
||||
ignore-docstrings=yes
|
||||
|
||||
# Imports are removed from the similarity computation
|
||||
ignore-imports=yes
|
||||
|
||||
# Signatures are removed from the similarity computation
|
||||
ignore-signatures=yes
|
||||
|
||||
# Minimum lines number of a similarity.
|
||||
min-similarity-lines=4
|
||||
|
||||
|
||||
[SPELLING]
|
||||
|
||||
# Limits count of emitted suggestions for spelling mistakes.
|
||||
max-spelling-suggestions=4
|
||||
|
||||
# Spelling dictionary name. Available dictionaries: none. To make it work,
|
||||
# install the 'python-enchant' package.
|
||||
spelling-dict=
|
||||
|
||||
# List of comma separated words that should be considered directives if they
|
||||
# appear at the beginning of a comment and should not be checked.
|
||||
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
|
||||
|
||||
# List of comma separated words that should not be checked.
|
||||
spelling-ignore-words=
|
||||
|
||||
# A path to a file that contains the private dictionary; one word per line.
|
||||
spelling-private-dict-file=
|
||||
|
||||
# Tells whether to store unknown words to the private dictionary (see the
|
||||
# --spelling-private-dict-file option) instead of raising a message.
|
||||
spelling-store-unknown-words=no
|
||||
|
||||
|
||||
[STRING]
|
||||
|
||||
# This flag controls whether inconsistent-quotes generates a warning when the
|
||||
# character used as a quote delimiter is used inconsistently within a module.
|
||||
check-quote-consistency=no
|
||||
|
||||
# This flag controls whether the implicit-str-concat should generate a warning
|
||||
# on implicit string concatenation in sequences defined over several lines.
|
||||
check-str-concat-over-line-jumps=no
|
||||
|
||||
|
||||
[TYPECHECK]
|
||||
|
||||
# List of decorators that produce context managers, such as
|
||||
# contextlib.contextmanager. Add to this list to register other decorators that
|
||||
# produce valid context managers.
|
||||
contextmanager-decorators=contextlib.contextmanager
|
||||
|
||||
# List of members which are set dynamically and missed by pylint inference
|
||||
# system, and so shouldn't trigger E1101 when accessed. Python regular
|
||||
# expressions are accepted.
|
||||
generated-members=
|
||||
|
||||
# Tells whether to warn about missing members when the owner of the attribute
|
||||
# is inferred to be None.
|
||||
ignore-none=yes
|
||||
|
||||
# This flag controls whether pylint should warn about no-member and similar
|
||||
# checks whenever an opaque object is returned when inferring. The inference
|
||||
# can return multiple potential results while evaluating a Python object, but
|
||||
# some branches might not be evaluated, which results in partial inference. In
|
||||
# that case, it might be useful to still emit no-member and other checks for
|
||||
# the rest of the inferred objects.
|
||||
ignore-on-opaque-inference=yes
|
||||
|
||||
# List of symbolic message names to ignore for Mixin members.
|
||||
ignored-checks-for-mixins=no-member,
|
||||
not-async-context-manager,
|
||||
not-context-manager,
|
||||
attribute-defined-outside-init
|
||||
|
||||
# List of class names for which member attributes should not be checked (useful
|
||||
# for classes with dynamically set attributes). This supports the use of
|
||||
# qualified names.
|
||||
ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace
|
||||
|
||||
# Show a hint with possible names when a member name was not found. The aspect
|
||||
# of finding the hint is based on edit distance.
|
||||
missing-member-hint=yes
|
||||
|
||||
# The minimum edit distance a name should have in order to be considered a
|
||||
# similar match for a missing member name.
|
||||
missing-member-hint-distance=1
|
||||
|
||||
# The total number of similar names that should be taken in consideration when
|
||||
# showing a hint for a missing member.
|
||||
missing-member-max-choices=1
|
||||
|
||||
# Regex pattern to define which classes are considered mixins.
|
||||
mixin-class-rgx=.*[Mm]ixin
|
||||
|
||||
# List of decorators that change the signature of a decorated function.
|
||||
signature-mutators=
|
||||
|
||||
|
||||
[VARIABLES]
|
||||
|
||||
# List of additional names supposed to be defined in builtins. Remember that
|
||||
# you should avoid defining new builtins when possible.
|
||||
additional-builtins=
|
||||
|
||||
# Tells whether unused global variables should be treated as a violation.
|
||||
allow-global-unused-variables=yes
|
||||
|
||||
# List of names allowed to shadow builtins
|
||||
allowed-redefined-builtins=
|
||||
|
||||
# List of strings which can identify a callback function by name. A callback
|
||||
# name must start or end with one of those strings.
|
||||
callbacks=cb_,
|
||||
_cb
|
||||
|
||||
# A regular expression matching the name of dummy variables (i.e. expected to
|
||||
# not be used).
|
||||
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
|
||||
|
||||
# Argument names that match this expression will be ignored. Default to name
|
||||
# with leading underscore.
|
||||
ignored-argument-names=_.*|^ignored_|^unused_
|
||||
|
||||
# Tells whether we should check for unused import in __init__ files.
|
||||
init-import=no
|
||||
|
||||
# List of qualified module names which can have objects that can redefine
|
||||
# builtins.
|
||||
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
|
||||
+4
-4
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
|
||||
# relates to FindOpenGL module
|
||||
# and cache variables OPENGL_gl_LIBRARY, OPENGL_glu_LIBRARY
|
||||
if (POLICY CMP0072)
|
||||
cmake_policy(SET CMP0072 OLD)
|
||||
set(OpenGL_GL_PREFERENCE LEGACY)
|
||||
endif(POLICY CMP0072)
|
||||
|
||||
find_program(CCACHE_PROGRAM ccache) #This check should occur before project()
|
||||
@@ -18,9 +18,9 @@ project(FreeCAD)
|
||||
set(PACKAGE_VERSION_NAME "Vulcan")
|
||||
set(PACKAGE_VERSION_MAJOR "0")
|
||||
set(PACKAGE_VERSION_MINOR "20")
|
||||
set(PACKAGE_VERSION_PATCH "0")
|
||||
set(PACKAGE_VERSION_SUFFIX "dev") # either "dev" for development snapshot or "" (empty string)
|
||||
set(FREECAD_VERSION_PATCH "0") # number of patch release (e.g. "4" for the 0.18.4 release)
|
||||
set(PACKAGE_VERSION_PATCH "2")
|
||||
set(PACKAGE_VERSION_SUFFIX "") # either "dev" for development snapshot or "" (empty string)
|
||||
set(FREECAD_VERSION_PATCH "2") # number of patch release (e.g. "4" for the 0.18.4 release)
|
||||
|
||||
set(FREECAD_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
[](https://github.com/freecad/freecad/releases/latest) [![Master][freecad-master-status]][gitlab-branch-master] [](https://crowdin.com/project/freecad) [](https://gitter.im/freecad/freecad?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://lgtm.com/projects/g/FreeCAD/FreeCAD/context:python) [](https://lgtm.com/projects/g/FreeCAD/FreeCAD/context:cpp) [](https://liberapay.com/FreeCAD)
|
||||
|
||||

|
||||
<img src="https://user-images.githubusercontent.com/1828501/174066870-1692005b-f8d7-43fb-a289-6d2f07f73d7f.png" width="800"/>
|
||||
|
||||
Overview
|
||||
--------
|
||||
@@ -55,13 +55,13 @@ Other options are described at the [wiki Download page](https://wiki.freecadweb.
|
||||
Build Status
|
||||
------------
|
||||
|
||||
| Master | 0.19 | Translation |
|
||||
| Master | 0.20 | Translation |
|
||||
|:------:|:----:|:-----------:|
|
||||
|[![Master][freecad-master-status]][gitlab-branch-master]|[![0.19][freecad-0.19-status]][gitlab-branch-0.19]|[](https://crowdin.com/project/freecad)|
|
||||
|[![Master][freecad-master-status]][gitlab-branch-master]|[![0.20][freecad-0.20-status]][gitlab-branch-0.20]|[](https://crowdin.com/project/freecad)|
|
||||
|
||||
[freecad-0.19-status]: https://gitlab.com/freecad/FreeCAD-CI/badges/releases/FreeCAD-0-19/pipeline.svg
|
||||
[freecad-0.20-status]: https://gitlab.com/freecad/FreeCAD-CI/badges/releases/FreeCAD-0-20/pipeline.svg
|
||||
[freecad-master-status]: https://gitlab.com/freecad/FreeCAD-CI/badges/master/pipeline.svg
|
||||
[gitlab-branch-0.19]: https://gitlab.com/freecad/FreeCAD-CI/-/commits/releases/FreeCAD-0-19
|
||||
[gitlab-branch-0.20]: https://gitlab.com/freecad/FreeCAD-CI/-/commits/releases/FreeCAD-0-20
|
||||
[gitlab-branch-master]: https://gitlab.com/freecad/FreeCAD-CI/-/commits/master
|
||||
[travis-builds]: https://travis-ci.org/FreeCAD/FreeCAD/builds
|
||||
|
||||
@@ -99,7 +99,7 @@ To report an issue please:
|
||||
For more detail see:
|
||||
- [Wiki Page about the Bug Tracker](https://wiki.freecadweb.org/Tracker)
|
||||
- [Bug Tracker](https://tracker.freecadweb.org)
|
||||
- [Help Forum](http://forum.freecadweb.org/viewforum.php?f=3)
|
||||
- [Help Forum](https://forum.freecadweb.org/viewforum.php?f=3)
|
||||
|
||||
|
||||
Usage & Getting help
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
macro(SetupOpenCasCade)
|
||||
# -------------------------------- OpenCasCade --------------------------------
|
||||
|
||||
find_package(OpenCasCade)
|
||||
find_package(OCC)
|
||||
if(NOT OCC_FOUND)
|
||||
message(FATAL_ERROR "================================================================\n"
|
||||
"Neither OpenCASCADE Community Edition nor OpenCASCADE was found!\n"
|
||||
|
||||
@@ -121,6 +121,10 @@ macro(SetupSalomeSMESH)
|
||||
find_package(SMESH CONFIG)
|
||||
set (SMESH_INCLUDE_DIR ${SMESH_INCLUDE_PATH})
|
||||
set(EXTERNAL_SMESH_LIBS ${SMESH_LIBRARIES})
|
||||
# If this definition is not set, linker errors will occur against SMESH on 64 bit machines.
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
add_definitions(-DSALOME_USE_64BIT_IDS)
|
||||
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
if(NOT SMESH_FOUND)
|
||||
message(ERROR "================\n"
|
||||
"SMESH not found.\n"
|
||||
|
||||
@@ -125,9 +125,7 @@ macro(SetupShibokenAndPyside)
|
||||
"PySide2 Python module not found.\n"
|
||||
"================================\n")
|
||||
else()
|
||||
message(STATUS "===============================================\n"
|
||||
"PySide2 Python module found at ${PRINT_OUTPUT}.\n"
|
||||
"===============================================\n")
|
||||
message(STATUS "PySide2 Python module found at ${PRINT_OUTPUT}.\n")
|
||||
endif()
|
||||
|
||||
endmacro(SetupShibokenAndPyside)
|
||||
|
||||
@@ -12,6 +12,7 @@ path_classifiers:
|
||||
- "src/CXX/"
|
||||
template:
|
||||
- "src/Tools/examplePy2wiki.py"
|
||||
- "src/Tools/wiki2qhelp.py"
|
||||
- "src/Mode/TemplatePyMod/"
|
||||
unmaintained:
|
||||
- "src/Mod/Robot/"
|
||||
|
||||
+21
-7
@@ -1127,7 +1127,8 @@ std::string Application::getUserMacroDir()
|
||||
std::string Application::getResourceDir()
|
||||
{
|
||||
#ifdef RESOURCEDIR
|
||||
std::string path(RESOURCEDIR);
|
||||
// #6892: Conda may inject null characters => remove them
|
||||
std::string path = std::string(RESOURCEDIR).c_str();
|
||||
path.append("/");
|
||||
QDir dir(QString::fromStdString(path));
|
||||
if (dir.isAbsolute())
|
||||
@@ -1141,7 +1142,8 @@ std::string Application::getResourceDir()
|
||||
std::string Application::getLibraryDir()
|
||||
{
|
||||
#ifdef LIBRARYDIR
|
||||
std::string path(LIBRARYDIR);
|
||||
// #6892: Conda may inject null characters => remove them
|
||||
std::string path = std::string(LIBRARYDIR).c_str();
|
||||
QDir dir(QString::fromStdString(path));
|
||||
if (dir.isAbsolute())
|
||||
return path;
|
||||
@@ -1154,7 +1156,8 @@ std::string Application::getLibraryDir()
|
||||
std::string Application::getHelpDir()
|
||||
{
|
||||
#ifdef DOCDIR
|
||||
std::string path(DOCDIR);
|
||||
// #6892: Conda may inject null characters => remove them
|
||||
std::string path = std::string(DOCDIR).c_str();
|
||||
path.append("/");
|
||||
QDir dir(QString::fromStdString(path));
|
||||
if (dir.isAbsolute())
|
||||
@@ -2160,7 +2163,7 @@ void parseProgramOptions(int ac, char ** av, const string& exe, variables_map& v
|
||||
("log-file", value<string>(), "Unlike --write-log this allows logging to an arbitrary file")
|
||||
("user-cfg,u", value<string>(),"User config file to load/save user settings")
|
||||
("system-cfg,s", value<string>(),"System config file to load/save system settings")
|
||||
("run-test,t", value<string>() ,"Test case - or 0 for all")
|
||||
("run-test,t", value<string>()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests.")
|
||||
("module-path,M", value< vector<string> >()->composing(),"Additional module paths")
|
||||
("python-path,P", value< vector<string> >()->composing(),"Additional python paths")
|
||||
("single-instance", "Allow to run a single instance of the application")
|
||||
@@ -2394,6 +2397,9 @@ void processProgramOptions(const variables_map& vm, std::map<std::string,std::st
|
||||
if ( "0" == testCase) {
|
||||
testCase = "TestApp.All";
|
||||
}
|
||||
else if (testCase.empty()) {
|
||||
testCase = "TestApp.PrintAll";
|
||||
}
|
||||
mConfig["TestCase"] = testCase;
|
||||
mConfig["RunMode"] = "Internal";
|
||||
mConfig["ScriptFileName"] = "FreeCADTest";
|
||||
@@ -2435,10 +2441,14 @@ void Application::initConfig(int argc, char ** argv)
|
||||
// We only set these keys if not yet defined. Therefore it suffices to search
|
||||
// only for 'BuildVersionMajor'.
|
||||
if (App::Application::Config().find("BuildVersionMajor") == App::Application::Config().end()) {
|
||||
std::stringstream str; str << FCVersionMajor << "." << FCVersionMinor;
|
||||
std::stringstream str;
|
||||
str << FCVersionMajor
|
||||
<< "." << FCVersionMinor
|
||||
<< "." << FCVersionPoint;
|
||||
App::Application::Config()["ExeVersion" ] = str.str();
|
||||
App::Application::Config()["BuildVersionMajor" ] = FCVersionMajor;
|
||||
App::Application::Config()["BuildVersionMinor" ] = FCVersionMinor;
|
||||
App::Application::Config()["BuildVersionPoint" ] = FCVersionPoint;
|
||||
App::Application::Config()["BuildRevision" ] = FCRevision;
|
||||
App::Application::Config()["BuildRepositoryURL" ] = FCRepositoryURL;
|
||||
App::Application::Config()["BuildRevisionDate" ] = FCRevisionDate;
|
||||
@@ -2518,17 +2528,21 @@ void Application::initConfig(int argc, char ** argv)
|
||||
// Remove banner if FreeCAD is invoked via the -c command as regular
|
||||
// Python interpreter
|
||||
if (!(mConfig["Verbose"] == "Strict"))
|
||||
Console().Message("%s %s, Libs: %s.%sR%s\n%s",mConfig["ExeName"].c_str(),
|
||||
Console().Message("%s %s, Libs: %s.%s.%sR%s\n%s",
|
||||
mConfig["ExeName"].c_str(),
|
||||
mConfig["ExeVersion"].c_str(),
|
||||
mConfig["BuildVersionMajor"].c_str(),
|
||||
mConfig["BuildVersionMinor"].c_str(),
|
||||
mConfig["BuildVersionPoint"].c_str(),
|
||||
mConfig["BuildRevision"].c_str(),
|
||||
mConfig["CopyrightInfo"].c_str());
|
||||
else
|
||||
Console().Message("%s %s, Libs: %s.%sB%s\n",mConfig["ExeName"].c_str(),
|
||||
Console().Message("%s %s, Libs: %s.%s.%sB%s\n",
|
||||
mConfig["ExeName"].c_str(),
|
||||
mConfig["ExeVersion"].c_str(),
|
||||
mConfig["BuildVersionMajor"].c_str(),
|
||||
mConfig["BuildVersionMinor"].c_str(),
|
||||
mConfig["BuildVersionPoint"].c_str(),
|
||||
mConfig["BuildRevision"].c_str());
|
||||
}
|
||||
LoadParameters();
|
||||
|
||||
@@ -104,9 +104,9 @@ PyMethodDef Application::Methods[] = {
|
||||
"* If no module is given it will be determined by the file extension.\n"
|
||||
"* If more than one module can load a file the first one will be taken.\n"
|
||||
"* If no module exists to load the file an exception will be raised."},
|
||||
{"open", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) (void)>( Application::sOpenDocument )), METH_VARARGS|METH_KEYWORDS,
|
||||
{"open", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) ()>( Application::sOpenDocument )), METH_VARARGS|METH_KEYWORDS,
|
||||
"See openDocument(string)"},
|
||||
{"openDocument", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) (void)>( Application::sOpenDocument )), METH_VARARGS|METH_KEYWORDS,
|
||||
{"openDocument", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) ()>( Application::sOpenDocument )), METH_VARARGS|METH_KEYWORDS,
|
||||
"openDocument(filepath,hidden=False) -> object\n"
|
||||
"Create a document and load the project file into the document.\n\n"
|
||||
"filepath: file path to an existing file. If the file doesn't exist\n"
|
||||
@@ -116,7 +116,7 @@ PyMethodDef Application::Methods[] = {
|
||||
// {"saveDocument", (PyCFunction) Application::sSaveDocument, METH_VARARGS,
|
||||
// "saveDocument(string) -- Save the document to a file."},
|
||||
// {"saveDocumentAs", (PyCFunction) Application::sSaveDocumentAs, METH_VARARGS},
|
||||
{"newDocument", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) (void)>( Application::sNewDocument )), METH_VARARGS|METH_KEYWORDS,
|
||||
{"newDocument", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) ()>( Application::sNewDocument )), METH_VARARGS|METH_KEYWORDS,
|
||||
"newDocument(name, label=None, hidden=False, temp=False) -> object\n"
|
||||
"Create a new document with a given name.\n\n"
|
||||
"name: unique document name which is checked automatically.\n"
|
||||
@@ -492,6 +492,9 @@ PyObject* Application::sGetVersion(PyObject * /*self*/, PyObject *args)
|
||||
it = cfg.find("BuildVersionMinor");
|
||||
list.append(Py::String(it != cfg.end() ? it->second : ""));
|
||||
|
||||
it = cfg.find("BuildVersionPoint");
|
||||
list.append(Py::String(it != cfg.end() ? it->second : ""));
|
||||
|
||||
it = cfg.find("BuildRevision");
|
||||
list.append(Py::String(it != cfg.end() ? it->second : ""));
|
||||
|
||||
|
||||
+42
-13
@@ -2614,24 +2614,49 @@ bool Document::saveToFile(const char* filename) const
|
||||
bool policy = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Document")->GetBool("BackupPolicy",true);
|
||||
|
||||
auto canonical_path = [](const char* filename) {
|
||||
try {
|
||||
#ifdef FC_OS_WIN32
|
||||
QString utf8Name = QString::fromUtf8(filename);
|
||||
auto realpath = fs::weakly_canonical(fs::absolute(fs::path(utf8Name.toStdWString())));
|
||||
std::string nativePath = QString::fromStdWString(realpath.native()).toStdString();
|
||||
#else
|
||||
auto realpath = fs::weakly_canonical(fs::absolute(fs::path(filename)));
|
||||
std::string nativePath = realpath.native();
|
||||
#endif
|
||||
// In case some folders in the path do not exist
|
||||
auto parentPath = realpath.parent_path();
|
||||
fs::create_directories(parentPath);
|
||||
|
||||
return nativePath;
|
||||
}
|
||||
catch (const std::exception&) {
|
||||
#ifdef FC_OS_WIN32
|
||||
QString utf8Name = QString::fromUtf8(filename);
|
||||
auto parentPath = fs::absolute(fs::path(utf8Name.toStdWString())).parent_path();
|
||||
#else
|
||||
auto parentPath = fs::absolute(fs::path(filename)).parent_path();
|
||||
#endif
|
||||
fs::create_directories(parentPath);
|
||||
|
||||
return std::string(filename);
|
||||
}
|
||||
};
|
||||
|
||||
//realpath is canonical filename i.e. without symlink
|
||||
std::string nativePath = canonical_path(filename);
|
||||
|
||||
// make a tmp. file where to save the project data first and then rename to
|
||||
// the actual file name. This may be useful if overwriting an existing file
|
||||
// fails so that the data of the work up to now isn't lost.
|
||||
std::string uuid = Base::Uuid::createUuid();
|
||||
std::string fn = filename;
|
||||
std::string fn = nativePath;
|
||||
if (policy) {
|
||||
fn += ".";
|
||||
fn += uuid;
|
||||
}
|
||||
Base::FileInfo tmp(fn);
|
||||
// In case some folders in the path do not exist
|
||||
#ifdef FC_OS_WIN32
|
||||
QString utf8Name = QString::fromUtf8(filename);
|
||||
auto parentPath = fs::absolute(fs::path(utf8Name.toStdWString())).parent_path();
|
||||
#else
|
||||
auto parentPath = fs::absolute(fs::path(filename)).parent_path();
|
||||
#endif
|
||||
fs::create_directories(parentPath);
|
||||
|
||||
|
||||
// open extra scope to close ZipWriter properly
|
||||
{
|
||||
@@ -2677,9 +2702,9 @@ bool Document::saveToFile(const char* filename) const
|
||||
count_bak = -1;
|
||||
}
|
||||
bool useFCBakExtension = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Document")->GetBool("UseFCBakExtension",false);
|
||||
std::string saveBackupDateFormat = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Document")->GetASCII("SaveBackupDateFormat","%Y%m%d-%H%M%S");
|
||||
("User parameter:BaseApp/Preferences/Document")->GetBool("UseFCBakExtension",false);
|
||||
std::string saveBackupDateFormat = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Document")->GetASCII("SaveBackupDateFormat","%Y%m%d-%H%M%S");
|
||||
|
||||
BackupPolicy policy;
|
||||
if (useFCBakExtension) {
|
||||
@@ -2691,7 +2716,7 @@ bool Document::saveToFile(const char* filename) const
|
||||
policy.setPolicy(BackupPolicy::Standard);
|
||||
}
|
||||
policy.setNumberOfFiles(count_bak);
|
||||
policy.apply(fn, filename);
|
||||
policy.apply(fn, nativePath);
|
||||
}
|
||||
|
||||
signalFinishSave(*this, filename);
|
||||
@@ -4218,6 +4243,10 @@ void Document::removeObject(const char* sName)
|
||||
}
|
||||
}
|
||||
|
||||
// In case the object gets deleted the pointer must be nullified
|
||||
if (tobedestroyed) {
|
||||
tobedestroyed->pcNameInDocument = nullptr;
|
||||
}
|
||||
d->objectMap.erase(pos);
|
||||
}
|
||||
|
||||
|
||||
+53
-27
@@ -96,11 +96,9 @@ DocumentObject::~DocumentObject(void)
|
||||
}
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *DocumentObject::recompute(void)
|
||||
void DocumentObject::printInvalidLinks() const
|
||||
{
|
||||
//check if the links are valid before making the recompute
|
||||
if(!GeoFeatureGroupExtension::areLinksValid(this)) {
|
||||
#if 1
|
||||
try {
|
||||
// Get objects that have invalid link scope, and print their names.
|
||||
// Truncate the invalid object list name strings for readability, if they happen to be very long.
|
||||
std::vector<App::DocumentObject*> invalid_linkobjs;
|
||||
@@ -114,28 +112,44 @@ App::DocumentObjectExecReturn *DocumentObject::recompute(void)
|
||||
scopenames += "... ";
|
||||
break;
|
||||
}
|
||||
|
||||
scopenames += scope.first->getNameInDocument();
|
||||
scopenames += " ";
|
||||
}
|
||||
|
||||
if (objnames.length() > 80) {
|
||||
objnames += "... ";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (objnames.empty()) {
|
||||
objnames = "N/A";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
objnames.pop_back();
|
||||
}
|
||||
|
||||
if (scopenames.empty()) {
|
||||
scopenames = "N/A";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
scopenames.pop_back();
|
||||
}
|
||||
Base::Console().Warning("%s: Link(s) to object(s) '%s' go out of the allowed scope '%s'. Instead, the linked object(s) reside within '%s'.\n", getTypeId().getName(), objnames.c_str(), getNameInDocument(), scopenames.c_str());
|
||||
#else
|
||||
return new App::DocumentObjectExecReturn("Links go out of the allowed scope", this);
|
||||
#endif
|
||||
|
||||
Base::Console().Warning("%s: Link(s) to object(s) '%s' go out of the allowed scope '%s'. Instead, the linked object(s) reside within '%s'.\n",
|
||||
getTypeId().getName(), objnames.c_str(), getNameInDocument(), scopenames.c_str());
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *DocumentObject::recompute()
|
||||
{
|
||||
//check if the links are valid before making the recompute
|
||||
if (!GeoFeatureGroupExtension::areLinksValid(this)) {
|
||||
printInvalidLinks();
|
||||
}
|
||||
|
||||
// set/unset the execution bit
|
||||
@@ -887,31 +901,43 @@ std::vector<std::string> DocumentObject::getSubObjects(int reason) const {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<std::pair<App::DocumentObject *,std::string> > DocumentObject::getParents(int depth) const {
|
||||
std::vector<std::pair<App::DocumentObject *,std::string> > ret;
|
||||
if(!getNameInDocument() || !GetApplication().checkLinkDepth(depth))
|
||||
std::vector<std::pair<App::DocumentObject *,std::string>> DocumentObject::getParents(int depth) const {
|
||||
std::vector<std::pair<App::DocumentObject *, std::string>> ret;
|
||||
if (!getNameInDocument() || !GetApplication().checkLinkDepth(depth, false)) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string name(getNameInDocument());
|
||||
name += ".";
|
||||
for(auto parent : getInList()) {
|
||||
if(!parent || !parent->getNameInDocument())
|
||||
continue;
|
||||
if(!parent->hasChildElement() &&
|
||||
!parent->hasExtension(GeoFeatureGroupExtension::getExtensionClassTypeId()))
|
||||
continue;
|
||||
if(!parent->getSubObject(name.c_str()))
|
||||
for (auto parent : getInList()) {
|
||||
if (!parent || !parent->getNameInDocument()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto links = GetApplication().getLinksTo(parent,App::GetLinkRecursive);
|
||||
if (!parent->hasChildElement() &&
|
||||
!parent->hasExtension(GeoFeatureGroupExtension::getExtensionClassTypeId())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!parent->getSubObject(name.c_str())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto links = GetApplication().getLinksTo(parent, App::GetLinkRecursive);
|
||||
links.insert(parent);
|
||||
for(auto parent : links) {
|
||||
auto parents = parent->getParents(depth+1);
|
||||
if(parents.empty())
|
||||
parents.emplace_back(parent,std::string());
|
||||
for(auto &v : parents)
|
||||
ret.emplace_back(v.first,v.second+name);
|
||||
|
||||
for (auto parent : links) {
|
||||
auto parents = parent->getParents(depth + 1);
|
||||
if (parents.empty()) {
|
||||
parents.emplace_back(parent, std::string());
|
||||
}
|
||||
|
||||
for (auto &v : parents) {
|
||||
ret.emplace_back(v.first, v.second + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+23
-20
@@ -112,7 +112,7 @@ public:
|
||||
boost::signals2::signal<void (const App::DocumentObject&, const App::Property&)> signalChanged;
|
||||
|
||||
/// returns the type name of the ViewProvider
|
||||
virtual const char* getViewProviderName(void) const {
|
||||
virtual const char* getViewProviderName() const {
|
||||
return "";
|
||||
}
|
||||
/**
|
||||
@@ -129,11 +129,11 @@ public:
|
||||
}
|
||||
|
||||
/// Constructor
|
||||
DocumentObject(void);
|
||||
DocumentObject();
|
||||
virtual ~DocumentObject();
|
||||
|
||||
/// returns the name which is set in the document for this object (not the name property!)
|
||||
const char *getNameInDocument(void) const;
|
||||
const char *getNameInDocument() const;
|
||||
/// Return the object ID that is unique within its owner document
|
||||
long getID() const {return _Id;}
|
||||
/// returns the name that is safe to be exported to other document
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
virtual bool isAttachedToDocument() const override;
|
||||
virtual const char* detachFromDocument() override;
|
||||
/// gets the document in which this Object is handled
|
||||
App::Document *getDocument(void) const;
|
||||
App::Document *getDocument() const;
|
||||
|
||||
/** Set the property touched -> changed, cause recomputation in Update()
|
||||
*/
|
||||
@@ -151,22 +151,22 @@ public:
|
||||
/// set this document object touched (cause recomputation on dependent features)
|
||||
void touch(bool noRecompute=false);
|
||||
/// test if this document object is touched
|
||||
bool isTouched(void) const;
|
||||
bool isTouched() const;
|
||||
/// Enforce this document object to be recomputed
|
||||
void enforceRecompute();
|
||||
/// Test if this document object must be recomputed
|
||||
bool mustRecompute(void) const;
|
||||
bool mustRecompute() const;
|
||||
/// reset this document object touched
|
||||
void purgeTouched(void) {
|
||||
void purgeTouched() {
|
||||
StatusBits.reset(ObjectStatus::Touch);
|
||||
StatusBits.reset(ObjectStatus::Enforce);
|
||||
setPropertyStatus(0,false);
|
||||
}
|
||||
/// set this feature to error
|
||||
bool isError(void) const {return StatusBits.test(ObjectStatus::Error);}
|
||||
bool isValid(void) const {return !StatusBits.test(ObjectStatus::Error);}
|
||||
bool isError() const {return StatusBits.test(ObjectStatus::Error);}
|
||||
bool isValid() const {return !StatusBits.test(ObjectStatus::Error);}
|
||||
/// remove the error from the object
|
||||
void purgeError(void){StatusBits.reset(ObjectStatus::Error);}
|
||||
void purgeError(){StatusBits.reset(ObjectStatus::Error);}
|
||||
/// returns true if this objects is currently recomputing
|
||||
bool isRecomputing() const {return StatusBits.test(ObjectStatus::Recompute);}
|
||||
/// returns true if this objects is currently restoring from file
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
/// returns a list of objects linked by the property
|
||||
std::vector<App::DocumentObject*> getOutListOfProperty(App::Property*) const;
|
||||
/// returns a list of objects this object is pointing to by Links and all further descended
|
||||
std::vector<App::DocumentObject*> getOutListRecursive(void) const;
|
||||
std::vector<App::DocumentObject*> getOutListRecursive() const;
|
||||
/// clear internal out list cache
|
||||
void clearOutListCache() const;
|
||||
/// get all possible paths from this to another object following the OutList
|
||||
@@ -237,10 +237,10 @@ public:
|
||||
/// get all objects link to this object
|
||||
std::vector<App::DocumentObject*> getInList(void) const
|
||||
#else
|
||||
const std::vector<App::DocumentObject*> &getInList(void) const;
|
||||
const std::vector<App::DocumentObject*> &getInList() const;
|
||||
#endif
|
||||
/// get all objects link directly or indirectly to this object
|
||||
std::vector<App::DocumentObject*> getInListRecursive(void) const;
|
||||
std::vector<App::DocumentObject*> getInListRecursive() const;
|
||||
/** Get a set of all objects linking to this object, including possible external parent objects
|
||||
*
|
||||
* @param inSet [out]: a set containing all objects linking to this object.
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
* necessarily mean that it will be recomputed. It only means that all
|
||||
* objects that link it (i.e. its InList) will be recomputed.
|
||||
*/
|
||||
virtual short mustExecute(void) const;
|
||||
virtual short mustExecute() const;
|
||||
|
||||
/** Recompute only this feature
|
||||
*
|
||||
@@ -308,7 +308,7 @@ public:
|
||||
bool recomputeFeature(bool recursive=false);
|
||||
|
||||
/// get the status Message
|
||||
const char *getStatusString(void) const;
|
||||
const char *getStatusString() const;
|
||||
|
||||
/** Called in case of losing a link
|
||||
* Get called by the document when a object got deleted a link property of this
|
||||
@@ -317,7 +317,7 @@ public:
|
||||
* additional or different behavior.
|
||||
*/
|
||||
virtual void onLostLinkToObject(DocumentObject*);
|
||||
virtual PyObject *getPyObject(void) override;
|
||||
virtual PyObject *getPyObject() override;
|
||||
|
||||
/** Get the sub element/object by name
|
||||
*
|
||||
@@ -561,7 +561,7 @@ public:
|
||||
|
||||
protected:
|
||||
/// recompute only this object
|
||||
virtual App::DocumentObjectExecReturn *recompute(void);
|
||||
virtual App::DocumentObjectExecReturn *recompute();
|
||||
/** get called by the document to recompute this feature
|
||||
* Normally this method get called in the processing of
|
||||
* Document::recompute().
|
||||
@@ -569,7 +569,7 @@ protected:
|
||||
* with the data from linked objects and objects own
|
||||
* properties.
|
||||
*/
|
||||
virtual App::DocumentObjectExecReturn *execute(void);
|
||||
virtual App::DocumentObjectExecReturn *execute();
|
||||
|
||||
/**
|
||||
* Executes the extensions of a document object.
|
||||
@@ -592,8 +592,8 @@ protected:
|
||||
*/
|
||||
std::bitset<32> StatusBits;
|
||||
|
||||
void setError(void){StatusBits.set(ObjectStatus::Error);}
|
||||
void resetError(void){StatusBits.reset(ObjectStatus::Error);}
|
||||
void setError(){StatusBits.set(ObjectStatus::Error);}
|
||||
void resetError(){StatusBits.reset(ObjectStatus::Error);}
|
||||
void setDocument(App::Document* doc);
|
||||
|
||||
/// get called before the value is changed
|
||||
@@ -614,6 +614,9 @@ protected:
|
||||
/// get called when a property status has changed
|
||||
virtual void onPropertyStatusChanged(const Property &prop, unsigned long oldStatus) override;
|
||||
|
||||
private:
|
||||
void printInvalidLinks() const;
|
||||
|
||||
/// python object of this class and all descendent
|
||||
protected: // attributes
|
||||
Py::SmartPtr PythonObject;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
// inclution of the generated files (generated out of PropertyContainerPy.xml)
|
||||
// inclusion of the generated files (generated out of PropertyContainerPy.xml)
|
||||
#include "DocumentObjectExtensionPy.h"
|
||||
#include "DocumentObjectExtensionPy.cpp"
|
||||
|
||||
|
||||
@@ -593,7 +593,12 @@ bool DocumentWeakPtrT::expired() const noexcept
|
||||
return (d->_document == nullptr);
|
||||
}
|
||||
|
||||
App::Document* DocumentWeakPtrT::operator->() noexcept
|
||||
App::Document* DocumentWeakPtrT::operator*() const noexcept
|
||||
{
|
||||
return d->_document;
|
||||
}
|
||||
|
||||
App::Document* DocumentWeakPtrT::operator->() const noexcept
|
||||
{
|
||||
return d->_document;
|
||||
}
|
||||
@@ -686,7 +691,12 @@ DocumentObjectWeakPtrT& DocumentObjectWeakPtrT::operator= (App::DocumentObject*
|
||||
return *this;
|
||||
}
|
||||
|
||||
App::DocumentObject* DocumentObjectWeakPtrT::operator->() noexcept
|
||||
App::DocumentObject* DocumentObjectWeakPtrT::operator*() const noexcept
|
||||
{
|
||||
return d->get();
|
||||
}
|
||||
|
||||
App::DocumentObject* DocumentObjectWeakPtrT::operator->() const noexcept
|
||||
{
|
||||
return d->get();
|
||||
}
|
||||
|
||||
@@ -294,11 +294,16 @@ public:
|
||||
* \return true if the managed object has already been deleted, false otherwise.
|
||||
*/
|
||||
bool expired() const noexcept;
|
||||
/*!
|
||||
* \brief operator *
|
||||
* \return pointer to the document
|
||||
*/
|
||||
App::Document* operator*() const noexcept;
|
||||
/*!
|
||||
* \brief operator ->
|
||||
* \return pointer to the document
|
||||
*/
|
||||
App::Document* operator->() noexcept;
|
||||
App::Document* operator->() const noexcept;
|
||||
|
||||
private:
|
||||
// disable
|
||||
@@ -334,10 +339,15 @@ public:
|
||||
*/
|
||||
DocumentObjectWeakPtrT& operator= (App::DocumentObject* p);
|
||||
/*!
|
||||
* \brief operator ->
|
||||
* \return pointer to the document
|
||||
* \brief operator *
|
||||
* \return pointer to the document object
|
||||
*/
|
||||
App::DocumentObject* operator->() noexcept;
|
||||
App::DocumentObject* operator*() const noexcept;
|
||||
/*!
|
||||
* \brief operator ->
|
||||
* \return pointer to the document object
|
||||
*/
|
||||
App::DocumentObject* operator->() const noexcept;
|
||||
/*!
|
||||
* \brief operator ==
|
||||
* \return true if both objects are equal, false otherwise
|
||||
@@ -400,6 +410,13 @@ public:
|
||||
ptr = p;
|
||||
return *this;
|
||||
}
|
||||
/*!
|
||||
* \brief operator ->
|
||||
* \return pointer to the document object
|
||||
*/
|
||||
T* operator*() const {
|
||||
return ptr.get<T>();
|
||||
}
|
||||
/*!
|
||||
* \brief operator ->
|
||||
* \return pointer to the document object
|
||||
|
||||
@@ -123,7 +123,7 @@ void DocumentObserverPython::slotCreatedDocument(const App::Document& Doc)
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyCreatedDocument.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -137,7 +137,7 @@ void DocumentObserverPython::slotDeletedDocument(const App::Document& Doc)
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyDeletedDocument.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -151,7 +151,7 @@ void DocumentObserverPython::slotRelabelDocument(const App::Document& Doc)
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyRelabelDocument.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -165,7 +165,7 @@ void DocumentObserverPython::slotActivateDocument(const App::Document& Doc)
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyActivateDocument.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -179,7 +179,7 @@ void DocumentObserverPython::slotUndoDocument(const App::Document& Doc)
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyUndoDocument.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -194,7 +194,7 @@ void DocumentObserverPython::slotRedoDocument(const App::Document& Doc)
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyRedoDocument.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -260,7 +260,7 @@ void DocumentObserverPython::slotBeforeChangeDocument(const App::Document& Doc,
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
// If a property is touched but not part of a document object then its name is null.
|
||||
// In this case the slot function must not be called.
|
||||
const char* prop_name = Doc.getPropertyName(&Prop);
|
||||
@@ -280,7 +280,7 @@ void DocumentObserverPython::slotChangedDocument(const App::Document& Doc, const
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
// If a property is touched but not part of a document object then its name is null.
|
||||
// In this case the slot function must not be called.
|
||||
const char* prop_name = Doc.getPropertyName(&Prop);
|
||||
@@ -300,7 +300,7 @@ void DocumentObserverPython::slotCreatedObject(const App::DocumentObject& Obj)
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::DocumentObject&>(Obj).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
|
||||
Base::pyCall(pyCreatedObject.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -314,7 +314,7 @@ void DocumentObserverPython::slotDeletedObject(const App::DocumentObject& Obj)
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::DocumentObject&>(Obj).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
|
||||
Base::pyCall(pyDeletedObject.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -329,7 +329,7 @@ void DocumentObserverPython::slotBeforeChangeObject(const App::DocumentObject& O
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(const_cast<App::DocumentObject&>(Obj).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
|
||||
// If a property is touched but not part of a document object then its name is null.
|
||||
// In this case the slot function must not be called.
|
||||
const char* prop_name = Obj.getPropertyName(&Prop);
|
||||
@@ -350,7 +350,7 @@ void DocumentObserverPython::slotChangedObject(const App::DocumentObject& Obj,
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(const_cast<App::DocumentObject&>(Obj).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
|
||||
// If a property is touched but not part of a document object then its name is null.
|
||||
// In this case the slot function must not be called.
|
||||
const char* prop_name = Obj.getPropertyName(&Prop);
|
||||
@@ -370,7 +370,7 @@ void DocumentObserverPython::slotRecomputedObject(const App::DocumentObject& Obj
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::DocumentObject&>(Obj).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
|
||||
Base::pyCall(pyRecomputedObject.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -384,7 +384,7 @@ void DocumentObserverPython::slotRecomputedDocument(const App::Document& doc)
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
Base::pyCall(pyRecomputedDocument.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -398,7 +398,7 @@ void DocumentObserverPython::slotBeforeRecomputeDocument(const App::Document& do
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
Base::pyCall(pyBeforeRecomputeDocument.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -412,7 +412,7 @@ void DocumentObserverPython::slotOpenTransaction(const App::Document& doc, std::
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
args.setItem(1, Py::String(str));
|
||||
Base::pyCall(pyOpenTransaction.ptr(),args.ptr());
|
||||
}
|
||||
@@ -427,7 +427,7 @@ void DocumentObserverPython::slotCommitTransaction(const App::Document& doc)
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
Base::pyCall(pyCommitTransaction.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -441,7 +441,7 @@ void DocumentObserverPython::slotAbortTransaction(const App::Document& doc)
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
Base::pyCall(pyAbortTransaction.ptr(),args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
@@ -456,7 +456,7 @@ void DocumentObserverPython::slotAppendDynamicProperty(const App::Property& Prop
|
||||
try {
|
||||
auto container = Prop.getContainer();
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(container->getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(container->getPyObject()));
|
||||
// If a property is touched but not part of a document object then its name is null.
|
||||
// In this case the slot function must not be called.
|
||||
const char* prop_name = container->getPropertyName(&Prop);
|
||||
@@ -477,7 +477,7 @@ void DocumentObserverPython::slotRemoveDynamicProperty(const App::Property& Prop
|
||||
try {
|
||||
auto container = Prop.getContainer();
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(container->getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(container->getPyObject()));
|
||||
// If a property is touched but not part of a document object then its name is null.
|
||||
// In this case the slot function must not be called.
|
||||
const char* prop_name = container->getPropertyName(&Prop);
|
||||
@@ -498,7 +498,7 @@ void DocumentObserverPython::slotChangePropertyEditor(const App::Document &, con
|
||||
try {
|
||||
auto container = Prop.getContainer();
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(container->getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(container->getPyObject()));
|
||||
// If a property is touched but not part of a document object then its name is null.
|
||||
// In this case the slot function must not be called.
|
||||
const char* prop_name = container->getPropertyName(&Prop);
|
||||
@@ -518,7 +518,7 @@ void DocumentObserverPython::slotStartSaveDocument(const App::Document& doc, con
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
args.setItem(1, Py::String(file));
|
||||
Base::pyCall(pyStartSaveDocument.ptr(),args.ptr());
|
||||
}
|
||||
@@ -533,7 +533,7 @@ void DocumentObserverPython::slotFinishSaveDocument(const App::Document& doc, co
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
args.setItem(1, Py::String(file));
|
||||
Base::pyCall(pyFinishSaveDocument.ptr(),args.ptr());
|
||||
}
|
||||
@@ -548,7 +548,7 @@ void DocumentObserverPython::slotBeforeAddingDynamicExtension(const App::Extensi
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(const_cast<App::ExtensionContainer&>(extcont).getPyObject()));
|
||||
args.setItem(0, Py::asObject(const_cast<App::ExtensionContainer&>(extcont).getPyObject()));
|
||||
args.setItem(1, Py::String(extension));
|
||||
Base::pyCall(pyBeforeAddingDynamicExtension.ptr(),args.ptr());
|
||||
}
|
||||
@@ -563,7 +563,7 @@ void DocumentObserverPython::slotAddedDynamicExtension(const App::ExtensionConta
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::Object(const_cast<App::ExtensionContainer&>(extcont).getPyObject()));
|
||||
args.setItem(0, Py::asObject(const_cast<App::ExtensionContainer&>(extcont).getPyObject()));
|
||||
args.setItem(1, Py::String(extension));
|
||||
Base::pyCall(pyAddedDynamicExtension.ptr(),args.ptr());
|
||||
}
|
||||
|
||||
@@ -1517,7 +1517,7 @@ void OperatorExpression::_toString(std::ostream &s, bool persistent,int) const
|
||||
leftOperator = static_cast<OperatorExpression*>(left)->op;
|
||||
if (left->priority() < priority()) // Check on operator priority first
|
||||
needsParens = true;
|
||||
else if (leftOperator == op) { // Equal priority?
|
||||
else if (leftOperator == op) { // Same operator ?
|
||||
if (!isLeftAssociative())
|
||||
needsParens = true;
|
||||
//else if (!isCommutative())
|
||||
@@ -1588,14 +1588,14 @@ void OperatorExpression::_toString(std::ostream &s, bool persistent,int) const
|
||||
rightOperator = static_cast<OperatorExpression*>(right)->op;
|
||||
if (right->priority() < priority()) // Check on operator priority first
|
||||
needsParens = true;
|
||||
else if (rightOperator == op) { // Equal priority?
|
||||
else if (rightOperator == op) { // Same operator ?
|
||||
if (!isRightAssociative())
|
||||
needsParens = true;
|
||||
else if (!isCommutative())
|
||||
needsParens = true;
|
||||
}
|
||||
else if (right->priority() == priority()) {
|
||||
if (!isRightAssociative())
|
||||
else if (right->priority() == priority()) { // Same priority ?
|
||||
if (!isRightAssociative() || rightOperator == MOD)
|
||||
needsParens = true;
|
||||
}
|
||||
|
||||
@@ -3193,7 +3193,7 @@ static int column;
|
||||
|
||||
// show the parser the lexer method
|
||||
#define yylex ExpressionParserlex
|
||||
int ExpressionParserlex(void);
|
||||
int ExpressionParserlex();
|
||||
|
||||
// Parser, defined in ExpressionParser.y
|
||||
# define YYTOKENTYPE
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "Application.h"
|
||||
|
||||
// inclution of the generated files (generated out of PropertyContainerPy.xml)
|
||||
// inclusion of the generated files (generated out of PropertyContainerPy.xml)
|
||||
#include <App/ExtensionPy.h>
|
||||
#include <App/ExtensionPy.cpp>
|
||||
|
||||
|
||||
@@ -111,7 +111,8 @@ def InitApplications():
|
||||
AddPath = FreeCAD.ConfigGet("AdditionalModulePaths").split(";")
|
||||
HomeMod = FreeCAD.getUserAppDataDir()+"Mod"
|
||||
HomeMod = os.path.realpath(HomeMod)
|
||||
MacroDir = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro").GetString("MacroPath")
|
||||
MacroStd = App.getUserMacroDir(False)
|
||||
MacroDir = App.getUserMacroDir(True)
|
||||
MacroMod = os.path.realpath(MacroDir+"/Mod")
|
||||
SystemWideMacroDir = FreeCAD.getHomePath()+'Macro'
|
||||
SystemWideMacroDir = os.path.realpath(SystemWideMacroDir)
|
||||
@@ -278,6 +279,7 @@ def InitApplications():
|
||||
for i in path:
|
||||
Log(" " + i + "\n")
|
||||
# add MacroDir to path (RFE #0000504)
|
||||
sys.path.append(MacroStd)
|
||||
sys.path.append(MacroDir)
|
||||
# add SystemWideMacroDir to path
|
||||
sys.path.append(SystemWideMacroDir)
|
||||
|
||||
+23
-14
@@ -11,37 +11,46 @@
|
||||
FatherNamespace="App">
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Jürgen Riegel" EMail="FreeCAD@juergen-riegel.net" />
|
||||
<UserDocu>This class does the whole placement and position handling</UserDocu>
|
||||
<UserDocu>App.GeoFeature class.\n
|
||||
Base class of all geometric document objects.
|
||||
This class does the whole placement and position handling.
|
||||
With the method `getPropertyOfGeometry` is possible to obtain
|
||||
the main geometric property in general form, without reference
|
||||
to any particular property name.</UserDocu>
|
||||
</Documentation>
|
||||
<Methode Name="getPaths">
|
||||
<Documentation>
|
||||
<UserDocu>returns all possible paths to the root of the document</UserDocu>
|
||||
<UserDocu>getPaths()\n
|
||||
Returns all possible paths to the root of the document.
|
||||
Note: Not implemented.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getGlobalPlacement">
|
||||
<Documentation>
|
||||
<UserDocu>Returns the placement of the object in the global coordinate space, respecting all stacked relationships.
|
||||
Note: This function is not available during recompute, as there the placements of parents can change
|
||||
after the execution of this object, rendering the result wrong.</UserDocu>
|
||||
<UserDocu>getGlobalPlacement() -> Base.Placement\n
|
||||
Returns the placement of the object in the global coordinate space, respecting all stacked
|
||||
relationships.
|
||||
Note: This function is not available during recompute, as there the placements of parents
|
||||
can change after the execution of this object, rendering the result wrong.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getPropertyNameOfGeometry">
|
||||
<Documentation>
|
||||
<UserDocu>Returns the property name of the actual geometry or None.
|
||||
For example for a part object it returns the value Shape,
|
||||
for a mesh the value Mesh and so on.
|
||||
<UserDocu>getPropertyNameOfGeometry() -> str or None\n
|
||||
Returns the property name of the actual geometry.
|
||||
For example for a Part feature it returns the value 'Shape', for a mesh feature the value
|
||||
'Mesh' and so on.
|
||||
If an object has no such property then None is returned.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getPropertyOfGeometry">
|
||||
<Documentation>
|
||||
<UserDocu>Returns the property of the actual geometry or None.
|
||||
For example for a part object it returns its Shape property,
|
||||
for a mesh its Mesh property and so on.
|
||||
<UserDocu>getPropertyOfGeometry() -> object or None\n
|
||||
Returns the property of the actual geometry.
|
||||
For example for a Part feature it returns its Shape property, for a Mesh feature its
|
||||
Mesh property and so on.
|
||||
If an object has no such property then None is returned.
|
||||
Unlike to getPropertyNameOfGeometry this function returns the geometry,
|
||||
not its name.
|
||||
</UserDocu>
|
||||
Unlike to getPropertyNameOfGeometry this function returns the geometry, not its name.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<CustomAttributes />
|
||||
|
||||
+9
-9
@@ -148,7 +148,7 @@ void LinkParams::removeCopyOnChangeApplyToAll() {
|
||||
|
||||
EXTENSION_PROPERTY_SOURCE(App::LinkBaseExtension, App::DocumentObjectExtension)
|
||||
|
||||
LinkBaseExtension::LinkBaseExtension(void)
|
||||
LinkBaseExtension::LinkBaseExtension()
|
||||
:enableLabelCache(false),hasOldSubElement(false),hasCopyOnChange(true)
|
||||
{
|
||||
initExtensionType(LinkBaseExtension::getExtensionClassTypeId());
|
||||
@@ -166,7 +166,7 @@ LinkBaseExtension::~LinkBaseExtension()
|
||||
{
|
||||
}
|
||||
|
||||
PyObject* LinkBaseExtension::getExtensionPyObject(void) {
|
||||
PyObject* LinkBaseExtension::getExtensionPyObject() {
|
||||
if (ExtensionPythonObject.is(Py::_None())){
|
||||
// ref counter is set to 1
|
||||
ExtensionPythonObject = Py::Object(new LinkBaseExtensionPy(this),true);
|
||||
@@ -293,7 +293,7 @@ void LinkBaseExtension::setProperty(int idx, Property *prop) {
|
||||
|
||||
static const char _GroupPrefix[] = "Configuration (";
|
||||
|
||||
App::DocumentObjectExecReturn *LinkBaseExtension::extensionExecute(void) {
|
||||
App::DocumentObjectExecReturn *LinkBaseExtension::extensionExecute() {
|
||||
// The actual value of LinkTouched is not important, just to notify view
|
||||
// provider that the link (in fact, its dependents, i.e. linked ones) have
|
||||
// recomputed.
|
||||
@@ -398,7 +398,7 @@ App::DocumentObjectExecReturn *LinkBaseExtension::extensionExecute(void) {
|
||||
return inherited::extensionExecute();
|
||||
}
|
||||
|
||||
short LinkBaseExtension::extensionMustExecute(void) {
|
||||
short LinkBaseExtension::extensionMustExecute() {
|
||||
auto link = getLink();
|
||||
if(!link)
|
||||
return 0;
|
||||
@@ -554,7 +554,7 @@ void LinkBaseExtension::syncCopyOnChange()
|
||||
// so the last object will be the copy of the original linked object
|
||||
auto newLinked = copiedObjs.back();
|
||||
|
||||
// We are coping from the original linked object and we've already mutated
|
||||
// We are copying from the original linked object and we've already mutated
|
||||
// it, so we need to copy all CopyOnChange properties from the mutated
|
||||
// object to the new copy.
|
||||
std::vector<App::Property*> propList;
|
||||
@@ -2226,7 +2226,7 @@ template class AppExport ExtensionPythonT<LinkBaseExtension>;
|
||||
|
||||
EXTENSION_PROPERTY_SOURCE(App::LinkExtension, App::LinkBaseExtension)
|
||||
|
||||
LinkExtension::LinkExtension(void)
|
||||
LinkExtension::LinkExtension()
|
||||
{
|
||||
initExtensionType(LinkExtension::getExtensionClassTypeId());
|
||||
|
||||
@@ -2266,7 +2266,7 @@ bool Link::canLinkProperties() const {
|
||||
|
||||
namespace App {
|
||||
PROPERTY_SOURCE_TEMPLATE(App::LinkPython, App::Link)
|
||||
template<> const char* App::LinkPython::getViewProviderName(void) const {
|
||||
template<> const char* App::LinkPython::getViewProviderName() const {
|
||||
return "Gui::ViewProviderLinkPython";
|
||||
}
|
||||
template class AppExport FeaturePythonT<App::Link>;
|
||||
@@ -2293,7 +2293,7 @@ bool LinkElement::canDelete() const {
|
||||
|
||||
namespace App {
|
||||
PROPERTY_SOURCE_TEMPLATE(App::LinkElementPython, App::LinkElement)
|
||||
template<> const char* App::LinkElementPython::getViewProviderName(void) const {
|
||||
template<> const char* App::LinkElementPython::getViewProviderName() const {
|
||||
return "Gui::ViewProviderLinkPython";
|
||||
}
|
||||
template class AppExport FeaturePythonT<App::LinkElement>;
|
||||
@@ -2312,7 +2312,7 @@ LinkGroup::LinkGroup() {
|
||||
|
||||
namespace App {
|
||||
PROPERTY_SOURCE_TEMPLATE(App::LinkGroupPython, App::LinkGroup)
|
||||
template<> const char* App::LinkGroupPython::getViewProviderName(void) const {
|
||||
template<> const char* App::LinkGroupPython::getViewProviderName() const {
|
||||
return "Gui::ViewProviderLinkPython";
|
||||
}
|
||||
template class AppExport FeaturePythonT<App::LinkGroup>;
|
||||
|
||||
+7
-7
@@ -286,8 +286,8 @@ public:
|
||||
bool extensionGetLinkedObject(DocumentObject *&ret,
|
||||
bool recurse, Base::Matrix4D *mat, bool transform, int depth) const override;
|
||||
|
||||
virtual App::DocumentObjectExecReturn *extensionExecute(void) override;
|
||||
virtual short extensionMustExecute(void) override;
|
||||
virtual App::DocumentObjectExecReturn *extensionExecute() override;
|
||||
virtual short extensionMustExecute() override;
|
||||
virtual void extensionOnChanged(const Property* p) override;
|
||||
virtual void onExtendedUnsetupObject () override;
|
||||
virtual void onExtendedDocumentRestored() override;
|
||||
@@ -296,7 +296,7 @@ public:
|
||||
virtual int extensionIsElementVisible(const char *) override;
|
||||
virtual bool extensionHasChildElement() const override;
|
||||
|
||||
virtual PyObject* getExtensionPyObject(void) override;
|
||||
virtual PyObject* getExtensionPyObject() override;
|
||||
|
||||
virtual Property *extensionGetPropertyByName(const char* name) const override;
|
||||
|
||||
@@ -536,9 +536,9 @@ public:
|
||||
|
||||
LINK_PROPS_DEFINE(LINK_PARAMS_LINK)
|
||||
|
||||
Link(void);
|
||||
Link();
|
||||
|
||||
const char* getViewProviderName(void) const override{
|
||||
const char* getViewProviderName() const override{
|
||||
return "Gui::ViewProviderLink";
|
||||
}
|
||||
|
||||
@@ -581,7 +581,7 @@ public:
|
||||
LINK_PROPS_DEFINE(LINK_PARAMS_ELEMENT)
|
||||
|
||||
LinkElement();
|
||||
const char* getViewProviderName(void) const override{
|
||||
const char* getViewProviderName() const override{
|
||||
return "Gui::ViewProviderLink";
|
||||
}
|
||||
|
||||
@@ -620,7 +620,7 @@ public:
|
||||
|
||||
LinkGroup();
|
||||
|
||||
const char* getViewProviderName(void) const override{
|
||||
const char* getViewProviderName() const override{
|
||||
return "Gui::ViewProviderLink";
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,11 @@ Metadata::Metadata(const fs::path& metadataFile)
|
||||
auto errHandler = std::make_unique<MetadataInternal::XMLErrorHandler>();
|
||||
_parser->setErrorHandler(errHandler.get());
|
||||
|
||||
#if defined (FC_OS_WIN32)
|
||||
_parser->parse(reinterpret_cast<const XMLCh*>(metadataFile.wstring().c_str()));
|
||||
#else
|
||||
_parser->parse(metadataFile.string().c_str());
|
||||
#endif
|
||||
|
||||
auto doc = _parser->getDocument();
|
||||
_dom = doc->getDocumentElement();
|
||||
@@ -448,6 +452,7 @@ bool Metadata::satisfies(const Meta::Dependency& dep)
|
||||
std::map<std::string, std::string>& config = App::Application::Config();
|
||||
replacements.insert(std::make_pair("$BuildVersionMajor", config["BuildVersionMajor"]));
|
||||
replacements.insert(std::make_pair("$BuildVersionMinor", config["BuildVersionMinor"]));
|
||||
replacements.insert(std::make_pair("$BuildVersionMinor", config["BuildVersionPoint"]));
|
||||
replacements.insert(std::make_pair("$BuildRevision", config["BuildRevision"]));
|
||||
for (const auto& replacement : replacements) {
|
||||
auto pos = injectedString.find(replacement.first);
|
||||
@@ -492,7 +497,10 @@ bool App::Metadata::supportsCurrentFreeCAD() const
|
||||
if (fcVersion == Meta::Version()) {
|
||||
std::map<std::string, std::string>& config = App::Application::Config();
|
||||
std::stringstream ss;
|
||||
ss << config["BuildVersionMajor"] << "." << config["BuildVersionMinor"] << "." << (config["BuildRevision"].empty() ? "0" : config["BuildRevision"]);
|
||||
ss << config["BuildVersionMajor"]
|
||||
<< "." << config["BuildVersionMinor"]
|
||||
<< "." << config["BuildVersionPoint"]
|
||||
<< "." << (config["BuildRevision"].empty() ? "0" : config["BuildRevision"]);
|
||||
fcVersion = Meta::Version(ss.str());
|
||||
}
|
||||
|
||||
|
||||
+88
-62
@@ -16,181 +16,207 @@
|
||||
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Chris Hennes" EMail="chennes@pioneerlibrarysystem.org" />
|
||||
<UserDocu>
|
||||
Metadata
|
||||
A Metadata object reads an XML-formatted package metadata file and provides read-only access to its contents.
|
||||
|
||||
A single constructor is supported:
|
||||
Metadata(file) -- Reads the XML file and provides access to the metadata it specifies.
|
||||
</UserDocu>
|
||||
<UserDocu>App.Metadata class.\n
|
||||
A Metadata object reads an XML-formatted package metadata file and provides
|
||||
read-only access to its contents.\n
|
||||
The following constructors are supported:\n
|
||||
Metadata()
|
||||
Empty constructor.\n
|
||||
Metadata(metadata)
|
||||
Copy constructor.
|
||||
metadata : App.Metadata\n
|
||||
Metadata(file)
|
||||
Reads the XML file and provides access to the metadata it specifies.
|
||||
file : str\n XML file name.</UserDocu>
|
||||
<DeveloperDocu>Metadata</DeveloperDocu>
|
||||
</Documentation>
|
||||
|
||||
<Attribute Name="Name" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>String: the name of this item</UserDocu>
|
||||
<UserDocu>String representing the name of this item.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Name" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Version" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>String: the version of this item in semantic triplet format</UserDocu>
|
||||
<UserDocu>String representing the version of this item in semantic triplet format.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Version" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Description" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>String: the description of this item (text only, no markup allowed)</UserDocu>
|
||||
<UserDocu>String representing the description of this item (text only, no markup allowed).</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Description" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Maintainer" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>List of maintainer objects with 'name' and 'email' string attributes</UserDocu>
|
||||
<UserDocu>List of maintainer objects with 'name' and 'email' string attributes.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Maintainer" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="License" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>List of applicable licenses as objects with 'name' and 'file' string attributes</UserDocu>
|
||||
<UserDocu>List of applicable licenses as objects with 'name' and 'file' string attributes.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="License" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Urls" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
List of URLs as objects with 'location' and 'type' string attributes, where type is one of:
|
||||
* website
|
||||
* repository
|
||||
* bugtracker
|
||||
* readme
|
||||
* documentation
|
||||
</UserDocu>
|
||||
<UserDocu>List of URLs as objects with 'location' and 'type' string attributes, where type
|
||||
is one of:
|
||||
* website
|
||||
* repository
|
||||
* bugtracker
|
||||
* readme
|
||||
* documentation</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Urls" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Author" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>List of author objects, each with a 'name' and a (potentially empty) 'email' string attribute</UserDocu>
|
||||
<UserDocu>List of author objects, each with a 'name' and a (potentially empty) 'email'
|
||||
string attribute.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Author" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Depend" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
List of dependencies, as objects with the following attributes:
|
||||
* package -- Required: must exactly match the contents of the 'name' element in the referenced package's package.xml file
|
||||
* version_lt -- Optional: The dependency to the package is restricted to versions less than the stated version number
|
||||
* version_lte -- Optional: The dependency to the package is restricted to versions less or equal than the stated version number
|
||||
* version_eq -- Optional: The dependency to the package is restricted to a version equal than the stated version number
|
||||
* version_gte -- Optional: The dependency to the package is restricted to versions greater or equal than the stated version number
|
||||
* version_gt -- Optional: The dependency to the package is restricted to versions greater than the stated version number
|
||||
* condition -- Optional: Conditional expression as documented in REP149
|
||||
</UserDocu>
|
||||
<UserDocu>List of dependencies, as objects with the following attributes:
|
||||
* package
|
||||
Required. Must exactly match the contents of the 'name' element in the
|
||||
referenced package's package.xml file.
|
||||
* version_lt
|
||||
Optional. The dependency to the package is restricted to versions less than
|
||||
the stated version number.
|
||||
* version_lte
|
||||
Optional. The dependency to the package is restricted to versions less or
|
||||
equal than the stated version number.
|
||||
* version_eq
|
||||
Optional. The dependency to the package is restricted to a version equal
|
||||
than the stated version number.
|
||||
* version_gte
|
||||
Optional. The dependency to the package is restricted to versions greater
|
||||
or equal than the stated version number.
|
||||
* version_gt
|
||||
Optional. The dependency to the package is restricted to versions greater
|
||||
than the stated version number.
|
||||
* condition
|
||||
Optional. Conditional expression as documented in REP149.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Depend" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Conflict" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>List of conflicts, format identical to dependencies</UserDocu>
|
||||
<UserDocu>List of conflicts, format identical to dependencies.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Conflict" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Replace" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>List of things this item is considered by its author to replace: format identical to dependencies</UserDocu>
|
||||
<UserDocu>List of things this item is considered by its author to replace. The format is
|
||||
identical to dependencies.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Replace" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Tag" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>List of strings</UserDocu>
|
||||
<UserDocu>List of strings.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Tag" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Icon" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Relative path to an icon file</UserDocu>
|
||||
<UserDocu>Relative path to an icon file.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Icon" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Classname" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>String: the name of the main Python class this item creates/represents</UserDocu>
|
||||
<UserDocu>String representing the name of the main Python class this item
|
||||
creates/represents.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Classname" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Subdirectory" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>String: the name of the subdirectory this content item is located in. If empty, the item is in a directory named the same as the content item.</UserDocu>
|
||||
<UserDocu>String representing the name of the subdirectory this content item is located in.
|
||||
If empty, the item is in a directory named the same as the content item.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Subdirectory" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="File" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>A list of files associated with this item -- the meaning of each file is implementation-defined</UserDocu>
|
||||
<UserDocu>List of files associated with this item.
|
||||
The meaning of each file is implementation-defined.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="File" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Content" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>A dictionary of lists of content items: defined recursively, each item is itself a Metadata object -- see package.xml file format documentation for details</UserDocu>
|
||||
<UserDocu>Dictionary of lists of content items: defined recursively, each item is itself
|
||||
a Metadata object.
|
||||
See package.xml file format documentation for details.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Content" Type="Object" />
|
||||
</Attribute>
|
||||
|
||||
<Attribute Name="FreeCADMin">
|
||||
<Documentation>
|
||||
<UserDocu>A string representing the minimum version of FreeCAD needed for this item. If unset it will be 0.0.0.</UserDocu>
|
||||
<UserDocu>String representing the minimum version of FreeCAD needed for this item.
|
||||
If unset it will be 0.0.0.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="FreeCADMin" Type="Object" />
|
||||
</Attribute>
|
||||
|
||||
<Attribute Name="FreeCADMax">
|
||||
<Documentation>
|
||||
<UserDocu>A string representing the maximum version of FreeCAD needed for this item. If unset it will be 0.0.0.</UserDocu>
|
||||
<UserDocu>String representing the maximum version of FreeCAD needed for this item.
|
||||
If unset it will be 0.0.0.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="FreeCADMax" Type="Object" />
|
||||
</Attribute>
|
||||
|
||||
<Methode Name="getLastSupportedFreeCADVersion">
|
||||
<Documentation>
|
||||
<UserDocu>getLastSupportedFreeCADVersion()
|
||||
Search through all content package items, and determine if a maximum supported version of FreeCAD
|
||||
is set. Returns None if no maximum version is set, or if *any* content item fails to provide a
|
||||
maximum version (implying that that content item will work with all known versions).
|
||||
</UserDocu>
|
||||
<UserDocu>getLastSupportedFreeCADVersion() -> str or None\n
|
||||
Search through all content package items, and determine if a maximum supported
|
||||
version of FreeCAD is set.
|
||||
Returns None if no maximum version is set, or if *any* content item fails to
|
||||
provide a maximum version (implying that that content item will work with all
|
||||
known versions).</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
|
||||
<Methode Name="getFirstSupportedFreeCADVersion">
|
||||
<Documentation>
|
||||
<UserDocu>getFirstSupportedFreeCADVersion()
|
||||
Search through all content package items, and determine if a minimum supported version of FreeCAD
|
||||
is set. Returns 0.0 if no minimum version is set, or if *any* content item fails to provide a
|
||||
minimum version (implying that that content item will work with all known versions -- technically
|
||||
limited to 0.20 as the lowest known version since the metadata standard was added then).
|
||||
</UserDocu>
|
||||
<UserDocu>getFirstSupportedFreeCADVersion() -> str or None\n
|
||||
Search through all content package items, and determine if a minimum supported
|
||||
version of FreeCAD is set.
|
||||
Returns 0.0 if no minimum version is set, or if *any* content item fails to
|
||||
provide a minimum version (implying that that content item will work with all
|
||||
known versions. Technically limited to 0.20 as the lowest known version since
|
||||
the metadata standard was added then).</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
|
||||
<Methode Name="supportsCurrentFreeCAD">
|
||||
<Documentation>
|
||||
<UserDocu>supportsCurrentFreeCAD()
|
||||
Returns false if this metadata object directly indicates that it does not support the current
|
||||
version of FreeCAD, or true if it makes no indication, or specifically indicates that it does
|
||||
support the current version. Does not recurse into Content items.
|
||||
</UserDocu>
|
||||
<UserDocu>supportsCurrentFreeCAD() -> bool\n
|
||||
Returns False if this metadata object directly indicates that it does not
|
||||
support the current version of FreeCAD, or True if it makes no indication, or
|
||||
specifically indicates that it does support the current version. Does not
|
||||
recurse into Content items.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
|
||||
<Methode Name="getGenericMetadata">
|
||||
<Documentation>
|
||||
<UserDocu>getGenericMetadata(name)
|
||||
Get the list of GenericMetadata objects with key 'name'. Generic metadata objects are Python objects with
|
||||
a string 'contents' and a dictionary of strings, 'attributes'. They represent unrecognized simple XML tags
|
||||
in the metadata file.
|
||||
</UserDocu>
|
||||
<UserDocu>getGenericMetadata(name) -> list\n
|
||||
Get the list of GenericMetadata objects with key 'name'.
|
||||
Generic metadata objects are Python objects with a string 'contents' and a
|
||||
dictionary of strings, 'attributes'. They represent unrecognized simple XML tags
|
||||
in the metadata file.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
|
||||
|
||||
+17
-10
@@ -23,6 +23,7 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "Metadata.h"
|
||||
#include <Base/FileInfo.h>
|
||||
|
||||
// inclusion of the generated files (generated out of MetadataPy.xml)
|
||||
#include "MetadataPy.h"
|
||||
@@ -34,7 +35,7 @@ XERCES_CPP_NAMESPACE_USE
|
||||
// Returns a string which represents the object e.g. when printed in Python
|
||||
std::string MetadataPy::representation(void) const
|
||||
{
|
||||
MetadataPy::PointerType ptr = reinterpret_cast<MetadataPy::PointerType>(_pcTwinPointer);
|
||||
MetadataPy::PointerType ptr = getMetadataPtr();
|
||||
std::stringstream str;
|
||||
str << "Metadata [Name=(";
|
||||
str << ptr->name();
|
||||
@@ -64,10 +65,13 @@ int MetadataPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
|
||||
// Main class constructor -- takes a file path, loads the metadata from it
|
||||
PyErr_Clear();
|
||||
const char* filename;
|
||||
if (PyArg_ParseTuple(args, "s", &filename)) {
|
||||
char* filename;
|
||||
if (PyArg_ParseTuple(args, "et", "utf-8", &filename)) {
|
||||
try {
|
||||
auto md = new Metadata(filename);
|
||||
std::string utf8Name = std::string(filename);
|
||||
PyMem_Free(filename);
|
||||
|
||||
auto md = new Metadata(Base::FileInfo::stringToPath(utf8Name));
|
||||
setTwinPointer(md);
|
||||
return 0;
|
||||
}
|
||||
@@ -288,10 +292,11 @@ Py::Object MetadataPy::getContent(void) const
|
||||
PyObject* MetadataPy::getGenericMetadata(PyObject* args)
|
||||
{
|
||||
const char* name;
|
||||
if (!PyArg_ParseTuple(args, "s!", &name))
|
||||
if (!PyArg_ParseTuple(args, "s", &name))
|
||||
return nullptr;
|
||||
|
||||
auto gm = (*getMetadataPtr())[name];
|
||||
auto pyGenericMetadata = new Py::List;
|
||||
Py::List pyGenericMetadata;
|
||||
for (const auto& item : gm) {
|
||||
Py::Dict pyItem;
|
||||
pyItem["contents"] = Py::String(item.contents);
|
||||
@@ -300,12 +305,12 @@ PyObject* MetadataPy::getGenericMetadata(PyObject* args)
|
||||
pyAttributes[attribute.first] = Py::String(attribute.second);
|
||||
}
|
||||
pyItem["attributes"] = pyAttributes;
|
||||
pyGenericMetadata->append(pyItem);
|
||||
pyGenericMetadata.append(pyItem);
|
||||
}
|
||||
return pyGenericMetadata->ptr();
|
||||
return Py::new_reference_to(pyGenericMetadata);
|
||||
}
|
||||
|
||||
Py::Object MetadataPy::getFreeCADMin() const
|
||||
Py::Object MetadataPy::getFreeCADMin() const
|
||||
{
|
||||
return Py::String(getMetadataPtr()->freecadmin().str());
|
||||
}
|
||||
@@ -316,10 +321,11 @@ void MetadataPy::setFreeCADMin(Py::Object args)
|
||||
PyObject* p = args.ptr();
|
||||
if (!PyArg_ParseTuple(p, "s", &version))
|
||||
return;
|
||||
|
||||
getMetadataPtr()->setFreeCADMin(App::Meta::Version(version));
|
||||
}
|
||||
|
||||
Py::Object MetadataPy::getFreeCADMax() const
|
||||
Py::Object MetadataPy::getFreeCADMax() const
|
||||
{
|
||||
return Py::String(getMetadataPtr()->freecadmax().str());
|
||||
}
|
||||
@@ -330,6 +336,7 @@ void MetadataPy::setFreeCADMax(Py::Object args)
|
||||
PyObject* p = args.ptr();
|
||||
if (!PyArg_ParseTuple(p, "s", &version))
|
||||
return;
|
||||
|
||||
getMetadataPtr()->setFreeCADMax(App::Meta::Version(version));
|
||||
}
|
||||
|
||||
|
||||
@@ -12,126 +12,139 @@
|
||||
DisableNotify="true">
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
|
||||
<UserDocu>This is a Persistence class</UserDocu>
|
||||
<UserDocu>App.PropertyContainer class.</UserDocu>
|
||||
</Documentation>
|
||||
<Methode Name="getPropertyByName">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
getPropertyByName(name,checkOwner=0)
|
||||
|
||||
Return the value of a named property. Note that the returned property may not
|
||||
always belong to this container (e.g. from a linked object).
|
||||
|
||||
* name: name of the property
|
||||
* checkOwner: 0: just return the property
|
||||
1: raise exception if not found or the property
|
||||
does not belong to this container
|
||||
2: return a tuple(owner,property_value)
|
||||
</UserDocu>
|
||||
<UserDocu>getPropertyByName(name, checkOwner=0) -> object or Tuple\n
|
||||
Returns the value of a named property. Note that the returned property may not
|
||||
always belong to this container (e.g. from a linked object).\n
|
||||
name : str\n Name of the property.
|
||||
checkOwner : int\n 0: just return the property.
|
||||
1: raise exception if not found or the property does not belong to this container.
|
||||
2: return a tuple (owner, propertyValue).</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getPropertyTouchList">
|
||||
<Documentation>
|
||||
<UserDocu>Return a list of index of touched values for list type properties.</UserDocu>
|
||||
<UserDocu>getPropertyTouchList(name) -> tuple\n
|
||||
Returns a list of index of touched values for list type properties.\n
|
||||
name : str\n Property name.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getTypeOfProperty">
|
||||
<Documentation>
|
||||
<UserDocu>Return the type of a named property. This can be (Hidden,ReadOnly,Output) or any combination. </UserDocu>
|
||||
<UserDocu>getTypeOfProperty(name) -> list\n
|
||||
Returns the type of a named property. This can be a list conformed by elements in
|
||||
(Hidden, NoRecompute, NoPersist, Output, ReadOnly, Transient).\n
|
||||
name : str\n Property name.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getTypeIdOfProperty">
|
||||
<Documentation>
|
||||
<UserDocu>Returns the C++ class name of a named property.</UserDocu>
|
||||
<UserDocu>getTypeIdOfProperty(name) -> str\n
|
||||
Returns the C++ class name of a named property.\n
|
||||
name : str\n Property name.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setEditorMode">
|
||||
<Documentation>
|
||||
<UserDocu>Set the behaviour of the property in the property editor.
|
||||
0 - default behaviour
|
||||
1 - item is ready-only
|
||||
2 - item is hidden
|
||||
</UserDocu>
|
||||
<UserDocu>setEditorMode(name, type) -> None\n
|
||||
Set the behaviour of the property in the property editor.\n
|
||||
name : str\n Property name.
|
||||
type : int, sequence of str\n Property type.
|
||||
0: default behaviour. 1: item is ready-only. 2: item is hidden. 3: item is hidden and read-only.
|
||||
If sequence, the available items are 'ReadOnly' and 'Hidden'.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getEditorMode">
|
||||
<Documentation>
|
||||
<UserDocu>Get the behaviour of the property in the property editor.
|
||||
It returns a list of strings with the current mode. If the list is empty there are no special restrictions.
|
||||
If the list contains 'ReadOnly' then the item appears in the property editor but is disabled.
|
||||
If the list contains 'Hidden' then the item even doesn't appear in the property editor.
|
||||
</UserDocu>
|
||||
<UserDocu>getEditorMode(name) -> list\n
|
||||
Get the behaviour of the property in the property editor.
|
||||
It returns a list of strings with the current mode. If the list is empty there are no
|
||||
special restrictions.
|
||||
If the list contains 'ReadOnly' then the item appears in the property editor but is
|
||||
disabled.
|
||||
If the list contains 'Hidden' then the item even doesn't appear in the property editor.\n
|
||||
name : str\n Property name.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getGroupOfProperty">
|
||||
<Documentation>
|
||||
<UserDocu>Return the name of the group which the property belongs to in this class. The properties sorted in different named groups for convenience.</UserDocu>
|
||||
<UserDocu>getGroupOfProperty(name) -> str\n
|
||||
Returns the name of the group which the property belongs to in this class.
|
||||
The properties are sorted in different named groups for convenience.\n
|
||||
name : str\n Property name.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setGroupOfProperty">
|
||||
<Documentation>
|
||||
<UserDocu>Set the name of the group of a dynamic property.</UserDocu>
|
||||
<UserDocu>setGroupOfProperty(name, group) -> None\n
|
||||
Set the name of the group of a dynamic property.\n
|
||||
name : str\n Property name.
|
||||
group : str\n Group name.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setPropertyStatus">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
setPropertyStatus(name,val): Set property status
|
||||
|
||||
name(String): property name
|
||||
|
||||
val(String|Int|[String|Int...]): text or integer value, or list/tuple of
|
||||
values. Call getPropertyStatus() to get a list of supported text value.
|
||||
If the text start with '-' or the integer value is negative, then the
|
||||
status is cleared.
|
||||
</UserDocu>
|
||||
<UserDocu>setPropertyStatus(name, val) -> None\n
|
||||
Set property status.\n
|
||||
name : str\n Property name.
|
||||
val : int, str, sequence of str or int\n Call getPropertyStatus() to get a list of supported text value.
|
||||
If the text start with '-' or the integer value is negative, then the status is cleared.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getPropertyStatus">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
getPropertyStatus(name=''): Get property status.
|
||||
|
||||
name(String): property name. If name is empty, return a list of supported
|
||||
text names of the status.
|
||||
</UserDocu>
|
||||
<UserDocu>getPropertyStatus(name='') -> list\n
|
||||
Get property status.\n
|
||||
name : str\n Property name. If empty, returns a list of supported text names of the status.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getDocumentationOfProperty">
|
||||
<Documentation>
|
||||
<UserDocu>Return the documentation string of the property of this class.</UserDocu>
|
||||
<UserDocu>getDocumentationOfProperty(name) -> str\n
|
||||
Returns the documentation string of the property of this class.\n
|
||||
name : str\n Property name.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setDocumentationOfProperty">
|
||||
<Documentation>
|
||||
<UserDocu>Set the documentation string of a dynamic property of this class.</UserDocu>
|
||||
<UserDocu>setDocumentationOfProperty(name, docstring) -> None\n
|
||||
Set the documentation string of a dynamic property of this class.\n
|
||||
name : str\n Property name.
|
||||
docstring : str\n Documentation string.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getEnumerationsOfProperty">
|
||||
<Documentation>
|
||||
<UserDocu>Return all enumeration strings of the property of this class or None if not a PropertyEnumeration.</UserDocu>
|
||||
<UserDocu>getEnumerationsOfProperty(name) -> list or None\n
|
||||
Return all enumeration strings of the property of this class or None if not a
|
||||
PropertyEnumeration.\n
|
||||
name : str\n Property name.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="dumpPropertyContent" Keyword="true" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>Dumps the content of the property, both the XML representation as well as the additional datafiles
|
||||
required, into a byte representation. It will be returned as byte array.
|
||||
dumpPropertyContent(propertyname) -- returns a byte array with full content
|
||||
dumpPropertyContent(propertyname, [Compression=1-9]) -- Sets the data compression from 0 (no) to 9 (max)
|
||||
</UserDocu>
|
||||
<UserDocu>dumpPropertyContent(Property, Compression=3) -> bytearray\n
|
||||
Dumps the content of the property, both the XML representation and the additional
|
||||
data files required, into a byte representation.\n
|
||||
Property : str\n Property Name.
|
||||
Compression : int\n Set the data compression level in the range [0, 9]. Set to 0 for no compression.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="restorePropertyContent">
|
||||
<Documentation>
|
||||
<UserDocu>Restore the content of given property from a byte representation as stored by \"dumpContent\".
|
||||
It could be restored from any python object implementing the buffer protocol.
|
||||
restorePropertyContent(propertyname, buffer) -- restores from the given byte array
|
||||
</UserDocu>
|
||||
<UserDocu>restorePropertyContent(name, obj) -> None\n
|
||||
Restore the content of the object from a byte representation as stored by `dumpPropertyContent`.
|
||||
It could be restored from any Python object implementing the buffer protocol.\n
|
||||
name : str\n Property name.
|
||||
obj : buffer\n Object with buffer protocol support.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Attribute Name="PropertiesList" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>A list of all property names</UserDocu>
|
||||
<UserDocu>A list of all property names.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="PropertiesList" Type="List"/>
|
||||
</Attribute>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <boost/iostreams/device/array.hpp>
|
||||
#include <boost/iostreams/stream.hpp>
|
||||
|
||||
// inclution of the generated files (generated out of PropertyContainerPy.xml)
|
||||
// inclusion of the generated files (generated out of PropertyContainerPy.xml)
|
||||
#include "PropertyContainerPy.h"
|
||||
#include "PropertyContainerPy.cpp"
|
||||
|
||||
@@ -54,16 +54,24 @@ PyObject* PropertyContainerPy::getPropertyByName(PyObject *args)
|
||||
int checkOwner=0;
|
||||
if (!PyArg_ParseTuple(args, "s|i", &pstr, &checkOwner))
|
||||
return nullptr;
|
||||
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(pstr);
|
||||
if (prop) {
|
||||
if(!checkOwner || (checkOwner==1 && prop->getContainer()==getPropertyContainerPtr()))
|
||||
return prop->getPyObject();
|
||||
Py::TupleN res(Py::asObject(prop->getContainer()->getPyObject()),
|
||||
Py::asObject(prop->getPyObject()));
|
||||
return Py::new_reference_to(res);
|
||||
|
||||
if (checkOwner < 0 || checkOwner > 2) {
|
||||
PyErr_SetString(PyExc_ValueError, "'checkOwner' expected in the range [0, 2]");
|
||||
return nullptr;
|
||||
}
|
||||
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", pstr);
|
||||
return nullptr;
|
||||
|
||||
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(pstr);
|
||||
if (!prop) {
|
||||
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", pstr);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!checkOwner || (checkOwner==1 && prop->getContainer()==getPropertyContainerPtr()))
|
||||
return prop->getPyObject();
|
||||
|
||||
Py::TupleN res(Py::asObject(prop->getContainer()->getPyObject()), Py::asObject(prop->getPyObject()));
|
||||
|
||||
return Py::new_reference_to(res);
|
||||
}
|
||||
|
||||
PyObject* PropertyContainerPy::getPropertyTouchList(PyObject *args)
|
||||
@@ -71,6 +79,7 @@ PyObject* PropertyContainerPy::getPropertyTouchList(PyObject *args)
|
||||
char *pstr;
|
||||
if (!PyArg_ParseTuple(args, "s", &pstr))
|
||||
return nullptr;
|
||||
|
||||
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(pstr);
|
||||
if (prop && prop->isDerivedFrom(PropertyLists::getClassTypeId())) {
|
||||
const auto &touched = static_cast<PropertyLists*>(prop)->getTouchList();
|
||||
@@ -80,11 +89,14 @@ PyObject* PropertyContainerPy::getPropertyTouchList(PyObject *args)
|
||||
ret.setItem(i++,Py::Long(idx));
|
||||
return Py::new_reference_to(ret);
|
||||
}
|
||||
else if(!prop)
|
||||
else if (!prop) {
|
||||
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", pstr);
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
PyErr_Format(PyExc_AttributeError, "Property '%s' is not of list type", pstr);
|
||||
return nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* PropertyContainerPy::getTypeOfProperty(PyObject *args)
|
||||
@@ -168,7 +180,7 @@ PyObject* PropertyContainerPy::setEditorMode(PyObject *args)
|
||||
status.reset(Property::ReadOnly);
|
||||
status.reset(Property::Hidden);
|
||||
for (Py::Sequence::iterator it = seq.begin();it!=seq.end();++it) {
|
||||
std::string str = (std::string)Py::String(*it);
|
||||
std::string str = static_cast<std::string>(Py::String(*it));
|
||||
if (str == "ReadOnly")
|
||||
status.set(Property::ReadOnly);
|
||||
else if (str == "Hidden")
|
||||
@@ -210,28 +222,30 @@ PyObject* PropertyContainerPy::setPropertyStatus(PyObject *args)
|
||||
PyObject *pyValue;
|
||||
if (!PyArg_ParseTuple(args, "sO", &name, &pyValue))
|
||||
return nullptr;
|
||||
|
||||
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(name);
|
||||
if (!prop) {
|
||||
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", name);
|
||||
return nullptr;
|
||||
}
|
||||
auto linkProp = Base::freecad_dynamic_cast<App::PropertyLinkBase>(prop);
|
||||
|
||||
auto linkProp = Base::freecad_dynamic_cast<App::PropertyLinkBase>(prop);
|
||||
std::bitset<32> status(prop->getStatus());
|
||||
size_t count = 1;
|
||||
bool isSeq = false;
|
||||
if(PyList_Check(pyValue) || PyTuple_Check(pyValue)) {
|
||||
if (PyList_Check(pyValue) || PyTuple_Check(pyValue)) {
|
||||
isSeq = true;
|
||||
count = PySequence_Size(pyValue);
|
||||
}
|
||||
for(size_t i=0;i<count;++i) {
|
||||
|
||||
for(size_t i=0; i<count; ++i) {
|
||||
Py::Object item;
|
||||
if(isSeq)
|
||||
if (isSeq)
|
||||
item = Py::Object(PySequence_GetItem(pyValue,i));
|
||||
else
|
||||
item = Py::Object(pyValue);
|
||||
bool value = true;
|
||||
if(item.isString()) {
|
||||
if (item.isString()) {
|
||||
const auto &statusMap = getStatusMap();
|
||||
auto v = (std::string)Py::String(item);
|
||||
if(v.size()>1 && v[0] == '-') {
|
||||
@@ -248,7 +262,8 @@ PyObject* PropertyContainerPy::setPropertyStatus(PyObject *args)
|
||||
return nullptr;
|
||||
}
|
||||
status.set(it->second,value);
|
||||
}else if(item.isNumeric()) {
|
||||
}
|
||||
else if (item.isNumeric()) {
|
||||
int v = Py::Int(item);
|
||||
if(v<0) {
|
||||
value = false;
|
||||
@@ -257,7 +272,8 @@ PyObject* PropertyContainerPy::setPropertyStatus(PyObject *args)
|
||||
if(v==0 || v>31)
|
||||
PyErr_Format(PyExc_ValueError, "Status value out of range '%d'", v);
|
||||
status.set(v,value);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError, "Expects status type to be Int or String");
|
||||
return nullptr;
|
||||
}
|
||||
@@ -275,31 +291,34 @@ PyObject* PropertyContainerPy::getPropertyStatus(PyObject *args)
|
||||
|
||||
Py::List ret;
|
||||
const auto &statusMap = getStatusMap();
|
||||
if(!name[0]) {
|
||||
if (!name[0]) {
|
||||
for(auto &v : statusMap)
|
||||
ret.append(Py::String(v.first.c_str()));
|
||||
}else{
|
||||
}
|
||||
else {
|
||||
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(name);
|
||||
if (prop) {
|
||||
if (!prop) {
|
||||
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", name);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto linkProp = Base::freecad_dynamic_cast<App::PropertyLinkBase>(prop);
|
||||
if(linkProp && linkProp->testFlag(App::PropertyLinkBase::LinkAllowPartial))
|
||||
ret.append(Py::String("AllowPartial"));
|
||||
auto linkProp = Base::freecad_dynamic_cast<App::PropertyLinkBase>(prop);
|
||||
if (linkProp && linkProp->testFlag(App::PropertyLinkBase::LinkAllowPartial))
|
||||
ret.append(Py::String("AllowPartial"));
|
||||
|
||||
std::bitset<32> bits(prop->getStatus());
|
||||
for(size_t i=1;i<bits.size();++i) {
|
||||
if(!bits[i]) continue;
|
||||
bool found = false;
|
||||
for(auto &v : statusMap) {
|
||||
if(v.second == (int)i) {
|
||||
ret.append(Py::String(v.first.c_str()));
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
std::bitset<32> bits(prop->getStatus());
|
||||
for(size_t i=1; i<bits.size(); ++i) {
|
||||
if(!bits[i]) continue;
|
||||
bool found = false;
|
||||
for(auto &v : statusMap) {
|
||||
if(v.second == static_cast<int>(i)) {
|
||||
ret.append(Py::String(v.first.c_str()));
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
if(!found)
|
||||
ret.append(Py::Int((long)i));
|
||||
}
|
||||
if (!found)
|
||||
ret.append(Py::Int(static_cast<long>(i)));
|
||||
}
|
||||
}
|
||||
return Py::new_reference_to(ret);
|
||||
@@ -312,6 +331,11 @@ PyObject* PropertyContainerPy::getEditorMode(PyObject *args)
|
||||
return nullptr;
|
||||
|
||||
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(name);
|
||||
if (!prop) {
|
||||
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", name);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Py::List ret;
|
||||
if (prop) {
|
||||
short Type = prop->getType();
|
||||
@@ -357,7 +381,8 @@ PyObject* PropertyContainerPy::setGroupOfProperty(PyObject *args)
|
||||
}
|
||||
prop->getContainer()->changeDynamicProperty(prop,group,nullptr);
|
||||
Py_Return;
|
||||
} PY_CATCH
|
||||
}
|
||||
PY_CATCH
|
||||
}
|
||||
|
||||
|
||||
@@ -373,9 +398,9 @@ PyObject* PropertyContainerPy::getDocumentationOfProperty(PyObject *args)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char* Group = getPropertyContainerPtr()->getPropertyDocumentation(prop);
|
||||
if (Group)
|
||||
return Py::new_reference_to(Py::String(Group));
|
||||
const char* docstr = getPropertyContainerPtr()->getPropertyDocumentation(prop);
|
||||
if (docstr)
|
||||
return Py::new_reference_to(Py::String(docstr));
|
||||
else
|
||||
return Py::new_reference_to(Py::String(""));
|
||||
}
|
||||
@@ -395,7 +420,8 @@ PyObject* PropertyContainerPy::setDocumentationOfProperty(PyObject *args)
|
||||
}
|
||||
prop->getContainer()->changeDynamicProperty(prop,nullptr,doc);
|
||||
Py_Return;
|
||||
} PY_CATCH
|
||||
}
|
||||
PY_CATCH
|
||||
}
|
||||
|
||||
PyObject* PropertyContainerPy::getEnumerationsOfProperty(PyObject *args)
|
||||
@@ -411,13 +437,10 @@ PyObject* PropertyContainerPy::getEnumerationsOfProperty(PyObject *args)
|
||||
}
|
||||
|
||||
PropertyEnumeration *enumProp = dynamic_cast<PropertyEnumeration*>(prop);
|
||||
if (!enumProp) {
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
if (!enumProp)
|
||||
Py_Return;
|
||||
|
||||
std::vector<std::string> enumerations = enumProp->getEnumVector();
|
||||
|
||||
Py::List ret;
|
||||
for (std::vector<std::string>::const_iterator it = enumerations.begin(); it != enumerations.end(); ++it) {
|
||||
ret.append(Py::String(*it));
|
||||
@@ -432,7 +455,7 @@ Py::List PropertyContainerPy::getPropertiesList(void) const
|
||||
|
||||
getPropertyContainerPtr()->getPropertyMap(Map);
|
||||
|
||||
for (std::map<std::string,Property*>::const_iterator It=Map.begin();It!=Map.end();++It)
|
||||
for (std::map<std::string,Property*>::const_iterator It=Map.begin(); It!=Map.end(); ++It)
|
||||
ret.append(Py::String(It->first));
|
||||
|
||||
return ret;
|
||||
@@ -442,12 +465,11 @@ Py::List PropertyContainerPy::getPropertiesList(void) const
|
||||
PyObject* PropertyContainerPy::dumpPropertyContent(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
int compression = 3;
|
||||
char* property;
|
||||
static char* kwds_def[] = {"Property", "Compression",nullptr};
|
||||
const char* property;
|
||||
static char* kwds_def[] = {"Property", "Compression", nullptr};
|
||||
PyErr_Clear();
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|i", kwds_def, &property, &compression)) {
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|i", kwds_def, &property, &compression))
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Property* prop = getPropertyContainerPtr()->getPropertyByName(property);
|
||||
if (!prop) {
|
||||
|
||||
@@ -179,7 +179,7 @@ private:
|
||||
typedef boost::adjacency_list< boost::listS, boost::vecS, boost::directedS > DiGraph;
|
||||
typedef std::pair<int, int> Edge;
|
||||
// Note: use std::map instead of unordered_map to keep the binding order stable
|
||||
#ifdef FC_OS_MACOSX
|
||||
#if defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
|
||||
typedef std::map<App::ObjectIdentifier, ExpressionInfo> ExpressionMap;
|
||||
#else
|
||||
typedef std::map<const App::ObjectIdentifier, ExpressionInfo> ExpressionMap;
|
||||
|
||||
@@ -1034,7 +1034,6 @@ PyObject *PropertyLinkSub::getPyObject(void)
|
||||
Py::Tuple tup(2);
|
||||
Py::List list(static_cast<int>(_cSubList.size()));
|
||||
if (_pcLinkSub) {
|
||||
_pcLinkSub->getPyObject();
|
||||
tup[0] = Py::asObject(_pcLinkSub->getPyObject());
|
||||
for(unsigned int i = 0;i<_cSubList.size(); i++)
|
||||
list[i] = Py::String(_cSubList[i]);
|
||||
|
||||
+23
-9
@@ -37,7 +37,7 @@ using namespace App;
|
||||
const int App::CellAddress::MAX_ROWS = 16384;
|
||||
const int App::CellAddress::MAX_COLUMNS = 26 * 26 + 26;
|
||||
|
||||
Range::Range(const char * range)
|
||||
Range::Range(const char * range, bool normalize)
|
||||
{
|
||||
std::string from;
|
||||
std::string to;
|
||||
@@ -62,28 +62,42 @@ Range::Range(const char * range)
|
||||
row_end = end.row();
|
||||
col_end = end.col();
|
||||
|
||||
if (normalize)
|
||||
this->normalize();
|
||||
row_curr = row_begin;
|
||||
col_curr = col_begin;
|
||||
}
|
||||
|
||||
Range::Range(int _row_begin, int _col_begin, int _row_end, int _col_end)
|
||||
: row_curr(_row_begin)
|
||||
, col_curr(_col_begin)
|
||||
, row_begin(_row_begin)
|
||||
Range::Range(int _row_begin, int _col_begin, int _row_end, int _col_end, bool normalize)
|
||||
: row_begin(_row_begin)
|
||||
, col_begin(_col_begin)
|
||||
, row_end(_row_end)
|
||||
, col_end(_col_end)
|
||||
{
|
||||
if (normalize)
|
||||
this->normalize();
|
||||
row_curr = row_begin;
|
||||
col_curr = col_begin;
|
||||
}
|
||||
|
||||
Range::Range(const CellAddress &from, const CellAddress &to)
|
||||
: row_curr(from.row())
|
||||
, col_curr(from.col())
|
||||
, row_begin(from.row())
|
||||
Range::Range(const CellAddress &from, const CellAddress &to, bool normalize)
|
||||
: row_begin(from.row())
|
||||
, col_begin(from.col())
|
||||
, row_end(to.row())
|
||||
, col_end(to.col())
|
||||
{
|
||||
if (normalize)
|
||||
this->normalize();
|
||||
row_curr = row_begin;
|
||||
col_curr = col_begin;
|
||||
}
|
||||
|
||||
void Range::normalize()
|
||||
{
|
||||
if (row_begin > row_end)
|
||||
std::swap(row_begin, row_end);
|
||||
if (col_begin > col_end)
|
||||
std::swap(col_begin, col_end);
|
||||
}
|
||||
|
||||
bool Range::next()
|
||||
|
||||
+6
-3
@@ -117,14 +117,17 @@ protected:
|
||||
|
||||
class AppExport Range {
|
||||
public:
|
||||
Range(const char *range);
|
||||
Range(const char *range, bool normalize=false);
|
||||
|
||||
Range(int _row_begin, int _col_begin, int _row_end, int _col_end);
|
||||
Range(int _row_begin, int _col_begin, int _row_end, int _col_end, bool normalize=false);
|
||||
|
||||
Range(const CellAddress & from, const CellAddress & to);
|
||||
Range(const CellAddress & from, const CellAddress & to, bool normalize=false);
|
||||
|
||||
bool next();
|
||||
|
||||
/** Make sure the range starts from top left and ends with bottom right corner **/
|
||||
void normalize();
|
||||
|
||||
/** Current row */
|
||||
inline int row() const { return row_curr; }
|
||||
|
||||
|
||||
@@ -194,9 +194,12 @@ void Transaction::addObjectNew(TransactionalObject *Obj)
|
||||
auto pos = index.find(Obj);
|
||||
if (pos != index.end()) {
|
||||
if (pos->second->status == TransactionObject::Del) {
|
||||
delete pos->second;
|
||||
delete pos->first;
|
||||
// first remove the item from the container before deleting it
|
||||
auto second = pos->second;
|
||||
auto first = pos->first;
|
||||
index.erase(pos);
|
||||
delete second;
|
||||
delete first;
|
||||
}
|
||||
else {
|
||||
pos->second->status = TransactionObject::New;
|
||||
|
||||
@@ -69,7 +69,7 @@ int AxisPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
|
||||
PyErr_Clear();
|
||||
PyObject* d;
|
||||
if (PyArg_ParseTuple(args, "O!O", &(Base::VectorPy::Type), &o,
|
||||
if (PyArg_ParseTuple(args, "O!O!", &(Base::VectorPy::Type), &o,
|
||||
&(Base::VectorPy::Type), &d)) {
|
||||
// NOTE: The first parameter defines the base (origin) and the second the direction.
|
||||
*getAxisPtr() = Base::Axis(static_cast<Base::VectorPy*>(o)->value(),
|
||||
|
||||
+120
-72
@@ -14,196 +14,244 @@
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
|
||||
<DeveloperDocu>This is the BoundBox export class</DeveloperDocu>
|
||||
<UserDocu>Bound box class
|
||||
A bounding box is an orthographic cube which is a way to describe outer boundaries.
|
||||
You get a bounding box from a lot of 3D types. It is often used to check if a 3D
|
||||
entity lies in the range of another object. Checking for bounding interference first
|
||||
can save a lot of computing time!
|
||||
|
||||
Constructor:
|
||||
App.BoundBox([Xmin,Ymin,Zmin,Xmax,Ymax,Zmax])
|
||||
App.BoundBox(Tuple, Tuple)
|
||||
App.BoundBox(Vector, Vector)
|
||||
App.BoundBox(BoundBox)
|
||||
</UserDocu>
|
||||
<UserDocu>Base.BoundBox class.\n
|
||||
This class represents a bounding box.
|
||||
A bounding box is a rectangular cuboid which is a way to describe outer
|
||||
boundaries and is obtained from a lot of 3D types.
|
||||
It is often used to check if a 3D entity lies in the range of another object.
|
||||
Checking for bounding interference first can save a lot of computing time!
|
||||
An invalid BoundBox is represented by inconsistent values at each direction:
|
||||
The maximum float value of the system at the minimum coordinates, and the
|
||||
opposite value at the maximum coordinates.\n
|
||||
The following constructors are supported:\n
|
||||
BoundBox()
|
||||
Empty constructor. Returns an invalid BoundBox.\n
|
||||
BoundBox(boundBox)
|
||||
Copy constructor.
|
||||
boundBox : Base.BoundBox\n
|
||||
BoundBox(xMin, yMin=0, zMin=0, xMax=0, yMax=0, zMax=0)
|
||||
Define from the minimum and maximum values at each direction.
|
||||
xMin : float\n Minimum value at x-coordinate.
|
||||
yMin : float\n Minimum value at y-coordinate.
|
||||
zMin : float\n Minimum value at z-coordinate.
|
||||
xMax : float\n Maximum value at x-coordinate.
|
||||
yMax : float\n Maximum value at y-coordinate.
|
||||
zMax : float\n Maximum value at z-coordinate.\n
|
||||
App.BoundBox(min, max)
|
||||
Define from two containers representing the minimum and maximum values of the
|
||||
coordinates in each direction.
|
||||
min : Base.Vector, tuple\n Minimum values of the coordinates.
|
||||
max : Base.Vector, tuple\n Maximum values of the coordinates.</UserDocu>
|
||||
</Documentation>
|
||||
<Methode Name="setVoid">
|
||||
<Documentation>
|
||||
<UserDocu>method setVoid()
|
||||
Invalidate the bounding box</UserDocu>
|
||||
<UserDocu>setVoid() -> None\n
|
||||
Invalidate the bounding box.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isValid">
|
||||
<Documentation>
|
||||
<UserDocu>method isValid()
|
||||
Checks if the bounding box is valid</UserDocu>
|
||||
<UserDocu>isValid() -> bool\n
|
||||
Checks if the bounding box is valid.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="add">
|
||||
<Documentation>
|
||||
<UserDocu>method add(BoundBox)
|
||||
Add (enlarge) the given BoundBox</UserDocu>
|
||||
<UserDocu>add(minMax) -> None
|
||||
add(x, y, z) -> None\n
|
||||
Increase the maximum values or decrease the minimum values of this BoundBox by
|
||||
replacing the current values with the given values, so the bounding box can grow
|
||||
but not shrink.\n
|
||||
minMax : Base.Vector, tuple\n Values to enlarge at each direction.
|
||||
x : float\n Value to enlarge at x-direction.
|
||||
y : float\n Value to enlarge at y-direction.
|
||||
z : float\n Value to enlarge at z-direction.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getPoint">
|
||||
<Documentation>
|
||||
<UserDocu>method getPoint(Int)
|
||||
Get the point of the given index. The index must be in the range of [0,7]
|
||||
</UserDocu>
|
||||
<UserDocu>getPoint(index) ->Base.Vector\n
|
||||
Get the point of the given index.
|
||||
The index must be in the range of [0, 7].\n
|
||||
index : int</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getEdge">
|
||||
<Documentation>
|
||||
<UserDocu>method getEdge(Int)
|
||||
Get the edge points of the given index. The index must be in the range of [0,11]
|
||||
</UserDocu>
|
||||
<UserDocu>getEdge(index) -> tuple of Base.Vector\n
|
||||
Get the edge points of the given index.
|
||||
The index must be in the range of [0, 11].\n
|
||||
index : int</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="closestPoint">
|
||||
<Documentation>
|
||||
<UserDocu>method closestPoint(Vector)
|
||||
Get the closest point of the bounding box to the given point
|
||||
</UserDocu>
|
||||
<UserDocu>closestPoint(point) -> Base.Vector
|
||||
closestPoint(x, y, z) -> Base.Vector\n
|
||||
Get the closest point of the bounding box to the given point.\n
|
||||
point : Base.Vector, tuple\n Coordinates of the given point.
|
||||
x : float\n X-coordinate of the given point.
|
||||
y : float\n Y-coordinate of the given point.
|
||||
z : float\n Z-coordinate of the given point.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="intersect">
|
||||
<Documentation>
|
||||
<UserDocu>method intersect(BoundBox|Vector Base, Vector Dir)
|
||||
Checks if the given object intersects with the BoundBox. That can be:
|
||||
- Another BoundBox
|
||||
- A line, specified by Base and Dir
|
||||
</UserDocu>
|
||||
<UserDocu>intersect(boundBox2) -> bool
|
||||
intersect(base, dir) -> bool\n
|
||||
Checks if the given object intersects with this bounding box. That can be
|
||||
another bounding box or a line specified by base and direction.\n
|
||||
boundBox2 : Base.BoundBox
|
||||
base : Base.Vector, tuple
|
||||
dir : Base.Vector, tuple</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="intersected">
|
||||
<Documentation>
|
||||
<UserDocu>method intersected(BoundBox)
|
||||
Returns the intersection of this and the given bounding box.
|
||||
</UserDocu>
|
||||
<UserDocu>intersected(boundBox2) -> Base.BoundBox\n
|
||||
Returns the intersection of this and the given bounding box.\n
|
||||
boundBox2 : Base.BoundBox</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="united">
|
||||
<Documentation>
|
||||
<UserDocu>method united(BoundBox)
|
||||
Returns the union of this and the given bounding box.
|
||||
</UserDocu>
|
||||
<UserDocu>united(boundBox2) -> Base.BoundBox\n
|
||||
Returns the union of this and the given bounding box.\n
|
||||
boundBox2 : Base.BoundBox</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="enlarge">
|
||||
<Documentation>
|
||||
<UserDocu>method enlarge(Float)
|
||||
Enlarge the BoundBox by the given value in each direction.
|
||||
A negative value shrinks the box.</UserDocu>
|
||||
<UserDocu>enlarge(variation) -> None\n
|
||||
Decrease the minimum values and increase the maximum values by the given value.
|
||||
A negative value shrinks the bounding box.\n
|
||||
variation : float</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
|
||||
<Methode Name="getIntersectionPoint">
|
||||
<Documentation>
|
||||
<UserDocu>method Vector getIntersectionPoint(Vector Base, Vector Dir, [float epsilon=0.0001])
|
||||
Calculate the intersection point of a line with the BoundBox
|
||||
The Base point must lie inside the bounding box, if not an
|
||||
exception is thrown.
|
||||
</UserDocu>
|
||||
<UserDocu>getIntersectionPoint(base, dir, epsilon=0.0001) -> Base.Vector\n
|
||||
Calculate the intersection point of a line with the bounding box.
|
||||
The base point must lie inside the bounding box, if not an exception is thrown.\n
|
||||
base : Base.Vector\n Base point of the line.
|
||||
dir : Base.Vector\n Direction of the line.
|
||||
epsilon : float\n Bounding box size tolerance.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="move">
|
||||
<Documentation>
|
||||
<UserDocu> method move(Vector)
|
||||
Move the BoundBox by the given vector
|
||||
</UserDocu>
|
||||
<UserDocu>move(displacement) -> None
|
||||
move(x, y, z) -> None\n
|
||||
Move the bounding box by the given values.\n
|
||||
displacement : Base.Vector, tuple\n Displacement at each direction.
|
||||
x : float\n Displacement at x-direction.
|
||||
y : float\n Displacement at y-direction.
|
||||
z : float\n Displacement at z-direction.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="scale">
|
||||
<Documentation>
|
||||
<UserDocu> method scale(x,y,z)
|
||||
Scale the BoundBox by the given values in x, y and z
|
||||
</UserDocu>
|
||||
<UserDocu>scale(factor) -> None
|
||||
scale(x, y, z) -> None\n
|
||||
Scale the bounding box by the given values.\n
|
||||
factor : Base.Vector, tuple\n Factor scale at each direction.
|
||||
x : float\n Scale at x-direction.
|
||||
y : float\n Scale at y-direction.
|
||||
z : float\n Scale at z-direction.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="transformed">
|
||||
<Documentation>
|
||||
<UserDocu> method transformed(Matrix)
|
||||
Return a new bounding box with the transformed corner of this bounding box
|
||||
</UserDocu>
|
||||
<UserDocu>transformed(matrix) -> Base.BoundBox\n
|
||||
Returns a new BoundBox containing the transformed rectangular cuboid
|
||||
represented by this BoundBox.\n
|
||||
matrix : Base.Matrix\n Transformation matrix.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isCutPlane">
|
||||
<Documentation>
|
||||
<UserDocu>method bool isCutPlane(Vector Base, Vector Normal)
|
||||
Check if the plane specified by Base and Normal intersects (cuts) the BoundBox</UserDocu>
|
||||
<UserDocu>isCutPlane(base, normal) -> bool\n
|
||||
Check if the plane specified by base and normal intersects (cuts) this bounding
|
||||
box.\n
|
||||
base : Base.Vector
|
||||
normal : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isInside">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
method bool isInside(Vector Base|BoundBox box)
|
||||
Check if the point or bounding box is inside this bounding box
|
||||
</UserDocu>
|
||||
<UserDocu>isInside(object) -> bool
|
||||
isInside(x, y, z) -> bool\n
|
||||
Check if a point or a bounding box is inside this bounding box.\n
|
||||
object : Base.Vector, Base.BoundBox\n Object to check if it is inside this bounding box.
|
||||
x : float\n X-coordinate of the point to check.
|
||||
y : float\n Y-coordinate of the point to check.
|
||||
z : float\n Z-coordinate of the point to check.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Attribute Name="Center" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Center point of the bounding box</UserDocu>
|
||||
<UserDocu>Center point of the bounding box.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Center" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="XMax" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The maximum x boundary position</UserDocu>
|
||||
<UserDocu>The maximum x boundary position.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="XMax" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="YMax" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The maximum y boundary position</UserDocu>
|
||||
<UserDocu>The maximum y boundary position.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="YMax" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="ZMax" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The maximum z boundary position</UserDocu>
|
||||
<UserDocu>The maximum z boundary position.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="ZMax" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="XMin" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The minimum x boundary position</UserDocu>
|
||||
<UserDocu>The minimum x boundary position.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="XMin" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="YMin" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The minimum y boundary position</UserDocu>
|
||||
<UserDocu>The minimum y boundary position.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="YMin" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="ZMin" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The minimum z boundary position</UserDocu>
|
||||
<UserDocu>The minimum z boundary position.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="ZMin" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="XLength" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Length of the BoundBox in x direction</UserDocu>
|
||||
<UserDocu>Length of the bounding box in x direction.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="XLength" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="YLength" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Length of the BoundBox in y direction</UserDocu>
|
||||
<UserDocu>Length of the bounding box in y direction.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="YLength" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="ZLength" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Length of the BoundBox in z direction</UserDocu>
|
||||
<UserDocu>Length of the bounding box in z direction.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="ZLength" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="DiagonalLength" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Diagonal length of the BoundBox</UserDocu>
|
||||
<UserDocu>Diagonal length of the bounding box.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="DiagonalLength" Type="Float" />
|
||||
</Attribute>
|
||||
|
||||
+24
-25
@@ -311,23 +311,22 @@ PyObject* BoundBoxPy::getIntersectionPoint(PyObject *args)
|
||||
{
|
||||
PyObject *object,*object2;
|
||||
double epsilon=0.0001;
|
||||
if (PyArg_ParseTuple(args,"O!O!|d:Need base and direction vector",
|
||||
&(Base::VectorPy::Type), &object,&(Base::VectorPy::Type), &object2, &epsilon)) {
|
||||
Base::Vector3d point;
|
||||
bool ok = getBoundBoxPtr()->IntersectionPoint(
|
||||
*(static_cast<Base::VectorPy*>(object)->getVectorPtr()),
|
||||
*(static_cast<Base::VectorPy*>(object2)->getVectorPtr()),
|
||||
point, epsilon);
|
||||
if (ok) {
|
||||
return new VectorPy(point);
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(Base::PyExc_FC_GeneralError, "No intersection");
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!PyArg_ParseTuple(args,"O!O!|d;Need base and direction vector",
|
||||
&(Base::VectorPy::Type), &object,&(Base::VectorPy::Type), &object2, &epsilon))
|
||||
return nullptr;
|
||||
|
||||
Base::Vector3d point;
|
||||
bool ok = getBoundBoxPtr()->IntersectionPoint(
|
||||
*(static_cast<Base::VectorPy*>(object)->getVectorPtr()),
|
||||
*(static_cast<Base::VectorPy*>(object2)->getVectorPtr()),
|
||||
point, epsilon);
|
||||
if (ok) {
|
||||
return new VectorPy(point);
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(Base::PyExc_FC_GeneralError, "No intersection");
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* BoundBoxPy::move(PyObject *args)
|
||||
@@ -344,13 +343,13 @@ PyObject* BoundBoxPy::move(PyObject *args)
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTuple(args,"O!:Need vector to move",&PyTuple_Type, &object)) {
|
||||
if (PyArg_ParseTuple(args,"O!",&PyTuple_Type, &object)) {
|
||||
vec = getVectorFromTuple<double>(object);
|
||||
break;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTuple(args,"O!:Need vector to move",&(Base::VectorPy::Type), &object)) {
|
||||
if (PyArg_ParseTuple(args,"O!",&(Base::VectorPy::Type), &object)) {
|
||||
vec = *(static_cast<Base::VectorPy*>(object)->getVectorPtr());
|
||||
break;
|
||||
}
|
||||
@@ -382,13 +381,13 @@ PyObject* BoundBoxPy::scale(PyObject *args)
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTuple(args,"O!:Need vector to scale",&PyTuple_Type, &object)) {
|
||||
if (PyArg_ParseTuple(args,"O!",&PyTuple_Type, &object)) {
|
||||
vec = getVectorFromTuple<double>(object);
|
||||
break;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTuple(args,"O!:Need vector to scale",&(Base::VectorPy::Type), &object)) {
|
||||
if (PyArg_ParseTuple(args,"O!",&(Base::VectorPy::Type), &object)) {
|
||||
vec = *(static_cast<Base::VectorPy*>(object)->getVectorPtr());
|
||||
break;
|
||||
}
|
||||
@@ -429,14 +428,14 @@ PyObject* BoundBoxPy::isCutPlane(PyObject *args)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (PyArg_ParseTuple(args,"O!O!:Need base and normal vector of a plane",
|
||||
if (!PyArg_ParseTuple(args,"O!O!;Need base and normal vector of a plane",
|
||||
&(Base::VectorPy::Type), &object,&(Base::VectorPy::Type), &object2))
|
||||
retVal = getBoundBoxPtr()->IsCutPlane(
|
||||
*(static_cast<Base::VectorPy*>(object)->getVectorPtr()),
|
||||
*(static_cast<Base::VectorPy*>(object2)->getVectorPtr()));
|
||||
else
|
||||
return nullptr;
|
||||
|
||||
retVal = getBoundBoxPtr()->IsCutPlane(
|
||||
*(static_cast<Base::VectorPy*>(object)->getVectorPtr()),
|
||||
*(static_cast<Base::VectorPy*>(object2)->getVectorPtr()));
|
||||
|
||||
return Py::new_reference_to(retVal);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
#include "Builder3D.h"
|
||||
#include "Console.h"
|
||||
#include "Exception.h"
|
||||
#include "FileInfo.h"
|
||||
#include "Matrix.h"
|
||||
#include "Stream.h"
|
||||
#include "Tools.h"
|
||||
|
||||
|
||||
@@ -320,7 +322,8 @@ void Builder3D::saveToLog()
|
||||
void Builder3D::saveToFile(const char* FileName)
|
||||
{
|
||||
result << "} ";
|
||||
std::ofstream file(FileName);
|
||||
Base::FileInfo fi(FileName);
|
||||
Base::ofstream file(fi);
|
||||
if(!file)
|
||||
throw FileException("Builder3D::saveToFile(): Can not open file...");
|
||||
|
||||
|
||||
@@ -266,7 +266,13 @@ std::stringstream &LogLevel::prefix(std::stringstream &str, const char *src, int
|
||||
PyFrameObject* frame = PyEval_GetFrame();
|
||||
if (frame) {
|
||||
line = PyFrame_GetLineNumber(frame);
|
||||
#if PY_VERSION_HEX < 0x030b0000
|
||||
src = PyUnicode_AsUTF8(frame->f_code->co_filename);
|
||||
#else
|
||||
PyCodeObject* code = PyFrame_GetCode(frame);
|
||||
src = PyUnicode_AsUTF8(code->co_filename);
|
||||
Py_DECREF(code);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (print_src && src && src[0]) {
|
||||
|
||||
@@ -14,68 +14,76 @@
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
|
||||
<DeveloperDocu>This is the CoordinateSystem export class</DeveloperDocu>
|
||||
<UserDocu></UserDocu>
|
||||
<UserDocu>Base.CoordinateSystem class.\n
|
||||
An orthonormal right-handed coordinate system in 3D space.\n
|
||||
CoordinateSystem()
|
||||
Empty constructor.</UserDocu>
|
||||
</Documentation>
|
||||
<Methode Name="setAxes">
|
||||
<Documentation>
|
||||
<UserDocu>setAxes(Axis or Vector z, Vector x)
|
||||
Set axis or z direction and x direction</UserDocu>
|
||||
<UserDocu>setAxes(axis, xDir) -> None\n
|
||||
Set axis or Z-direction, and X-direction.
|
||||
The X-direction is determined from the orthonormal compononent of `xDir`
|
||||
with respect to `axis` direction.\n
|
||||
axis : Base.Axis, Base.Vector
|
||||
xDir : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="displacement" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>displacement(CoordinateSystem)
|
||||
Computes the placement from this to the passed coordinate system</UserDocu>
|
||||
<UserDocu>displacement(coordSystem2) -> Base.Placement\n
|
||||
Computes the placement from this to the passed coordinate system `coordSystem2`.\n
|
||||
coordSystem2 : Base.CoordinateSystem</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="transformTo">
|
||||
<Documentation>
|
||||
<UserDocu>transformTo(Vector)
|
||||
Computes the coordinates of the point in coordinates of this system
|
||||
</UserDocu>
|
||||
<UserDocu>transformTo(vector) -> Base.Vector\n
|
||||
Computes the coordinates of the point in coordinates of this coordinate system.\n
|
||||
vector : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="transform">
|
||||
<Documentation>
|
||||
<UserDocu>transform(Rotation or Placement)
|
||||
Applies the rotation or placement on this coordinate system
|
||||
</UserDocu>
|
||||
<UserDocu>transform(trans) -> None\n
|
||||
Applies a transformation on this coordinate system.\n
|
||||
trans : Base.Rotation, Base.Placement</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setPlacement">
|
||||
<Documentation>
|
||||
<UserDocu>setPlacment(Placement)
|
||||
Set placement to the coordinate system.
|
||||
</UserDocu>
|
||||
<UserDocu>setPlacment(placement) -> None\n
|
||||
Set placement to the coordinate system.\n
|
||||
placement : Base.Placement</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Attribute Name="Axis" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>Set or get axis</UserDocu>
|
||||
<UserDocu>Set or get axis.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Axis" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="XDirection" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>Set or get x direction</UserDocu>
|
||||
<UserDocu>Set or get X-direction.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="XDirection" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="YDirection" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>Set or get y direction</UserDocu>
|
||||
<UserDocu>Set or get Y-direction.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="YDirection" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="ZDirection" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>Set or get z direction</UserDocu>
|
||||
<UserDocu>Set or get Z-direction.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="ZDirection" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Position" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>Set or get position</UserDocu>
|
||||
<UserDocu>Set or get position.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Position" Type="Object" />
|
||||
</Attribute>
|
||||
|
||||
@@ -181,11 +181,18 @@ std::string FileInfo::getTempFileName(const char* FileName, const char* Path)
|
||||
buf += "/fileXXXXXX";
|
||||
}
|
||||
|
||||
std::vector<char> vec;
|
||||
std::copy(buf.begin(), buf.end(), std::back_inserter(vec));
|
||||
vec.push_back('\0');
|
||||
|
||||
/* coverity[secure_temp] mkstemp uses 0600 as the mode and is safe */
|
||||
int id = mkstemp(const_cast<char*>(buf.c_str()));
|
||||
int id = mkstemp(vec.data());
|
||||
if (id > -1) {
|
||||
FILE* file = fdopen(id, "w");
|
||||
fclose(file);
|
||||
vec.pop_back(); // remove '\0'
|
||||
std::string str(vec.begin(), vec.end());
|
||||
buf.swap(str);
|
||||
unlink(buf.c_str());
|
||||
}
|
||||
return buf;
|
||||
@@ -512,6 +519,7 @@ bool FileInfo::copyTo(const char* NewName) const
|
||||
FileInfo fi1(FileName);
|
||||
FileInfo fi2(NewName);
|
||||
Base::ifstream file(fi1, std::ios::in | std::ios::binary);
|
||||
file.unsetf(std::ios_base::skipws);
|
||||
Base::ofstream copy(fi2, std::ios::out | std::ios::binary);
|
||||
file >> copy.rdbuf();
|
||||
return file.is_open() && copy.is_open();
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
Vector2dPy(Py::PythonClassInstance *self, Py::Tuple &args, Py::Dict &kwds);
|
||||
virtual ~Vector2dPy();
|
||||
|
||||
static void init_type(void);
|
||||
static void init_type();
|
||||
Py::Object getattro(const Py::String &name_);
|
||||
int setattro(const Py::String &name_, const Py::Object &value);
|
||||
virtual Py::Object repr();
|
||||
|
||||
@@ -524,6 +524,7 @@ void InterpreterSingleton::addPythonPath(const char* Path)
|
||||
list.append(Py::String(Path));
|
||||
}
|
||||
|
||||
#if PY_VERSION_HEX < 0x030b0000
|
||||
const char* InterpreterSingleton::init(int argc,char *argv[])
|
||||
{
|
||||
if (!Py_IsInitialized()) {
|
||||
@@ -566,6 +567,61 @@ const char* InterpreterSingleton::init(int argc,char *argv[])
|
||||
PyGILStateLocker lock;
|
||||
return Py_EncodeLocale(Py_GetPath(),nullptr);
|
||||
}
|
||||
#else
|
||||
namespace {
|
||||
void initInterpreter(int argc,char *argv[])
|
||||
{
|
||||
PyStatus status;
|
||||
PyConfig config;
|
||||
PyConfig_InitPythonConfig(&config);
|
||||
|
||||
status = PyConfig_SetBytesArgv(&config, argc, argv);
|
||||
if (PyStatus_Exception(status)) {
|
||||
throw Base::RuntimeError("Failed to set config");
|
||||
}
|
||||
|
||||
status = Py_InitializeFromConfig(&config);
|
||||
if (PyStatus_Exception(status)) {
|
||||
throw Base::RuntimeError("Failed to init from config");
|
||||
}
|
||||
|
||||
PyConfig_Clear(&config);
|
||||
|
||||
Py_Initialize();
|
||||
const char* virtualenv = getenv("VIRTUAL_ENV");
|
||||
if (virtualenv) {
|
||||
PyRun_SimpleString(
|
||||
"# Check for virtualenv, and activate if present.\n"
|
||||
"# See https://virtualenv.pypa.io/en/latest/userguide/#using-virtualenv-without-bin-python\n"
|
||||
"import os\n"
|
||||
"import sys\n"
|
||||
"base_path = os.getenv(\"VIRTUAL_ENV\")\n"
|
||||
"if not base_path is None:\n"
|
||||
" activate_this = os.path.join(base_path, \"bin\", \"activate_this.py\")\n"
|
||||
" exec(open(activate_this).read(), {'__file__':activate_this})\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
const char* InterpreterSingleton::init(int argc,char *argv[])
|
||||
{
|
||||
try {
|
||||
if (!Py_IsInitialized()) {
|
||||
initInterpreter(argc, argv);
|
||||
|
||||
PythonStdOutput::init_type();
|
||||
this->_global = PyEval_SaveThread();
|
||||
}
|
||||
|
||||
PyGILStateLocker lock;
|
||||
return Py_EncodeLocale(Py_GetPath(),nullptr);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
e.ReportException();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void InterpreterSingleton::replaceStdOutput()
|
||||
{
|
||||
|
||||
+16
-26
@@ -34,59 +34,49 @@
|
||||
using namespace Base;
|
||||
|
||||
Matrix4D::Matrix4D ()
|
||||
: dMtrx4D{{1.,0.,0.,0.},
|
||||
{0.,1.,0.,0.},
|
||||
{0.,0.,1.,0.},
|
||||
{0.,0.,0.,1.}}
|
||||
{
|
||||
setToUnity();
|
||||
}
|
||||
|
||||
Matrix4D::Matrix4D (float a11, float a12, float a13, float a14,
|
||||
float a21, float a22, float a23, float a24,
|
||||
float a31, float a32, float a33, float a34,
|
||||
float a41, float a42, float a43, float a44 )
|
||||
float a41, float a42, float a43, float a44)
|
||||
: dMtrx4D{{a11,a12,a13,a14},
|
||||
{a21,a22,a23,a24},
|
||||
{a31,a32,a33,a34},
|
||||
{a41,a42,a43,a44}}
|
||||
{
|
||||
dMtrx4D[0][0] = static_cast<double>(a11);
|
||||
dMtrx4D[0][1] = static_cast<double>(a12);
|
||||
dMtrx4D[0][2] = static_cast<double>(a13);
|
||||
dMtrx4D[0][3] = static_cast<double>(a14);
|
||||
dMtrx4D[1][0] = static_cast<double>(a21);
|
||||
dMtrx4D[1][1] = static_cast<double>(a22);
|
||||
dMtrx4D[1][2] = static_cast<double>(a23);
|
||||
dMtrx4D[1][3] = static_cast<double>(a24);
|
||||
dMtrx4D[2][0] = static_cast<double>(a31);
|
||||
dMtrx4D[2][1] = static_cast<double>(a32);
|
||||
dMtrx4D[2][2] = static_cast<double>(a33);
|
||||
dMtrx4D[2][3] = static_cast<double>(a34);
|
||||
dMtrx4D[3][0] = static_cast<double>(a41);
|
||||
dMtrx4D[3][1] = static_cast<double>(a42);
|
||||
dMtrx4D[3][2] = static_cast<double>(a43);
|
||||
dMtrx4D[3][3] = static_cast<double>(a44);
|
||||
}
|
||||
|
||||
Matrix4D::Matrix4D (double a11, double a12, double a13, double a14,
|
||||
double a21, double a22, double a23, double a24,
|
||||
double a31, double a32, double a33, double a34,
|
||||
double a41, double a42, double a43, double a44 )
|
||||
: dMtrx4D{{a11,a12,a13,a14},
|
||||
{a21,a22,a23,a24},
|
||||
{a31,a32,a33,a34},
|
||||
{a41,a42,a43,a44}}
|
||||
{
|
||||
dMtrx4D[0][0] = a11; dMtrx4D[0][1] = a12; dMtrx4D[0][2] = a13; dMtrx4D[0][3] = a14;
|
||||
dMtrx4D[1][0] = a21; dMtrx4D[1][1] = a22; dMtrx4D[1][2] = a23; dMtrx4D[1][3] = a24;
|
||||
dMtrx4D[2][0] = a31; dMtrx4D[2][1] = a32; dMtrx4D[2][2] = a33; dMtrx4D[2][3] = a34;
|
||||
dMtrx4D[3][0] = a41; dMtrx4D[3][1] = a42; dMtrx4D[3][2] = a43; dMtrx4D[3][3] = a44;
|
||||
}
|
||||
|
||||
|
||||
Matrix4D::Matrix4D (const Matrix4D& rclMtrx)
|
||||
Matrix4D::Matrix4D (const Matrix4D& rclMtrx) : Matrix4D()
|
||||
{
|
||||
(*this) = rclMtrx;
|
||||
}
|
||||
|
||||
Matrix4D::Matrix4D (const Vector3f& rclBase, const Vector3f& rclDir, float fAngle)
|
||||
: Matrix4D()
|
||||
{
|
||||
setToUnity();
|
||||
this->rotLine(rclBase,rclDir,fAngle);
|
||||
}
|
||||
|
||||
Matrix4D::Matrix4D (const Vector3d& rclBase, const Vector3d& rclDir, double fAngle)
|
||||
: Matrix4D()
|
||||
{
|
||||
setToUnity();
|
||||
this->rotLine(rclBase,rclDir,fAngle);
|
||||
}
|
||||
|
||||
|
||||
+144
-110
@@ -16,303 +16,337 @@
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
|
||||
<DeveloperDocu>This is the Matrix export class</DeveloperDocu>
|
||||
<UserDocu>A 4x4 Matrix</UserDocu>
|
||||
<UserDocu>Base.Matrix class.\n
|
||||
A 4x4 Matrix.
|
||||
In particular, this matrix can represent an affine transformation, that is, given a
|
||||
3D vector `x`, apply the transformation y = M*x + b, where the matrix `M` is a linear
|
||||
map and the vector `b` is a translation.
|
||||
`y` can be obtained using a linear transformation represented by the 4x4 matrix `A`
|
||||
conformed by the augmented 3x4 matrix (M|b), augmented by row with (0,0,0,1), therefore:
|
||||
(y, 1) = A*(x, 1).\n
|
||||
The following constructors are supported:\n
|
||||
Matrix()
|
||||
Empty constructor.\n
|
||||
Matrix(matrix)
|
||||
Copy constructor.
|
||||
matrix : Base.Matrix.\n
|
||||
Matrix(*coef)
|
||||
Define from 16 coefficients of the 4x4 matrix.
|
||||
coef : sequence of float\n The sequence can have up to 16 elements which complete the matrix by rows.\n
|
||||
Matrix(vector1, vector2, vector3, vector4)
|
||||
Define from four 3D vectors which represent the columns of the 3x4 submatrix, useful
|
||||
to represent an affine transformation. The fourth row is made up by (0,0,0,1).
|
||||
vector1 : Base.Vector
|
||||
vector2 : Base.Vector
|
||||
vector3 : Base.Vector
|
||||
vector4 : Base.Vector\n Default to (0,0,0). Optional.</UserDocu>
|
||||
</Documentation>
|
||||
<Methode Name="move">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
move(Vector)
|
||||
Move the matrix along the vector
|
||||
</UserDocu>
|
||||
<UserDocu>move(vector) -> None
|
||||
move(x, y, z) -> None\n
|
||||
Move the matrix along a vector, equivalent to left multiply the matrix
|
||||
by a pure translation transformation.\n
|
||||
vector : Base.Vector, tuple
|
||||
x : float\n `x` translation.
|
||||
y : float\n `y` translation.
|
||||
z : float\n `z` translation.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="scale">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
scale(Vector)
|
||||
Scale the matrix with the vector
|
||||
</UserDocu>
|
||||
<UserDocu>scale(vector) -> None
|
||||
scale(x, y, z) -> None
|
||||
scale(factor) -> None\n
|
||||
Scale the first three rows of the matrix.\n
|
||||
vector : Base.Vector
|
||||
x : float\n First row factor scale.
|
||||
y : float\n Second row factor scale.
|
||||
z : float\n Third row factor scale.
|
||||
factor : float\n global factor scale.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="hasScale" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
hasScale(tol=0.0)
|
||||
<UserDocu>hasScale(tol=0) -> ScaleType\n
|
||||
Return an enum value of ScaleType. Possible values are:
|
||||
Uniform, NonUniformLeft, NonUniformRight, NoScaling or Other
|
||||
if it's not a scale matrix
|
||||
</UserDocu>
|
||||
if it's not a scale matrix.\n
|
||||
tol : float</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="nullify">
|
||||
<Documentation>
|
||||
<UserDocu>nullify() - make this the null matrix</UserDocu>
|
||||
<UserDocu>nullify() -> None\n
|
||||
Make this the null matrix.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isNull" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>isNull() - check if this is the null matrix</UserDocu>
|
||||
<UserDocu>isNull() -> bool\n
|
||||
Check if this is the null matrix.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="unity">
|
||||
<Documentation>
|
||||
<UserDocu>unity() - make this matrix to unity</UserDocu>
|
||||
<UserDocu>unity() -> None\n
|
||||
Make this matrix to unity (4D identity matrix).</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isUnity" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>isUnity() - check if this is the unit matrix</UserDocu>
|
||||
<UserDocu>isUnity() -> bool\n
|
||||
Check if this is the unit matrix (4D identity matrix).</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="transform">
|
||||
<Documentation>
|
||||
<UserDocu>transform(Vector,Matrix) - return the dot product of the two vectors</UserDocu>
|
||||
<UserDocu>transform(vector, matrix2) -> None\n
|
||||
Transform the matrix around a given point.
|
||||
Equivalent to left multiply the matrix by T*M*T_inv, where M is `matrix2`, T the
|
||||
translation generated by `vector` and T_inv the inverse translation.
|
||||
For example, if `matrix2` is a rotation, the result is the transformation generated
|
||||
by the current matrix followed by a rotation around the point represented by `vector`.\n
|
||||
vector : Base.Vector
|
||||
matrix2 : Base.Matrix</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="col" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
col(index)
|
||||
Return the vector of a column
|
||||
</UserDocu>
|
||||
<UserDocu>col(index) -> Base.Vector\n
|
||||
Return the vector of a column, that is, the vector generated by the three
|
||||
first elements of the specified column.
|
||||
index : int\n Required column index.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setCol">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
setCol(index, Vector)
|
||||
Set the vector of a column
|
||||
</UserDocu>
|
||||
<UserDocu>setCol(index, vector) -> None\n
|
||||
Set the vector of a column, that is, the three first elements of the specified
|
||||
column by index.\n
|
||||
index : int\n Required column index.
|
||||
vector : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="row" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
row(index)
|
||||
Return the vector of a row
|
||||
</UserDocu>
|
||||
<UserDocu>row(index) -> Base.Vector\n
|
||||
Return the vector of a row, that is, the vector generated by the three
|
||||
first elements of the specified row.\n
|
||||
index : int\n Required row index.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setRow">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
setRow(index, Vector)
|
||||
Set the vector of a row
|
||||
</UserDocu>
|
||||
<UserDocu>setRow(index, vector) -> None\n
|
||||
Set the vector of a row, that is, the three first elements of the specified
|
||||
row by index.\n
|
||||
index : int\n Required row index.
|
||||
vector : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="trace" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
trace()
|
||||
Return the trace of the 3x3 sub-matrix as vector
|
||||
</UserDocu>
|
||||
<UserDocu>trace() -> Base.Vector\n
|
||||
Return the diagonal of the 3x3 leading principal submatrix as vector.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setTrace">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
setTrace(Vector)
|
||||
Set the trace of the 3x3 sub-matrix
|
||||
</UserDocu>
|
||||
<UserDocu>setTrace(vector) -> None\n
|
||||
Set the diagonal of the 3x3 leading principal submatrix.\n
|
||||
vector : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="rotateX">
|
||||
<Documentation>
|
||||
<UserDocu>rotateX(float) - rotate around X</UserDocu>
|
||||
<UserDocu>rotateX(angle) -> None\n
|
||||
Rotate around X axis.
|
||||
angle : float\n Angle in radians.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="rotateY">
|
||||
<Documentation>
|
||||
<UserDocu>rotateY(float) - rotate around Y</UserDocu>
|
||||
<UserDocu>rotateY(angle) -> None\n
|
||||
Rotate around Y axis.
|
||||
angle : float\n Angle in radians.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="rotateZ">
|
||||
<Documentation>
|
||||
<UserDocu>rotateZ(float) - rotate around Z</UserDocu>
|
||||
<UserDocu>rotateZ(angle) -> None\n
|
||||
Rotate around Z axis.
|
||||
angle : float\n Angle in radians.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="multiply">
|
||||
<Methode Name="multiply" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
multiply(Matrix|Vector)
|
||||
Multiply a matrix or vector with this matrix
|
||||
</UserDocu>
|
||||
<UserDocu>multiply(matrix) -> Base.Matrix
|
||||
multiply(vector) -> Base.Vector\n
|
||||
Right multiply the matrix by the given object.
|
||||
If the argument is a vector, this is augmented to the 4D vector (`vector`, 1).\n
|
||||
matrix : Base.Matrix
|
||||
vector : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="multVec" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
multVec(Vector) -> Vector
|
||||
Compute the transformed vector using the matrix
|
||||
</UserDocu>
|
||||
<UserDocu>multVec(vector) -> Base.Vector\n
|
||||
Compute the transformed vector using the matrix.
|
||||
vector : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="invert">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
invert() -> None
|
||||
Compute the inverse matrix, if possible
|
||||
</UserDocu>
|
||||
<UserDocu>invert() -> None\n
|
||||
Compute the inverse matrix in-place, if possible.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="inverse">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
inverse() -> Matrix
|
||||
Compute the inverse matrix, if possible
|
||||
</UserDocu>
|
||||
<Methode Name="inverse" Const="true">
|
||||
<Documentation><UserDocu>inverse() -> Base.Matrix\n
|
||||
Compute the inverse matrix, if possible.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="transpose">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
transpose() -> None
|
||||
Transpose the matrix.
|
||||
</UserDocu>
|
||||
<UserDocu>transpose() -> None\n
|
||||
Transpose the matrix in-place.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="transposed" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
transposed() -> Matrix
|
||||
Returns a transposed copy of this matrix.
|
||||
</UserDocu>
|
||||
<UserDocu>transposed() -> Base.Matrix\n
|
||||
Returns a transposed copy of this matrix.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="determinant">
|
||||
<Methode Name="determinant" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
determinant() -> Float
|
||||
Compute the determinant of the matrix
|
||||
</UserDocu>
|
||||
<UserDocu>determinant() -> float\n
|
||||
Compute the determinant of the matrix.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isOrthogonal">
|
||||
<Methode Name="isOrthogonal" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
isOrthogonal([Float]) -> Float
|
||||
<UserDocu>isOrthogonal(tol=1e-6) -> float\n
|
||||
Checks if the matrix is orthogonal, i.e. M * M^T = k*I and returns
|
||||
the multiple of the identity matrix. If it's not orthogonal 0 is returned.
|
||||
As argument you can set a tolerance which by default is 1.0e-6.
|
||||
</UserDocu>
|
||||
the multiple of the identity matrix. If it's not orthogonal 0 is returned.\n
|
||||
tol : float\n Tolerance used to check orthogonality.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="submatrix">
|
||||
<Methode Name="submatrix" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
submatrix(int) -> Matrix
|
||||
Get the sub-matrix. The parameter must be in the range [1,4].
|
||||
</UserDocu>
|
||||
<UserDocu>submatrix(dim) -> Base.Matrix\n
|
||||
Get the leading principal submatrix of the given dimension.
|
||||
The (4 - `dim`) remaining dimensions are completed with the
|
||||
corresponding identity matrix.\n
|
||||
dim : int\n Dimension parameter must be in the range [1,4].</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="analyze">
|
||||
<Methode Name="analyze" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
analyze() -> string
|
||||
Analyzes the type of transformation.
|
||||
</UserDocu>
|
||||
<UserDocu>analyze() -> str\n
|
||||
Analyzes the type of transformation.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Attribute Name="A11" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (1,1) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A11" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A12" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (1,2) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A12" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A13" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (1,3) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A13" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A14" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (1,4) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A14" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A21" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (2,1) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A21" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A22" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (2,2) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A22" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A23" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (2,3) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A23" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A24" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (2,4) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A24" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A31" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (3,1) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A31" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A32" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (3,2) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A32" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A33" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (3,3) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A33" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A34" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (3,4) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A34" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A41" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (4,1) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A41" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A42" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (4,2) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A42" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A43" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (4,3) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A43" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A44" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The (4,4) matrix element.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A44" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="A" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The matrix elements</UserDocu>
|
||||
<UserDocu>The matrix elements.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="A" Type="Sequence" />
|
||||
</Attribute>
|
||||
|
||||
+67
-64
@@ -120,7 +120,7 @@ int MatrixPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyErr_SetString(PyExc_TypeError, "matrix or up to 16 floats expected");
|
||||
PyErr_SetString(PyExc_TypeError, "Base.Matrix, four Base.Vector or up to 16 floats expected");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -291,10 +291,9 @@ PyObject* MatrixPy::move(PyObject * args)
|
||||
|
||||
PY_TRY {
|
||||
getMatrixPtr()->move(vec);
|
||||
Py_Return;
|
||||
}
|
||||
PY_CATCH;
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::scale(PyObject * args)
|
||||
@@ -337,10 +336,9 @@ PyObject* MatrixPy::scale(PyObject * args)
|
||||
|
||||
PY_TRY {
|
||||
getMatrixPtr()->scale(vec);
|
||||
Py_Return;
|
||||
}
|
||||
PY_CATCH;
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::hasScale(PyObject * args)
|
||||
@@ -358,6 +356,7 @@ PyObject* MatrixPy::nullify(PyObject * args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
getMatrixPtr()->nullify();
|
||||
Py_Return;
|
||||
@@ -369,6 +368,7 @@ PyObject* MatrixPy::isNull(PyObject * args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
bool ok = getMatrixPtr()->isNull();
|
||||
return Py::new_reference_to(Py::Boolean(ok));
|
||||
@@ -380,18 +380,19 @@ PyObject* MatrixPy::unity(PyObject * args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
getMatrixPtr()->setToUnity();
|
||||
Py_Return;
|
||||
}
|
||||
PY_CATCH;
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::isUnity(PyObject * args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
bool ok = getMatrixPtr()->isUnity();
|
||||
return Py::new_reference_to(Py::Boolean(ok));
|
||||
@@ -421,86 +422,91 @@ PyObject* MatrixPy::transform(PyObject * args)
|
||||
PyObject* MatrixPy::col(PyObject * args)
|
||||
{
|
||||
int index;
|
||||
if (PyArg_ParseTuple(args, "i", &index)) {
|
||||
index = index % 4;
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
Base::Vector3d v = mat->getCol(index);
|
||||
return Py::new_reference_to(Py::Vector(v));
|
||||
if (!PyArg_ParseTuple(args, "i", &index))
|
||||
return nullptr;
|
||||
|
||||
if (index < 0 || index > 3) {
|
||||
PyErr_SetString(PyExc_ValueError, "Index expected in the range [0, 3]");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PyExc_TypeError, "int expected");
|
||||
return nullptr;
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
Base::Vector3d v = mat->getCol(index);
|
||||
return Py::new_reference_to(Py::Vector(v));
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::setCol(PyObject * args)
|
||||
{
|
||||
int index;
|
||||
PyObject* o;
|
||||
if (PyArg_ParseTuple(args, "iO!", &index, &(VectorPy::Type), &o)) {
|
||||
index = index % 4;
|
||||
Base::Vector3d v = Py::Vector(o, false).toVector();
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
mat->setCol(index, v);
|
||||
Py_Return;
|
||||
if (!PyArg_ParseTuple(args, "iO!", &index, &(VectorPy::Type), &o))
|
||||
return nullptr;
|
||||
|
||||
if (index < 0 || index > 3) {
|
||||
PyErr_SetString(PyExc_ValueError, "Index expected in the range [0, 3]");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PyExc_TypeError, "int and Vector expected");
|
||||
return nullptr;
|
||||
Base::Vector3d v = Py::Vector(o, false).toVector();
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
mat->setCol(index, v);
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::row(PyObject * args)
|
||||
{
|
||||
int index;
|
||||
if (PyArg_ParseTuple(args, "i", &index)) {
|
||||
index = index % 4;
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
Base::Vector3d v = mat->getRow(index);
|
||||
return Py::new_reference_to(Py::Vector(v));
|
||||
if (!PyArg_ParseTuple(args, "i", &index))
|
||||
return nullptr;
|
||||
|
||||
if (index < 0 || index > 3) {
|
||||
PyErr_SetString(PyExc_ValueError, "Index expected in the range [0, 3]");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PyExc_TypeError, "int expected");
|
||||
return nullptr;
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
Base::Vector3d v = mat->getRow(index);
|
||||
return Py::new_reference_to(Py::Vector(v));
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::setRow(PyObject * args)
|
||||
{
|
||||
int index;
|
||||
PyObject* o;
|
||||
if (PyArg_ParseTuple(args, "iO!", &index, &(VectorPy::Type), &o)) {
|
||||
index = index % 4;
|
||||
Base::Vector3d v = Py::Vector(o, false).toVector();
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
mat->setRow(index, v);
|
||||
Py_Return;
|
||||
if (!PyArg_ParseTuple(args, "iO!", &index, &(VectorPy::Type), &o))
|
||||
return nullptr;
|
||||
|
||||
if (index < 0 || index > 3) {
|
||||
PyErr_SetString(PyExc_ValueError, "Index expected in the range [0, 3]");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PyExc_TypeError, "int and Vector expected");
|
||||
return nullptr;
|
||||
Base::Vector3d v = Py::Vector(o, false).toVector();
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
mat->setRow(index, v);
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::trace(PyObject * args)
|
||||
{
|
||||
if (PyArg_ParseTuple(args, "")) {
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
Base::Vector3d v = mat->trace();
|
||||
return Py::new_reference_to(Py::Vector(v));
|
||||
}
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
return nullptr;
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
Base::Vector3d v = mat->trace();
|
||||
return Py::new_reference_to(Py::Vector(v));
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::setTrace(PyObject * args)
|
||||
{
|
||||
PyObject* o;
|
||||
if (PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &o)) {
|
||||
Base::Vector3d v = Py::Vector(o, false).toVector();
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
mat->setTrace(v);
|
||||
Py_Return;
|
||||
}
|
||||
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &o))
|
||||
return nullptr;
|
||||
|
||||
PyErr_SetString(PyExc_TypeError, "Vector expected");
|
||||
return nullptr;
|
||||
Base::Vector3d v = Py::Vector(o, false).toVector();
|
||||
Matrix4D* mat = getMatrixPtr();
|
||||
mat->setTrace(v);
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::rotateX(PyObject * args)
|
||||
@@ -528,10 +534,9 @@ PyObject* MatrixPy::rotateX(PyObject * args)
|
||||
|
||||
PY_TRY {
|
||||
getMatrixPtr()->rotX(angle);
|
||||
Py_Return;
|
||||
}
|
||||
PY_CATCH;
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::rotateY(PyObject * args)
|
||||
@@ -559,10 +564,9 @@ PyObject* MatrixPy::rotateY(PyObject * args)
|
||||
|
||||
PY_TRY {
|
||||
getMatrixPtr()->rotY(angle);
|
||||
Py_Return;
|
||||
}
|
||||
PY_CATCH;
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::rotateZ(PyObject * args)
|
||||
@@ -590,10 +594,9 @@ PyObject* MatrixPy::rotateZ(PyObject * args)
|
||||
|
||||
PY_TRY {
|
||||
getMatrixPtr()->rotZ(angle);
|
||||
Py_Return;
|
||||
}
|
||||
PY_CATCH;
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::multiply(PyObject * args)
|
||||
@@ -619,6 +622,7 @@ PyObject* MatrixPy::multVec(PyObject * args)
|
||||
PyObject *obj;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &obj))
|
||||
return nullptr;
|
||||
|
||||
Base::Vector3d vec(static_cast<VectorPy*>(obj)->value());
|
||||
getMatrixPtr()->multVec(vec, vec);
|
||||
return new VectorPy(new Vector3d(vec));
|
||||
@@ -630,16 +634,16 @@ PyObject* MatrixPy::invert(PyObject * args)
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON)
|
||||
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON) {
|
||||
getMatrixPtr()->inverseGauss();
|
||||
Py_Return;
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot invert singular matrix");
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
PY_CATCH;
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::inverse(PyObject * args)
|
||||
@@ -659,14 +663,13 @@ PyObject* MatrixPy::inverse(PyObject * args)
|
||||
}
|
||||
}
|
||||
PY_CATCH;
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::determinant(PyObject * args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
return PyFloat_FromDouble(getMatrixPtr()->determinant());
|
||||
}
|
||||
|
||||
@@ -675,6 +678,7 @@ PyObject* MatrixPy::submatrix(PyObject * args)
|
||||
int dim;
|
||||
if (!PyArg_ParseTuple(args, "i", &dim))
|
||||
return nullptr;
|
||||
|
||||
if (dim < 1 || dim > 4) {
|
||||
PyErr_SetString(PyExc_IndexError, "Dimension out of range");
|
||||
return nullptr;
|
||||
@@ -709,6 +713,7 @@ PyObject* MatrixPy::isOrthogonal(PyObject * args)
|
||||
double eps=1.0e-06;
|
||||
if (!PyArg_ParseTuple(args, "|d",&eps))
|
||||
return nullptr;
|
||||
|
||||
const Base::Matrix4D& mat = *getMatrixPtr();
|
||||
Base::Matrix4D trp = mat;
|
||||
trp.transpose();
|
||||
@@ -747,8 +752,6 @@ PyObject* MatrixPy::transposed(PyObject * args)
|
||||
return new MatrixPy(m);
|
||||
}
|
||||
PY_CATCH;
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MatrixPy::transpose(PyObject * args)
|
||||
|
||||
@@ -174,7 +174,7 @@ MemDebug::~MemDebug()
|
||||
*/
|
||||
int MemDebug::sReportHook(int nRptType,char *szMsg,int *retVal)
|
||||
{
|
||||
char *RptTypes[] = { "Warning", "Error", "Assert" };
|
||||
const char *RptTypes[] = { "Warning", "Error", "Assert" };
|
||||
|
||||
if ( ( nRptType > 0 ) || ( strstr( szMsg, "HEAP CORRUPTION DETECTED" ) ) )
|
||||
fprintf( logFile, "%s: %s", RptTypes[nRptType], szMsg );
|
||||
@@ -199,8 +199,8 @@ int __cdecl MemDebug::sAllocHook(
|
||||
int nLine
|
||||
)
|
||||
{
|
||||
char *operation[] = { " :", "Alloc :", "Realloc:", "Free :" };
|
||||
char *blockType[] = { "Free", "Normal", "CRT", "Ignore", "Client" };
|
||||
const char *operation[] = { " :", "Alloc :", "Realloc:", "Free :" };
|
||||
const char *blockType[] = { "Free", "Normal", "CRT", "Ignore", "Client" };
|
||||
|
||||
if ( nBlockUse == _CRT_BLOCK ) // Ignore internal C runtime library allocations
|
||||
return( 7 ); // (True = 7, False = 0)
|
||||
|
||||
@@ -85,7 +85,7 @@ class ParameterManager;
|
||||
* and exporting groups of parameters and enables streaming
|
||||
* to a persistent medium via XML.
|
||||
* \par
|
||||
* Its main task is making user parameter persitent, saving
|
||||
* Its main task is making user parameter persistent, saving
|
||||
* last used values in dialog boxes, setting and retrieving all
|
||||
* kind of preferences and so on.
|
||||
* @see ParameterManager
|
||||
|
||||
+12
-12
@@ -12,35 +12,35 @@
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
|
||||
<DeveloperDocu>This is the Persistence class</DeveloperDocu>
|
||||
<UserDocu>This is a persistence class</UserDocu>
|
||||
<UserDocu>Base.Persistence class.\n
|
||||
Class to dump and restore the content of an object.</UserDocu>
|
||||
</Documentation>
|
||||
<Attribute Name="Content" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Content of the object in XML representation</UserDocu>
|
||||
<UserDocu>Content of the object in XML representation.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Content" Type="String" />
|
||||
</Attribute>
|
||||
<Attribute Name="MemSize" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Memory size of the object in byte</UserDocu>
|
||||
<UserDocu>Memory size of the object in bytes.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="MemSize" Type="Int"/>
|
||||
</Attribute>
|
||||
<Methode Name="dumpContent" Keyword="true" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>Dumps the content of the object, both the XML representation as well as the additional datafiles
|
||||
required, into a byte representation. It will be returned as byte array.
|
||||
dumpContent() -- returns a byte array with full content
|
||||
dumpContent(Compression=1-9) -- Sets the data compression from 0 (no) to 9 (max)
|
||||
</UserDocu>
|
||||
<UserDocu>dumpContent(Compression=3) -> bytearray\n
|
||||
Dumps the content of the object, both the XML representation and the additional
|
||||
data files required, into a byte representation.\n
|
||||
Compression : int\n Set the data compression level in the range [0,9]. Set to 0 for no compression.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="restoreContent">
|
||||
<Documentation>
|
||||
<UserDocu>Restore the content of the object from a byte representation as stored by \"dumpContent\".
|
||||
It could be restored from any python object implementing the buffer protocol.
|
||||
restoreContent(buffer) -- restores from the given byte array
|
||||
</UserDocu>
|
||||
<UserDocu>restoreContent(obj) -> None\n
|
||||
Restore the content of the object from a byte representation as stored by `dumpContent`.
|
||||
It could be restored from any Python object implementing the buffer protocol.\n
|
||||
obj : buffer\n Object with buffer protocol support.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
</PythonExport>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "Persistence.h"
|
||||
#include "Writer.h"
|
||||
|
||||
// inclution of the generated files (generated By PersitancePy.xml)
|
||||
// inclusion of the generated files (generated By PersitancePy.xml)
|
||||
#include "PersistencePy.h"
|
||||
#include "PersistencePy.cpp"
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ Placement Placement::fromDualQuaternion(DualQuat qq)
|
||||
return Placement(Vector3d(mvq.x.re,mvq.y.re, mvq.z.re), rot);
|
||||
}
|
||||
|
||||
Base::Matrix4D Placement::toMatrix(void) const
|
||||
Base::Matrix4D Placement::toMatrix() const
|
||||
{
|
||||
Base::Matrix4D matrix;
|
||||
_rot.getValue(matrix);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
FatherNamespace="Base">
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
|
||||
<UserDocu>Base.Placement class\n
|
||||
<UserDocu>Base.Placement class.\n
|
||||
A Placement defines an orientation (rotation) and a position (base) in 3D space.
|
||||
It is used when no scaling or other distortion is needed.\n
|
||||
The following constructors are supported:\n
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <stack>
|
||||
|
||||
@@ -60,7 +60,11 @@ PyObjectBase::PyObjectBase(void* p,PyTypeObject *T)
|
||||
, baseProxy(nullptr)
|
||||
, attrDict(nullptr)
|
||||
{
|
||||
#if PY_VERSION_HEX < 0x030b0000
|
||||
Py_TYPE(this) = T;
|
||||
#else
|
||||
this->ob_type = T;
|
||||
#endif
|
||||
_Py_NewReference(this);
|
||||
#ifdef FC_LOGPYOBJECTS
|
||||
Base::Console().Log("PyO+: %s (%p)\n",T->tp_name, this);
|
||||
@@ -103,7 +107,7 @@ static void
|
||||
PyBaseProxy_dealloc(PyObject* self)
|
||||
{
|
||||
/* Clear weakrefs first before calling any destructors */
|
||||
if (reinterpret_cast<PyBaseProxy*>(self)->weakreflist != nullptr)
|
||||
if (reinterpret_cast<PyBaseProxy*>(self)->weakreflist)
|
||||
PyObject_ClearWeakRefs(self);
|
||||
Py_TYPE(self)->tp_free(self);
|
||||
}
|
||||
@@ -349,7 +353,7 @@ int PyObjectBase::__setattro(PyObject *obj, PyObject *attro, PyObject *value)
|
||||
|
||||
//Hint: In general we don't allow to delete attributes (i.e. value=0). However, if we want to allow
|
||||
//we must check then in _setattr() of all subclasses whether value is 0.
|
||||
if ( value==nullptr ) {
|
||||
if (!value) {
|
||||
PyErr_Format(PyExc_AttributeError, "Cannot delete attribute: '%s'", attr);
|
||||
return -1;
|
||||
}
|
||||
@@ -409,7 +413,7 @@ PyObject *PyObjectBase::_getattr(const char *attr)
|
||||
// As fallback solution use Python's default method to get generic attributes
|
||||
PyObject *w, *res;
|
||||
w = PyUnicode_InternFromString(attr);
|
||||
if (w != nullptr) {
|
||||
if (w) {
|
||||
res = PyObject_GenericGetAttr(this, w);
|
||||
Py_XDECREF(w);
|
||||
return res;
|
||||
@@ -429,7 +433,7 @@ int PyObjectBase::_setattr(const char *attr, PyObject *value)
|
||||
PyObject *w;
|
||||
// As fallback solution use Python's default method to get generic attributes
|
||||
w = PyUnicode_InternFromString(attr); // new reference
|
||||
if (w != nullptr) {
|
||||
if (w) {
|
||||
// call methods from tp_getset if defined
|
||||
int res = PyObject_GenericSetAttr(this, w, value);
|
||||
Py_DECREF(w);
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#endif
|
||||
#define slots
|
||||
#include <bitset>
|
||||
#include <cstring>
|
||||
|
||||
#include "Exception.h"
|
||||
#ifndef PYCXX_PYTHON_2TO3
|
||||
@@ -122,6 +123,10 @@ inline void Assert(int expr, char *msg) // C++ assert
|
||||
};
|
||||
}
|
||||
|
||||
inline bool asBoolean(PyObject *obj) {
|
||||
return PyObject_IsTrue(obj) != 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*------------------------------
|
||||
|
||||
+9
-1
@@ -15,8 +15,10 @@ is provided on an as is basis, without warranties of any kind.
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <compile.h>
|
||||
#include <eval.h>
|
||||
#include <frameobject.h>
|
||||
#if PY_VERSION_HEX < 0x030b0000
|
||||
#include <eval.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -310,7 +312,13 @@ void PP_Fetch_Error_Text()
|
||||
if(!frame)
|
||||
return;
|
||||
int line = PyFrame_GetLineNumber(frame);
|
||||
#if PY_VERSION_HEX < 0x030b0000
|
||||
const char *file = PyUnicode_AsUTF8(frame->f_code->co_filename);
|
||||
#else
|
||||
PyCodeObject* code = PyFrame_GetCode(frame);
|
||||
const char *file = PyUnicode_AsUTF8(code->co_filename);
|
||||
Py_DECREF(code);
|
||||
#endif
|
||||
#ifdef FC_OS_WIN32
|
||||
const char *_f = strstr(file, "\\src\\");
|
||||
#else
|
||||
|
||||
@@ -341,6 +341,7 @@ Rotation Rotation::inverse() const
|
||||
rot._axis[0] = -this->_axis[0];
|
||||
rot._axis[1] = -this->_axis[1];
|
||||
rot._axis[2] = -this->_axis[2];
|
||||
rot._angle = this->_angle;
|
||||
return rot;
|
||||
}
|
||||
|
||||
|
||||
+99
-81
@@ -16,157 +16,175 @@
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
|
||||
<DeveloperDocu>This is the Rotation export class</DeveloperDocu>
|
||||
<UserDocu>
|
||||
A Rotation using a quaternion.
|
||||
The Rotation object can be created by:
|
||||
-- an empty parameter list
|
||||
-- a Rotation object
|
||||
-- a Vector (axis) and a float (angle)
|
||||
-- two Vectors (rotation from/to vector)
|
||||
-- three floats (Euler angles) as yaw-pitch-roll in XY'Z'' convention
|
||||
-- one string and three floats (Euler angles) as euler rotation
|
||||
of a given type. Call toEulerSequence() for supported sequence types.
|
||||
-- four floats (Quaternion) where the quaternion is specified as:
|
||||
q=xi+yj+zk+w, i.e. the last parameter is the real part
|
||||
-- three vectors that define rotated axes directions + an optional
|
||||
3-characher string of capital letters 'X', 'Y', 'Z' that sets the
|
||||
order of importance of the axes (e.g., 'ZXY' means z direction is
|
||||
followed strictly, x is used but corrected if necessary, y is ignored).
|
||||
</UserDocu>
|
||||
<UserDocu>Base.Rotation class.\n
|
||||
A Rotation using a quaternion.\n
|
||||
The following constructors are supported:\n
|
||||
Rotation()
|
||||
Empty constructor.\n
|
||||
Rotation(rotation)
|
||||
Copy constructor.\n
|
||||
Rotation(Axis, Radian)
|
||||
Rotation(Axis, Degree)
|
||||
Define from an axis and an angle (in radians or degrees according to the keyword).
|
||||
Axis : Base.Vector
|
||||
Radian : float
|
||||
Degree : float\n
|
||||
Rotation(vector_start, vector_end)
|
||||
Define from two vectors (rotation from/to vector).
|
||||
vector_start : Base.Vector
|
||||
vector_end : Base.Vector\n
|
||||
Rotation(angle1, angle2, angle3)
|
||||
Define from three floats (Euler angles) as yaw-pitch-roll in XY'Z'' convention.
|
||||
angle1 : float
|
||||
angle2 : float
|
||||
angle3 : float\n
|
||||
Rotation(seq, angle1, angle2, angle3)
|
||||
Define from one string and three floats (Euler angles) as Euler rotation
|
||||
of a given type. Call toEulerAngles() for supported sequence types.
|
||||
seq : str
|
||||
angle1 : float
|
||||
angle2 : float
|
||||
angle3 : float\n
|
||||
Rotation(x, y, z, w)
|
||||
Define from four floats (quaternion) where the quaternion is specified as:
|
||||
q = xi+yj+zk+w, i.e. the last parameter is the real part.
|
||||
x : float
|
||||
y : float
|
||||
z : float
|
||||
w : float\n
|
||||
Rotation(dir1, dir2, dir3, seq)
|
||||
Define from three vectors that define rotated axes directions plus an optional
|
||||
3-characher string of capital letters 'X', 'Y', 'Z' that sets the order of
|
||||
importance of the axes (e.g., 'ZXY' means z direction is followed strictly,
|
||||
x is used but corrected if necessary, y is ignored).
|
||||
dir1 : Base.Vector
|
||||
dir2 : Base.Vector
|
||||
dir3 : Base.Vector
|
||||
seq : str\n
|
||||
Rotation(matrix)
|
||||
Define from a matrix rotation in the 4D representation.
|
||||
matrix : Base.Matrix\n
|
||||
Rotation(*coef)
|
||||
Define from 16 or 9 elements which represent the rotation in the 4D matrix
|
||||
representation or in the 3D matrix representation, respectively.
|
||||
coef : sequence of float</UserDocu>
|
||||
</Documentation>
|
||||
<Methode Name="invert">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
invert() -> None
|
||||
Sets the rotation to its inverse
|
||||
</UserDocu>
|
||||
<UserDocu>invert() -> None\n
|
||||
Sets the rotation to its inverse.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="inverted">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
inverted() -> Rotation
|
||||
Returns the inverse of the rotation
|
||||
</UserDocu>
|
||||
<UserDocu>inverted() -> Base.Rotation\n
|
||||
Returns the inverse of the rotation.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isSame">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
isSame(Rotation, [tolerance=0])
|
||||
Checks if the two quaternions perform the same rotation.
|
||||
Optionally, a tolerance value greater than zero can be passed.
|
||||
</UserDocu>
|
||||
<UserDocu>isSame(rotation, tol=0) -> bool\n
|
||||
Checks if `rotation` perform the same transformation as this rotation.\n
|
||||
rotation : Base.Rotation
|
||||
tol : float\n Tolerance used to compare both rotations.
|
||||
If tol is negative or zero, no tolerance is used.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="multiply" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
multiply(Rotation)
|
||||
Multiply this quaternion with another quaternion
|
||||
</UserDocu>
|
||||
<UserDocu>multiply(rotation) -> Base.Rotation\n
|
||||
Right multiply this rotation with another rotation.\n
|
||||
rotation : Base.Rotation\n Rotation by which to multiply this rotation.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="multVec" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
multVec(Vector) -> Vector
|
||||
Compute the transformed vector using the rotation
|
||||
</UserDocu>
|
||||
<UserDocu>multVec(vector) -> Base.Vector\n
|
||||
Compute the transformed vector using the rotation.\n
|
||||
vector : Base.Vector\n Vector to be transformed.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="slerp" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
slerp(Rotation, Float) -> Rotation
|
||||
Spherical linear interpolation of this and a given rotation. The float must be in the range of 0 and 1
|
||||
</UserDocu>
|
||||
<UserDocu>slerp(rotation2, t) -> Base.Rotation\n
|
||||
Spherical Linear Interpolation (SLERP) of this rotation and `rotation2`.\n
|
||||
t : float\n Parameter of the path. t=0 returns this rotation, t=1 returns `rotation2`.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setYawPitchRoll">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
setYawPitchRoll(angle1, angle2, angle3)
|
||||
Set the Euler angles of this rotation
|
||||
as yaw-pitch-roll in XY'Z'' convention.
|
||||
|
||||
NOTE: The angles are in degree
|
||||
</UserDocu>
|
||||
<UserDocu>setYawPitchRoll(angle1, angle2, angle3) -> None\n
|
||||
Set the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.\n
|
||||
angle1 : float\n Angle around yaw axis in degrees.
|
||||
angle2 : float\n Angle around pitch axis in degrees.
|
||||
angle3 : float\n Angle around roll axis in degrees.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getYawPitchRoll" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
getYawPitchRoll() -> list
|
||||
Get the Euler angles of this rotation
|
||||
as yaw-pitch-roll in XY'Z'' convention
|
||||
NOTE: The angles are in degree
|
||||
</UserDocu>
|
||||
<UserDocu>getYawPitchRoll() -> tuple\n
|
||||
Get the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.
|
||||
The angles are given in degrees.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setEulerAngles">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
setEulerAngles(seq, angle1, angle2, angle3)
|
||||
Set the Euler angles in a given sequence for this rotation.
|
||||
'seq' is the Euler sequence name. You get all possible values with toEulerAngles()
|
||||
</UserDocu>
|
||||
<UserDocu>setEulerAngles(seq, angle1, angle2, angle3) -> None\n
|
||||
Set the Euler angles in a given sequence for this rotation.
|
||||
The angles must be given in degrees.\n
|
||||
seq : str\n Euler sequence name. All possible values given by toEulerAngles().
|
||||
angle1 : float
|
||||
angle2 : float
|
||||
angle3 : float </UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="toEulerAngles" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
toEulerAngles(seq='') -> list
|
||||
Get the Euler angles in a given sequence for this rotation.
|
||||
Call this function without arguments to output all possible values of 'seq'.
|
||||
</UserDocu>
|
||||
<UserDocu>toEulerAngles(seq) -> list\n
|
||||
Get the Euler angles in a given sequence for this rotation.\n
|
||||
seq : str\n Euler sequence name. If not given, the function returns
|
||||
all possible values of `seq`. Optional.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="toMatrix" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
toMatrix()
|
||||
convert the rotation to a matrix representation
|
||||
</UserDocu>
|
||||
<UserDocu>toMatrix() -> Base.Matrix\n
|
||||
Convert the rotation to a 4D matrix representation.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isNull" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
isNull() -> Bool
|
||||
returns True if all Q values are zero
|
||||
</UserDocu>
|
||||
<UserDocu>isNull() -> bool\n
|
||||
Returns True if all values in the quaternion representation are zero.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isIdentity" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
isIdentity() -> Bool
|
||||
returns True if the rotation equals the unity matrix
|
||||
</UserDocu>
|
||||
<UserDocu>isIdentity() -> bool\n
|
||||
Returns True if the rotation equals the 4D identity matrix.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Attribute Name="Q" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The rotation elements (as quaternion)</UserDocu>
|
||||
<UserDocu>The rotation elements (as quaternion).</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Q" Type="Tuple" />
|
||||
</Attribute>
|
||||
<Attribute Name="Axis" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The rotation axis of the quaternion</UserDocu>
|
||||
<UserDocu>The rotation axis of the quaternion.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Axis" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="RawAxis" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>The rotation axis without normalization</UserDocu>
|
||||
<UserDocu>The rotation axis without normalization.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="RawAxis" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Angle" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>The rotation angle of the quaternion</UserDocu>
|
||||
<UserDocu>The rotation angle of the quaternion.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Angle" Type="Float" />
|
||||
</Attribute>
|
||||
|
||||
+1
-1
@@ -426,7 +426,7 @@ IODeviceOStreambuf::seekpos(std::streambuf::pos_type pos,
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
IODeviceIStreambuf::IODeviceIStreambuf(QIODevice* dev) : device(dev)
|
||||
IODeviceIStreambuf::IODeviceIStreambuf(QIODevice* dev) : device(dev), buffer{}
|
||||
{
|
||||
setg (buffer+pbSize, // beginning of putback area
|
||||
buffer+pbSize, // read position
|
||||
|
||||
+22
-12
@@ -339,17 +339,22 @@ class FileInfo;
|
||||
class ofstream : public std::ofstream
|
||||
{
|
||||
public:
|
||||
ofstream() = default;
|
||||
ofstream(const FileInfo& fi, ios_base::openmode mode =
|
||||
std::ios::out | std::ios::trunc)
|
||||
#ifdef _MSC_VER
|
||||
: std::ofstream(fi.toStdWString().c_str(), mode)
|
||||
: std::ofstream(fi.toStdWString().c_str(), mode) {}
|
||||
#else
|
||||
: std::ofstream(fi.filePath().c_str(), mode)
|
||||
: std::ofstream(fi.filePath().c_str(), mode) {}
|
||||
#endif
|
||||
~ofstream() override = default;
|
||||
void open(const FileInfo& fi, ios_base::openmode mode =
|
||||
std::ios::out | std::ios::trunc) {
|
||||
#ifdef _MSC_VER
|
||||
std::ofstream::open(fi.toStdWString().c_str(), mode);
|
||||
#else
|
||||
std::ofstream::open(fi.filePath().c_str(), mode);
|
||||
#endif
|
||||
{
|
||||
}
|
||||
virtual ~ofstream()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@@ -362,17 +367,22 @@ public:
|
||||
class ifstream : public std::ifstream
|
||||
{
|
||||
public:
|
||||
ifstream() = default;
|
||||
ifstream(const FileInfo& fi, ios_base::openmode mode =
|
||||
std::ios::in)
|
||||
#ifdef _MSC_VER
|
||||
: std::ifstream(fi.toStdWString().c_str(), mode)
|
||||
: std::ifstream(fi.toStdWString().c_str(), mode) {}
|
||||
#else
|
||||
: std::ifstream(fi.filePath().c_str(), mode)
|
||||
: std::ifstream(fi.filePath().c_str(), mode) {}
|
||||
#endif
|
||||
~ifstream() override = default;
|
||||
void open(const FileInfo& fi, ios_base::openmode mode =
|
||||
std::ios::in) {
|
||||
#ifdef _MSC_VER
|
||||
std::ifstream::open(fi.toStdWString().c_str(), mode);
|
||||
#else
|
||||
std::ifstream::open(fi.filePath().c_str(), mode);
|
||||
#endif
|
||||
{
|
||||
}
|
||||
virtual ~ifstream()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+20
-21
@@ -264,7 +264,7 @@ inline Vector2d& Vector2d::operator-= (const Vector2d &v)
|
||||
|
||||
inline Vector2d Vector2d::operator* (double c) const
|
||||
{
|
||||
return Vector2d(c*x, c*y);
|
||||
return Vector2d(c * x, c * y);
|
||||
}
|
||||
|
||||
inline Vector2d& Vector2d::operator*= (double c)
|
||||
@@ -276,17 +276,17 @@ inline Vector2d& Vector2d::operator*= (double c)
|
||||
|
||||
inline double Vector2d::operator* (const Vector2d &v) const
|
||||
{
|
||||
return x*v.x + y*v.y;
|
||||
return x * v.x + y * v.y;
|
||||
}
|
||||
|
||||
inline Vector2d operator* (double c, const Vector2d &v)
|
||||
{
|
||||
return Vector2d(c*v.x, c*v.y);
|
||||
return Vector2d(c * v.x, c * v.y);
|
||||
}
|
||||
|
||||
inline Vector2d Vector2d::operator/ (double c) const
|
||||
{
|
||||
return Vector2d(x/c, y/c);
|
||||
return Vector2d(x / c, y / c);
|
||||
}
|
||||
|
||||
inline Vector2d& Vector2d::operator/= (double c)
|
||||
@@ -298,12 +298,12 @@ inline Vector2d& Vector2d::operator/= (double c)
|
||||
|
||||
inline bool Vector2d::IsNull(double tolerance) const
|
||||
{
|
||||
return x*x + y*y <= tolerance*tolerance;
|
||||
return x * x + y * y <= tolerance * tolerance;
|
||||
}
|
||||
|
||||
inline double Vector2d::Length() const
|
||||
{
|
||||
return sqrt(x*x + y*y);
|
||||
return sqrt(x * x + y * y);
|
||||
}
|
||||
|
||||
inline double Vector2d::Angle() const
|
||||
@@ -313,7 +313,7 @@ inline double Vector2d::Angle() const
|
||||
|
||||
inline double Vector2d::Sqr() const
|
||||
{
|
||||
return x*x + y*y;
|
||||
return x * x + y * y;
|
||||
}
|
||||
|
||||
inline Vector2d& Vector2d::Set(double x, double y)
|
||||
@@ -339,8 +339,9 @@ inline Vector2d& Vector2d::Scale(double factor)
|
||||
|
||||
inline Vector2d& Vector2d::Rotate(double angle)
|
||||
{
|
||||
x = x*cos(angle) - y*sin(angle);
|
||||
y = x*sin(angle) + y*cos(angle);
|
||||
auto tmp_x = x;
|
||||
x = x * cos(angle) - y * sin(angle);
|
||||
y = tmp_x * sin(angle) + y * cos(angle);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -363,7 +364,7 @@ inline Vector2d Vector2d::Perpendicular(bool clockwise) const
|
||||
|
||||
inline Vector2d Vector2d::FromPolar(double r, double fi)
|
||||
{
|
||||
return Vector2d(r*cos(fi), r*sin(fi));
|
||||
return Vector2d(r * cos(fi), r * sin(fi));
|
||||
}
|
||||
|
||||
inline double Vector2d::Distance(const Vector2d& v) const
|
||||
@@ -371,7 +372,7 @@ inline double Vector2d::Distance(const Vector2d& v) const
|
||||
double dx = (x - v.x);
|
||||
double dy = (y - v.y);
|
||||
|
||||
return sqrt(dx*dx + dy*dy);
|
||||
return sqrt(dx * dx + dy * dy);
|
||||
}
|
||||
|
||||
inline bool Vector2d::IsEqual(const Vector2d& v, double tolerance) const
|
||||
@@ -414,7 +415,7 @@ inline bool Polygon2d::Delete (size_t ulNdx)
|
||||
{
|
||||
std::vector<Vector2d>::iterator it = _aclVct.begin();
|
||||
std::advance(it, ulNdx);
|
||||
_aclVct.erase ( it );
|
||||
_aclVct.erase(it);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -491,10 +492,10 @@ inline BoundBox2d::BoundBox2d (const BoundBox2d &rclBB)
|
||||
|
||||
inline BoundBox2d::BoundBox2d (double fX1, double fY1, double fX2, double fY2)
|
||||
{
|
||||
MinX = std::min<double>( fX1, fX2 );
|
||||
MaxX = std::max<double>( fX1, fX2 );
|
||||
MinY = std::min<double>( fY1, fY2 );
|
||||
MaxY = std::max<double>( fY1, fY2 );
|
||||
MinX = std::min<double>(fX1, fX2);
|
||||
MaxX = std::max<double>(fX1, fX2);
|
||||
MinY = std::min<double>(fY1, fY2);
|
||||
MaxY = std::max<double>(fY1, fY2);
|
||||
}
|
||||
|
||||
inline bool BoundBox2d::IsValid ()
|
||||
@@ -504,8 +505,8 @@ inline bool BoundBox2d::IsValid ()
|
||||
|
||||
inline bool BoundBox2d::IsEqual(const BoundBox2d& b, double tolerance) const
|
||||
{
|
||||
return Vector2d(MinX,MinY).IsEqual(Vector2d(b.MinX,b.MinY), tolerance) &&
|
||||
Vector2d(MaxX,MaxY).IsEqual(Vector2d(b.MaxX,b.MaxY), tolerance);
|
||||
return Vector2d(MinX, MinY).IsEqual(Vector2d(b.MinX, b.MinY), tolerance) &&
|
||||
Vector2d(MaxX, MaxY).IsEqual(Vector2d(b.MaxX, b.MaxY), tolerance);
|
||||
}
|
||||
|
||||
inline BoundBox2d& BoundBox2d::operator= (const BoundBox2d& rclBB)
|
||||
@@ -549,7 +550,7 @@ inline bool BoundBox2d::Contains(const Vector2d &v, double tolerance) const
|
||||
|
||||
inline Vector2d BoundBox2d::GetCenter() const
|
||||
{
|
||||
return Vector2d((MinX + MaxX)*0.5, (MinY + MaxY)*0.5);
|
||||
return Vector2d((MinX + MaxX) * 0.5, (MinY + MaxY) * 0.5);
|
||||
}
|
||||
|
||||
inline void BoundBox2d::SetVoid()
|
||||
@@ -569,5 +570,3 @@ inline void BoundBox2d::Add(const Vector2d &v)
|
||||
} // namespace Base
|
||||
|
||||
#endif // BASE_TOOLS2D_H
|
||||
|
||||
|
||||
|
||||
+36
-15
@@ -17,78 +17,99 @@ namespace Base {
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
|
||||
<DeveloperDocu>This is the Type class</DeveloperDocu>
|
||||
<UserDocu>This is the Type class</UserDocu>
|
||||
<UserDocu>Base.BaseType class.\n
|
||||
This class is not intended to create instances of itself, but to get information
|
||||
from the different types and create instances of them.
|
||||
Regarding instantiation, this is possible in cases that inherit from the
|
||||
Base::BaseClass class and are not abstract classes.</UserDocu>
|
||||
</Documentation>
|
||||
<Methode Name="fromName" Static="true">
|
||||
<Documentation>
|
||||
<UserDocu>Returns a type object by name</UserDocu>
|
||||
<UserDocu>fromName(name) -> Base.BaseType\n
|
||||
Returns a type object by name.\n
|
||||
name : str</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="fromKey" Static="true">
|
||||
<Documentation>
|
||||
<UserDocu>Returns a type object by key</UserDocu>
|
||||
<UserDocu>fromKey(key) -> Base.BaseType\n
|
||||
Returns a type id object by key.\n
|
||||
key : int</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getNumTypes" Static="true">
|
||||
<Documentation>
|
||||
<UserDocu>Returns the number of type ids</UserDocu>
|
||||
<UserDocu>getNumTypes() -> int\n
|
||||
Returns the number of type ids created so far.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getBadType" Static="true">
|
||||
<Documentation>
|
||||
<UserDocu>Returns an invalid type id</UserDocu>
|
||||
<UserDocu>getBadType() -> Base.BaseType\n
|
||||
Returns an invalid type id.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getAllDerivedFrom" Static="true">
|
||||
<Documentation>
|
||||
<UserDocu>Returns all descendants</UserDocu>
|
||||
<UserDocu>getAllDerivedFrom(type) -> list\n
|
||||
Returns all descendants from the given type id.\n
|
||||
type : str, Base.BaseType</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getParent" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>Returns the parent type id</UserDocu>
|
||||
<UserDocu>getParent() -> Base.BaseType\n
|
||||
Returns the parent type id.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isBad" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>Checks if the type id is invalid</UserDocu>
|
||||
<UserDocu>isBad() -> bool\n
|
||||
Checks if the type id is invalid.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isDerivedFrom" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>Returns true if given type is a father</UserDocu>
|
||||
<UserDocu>isDerivedFrom(type) -> bool\n
|
||||
Returns true if given type id is a father of this type id.\n
|
||||
type : str, Base.BaseType</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getAllDerived" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>Returns all descendants</UserDocu>
|
||||
<UserDocu>getAllDerived() -> list\n
|
||||
Returns all descendants from this type id.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="createInstance">
|
||||
<Documentation>
|
||||
<UserDocu>Creates an instance of this type</UserDocu>
|
||||
<UserDocu>createInstance() -> object\n
|
||||
Creates an instance of this type id.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="createInstanceByName" Static="true">
|
||||
<Documentation>
|
||||
<UserDocu>Creates an instance of the named type</UserDocu>
|
||||
<UserDocu>createInstanceByName(name, load=False) -> object\n
|
||||
Creates an instance of the named type id.\n
|
||||
name : str
|
||||
load : bool\n Load named type id module.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Attribute Name="Name" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>The name of the type id</UserDocu>
|
||||
<UserDocu>The name of the type id.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Name" Type="String" />
|
||||
</Attribute>
|
||||
<Attribute Name="Key" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>The key of the type id</UserDocu>
|
||||
<UserDocu>The key of the type id.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Key" Type="Long" />
|
||||
</Attribute>
|
||||
<Attribute Name="Module" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Module in which this class is defined</UserDocu>
|
||||
<UserDocu>Module in which this class is defined.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Module" Type="String"/>
|
||||
</Attribute>
|
||||
|
||||
+12
-12
@@ -87,9 +87,9 @@ const char* UnitsApi::getDescription(UnitSystem system)
|
||||
}
|
||||
}
|
||||
|
||||
UnitsSchemaPtr UnitsApi::createSchema(UnitSystem s)
|
||||
UnitsSchemaPtr UnitsApi::createSchema(UnitSystem system)
|
||||
{
|
||||
switch (s) {
|
||||
switch (system) {
|
||||
case UnitSystem::SI1:
|
||||
return std::make_unique<UnitsSchemaInternal>();
|
||||
case UnitSystem::SI2:
|
||||
@@ -115,14 +115,14 @@ UnitsSchemaPtr UnitsApi::createSchema(UnitSystem s)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void UnitsApi::setSchema(UnitSystem s)
|
||||
void UnitsApi::setSchema(UnitSystem system)
|
||||
{
|
||||
if (UserPrefSystem) {
|
||||
UserPrefSystem->resetSchemaUnits(); // for schemas changed the Quantity constants
|
||||
}
|
||||
|
||||
UserPrefSystem = createSchema(s);
|
||||
currentSystem = s;
|
||||
UserPrefSystem = createSchema(system);
|
||||
currentSystem = system;
|
||||
|
||||
// for wrong value fall back to standard schema
|
||||
if (!UserPrefSystem) {
|
||||
@@ -133,21 +133,21 @@ void UnitsApi::setSchema(UnitSystem s)
|
||||
UserPrefSystem->setSchemaUnits(); // if necessary a unit schema can change the constants in Quantity (e.g. mi=1.8km rather then 1.6km).
|
||||
}
|
||||
|
||||
QString UnitsApi::toString(const Base::Quantity& q, const QuantityFormat& f)
|
||||
QString UnitsApi::toString(const Base::Quantity& quantity, const QuantityFormat& format)
|
||||
{
|
||||
QString value = QString::fromLatin1("'%1 %2'").arg(q.getValue(), 0, f.toFormat(), f.precision)
|
||||
.arg(q.getUnit().getString());
|
||||
QString value = QString::fromLatin1("'%1 %2'").arg(quantity.getValue(), 0, format.toFormat(), format.precision)
|
||||
.arg(quantity.getUnit().getString());
|
||||
return value;
|
||||
}
|
||||
|
||||
QString UnitsApi::toNumber(const Base::Quantity& q, const QuantityFormat& f)
|
||||
QString UnitsApi::toNumber(const Base::Quantity& quantity, const QuantityFormat& format)
|
||||
{
|
||||
return toNumber(q.getValue(), f);
|
||||
return toNumber(quantity.getValue(), format);
|
||||
}
|
||||
|
||||
QString UnitsApi::toNumber(double d, const QuantityFormat& f)
|
||||
QString UnitsApi::toNumber(double value, const QuantityFormat& format)
|
||||
{
|
||||
QString number = QString::fromLatin1("%1").arg(d, 0, f.toFormat(), f.precision);
|
||||
QString number = QString::fromLatin1("%1").arg(value, 0, format.toFormat(), format.precision);
|
||||
return number;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <QString>
|
||||
|
||||
#include "UnitsSchemaInternal.h"
|
||||
#include <cmath>
|
||||
|
||||
|
||||
using namespace Base;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <QString>
|
||||
|
||||
#include "UnitsSchemaMKS.h"
|
||||
#include <cmath>
|
||||
|
||||
|
||||
using namespace Base;
|
||||
|
||||
@@ -39,14 +39,6 @@ Vector3<_Precision>::Vector3 (_Precision fx, _Precision fy, _Precision fz)
|
||||
{
|
||||
}
|
||||
|
||||
template <class _Precision>
|
||||
Vector3<_Precision>::Vector3 (const Vector3<_Precision>& rcVct)
|
||||
: x(rcVct.x),
|
||||
y(rcVct.y),
|
||||
z(rcVct.z)
|
||||
{
|
||||
}
|
||||
|
||||
template <class _Precision>
|
||||
_Precision& Vector3<_Precision>::operator [] (unsigned short usIndex)
|
||||
{
|
||||
@@ -155,15 +147,6 @@ Vector3<_Precision> Vector3<_Precision>::operator / (_Precision fDiv) const
|
||||
return Vector3<_Precision>(this->x/fDiv,this->y/fDiv,this->z/fDiv);
|
||||
}
|
||||
|
||||
template <class _Precision>
|
||||
Vector3<_Precision>& Vector3<_Precision>::operator = (const Vector3<_Precision>& rcVct)
|
||||
{
|
||||
x = rcVct.x;
|
||||
y = rcVct.y;
|
||||
z = rcVct.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class _Precision>
|
||||
_Precision Vector3<_Precision>::operator * (const Vector3<_Precision>& rcVct) const
|
||||
{
|
||||
|
||||
+5
-3
@@ -91,8 +91,9 @@ public:
|
||||
|
||||
/// Construction
|
||||
explicit Vector3 (_Precision fx = 0.0, _Precision fy = 0.0, _Precision fz = 0.0);
|
||||
/// Construction
|
||||
Vector3 (const Vector3<_Precision>& rcVct);
|
||||
Vector3 (const Vector3<_Precision>& v) = default;
|
||||
Vector3 (Vector3<_Precision>&& v) = default;
|
||||
~Vector3 () = default;
|
||||
|
||||
/** @name Operator */
|
||||
//@{
|
||||
@@ -117,7 +118,8 @@ public:
|
||||
Vector3 & operator *= (_Precision fScale);
|
||||
Vector3 & operator /= (_Precision fDiv);
|
||||
/// Assignment
|
||||
Vector3 & operator = (const Vector3<_Precision>& rcVct);
|
||||
Vector3 & operator = (const Vector3<_Precision>& v) = default;
|
||||
Vector3 & operator = (Vector3<_Precision>&& v) = default;
|
||||
/// Scalar product
|
||||
_Precision operator * (const Vector3<_Precision>& rcVct) const;
|
||||
/// Scalar product
|
||||
|
||||
+91
-75
@@ -16,171 +16,187 @@
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
|
||||
<DeveloperDocu>This is the Vector export class</DeveloperDocu>
|
||||
<UserDocu>This class represents a 3D float vector</UserDocu>
|
||||
<UserDocu>Base.Vector class.\n
|
||||
This class represents a 3D float vector.
|
||||
Useful to represent points in the 3D space.\n
|
||||
The following constructors are supported:\n
|
||||
Vector(x=0, y=0, z=0)
|
||||
x : float
|
||||
y : float
|
||||
z : float\n
|
||||
Vector(vector)
|
||||
Copy constructor.
|
||||
vector : Base.Vector\n
|
||||
Vector(seq)
|
||||
Define from a sequence of float.
|
||||
seq : sequence of float.</UserDocu>
|
||||
</Documentation>
|
||||
<Methode Name="__reduce__" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>__reduce__()
|
||||
Serialization of Vector objects
|
||||
</UserDocu>
|
||||
<UserDocu>__reduce__() -> tuple\n
|
||||
Serialization of Vector objects.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="add" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>add(Vector)
|
||||
returns the sum of this and another vector
|
||||
</UserDocu>
|
||||
<UserDocu>add(vector2) -> Base.Vector\n
|
||||
Returns the sum of this vector and `vector2`.\n
|
||||
vector2 : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="sub" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>sub(Vector)
|
||||
returns the difference of this and another vector
|
||||
</UserDocu>
|
||||
<UserDocu>sub(vector2) -> Base.Vector\n
|
||||
Returns the difference of this vector and `vector2`.\n
|
||||
vector2 : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="negative" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>negative()
|
||||
returns the negative (opposite) of this vector
|
||||
</UserDocu>
|
||||
<UserDocu>negative() -> Base.Vector\n
|
||||
Returns the negative (opposite) of this vector.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="scale">
|
||||
<Documentation>
|
||||
<UserDocu>scale(Float,Float,Float)
|
||||
scales (multiplies) this vector by a factor
|
||||
</UserDocu>
|
||||
<UserDocu>scale(x, y, z) -> Base.Vector\n
|
||||
Scales in-place this vector by the given factor in each component.\n
|
||||
x : float\n x-component factor scale.
|
||||
y : float\n y-component factor scale.
|
||||
z : float\n z-component factor scale.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="multiply">
|
||||
<Documentation>
|
||||
<UserDocu>multiply(Float)
|
||||
multiplies (scales) this vector by a single factor
|
||||
</UserDocu>
|
||||
<UserDocu>multiply(factor) -> Base.Vector\n
|
||||
Multiplies in-place each component of this vector by a single factor.
|
||||
Equivalent to scale(factor, factor, factor).\n
|
||||
factor : float</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="dot" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>dot(Vector)
|
||||
returns the dot product of the this vector with another one
|
||||
</UserDocu>
|
||||
<UserDocu>dot(vector2) -> float\n
|
||||
Returns the scalar product (dot product) between this vector and `vector2`.\n
|
||||
vector2 : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="cross" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>cross(Vector)
|
||||
returns the cross product between this and another vector
|
||||
</UserDocu>
|
||||
<UserDocu>cross(vector2) -> Base.Vector\n
|
||||
Returns the vector product (cross product) between this vector and `vector2`.\n
|
||||
vector2 : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isOnLineSegment" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>isOnLineSegment(Vector, Vector)
|
||||
checks if Vector is on a line segment
|
||||
</UserDocu>
|
||||
<UserDocu>isOnLineSegment(vector1, vector2) -> bool\n
|
||||
Checks if this vector is on the line segment generated by `vector1` and `vector2`.\n
|
||||
vector1 : Base.Vector
|
||||
vector2 : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getAngle" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>getAngle(Vector)
|
||||
returns the angle in radians between this and another vector
|
||||
</UserDocu>
|
||||
<UserDocu>getAngle(vector2) -> float\n
|
||||
Returns the angle in radians between this vector and `vector2`.\n
|
||||
vector2 : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="normalize">
|
||||
<Documentation>
|
||||
<UserDocu>normalize()
|
||||
normalizes the vector to the length of 1.0
|
||||
</UserDocu>
|
||||
<UserDocu>normalize() -> Base.Vector\n
|
||||
Normalizes in-place this vector to the length of 1.0.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isEqual">
|
||||
<Documentation>
|
||||
<UserDocu>isEqual(Vector, tolerance) -> Boolean
|
||||
If the distance to the given point is less or equal to the tolerance
|
||||
bith points are considered equal.
|
||||
</UserDocu>
|
||||
<UserDocu>isEqual(vector2, tol=0) -> bool\n
|
||||
Checks if the distance between the points represented by this vector
|
||||
and `vector2` is less or equal to the given tolerance.\n
|
||||
vector2 : Base.Vector
|
||||
tol : float</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="projectToLine">
|
||||
<Documentation>
|
||||
<UserDocu>projectToLine(Vector pnt,Vector vec)
|
||||
Projects the point 'pnt' on a line that goes through the origin with the direction vector 'vec'.
|
||||
The result is the vector from point 'pnt' to the projected point.
|
||||
NOTE: The result does not depend on the vector instance 'self'.
|
||||
NOTE: This method modifies the vector instance 'self'.
|
||||
</UserDocu>
|
||||
<UserDocu>projectToLine(point, dir) -> Base.Vector\n
|
||||
Projects `point` on a line that goes through the origin with the direction `dir`.
|
||||
The result is the vector from `point` to the projected point.
|
||||
The operation is equivalent to dir_n.cross(dir_n.cross(point)), where `dir_n` is
|
||||
the vector `dir` normalized.
|
||||
The method modifies this vector instance according to result and does not
|
||||
depend on the vector itself.\n
|
||||
point : Base.Vector
|
||||
dir : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="projectToPlane">
|
||||
<Documentation>
|
||||
<UserDocu>projectToPlane(Vector,Vector)
|
||||
projects the vector on a plane defined by a base point and a normal
|
||||
</UserDocu>
|
||||
<UserDocu>projectToPlane(base, normal) -> Base.Vector\n
|
||||
Projects in-place this vector on a plane defined by a base point
|
||||
represented by `base` and a normal defined by `normal`.\n
|
||||
base : Base.Vector
|
||||
normal : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="distanceToPoint" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
distanceToPoint(Vector)
|
||||
returns the distance to another point
|
||||
</UserDocu>
|
||||
<UserDocu>distanceToPoint(point2) -> float\n
|
||||
Returns the distance to another point represented by `point2`.\n.
|
||||
point : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="distanceToLine" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>distanceToLine(Vector,Vector)
|
||||
returns the distance between this vector and a line defined by
|
||||
a base point and a direction
|
||||
</UserDocu>
|
||||
<UserDocu>distanceToLine(base, dir) -> float\n
|
||||
Returns the distance between the point represented by this vector
|
||||
and a line defined by a base point represented by `base` and a
|
||||
direction `dir`.\n
|
||||
base : Base.Vector
|
||||
dir : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="distanceToLineSegment" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>distanceToLineSegment(Vector,Vector)
|
||||
returns the distance between this vector and a line segment defined by
|
||||
a base point and a direction
|
||||
</UserDocu>
|
||||
<UserDocu>distanceToLineSegment(point1, point2) -> Base.Vector\n
|
||||
Returns the vector between the point represented by this vector and the point
|
||||
on the line segment with the shortest distance. The line segment is defined by
|
||||
`point1` and `point2`.\n
|
||||
point1 : Base.Vector
|
||||
point2 : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="distanceToPlane" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>distanceToPlane(Vector,Vector)
|
||||
returns the distance between this vector and a plane defined by
|
||||
a base point and a normal
|
||||
</UserDocu>
|
||||
<UserDocu>distanceToPlane(base, normal) -> float\n
|
||||
Returns the distance between this vector and a plane defined by a
|
||||
base point represented by `base` and a normal defined by `normal`.\n
|
||||
base : Base.Vector
|
||||
normal : Base.Vector</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Attribute Name="Length" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>Length([Float]) -> Float
|
||||
gets or sets the length of this vector
|
||||
</UserDocu>
|
||||
<UserDocu>Gets or sets the length of this vector.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Type" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="x" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>x([Float]) -> Float
|
||||
gets or sets the X component of this vector
|
||||
</UserDocu>
|
||||
<UserDocu>Gets or sets the X component of this vector.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="x" Type="Float"/>
|
||||
</Attribute>
|
||||
<Attribute Name="y" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>y([Float]) -> Float
|
||||
gets or sets the Y component of this vector
|
||||
</UserDocu>
|
||||
<UserDocu>Gets or sets the Y component of this vector.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="y" Type="Float"/>
|
||||
</Attribute>
|
||||
<Attribute Name="z" ReadOnly="false">
|
||||
<Documentation>
|
||||
<UserDocu>z([Float]) -> Float
|
||||
gets or sets the Z component of this vector
|
||||
</UserDocu>
|
||||
<UserDocu>Gets or sets the Z component of this vector.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="z" Type="Float"/>
|
||||
</Attribute>
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
// inclusion of the generated files (generated out of VectorPy.xml)
|
||||
#include "GeometryPyCXX.h"
|
||||
#include "VectorPy.h"
|
||||
#include "MatrixPy.h"
|
||||
#include "RotationPy.h"
|
||||
#include "VectorPy.cpp"
|
||||
|
||||
using namespace Base;
|
||||
@@ -156,7 +154,7 @@ PyObject* VectorPy::number_multiply_handler(PyObject *self, PyObject *other)
|
||||
return new VectorPy(a * b);
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_NotImplementedError, "Not implemented");
|
||||
PyErr_SetString(PyExc_TypeError, "A Vector can only be multiplied by Vector or number");
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Version Number
|
||||
#define FCVersionMajor "${PACKAGE_VERSION_MAJOR}"
|
||||
#define FCVersionMinor "${PACKAGE_VERSION_MINOR}"
|
||||
#define FCVersionPoint "${FREECAD_VERSION_PATCH}"
|
||||
#define FCVersionName "${PACKAGE_VERSION_NAME}"
|
||||
// test: $Format:Hash (%H), Date: %ci$
|
||||
#define FCRevision "${PACKAGE_WCREF}" //Highest committed revision number
|
||||
|
||||
@@ -10,7 +10,8 @@ if (WIN32)
|
||||
REALPATH BASE_DIR "${CMAKE_INSTALL_PREFIX}")
|
||||
set( ${CMAKE_INSTALL_BINDIR})
|
||||
else()
|
||||
set(FREECAD_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
|
||||
get_filename_component(FREECAD_LIBRARY_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}"
|
||||
REALPATH BASE_DIR "${CMAKE_INSTALL_PREFIX}")
|
||||
endif()
|
||||
|
||||
configure_file(__init__.py.template ${NAMESPACE_INIT})
|
||||
|
||||
+4
-3
@@ -33,6 +33,7 @@
|
||||
# include <QTimer>
|
||||
# include <QToolBar>
|
||||
# include <QToolButton>
|
||||
# include <QToolTip>
|
||||
#endif
|
||||
|
||||
#include <Base/Exception.h>
|
||||
@@ -381,7 +382,7 @@ void ActionGroup::onActivated (QAction* a)
|
||||
|
||||
void ActionGroup::onHovered (QAction *a)
|
||||
{
|
||||
Gui::ToolTip::showText(QCursor::pos(), a->toolTip());
|
||||
QToolTip::showText(QCursor::pos(), a->toolTip());
|
||||
}
|
||||
|
||||
|
||||
@@ -927,7 +928,7 @@ void RecentMacrosAction::setFiles(const QStringList& files)
|
||||
auto check = Application::Instance->commandManager().checkAcceleratorForConflicts(qPrintable(accel_tmp));
|
||||
if (check) {
|
||||
recentFiles[index]->setShortcut(QKeySequence());
|
||||
auto msg = QStringLiteral("Recent macros : shortcut %1 disabled because conflicting with %2")
|
||||
auto msg = QStringLiteral("Recent macros : keyboard shortcut %1 disabled because conflicting with %2")
|
||||
.arg(accel_tmp).arg(QLatin1String(check->getName()));
|
||||
Base::Console().Warning("%s\n", qPrintable(msg));
|
||||
}
|
||||
@@ -936,7 +937,7 @@ void RecentMacrosAction::setFiles(const QStringList& files)
|
||||
recentFiles[index]->setShortcut(accel);
|
||||
}
|
||||
}
|
||||
recentFiles[index]->setStatusTip(tr("Run macro %1 (Shift+click to edit) shortcut: %2").arg(files[index]).arg(accel));
|
||||
recentFiles[index]->setStatusTip(tr("Run macro %1 (Shift+click to edit) keyboard shortcut: %2").arg(files[index]).arg(accel));
|
||||
recentFiles[index]->setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
+17
-16
@@ -1017,7 +1017,7 @@ bool Application::sendHasMsgToFocusView(const char* pMsg)
|
||||
return false;
|
||||
}
|
||||
|
||||
Gui::MDIView* Application::activeView(void) const
|
||||
Gui::MDIView* Application::activeView() const
|
||||
{
|
||||
if (activeDocument())
|
||||
return activeDocument()->getActiveView();
|
||||
@@ -1049,12 +1049,12 @@ void Application::activateView(const Base::Type& type, bool create)
|
||||
}
|
||||
|
||||
/// Getter for the active view
|
||||
Gui::Document* Application::activeDocument(void) const
|
||||
Gui::Document* Application::activeDocument() const
|
||||
{
|
||||
return d->activeDocument;
|
||||
}
|
||||
|
||||
Gui::Document* Application::editDocument(void) const
|
||||
Gui::Document* Application::editDocument() const
|
||||
{
|
||||
return d->editDocument;
|
||||
}
|
||||
@@ -1188,7 +1188,7 @@ void Application::detachView(Gui::BaseView* pcView)
|
||||
d->passive.remove(pcView);
|
||||
}
|
||||
|
||||
void Application::onUpdate(void)
|
||||
void Application::onUpdate()
|
||||
{
|
||||
// update all documents
|
||||
std::map<const App::Document*, Gui::Document*>::iterator It;
|
||||
@@ -1218,7 +1218,7 @@ void Application::viewActivated(MDIView* pcView)
|
||||
}
|
||||
|
||||
|
||||
void Application::updateActive(void)
|
||||
void Application::updateActive()
|
||||
{
|
||||
activeDocument()->onUpdate();
|
||||
}
|
||||
@@ -1569,7 +1569,7 @@ QString Application::workbenchMenuText(const QString& wb) const
|
||||
return QString();
|
||||
}
|
||||
|
||||
QStringList Application::workbenches(void) const
|
||||
QStringList Application::workbenches() const
|
||||
{
|
||||
// If neither 'HiddenWorkbench' nor 'ExtraWorkbench' is set then all workbenches are returned.
|
||||
const std::map<std::string,std::string>& config = App::Application::Config();
|
||||
@@ -1659,22 +1659,22 @@ void Application::setupContextMenu(const char* recipient, MenuItem* items) const
|
||||
}
|
||||
}
|
||||
|
||||
bool Application::isClosing(void)
|
||||
bool Application::isClosing()
|
||||
{
|
||||
return d->isClosing;
|
||||
}
|
||||
|
||||
MacroManager *Application::macroManager(void)
|
||||
MacroManager *Application::macroManager()
|
||||
{
|
||||
return d->macroMngr;
|
||||
}
|
||||
|
||||
CommandManager &Application::commandManager(void)
|
||||
CommandManager &Application::commandManager()
|
||||
{
|
||||
return d->commandManager;
|
||||
}
|
||||
|
||||
Gui::PreferencePackManager* Application::prefPackManager(void)
|
||||
Gui::PreferencePackManager* Application::prefPackManager()
|
||||
{
|
||||
return d->prefPackManager;
|
||||
}
|
||||
@@ -1756,7 +1756,7 @@ static void init_resources()
|
||||
Q_INIT_RESOURCE(translation);
|
||||
}
|
||||
|
||||
void Application::initApplication(void)
|
||||
void Application::initApplication()
|
||||
{
|
||||
static bool init = false;
|
||||
if (init) {
|
||||
@@ -1778,7 +1778,7 @@ void Application::initApplication(void)
|
||||
}
|
||||
}
|
||||
|
||||
void Application::initTypes(void)
|
||||
void Application::initTypes()
|
||||
{
|
||||
// views
|
||||
Gui::BaseView ::init();
|
||||
@@ -1848,7 +1848,7 @@ void Application::initTypes(void)
|
||||
(ViewProviderDocumentObject::getClassTypeId());
|
||||
}
|
||||
|
||||
void Application::initOpenInventor(void)
|
||||
void Application::initOpenInventor()
|
||||
{
|
||||
// init the Inventor subsystem
|
||||
SoDB::init();
|
||||
@@ -1856,12 +1856,12 @@ void Application::initOpenInventor(void)
|
||||
SoFCDB::init();
|
||||
}
|
||||
|
||||
void Application::runInitGuiScript(void)
|
||||
void Application::runInitGuiScript()
|
||||
{
|
||||
Base::Interpreter().runString(Base::ScriptFactory().ProduceScript("FreeCADGuiInit"));
|
||||
}
|
||||
|
||||
void Application::runApplication(void)
|
||||
void Application::runApplication()
|
||||
{
|
||||
const std::map<std::string,std::string>& cfg = App::Application::Config();
|
||||
std::map<std::string,std::string>::const_iterator it;
|
||||
@@ -2038,7 +2038,8 @@ void Application::runApplication(void)
|
||||
std::map<std::string, std::string>& config = App::Application::Config();
|
||||
QString major = QString::fromLatin1(config["BuildVersionMajor"].c_str());
|
||||
QString minor = QString::fromLatin1(config["BuildVersionMinor"].c_str());
|
||||
QString title = QString::fromLatin1("%1 %2.%3").arg(mainApp.applicationName(), major, minor);
|
||||
QString point = QString::fromLatin1(config["BuildVersionPoint"].c_str());
|
||||
QString title = QString::fromLatin1("%1 %2.%3.%4").arg(mainApp.applicationName(), major, minor, point);
|
||||
mw.setWindowTitle(title);
|
||||
} else {
|
||||
mw.setWindowTitle(mainApp.applicationName());
|
||||
|
||||
+15
-15
@@ -89,9 +89,9 @@ public:
|
||||
/// get called if a view gets activated, this manage the whole activation scheme
|
||||
void viewActivated(Gui::MDIView* pcView);
|
||||
/// call update to all documents and all views (costly!)
|
||||
void onUpdate(void);
|
||||
void onUpdate();
|
||||
/// call update to all views of the active document
|
||||
void updateActive(void);
|
||||
void updateActive();
|
||||
/// call update to all command actions
|
||||
void updateActions(bool delay = false);
|
||||
//@}
|
||||
@@ -160,11 +160,11 @@ public:
|
||||
/// message when a GuiDocument is about to vanish
|
||||
void onLastWindowClosed(Gui::Document* pcDoc);
|
||||
/// Getter for the active document
|
||||
Gui::Document* activeDocument(void) const;
|
||||
Gui::Document* activeDocument() const;
|
||||
/// Set the active document
|
||||
void setActiveDocument(Gui::Document* pcDocument);
|
||||
/// Getter for the editing document
|
||||
Gui::Document* editDocument(void) const;
|
||||
Gui::Document* editDocument() const;
|
||||
Gui::MDIView* editViewOfNode(SoNode *node) const;
|
||||
/// Set editing document, which will reset editing of all other document
|
||||
void setEditDocument(Gui::Document* pcDocument);
|
||||
@@ -177,7 +177,7 @@ public:
|
||||
*/
|
||||
Gui::Document* getDocument(const App::Document* pDoc) const;
|
||||
/// Getter for the active view of the active document or null
|
||||
Gui::MDIView* activeView(void) const;
|
||||
Gui::MDIView* activeView() const;
|
||||
/// Activate a view of the given type of the active document
|
||||
void activateView(const Base::Type&, bool create=false);
|
||||
/// Shows the associated view provider of the given object
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
//@}
|
||||
|
||||
/// true when the application shutting down
|
||||
bool isClosing(void);
|
||||
bool isClosing();
|
||||
void checkForPreviousCrashes();
|
||||
|
||||
/** @name workbench handling */
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
QPixmap workbenchIcon(const QString&) const;
|
||||
QString workbenchToolTip(const QString&) const;
|
||||
QString workbenchMenuText(const QString&) const;
|
||||
QStringList workbenches(void) const;
|
||||
QStringList workbenches() const;
|
||||
void setupContextMenu(const char* recipient, MenuItem*) const;
|
||||
//@}
|
||||
|
||||
@@ -212,24 +212,24 @@ public:
|
||||
/** @name User Commands */
|
||||
//@{
|
||||
/// Get macro manager
|
||||
Gui::MacroManager *macroManager(void);
|
||||
Gui::MacroManager *macroManager();
|
||||
/// Reference to the command manager
|
||||
Gui::CommandManager &commandManager(void);
|
||||
Gui::CommandManager &commandManager();
|
||||
/// helper which create the commands
|
||||
void createStandardOperations();
|
||||
//@}
|
||||
|
||||
Gui::PreferencePackManager* prefPackManager(void);
|
||||
Gui::PreferencePackManager* prefPackManager();
|
||||
|
||||
/** @name Init, Destruct an Access methods */
|
||||
//@{
|
||||
/// some kind of singleton
|
||||
static Application* Instance;
|
||||
static void initApplication(void);
|
||||
static void initTypes(void);
|
||||
static void initOpenInventor(void);
|
||||
static void runInitGuiScript(void);
|
||||
static void runApplication(void);
|
||||
static void initApplication();
|
||||
static void initTypes();
|
||||
static void initOpenInventor();
|
||||
static void runInitGuiScript();
|
||||
static void runApplication();
|
||||
void tryClose( QCloseEvent * e );
|
||||
//@}
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@ private:
|
||||
|
||||
}
|
||||
|
||||
void RecoveryWriter::writeFiles(void)
|
||||
void RecoveryWriter::writeFiles()
|
||||
{
|
||||
#if 0
|
||||
FileWriter::writeFiles();
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ public:
|
||||
always returns true.
|
||||
*/
|
||||
virtual bool shouldWrite(const std::string&, const Base::Persistence *) const;
|
||||
virtual void writeFiles(void);
|
||||
virtual void writeFiles();
|
||||
|
||||
private:
|
||||
AutoSaveProperty& saver;
|
||||
|
||||
+19
-18
@@ -13,71 +13,72 @@
|
||||
Delete="true">
|
||||
<Documentation>
|
||||
<Author Licence="LGPL" Name="Zheng, Lei" EMail="realthunder.dev@gmail.com" />
|
||||
<UserDocu>Class for creating a Coin3D representation of a coordinate system</UserDocu>
|
||||
<UserDocu>Gui.AxisOrigin class.\n
|
||||
Class for creating a Coin3D representation of a coordinate system.</UserDocu>
|
||||
</Documentation>
|
||||
<Methode Name="getElementPicked" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>getElementPicked(pickPoint): return the picked subelement</UserDocu>
|
||||
<UserDocu>getElementPicked(pickedPoint) -> str\n
|
||||
Returns the picked element name.\n
|
||||
pickedPoint : coin.SoPickedPoint</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getDetailPath" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
getDetailPath(subname,path): return Coin detail and path of an subelement
|
||||
|
||||
subelement: dot separated string reference to the sub element
|
||||
pPath: output coin path leading to the returned element detail
|
||||
</UserDocu>
|
||||
<UserDocu>getDetailPath(subname, path) -> coin.SoDetail or None\n
|
||||
Returns Coin detail of a subelement.
|
||||
Note: Not fully implemented. Currently only returns None.\n
|
||||
subname : str\n String reference to the subelement.
|
||||
path: coin.SoPath\n Output Coin path leading to the returned element detail.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Attribute Name="AxisLength">
|
||||
<Documentation>
|
||||
<UserDocu>Get/set the axis length</UserDocu>
|
||||
<UserDocu>Get/set the axis length.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="AxisLength" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="LineWidth">
|
||||
<Documentation>
|
||||
<UserDocu>Get/set the axis line width for rendering</UserDocu>
|
||||
<UserDocu>Get/set the axis line width for rendering.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="LineWidth" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="PointSize">
|
||||
<Documentation>
|
||||
<UserDocu>Get/set the origin point size for rendering</UserDocu>
|
||||
<UserDocu>Get/set the origin point size for rendering.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="PointSize" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="Scale">
|
||||
<Documentation>
|
||||
<UserDocu>Get/set auto scaling factor, 0 to disable</UserDocu>
|
||||
<UserDocu>Get/set auto scaling factor, 0 to disable.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Scale" Type="Float" />
|
||||
</Attribute>
|
||||
<Attribute Name="Plane">
|
||||
<Documentation>
|
||||
<UserDocu>Get/set axis plane size and distance to axis line</UserDocu>
|
||||
<UserDocu>Get/set axis plane size and distance to axis line.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Plane" Type="Tuple" />
|
||||
</Attribute>
|
||||
<Attribute Name="Labels">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
Get/set axis component names as a dictionary. Available keys are,
|
||||
<UserDocu>Get/set axis component names as a dictionary.
|
||||
Available keys are:
|
||||
'O': origin
|
||||
'X': x axis
|
||||
'Y': y axis
|
||||
'Z': z axis
|
||||
'XY': xy plane
|
||||
'XZ': xz plane
|
||||
'YZ': yz plane
|
||||
</UserDocu>
|
||||
'YZ': yz plane</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Labels" Type="Dict" />
|
||||
</Attribute>
|
||||
<Attribute Name="Node" ReadOnly='true'>
|
||||
<Documentation>
|
||||
<UserDocu>Get the Coin3D node</UserDocu>
|
||||
<UserDocu>Get the Coin3D node.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Node" Type="Object" />
|
||||
</Attribute>
|
||||
|
||||
+56
-33
@@ -45,7 +45,7 @@ int AxisOriginPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
|
||||
|
||||
|
||||
// returns a string which represent the object e.g. when printed in python
|
||||
std::string AxisOriginPy::representation(void) const
|
||||
std::string AxisOriginPy::representation() const
|
||||
{
|
||||
return "<AxisOrigin>";
|
||||
}
|
||||
@@ -53,16 +53,21 @@ std::string AxisOriginPy::representation(void) const
|
||||
PyObject* AxisOriginPy::getElementPicked(PyObject* args)
|
||||
{
|
||||
PyObject *obj;
|
||||
if (!PyArg_ParseTuple(args, "O",&obj))
|
||||
if (!PyArg_ParseTuple(args, "O", &obj))
|
||||
return nullptr;
|
||||
|
||||
void *ptr = nullptr;
|
||||
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "_p_SoPickedPoint", obj, &ptr, 0);
|
||||
SoPickedPoint *pp = reinterpret_cast<SoPickedPoint*>(ptr);
|
||||
if(!pp)
|
||||
throw Base::TypeError("type must be of coin.SoPickedPoint");
|
||||
if (!ptr) {
|
||||
PyErr_SetString(PyExc_TypeError, "'pickedPoint' must be a coin.SoPickedPoint");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SoPickedPoint *pp = static_cast<SoPickedPoint*>(ptr);
|
||||
std::string name;
|
||||
if(!getAxisOriginPtr()->getElementPicked(pp,name))
|
||||
if (!getAxisOriginPtr()->getElementPicked(pp,name))
|
||||
Py_Return;
|
||||
|
||||
return Py::new_reference_to(Py::String(name));
|
||||
}
|
||||
|
||||
@@ -70,89 +75,107 @@ PyObject* AxisOriginPy::getDetailPath(PyObject* args)
|
||||
{
|
||||
const char *sub;
|
||||
PyObject *path;
|
||||
if (!PyArg_ParseTuple(args, "sO",&sub,&path))
|
||||
if (!PyArg_ParseTuple(args, "sO", &sub,&path))
|
||||
return nullptr;
|
||||
|
||||
void *ptr = nullptr;
|
||||
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "_p_SoPath", path, &ptr, 0);
|
||||
SoPath *pPath = reinterpret_cast<SoPath*>(ptr);
|
||||
if(!pPath)
|
||||
throw Base::TypeError("type must be of coin.SoPath");
|
||||
if (!ptr) {
|
||||
PyErr_SetString(PyExc_TypeError, "'path' must be a coin.SoPath");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SoPath *pPath = static_cast<SoPath*>(ptr);
|
||||
SoDetail *det = nullptr;
|
||||
if(!getAxisOriginPtr()->getDetailPath(
|
||||
sub,static_cast<SoFullPath*>(pPath),det))
|
||||
{
|
||||
if(det) delete det;
|
||||
if (!getAxisOriginPtr()->getDetailPath(sub, static_cast<SoFullPath*>(pPath), det)) {
|
||||
delete det;
|
||||
Py_Return;
|
||||
}
|
||||
if(!det)
|
||||
return Py::new_reference_to(Py::True());
|
||||
return Base::Interpreter().createSWIGPointerObj("pivy.coin", "_p_SoDetail", (void*)det, 0);
|
||||
if (!det)
|
||||
Py_Return;
|
||||
|
||||
return Base::Interpreter().createSWIGPointerObj("pivy.coin", "_p_SoDetail", static_cast<void*>(det), 0);
|
||||
}
|
||||
|
||||
Py::Float AxisOriginPy::getAxisLength() const {
|
||||
Py::Float AxisOriginPy::getAxisLength() const
|
||||
{
|
||||
return Py::Float(getAxisOriginPtr()->getAxisLength());
|
||||
}
|
||||
|
||||
void AxisOriginPy::setAxisLength(Py::Float size) {
|
||||
void AxisOriginPy::setAxisLength(Py::Float size)
|
||||
{
|
||||
getAxisOriginPtr()->setAxisLength(size);
|
||||
}
|
||||
|
||||
Py::Float AxisOriginPy::getLineWidth() const {
|
||||
Py::Float AxisOriginPy::getLineWidth() const
|
||||
{
|
||||
return Py::Float(getAxisOriginPtr()->getLineWidth());
|
||||
}
|
||||
|
||||
void AxisOriginPy::setLineWidth(Py::Float size) {
|
||||
void AxisOriginPy::setLineWidth(Py::Float size)
|
||||
{
|
||||
getAxisOriginPtr()->setLineWidth(size);
|
||||
}
|
||||
|
||||
Py::Float AxisOriginPy::getPointSize() const {
|
||||
Py::Float AxisOriginPy::getPointSize() const
|
||||
{
|
||||
return Py::Float(getAxisOriginPtr()->getPointSize());
|
||||
}
|
||||
|
||||
void AxisOriginPy::setPointSize(Py::Float size) {
|
||||
void AxisOriginPy::setPointSize(Py::Float size)
|
||||
{
|
||||
getAxisOriginPtr()->setPointSize(size);
|
||||
}
|
||||
|
||||
Py::Float AxisOriginPy::getScale() const {
|
||||
Py::Float AxisOriginPy::getScale() const
|
||||
{
|
||||
return Py::Float(getAxisOriginPtr()->getScale());
|
||||
}
|
||||
|
||||
void AxisOriginPy::setScale(Py::Float size) {
|
||||
void AxisOriginPy::setScale(Py::Float size)
|
||||
{
|
||||
getAxisOriginPtr()->setScale(size);
|
||||
}
|
||||
|
||||
Py::Tuple AxisOriginPy::getPlane() const {
|
||||
Py::Tuple AxisOriginPy::getPlane() const
|
||||
{
|
||||
auto info = getAxisOriginPtr()->getPlane();
|
||||
Py::Tuple ret(2);
|
||||
ret.setItem(0,Py::Float(info.first));
|
||||
ret.setItem(1,Py::Float(info.second));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void AxisOriginPy::setPlane(Py::Tuple tuple) {
|
||||
void AxisOriginPy::setPlane(Py::Tuple tuple)
|
||||
{
|
||||
float s,d;
|
||||
if (!PyArg_ParseTuple(*tuple, "dd",&s,&d))
|
||||
if (!PyArg_ParseTuple(*tuple, "ff",&s,&d))
|
||||
throw Py::Exception();
|
||||
|
||||
getAxisOriginPtr()->setPlane(s,d);
|
||||
}
|
||||
|
||||
Py::Dict AxisOriginPy::getLabels() const {
|
||||
Py::Dict AxisOriginPy::getLabels() const
|
||||
{
|
||||
Py::Dict dict;
|
||||
for(auto &v : getAxisOriginPtr()->getLabels())
|
||||
for (auto &v : getAxisOriginPtr()->getLabels())
|
||||
dict.setItem(Py::String(v.first),Py::String(v.second));
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
void AxisOriginPy::setLabels(Py::Dict dict) {
|
||||
void AxisOriginPy::setLabels(Py::Dict dict)
|
||||
{
|
||||
std::map<std::string,std::string> labels;
|
||||
for(auto it=dict.begin();it!=dict.end();++it) {
|
||||
for (auto it=dict.begin(); it!=dict.end(); ++it) {
|
||||
const auto &value = *it;
|
||||
labels[value.first.as_string()] = Py::Object(value.second).as_string();
|
||||
}
|
||||
getAxisOriginPtr()->setLabels(labels);
|
||||
}
|
||||
|
||||
Py::Object AxisOriginPy::getNode(void) const
|
||||
Py::Object AxisOriginPy::getNode() const
|
||||
{
|
||||
SoGroup* node = getAxisOriginPtr()->getNode();
|
||||
PyObject* Ptr = Base::Interpreter().createSWIGPointerObj("pivy.coin","SoGroup *", node, 1);
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
|
||||
BitmapFactoryInst* BitmapFactoryInst::_pcSingleton = nullptr;
|
||||
|
||||
BitmapFactoryInst& BitmapFactoryInst::instance(void)
|
||||
BitmapFactoryInst& BitmapFactoryInst::instance()
|
||||
{
|
||||
if (_pcSingleton == nullptr)
|
||||
{
|
||||
@@ -112,7 +112,7 @@ BitmapFactoryInst& BitmapFactoryInst::instance(void)
|
||||
return *_pcSingleton;
|
||||
}
|
||||
|
||||
void BitmapFactoryInst::destruct (void)
|
||||
void BitmapFactoryInst::destruct ()
|
||||
{
|
||||
if (_pcSingleton != nullptr)
|
||||
delete _pcSingleton;
|
||||
@@ -203,7 +203,7 @@ bool BitmapFactoryInst::findPixmapInCache(const char* name, QPixmap& px) const
|
||||
|
||||
QIcon BitmapFactoryInst::iconFromTheme(const char* name, const QIcon& fallback)
|
||||
{
|
||||
QString iconName = QString::fromLatin1(name);
|
||||
QString iconName = QString::fromUtf8(name);
|
||||
QIcon icon = QIcon::fromTheme(iconName, fallback);
|
||||
if (icon.isNull()) {
|
||||
QPixmap px = pixmap(name);
|
||||
|
||||
@@ -52,8 +52,8 @@ public:
|
||||
BottomRight /**< Place to the bottom right corner */
|
||||
};
|
||||
|
||||
static BitmapFactoryInst& instance(void);
|
||||
static void destruct (void);
|
||||
static BitmapFactoryInst& instance();
|
||||
static void destruct ();
|
||||
|
||||
/// Adds a path where pixmaps can be found
|
||||
void addPath(const QString& path);
|
||||
@@ -149,7 +149,7 @@ private:
|
||||
};
|
||||
|
||||
/// Get the global instance
|
||||
inline BitmapFactoryInst& BitmapFactory(void)
|
||||
inline BitmapFactoryInst& BitmapFactory()
|
||||
{
|
||||
return BitmapFactoryInst::instance();
|
||||
}
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ public:
|
||||
*/
|
||||
virtual ~ComboView();
|
||||
|
||||
Gui::TaskView::TaskView *getTaskPanel(void){return taskPanel;}
|
||||
Gui::TaskView::TaskView *getTaskPanel(){return taskPanel;}
|
||||
QTabWidget* getTabPanel() const { return tabs;}
|
||||
|
||||
|
||||
|
||||
+36
-29
@@ -264,12 +264,12 @@ void Command::addToGroup(ActionGroup* group)
|
||||
group->addAction(_pcAction->findChild<QAction*>());
|
||||
}
|
||||
|
||||
Application *Command::getGuiApplication(void)
|
||||
Application *Command::getGuiApplication()
|
||||
{
|
||||
return Application::Instance;
|
||||
}
|
||||
|
||||
Gui::Document* Command::getActiveGuiDocument(void) const
|
||||
Gui::Document* Command::getActiveGuiDocument() const
|
||||
{
|
||||
return getGuiApplication()->activeDocument();
|
||||
}
|
||||
@@ -474,7 +474,7 @@ void Command::_invoke(int id, bool disablelog)
|
||||
#endif
|
||||
}
|
||||
|
||||
void Command::testActive(void)
|
||||
void Command::testActive()
|
||||
{
|
||||
if (!_pcAction)
|
||||
return;
|
||||
@@ -523,7 +523,7 @@ void Command::setEnabled(bool on)
|
||||
// Helper methods
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
bool Command::hasActiveDocument(void) const
|
||||
bool Command::hasActiveDocument() const
|
||||
{
|
||||
return getActiveGuiDocument() != nullptr;
|
||||
}
|
||||
@@ -533,7 +533,7 @@ bool Command::hasObject(const char* Name)
|
||||
return getDocument() != nullptr && getDocument()->getObject(Name) != nullptr;
|
||||
}
|
||||
|
||||
Gui::SelectionSingleton& Command::getSelection(void)
|
||||
Gui::SelectionSingleton& Command::getSelection()
|
||||
{
|
||||
return Gui::Selection();
|
||||
}
|
||||
@@ -605,17 +605,17 @@ void Command::openCommand(const char* sCmdName)
|
||||
App::GetApplication().setActiveTransaction(sCmdName);
|
||||
}
|
||||
|
||||
void Command::commitCommand(void)
|
||||
void Command::commitCommand()
|
||||
{
|
||||
App::GetApplication().closeActiveTransaction();
|
||||
}
|
||||
|
||||
void Command::abortCommand(void)
|
||||
void Command::abortCommand()
|
||||
{
|
||||
App::GetApplication().closeActiveTransaction(true);
|
||||
}
|
||||
|
||||
bool Command::hasPendingCommand(void)
|
||||
bool Command::hasPendingCommand()
|
||||
{
|
||||
return !!App::GetApplication().getActiveTransaction();
|
||||
}
|
||||
@@ -657,8 +657,15 @@ void Command::printPyCaller() {
|
||||
if(!frame)
|
||||
return;
|
||||
int line = PyFrame_GetLineNumber(frame);
|
||||
#if PY_VERSION_HEX < 0x030b0000
|
||||
const char *file = PyUnicode_AsUTF8(frame->f_code->co_filename);
|
||||
printCaller(file?file:"<no file>",line);
|
||||
#else
|
||||
PyCodeObject* code = PyFrame_GetCode(frame);
|
||||
const char* file = PyUnicode_AsUTF8(code->co_filename);
|
||||
printCaller(file?file:"<no file>",line);
|
||||
Py_DECREF(code);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Command::printCaller(const char *file, int line) {
|
||||
@@ -810,13 +817,13 @@ const std::string Command::strToPython(const char* Str)
|
||||
}
|
||||
|
||||
/// Updates the (active) document (propagate changes)
|
||||
void Command::updateActive(void)
|
||||
void Command::updateActive()
|
||||
{
|
||||
WaitCursor wc;
|
||||
doCommand(App,"App.ActiveDocument.recompute()");
|
||||
}
|
||||
|
||||
bool Command::isActiveObjectValid(void)
|
||||
bool Command::isActiveObjectValid()
|
||||
{
|
||||
Gui::Document* active = Gui::Application::Instance->activeDocument();
|
||||
assert(active);
|
||||
@@ -843,7 +850,7 @@ void Command::updateAll(std::list<Gui::Document*> cList)
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/// returns the begin of a online help page
|
||||
const char * Command::beginCmdHelp(void)
|
||||
const char * Command::beginCmdHelp()
|
||||
{
|
||||
return "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
|
||||
"<html>\n"
|
||||
@@ -855,7 +862,7 @@ const char * Command::beginCmdHelp(void)
|
||||
}
|
||||
|
||||
/// returns the end of a online help page
|
||||
const char * Command::endCmdHelp(void)
|
||||
const char * Command::endCmdHelp()
|
||||
{
|
||||
return "</body></html>\n\n";
|
||||
}
|
||||
@@ -974,7 +981,7 @@ void Command::printConflictingAccelerators() const
|
||||
Base::Console().Warning("Accelerator conflict between %s (%s) and %s (%s)\n", sName, sAccel, cmd->sName, cmd->sAccel);
|
||||
}
|
||||
|
||||
Action * Command::createAction(void)
|
||||
Action * Command::createAction()
|
||||
{
|
||||
Action *pcAction;
|
||||
pcAction = new Action(this,getMainWindow());
|
||||
@@ -1021,7 +1028,7 @@ Command *GroupCommand::addCommand(const char *name) {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
Action * GroupCommand::createAction(void) {
|
||||
Action * GroupCommand::createAction() {
|
||||
ActionGroup* pcAction = new ActionGroup(this, getMainWindow());
|
||||
pcAction->setMenuRole(QAction::NoRole);
|
||||
pcAction->setDropDownMenu(true);
|
||||
@@ -1061,6 +1068,7 @@ void GroupCommand::activated(int iMsg)
|
||||
}
|
||||
|
||||
void GroupCommand::languageChange() {
|
||||
Command::languageChange();
|
||||
if (_pcAction)
|
||||
setup(_pcAction);
|
||||
}
|
||||
@@ -1069,18 +1077,17 @@ void GroupCommand::setup(Action *pcAction) {
|
||||
|
||||
pcAction->setText(QCoreApplication::translate(className(), getMenuText()));
|
||||
|
||||
// The tooltip for the group is the tooltip of the active tool (that is, the tool that will
|
||||
// be activated when the main portion of the button is clicked).
|
||||
int idx = pcAction->property("defaultAction").toInt();
|
||||
if(idx>=0 && idx<(int)cmds.size() && cmds[idx].first) {
|
||||
auto cmd = cmds[idx].first;
|
||||
pcAction->setIcon(BitmapFactory().iconFromTheme(cmd->getPixmap()));
|
||||
pcAction->setChecked(cmd->getAction()->isChecked(),true);
|
||||
const char *context = dynamic_cast<PythonCommand*>(cmd) ? cmd->getName() : cmd->className();
|
||||
const char *tooltip = cmd->getToolTipText();
|
||||
const char *statustip = cmd->getStatusTip();
|
||||
if (!statustip || '\0' == *statustip)
|
||||
statustip = tooltip;
|
||||
recreateTooltip(context, pcAction);
|
||||
pcAction->setStatusTip(QCoreApplication::translate(context,statustip));
|
||||
cmd->recreateTooltip(context, cmd->getAction());
|
||||
pcAction->setToolTip(cmd->getAction()->toolTip());
|
||||
pcAction->setStatusTip(cmd->getAction()->statusTip());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1136,7 +1143,7 @@ void MacroCommand::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
Action * MacroCommand::createAction(void)
|
||||
Action * MacroCommand::createAction()
|
||||
{
|
||||
Action *pcAction;
|
||||
pcAction = new Action(this,getMainWindow());
|
||||
@@ -1306,7 +1313,7 @@ void PythonCommand::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool PythonCommand::isActive(void)
|
||||
bool PythonCommand::isActive()
|
||||
{
|
||||
try {
|
||||
Base::PyGILStateLocker lock;
|
||||
@@ -1336,7 +1343,7 @@ void PythonCommand::languageChange()
|
||||
}
|
||||
}
|
||||
|
||||
const char* PythonCommand::getHelpUrl(void) const
|
||||
const char* PythonCommand::getHelpUrl() const
|
||||
{
|
||||
PyObject* pcTemp;
|
||||
pcTemp = Interpreter().runMethodObject(_pcPyCommand, "CmdHelpURL");
|
||||
@@ -1347,7 +1354,7 @@ const char* PythonCommand::getHelpUrl(void) const
|
||||
return PyUnicode_AsUTF8(pcTemp);
|
||||
}
|
||||
|
||||
Action * PythonCommand::createAction(void)
|
||||
Action * PythonCommand::createAction()
|
||||
{
|
||||
QAction* qtAction = new QAction(nullptr);
|
||||
Action *pcAction;
|
||||
@@ -1522,7 +1529,7 @@ void PythonGroupCommand::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool PythonGroupCommand::isActive(void)
|
||||
bool PythonGroupCommand::isActive()
|
||||
{
|
||||
try {
|
||||
Base::PyGILStateLocker lock;
|
||||
@@ -1546,7 +1553,7 @@ bool PythonGroupCommand::isActive(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
Action * PythonGroupCommand::createAction(void)
|
||||
Action * PythonGroupCommand::createAction()
|
||||
{
|
||||
Gui::ActionGroup* pcAction = new Gui::ActionGroup(this, Gui::getMainWindow());
|
||||
pcAction->setDropDownMenu(hasDropDownMenu());
|
||||
@@ -1656,7 +1663,7 @@ void PythonGroupCommand::languageChange()
|
||||
}
|
||||
}
|
||||
|
||||
const char* PythonGroupCommand::getHelpUrl(void) const
|
||||
const char* PythonGroupCommand::getHelpUrl() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
@@ -1833,7 +1840,7 @@ std::vector <Command*> CommandManager::getModuleCommands(const char *sModName) c
|
||||
return vCmds;
|
||||
}
|
||||
|
||||
std::vector <Command*> CommandManager::getAllCommands(void) const
|
||||
std::vector <Command*> CommandManager::getAllCommands() const
|
||||
{
|
||||
std::vector <Command*> vCmds;
|
||||
|
||||
@@ -1870,7 +1877,7 @@ void CommandManager::runCommandByName (const char* sName) const
|
||||
pCmd->invoke(0);
|
||||
}
|
||||
|
||||
void CommandManager::testActive(void)
|
||||
void CommandManager::testActive()
|
||||
{
|
||||
for ( std::map<std::string, Command*>::iterator It= _sCommands.begin();It!=_sCommands.end();++It) {
|
||||
It->second->testActive();
|
||||
|
||||
+36
-36
@@ -213,15 +213,15 @@ class SelectionSingleton;
|
||||
class MDIView;
|
||||
|
||||
|
||||
void CreateStdCommands(void);
|
||||
void CreateDocCommands(void);
|
||||
void CreateFeatCommands(void);
|
||||
void CreateMacroCommands(void);
|
||||
void CreateViewStdCommands(void);
|
||||
void CreateWindowStdCommands(void);
|
||||
void CreateStructureCommands(void);
|
||||
void CreateTestCommands(void);
|
||||
void CreateLinkCommands(void);
|
||||
void CreateStdCommands();
|
||||
void CreateDocCommands();
|
||||
void CreateFeatCommands();
|
||||
void CreateMacroCommands();
|
||||
void CreateViewStdCommands();
|
||||
void CreateWindowStdCommands();
|
||||
void CreateStructureCommands();
|
||||
void CreateTestCommands();
|
||||
void CreateLinkCommands();
|
||||
|
||||
|
||||
/** The CommandBase class
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
//@{
|
||||
protected:
|
||||
/// Creates the used Action when adding to a widget. The default implementation does nothing.
|
||||
virtual Action * createAction(void);
|
||||
virtual Action * createAction();
|
||||
|
||||
public:
|
||||
/// Reassigns QAction stuff after the language has changed.
|
||||
@@ -323,7 +323,7 @@ protected:
|
||||
/// Methods which gets called when activated, needs to be reimplemented!
|
||||
virtual void activated(int iMsg)=0;
|
||||
/// Creates the used Action
|
||||
virtual Action * createAction(void);
|
||||
virtual Action * createAction();
|
||||
/// Applies the menu text, tool and status tip to the passed action object
|
||||
void applyCommandData(const char* context, Action* );
|
||||
const char* keySequenceToAccel(int) const;
|
||||
@@ -336,9 +336,9 @@ public:
|
||||
/// CommandManager is a friend
|
||||
friend class CommandManager;
|
||||
/// Override this method if your Cmd is not always active
|
||||
virtual bool isActive(void){return true;}
|
||||
virtual bool isActive(){return true;}
|
||||
/// Get somtile called to check the state of the command
|
||||
void testActive(void);
|
||||
void testActive();
|
||||
/// Enables or disables the command
|
||||
void setEnabled(bool);
|
||||
/// (Re)Create the text for the tooltip (for example, when the shortcut is changed)
|
||||
@@ -372,11 +372,11 @@ public:
|
||||
/** @name Helper methods to get important classes */
|
||||
//@{
|
||||
/// Get pointer to the Application Window
|
||||
static Application* getGuiApplication(void);
|
||||
static Application* getGuiApplication();
|
||||
/// Get a reference to the selection
|
||||
static Gui::SelectionSingleton& getSelection(void);
|
||||
static Gui::SelectionSingleton& getSelection();
|
||||
/// Get pointer to the active gui document
|
||||
Gui::Document* getActiveGuiDocument(void) const;
|
||||
Gui::Document* getActiveGuiDocument() const;
|
||||
/** Get pointer to the named or active App document
|
||||
* Returns a pointer to the named document or the active
|
||||
* document when no name is given. NULL is returned
|
||||
@@ -407,17 +407,17 @@ public:
|
||||
/// Open a new Undo transaction on the active document
|
||||
static void openCommand(const char* sName=nullptr);
|
||||
/// Commit the Undo transaction on the active document
|
||||
static void commitCommand(void);
|
||||
static void commitCommand();
|
||||
/// Abort the Undo transaction on the active document
|
||||
static void abortCommand(void);
|
||||
static void abortCommand();
|
||||
/// Check if an Undo transaction is open on the active document
|
||||
static bool hasPendingCommand(void);
|
||||
static bool hasPendingCommand();
|
||||
/// Updates the (active) document (propagate changes)
|
||||
static void updateActive(void);
|
||||
static void updateActive();
|
||||
/// Updates the (all or listed) documents (propagate changes)
|
||||
static void updateAll(std::list<Gui::Document*> cList);
|
||||
/// Checks if the active object of the active document is valid
|
||||
static bool isActiveObjectValid(void);
|
||||
static bool isActiveObjectValid();
|
||||
/// Translate command
|
||||
void languageChange();
|
||||
/// Updates the QAction with respect to the passed mode.
|
||||
@@ -539,17 +539,17 @@ public:
|
||||
/** @name Helper methods to generate help pages */
|
||||
//@{
|
||||
/// returns the begin of a online help page
|
||||
const char * beginCmdHelp(void);
|
||||
const char * beginCmdHelp();
|
||||
/// returns the end of a online help page
|
||||
const char * endCmdHelp(void);
|
||||
const char * endCmdHelp();
|
||||
/// Get the help URL
|
||||
virtual const char* getHelpUrl(void) const { return sHelpUrl; }
|
||||
virtual const char* getHelpUrl() const { return sHelpUrl; }
|
||||
//@}
|
||||
|
||||
/** @name Helper methods for the Active tests */
|
||||
//@{
|
||||
/// true when there is a document
|
||||
bool hasActiveDocument(void) const;
|
||||
bool hasActiveDocument() const;
|
||||
/// true when there is a document and a Feature with Name
|
||||
bool hasObject(const char* Name);
|
||||
//@}
|
||||
@@ -557,7 +557,7 @@ public:
|
||||
/** @name checking of internal state */
|
||||
//@{
|
||||
/// returns the name to which the command belongs
|
||||
const char* getAppModuleName(void) const {return sAppModule;}
|
||||
const char* getAppModuleName() const {return sAppModule;}
|
||||
void setAppModuleName(const char*);
|
||||
/// Get the command name
|
||||
const char* getName() const { return sName; }
|
||||
@@ -643,7 +643,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void activated(int iMsg);
|
||||
virtual Gui::Action * createAction(void);
|
||||
virtual Gui::Action * createAction();
|
||||
virtual void languageChange();
|
||||
|
||||
void setup(Action *);
|
||||
@@ -673,11 +673,11 @@ protected:
|
||||
/// Method which gets called when activated
|
||||
virtual void activated(int iMsg);
|
||||
/// if the command is not always active
|
||||
virtual bool isActive(void);
|
||||
virtual bool isActive();
|
||||
/// Get the help URL
|
||||
const char* getHelpUrl(void) const;
|
||||
const char* getHelpUrl() const;
|
||||
/// Creates the used Action
|
||||
virtual Action * createAction(void);
|
||||
virtual Action * createAction();
|
||||
//@}
|
||||
|
||||
public:
|
||||
@@ -724,11 +724,11 @@ protected:
|
||||
/// Method which gets called when activated
|
||||
virtual void activated(int iMsg);
|
||||
/// if the command is not always active
|
||||
virtual bool isActive(void);
|
||||
virtual bool isActive();
|
||||
/// Get the help URL
|
||||
const char* getHelpUrl(void) const;
|
||||
const char* getHelpUrl() const;
|
||||
/// Creates the used Action
|
||||
virtual Action * createAction(void);
|
||||
virtual Action * createAction();
|
||||
//@}
|
||||
|
||||
public:
|
||||
@@ -779,7 +779,7 @@ protected:
|
||||
/// Method which get called when activated
|
||||
void activated(int iMsg);
|
||||
/// Creates the used Action
|
||||
Action * createAction(void);
|
||||
Action * createAction();
|
||||
//@}
|
||||
|
||||
public:
|
||||
@@ -845,7 +845,7 @@ public:
|
||||
* of a special app module use GetModuleCommands()
|
||||
* @see Command
|
||||
*/
|
||||
std::vector <Command*> getAllCommands(void) const;
|
||||
std::vector <Command*> getAllCommands() const;
|
||||
|
||||
/** Returns all commands of a group
|
||||
* delivers a vector of all commands in the given group.
|
||||
@@ -866,7 +866,7 @@ public:
|
||||
/// method is OBSOLETE use GetModuleCommands() or GetAllCommands()
|
||||
const std::map<std::string, Command*>& getCommands() const { return _sCommands; }
|
||||
/// get frequently called by the AppWnd to check the commands are active.
|
||||
void testActive(void);
|
||||
void testActive();
|
||||
|
||||
void addCommandMode(const char* sContext, const char* sName);
|
||||
void updateCommands(const char* sContext, int mode);
|
||||
|
||||
+32
-32
@@ -242,7 +242,7 @@ void StdCmdImport::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdImport::isActive(void)
|
||||
bool StdCmdImport::isActive()
|
||||
{
|
||||
return (getActiveGuiDocument() ? true : false);
|
||||
}
|
||||
@@ -490,7 +490,7 @@ void StdCmdExport::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdExport::isActive(void)
|
||||
bool StdCmdExport::isActive()
|
||||
{
|
||||
return (getActiveGuiDocument() ? true : false);
|
||||
}
|
||||
@@ -543,7 +543,7 @@ void StdCmdMergeProjects::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdMergeProjects::isActive(void)
|
||||
bool StdCmdMergeProjects::isActive()
|
||||
{
|
||||
return this->hasActiveDocument();
|
||||
}
|
||||
@@ -576,7 +576,7 @@ void StdCmdDependencyGraph::activated(int iMsg)
|
||||
getMainWindow()->addWindow(view);
|
||||
}
|
||||
|
||||
bool StdCmdDependencyGraph::isActive(void)
|
||||
bool StdCmdDependencyGraph::isActive()
|
||||
{
|
||||
return (getActiveGuiDocument() ? true : false);
|
||||
}
|
||||
@@ -643,7 +643,7 @@ void StdCmdSave::activated(int iMsg)
|
||||
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"Save\")");
|
||||
}
|
||||
|
||||
bool StdCmdSave::isActive(void)
|
||||
bool StdCmdSave::isActive()
|
||||
{
|
||||
#if 0
|
||||
if( getActiveGuiDocument() )
|
||||
@@ -683,7 +683,7 @@ void StdCmdSaveAs::activated(int iMsg)
|
||||
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"SaveAs\")");
|
||||
}
|
||||
|
||||
bool StdCmdSaveAs::isActive(void)
|
||||
bool StdCmdSaveAs::isActive()
|
||||
{
|
||||
#if 0
|
||||
if( getActiveGuiDocument() )
|
||||
@@ -721,7 +721,7 @@ void StdCmdSaveCopy::activated(int iMsg)
|
||||
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"SaveCopy\")");
|
||||
}
|
||||
|
||||
bool StdCmdSaveCopy::isActive(void)
|
||||
bool StdCmdSaveCopy::isActive()
|
||||
{
|
||||
return ( getActiveGuiDocument() ? true : false );
|
||||
}
|
||||
@@ -748,7 +748,7 @@ void StdCmdSaveAll::activated(int iMsg)
|
||||
Gui::Document::saveAll();
|
||||
}
|
||||
|
||||
bool StdCmdSaveAll::isActive(void)
|
||||
bool StdCmdSaveAll::isActive()
|
||||
{
|
||||
return ( getActiveGuiDocument() ? true : false );
|
||||
}
|
||||
@@ -786,7 +786,7 @@ void StdCmdRevert::activated(int iMsg)
|
||||
doCommand(Command::App,"App.ActiveDocument.restore()");
|
||||
}
|
||||
|
||||
bool StdCmdRevert::isActive(void)
|
||||
bool StdCmdRevert::isActive()
|
||||
{
|
||||
return ( getActiveGuiDocument() ? true : false );
|
||||
}
|
||||
@@ -816,7 +816,7 @@ void StdCmdProjectInfo::activated(int iMsg)
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
bool StdCmdProjectInfo::isActive(void)
|
||||
bool StdCmdProjectInfo::isActive()
|
||||
{
|
||||
return ( getActiveGuiDocument() ? true : false );
|
||||
}
|
||||
@@ -846,7 +846,7 @@ void StdCmdProjectUtil::activated(int iMsg)
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
bool StdCmdProjectUtil::isActive(void)
|
||||
bool StdCmdProjectUtil::isActive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -878,7 +878,7 @@ void StdCmdPrint::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdPrint::isActive(void)
|
||||
bool StdCmdPrint::isActive()
|
||||
{
|
||||
return getGuiApplication()->sendHasMsgToActiveView("Print");
|
||||
}
|
||||
@@ -908,7 +908,7 @@ void StdCmdPrintPreview::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdPrintPreview::isActive(void)
|
||||
bool StdCmdPrintPreview::isActive()
|
||||
{
|
||||
return getGuiApplication()->sendHasMsgToActiveView("PrintPreview");
|
||||
}
|
||||
@@ -939,7 +939,7 @@ void StdCmdPrintPdf::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdPrintPdf::isActive(void)
|
||||
bool StdCmdPrintPdf::isActive()
|
||||
{
|
||||
return getGuiApplication()->sendHasMsgToActiveView("PrintPdf");
|
||||
}
|
||||
@@ -996,12 +996,12 @@ void StdCmdUndo::activated(int iMsg)
|
||||
getGuiApplication()->sendMsgToActiveView("Undo");
|
||||
}
|
||||
|
||||
bool StdCmdUndo::isActive(void)
|
||||
bool StdCmdUndo::isActive()
|
||||
{
|
||||
return getGuiApplication()->sendHasMsgToActiveView("Undo");
|
||||
}
|
||||
|
||||
Action * StdCmdUndo::createAction(void)
|
||||
Action * StdCmdUndo::createAction()
|
||||
{
|
||||
Action *pcAction;
|
||||
|
||||
@@ -1040,12 +1040,12 @@ void StdCmdRedo::activated(int iMsg)
|
||||
getGuiApplication()->sendMsgToActiveView("Redo");
|
||||
}
|
||||
|
||||
bool StdCmdRedo::isActive(void)
|
||||
bool StdCmdRedo::isActive()
|
||||
{
|
||||
return getGuiApplication()->sendHasMsgToActiveView("Redo");
|
||||
}
|
||||
|
||||
Action * StdCmdRedo::createAction(void)
|
||||
Action * StdCmdRedo::createAction()
|
||||
{
|
||||
Action *pcAction;
|
||||
|
||||
@@ -1081,7 +1081,7 @@ void StdCmdCut::activated(int iMsg)
|
||||
getGuiApplication()->sendMsgToActiveView("Cut");
|
||||
}
|
||||
|
||||
bool StdCmdCut::isActive(void)
|
||||
bool StdCmdCut::isActive()
|
||||
{
|
||||
return getGuiApplication()->sendHasMsgToActiveView("Cut");
|
||||
}
|
||||
@@ -1114,7 +1114,7 @@ void StdCmdCopy::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdCopy::isActive(void)
|
||||
bool StdCmdCopy::isActive()
|
||||
{
|
||||
if (getGuiApplication()->sendHasMsgToFocusView("Copy"))
|
||||
return true;
|
||||
@@ -1152,7 +1152,7 @@ void StdCmdPaste::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdPaste::isActive(void)
|
||||
bool StdCmdPaste::isActive()
|
||||
{
|
||||
if (getGuiApplication()->sendHasMsgToFocusView("Paste"))
|
||||
return true;
|
||||
@@ -1243,7 +1243,7 @@ void StdCmdDuplicateSelection::activated(int iMsg)
|
||||
fi.deleteFile();
|
||||
}
|
||||
|
||||
bool StdCmdDuplicateSelection::isActive(void)
|
||||
bool StdCmdDuplicateSelection::isActive()
|
||||
{
|
||||
return Gui::Selection().hasSelection();
|
||||
}
|
||||
@@ -1275,7 +1275,7 @@ void StdCmdSelectAll::activated(int iMsg)
|
||||
rSel.setSelection(doc->getName(), objs);
|
||||
}
|
||||
|
||||
bool StdCmdSelectAll::isActive(void)
|
||||
bool StdCmdSelectAll::isActive()
|
||||
{
|
||||
return App::GetApplication().getActiveDocument() != nullptr;
|
||||
}
|
||||
@@ -1448,7 +1448,7 @@ void StdCmdDelete::activated(int iMsg)
|
||||
Gui::getMainWindow()->update();
|
||||
}
|
||||
|
||||
bool StdCmdDelete::isActive(void)
|
||||
bool StdCmdDelete::isActive()
|
||||
{
|
||||
return Selection().getCompleteSelection().size() > 0;
|
||||
}
|
||||
@@ -1502,7 +1502,7 @@ void StdCmdRefresh::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdRefresh::isActive(void)
|
||||
bool StdCmdRefresh::isActive()
|
||||
{
|
||||
return this->getDocument() && this->getDocument()->mustExecute();
|
||||
}
|
||||
@@ -1528,7 +1528,7 @@ void StdCmdTransform::activated(int iMsg)
|
||||
Gui::Control().showDialog(new Gui::Dialog::TaskTransform());
|
||||
}
|
||||
|
||||
bool StdCmdTransform::isActive(void)
|
||||
bool StdCmdTransform::isActive()
|
||||
{
|
||||
return (Gui::Control().activeDialog()==nullptr);
|
||||
}
|
||||
@@ -1562,7 +1562,7 @@ void StdCmdPlacement::activated(int iMsg)
|
||||
Gui::Control().showDialog(plm);
|
||||
}
|
||||
|
||||
bool StdCmdPlacement::isActive(void)
|
||||
bool StdCmdPlacement::isActive()
|
||||
{
|
||||
return Gui::Selection().countObjectsOfType(App::GeoFeature::getClassTypeId()) >= 1;
|
||||
}
|
||||
@@ -1596,7 +1596,7 @@ void StdCmdTransformManip::activated(int iMsg)
|
||||
getActiveGuiDocument()->setEdit(vp, Gui::ViewProvider::Transform);
|
||||
}
|
||||
|
||||
bool StdCmdTransformManip::isActive(void)
|
||||
bool StdCmdTransformManip::isActive()
|
||||
{
|
||||
return Gui::Selection().countObjectsOfType(App::GeoFeature::getClassTypeId()) == 1;
|
||||
}
|
||||
@@ -1664,7 +1664,7 @@ void StdCmdAlignment::activated(int iMsg)
|
||||
Gui::Selection().clearSelection();
|
||||
}
|
||||
|
||||
bool StdCmdAlignment::isActive(void)
|
||||
bool StdCmdAlignment::isActive()
|
||||
{
|
||||
if (ManualAlignment::hasInstance())
|
||||
return false;
|
||||
@@ -1706,7 +1706,7 @@ void StdCmdEdit::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdEdit::isActive(void)
|
||||
bool StdCmdEdit::isActive()
|
||||
{
|
||||
return (Selection().getCompleteSelection().size() > 0) || (Gui::Control().activeDialog() != nullptr);
|
||||
}
|
||||
@@ -1763,7 +1763,7 @@ protected:
|
||||
copyExpressions(objs);
|
||||
}
|
||||
|
||||
virtual Gui::Action * createAction(void) {
|
||||
virtual Gui::Action * createAction() {
|
||||
ActionGroup* pcAction = new ActionGroup(this, getMainWindow());
|
||||
pcAction->setDropDownMenu(true);
|
||||
applyCommandData(this->className(), pcAction);
|
||||
@@ -1932,7 +1932,7 @@ protected:
|
||||
|
||||
namespace Gui {
|
||||
|
||||
void CreateDocCommands(void)
|
||||
void CreateDocCommands()
|
||||
{
|
||||
CommandManager &rcCmdMgr = Application::Instance->commandManager();
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ void StdCmdRandomColor::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdRandomColor::isActive(void)
|
||||
bool StdCmdRandomColor::isActive()
|
||||
{
|
||||
return (Gui::Selection().size() != 0);
|
||||
}
|
||||
@@ -135,7 +135,7 @@ StdCmdSendToPythonConsole::StdCmdSendToPythonConsole()
|
||||
sAccel = "Ctrl+Shift+P";
|
||||
}
|
||||
|
||||
bool StdCmdSendToPythonConsole::isActive(void)
|
||||
bool StdCmdSendToPythonConsole::isActive()
|
||||
{
|
||||
//active only if either 1 object is selected or multiple subobjects from the same object
|
||||
return Gui::Selection().getSelectionEx().size() == 1;
|
||||
@@ -211,7 +211,7 @@ void StdCmdSendToPythonConsole::activated(int iMsg)
|
||||
|
||||
namespace Gui {
|
||||
|
||||
void CreateFeatCommands(void)
|
||||
void CreateFeatCommands()
|
||||
{
|
||||
CommandManager &rcCmdMgr = Application::Instance->commandManager();
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void activated(int iMsg);
|
||||
virtual bool isActive(void);
|
||||
virtual Action * createAction(void);
|
||||
virtual bool isActive();
|
||||
virtual Action * createAction();
|
||||
virtual void languageChange();
|
||||
};
|
||||
|
||||
@@ -86,7 +86,7 @@ bool StdCmdLinkMakeGroup::isActive() {
|
||||
return !!App::GetApplication().getActiveDocument();
|
||||
}
|
||||
|
||||
Action * StdCmdLinkMakeGroup::createAction(void)
|
||||
Action * StdCmdLinkMakeGroup::createAction()
|
||||
{
|
||||
ActionGroup* pcAction = new ActionGroup(this, getMainWindow());
|
||||
pcAction->setDropDownMenu(true);
|
||||
@@ -870,7 +870,7 @@ public:
|
||||
sGroup = "View";
|
||||
sMenuText = QT_TR_NOOP("Link actions");
|
||||
sToolTipText = QT_TR_NOOP("Link actions");
|
||||
sWhatsThis = "Std_LinkActions";
|
||||
sWhatsThis = "Std_LinkMakeRelative";
|
||||
sStatusTip = QT_TR_NOOP("Link actions");
|
||||
eType = AlterDoc;
|
||||
bCanLog = false;
|
||||
@@ -892,7 +892,7 @@ public:
|
||||
|
||||
namespace Gui {
|
||||
|
||||
void CreateLinkCommands(void)
|
||||
void CreateLinkCommands()
|
||||
{
|
||||
CommandManager &rcCmdMgr = Application::Instance->commandManager();
|
||||
rcCmdMgr.addCommand(new StdCmdLinkMake());
|
||||
|
||||
+11
-11
@@ -58,7 +58,7 @@ void StdCmdDlgMacroRecord::activated(int iMsg)
|
||||
cDlg.exec();
|
||||
}
|
||||
|
||||
bool StdCmdDlgMacroRecord::isActive(void)
|
||||
bool StdCmdDlgMacroRecord::isActive()
|
||||
{
|
||||
return ! (getGuiApplication()->macroManager()->isOpen());
|
||||
}
|
||||
@@ -86,7 +86,7 @@ void StdCmdMacroStopRecord::activated(int iMsg)
|
||||
getGuiApplication()->macroManager()->commit();
|
||||
}
|
||||
|
||||
bool StdCmdMacroStopRecord::isActive(void)
|
||||
bool StdCmdMacroStopRecord::isActive()
|
||||
{
|
||||
return getGuiApplication()->macroManager()->isOpen();
|
||||
}
|
||||
@@ -115,7 +115,7 @@ void StdCmdDlgMacroExecute::activated(int iMsg)
|
||||
cDlg.exec();
|
||||
}
|
||||
|
||||
bool StdCmdDlgMacroExecute::isActive(void)
|
||||
bool StdCmdDlgMacroExecute::isActive()
|
||||
{
|
||||
return ! (getGuiApplication()->macroManager()->isOpen());
|
||||
}
|
||||
@@ -144,7 +144,7 @@ void StdCmdDlgMacroExecuteDirect::activated(int iMsg)
|
||||
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"Run\")");
|
||||
}
|
||||
|
||||
bool StdCmdDlgMacroExecuteDirect::isActive(void)
|
||||
bool StdCmdDlgMacroExecuteDirect::isActive()
|
||||
{
|
||||
return getGuiApplication()->sendHasMsgToActiveView("Run");
|
||||
}
|
||||
@@ -169,7 +169,7 @@ void StdCmdMacroAttachDebugger::activated(int iMsg)
|
||||
"RemoteDebugger.attachToRemoteDebugger()");
|
||||
}
|
||||
|
||||
bool StdCmdMacroAttachDebugger::isActive(void)
|
||||
bool StdCmdMacroAttachDebugger::isActive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -199,7 +199,7 @@ void StdCmdMacroStartDebug::activated(int iMsg)
|
||||
dbg->stepRun();
|
||||
}
|
||||
|
||||
bool StdCmdMacroStartDebug::isActive(void)
|
||||
bool StdCmdMacroStartDebug::isActive()
|
||||
{
|
||||
return getGuiApplication()->sendHasMsgToActiveView("StartDebug");
|
||||
}
|
||||
@@ -225,7 +225,7 @@ void StdCmdMacroStopDebug::activated(int iMsg)
|
||||
Application::Instance->macroManager()->debugger()->tryStop();
|
||||
}
|
||||
|
||||
bool StdCmdMacroStopDebug::isActive(void)
|
||||
bool StdCmdMacroStopDebug::isActive()
|
||||
{
|
||||
static PythonDebugger* dbg = Application::Instance->macroManager()->debugger();
|
||||
return dbg->isRunning();
|
||||
@@ -252,7 +252,7 @@ void StdCmdMacroStepOver::activated(int iMsg)
|
||||
Application::Instance->macroManager()->debugger()->stepOver();
|
||||
}
|
||||
|
||||
bool StdCmdMacroStepOver::isActive(void)
|
||||
bool StdCmdMacroStepOver::isActive()
|
||||
{
|
||||
static PythonDebugger* dbg = Application::Instance->macroManager()->debugger();
|
||||
return dbg->isRunning();
|
||||
@@ -279,7 +279,7 @@ void StdCmdMacroStepInto::activated(int iMsg)
|
||||
Application::Instance->macroManager()->debugger()->stepInto();
|
||||
}
|
||||
|
||||
bool StdCmdMacroStepInto::isActive(void)
|
||||
bool StdCmdMacroStepInto::isActive()
|
||||
{
|
||||
static PythonDebugger* dbg = Application::Instance->macroManager()->debugger();
|
||||
return dbg->isRunning();
|
||||
@@ -306,14 +306,14 @@ void StdCmdToggleBreakpoint::activated(int iMsg)
|
||||
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"ToggleBreakpoint\")");
|
||||
}
|
||||
|
||||
bool StdCmdToggleBreakpoint::isActive(void)
|
||||
bool StdCmdToggleBreakpoint::isActive()
|
||||
{
|
||||
return getGuiApplication()->sendHasMsgToActiveView("ToggleBreakpoint");
|
||||
}
|
||||
|
||||
namespace Gui {
|
||||
|
||||
void CreateMacroCommands(void)
|
||||
void CreateMacroCommands()
|
||||
{
|
||||
CommandManager &rcCmdMgr = Application::Instance->commandManager();
|
||||
rcCmdMgr.addCommand(new StdCmdDlgMacroRecord());
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
|
||||
// returns a string which represents the object e.g. when printed in python
|
||||
std::string CommandPy::representation(void) const
|
||||
std::string CommandPy::representation() const
|
||||
{
|
||||
return std::string("<Command object>");
|
||||
}
|
||||
|
||||
+12
-12
@@ -102,12 +102,12 @@ void StdCmdWorkbench::activated(int i)
|
||||
}
|
||||
}
|
||||
|
||||
bool StdCmdWorkbench::isActive(void)
|
||||
bool StdCmdWorkbench::isActive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Action * StdCmdWorkbench::createAction(void)
|
||||
Action * StdCmdWorkbench::createAction()
|
||||
{
|
||||
Action *pcAction;
|
||||
|
||||
@@ -152,7 +152,7 @@ void StdCmdRecentFiles::activated(int iMsg)
|
||||
/**
|
||||
* Creates the QAction object containing the recent files.
|
||||
*/
|
||||
Action * StdCmdRecentFiles::createAction(void)
|
||||
Action * StdCmdRecentFiles::createAction()
|
||||
{
|
||||
RecentFilesAction* pcAction = new RecentFilesAction(this, getMainWindow());
|
||||
pcAction->setObjectName(QLatin1String("recentFiles"));
|
||||
@@ -192,7 +192,7 @@ void StdCmdRecentMacros::activated(int iMsg)
|
||||
/**
|
||||
* Creates the QAction object containing the recent macros.
|
||||
*/
|
||||
Action * StdCmdRecentMacros::createAction(void)
|
||||
Action * StdCmdRecentMacros::createAction()
|
||||
{
|
||||
RecentMacrosAction* pcAction = new RecentMacrosAction(this, getMainWindow());
|
||||
pcAction->setObjectName(QLatin1String("recentMacros"));
|
||||
@@ -218,7 +218,7 @@ StdCmdAbout::StdCmdAbout()
|
||||
eType = 0;
|
||||
}
|
||||
|
||||
Action * StdCmdAbout::createAction(void)
|
||||
Action * StdCmdAbout::createAction()
|
||||
{
|
||||
Action *pcAction;
|
||||
|
||||
@@ -356,7 +356,7 @@ StdCmdDlgPreferences::StdCmdDlgPreferences()
|
||||
eType = 0;
|
||||
}
|
||||
|
||||
Action * StdCmdDlgPreferences::createAction(void)
|
||||
Action * StdCmdDlgPreferences::createAction()
|
||||
{
|
||||
Action *pcAction = Command::createAction();
|
||||
pcAction->setMenuRole(QAction::PreferencesRole);
|
||||
@@ -803,7 +803,7 @@ void StdCmdTextDocument::activated(int iMsg)
|
||||
commitCommand();
|
||||
}
|
||||
|
||||
bool StdCmdTextDocument::isActive(void)
|
||||
bool StdCmdTextDocument::isActive()
|
||||
{
|
||||
return hasActiveDocument();
|
||||
}
|
||||
@@ -845,8 +845,8 @@ public:
|
||||
void updateIcon(int mode);
|
||||
protected:
|
||||
virtual void activated(int iMsg);
|
||||
virtual bool isActive(void);
|
||||
virtual Gui::Action * createAction(void);
|
||||
virtual bool isActive();
|
||||
virtual Gui::Action * createAction();
|
||||
};
|
||||
|
||||
StdCmdUserEditMode::StdCmdUserEditMode()
|
||||
@@ -863,7 +863,7 @@ StdCmdUserEditMode::StdCmdUserEditMode()
|
||||
this->getGuiApplication()->signalUserEditModeChanged.connect(boost::bind(&StdCmdUserEditMode::updateIcon, this, bp::_1));
|
||||
}
|
||||
|
||||
Gui::Action * StdCmdUserEditMode::createAction(void)
|
||||
Gui::Action * StdCmdUserEditMode::createAction()
|
||||
{
|
||||
Gui::ActionGroup* pcAction = new Gui::ActionGroup(this, Gui::getMainWindow());
|
||||
pcAction->setDropDownMenu(true);
|
||||
@@ -928,14 +928,14 @@ void StdCmdUserEditMode::activated(int iMsg)
|
||||
Gui::Application::Instance->setUserEditMode(iMsg);
|
||||
}
|
||||
|
||||
bool StdCmdUserEditMode::isActive(void)
|
||||
bool StdCmdUserEditMode::isActive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace Gui {
|
||||
|
||||
void CreateStdCommands(void)
|
||||
void CreateStdCommands()
|
||||
{
|
||||
CommandManager &rcCmdMgr = Application::Instance->commandManager();
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user