Compare commits
792
Commits
popt
...
compiler-flags
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48694feeea | ||
|
|
c94f7271e9 | ||
|
|
769bb9d26e | ||
|
|
d77c2a949a | ||
|
|
47aecc2fd5 | ||
|
|
2e68308d0b | ||
|
|
a879990b07 | ||
|
|
ea8021afff | ||
|
|
928893513b | ||
|
|
3e7aa5954a | ||
|
|
ccc1b0a7d3 | ||
|
|
9602bc0c3a | ||
|
|
e095365798 | ||
|
|
6956d15aec | ||
|
|
f61eeff59e | ||
|
|
5ed8ca6959 | ||
|
|
676481b0f3 | ||
|
|
2aa7b85b2c | ||
|
|
69bbf87081 | ||
|
|
0ea2854bcc | ||
|
|
02a795832a | ||
|
|
b2db1f2d06 | ||
|
|
992d062c1d | ||
|
|
970e454362 | ||
|
|
b06f36eb8c | ||
|
|
1faf2006b4 | ||
|
|
3999622b5a | ||
|
|
46a5fb749e | ||
|
|
07d6128ac5 | ||
|
|
ff2071bc99 | ||
|
|
31fd883981 | ||
|
|
974d760bb5 | ||
|
|
c92a8bcdad | ||
|
|
c3a71f92ac | ||
|
|
78e9853c58 | ||
|
|
67632f360c | ||
|
|
4215718381 | ||
|
|
ee3e2368cf | ||
|
|
29614dfbdb | ||
|
|
e59d2138b6 | ||
|
|
6c6638b6f4 | ||
|
|
8c8df35246 | ||
|
|
db92006232 | ||
|
|
b651b5ed4d | ||
|
|
575e5558c3 | ||
|
|
1f2bfb92d1 | ||
|
|
8b13102705 | ||
|
|
3060104931 | ||
|
|
664f828f07 | ||
|
|
27c5a9a6fc | ||
|
|
a12fe07dcd | ||
|
|
748d4a3cfb | ||
|
|
4363ac7195 | ||
|
|
ab113382eb | ||
|
|
5ddfac5364 | ||
|
|
3167412e05 | ||
|
|
2ccfc1fda5 | ||
|
|
2a456993a9 | ||
|
|
e93c30f2c6 | ||
|
|
3f7b40333f | ||
|
|
ad215827fa | ||
|
|
285b768193 | ||
|
|
0bbbed4192 | ||
|
|
c5c0f65807 | ||
|
|
0acc4b5471 | ||
|
|
675e12ca52 | ||
|
|
9343c21e62 | ||
|
|
241a5adec5 | ||
|
|
b18e94a0f4 | ||
|
|
e0823e20b2 | ||
|
|
280a44de08 | ||
|
|
96a3e52776 | ||
|
|
6a65c85055 | ||
|
|
5a2034dbe0 | ||
|
|
12206c9386 | ||
|
|
2303e9b3a9 | ||
|
|
c0b261f4dc | ||
|
|
b6d6d43d94 | ||
|
|
eecbd88597 | ||
|
|
51e1a14a55 | ||
|
|
6c49e8113b | ||
|
|
093b3d9b95 | ||
|
|
4f141a04e3 | ||
|
|
3c63fe48cb | ||
|
|
0b9050dfaf | ||
|
|
7265b374c9 | ||
|
|
b858d5254a | ||
|
|
58f9f9af1e | ||
|
|
962a3a1f9c | ||
|
|
51ff350077 | ||
|
|
98a3ed59c7 | ||
|
|
25c7f1ec16 | ||
|
|
3976647e7b | ||
|
|
62f71ccb47 | ||
|
|
a2ba7debb1 | ||
|
|
3477a81b69 | ||
|
|
1bed17509c | ||
|
|
f7e1835428 | ||
|
|
9c8f29b596 | ||
|
|
53f7e00947 | ||
|
|
993cc35165 | ||
|
|
05c435d08a | ||
|
|
0c905b9667 | ||
|
|
fea810bc3d | ||
|
|
09d3c1a994 | ||
|
|
0381d135e6 | ||
|
|
e1a02e7fa2 | ||
|
|
f3431d6fd8 | ||
|
|
357e639366 | ||
|
|
4eca7b16a2 | ||
|
|
16801d730d | ||
|
|
4ac5993bc1 | ||
|
|
9fa2e5358d | ||
|
|
d4c591e305 | ||
|
|
185387dc42 | ||
|
|
d8240e01f1 | ||
|
|
7a76b072ef | ||
|
|
a2e9e60fad | ||
|
|
b7b0518057 | ||
|
|
ccbf6db2a8 | ||
|
|
a7a608ebd6 | ||
|
|
481df7a4d7 | ||
|
|
7fc400ece7 | ||
|
|
23c30ec224 | ||
|
|
d340161c77 | ||
|
|
4a4227d3d1 | ||
|
|
26ae7ee1fb | ||
|
|
4990ba8af2 | ||
|
|
4ba0467a2a | ||
|
|
a526a518ec | ||
|
|
8ad26519b5 | ||
|
|
4f2cb1df84 | ||
|
|
ef28b2f44c | ||
|
|
6dce1771da | ||
|
|
7fb358e1be | ||
|
|
80044bda13 | ||
|
|
c89de8ef58 | ||
|
|
39bc300543 | ||
|
|
cb4739ab6b | ||
|
|
128b248427 | ||
|
|
16e410a900 | ||
|
|
8bc24b0c61 | ||
|
|
fef61e0b38 | ||
|
|
74fa8e5211 | ||
|
|
956f75e622 | ||
|
|
981fea0212 | ||
|
|
4aaa3e93ce | ||
|
|
3809e8e542 | ||
|
|
ecaab9b978 | ||
|
|
9222636ad5 | ||
|
|
ef938a8d96 | ||
|
|
a10e1c5077 | ||
|
|
a4b74cb19c | ||
|
|
42752095d9 | ||
|
|
2e0039565d | ||
|
|
8004644939 | ||
|
|
e794a18785 | ||
|
|
5d779ed9bf | ||
|
|
58292b96f6 | ||
|
|
201f4dabb7 | ||
|
|
95074343ff | ||
|
|
0eb6152248 | ||
|
|
ed24088af8 | ||
|
|
589fb9ce88 | ||
|
|
ff628cc8ee | ||
|
|
a5192b3e9d | ||
|
|
76cb7c8cba | ||
|
|
2b5fd863b8 | ||
|
|
14b851b76e | ||
|
|
0775911cb8 | ||
|
|
b6b91c7ff3 | ||
|
|
85205ad99d | ||
|
|
27feff8be6 | ||
|
|
59744d6476 | ||
|
|
a28d9b81d1 | ||
|
|
92af231796 | ||
|
|
bc41a3abdd | ||
|
|
ab790b3226 | ||
|
|
66f55ae90a | ||
|
|
df7190e81d | ||
|
|
8d61e29f8a | ||
|
|
4fed1d5d7f | ||
|
|
121379e253 | ||
|
|
f42809f5d4 | ||
|
|
3e0620afdb | ||
|
|
b46f30b451 | ||
|
|
6285102b01 | ||
|
|
0a3aae8287 | ||
|
|
8ed10b1255 | ||
|
|
d84b5b6b7c | ||
|
|
03663ae2b7 | ||
|
|
613151cf07 | ||
|
|
08f464a836 | ||
|
|
e166c7a48f | ||
|
|
54eb90d659 | ||
|
|
c382f611c8 | ||
|
|
355dc868ab | ||
|
|
5c38e97ee2 | ||
|
|
850a30dd11 | ||
|
|
5245666791 | ||
|
|
4ce1a19c44 | ||
|
|
d47cf7e774 | ||
|
|
7028f84a68 | ||
|
|
beeaf1b4fc | ||
|
|
a6d65b4192 | ||
|
|
4e25d7d2d6 | ||
|
|
4546678889 | ||
|
|
13c7600264 | ||
|
|
593f784285 | ||
|
|
783c668571 | ||
|
|
cac8c2ac76 | ||
|
|
9540f6baf8 | ||
|
|
89c9dbbda7 | ||
|
|
c99aa6f07c | ||
|
|
38e4a0bad8 | ||
|
|
e9024e0400 | ||
|
|
cbf3f3899c | ||
|
|
4b3bcb3c3e | ||
|
|
05103c66ce | ||
|
|
d6f02edeab | ||
|
|
4c2680940b | ||
|
|
e73154ad0d | ||
|
|
38362ae25c | ||
|
|
155ebe15e9 | ||
|
|
bb529cb538 | ||
|
|
64d96caa46 | ||
|
|
bafc2262c8 | ||
|
|
b2dc6c7f20 | ||
|
|
60d6190789 | ||
|
|
7b65d28b90 | ||
|
|
83fac85a2d | ||
|
|
5b89202bf7 | ||
|
|
538e91404a | ||
|
|
32644e2b6f | ||
|
|
1edc204fc7 | ||
|
|
3a5e597c44 | ||
|
|
771d130ca0 | ||
|
|
6c531c77ad | ||
|
|
cd395ed672 | ||
|
|
2b6580b90c | ||
|
|
525fb0c9cd | ||
|
|
8c9368a2f7 | ||
|
|
4ecf34c9f9 | ||
|
|
44dddc8b46 | ||
|
|
d84e0f1629 | ||
|
|
9de23cb952 | ||
|
|
a72127a937 | ||
|
|
fc3579bb88 | ||
|
|
a5c59f2128 | ||
|
|
9355b08feb | ||
|
|
21f8a7fc2e | ||
|
|
6a2e7e8b0f | ||
|
|
239c34b19f | ||
|
|
8c26685602 | ||
|
|
e99e24b90b | ||
|
|
142d5c8b87 | ||
|
|
a5505ff4ef | ||
|
|
4a118ad23d | ||
|
|
4a18d634ab | ||
|
|
e2902e9d23 | ||
|
|
ea062d0d1c | ||
|
|
6543cd12bf | ||
|
|
d4a46eecd4 | ||
|
|
f46bd5e3f7 | ||
|
|
a2d53a9aa5 | ||
|
|
9af850745e | ||
|
|
9bf3242d74 | ||
|
|
224b180058 | ||
|
|
e5fdc358c6 | ||
|
|
8a0c758e70 | ||
|
|
df78ebdd4d | ||
|
|
578c64a14b | ||
|
|
4c7ffc817b | ||
|
|
8da4307ae7 | ||
|
|
c33839bd61 | ||
|
|
6d7afb66e9 | ||
|
|
22c1193541 | ||
|
|
0bca857d7e | ||
|
|
5f47728332 | ||
|
|
dcd52c441f | ||
|
|
fa9f1fe8d6 | ||
|
|
ea2874aa00 | ||
|
|
30c70888b9 | ||
|
|
f6ac4eed5b | ||
|
|
25a6a06a4c | ||
|
|
45b937ef31 | ||
|
|
62cf2caa78 | ||
|
|
b9d3e7a1d3 | ||
|
|
0c561d734e | ||
|
|
cd70254540 | ||
|
|
5823300947 | ||
|
|
95223352b3 | ||
|
|
36fc2bfb40 | ||
|
|
bf9b805f93 | ||
|
|
1885e569b3 | ||
|
|
b8bec9ed11 | ||
|
|
52d9b83f36 | ||
|
|
09b6af1e31 | ||
|
|
de5ab4d9ec | ||
|
|
b3f4faf520 | ||
|
|
4e4df33d17 | ||
|
|
d1b0e65fb0 | ||
|
|
ab63b9e8b4 | ||
|
|
373b18f444 | ||
|
|
cb14f2ec01 | ||
|
|
c30252f273 | ||
|
|
af57049319 | ||
|
|
3c63da864f | ||
|
|
793c0b8ed0 | ||
|
|
cdb6c6214e | ||
|
|
41837ccb68 | ||
|
|
deeb5be723 | ||
|
|
e6f8f24ec5 | ||
|
|
495b751f28 | ||
|
|
ca2905a341 | ||
|
|
1bfecc6436 | ||
|
|
b69500569e | ||
|
|
48c69aebbc | ||
|
|
b2813639c8 | ||
|
|
0009dccf94 | ||
|
|
8c97488d7a | ||
|
|
8df816f5b0 | ||
|
|
866097a82b | ||
|
|
1eeaffc56a | ||
|
|
5385584b4f | ||
|
|
a0f2155c35 | ||
|
|
8db08e8d69 | ||
|
|
48b633f1b9 | ||
|
|
97254eb5aa | ||
|
|
db3a246d83 | ||
|
|
de32d3ae88 | ||
|
|
16cdf98712 | ||
|
|
afd26e229d | ||
|
|
49e4f75df5 | ||
|
|
2960d8c1e7 | ||
|
|
d5c0af1936 | ||
|
|
b522885592 | ||
|
|
155adb0d5f | ||
|
|
6a2c13f80c | ||
|
|
0e5701a304 | ||
|
|
c1fbd682c2 | ||
|
|
7e2b9db6c4 | ||
|
|
7aebfca23e | ||
|
|
d6489232e7 | ||
|
|
6bf2b296ee | ||
|
|
341ba7a9ff | ||
|
|
64059f80d7 | ||
|
|
e6df5e74b2 | ||
|
|
0d5cf4ba01 | ||
|
|
8eabc71f7b | ||
|
|
e4609d8b54 | ||
|
|
ec785768b5 | ||
|
|
ac4c02ef17 | ||
|
|
0899715398 | ||
|
|
83f1e3ae6e | ||
|
|
4b57be7258 | ||
|
|
88b9580770 | ||
|
|
6a753f0614 | ||
|
|
400e16987f | ||
|
|
7935bd9442 | ||
|
|
ccb0e6641e | ||
|
|
b4168be2ef | ||
|
|
4b30b924ed | ||
|
|
b4515bb986 | ||
|
|
ec46a458c9 | ||
|
|
f3bfc3ac11 | ||
|
|
d8d774a32c | ||
|
|
5dadf142e4 | ||
|
|
2eef3c7847 | ||
|
|
0b72579ac8 | ||
|
|
7f9ab71f65 | ||
|
|
a136be598b | ||
|
|
7ee291832a | ||
|
|
f96ce3a215 | ||
|
|
ac88f7c25d | ||
|
|
b8684901d0 | ||
|
|
c2cfb160af | ||
|
|
5d8da19430 | ||
|
|
6fdaa311fa | ||
|
|
47012ea4da | ||
|
|
a3dd7a5633 | ||
|
|
904be596fe | ||
|
|
c6428eb615 | ||
|
|
72d183001e | ||
|
|
557850c9af | ||
|
|
f3042e3f43 | ||
|
|
7af24f8f79 | ||
|
|
7ee6c9d9ee | ||
|
|
2728af1d43 | ||
|
|
f693092140 | ||
|
|
46e0facac6 | ||
|
|
943f7d0486 | ||
|
|
19c8c02832 | ||
|
|
7d348f6622 | ||
|
|
ccd4f31afa | ||
|
|
ff82c1eb7a | ||
|
|
45dc58b2f1 | ||
|
|
6c8fb6d6c5 | ||
|
|
7dbdff3b8a | ||
|
|
7b24c4c3a4 | ||
|
|
6d8035e367 | ||
|
|
f06a021ba0 | ||
|
|
b145a0dbce | ||
|
|
a3b6989fde | ||
|
|
444927d9ba | ||
|
|
abb839c26a | ||
|
|
185e4ec5fb | ||
|
|
24d3681dc9 | ||
|
|
3fc5d232e8 | ||
|
|
2322e0bec8 | ||
|
|
9882b24fea | ||
|
|
4b3ef4460e | ||
|
|
b263d41a56 | ||
|
|
6a3947dbb9 | ||
|
|
1fc33edd85 | ||
|
|
96e5db1705 | ||
|
|
252c6e616e | ||
|
|
fd46b962b4 | ||
|
|
da7d28944f | ||
|
|
b43e40037c | ||
|
|
d4873b1e6d | ||
|
|
0bdf284e18 | ||
|
|
b7c2b092b6 | ||
|
|
d873a21a92 | ||
|
|
b24f795d86 | ||
|
|
6a135e890b | ||
|
|
25c1080989 | ||
|
|
b4b41038ab | ||
|
|
b13c52abc7 | ||
|
|
64143b8ba9 | ||
|
|
197e1aeb49 | ||
|
|
2c7f218329 | ||
|
|
8cd2161474 | ||
|
|
485aad383b | ||
|
|
02cf7228d0 | ||
|
|
89f6b55768 | ||
|
|
c34e282479 | ||
|
|
630a2ed796 | ||
|
|
0ce1a8e04e | ||
|
|
ae65bdaf4e | ||
|
|
425a9462b8 | ||
|
|
27dcca8bf3 | ||
|
|
88684fcab4 | ||
|
|
42d5033a80 | ||
|
|
a8f246dedb | ||
|
|
eadaacc254 | ||
|
|
ce417948f3 | ||
|
|
7f15ebc8b5 | ||
|
|
0ad9305081 | ||
|
|
be3f82f2d6 | ||
|
|
67a98c35dc | ||
|
|
2f0a5511f8 | ||
|
|
e1ab25ae00 | ||
|
|
db1bf12436 | ||
|
|
ec85f9e2e9 | ||
|
|
250a13c3b8 | ||
|
|
92581b2dd5 | ||
|
|
8049c182d2 | ||
|
|
4b1e6c5337 | ||
|
|
d45d2eba95 | ||
|
|
81b3b66fbe | ||
|
|
73ee65c804 | ||
|
|
93a4c112cf | ||
|
|
072478b02d | ||
|
|
f09a42a103 | ||
|
|
513e7a718a | ||
|
|
5945457c68 | ||
|
|
2bece33c46 | ||
|
|
b797aa6144 | ||
|
|
f8f2fc3b2b | ||
|
|
82ac2f5aef | ||
|
|
2ee4c769d3 | ||
|
|
c349614856 | ||
|
|
ac307ad029 | ||
|
|
75a8f10a1e | ||
|
|
d0256d9d4c | ||
|
|
ede265851a | ||
|
|
4de38674ba | ||
|
|
89a1021ea4 | ||
|
|
dc54ffb8b6 | ||
|
|
81f2a419e2 | ||
|
|
f627bed234 | ||
|
|
e350974ed9 | ||
|
|
bbf2a9ab7f | ||
|
|
8ccc1cfc10 | ||
|
|
8a11061cfa | ||
|
|
53b6854be1 | ||
|
|
2b24f7ea17 | ||
|
|
dc7a608d53 | ||
|
|
b845af7256 | ||
|
|
7544be9371 | ||
|
|
4406d5a341 | ||
|
|
91428ce24e | ||
|
|
056c86fadf | ||
|
|
a1842e1545 | ||
|
|
8cea6d9545 | ||
|
|
e60f48574b | ||
|
|
387f3741fc | ||
|
|
93b3f05c27 | ||
|
|
3366eda965 | ||
|
|
7ffef8cd2c | ||
|
|
9d220b0b7e | ||
|
|
674c4840bd | ||
|
|
fb317ffe7f | ||
|
|
e53c84660d | ||
|
|
4c2d0d24cb | ||
|
|
c13b96832b | ||
|
|
362a0444ac | ||
|
|
24093564fc | ||
|
|
aafe044300 | ||
|
|
d0c2db8a70 | ||
|
|
f40a649611 | ||
|
|
ece6730832 | ||
|
|
f431b4f409 | ||
|
|
78ba742ef0 | ||
|
|
6f10041596 | ||
|
|
242f85f1e7 | ||
|
|
3c7db8c27c | ||
|
|
48a94b6b13 | ||
|
|
a26e99d70b | ||
|
|
6781faf3b5 | ||
|
|
f761a656e2 | ||
|
|
9fec0e1a38 | ||
|
|
c0b15cc7aa | ||
|
|
6689fbfaae | ||
|
|
f927e45f41 | ||
|
|
a69b9e5360 | ||
|
|
9c932b4126 | ||
|
|
9cef24a933 | ||
|
|
5ff4cb4e05 | ||
|
|
0df73b5b48 | ||
|
|
042bea47b4 | ||
|
|
a85bd9417e | ||
|
|
0f6a069ca2 | ||
|
|
2cd39baec5 | ||
|
|
45cc7e8826 | ||
|
|
e6c46be17e | ||
|
|
dbea802f85 | ||
|
|
1c80b70057 | ||
|
|
d9a9a1b26b | ||
|
|
b3f2caba32 | ||
|
|
040dd54bce | ||
|
|
22e36e7167 | ||
|
|
a21dd2212c | ||
|
|
7a21d6cc25 | ||
|
|
bef080b979 | ||
|
|
2f37160798 | ||
|
|
9f4d93b4b9 | ||
|
|
33042240bd | ||
|
|
cbcd6a518f | ||
|
|
57707df9f3 | ||
|
|
9c2ac97c00 | ||
|
|
7bf80be774 | ||
|
|
e84cbc6e5b | ||
|
|
7374e2293f | ||
|
|
d251f22985 | ||
|
|
b45bb4cd81 | ||
|
|
db825f4a35 | ||
|
|
a1ee4dd786 | ||
|
|
9298f4d1aa | ||
|
|
47e4d9b905 | ||
|
|
412fad78c1 | ||
|
|
d5756387f4 | ||
|
|
44be3ba119 | ||
|
|
56e1b6b45f | ||
|
|
f5e29fceee | ||
|
|
518eada858 | ||
|
|
5e306572e5 | ||
|
|
d7cdb95dfb | ||
|
|
a25df03d65 | ||
|
|
37930f2645 | ||
|
|
3843ca8958 | ||
|
|
2a4b703bf0 | ||
|
|
68556bda0a | ||
|
|
94d8480438 | ||
|
|
c2099ad8f1 | ||
|
|
8e8f5a6ef8 | ||
|
|
51da5a8d33 | ||
|
|
ed891d0952 | ||
|
|
db1ef54fd7 | ||
|
|
0c9448550a | ||
|
|
8881259edc | ||
|
|
a5b2e812ec | ||
|
|
20026322fe | ||
|
|
c7b20b6d2c | ||
|
|
2578f20592 | ||
|
|
09425bc01e | ||
|
|
d7ba29ff04 | ||
|
|
3f2719dff2 | ||
|
|
e00215a710 | ||
|
|
e000bb64f4 | ||
|
|
cad2ed73aa | ||
|
|
e4032880eb | ||
|
|
21eaf072d2 | ||
|
|
85718607f3 | ||
|
|
cb5d4c46a0 | ||
|
|
d38caf2624 | ||
|
|
c40e40d14e | ||
|
|
ed80a6cc68 | ||
|
|
5e052017ac | ||
|
|
533dea84fc | ||
|
|
ac085a264d | ||
|
|
f52852d717 | ||
|
|
e6806d95cd | ||
|
|
1b5444f3de | ||
|
|
cddf93fa80 | ||
|
|
80044db0b1 | ||
|
|
62b063d463 | ||
|
|
4ed789a6c7 | ||
|
|
3ef859d283 | ||
|
|
8a164b654c | ||
|
|
8ebe88c7e1 | ||
|
|
15589c6a1d | ||
|
|
5c49adccd9 | ||
|
|
d85998d908 | ||
|
|
661cd3f449 | ||
|
|
33bb71be73 | ||
|
|
e562b640be | ||
|
|
13e42e8cc5 | ||
|
|
15ca9a449f | ||
|
|
d9cff96eb7 | ||
|
|
f90cf25dc9 | ||
|
|
db3126e970 | ||
|
|
d09215a1b9 | ||
|
|
d6e10d6642 | ||
|
|
2808d04146 | ||
|
|
dba4dcdd72 | ||
|
|
30aad8d272 | ||
|
|
b2863bdd4d | ||
|
|
1e072c374e | ||
|
|
c5a65644a2 | ||
|
|
43fe761a14 | ||
|
|
8374689ce8 | ||
|
|
b41cd9f4b5 | ||
|
|
2b8e92447d | ||
|
|
f26f90d9f0 | ||
|
|
03a2f3b470 | ||
|
|
01c9630123 | ||
|
|
47c9507e32 | ||
|
|
b5df13b2f6 | ||
|
|
87477c11df | ||
|
|
1bf0d488f6 | ||
|
|
971150c6c1 | ||
|
|
1c6ac3c056 | ||
|
|
9f38119343 | ||
|
|
d11362c9f9 | ||
|
|
4ecb987709 | ||
|
|
822951725c | ||
|
|
f7ed07601f | ||
|
|
65d94e82b8 | ||
|
|
05c14523ed | ||
|
|
5eb8e18313 | ||
|
|
db7f22edb4 | ||
|
|
ce2634e377 | ||
|
|
817230455e | ||
|
|
5aa559851f | ||
|
|
d3fa91fe25 | ||
|
|
42678b1d96 | ||
|
|
843ff616ca | ||
|
|
e41152af6a | ||
|
|
4790196a34 | ||
|
|
87e71aeb2e | ||
|
|
ad4c41f6c7 | ||
|
|
fbd1b98ada | ||
|
|
598ea0762c | ||
|
|
450a67e955 | ||
|
|
5befd8050b | ||
|
|
3a379cea0b | ||
|
|
9d1849117a | ||
|
|
62c07f8fcf | ||
|
|
329cdab8c6 | ||
|
|
61b21852e8 | ||
|
|
9457c8f281 | ||
|
|
4f2ed0a5a7 | ||
|
|
b1b060c437 | ||
|
|
e34d63b6b4 | ||
|
|
a8784c0f5e | ||
|
|
0cff7ddb95 | ||
|
|
a21334220b | ||
|
|
ab6b092cf5 | ||
|
|
3e7f1d9631 | ||
|
|
44c9771633 | ||
|
|
b14f8bbbf8 | ||
|
|
15dc606bde | ||
|
|
872c2935de | ||
|
|
182ec1f73d | ||
|
|
f8d96de9b8 | ||
|
|
c76bd6f66c | ||
|
|
c80b1e54c6 | ||
|
|
6cc2ea4f39 | ||
|
|
f690401962 | ||
|
|
0e5d89d5f9 | ||
|
|
20aa4d31ee | ||
|
|
5a10687aa7 | ||
|
|
193d5d9b4d | ||
|
|
059f486db7 | ||
|
|
e1832b9c16 | ||
|
|
405630bca1 | ||
|
|
b43080aabd | ||
|
|
8ef3deb066 | ||
|
|
44538b0334 | ||
|
|
65c4916847 | ||
|
|
0c3bcfe536 | ||
|
|
d8fb1e4f57 | ||
|
|
f45da35764 | ||
|
|
d3821beebc | ||
|
|
935abf6855 | ||
|
|
5f4c3d9f3c | ||
|
|
a63e44b422 | ||
|
|
6dbb97ce1d | ||
|
|
611be72982 | ||
|
|
99f7751032 | ||
|
|
bf754899c4 | ||
|
|
17571047fc | ||
|
|
820f0267cc | ||
|
|
d26fcc7357 | ||
|
|
fddd7fd08c | ||
|
|
48d5115859 | ||
|
|
2934a786fd | ||
|
|
3005a471b7 | ||
|
|
3c1c2e519d | ||
|
|
99323d2779 | ||
|
|
7b77887f5c | ||
|
|
40f0e51157 | ||
|
|
143287e658 | ||
|
|
0f5ae59e03 | ||
|
|
0eb9c7ba65 | ||
|
|
b4164457e4 | ||
|
|
8f36c12b40 | ||
|
|
7003e89a46 | ||
|
|
3de1ac8882 | ||
|
|
14766238b8 | ||
|
|
f7efbfa735 | ||
|
|
fefe5fdabe | ||
|
|
b0fbf033d4 | ||
|
|
298e52d4c5 | ||
|
|
fef943f32d | ||
|
|
8327f72d18 | ||
|
|
87ffc081ad | ||
|
|
b8806c3b21 | ||
|
|
0a437f1e84 | ||
|
|
ddf60ce89b | ||
|
|
c7f682bb1a | ||
|
|
5cd938d30f | ||
|
|
6f22a131a6 | ||
|
|
eb291ad1bf | ||
|
|
eef57addea | ||
|
|
cb613e035b | ||
|
|
c1d3375567 | ||
|
|
8b6d383d06 | ||
|
|
9142505e24 | ||
|
|
8585ffb56b | ||
|
|
8df65cb0df | ||
|
|
b951d20802 | ||
|
|
c1c5b5bdf6 | ||
|
|
d6207f0759 | ||
|
|
c28c0db07c | ||
|
|
82d3bf8ab1 | ||
|
|
292f1b94a1 | ||
|
|
542ec29e69 | ||
|
|
b0444505af | ||
|
|
87b5e7f72e | ||
|
|
ee8fcea415 | ||
|
|
4315f4ea2f | ||
|
|
de793a1552 | ||
|
|
d2b8bbb6c4 | ||
|
|
e362d98183 | ||
|
|
7645534ca0 | ||
|
|
dcd26fa229 | ||
|
|
1dc5122691 | ||
|
|
55a5426dbe | ||
|
|
ccd4ba7564 | ||
|
|
04776d4d49 | ||
|
|
0881eccb02 | ||
|
|
4d630de3b2 | ||
|
|
dd78a09c2d | ||
|
|
0e6325726c | ||
|
|
188235de8e | ||
|
|
1d2229d794 | ||
|
|
ad27242afc | ||
|
|
51598822fa | ||
|
|
e11244a844 | ||
|
|
806ecac00d | ||
|
|
6b7aa33ff8 | ||
|
|
f9ba9ac06c | ||
|
|
520678cac1 | ||
|
|
d48807c1a8 | ||
|
|
7f3192a797 | ||
|
|
d2401a3583 | ||
|
|
367648fdb0 | ||
|
|
99374e4c27 | ||
|
|
a81d078815 |
@@ -1,12 +1,56 @@
|
||||
-*- coding: utf-8 -*-
|
||||
BRL-CAD Deprecation Log
|
||||
=======================
|
||||
BRL-CAD Interface Change Policy
|
||||
===============================
|
||||
|
||||
Included below is a deprecation log and notes for BRL-CAD public
|
||||
interface changes that potentially impact external developers and
|
||||
users. Public interfaces include developer application programming
|
||||
interface (API) calls as well as user application command-line
|
||||
interface (CLI) and graphical user interface (GUI) behaviors.
|
||||
Included below are details of BRL-CAD public interface changes that
|
||||
potentially impact external developers and users. Public interfaces
|
||||
include developer application programming interface (API) calls as
|
||||
well as user application command-line interface (CLI) and graphical
|
||||
user interface (GUI) behaviors. Changes are characterized as:
|
||||
|
||||
1) changing a new interface,
|
||||
2) being minimally impacting, or
|
||||
3) requiring adherence to deprecation policy.
|
||||
|
||||
This policy is intentionally designed to balance developer agility,
|
||||
helping accelerate development, with interface stability, helping
|
||||
preserve application developer and user investments.
|
||||
|
||||
All changes to BRL-CAD are expected to conform to this change policy.
|
||||
|
||||
|
||||
NEW INTERFACE
|
||||
-------------
|
||||
|
||||
Changes to interfaces that have been recently introduced are often
|
||||
subject to change and should not yet be relied upon by application
|
||||
developers or users. They may be changed as needed from release to
|
||||
release and are not subject to change policy restrictions until they
|
||||
have been included in at least TWO releases without change.
|
||||
|
||||
|
||||
MINIMALLY IMPACTING
|
||||
-------------------
|
||||
|
||||
If a change to an interface has a suitable and completely equivalent
|
||||
alternative, the change is deemed to be "minimally impacting" and can
|
||||
be made during any release. Examples of such changes include renaming
|
||||
an interface, reordering parameters, adding additional parameters for
|
||||
previously implicit behavior, and removing unused parameters.
|
||||
|
||||
Basically, the impact can usually be considered minimally impacting if
|
||||
a static regular expression search-and-replace is all that is needed
|
||||
to update calling code, and no change is imposed on the user.
|
||||
|
||||
|
||||
DEPRECATION POLICY
|
||||
------------------
|
||||
|
||||
If a change will intentionally change, replace, or remove
|
||||
functionality that has been documented and published in at least TWO
|
||||
releases should be first marked as DEPRECATED. Otherwise, changes to
|
||||
interfaces that have not been publicly announced or are not publicly
|
||||
documented for at least two releases may be changed without notice.
|
||||
|
||||
The general practice is that public interface changes may go from
|
||||
deprecated to obsolete, whereby previous behavior is removed or
|
||||
@@ -16,59 +60,67 @@ a) during a major release (e.g. going from 7.*.* to 8.*.*)
|
||||
|
||||
b) during a minor release provided the change was publicly announced
|
||||
as deprecated beforehand AND sufficient deprecation warning was
|
||||
given via i) two minor releases included the deprecation notice,
|
||||
and ii) at least three months (90 days) have passed since the
|
||||
given via i) TWO minor releases included the deprecation notice,
|
||||
and ii) at least THREE months (90 days) have passed since the
|
||||
deprecation was announced
|
||||
|
||||
c) during a minor release provided there still exists an equivalent
|
||||
alternative interface that will not impose an undue burden on users
|
||||
or developers (see "MINIMALLY IMPACTING API CHANGES" below)
|
||||
c) during any release provided there still exists an EQUIVALENT
|
||||
alternative interface that does not impose an undue burden on users
|
||||
or developers (see "MINIMALLY IMPACTING")
|
||||
|
||||
d) during a patch release provided you can correctly prove P = NP
|
||||
Public interfaces scheduled for removal should be visibly marked as
|
||||
deprecated during compilation with the DEPRECATED keyword on function
|
||||
declarations, with #warning "DEPRECATED ..." pre-processor statements,
|
||||
and with @DEPRECATED in source code comments. Where users are not
|
||||
adversely affected, a run-time DEPRECATION statement may be printed.
|
||||
|
||||
If a change will intentionally replace or remove functionality, then
|
||||
they should be then marked as deprecated first. Otherwise, changes to
|
||||
interfaces that are never publicly announced, not installed, or are
|
||||
not part of publicly available documentation are fair game to change
|
||||
as needed.
|
||||
Whenever published functionality is finally removed, move its entry
|
||||
from the DEPRECATED section below to the OBSOLETE section for the
|
||||
version in which it was removed. Make sure the entry retains a
|
||||
reference to the version in which the item was marked as deprecated.
|
||||
|
||||
Where feasible, interfaces should be visibly marked as deprecated
|
||||
either during compile-time with #warning pre-processor declarations or
|
||||
during run-time with print statements.
|
||||
|
||||
Example: Say we decided during 7.50.3 development to remove
|
||||
rt_shootray() from our API without a replacement that would qualify as
|
||||
"minimally impacting". We'd annotate the deprecation here, mark the
|
||||
EXAMPLES
|
||||
--------
|
||||
|
||||
Example #1: Say we decided during 7.50.3 development to remove
|
||||
rt_shootray() from the API without a replacement. That does NOT
|
||||
qualify as "minimally impacting" because there's no replacement and
|
||||
rt_shootray() has been published and documented in more than two
|
||||
releases. We'd annotate the deprecation in the CHANGES file, mark the
|
||||
function as DEPRECATED in the API header, and post the 7.50.4 release.
|
||||
The soonest that function could be removed would be in the 7.54.0
|
||||
release during 7.53 development. It could NOT be removed in 7.54.2
|
||||
since it's a patch version, prior to the 7.54 release line, nor even
|
||||
during 7.54.0 if less than 90 days had passed since 7.50.6 was posted.
|
||||
|
||||
When it is finally removed, remove its entry in the DEPRECATED section
|
||||
and move it to the OBSOLETE section under the version entry in which
|
||||
it was removed. Make sure the entry has a reference to the version
|
||||
in which the item was first classified as deprecated. See the %S
|
||||
entry for an example.
|
||||
|
||||
DEPRECATED/OBSOLETE Items
|
||||
-------------------------
|
||||
|
||||
The items listed below are interfaces that are deprecated or obsolete,
|
||||
categorized by the release in which the change was made. If the
|
||||
change involved a rename/removal of a routine, both the original and
|
||||
new names should be listed for reference.
|
||||
Example #2: Say we decide during 7.48.0 development to modify bu_log()
|
||||
by adding a new additional enum parameter denoting a message type.
|
||||
This change is considered minimally impacting because it can be
|
||||
characterized by a simple regular expression (e.g.,
|
||||
s/bu_log(/bu_log(PRINT, /g). Updates to calling codes are considered
|
||||
trivial. The change would get documented in the CHANGES file and all
|
||||
calls that can be updated must be updated at that time.
|
||||
|
||||
|
||||
**************
|
||||
* DEPRECATED *
|
||||
**************
|
||||
|
||||
The items listed below are interfaces that are deprecated. They are
|
||||
categorized by the release in which the change was made. If the
|
||||
change involved a removal of a command or function, both the original
|
||||
and new names should be listed for reference.
|
||||
|
||||
|
||||
7.24
|
||||
----
|
||||
include/raytrace librt
|
||||
db_full_path_list_add(), db_free_full_path_list() [deprecated 7.24]
|
||||
db_search_formplan(), db_search_freeplan(), db_search_full_paths() [deprecated 7.24]
|
||||
db_search_unique_objects(), struct db_full_path_list [deprecated 7.24]
|
||||
src/irprep
|
||||
all_sf, firpass, ir-X, irdisp, pictx, secpass, shapefact, showterm [deprecated 7.24]
|
||||
all_sf, firpass, ir-X, irdisp, pictx, secpass, shapefact, showterm [deprecated 7.24]
|
||||
include/raytrace.h librt
|
||||
RT_DBHASH and RT_DBNHASH [deprecation 7.24]
|
||||
|
||||
@@ -247,6 +299,10 @@ include/raytrace.h
|
||||
* OBSOLETE *
|
||||
************
|
||||
|
||||
Below are the interfaces that have followed deprecation policy and are
|
||||
now no longer a part of BRL-CAD.
|
||||
|
||||
|
||||
7.24.2
|
||||
------
|
||||
.pl file suffix
|
||||
@@ -412,15 +468,6 @@ include/[library].h (several)
|
||||
* MINIMALLY IMPACTING API CHANGES *
|
||||
***********************************
|
||||
|
||||
If a change to an interface has a suitable and completely equivalent
|
||||
alternative, the change is deemed to be "minimally impacting" and can
|
||||
be made during any minor release. Examples of such changes include
|
||||
renaming an interface, reordering parameters, adding new parameters to
|
||||
an interface for previously implicit or restricted behavior, and
|
||||
removing unused parameters.
|
||||
|
||||
Basically, the impact can usually be considered minor if a static
|
||||
regular expression search-and-replace is all that is needed to update.
|
||||
Included in following are various minimally impacting API changes that
|
||||
have been identified in chronological order. As expressions are not
|
||||
extensively tested, use with caution.
|
||||
@@ -902,4 +949,4 @@ s/redraw_vlist/draw/g
|
||||
removed redraw_vlist mged command, just call draw or refresh [7.24]
|
||||
s/RT_BADNUM/INVALID/g
|
||||
s/RT_BADVAL/VINVALID/g
|
||||
moved RT_BADNUM and RT_BADVEC to vmath.h as INVALID and VINVALID [7.24]
|
||||
moved RT_BADNUM and RT_BADVEC to vmath.h as INVALID and VINVALID [7.24]
|
||||
|
||||
+134
-40
@@ -49,18 +49,19 @@
|
||||
# As best as is reasonably possible, proper ordering and
|
||||
# separation of tests and settings should be maintained per the
|
||||
# recommended standard layout. The tests should be added to the
|
||||
# labeled sections below so that they are organized as follows:
|
||||
# labeled sections below so that they are organized in stages as
|
||||
# follows:
|
||||
#
|
||||
# 0) information on the package and toplevel CMake settings
|
||||
# 1) define top level options
|
||||
# 2) check programs
|
||||
# 3) check compiler characteristics
|
||||
# 4) check libraries
|
||||
# 5) check headers
|
||||
# 6) check types/structures
|
||||
# 7) check functions
|
||||
# 8) check system services
|
||||
# 9) output a summary
|
||||
# Stage 0 - information on the package and toplevel CMake settings
|
||||
# Stage 1 - define top level options
|
||||
# Stage 2 - check programs
|
||||
# Stage 3 - check compiler characteristics
|
||||
# Stage 4 - check libraries
|
||||
# Stage 5 - check headers
|
||||
# Stage 6 - check types/structures
|
||||
# Stage 7 - check functions
|
||||
# Stage 8 - check system services
|
||||
# Stage 9 - output a summary
|
||||
#
|
||||
# The output summary should report key information about the final
|
||||
# configuration of the build. Comprehensive information is available
|
||||
@@ -628,10 +629,10 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX)
|
||||
set(BRLCAD_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "BRL-CAD install prefix")
|
||||
mark_as_advanced(BRLCAD_PREFIX)
|
||||
|
||||
# If we've got a Release build with a Debug path or vice versa, warn about it
|
||||
# A "make install" of a Release build into a dev install directory or vice
|
||||
# versa is going to result in an install that doesn't respect BRL-CAD standard
|
||||
# naming conventions
|
||||
# If we've a Release build with a Debug path or vice versa, warn about
|
||||
# it. A "make install" of a Release build into a dev install
|
||||
# directory or vice versa is going to result in an install that
|
||||
# doesn't respect BRL-CAD standard naming conventions.
|
||||
if("${CMAKE_BUILD_TYPE}" MATCHES "Release" AND ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/brlcad/dev-${BRLCAD_VERSION}")
|
||||
message(FATAL_ERROR "\nInstallation directory (CMAKE_INSTALL_PREFIX) is set to /usr/brlcad/dev-${BRLCAD_VERSION}, but build type is set to Release!\n")
|
||||
endif("${CMAKE_BUILD_TYPE}" MATCHES "Release" AND ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/brlcad/dev-${BRLCAD_VERSION}")
|
||||
@@ -644,7 +645,7 @@ endif("${CMAKE_BUILD_TYPE}" MATCHES "Debug" AND ${CMAKE_INSTALL_PREFIX} STREQUAL
|
||||
# the build directory AND install directory. Thanks to plplot for
|
||||
# identifying the necessity of setting CMAKE_INSTALL_NAME_DIR on OSX.
|
||||
# Documentation of these options is available at
|
||||
# http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||
# http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
@@ -744,7 +745,7 @@ endif(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
# changes would not automatically propagate back up.
|
||||
#
|
||||
# We also allow for multiple projects with this macro, in case
|
||||
# subprojects are also managing a config.h.in file of their own.
|
||||
# subprojects are also managing a config.h.in a file of their own.
|
||||
|
||||
set(CONFIG_H_FILE "${BRLCAD_BINARY_DIR}/include/brlcad_config.h.in")
|
||||
set_source_files_properties(${CONFIG_H_FILE} PROPERTIES GENERATED TRUE)
|
||||
@@ -1215,6 +1216,47 @@ endif(BRLCAD_ENABLE_VERBOSE_PROGRESS)
|
||||
option(BRLCAD_ENABLE_PROFILING "Build with profiling support" OFF)
|
||||
mark_as_advanced(BRLCAD_ENABLE_PROFILING)
|
||||
|
||||
#====== POSIX, C99 ===================
|
||||
# Build with strict POSIX compliance checking
|
||||
set(ENABLE_POSIX_COMPLIANCE_ALIASES "ENABLE_POSIX")
|
||||
set(ENABLE_POSIX_COMPLIANCE_DESCRIPTION "
|
||||
Build with strict POSIX compliance checking. Defaults to OFF.
|
||||
|
||||
Causes compiler options to be set for strict compliance with the
|
||||
minimum C and C++ standards acceptable according to current BRL-CAD
|
||||
policy. The current minimum C standard is POSIX 200112 plus C99.
|
||||
There is no currently defined minimum C++ standard.
|
||||
")
|
||||
BRLCAD_OPTION(OFF ENABLE_POSIX_COMPLIANCE
|
||||
ENABLE_POSIX_COMPLIANCE_ALIASES
|
||||
ENABLE_POSIX_COMPLIANCE_DESCRIPTION)
|
||||
mark_as_advanced(ENABLE_POSIX_COMPLIANCE)
|
||||
|
||||
#== C99 ==
|
||||
set(ENABLE_C99_COMPLIANCE_ALIASES "ENABLE_C99")
|
||||
set(ENABLE_C99_COMPLIANCE_DESCRIPTION "
|
||||
Build with strict C99 compliance checking. Defaults to OFF.
|
||||
|
||||
Causes C compiler options to be set for strict compliance with the C99
|
||||
standard.
|
||||
")
|
||||
BRLCAD_OPTION(OFF ENABLE_C99_COMPLIANCE
|
||||
ENABLE_C99_COMPLIANCE_ALIASES
|
||||
ENABLE_C99_COMPLIANCE_DESCRIPTION)
|
||||
mark_as_advanced(ENABLE_C99_COMPLIANCE)
|
||||
|
||||
# only one of the two C std options is allowed
|
||||
set(STD_COMPLIANCE OFF)
|
||||
if (ENABLE_POSIX_COMPLIANCE)
|
||||
set(ENABLE_C99_COMPLIANCE OFF)
|
||||
set(STD_COMPLIANCE ON)
|
||||
elseif(ENABLE_C99_COMPLIANCE)
|
||||
set(ENABLE_POSIX_COMPLIANCE OFF)
|
||||
set(STD_COMPLIANCE ON)
|
||||
endif()
|
||||
|
||||
#====== POSIX, C99 ===================
|
||||
|
||||
# Build with dtrace support
|
||||
option(BRLCAD_ENABLE_DTRACE "Build with dtrace support" OFF)
|
||||
mark_as_advanced(BRLCAD_ENABLE_DTRACE)
|
||||
@@ -1339,6 +1381,17 @@ CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_PDF_MAN "Build PDF output from DocBook d
|
||||
CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_VALIDATE "Perform validation for DocBook documentation" ON "BRLCAD_EXTRADOCS;BRLCAD_ENABLE_STRICT" OFF)
|
||||
mark_as_advanced(BRLCAD_EXTRADOCS_VALIDATE)
|
||||
|
||||
# Load various wrapper macros for checking libraries, headers and
|
||||
# functions, some in use by src/other build logic
|
||||
include(${BRLCAD_CMAKE_DIR}/BRLCAD_CheckFunctions.cmake)
|
||||
|
||||
# The src/other subdirectory does not share (at least, not universally)
|
||||
# certain definitions common to all other directories in BRL-CAD. Also,
|
||||
# we don't want flags that are otherwise global to BRL-CAD to be passed
|
||||
# to the src/other directory (particularly things like strict compiler
|
||||
# flags) so add src/other before any of that setup occurs.
|
||||
add_subdirectory(src/other)
|
||||
|
||||
|
||||
# *******************************************************************
|
||||
# *** Check for Programs - Stage 2 of 9 ***
|
||||
@@ -1356,47 +1409,38 @@ include(${BRLCAD_CMAKE_DIR}/FindShellDeps.cmake)
|
||||
include(${BRLCAD_CMAKE_DIR}/FindLEX.cmake)
|
||||
include(${BRLCAD_CMAKE_DIR}/FindYACC.cmake)
|
||||
|
||||
|
||||
# If using dtrace, we will need to find it
|
||||
if(BRLCAD_ENABLE_DTRACE)
|
||||
find_program(DTRACE_EXEC NAMES dtrace DOC "path to dtrace executable")
|
||||
endif(BRLCAD_ENABLE_DTRACE)
|
||||
|
||||
|
||||
# Load various wrapper macros for checking libraries, headers and
|
||||
# functions
|
||||
include(${BRLCAD_CMAKE_DIR}/BRLCAD_CheckFunctions.cmake)
|
||||
|
||||
|
||||
# *******************************************************************
|
||||
# *** Check for Compiler Characteristics - Stage 3 of 9 ***
|
||||
# *******************************************************************
|
||||
|
||||
# at this stage only the gcc compiler is supported
|
||||
# load our compiler testing macro definitions
|
||||
if(NOT MSVC)
|
||||
# alas, we heavily assume and test for gcc-style flags in both
|
||||
include(${BRLCAD_CMAKE_DIR}/CompilerFlags.cmake)
|
||||
include(${BRLCAD_CMAKE_DIR}/BRLCAD_CompilerFlags.cmake)
|
||||
endif(NOT MSVC)
|
||||
|
||||
# The src/other subdirectory does not share (at least, not universally)
|
||||
# certain definitions common to all other directories in BRL-CAD. Also,
|
||||
# we don't want flags that are otherwise global to BRL-CAD to be passed
|
||||
# to the src/other directory (particularly things like strict compiler
|
||||
# flags) so add src/other before any of that setup occurs.
|
||||
add_subdirectory(src/other)
|
||||
# when strict standards compliance is in effect, we need to ensure
|
||||
# all checks use the same compiler settings (but it doesn't seem to
|
||||
# work in wrapped CMake checking functions as it is documented to do)
|
||||
if(STD_COMPLIANCE)
|
||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
# Most of the src/other projects have their own logic for handling
|
||||
# the C inline issue - BRL-CAD needs a fine-grained approach. Mixed
|
||||
# C and C++ sources require different treatment for the same build
|
||||
# target, since C++11 doesn't allow inline to be re-defined. See
|
||||
# misc/CMake/BRLCAD_Targets.cmake for handling of C_INLINE.
|
||||
include(${BRLCAD_CMAKE_DIR}/CheckCInline.cmake)
|
||||
CHECK_C_INLINE(C_INLINE)
|
||||
|
||||
# Requires that CompilerFlags.cmake already be loaded
|
||||
if(NOT MSVC)
|
||||
include(${BRLCAD_CMAKE_DIR}/BRLCAD_CompilerFlags.cmake)
|
||||
endif(NOT MSVC)
|
||||
|
||||
# If doing an optimized build, set _FORTIFY_SOURCE to 2. Provides
|
||||
# compile-time best-practice error checking on certain libc functions
|
||||
# (e.g., memcpy), and provides run-time checks on buffer lengths and
|
||||
@@ -1702,7 +1746,7 @@ BRLCAD_FUNCTION_EXISTS(geteuid HAVE_GETEUID)
|
||||
BRLCAD_FUNCTION_EXISTS(gethostname HAVE_GETHOSTNAME)
|
||||
BRLCAD_FUNCTION_EXISTS(getloadavg HAVE_GETLOADAVG)
|
||||
BRLCAD_FUNCTION_EXISTS(getopt_long HAVE_GETOPT_LONG)
|
||||
BRLCAD_FUNCTION_EXISTS(getprogname HAVE_GETPROGNAME)
|
||||
BRLCAD_FUNCTION_EXISTS(getprogname HAVE_GETPROGNAME) # bsd
|
||||
BRLCAD_FUNCTION_EXISTS(kill HAVE_KILL)
|
||||
BRLCAD_FUNCTION_EXISTS(lrand48 HAVE_LRAND48)
|
||||
BRLCAD_FUNCTION_EXISTS(memset HAVE_MEMSET)
|
||||
@@ -1715,8 +1759,9 @@ BRLCAD_FUNCTION_EXISTS(realpath HAVE_REALPATH)
|
||||
BRLCAD_FUNCTION_EXISTS(setenv HAVE_SETENV)
|
||||
BRLCAD_FUNCTION_EXISTS(setpgid HAVE_SETPGID)
|
||||
BRLCAD_FUNCTION_EXISTS(setpriority HAVE_SETPRIORITY)
|
||||
BRLCAD_FUNCTION_EXISTS(setprogname HAVE_SETPROGNAME)
|
||||
BRLCAD_FUNCTION_EXISTS(srand48 HAVE_SRAND48)
|
||||
BRLCAD_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
|
||||
BRLCAD_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
|
||||
BRLCAD_FUNCTION_EXISTS(strchr HAVE_STRCHR)
|
||||
BRLCAD_FUNCTION_EXISTS(strdup HAVE_STRDUP)
|
||||
BRLCAD_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
|
||||
@@ -1755,8 +1800,47 @@ if("${HAVE_DECL_FILENO}" MATCHES "^${HAVE_DECL_FILENO}$")
|
||||
endif(HAVE_DECL_FILENO)
|
||||
endif("${HAVE_DECL_FILENO}" MATCHES "^${HAVE_DECL_FILENO}$")
|
||||
|
||||
# test for program_invocation_name global variable
|
||||
if("${HAVE_PROGRAM_INVOCATION_NAME}" MATCHES "^${HAVE_PROGRAM_INVOCATION_NAME}$")
|
||||
check_c_source_compiles("#define _GNU_SOURCE\n#include <errno.h>\nint main() { return (program_invocation_name)?0:1; }" HAVE_PROGRAM_INVOCATION_NAME)
|
||||
if(HAVE_PROGRAM_INVOCATION_NAME)
|
||||
CONFIG_H_APPEND(BRLCAD "#cmakedefine HAVE_PROGRAM_INVOCATION_NAME 1\n")
|
||||
endif(HAVE_PROGRAM_INVOCATION_NAME)
|
||||
endif("${HAVE_PROGRAM_INVOCATION_NAME}" MATCHES "^${HAVE_PROGRAM_INVOCATION_NAME}$")
|
||||
|
||||
# On Windows, we need to check for hypot etc.. This test pertains
|
||||
#-----------------------------------------------------------------------
|
||||
# check C99 missing functions with a more rigourously-controlled compiler envirinment
|
||||
if(STD_COMPLIANCE)
|
||||
|
||||
set(needed_FUNCS
|
||||
test_fdopen
|
||||
test_fileno
|
||||
test_realpath
|
||||
test_gethostname
|
||||
test_posix_memalign
|
||||
test_strcasecmp
|
||||
test_strncasecmp
|
||||
)
|
||||
|
||||
foreach(tprog ${needed_FUNCS})
|
||||
# remove "test_" from tprog
|
||||
STRING(REGEX REPLACE "test_" "" func ${tprog})
|
||||
STRING(TOUPPER "${prog}" func)
|
||||
try_compile(success
|
||||
"${CMAKE_BINARY_DIR}/test_funcs"
|
||||
"${CMAKE_SOURCE_DIR}/src/compat/${tprog}.c"
|
||||
CMAKE_FLAGS "${CMAKE_C_FLAGS}"
|
||||
OUTPUT_VARIABLE log
|
||||
)
|
||||
if(success)
|
||||
CONFIG_H_APPEND(BRLCAD "#cmakedefine HAVE_WORKING_${func}_FUNCTION 1\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
endif()
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
# On Windows, we need to check for hypot etc. This test pertains
|
||||
# to the windows specific config file, not CONFIG_H_FILE - hence,
|
||||
# just run the test and it will be handled by configure_file later.
|
||||
include(CheckSymbolExists)
|
||||
@@ -1986,13 +2070,23 @@ endif(NOT BRLCAD_IS_SUBBUILD)
|
||||
|
||||
# Generate the include/conf files
|
||||
|
||||
# HOST
|
||||
# HOST (note gethostname is NOT a c89 function)
|
||||
configure_file(${BRLCAD_CMAKE_DIR}/test_srcs/report_hostname.c.in ${CMAKE_BINARY_DIR}/CMakeTmp/report_hostname.c)
|
||||
if(NOT MSVC)
|
||||
TRY_RUN(TIME_RESULT TIME_COMPILED
|
||||
${CMAKE_BINARY_DIR}/CMakeTmp
|
||||
${CMAKE_BINARY_DIR}/CMakeTmp/report_hostname.c
|
||||
OUTPUT_VARIABLE COMPILEMESSAGES)
|
||||
OUTPUT_VARIABLE COMPILEMESSAGES
|
||||
)
|
||||
# test results
|
||||
if(NOT TIME_COMPILED)
|
||||
message(INFO ${COMPILEMESSAGES})
|
||||
message(FATAL_ERROR "CMakeTmp/report_hostname.c failed to compile")
|
||||
endif()
|
||||
if(TIME_RESULT)
|
||||
message(INFO ${COMPILEMESSAGES})
|
||||
message(FATAL_ERROR "CMakeTmp/report_hostname.c failed to run")
|
||||
endif()
|
||||
else(NOT MSVC)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib)
|
||||
TRY_RUN(TIME_RESULT TIME_COMPILED
|
||||
|
||||
@@ -1189,108 +1189,163 @@ necessary convention by a binary package management system. Examples:
|
||||
zip
|
||||
|
||||
|
||||
PATCHING A RELEASE
|
||||
------------------
|
||||
|
||||
Should it become necessary to patch a release that has already been
|
||||
posted and announced, the mechanism is to post patch files for the
|
||||
source release and update the uploaded release notes README file.
|
||||
|
||||
Example: stop_rt_crashing-0.patch and fix_fbserv-1.patch
|
||||
|
||||
It's expected that all patch files are independent and will be applied
|
||||
sequentially. They should be consistently and incrementally numbered.
|
||||
Users should be instructed in the release notes README to download and
|
||||
apply all available patch files.
|
||||
|
||||
For binary releases, it's recommended to just "move on" and let issues
|
||||
become resolved in the next release unless there's a critical security
|
||||
or significant data corruption issue involved. If it becomes
|
||||
necessary to repost a release, use the RELEASE_COUNT file name
|
||||
convention described in VERSION NUMBERS & COMPATIBILITY.
|
||||
|
||||
Example: BRL-CAD-7.12.2.dmg is superseded by BRL-CAD-7.12.2-1.dmg
|
||||
|
||||
Patched binary releases may be moved to the hidden attic folder if
|
||||
critical, though not necessary or recommended. They are preserved for
|
||||
historic record and should never be deleted once announced. Releases
|
||||
not yet been announced may be updated within two days of being posted
|
||||
without involving a patch.
|
||||
|
||||
|
||||
MAKING A RELEASE
|
||||
----------------
|
||||
|
||||
BRL-CAD is developed on a monthly iteration development schedule with
|
||||
a release planned (not always actualized) at the end of every month.
|
||||
|
||||
In order to make a release, the sources need to be appropriately
|
||||
verified, validated, documented, synchronized, and tagged:
|
||||
documented, tested, synchronized, and tagged. BRL-CAD releases must
|
||||
pass strict verification and validation testing.
|
||||
|
||||
* Required verification and validation actions include compiling
|
||||
successfully, passing regression tests, a successful benchmark,
|
||||
and passing distcheck on at least two different platforms.
|
||||
Compile with both default settings and all dependencies enabled.
|
||||
Any developer may cause a release to be made provided testing passes
|
||||
and the appropriate release steps are taken.
|
||||
|
||||
* All user-visible changes should be documented in the NEWS file;
|
||||
all API changes should be noted in the CHANGES file (or reverted).
|
||||
The release number should appropriately reflect the type of
|
||||
changes being released. See the more specific release steps noted
|
||||
below and VERSION NUMBERS & COMPATIBILITY.
|
||||
When a release intention is announced, it is recommended to sync the
|
||||
trunk sources to the RELEASE branch so appropriate review testing,
|
||||
repairs, and release steps can occur without being impacted by other
|
||||
development activity.
|
||||
|
||||
* After successfully compiling and passing tests on at least two
|
||||
platforms, the sources get merged to the STABLE branch and tagged
|
||||
as tags/rel-MAJOR-MINOR-PATCH allowing for minor changes until
|
||||
sources are posted and an announcement is posted.
|
||||
Release steps are as follows:
|
||||
|
||||
Any developer may cause a release to be made provided all of the
|
||||
appropriate steps are taken.
|
||||
#####################################################################
|
||||
# 00: Notify developer mailing list of intention to release.
|
||||
|
||||
When a release intention is announced, contributors are expected to
|
||||
"settle down" for two days (at most) so that the source code may be
|
||||
verified, tested, and released. As BRL-CAD strives for a monthly
|
||||
iteration development cycle, this is often done at the end of a month.
|
||||
echo "Release preparations are under way. Trunk sources merged to the RELEASE branch will be reviewed for sync to STABLE and release tagging. Please help test by compiling distcheck-full and running benchmark, mged, and archer." | mail -s "Release preparations commencing" brlcad-devel@lists.sourceforge.net -r "your@subscribed.address"
|
||||
|
||||
Only minor bug fixes, documentation changes, and build system fixes
|
||||
should be performed after release intention is announced. Major
|
||||
changes to the source code and documentation should not occur while
|
||||
release testing is being performed.
|
||||
#####################################################################
|
||||
# 01: Sync trunk to RELEASE branch.
|
||||
|
||||
Steps to take for performing an appropriately verified, validated,
|
||||
documented, synchronized, and tagged release are as follows:
|
||||
# NON-AUTO: Review the log and obtain the last trunk merge
|
||||
# revision number from comments.
|
||||
svn log --stop-on-copy https://svn.code.sf.net/p/brlcad/code/brlcad/branches/RELEASE | grep -E 'r[0-9]{5}'
|
||||
PREV=[[last_trunk_rev]]
|
||||
echo "PREV=$PREV"
|
||||
|
||||
0) All code is committed to SVN. All commits have been reviewed.
|
||||
Notify developer mailing list of intention to release.
|
||||
svn co svn://svn.code.sf.net/p/brlcad/code/brlcad/branches/RELEASE brlcad.RELEASE
|
||||
cd brlcad.RELEASE
|
||||
svn merge https://svn.code.sf.net/p/brlcad/code/brlcad/trunk@$PREV https://svn.code.sf.net/p/brlcad/code/brlcad/trunk@HEAD .
|
||||
|
||||
echo "Release preparations have begun. Please refrain from disruptive commits until the release is tagged or 24-hours have passed, whichever first. Ensure API changes are in CHANGES, user-visible changes are in NEWS, and help with release testing." | mail -s "Release preparations commencing" brlcad-devel@lists.sourceforge.net -r "your@subscribed.address"
|
||||
#####################################################################
|
||||
# 02: Test the merge.
|
||||
|
||||
1) Update TODO and BUGS. Verify all user-visible changes are in NEWS.
|
||||
Verify CHANGES reflects all API and application changes. Make sure
|
||||
changes to usage/options are reflected in manual pages.
|
||||
mkdir -p .build && cd .build
|
||||
cmake .. -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release && make
|
||||
|
||||
2) Update or verify the version numbers in the include/conf version
|
||||
files, NEWS, and README. Commit the changes to the source repository.
|
||||
See VERSION NUMBERS & COMPATIBILITY for versioning requirements.
|
||||
# Manually check rt, mged, and archer.
|
||||
bin/rt # should report usage with correct library versions
|
||||
bin/mged -c test.g "make sph sph ; rt" # pops up a sphere
|
||||
bin/mged # displays gui, run: opendb test.g ; draw sph ; rt
|
||||
bin/archer # displays gui, run: opendb test.g ; draw sph ; rt
|
||||
|
||||
3) Update the ChangeLog with entries since the last release; commit
|
||||
the updated ChangeLog. Use the YYYY-MM-DD of the previous release.
|
||||
Get the date from the NEWS file.
|
||||
# clean up
|
||||
cd .. && rm -rf .build
|
||||
|
||||
#####################################################################
|
||||
# 03: Commit the merge.
|
||||
|
||||
CURR=`svn log --xml https://svn.code.sf.net/p/brlcad/code/brlcad/trunk | grep 'revision=' | head -n 1 | sed 's/.*="\([0-9][0-9]*\)".*/\1/g'`
|
||||
echo "CURR=$CURR"
|
||||
|
||||
svn commit -m "merge of trunk to RELEASE branch, r$PREV through r$CURR"
|
||||
|
||||
#####################################################################
|
||||
# 04: Reprioritize or address remaining TODO items.
|
||||
|
||||
# NON-AUTO: Do what's necessary to release, update priorities.
|
||||
|
||||
#####################################################################
|
||||
# 05: Review all commits.
|
||||
|
||||
# NON-AUTO: Verify all user-visible changes are in NEWS.
|
||||
# NON-AUTO: Verify all interface changes are in CHANGES.
|
||||
# NON-AUTO: Verify usage/options are documented in doc/.
|
||||
|
||||
#####################################################################
|
||||
# 06: Update the version numbers.
|
||||
|
||||
# NON-AUTO: NEWS
|
||||
# NON-AUTO: README
|
||||
# NON-AUTO: include/conf/PATCH
|
||||
# NON-AUTO: include/conv/MINOR (See VERSION NUMBERS & COMPATIBILITY section.)
|
||||
# NON-AUTO: misc/debian/changelog
|
||||
# NON-AUTO: misc/macosx/Resources/ReadMe.rtfd/TXT.rtf
|
||||
# NON-AUTO: misc/macosx/Resources/Welcome.rtfd/TXT.rtf
|
||||
|
||||
#####################################################################
|
||||
# 07: Update ChangeLog. Use the YYYY-MM-DD of previous NEWS entry.
|
||||
|
||||
LAST=`grep -E "\--- [0-9]{4}-[0-9]{2}-[0-9]{2}" NEWS | head -n 2 | tail -n 1 | awk '{print $2}'`
|
||||
echo "LAST=$LAST"
|
||||
svn2cl --break-before-msg --include-rev --stdout -r HEAD:{$LAST} > ChangeLog
|
||||
svn commit -m "update log with commits through $LAST" ChangeLog
|
||||
|
||||
4) Verify a successful build and distcheck ON AT LEAST TWO PLATFORMS.
|
||||
Passing regression tests, benchmark, and two build configurations are
|
||||
required for syncing to STABLE. Manually test mged and archer.
|
||||
#####################################################################
|
||||
# 08: Run distcheck-full on at least two platforms.
|
||||
|
||||
mkdir -p .verify && cd .verify
|
||||
cmake .. && make distcheck && rm -rf ../.verify/*
|
||||
cmake .. -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release && make distcheck && make
|
||||
mkdir -p .build && cd .build && cmake .. && make distcheck-full
|
||||
|
||||
# manually test
|
||||
bin/rt # should report usage with correct library versions
|
||||
bin/benchmark run TIMEFRAME=1 # completes without ERROR
|
||||
bin/mged -c test.g "make sph sph ; rt" # pops up a sphere
|
||||
bin/rtwizard # displays gui
|
||||
bin/mged # displays gui, run: opendb test2.g ; make sph sph ; rt
|
||||
#####################################################################
|
||||
# 09: Sync RELEASE to STABLE branch:
|
||||
|
||||
# clean up
|
||||
cd .. && rm -rf .verify
|
||||
|
||||
5) Sync trunk onto the STABLE branch. Make sure all changes since the
|
||||
previous sync are included and that STABLE matches trunk.
|
||||
|
||||
# review the log and obtain the last trunk merge revision number from comments
|
||||
svn log --stop-on-copy https://svn.code.sf.net/p/brlcad/code/brlcad/branches/STABLE . | more
|
||||
# NON-AUTO: Review the log and obtain the last merge revision
|
||||
# number from comments.
|
||||
svn log --stop-on-copy https://svn.code.sf.net/p/brlcad/code/brlcad/branches/STABLE | less
|
||||
PREV=[[last_trunk_rev]]
|
||||
*** OR ***
|
||||
### OR ###
|
||||
PREV=`svn log --xml --stop-on-copy https://svn.code.sf.net/p/brlcad/code/brlcad/branches/STABLE | grep 'revision=' | head -n 1 | sed 's/.*revision="\([0-9][0-9]*\)".*/\1/g'`
|
||||
echo "PREV=$PREV"
|
||||
|
||||
# merge that range of changes into STABLE and make sure it works
|
||||
# merge that range of changes into STABLE
|
||||
svn co https://svn.code.sf.net/p/brlcad/code/brlcad/branches/STABLE brlcad.STABLE && cd brlcad.STABLE
|
||||
svn merge https://svn.code.sf.net/p/brlcad/code/brlcad/trunk@$PREV https://svn.code.sf.net/p/brlcad/code/brlcad/trunk@HEAD .
|
||||
svn merge https://svn.code.sf.net/p/brlcad/code/brlcad/branches/RELEASE@$PREV https://svn.code.sf.net/p/brlcad/code/brlcad/branches/RELEASE@HEAD .
|
||||
|
||||
#####################################################################
|
||||
# 10: Test the merge.
|
||||
|
||||
# compile the merge
|
||||
mkdir .merge && cd .merge
|
||||
cmake .. -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release && make && cd .. && rm -rf .merge
|
||||
cmake .. -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release && make distcheck-full && cd .. && rm -rf .merge
|
||||
|
||||
# commit the merge
|
||||
CURR=`svn log --xml https://svn.code.sf.net/p/brlcad/code/brlcad/trunk | grep 'revision=' | head -n 1 | sed 's/.*="\([0-9][0-9]*\)".*/\1/g'`
|
||||
#####################################################################
|
||||
# 11: Commit the merge.
|
||||
|
||||
CURR=`svn log --xml https://svn.code.sf.net/p/brlcad/code/brlcad/branches/RELEASE | grep 'revision=' | head -n 1 | sed 's/.*="\([0-9][0-9]*\)".*/\1/g'`
|
||||
echo "CURR=$CURR"
|
||||
svn commit -m "merging trunk to STABLE from r$PREV to HEAD r$CURR"
|
||||
|
||||
6) Tag the release using "rel-MAJOR-MINOR-PATCH" format:
|
||||
svn commit -m "merging RELEASE branch to STABLE branch, r$PREV through r$CURR"
|
||||
|
||||
#####################################################################
|
||||
# 12: Tag the release using "rel-MAJOR-MINOR-PATCH" format:
|
||||
|
||||
MAJOR=`awk '{print $1}' include/conf/MAJOR`
|
||||
MINOR=`awk '{print $1}' include/conf/MINOR`
|
||||
@@ -1298,11 +1353,13 @@ previous sync are included and that STABLE matches trunk.
|
||||
echo "Tagging rel-$MAJOR-$MINOR-$PATCH"
|
||||
svn cp https://svn.code.sf.net/p/brlcad/code/brlcad/branches/STABLE https://svn.code.sf.net/p/brlcad/code/brlcad/tags/rel-$MAJOR-$MINOR-$PATCH
|
||||
|
||||
7) Increment and commit the next BRL-CAD release numbers to SVN.
|
||||
Update the include/conf/(MAJOR|MINOR|PATCH) version files immediately
|
||||
to an odd-numbered minor version or a new patch developer version
|
||||
(e.g. 7.11.0 or 7.4.1). Update README and NEWS version to next
|
||||
_expected_ release number (e.g. 7.12.0 or 7.4.2).
|
||||
#####################################################################
|
||||
# 13: Increment and commit the next BRL-CAD release numbers to SVN.
|
||||
|
||||
# Update the include/conf/(MAJOR|MINOR|PATCH) version files
|
||||
# immediately to odd-numbered minor version or new patch developer
|
||||
# version (e.g. 7.11.0 or 7.34.1). Update README and NEWS version
|
||||
# to next *expected* release number (e.g. 7.12.0 or 7.34.2).
|
||||
|
||||
echo "`expr $PATCH + 1`" > include/conf/PATCH
|
||||
NEXT="`expr $PATCH + 2`"
|
||||
@@ -1311,16 +1368,22 @@ _expected_ release number (e.g. 7.12.0 or 7.4.2).
|
||||
cat NEWS | tr '\n' '@' | perl -pi -e "$EXPR" | tr '@' '\n' > NEWS
|
||||
svn commit -m "bump to next development revision after tagging the $MAJOR.$MINOR.$PATCH release" ../include/conf/PATCH
|
||||
|
||||
8) Obtain a tagged version of the sources from the repository, make
|
||||
final distribution tarballs:
|
||||
#####################################################################
|
||||
# 14: Sync RELEASE changes back to trunk.
|
||||
|
||||
# Work-in-progress
|
||||
|
||||
#####################################################################
|
||||
# 15: Obtain a tagged version of the sources from the repository, make
|
||||
# final distribution tarballs:
|
||||
|
||||
svn checkout https://svn.code.sf.net/p/brlcad/code/brlcad/tags/rel-$MAJOR-$MINOR-$PATCH brlcad-$MAJOR.$MINOR.$PATCH
|
||||
cd brlcad-$MAJOR.$MINOR.$PATCH-build && mkdir .build && cd .build
|
||||
cmake .. -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release && make distcheck
|
||||
cmake .. -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release && make distcheck-full
|
||||
|
||||
9) Upload the source distributions and release notes. Use source
|
||||
tarballs to create binaries. Use the NAMING A BINARY RELEASE section
|
||||
above to name them.
|
||||
#####################################################################
|
||||
# 16: Upload the source distributions and release notes. Use source
|
||||
# tarballs to create binaries.
|
||||
|
||||
# create a shell session and source dir
|
||||
SFUSERNAME=`ls ~/.subversion/auth/svn.simple/* | xargs -n 1 grep -A4 sourceforge | tail -1`
|
||||
@@ -1344,17 +1407,21 @@ above to name them.
|
||||
cat README-$MAJOR-$MINOR-$PATCH.txt && echo "==="
|
||||
scp README-$MAJOR-$MINOR-$PATCH.txt "$SFUSERNAME,brlcad@shell.sf.net:/home/frs/project/b/br/brlcad/BRL-CAD\ Source/$MAJOR.$MINOR.$PATCH/."
|
||||
|
||||
# upload release notes to binary dirs (as needed)
|
||||
# NON-AUTO: Following the NAMING A BINARY RELEASE convention,
|
||||
# upload any release binaries and platform-specific release notes.
|
||||
|
||||
scp README-$MAJOR-$MINOR-$PATCH.txt "$SFUSERNAME,brlcad@shell.sf.net:/home/frs/project/b/br/brlcad/BRL-CAD\ Runtime\ Libraries/$MAJOR.$MINOR.$PATCH/."
|
||||
scp README-$MAJOR-$MINOR-$PATCH.txt "$SFUSERNAME,brlcad@shell.sf.net:/home/frs/project/b/br/brlcad/BRL-CAD\ for\ BSD/$MAJOR.$MINOR.$PATCH/."
|
||||
scp README-$MAJOR-$MINOR-$PATCH.txt "$SFUSERNAME,brlcad@shell.sf.net:/home/frs/project/b/br/brlcad/BRL-CAD\ for\ Linux/$MAJOR.$MINOR.$PATCH/."
|
||||
scp README-$MAJOR-$MINOR-$PATCH.txt "$SFUSERNAME,brlcad@shell.sf.net:/home/frs/project/b/br/brlcad/BRL-CAD\ for\ Mac\ OS\ X/$MAJOR.$MINOR.$PATCH/."
|
||||
scp README-$MAJOR-$MINOR-$PATCH.txt "$SFUSERNAME,brlcad@shell.sf.net:/home/frs/project/b/br/brlcad/BRL-CAD\ for\ Windows/$MAJOR.$MINOR.$PATCH/."
|
||||
|
||||
# be sure to mark binaries as default download, then close shell session
|
||||
# NON-AUTO: Be sure to mark binaries as default download, then
|
||||
# close shell session
|
||||
ssh -v $SFUSERNAME,brlcad@shell.sf.net shutdown
|
||||
|
||||
10) Notify binary platform maintainers:
|
||||
#####################################################################
|
||||
# 17: Notify binary platform maintainers:
|
||||
|
||||
T2 package maintainer
|
||||
http://t2-project.org/packages/brlcad.html
|
||||
@@ -1377,7 +1444,8 @@ above to name them.
|
||||
Slackware maintainer
|
||||
http://slackbuilds.org/result/?search=brlcad
|
||||
|
||||
11) Announce the new release.
|
||||
#####################################################################
|
||||
# 18: Announce the new release.
|
||||
|
||||
The NEWS file should generally be used as a basis for making release
|
||||
announcements though the announcements almost always require
|
||||
@@ -1463,37 +1531,10 @@ Multiple platform major release and announcements:
|
||||
http://cadcam-insider.com/index.php/News-submission-guidelines.html
|
||||
copyboy@cadcam-insider.com
|
||||
|
||||
12) Sit back and enjoy a beverage for a job well done.
|
||||
#####################################################################
|
||||
# 19: Sit back and enjoy a beverage for a job well done.
|
||||
|
||||
|
||||
PATCHING A RELEASE
|
||||
------------------
|
||||
|
||||
Should it become necessary to patch a release that has already been
|
||||
posted and announced, the mechanism is to post patch files for the
|
||||
source release and update the uploaded release notes README file.
|
||||
|
||||
Example: stop_rt_crashing-0.patch and fix_fbserv-1.patch
|
||||
|
||||
It's expected that all patch files are independent and will be applied
|
||||
sequentially. They should be consistently and incrementally numbered.
|
||||
Users should be instructed in the release notes README to download and
|
||||
apply all available patch files.
|
||||
|
||||
For binary releases, it's recommended to just "move on" and let issues
|
||||
become resolved in the next release unless there's a critical security
|
||||
or significant data corruption issue involved. If it becomes
|
||||
necessary to repost a release, use the RELEASE_COUNT file name
|
||||
convention described in VERSION NUMBERS & COMPATIBILITY.
|
||||
|
||||
Example: BRL-CAD-7.12.2.dmg is superseded by BRL-CAD-7.12.2-1.dmg
|
||||
|
||||
Patched binary releases may be moved to the hidden attic folder if
|
||||
critical, though not necessary or recommended. They are preserved for
|
||||
historic record and should never be deleted once announced. Releases
|
||||
not yet been announced may be updated within two days of being posted
|
||||
without involving a patch.
|
||||
|
||||
|
||||
GETTING HELP
|
||||
------------
|
||||
|
||||
@@ -405,6 +405,28 @@ mode.
|
||||
Aliases: ENABLE_STRICT, ENABLE_STRICT_COMPILE, ENABLE_STRICT_COMPILE_FLAGS
|
||||
|
||||
|
||||
--- ENABLE_POSIX_COMPLIANCE ---
|
||||
|
||||
Build with strict POSIX compliance checking. Defaults to OFF.
|
||||
|
||||
Causes compiler options to be set for strict compliance with the
|
||||
minimum C and C++ standards acceptable according to current BRL-CAD
|
||||
policy. The current minimum C standard is POSIX 200112 plus C99.
|
||||
There is no currently defined minimum C++ standard.
|
||||
|
||||
Aliases: ENABLE_POSIX
|
||||
|
||||
|
||||
--- ENABLE_C99_COMPLIANCE ---
|
||||
|
||||
Build with strict C99 compliance checking. Defaults to OFF.
|
||||
|
||||
Causes C compiler options to be set for strict compliance with the C99
|
||||
standard.
|
||||
|
||||
Aliases: ENABLE_C99
|
||||
|
||||
|
||||
--- BRLCAD_EXTRADOCS ---
|
||||
|
||||
The core option that enables and disables building of BRL-CAD's DocBook
|
||||
|
||||
@@ -13,6 +13,9 @@ changes made. See document footer for additional details.
|
||||
--- 2013-0X-XX Release 7.24.2 ---
|
||||
----------------------------------------------------------------------
|
||||
|
||||
* added -depth option to MGED 'search' command - Cliff Yapp
|
||||
* improved 'search' with 'flat' search path modifier - Cliff Yapp
|
||||
* improved 'search' with above/equal/below depth limits - Cliff Yapp
|
||||
* added attribute sorting option to the 'attr' command - Tom Browder
|
||||
* changed 'bwfilter' tool offset option from -o to -O - Mohit Daga
|
||||
* gattributes section 5 man page renamed to attributes - Tom Browder
|
||||
@@ -24,7 +27,7 @@ changes made. See document footer for additional details.
|
||||
* fixed fast4-g importer parsing of blank input lines - Richard Weiss
|
||||
* added -o flag to 'bb' command for oriented bounding box - Cliff Yapp
|
||||
* allow search to see hidden combs with the -a flag - Cliff Yapp
|
||||
* added comb -l option - 'lifts' R flag to top of comb tree - C. Yapp
|
||||
* added comb -l lift option to change region designation - Cliff Yapp
|
||||
* print current grid information in gqa output - Cliff Yapp
|
||||
* added -f option for flattening combs to 'comb' command - Cliff Yapp
|
||||
* added support for boolean op filtering in search - Cliff Yapp
|
||||
|
||||
@@ -18,29 +18,26 @@ tasks as they are completed.
|
||||
THESE TASKS SHOULD HAPPEN BEFORE THE NEXT RELEASE
|
||||
-------------------------------------------------
|
||||
|
||||
* Archer GUI needs to remember the last size of the command
|
||||
window when it is in detached (2 window) mode
|
||||
|
||||
* address the ctest failure of bu_progname_tests (seen on ia64 linux)
|
||||
|
||||
* address the ctest failure of bu_heap_test_1 (seen on ia32 fbsd)
|
||||
|
||||
* heap unit test needs to actually compare performance against system
|
||||
allocation, not just do some work
|
||||
|
||||
* re-do the sh/enumerate.sh script for CMake
|
||||
|
||||
* attempt to replicate the GTK+ ISST interface in TCL
|
||||
|
||||
* provide a viable FindBRLCAD.cmake
|
||||
|
||||
* investigate thread affinity locking on Linux
|
||||
* nada.
|
||||
|
||||
|
||||
THESE TASKS SHOULD HAPPEN WITHIN TWO RELEASE ITERATIONS
|
||||
-------------------------------------------------------
|
||||
|
||||
* fix the bu_sempahore unit test
|
||||
* address the ctest failure of bu_heap_test_1 (seen on ia32 fbsd)
|
||||
|
||||
* investigate thread affinity locking on Linux
|
||||
|
||||
* re-do the sh/enumerate.sh script for CMake
|
||||
|
||||
* heap unit test needs to actually compare performance against system
|
||||
allocation, not just do some work
|
||||
|
||||
* bundle primary rays in rt front end into postage stamps, shoot via
|
||||
rt_shootrays(), modify to pass all rays down through the spatial
|
||||
partitioning simultaneously
|
||||
|
||||
* fix the bu_semaphore unit test
|
||||
|
||||
* fix the bn_poly_sub unit test
|
||||
|
||||
@@ -80,6 +77,46 @@ THESE TASKS SHOULD HAPPEN WITHIN TWO RELEASE ITERATIONS
|
||||
THESE ARE UNSCHEDULED BACKLOG TASKS
|
||||
-----------------------------------
|
||||
|
||||
* 'about' command to display version, contents of various doc files,
|
||||
customizable brlcad.msg file
|
||||
|
||||
* 'align' command taking a from 3d pt and a to 3d pt target.
|
||||
moves/rotates the source object into alignment.
|
||||
|
||||
* Update the comb "region lift" capability to handle automatic duplication
|
||||
and substitution of the duplicate into the tree of combs who can't have
|
||||
their definitions changed without impacting other geometry in the .g file.
|
||||
|
||||
* change 'mirror' command offset to be prior to mirror instead of
|
||||
after, so that you can mirror intuitively over a specified point
|
||||
along a given axis.
|
||||
|
||||
* refactor rt_mirror (src/librt/primitives/mirror.c) into the functab
|
||||
|
||||
* refactor rt_functab accessors to go through an api call or calls so
|
||||
that the array is not accessed directly. either an rt_eval() style
|
||||
interface with data-driven keys to tell it with function(s) to call,
|
||||
or simply have an rt_*() for each function (e.g., rt_mirror(),
|
||||
rt_shot(), rt_describe(), etc.).
|
||||
|
||||
* review proc-db for promotion to src/shapes
|
||||
|
||||
* implement new 'reduce' command to perform model reduction. should
|
||||
perform automatic simplification of geometry to reduce complexity by
|
||||
(potentially) orders of magnitude. this is level of detail for
|
||||
non-viewing purposes, for export. possibly automatable by replacing
|
||||
leave-node geometry with bounding box (arb8s), but collapsing and
|
||||
combining up the hierarchy to a prescribed tree depth. however, it
|
||||
model includes BoTs/NURBS, more advanced spatial logic will be
|
||||
needed.
|
||||
|
||||
* provide a viable FindBRLCAD.cmake
|
||||
|
||||
* replicate the GTK+ ISST interface in TCL
|
||||
|
||||
* Archer GUI needs to remember the last size of the command
|
||||
window when it is in detached (2 window) mode
|
||||
|
||||
* fix nurbs_ssi and nurbs_tester unit tests
|
||||
|
||||
* get rid of the -P#processors user option (except rt* tools) common
|
||||
@@ -387,14 +424,6 @@ comp.r4 ID 5678 material code 5 LOS 75
|
||||
* vls name wrapping (reversible argv-to-vls, vls-to-argv). look at
|
||||
src/libged/glob.c code, very similar.
|
||||
|
||||
* refactor rt_mirror (src/librt/primitives/mirror.c) into the functab
|
||||
|
||||
* refactor rt_functab accessors to go through an api call or calls so
|
||||
that the array is not accessed directly. either an rt_eval() style
|
||||
interface with data-driven keys to tell it with function(s) to call,
|
||||
or simply have an rt_*() for each function (e.g., rt_mirror(),
|
||||
rt_shot(), rt_describe(), etc.).
|
||||
|
||||
* release dm X get_color() memory
|
||||
|
||||
* update g-xxx_facets to use libgcv
|
||||
|
||||
@@ -66,6 +66,14 @@ do
|
||||
shift;;
|
||||
--disable-strict-compile-flags) options="$options -DBRLCAD_ENABLE_STRICT=OFF";
|
||||
shift;;
|
||||
--enable-posix) options="$options -DENABLE_POSIX_COMPLIANCE=ON";
|
||||
shift;;
|
||||
--disable-posix) options="$options -DENABLE_POSIX_COMPLIANCE=OFF";
|
||||
shift;;
|
||||
--enable-c99) options="$options -DENABLE_C99_COMPLIANCE=ON";
|
||||
shift;;
|
||||
--disable-c99) options="$options -DENABLE_C99_COMPLIANCE=OFF";
|
||||
shift;;
|
||||
--enable-docs) options="$options -DBRLCAD_EXTRADOCS=ON";
|
||||
shift;;
|
||||
--disable-docs) options="$options -DBRLCAD_EXTRADOCS=OFF";
|
||||
|
||||
+1373
-1363
File diff suppressed because it is too large
Load Diff
+6
-2
@@ -219,8 +219,12 @@ ADD_DOC(documentation_mged_old_DATA mged_old)
|
||||
configure_file(pad_file.xml.in ${CMAKE_CURRENT_BINARY_DIR}/pad_file.xml @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pad_file.xml DESTINATION ${DOC_DIR})
|
||||
|
||||
CMAKEFILES(pad_file.xml.in STARTERS)
|
||||
CMAKEFILES(burst)
|
||||
CMAKEFILES(
|
||||
STARTERS
|
||||
burst
|
||||
implicit_constraints.txt
|
||||
pad_file.xml.in
|
||||
)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
|
||||
@@ -457,7 +457,7 @@ should be opened, else 0.</para>
|
||||
|
||||
<programlisting>void view_pixel(struct application *ap);</programlisting>
|
||||
|
||||
<para>Called by worker() after the end of proccessing for each
|
||||
<para>Called by worker() after the end of processing for each
|
||||
pixel.</para>
|
||||
|
||||
<programlisting>void view_end(struct application *ap);</programlisting>
|
||||
@@ -879,7 +879,7 @@ memcpy(wm_hd->wm_mat, trans_matrix, sizeof(mat_t));
|
||||
<listitem>
|
||||
<para><itemizedlist>
|
||||
<listitem>
|
||||
<para>Note: use mk_lcomb/mk_comb for inital creation only!</para>
|
||||
<para>Note: use mk_lcomb/mk_comb for initial creation only!</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>caveat: can use to update boolean tree under special conditions</para>
|
||||
|
||||
@@ -60,16 +60,16 @@
|
||||
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
||||
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:param name="shade.verbatim" select="1"/>
|
||||
|
||||
|
||||
<xsl:attribute-set name="shade.verbatim.style">
|
||||
<xsl:attribute name="border">0.5pt solid blue</xsl:attribute>
|
||||
<xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
|
||||
<xsl:attribute name="padding-top">0.25em</xsl:attribute>
|
||||
<xsl:attribute name="padding-bottom">0.25em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:attribute-set name="monospace.properties">
|
||||
<xsl:attribute name="font-size">8.0pt</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
@@ -60,16 +60,16 @@
|
||||
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
||||
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:param name="shade.verbatim" select="1"/>
|
||||
|
||||
|
||||
<xsl:attribute-set name="shade.verbatim.style">
|
||||
<xsl:attribute name="border">0.5pt solid blue</xsl:attribute>
|
||||
<xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
|
||||
<xsl:attribute name="padding-top">0.25em</xsl:attribute>
|
||||
<xsl:attribute name="padding-bottom">0.25em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:attribute-set name="monospace.properties">
|
||||
<xsl:attribute name="font-size">8.0pt</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
@@ -60,16 +60,16 @@
|
||||
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
||||
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:param name="shade.verbatim" select="1"/>
|
||||
|
||||
|
||||
<xsl:attribute-set name="shade.verbatim.style">
|
||||
<xsl:attribute name="border">0.5pt solid blue</xsl:attribute>
|
||||
<xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
|
||||
<xsl:attribute name="padding-top">0.25em</xsl:attribute>
|
||||
<xsl:attribute name="padding-bottom">0.25em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:attribute-set name="monospace.properties">
|
||||
<xsl:attribute name="font-size">8.0pt</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
@@ -60,16 +60,16 @@
|
||||
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
||||
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:param name="shade.verbatim" select="1"/>
|
||||
|
||||
|
||||
<xsl:attribute-set name="shade.verbatim.style">
|
||||
<xsl:attribute name="border">0.5pt solid blue</xsl:attribute>
|
||||
<xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
|
||||
<xsl:attribute name="padding-top">0.25em</xsl:attribute>
|
||||
<xsl:attribute name="padding-bottom">0.25em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:attribute-set name="monospace.properties">
|
||||
<xsl:attribute name="font-size">8.0pt</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
@@ -60,16 +60,16 @@
|
||||
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
||||
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:param name="shade.verbatim" select="1"/>
|
||||
|
||||
|
||||
<xsl:attribute-set name="shade.verbatim.style">
|
||||
<xsl:attribute name="border">0.5pt solid blue</xsl:attribute>
|
||||
<xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
|
||||
<xsl:attribute name="padding-top">0.25em</xsl:attribute>
|
||||
<xsl:attribute name="padding-bottom">0.25em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:attribute-set name="monospace.properties">
|
||||
<xsl:attribute name="font-size">8.0pt</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
@@ -63,16 +63,16 @@
|
||||
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
||||
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<!-- set verbatim blocks off from normal text -->
|
||||
<xsl:param name="shade.verbatim" select="1"/>
|
||||
|
||||
<xsl:attribute-set name="shade.verbatim.style">
|
||||
<xsl:attribute name="border">0.5pt solid blue</xsl:attribute>
|
||||
<xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
|
||||
<xsl:attribute name="padding-top">0.25em</xsl:attribute>
|
||||
<xsl:attribute name="padding-bottom">0.25em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:attribute-set name="monospace.properties">
|
||||
<xsl:attribute name="font-size">8.0pt</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
@@ -60,16 +60,16 @@
|
||||
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
||||
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:param name="shade.verbatim" select="1"/>
|
||||
|
||||
|
||||
<xsl:attribute-set name="shade.verbatim.style">
|
||||
<xsl:attribute name="border">0.5pt solid blue</xsl:attribute>
|
||||
<xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
|
||||
<xsl:attribute name="padding-top">0.25em</xsl:attribute>
|
||||
<xsl:attribute name="padding-bottom">0.25em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
|
||||
<xsl:attribute-set name="monospace.properties">
|
||||
<xsl:attribute name="font-size">8.0pt</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
</xsl:attribute-set>
|
||||
|
||||
<!-- center table titles, thanks to Dean Nelson <deannelson@aol.com>,
|
||||
2010-11-09, from the docbook-apps mailing list>
|
||||
2010-11-09, from the docbook-apps mailing list>
|
||||
-->
|
||||
<xsl:attribute-set name="formal.title.properties">
|
||||
<xsl:attribute name="text-align">
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<arg choice='opt'>-s <replaceable>squaresize</replaceable></arg>
|
||||
<arg choice='opt'>-w <replaceable>width</replaceable></arg>
|
||||
<arg choice='opt'>-n <replaceable>height</replaceable></arg>
|
||||
</arg>
|
||||
</arg>
|
||||
<arg choice='opt'>-o <replaceable>out.pix</replaceable></arg>
|
||||
<arg choice='opt'><replaceable>in.bw</replaceable></arg>
|
||||
<arg choice='plain'><replaceable>></replaceable></arg>
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<refsynopsisdiv xml:id='synopsis'>
|
||||
<cmdsynopsis>
|
||||
<command>pix-bw</command>
|
||||
<arg choice='opt'>
|
||||
<arg choice='opt'>
|
||||
<arg choice='opt'>-s <replaceable>squaresize</replaceable></arg>
|
||||
<arg choice='opt'>
|
||||
<arg choice='opt'>
|
||||
<arg choice='opt'>-w <replaceable>width</replaceable></arg>
|
||||
<arg choice='opt'>-n <replaceable>height</replaceable></arg></arg></arg>
|
||||
<arg choice='opt'>
|
||||
@@ -44,7 +44,7 @@ file from its standard input
|
||||
and produce a black and white
|
||||
<citerefentry><refentrytitle>bw</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
||||
file on its standard output.
|
||||
By default all three colors are weighted equally.
|
||||
By default all three colors are weighted equally.
|
||||
The
|
||||
<option>-e </option><replaceable>type</replaceable>
|
||||
flag can be used to specify a standard weighting scheme</para>
|
||||
@@ -56,7 +56,7 @@ choices include:</para>
|
||||
<varlistentry>
|
||||
<term><emphasis remap='B'>ntsc</emphasis></term>
|
||||
<listitem>
|
||||
<para> weighting used is based on the NTSC primaries and the
|
||||
<para> weighting used is based on the NTSC primaries and the
|
||||
D6500 alignment white.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -79,7 +79,7 @@ the value will be treated as a weight
|
||||
to be applied to that color.
|
||||
</para>
|
||||
<para>
|
||||
If 0 is supplied by the user for weights, then the weights assigned
|
||||
If 0 is supplied by the user for weights, then the weights assigned
|
||||
are 1.0 divided by the number of colors selected.</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ set(docbook_man3_EN
|
||||
libplot3.xml
|
||||
librt.xml
|
||||
libwdb.xml
|
||||
popt.xml
|
||||
redblack.xml
|
||||
)
|
||||
|
||||
|
||||
@@ -1,954 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!-- the original file had an entity '\' which is the backslash; it was
|
||||
replaced by the equivalent unicode character reference '\'
|
||||
-->
|
||||
<!-- lifted from man+troff by doclifter -->
|
||||
<refentry xmlns='http://docbook.org/ns/docbook' version='5.0' xml:lang='en' xml:id='popt3'>
|
||||
<refmeta>
|
||||
<refentrytitle>POPT</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo class='source'>June 30, 1998</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>popt</refname>
|
||||
<refpurpose>Parse command line options</refpurpose>
|
||||
</refnamediv>
|
||||
<!-- body begins here -->
|
||||
<refsynopsisdiv xml:id='synopsis'>
|
||||
<funcsynopsis>
|
||||
<funcsynopsisinfo>
|
||||
#include <popt.h>
|
||||
|
||||
</funcsynopsisinfo>
|
||||
<funcprototype>
|
||||
<funcdef>poptContext <function>poptGetContext</function></funcdef>
|
||||
<paramdef>const char * <parameter>name</parameter></paramdef>
|
||||
<paramdef>int <parameter>argc</parameter></paramdef>
|
||||
<paramdef>const char ** <parameter>argv</parameter></paramdef>
|
||||
<paramdef>const struct poptOption * <parameter>options</parameter></paramdef>
|
||||
<paramdef>int <parameter>flags</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>void <function>poptFreeContext</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>void <function>poptResetContext</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>poptGetNextOpt</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>const char *<function>poptGetOptArg</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>const char *<function>poptGetArg</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>const char *<function>poptPeekArg</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>const char **<function>poptGetArgs</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>const char *const <function>poptStrerror</function></funcdef>
|
||||
<paramdef>const int <parameter>error</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>const char *<function>poptBadOption</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
<paramdef>int <parameter>flags</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>poptReadDefaultConfig</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
<paramdef>int <parameter>flags</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>poptReadConfigFile</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
<paramdef>char * <parameter>fn</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>poptAddAlias</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
<paramdef>struct poptAlias <parameter>alias</parameter></paramdef>
|
||||
<paramdef>int <parameter>flags</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>poptParseArgvString</function></funcdef>
|
||||
<paramdef>char * <parameter>s</parameter></paramdef>
|
||||
<paramdef>int * <parameter>argcPtr</parameter></paramdef>
|
||||
<paramdef>const char *** <parameter>argvPtr</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>poptDupArgv</function></funcdef>
|
||||
<paramdef>int <parameter>argc</parameter></paramdef>
|
||||
<paramdef>const char ** <parameter>argv</parameter></paramdef>
|
||||
<paramdef>int * <parameter>argcPtr</parameter></paramdef>
|
||||
<paramdef>const char *** <parameter>argvPtr</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>poptStuffArgs</function></funcdef>
|
||||
<paramdef>poptContext <parameter>con</parameter></paramdef>
|
||||
<paramdef>const char ** <parameter>argv</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
||||
<refsect1 xml:id='description'><title>DESCRIPTION</title>
|
||||
<para>The popt library exists essentially for parsing command-line
|
||||
options. It is found superior in many ways when compared to
|
||||
parsing the argv array by hand or using the getopt functions
|
||||
<function>getopt()</function>
|
||||
and
|
||||
<function>getopt_long()</function>
|
||||
[see
|
||||
<citerefentry><refentrytitle>getopt</refentrytitle><manvolnum>3</manvolnum></citerefentry>].
|
||||
Some specific advantages of popt are: it does not utilize global
|
||||
variables, thus enabling multiple passes in parsing <varname role='parameter'>argv</varname>
|
||||
; it can parse an arbitrary array of <varname role='parameter'>argv</varname>-style elements,
|
||||
allowing parsing of command-line-strings from any source;
|
||||
it provides a standard method of option aliasing (to be
|
||||
discussed at length below.); it can exec external option filters; and,
|
||||
finally, it can automatically generate help and usage messages for
|
||||
the application.</para>
|
||||
|
||||
<para>Like
|
||||
<function>getopt_long()</function>,
|
||||
the popt library supports short and long style options. Recall
|
||||
that a
|
||||
<emphasis remap='B'>short option</emphasis>
|
||||
consists of a - character followed by a single alphanumeric character.
|
||||
A
|
||||
<emphasis remap='B'>long option</emphasis>,
|
||||
common in GNU utilities, consists of two - characters followed by a
|
||||
string made up of letters, numbers and hyphens. Long options are
|
||||
optionally allowed to begin with a single -, primarily to allow command-line
|
||||
compatibility between popt applications and X toolkit applications.
|
||||
Either type of option may be followed by an argument. A space separates a
|
||||
short option from its arguments; either a space or an = separates a long
|
||||
option from an argument.</para>
|
||||
|
||||
<para>The popt library is highly portable and should work on any POSIX
|
||||
platform. The latest version is distributed with rpm and is always available
|
||||
from: ftp://ftp.rpm.org/pub/rpm/dist.</para>
|
||||
|
||||
<para>It may be redistributed under the X consortium license, see the file COPYING
|
||||
in the popt source distribution for details.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 xml:id='basic_popt_usage'><title>BASIC POPT USAGE</title>
|
||||
|
||||
<refsect2 xml:id='x1_the_option_table'><title>1. THE OPTION TABLE</title>
|
||||
<para>Applications provide popt with information on their command-line
|
||||
options by means of an "option table," i.e., an array of
|
||||
<emphasis remap='B'>struct poptOption</emphasis>
|
||||
structures:</para>
|
||||
|
||||
<para>#include <popt.h></para>
|
||||
|
||||
<programlisting remap='.nf'>
|
||||
struct poptOption {
|
||||
const char * longName; /* may be NULL */
|
||||
char shortName; /* may be '\0' */
|
||||
int argInfo;
|
||||
void * arg; /* depends on argInfo */
|
||||
int val; /* 0 means don't return, just update flag */
|
||||
char * descrip; /* description for autohelp -- may be NULL */
|
||||
char * argDescrip; /* argument description for autohelp */
|
||||
};
|
||||
</programlisting> <!-- .fi -->
|
||||
|
||||
<para>Each member of the table defines a single option that may be
|
||||
passed to the program. Long and short options are considered
|
||||
a single option that may occur in two different forms. The
|
||||
first two members,
|
||||
<emphasis remap='I'>longName</emphasis> and <emphasis remap='I'>shortName</emphasis>, define the names of the option;
|
||||
the first is a long name, while the latter is a single character.</para>
|
||||
|
||||
<para>The
|
||||
<emphasis remap='I'>argInfo</emphasis> member tells popt what type of argument is expected
|
||||
after the option. If no argument is expected,
|
||||
<emphasis remap='B'>POPT_ARG_NONE</emphasis>
|
||||
should be used.
|
||||
The rest of the valid values are shown in the following table:</para>
|
||||
|
||||
<informaltable pgwide='0' frame='none'>
|
||||
<tgroup cols='3' align='center'>
|
||||
<colspec colname='c1'/>
|
||||
<colspec colname='c2'/>
|
||||
<colspec colname='c3'/>
|
||||
<thead>
|
||||
<row>
|
||||
<entry align='left'>Value</entry>
|
||||
<entry align='left'>Description</entry>
|
||||
<entry align='left'>arg Type</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align='left'>POPT_ARG_NONE</entry>
|
||||
<entry align='left'>No argument expected</entry>
|
||||
<entry align='left'>int</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align='left'>POPT_ARG_STRING</entry>
|
||||
<entry align='left'>No type checking to be performed</entry>
|
||||
<entry align='left'>char *</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align='left'>POPT_ARG_ARGV</entry>
|
||||
<entry align='left'>No type checking to be performed</entry>
|
||||
<entry align='left'>char **</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align='left'>POPT_ARG_SHORT</entry>
|
||||
<entry align='left'>An short argument is expected</entry>
|
||||
<entry align='left'>short</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align='left'>POPT_ARG_INT</entry>
|
||||
<entry align='left'>An integer argument is expected</entry>
|
||||
<entry align='left'>int</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align='left'>POPT_ARG_LONG</entry>
|
||||
<entry align='left'>A long integer is expected</entry>
|
||||
<entry align='left'>long</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align='left'>POPT_ARG_LONGLONG</entry>
|
||||
<entry align='left'>A long long integer is expected</entry>
|
||||
<entry align='left'>long long</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align='left'>POPT_ARG_VAL</entry>
|
||||
<entry align='left'>Integer value taken from <emphasis remap='CW'>val</emphasis></entry>
|
||||
<entry align='left'>int</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align='left'>POPT_ARG_FLOAT</entry>
|
||||
<entry align='left'>An float argument is expected</entry>
|
||||
<entry align='left'>float</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align='left'>POPT_ARG_DOUBLE</entry>
|
||||
<entry align='left'>A double argument is expected</entry>
|
||||
<entry align='left'>double</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
||||
|
||||
|
||||
<para>For numeric values, if the <emphasis remap='I'>argInfo</emphasis> value is bitwise or'd with one of
|
||||
<emphasis remap='B'>POPT_ARGFLAG_OR</emphasis>, <emphasis remap='B'>POPT_ARGFLAG_AND</emphasis>, or <emphasis remap='B'>POPT_ARGFLAG_XOR</emphasis>,
|
||||
the value is saved by performing an OR, AND, or XOR.
|
||||
If the <emphasis remap='I'>argInfo</emphasis> value is bitwise or'd with <emphasis remap='B'>POPT_ARGFLAG_NOT</emphasis>,
|
||||
the value will be negated before saving. For the common operations of
|
||||
setting and/or clearing bits, <emphasis remap='B'>POPT_BIT_SET</emphasis> and <emphasis remap='B'>POPT_BIT_CLR</emphasis>
|
||||
have the appropriate flags set to perform bit operations.</para>
|
||||
|
||||
<para>If the <emphasis remap='I'>argInfo</emphasis> value is bitwise or'd with <emphasis remap='B'>POPT_ARGFLAG_ONEDASH</emphasis>,
|
||||
the long argument may be given with a single - instead of two. For example,
|
||||
if <option>--longopt</option> is an option with <emphasis remap='B'>POPT_ARGFLAG_ONEDASH</emphasis>, is
|
||||
specified, <option>-longopt</option> is accepted as well.</para>
|
||||
|
||||
<para>The next element, <emphasis remap='I'>arg</emphasis>, allows popt to automatically update
|
||||
program variables when the option is used. If <emphasis remap='I'>arg</emphasis> is
|
||||
<emphasis remap='B'>NULL</emphasis>, it is ignored and popt takes no special action.
|
||||
Otherwise it should point to a variable of the type indicated in the
|
||||
right-most column of the table above. A <emphasis remap='B'>POPT_ARG_ARGV</emphasis> arg will
|
||||
(re-)allocate an array of char * string pointers, append the string argument, and add a
|
||||
<emphasis remap='B'>NULL</emphasis> sentinel at the end of the array as needed.
|
||||
The target char ** address of a <emphasis remap='B'>POPT_ARG_ARGV</emphasis> arg should be initialized to <emphasis remap='B'>NULL</emphasis>.</para>
|
||||
|
||||
<para>If the option takes no argument (<emphasis remap='I'>argInfo</emphasis> is
|
||||
<emphasis remap='B'>POPT_ARG_NONE</emphasis>), the variable pointed to by
|
||||
<emphasis remap='I'>arg</emphasis> is set to 1 when the option is used. (Incidentally, it
|
||||
will perhaps not escape the attention of hunt-and-peck typists that
|
||||
the value of <emphasis remap='B'>POPT_ARG_NONE</emphasis> is 0.) If the option does take
|
||||
an argument, the variable that
|
||||
<emphasis remap='I'>arg</emphasis> points to is updated to reflect the value of the argument.
|
||||
Any string is acceptable for <emphasis remap='B'>POPT_ARG_STRING</emphasis> and <emphasis remap='B'>POPT_ARG_ARGV</emphasis> arguments, but
|
||||
<emphasis remap='B'>POPT_ARG_INT</emphasis>, <emphasis remap='B'>POPT_ARG_SHORT</emphasis>, <emphasis remap='B'>POPT_ARG_LONG</emphasis>, <emphasis remap='B'>POPT_ARG_LONGLONG</emphasis>, <emphasis remap='B'>POPT_ARG_FLOAT</emphasis>, and
|
||||
<emphasis remap='B'>POPT_ARG_DOUBLE</emphasis> are converted to the appropriate type, and an
|
||||
error returned if the conversion fails.</para>
|
||||
|
||||
<para><emphasis remap='B'>POPT_ARG_VAL</emphasis> causes <emphasis remap='I'>arg</emphasis> to be set to the (integer) value of
|
||||
<emphasis remap='I'>val</emphasis> when the argument is found. This is most often useful for
|
||||
mutually-exclusive arguments in cases where it is not an error for
|
||||
multiple arguments to occur and where you want the last argument
|
||||
specified to win; for example, "rm -i -f". <emphasis remap='B'>POPT_ARG_VAL</emphasis> causes
|
||||
the parsing function not to return a value, since the value of <emphasis remap='I'>val</emphasis>
|
||||
has already been used.</para>
|
||||
|
||||
<para>If the <emphasis remap='I'>argInfo</emphasis> value is bitwise or'd with <emphasis remap='B'>POPT_ARGFLAG_OPTIONAL</emphasis>,
|
||||
the argument to the long option may be omitted. If the long option
|
||||
is used without an argument, a default value of zero or NULL will be saved
|
||||
(if the arg pointer is present), otherwise behavior will be identical to
|
||||
a long option with argument.</para>
|
||||
|
||||
<para>The next option, <emphasis remap='I'>val</emphasis>, is the value popt's parsing function
|
||||
should return when the option is encountered. If it is 0, the parsing
|
||||
function does not return a value, instead parsing the next
|
||||
command-line argument.</para>
|
||||
|
||||
<para>The last two options, <emphasis remap='I'>descrip</emphasis> and <emphasis remap='I'>argDescrip</emphasis> are only required
|
||||
if automatic help messages are desired (automatic usage messages can
|
||||
be generated without them). <emphasis remap='I'>descrip</emphasis> is a text description of the
|
||||
argument and <emphasis remap='I'>argdescrip</emphasis> is a short summary of the type of arguments
|
||||
the option expects, or NULL if the option doesn't require any
|
||||
arguments.</para>
|
||||
|
||||
<para>If popt should automatically provide <option>--usage</option> and <option>--help</option> (<option>-?</option>)
|
||||
options, one line in the table should be the macro <emphasis remap='B'>POPT_AUTOHELP</emphasis>.
|
||||
This macro includes another option table (via <emphasis remap='B'>POPT_ARG_INCLUDE_TABLE</emphasis>
|
||||
; see below) in the main one which provides the table entries for these
|
||||
arguments. When <option>--usage</option> or <option>--help</option> are passed to programs which
|
||||
use popt's automatical help, popt displays the appropriate message on
|
||||
stderr as soon as it finds the option, and exits the program with a
|
||||
return code of 0. If you want to use popt's automatic help generation in
|
||||
a different way, you need to explicitly add the option entries to your programs
|
||||
option table instead of using <emphasis remap='B'>POPT_AUTOHELP</emphasis>.</para>
|
||||
|
||||
<para>If the <emphasis remap='I'>argInfo</emphasis> value is bitwise or'd with <emphasis remap='B'>POPT_ARGFLAG_DOC_HIDDEN</emphasis>,
|
||||
the argument will not be shown in help output.</para>
|
||||
|
||||
<para>If the <emphasis remap='I'>argInfo</emphasis> value is bitwise or'd with <emphasis remap='B'>POPT_ARGFLAG_SHOW_DEFAULT</emphasis>,
|
||||
the inital value of the arg will be shown in help output.</para>
|
||||
|
||||
<para>The final structure in the table should have all the pointer values set
|
||||
to <emphasis remap='B'>NULL</emphasis> and all the arithmetic values set to 0, marking the
|
||||
end of the table. The macro <emphasis remap='B'>POPT_TABLEEND</emphasis> is provided to do that.</para>
|
||||
|
||||
<para>There are two types of option table entries which do not specify command
|
||||
line options. When either of these types of entries are used, the
|
||||
<emphasis remap='I'>longName</emphasis> element must be <emphasis remap='B'>NULL</emphasis> and the <emphasis remap='B'>shortName</emphasis> element
|
||||
must be <emphasis remap='B'>'\0'</emphasis>.</para>
|
||||
|
||||
<para>The first of these special entry types allows the application to nest
|
||||
another option table in the current one; such nesting may extend quite
|
||||
deeply (the actual depth is limited by the program's stack). Including
|
||||
other option tables allows a library to provide a standard set of
|
||||
command-line options to every program which uses it (this is often done
|
||||
in graphical programming toolkits, for example). To do this, set
|
||||
the <emphasis remap='I'>argInfo</emphasis> field to <emphasis remap='B'>POPT_ARG_INCLUDE_TABLE</emphasis> and the
|
||||
arg field to point to the table which is being included. If
|
||||
automatic help generation is being used, the <emphasis remap='I'>descrip</emphasis> field should
|
||||
contain a overall description of the option table being included.</para>
|
||||
|
||||
<para>The other special option table entry type tells popt to call a function (a
|
||||
callback) when any option in that table is found. This is especially usefull
|
||||
when included option tables are being used, as the program which provides
|
||||
the top-level option table doesn't need to be aware of the other options
|
||||
which are provided by the included table. When a callback is set for
|
||||
a table, the parsing function never returns information on an option in
|
||||
the table. Instead, options information must be retained via the callback
|
||||
or by having popt set a variable through the option's <emphasis remap='I'>arg</emphasis> field.
|
||||
Option callbacks should match the following prototype:</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>void poptCallbackType(poptContext con, </emphasis>
|
||||
<emphasis remap='B'> const struct poptOption * opt, </emphasis>
|
||||
<emphasis remap='B'> const char * arg, void * data);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
|
||||
<para>The first parameter is the context which is being parsed (see the next
|
||||
section for information on contexts), <emphasis remap='I'>opt</emphasis> points to the option
|
||||
which triggered this callback, and <emphasis remap='I'>arg</emphasis> is the option's argument.
|
||||
If the option does not take an argument, <emphasis remap='I'>arg</emphasis> is <emphasis remap='B'>NULL</emphasis>. The
|
||||
final parameter, <emphasis remap='I'>data</emphasis> is taken from the <emphasis remap='I'>descrip</emphasis> field
|
||||
of the option table entry which defined the callback. As <emphasis remap='I'>descrip</emphasis>
|
||||
is a pointer, this allows callback functions to be passed an arbitrary
|
||||
set of data (though a typecast will have to be used).</para>
|
||||
|
||||
<para>The option table entry which defines a callback has an <emphasis remap='I'>argInfo</emphasis> of
|
||||
<emphasis remap='B'>POPT_ARG_CALLBACK</emphasis>, an <emphasis remap='I'>arg</emphasis> which points to the callback
|
||||
function, and a <emphasis remap='I'>descrip</emphasis> field which specifies an arbitrary pointer
|
||||
to be passed to the callback.</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 xml:id='x2_creating_a_context'><title>2. CREATING A CONTEXT</title>
|
||||
<para>popt can interleave the parsing of multiple command-line sets. It allows
|
||||
this by keeping all the state information for a particular set of
|
||||
command-line arguments in a
|
||||
<type>poptContext</type> data structure, an opaque type that should not be
|
||||
modified outside the popt library.</para>
|
||||
|
||||
<para>New popt contexts are created by <emphasis remap='B'>poptGetContext()</emphasis>:</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>poptContext poptGetContext(const char * </emphasis><varname role='parameter'>name</varname><emphasis remap='B'>, int </emphasis><varname role='parameter'>argc</varname><emphasis remap='B'>,</emphasis>
|
||||
<emphasis remap='B'> const char ** </emphasis><varname role='parameter'>argv</varname><emphasis remap='B'>,</emphasis>
|
||||
<emphasis remap='B'> const struct poptOption * </emphasis><varname role='parameter'>options</varname><emphasis remap='B'>,</emphasis>
|
||||
<emphasis remap='B'> int </emphasis><varname role='parameter'>flags</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
|
||||
<para>The first parameter,
|
||||
<varname role='parameter'>name</varname>, is used only for alias handling (discussed later). It
|
||||
should be the name of the application whose options are being parsed,
|
||||
or should be <emphasis remap='B'>NULL</emphasis> if no option aliasing is desired. The next
|
||||
two arguments specify the command-line arguments to parse. These are
|
||||
generally passed to <emphasis remap='B'>poptGetContext()</emphasis> exactly as they were
|
||||
passed to the program's <function>main()</function> function. The
|
||||
<varname role='parameter'>options</varname> parameter points to the table of command-line options,
|
||||
which was described in the previous section. The final parameter,
|
||||
<varname role='parameter'>flags</varname>,
|
||||
can take one of three values:</para>
|
||||
<!-- br -->
|
||||
|
||||
<informaltable pgwide='0' frame='none'>
|
||||
<tgroup cols='2' align='center'>
|
||||
<colspec colname='c1'/>
|
||||
<colspec colname='c2'/>
|
||||
<thead>
|
||||
<row>
|
||||
<entry align='left'>Value</entry>
|
||||
<entry align='left'>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align='left'>POPT_CONTEXT_NO_EXEC</entry>
|
||||
<entry align='left'>Ignore exec expansions</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align='left'>POPT_CONTEXT_KEEP_FIRST</entry>
|
||||
<entry align='left'>Do not ignore argv[0]</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align='left'>POPT_CONTEXT_POSIXMEHARDER</entry>
|
||||
<entry align='left'>Options cannot follow arguments</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
||||
|
||||
|
||||
<para>A <type>poptContext</type> keeps track of which options have already been
|
||||
parsed and which remain, among other things. If a program wishes to
|
||||
restart option processing of a set of arguments, it can reset the
|
||||
<type>poptContext</type> by passing the context as the sole argument to
|
||||
<emphasis remap='B'>poptResetContext()</emphasis>.</para>
|
||||
|
||||
<para>When argument processing is complete, the process should free the
|
||||
<type>poptContext</type> as it contains dynamically allocated components. The
|
||||
<emphasis remap='B'>poptFreeContext()</emphasis> function takes a
|
||||
<type>poptContext</type> as its sole argument and frees the resources the
|
||||
context is using.</para>
|
||||
|
||||
<para>Here are the prototypes of both <emphasis remap='B'>poptResetContext()</emphasis> and
|
||||
<emphasis remap='B'>poptFreeContext()</emphasis>:</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>#include <popt.h></emphasis>
|
||||
<emphasis remap='B'>void poptFreeContext(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>);</emphasis>
|
||||
<emphasis remap='B'>void poptResetContext(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
|
||||
</refsect2>
|
||||
|
||||
<refsect2 xml:id='x3_parsing_the_command_line'><title>3. PARSING THE COMMAND LINE</title>
|
||||
<para>After an application has created a <type>poptContext</type>, it may begin
|
||||
parsing arguments. <emphasis remap='B'>poptGetNextOpt()</emphasis> performs the actual
|
||||
argument parsing.</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>#include <popt.h></emphasis>
|
||||
<emphasis remap='B'>int poptGetNextOpt(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
|
||||
<para>Taking the context as its sole argument, this function parses the next
|
||||
command-line argument found. After finding the next argument in the
|
||||
option table, the function fills in the object pointed to by the option
|
||||
table entry's <emphasis remap='I'>arg</emphasis>
|
||||
pointer if it is not <emphasis remap='B'>NULL</emphasis>. If the val entry for the option is
|
||||
non-0, the function then returns that value. Otherwise,
|
||||
<emphasis remap='B'>poptGetNextOpt()</emphasis> continues on to the next argument.</para>
|
||||
|
||||
<para><emphasis remap='B'>poptGetNextOpt()</emphasis> returns -1 when the final argument has been
|
||||
parsed, and other negative values when errors occur. This makes it a
|
||||
good idea to
|
||||
keep the <emphasis remap='I'>val</emphasis> elements in the options table greater than 0.</para>
|
||||
|
||||
<para>If all of the command-line options are handled through <emphasis remap='I'>arg</emphasis>
|
||||
pointers, command-line parsing is reduced to the following line of code:</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
rc = poptGetNextOpt(poptcon);
|
||||
</literallayout> <!-- .fi -->
|
||||
|
||||
<para>Many applications require more complex command-line parsing than this,
|
||||
however, and use the following structure:</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
while ((rc = poptGetNextOpt(poptcon)) > 0) {
|
||||
switch (rc) {
|
||||
/* specific arguments are handled here */
|
||||
}
|
||||
}
|
||||
</literallayout> <!-- .fi -->
|
||||
|
||||
<para>When returned options are handled, the application needs to know the
|
||||
value of any arguments that were specified after the option. There are two
|
||||
ways to discover them. One is to ask popt to fill in a variable with the
|
||||
value of the option through the option table's <emphasis remap='I'>arg</emphasis> elements. The
|
||||
other is to use <emphasis remap='B'>poptGetOptArg()</emphasis>:</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>#include <popt.h></emphasis>
|
||||
<emphasis remap='B'>char * poptGetOptArg(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
|
||||
<para>This function returns the argument given for the final option returned by
|
||||
<emphasis remap='B'>poptGetNextOpt()</emphasis>, or it returns <emphasis remap='B'>NULL</emphasis> if no argument was specified.
|
||||
The calling function is responsible for deallocating this string.</para>
|
||||
|
||||
</refsect2>
|
||||
|
||||
<refsect2 xml:id='x4_leftover_arguments'><title>4. LEFTOVER ARGUMENTS</title>
|
||||
<para>Many applications take an arbitrary number of command-line arguments,
|
||||
such as a list of file names. When popt encounters an argument that does
|
||||
not begin with a -, it assumes it is such an argument and adds it to a list
|
||||
of leftover arguments. Three functions allow applications to access such
|
||||
arguments:</para>
|
||||
<para><emphasis remap='B'>const char * poptGetArg(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>);</emphasis>
|
||||
This function returns the next leftover argument and marks it as
|
||||
processed.</para>
|
||||
|
||||
<para><emphasis remap='B'>const char * poptPeekArg(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>);</emphasis>
|
||||
The next leftover argument is returned but not marked as processed.
|
||||
This allows an application to look ahead into the argument list,
|
||||
without modifying the list.</para>
|
||||
|
||||
<para><emphasis remap='B'>const char ** poptGetArgs(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>);</emphasis>
|
||||
All the leftover arguments are returned in a manner identical to
|
||||
<varname role='parameter'>argv</varname>. The final element in the returned array points to
|
||||
<emphasis remap='B'>NULL</emphasis>, indicating the end of the arguments.</para>
|
||||
|
||||
</refsect2>
|
||||
|
||||
<refsect2 xml:id='x5_automatic_help_messages'><title>5. AUTOMATIC HELP MESSAGES</title>
|
||||
<para>The <emphasis remap='B'>popt</emphasis> library can automatically generate help messages which
|
||||
describe the options a program accepts. There are two types of help
|
||||
messages which can be generated. Usage messages are a short messages
|
||||
which lists valid options, but does not describe them. Help messages
|
||||
describe each option on one (or more) lines, resulting in a longer, but
|
||||
more useful, message. Whenever automatic help messages are used, the
|
||||
<emphasis remap='B'>descrip</emphasis> and <emphasis remap='B'>argDescrip</emphasis> fields <emphasis remap='B'>struct poptOption</emphasis> members
|
||||
should be filled in for each option.</para>
|
||||
|
||||
<para>The <emphasis remap='B'>POPT_AUTOHELP</emphasis> macro makes it easy to add <option>--usage</option> and
|
||||
<option>--help</option> messages to your program, and is described in part 1
|
||||
of this man page. If more control is needed over your help messages,
|
||||
the following two functions are available:</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>#include <popt.h></emphasis>
|
||||
<emphasis remap='B'>void poptPrintHelp(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>, FILE * </emphasis><emphasis remap='I'>f</emphasis><emphasis remap='B'>, int </emphasis><varname role='parameter'>flags</varname><emphasis remap='B'>);</emphasis>
|
||||
<emphasis remap='B'>void poptPrintUsage(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>, FILE * </emphasis><emphasis remap='I'>f</emphasis><emphasis remap='B'>, int </emphasis><varname role='parameter'>flags</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
|
||||
<para><emphasis remap='B'>poptPrintHelp()</emphasis> displays the standard help message to the stdio file
|
||||
descriptor f, while <emphasis remap='B'>poptPrintUsage()</emphasis> displays the shorter usage
|
||||
message. Both functions currently ignore the <varname role='parameter'>flags</varname> argument; it is
|
||||
there to allow future changes.</para>
|
||||
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 xml:id='error_handling'><title>ERROR HANDLING</title>
|
||||
<para>All of the popt functions that can return errors return integers.
|
||||
When an error occurs, a negative error code is returned. The
|
||||
following table summarizes the error codes that occur:</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'> Error Description</emphasis>
|
||||
<emphasis remap='B'>POPT_ERROR_NOARG </emphasis>Argument missing for an option.
|
||||
<emphasis remap='B'>POPT_ERROR_BADOPT </emphasis>Option's argument couldn't be parsed.
|
||||
<emphasis remap='B'>POPT_ERROR_OPTSTOODEEP </emphasis>Option aliasing nested too deeply.
|
||||
<emphasis remap='B'>POPT_ERROR_BADQUOTE </emphasis>Quotations do not match.
|
||||
<emphasis remap='B'>POPT_ERROR_BADNUMBER </emphasis>Option couldn't be converted to number.
|
||||
<emphasis remap='B'>POPT_ERROR_OVERFLOW </emphasis>A given number was too big or small.
|
||||
</literallayout> <!-- .fi -->
|
||||
|
||||
<para>Here is a more detailed discussion of each error:</para>
|
||||
|
||||
<variablelist remap='TP'>
|
||||
<varlistentry>
|
||||
<term><emphasis remap='B'>POPT_ERROR_NOARG</emphasis></term>
|
||||
<listitem>
|
||||
<para>An option that requires an argument was specified on the command
|
||||
line, but no argument was given. This can be returned only by
|
||||
<emphasis remap='B'>poptGetNextOpt()</emphasis>.</para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis remap='B'>POPT_ERROR_BADOPT</emphasis></term>
|
||||
<listitem>
|
||||
<para>An option was specified in <varname role='parameter'>argv</varname> but is not in the option
|
||||
table. This error can be returned only from <emphasis remap='B'>poptGetNextOpt()</emphasis>.</para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis remap='B'>POPT_ERROR_OPTSTOODEEP</emphasis></term>
|
||||
<listitem>
|
||||
<para>A set of option aliases is nested too deeply. Currently, popt
|
||||
follows options only 10 levels to prevent infinite recursion. Only
|
||||
<emphasis remap='B'>poptGetNextOpt()</emphasis> can return this error.</para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis remap='B'>POPT_ERROR_BADQUOTE</emphasis></term>
|
||||
<listitem>
|
||||
<para>A parsed string has a quotation mismatch (such as a single quotation
|
||||
mark). <emphasis remap='B'>poptParseArgvString()</emphasis>, <emphasis remap='B'>poptReadConfigFile()</emphasis>, or
|
||||
<emphasis remap='B'>poptReadDefaultConfig()</emphasis> can return this error.</para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis remap='B'>POPT_ERROR_BADNUMBER</emphasis></term>
|
||||
<listitem>
|
||||
<para>A conversion from a string to a number (int or long) failed due
|
||||
to the string containing nonnumeric characters. This occurs when
|
||||
<emphasis remap='B'>poptGetNextOpt()</emphasis> is processing an argument of type
|
||||
<emphasis remap='B'>POPT_ARG_INT</emphasis>, <emphasis remap='B'>POPT_ARG_SHORT</emphasis>, <emphasis remap='B'>POPT_ARG_LONG</emphasis>, <emphasis remap='B'>POPT_ARG_LONGLONG</emphasis>,
|
||||
POPT_ARG_FLOAT<emphasis remap='B'>, or </emphasis>POPT_ARG_DOUBLE<literal>.</literal></para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis remap='B'>POPT_ERROR_OVERFLOW</emphasis></term>
|
||||
<listitem>
|
||||
<para>A string-to-number conversion failed because the number was too
|
||||
large or too small. Like <emphasis remap='B'>POPT_ERROR_BADNUMBER</emphasis>, this error
|
||||
can occur only when <emphasis remap='B'>poptGetNextOpt()</emphasis> is processing an
|
||||
argument of type <emphasis remap='B'>POPT_ARG_INT</emphasis>, <emphasis remap='B'>POPT_ARG_SHORT</emphasis>, <emphasis remap='B'>POPT_ARG_LONG</emphasis>, <emphasis remap='B'>POPT_ARG_LONGLONG</emphasis>,
|
||||
POPT_ARG_FLOAT<emphasis remap='B'>, or </emphasis>POPT_ARG_DOUBLE<literal>.</literal></para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis remap='B'>POPT_ERROR_ERRNO</emphasis></term>
|
||||
<listitem>
|
||||
<para>A system call returned with an error, and <varname>errno</varname> still
|
||||
contains the error from the system call. Both
|
||||
<emphasis remap='B'>poptReadConfigFile()</emphasis> and <emphasis remap='B'>poptReadDefaultConfig()</emphasis> can
|
||||
return this error.</para>
|
||||
|
||||
|
||||
<para>Two functions are available to make it easy for applications to provide
|
||||
good error messages.</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>const char *const poptStrerror(const int </emphasis><varname role='parameter'>error</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
<para>This function takes a popt error code and returns a string describing
|
||||
the error, just as with the standard <function>strerror()</function> function.</para>
|
||||
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>const char * poptBadOption(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>, int </emphasis><varname role='parameter'>flags</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
<para>If an error occurred during <emphasis remap='B'>poptGetNextOpt()</emphasis>, this function
|
||||
returns the option that caused the error. If the <varname role='parameter'>flags</varname> argument
|
||||
is set to <emphasis remap='B'>POPT_BADOPTION_NOALIAS</emphasis>, the outermost option is
|
||||
returned. Otherwise, <varname role='parameter'>flags</varname> should be 0, and the option that is
|
||||
returned may have been specified through an alias.</para>
|
||||
|
||||
<para>These two functions make popt error handling trivial for most
|
||||
applications. When an error is detected from most of the functions,
|
||||
an error message is printed along with the error string from
|
||||
<emphasis remap='B'>poptStrerror()</emphasis>. When an error occurs during argument parsing,
|
||||
code similiar to the following displays a useful error message:</para>
|
||||
|
||||
<programlisting remap='.nf'>
|
||||
fprintf(stderr, "%s: %s\n",
|
||||
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
|
||||
poptStrerror(rc));
|
||||
</programlisting> <!-- .fi -->
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 xml:id='option_aliasing'><title>OPTION ALIASING</title>
|
||||
<para>One of the primary benefits of using popt over <function>getopt()</function> is the
|
||||
ability to use option aliasing. This lets the user specify options that
|
||||
popt expands into other options when they are specified. If the standard
|
||||
grep program made use of popt, users could add a <option>--text</option> option
|
||||
that expanded to <option>-i -n -E -2</option> to let them more easily find
|
||||
information in text files.</para>
|
||||
|
||||
|
||||
<refsect2 xml:id='x1_specifying_aliases'><title>1. SPECIFYING ALIASES</title>
|
||||
<para>Aliases are normally specified in two places: <filename>/etc/popt</filename>
|
||||
and the <markup>.popt</markup> file in the user's home directory (found through
|
||||
the <envar>HOME</envar> environment variable). Both files have the same format,
|
||||
an arbitrary number of lines formatted like this:</para>
|
||||
|
||||
<para><emphasis remap='I'>appname</emphasis><emphasis remap='B'> alias </emphasis><emphasis remap='I'>newoption</emphasis><emphasis remap='I'> expansion</emphasis></para>
|
||||
|
||||
<para>The <emphasis remap='I'>appname</emphasis> is the name of the application, which must be the
|
||||
same as the <varname role='parameter'>name</varname> parameter passed to
|
||||
<emphasis remap='B'>poptGetContext()</emphasis>. This allows each file to specify aliases for
|
||||
multiple programs. The <varname role='parameter'>alias</varname> keyword specifies that an alias is
|
||||
being defined; currently popt configuration files support only aliases, but
|
||||
other abilities may be added in the future. The next option is the option
|
||||
that should be aliased, and it may be either a short or a long option. The
|
||||
rest of the line specifies the expansion for the alias. It is parsed
|
||||
similarly to a shell command, which allows \, ", and ' to be used for
|
||||
quoting. If a backslash is the final character on a line, the next line
|
||||
in the file is assumed to be a logical continuation of the line containing
|
||||
the backslash, just as in shell.</para>
|
||||
|
||||
<para>The following entry would add a <option>--text</option> option to the grep command,
|
||||
as suggested at the beginning of this section.</para>
|
||||
|
||||
<para><emphasis remap='B'>grep alias --text -i -n -E -2</emphasis></para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 xml:id='x2_enabling_aliases'><title>2. ENABLING ALIASES</title>
|
||||
<para>An application must enable alias expansion for a <type>poptContext</type>
|
||||
before calling <emphasis remap='B'>poptGetNextArg()</emphasis> for the first time. There are
|
||||
three functions that define aliases for a context:</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>int poptReadDefaultConfig(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>, int </emphasis><varname role='parameter'>flags</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
<para>This function reads aliases from <filename>/etc/popt</filename> and the
|
||||
<markup>.popt</markup> file in the user's home directory. Currently,
|
||||
<varname role='parameter'>flags</varname> should be
|
||||
<emphasis remap='B'>NULL</emphasis>, as it is provided only for future expansion.</para>
|
||||
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>int poptReadConfigFile(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>, char * </emphasis><varname role='parameter'>fn</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
<para>The file specified by <varname role='parameter'>fn</varname> is opened and parsed as a popt
|
||||
configuration file. This allows programs to use program-specific
|
||||
configuration files.</para>
|
||||
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>int poptAddAlias(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>, struct poptAlias </emphasis><varname role='parameter'>alias</varname><emphasis remap='B'>,</emphasis>
|
||||
<emphasis remap='B'> int </emphasis><varname role='parameter'>flags</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
<para>Occasionally, processes want to specify aliases without having to
|
||||
read them from a configuration file. This function adds a new alias
|
||||
to a context. The <varname role='parameter'>flags</varname> argument should be 0, as it is
|
||||
currently reserved for future expansion. The new alias is specified
|
||||
as a <emphasis remap='B'>struct poptAlias</emphasis>, which is defined as:</para>
|
||||
|
||||
<programlisting remap='.nf'>
|
||||
struct poptAlias {
|
||||
const char * longName; /* may be NULL */
|
||||
char shortName; /* may be '\0' */
|
||||
int argc;
|
||||
const char ** argv; /* must be free()able */
|
||||
};
|
||||
</programlisting> <!-- .fi -->
|
||||
|
||||
<para>The first two elements, <emphasis remap='I'>longName</emphasis> and <emphasis remap='I'>shortName</emphasis>, specify
|
||||
the option that is aliased. The final two, <varname role='parameter'>argc</varname> and <varname role='parameter'>argv</varname>,
|
||||
define the expansion to use when the aliases option is encountered.</para>
|
||||
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 xml:id='parsing_argument_strings'><title>PARSING ARGUMENT STRINGS</title>
|
||||
<para>Although popt is usually used for parsing arguments already divided into
|
||||
an <varname role='parameter'>argv</varname>-style array, some programs need to parse strings that
|
||||
are formatted identically to command lines. To facilitate this, popt
|
||||
provides a function that parses a string into an array of strings,
|
||||
using rules similiar to normal shell parsing.</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>#include <popt.h></emphasis>
|
||||
<emphasis remap='B'>int poptParseArgvString(char * </emphasis><varname role='parameter'>s</varname><emphasis remap='B'>, int * </emphasis><varname role='parameter'>argcPtr</varname><emphasis remap='B'>,</emphasis>
|
||||
<emphasis remap='B'> char *** </emphasis><varname role='parameter'>argvPtr</varname><emphasis remap='B'>);</emphasis>
|
||||
<emphasis remap='B'>int poptDupArgv(int </emphasis><varname role='parameter'>argc</varname><emphasis remap='B'>, const char ** </emphasis><varname role='parameter'>argv</varname><emphasis remap='B'>, int * </emphasis><varname role='parameter'>argcPtr</varname><emphasis remap='B'>,</emphasis>
|
||||
<emphasis remap='B'> const char *** </emphasis><varname role='parameter'>argvPtr</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
|
||||
<para>The string s is parsed into an <varname role='parameter'>argv</varname>-style array. The integer
|
||||
pointed to by the <varname role='parameter'>argcPtr</varname> parameter contains the number of elements
|
||||
parsed, and the final <varname role='parameter'>argvPtr</varname> parameter contains the address of the
|
||||
newly created array.
|
||||
The routine <emphasis remap='B'>poptDupArgv()</emphasis> can be used to make a copy of an existing
|
||||
argument array.</para>
|
||||
|
||||
<para>The <varname role='parameter'>argvPtr</varname>
|
||||
created by <emphasis remap='B'>poptParseArgvString()</emphasis> or <emphasis remap='B'>poptDupArgv()</emphasis> is suitable to pass directly
|
||||
to <emphasis remap='B'>poptGetContext()</emphasis>.
|
||||
Both routines return a single dynamically allocated contiguous
|
||||
block of storage and should be <function>free()</function>ed when the application is
|
||||
finished with the storage.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 xml:id='handling_extra_arguments'><title>HANDLING EXTRA ARGUMENTS</title>
|
||||
<para>Some applications implement the equivalent of option aliasing but need
|
||||
to do so through special logic. The <emphasis remap='B'>poptStuffArgs()</emphasis> function
|
||||
allows an application to insert new arguments into the current
|
||||
<type>poptContext</type>.</para>
|
||||
|
||||
<literallayout remap='.nf'>
|
||||
<emphasis remap='B'>#include <popt.h></emphasis>
|
||||
<emphasis remap='B'>int poptStuffArgs(poptContext </emphasis><varname role='parameter'>con</varname><emphasis remap='B'>, const char ** </emphasis><varname role='parameter'>argv</varname><emphasis remap='B'>);</emphasis>
|
||||
</literallayout> <!-- .fi -->
|
||||
|
||||
<para>The passed <varname role='parameter'>argv</varname>
|
||||
must have a <emphasis remap='B'>NULL</emphasis> pointer as its final element. When
|
||||
<emphasis remap='B'>poptGetNextOpt()</emphasis> is next called, the
|
||||
"stuffed" arguments are the first to be parsed. popt returns to the
|
||||
normal arguments once all the stuffed arguments have been exhausted.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 xml:id='example'><title>EXAMPLE</title>
|
||||
<para>The following example is a simplified version of the program "robin"
|
||||
which appears in Chapter 15 of the text cited below. Robin has
|
||||
been stripped of everything but its argument-parsing logic, slightly
|
||||
reworked, and renamed "parse." It may prove useful in illustrating
|
||||
at least some of the features of the extremely rich popt library.</para>
|
||||
|
||||
<programlisting remap='.nf'>
|
||||
#include <popt.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void usage(poptContext optCon, int exitcode, char *error, char *addl) {
|
||||
poptPrintUsage(optCon, stderr, 0);
|
||||
if (error) fprintf(stderr, "%s: %s0, error, addl);
|
||||
exit(exitcode);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
char c; /* used for argument parsing */
|
||||
int i = 0; /* used for tracking options */
|
||||
char *portname;
|
||||
int speed = 0; /* used in argument parsing to set speed */
|
||||
int raw = 0; /* raw mode? */
|
||||
int j;
|
||||
char buf[BUFSIZ+1];
|
||||
poptContext optCon; /* context for parsing command-line options */
|
||||
|
||||
struct poptOption optionsTable[] = {
|
||||
{ "bps", 'b', POPT_ARG_INT, &speed, 0,
|
||||
"signaling rate in bits-per-second", "BPS" },
|
||||
{ "crnl", 'c', 0, 0, 'c',
|
||||
"expand cr characters to cr/lf sequences", NULL },
|
||||
{ "hwflow", 'h', 0, 0, 'h',
|
||||
"use hardware (RTS/CTS) flow control", NULL },
|
||||
{ "noflow", 'n', 0, 0, 'n',
|
||||
"use no flow control", NULL },
|
||||
{ "raw", 'r', 0, &raw, 0,
|
||||
"don't perform any character conversions", NULL },
|
||||
{ "swflow", 's', 0, 0, 's',
|
||||
"use software (XON/XOF) flow control", NULL } ,
|
||||
POPT_AUTOHELP
|
||||
{ NULL, 0, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
optCon = poptGetContext(NULL, argc, argv, optionsTable, 0);
|
||||
poptSetOtherOptionHelp(optCon, "[OPTIONS]* <port>");
|
||||
|
||||
if (argc < 2) {
|
||||
poptPrintUsage(optCon, stderr, 0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Now do options processing, get portname */
|
||||
while ((c = poptGetNextOpt(optCon)) >= 0) {
|
||||
switch (c) {
|
||||
case 'c':
|
||||
buf[i++] = 'c';
|
||||
break;
|
||||
case 'h':
|
||||
buf[i++] = 'h';
|
||||
break;
|
||||
case 's':
|
||||
buf[i++] = 's';
|
||||
break;
|
||||
case 'n':
|
||||
buf[i++] = 'n';
|
||||
break;
|
||||
}
|
||||
}
|
||||
portname = poptGetArg(optCon);
|
||||
if((portname == NULL) || !(poptPeekArg(optCon) == NULL))
|
||||
usage(optCon, 1, "Specify a single port", ".e.g., /dev/cua0");
|
||||
|
||||
if (c < -1) {
|
||||
/* an error occurred during option processing */
|
||||
fprintf(stderr, "%s: %s\n",
|
||||
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
|
||||
poptStrerror(c));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Print out options, portname chosen */
|
||||
printf("Options chosen: ");
|
||||
for(j = 0; j < i ; j++)
|
||||
printf("-%c ", buf[j]);
|
||||
if(raw) printf("-r ");
|
||||
if(speed) printf("-b %d ", speed);
|
||||
printf("\nPortname chosen: %s\n", portname);
|
||||
|
||||
poptFreeContext(optCon);
|
||||
exit(0);
|
||||
}
|
||||
</programlisting> <!-- .fi -->
|
||||
|
||||
<para>RPM, a popular Linux package management program, makes heavy use
|
||||
of popt's features. Many of its command-line arguments are implemented
|
||||
through popt aliases, which makes RPM an excellent example of how to
|
||||
take advantage of the popt library. For more information on RPM, see
|
||||
http://www.rpm.org. The popt source code distribution includes test
|
||||
program(s) which use all of the features of the popt libraries in
|
||||
various ways. If a feature isn't working for you, the popt test code
|
||||
is the first place to look.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 xml:id='bugs'><title>BUGS</title>
|
||||
<para>None presently known.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 xml:id='author'><title>AUTHOR</title>
|
||||
<para>Erik W. Troan <ewt@redhat.com></para>
|
||||
|
||||
<para>This man page is derived in part from
|
||||
<emphasis remap='I'>Linux Application Development</emphasis>
|
||||
by Michael K. Johnson and Erik W. Troan, Copyright (c) 1998 by Addison
|
||||
Wesley Longman, Inc., and included in the popt documentation with the
|
||||
permission of the Publisher and the appreciation of the Authors.</para>
|
||||
|
||||
<para>Thanks to Robert Lynch for his extensive work on this man page.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 xml:id='see_also'><title>SEE ALSO</title>
|
||||
<para><citerefentry><refentrytitle>getopt</refentrytitle><manvolnum>3</manvolnum></citerefentry></para>
|
||||
|
||||
<para><emphasis remap='I'>Linux Application Development</emphasis>, by Michael K. Johnson and
|
||||
Erik W. Troan (Addison-Wesley, 1998; ISBN 0-201-30821-5), Chapter 24.</para>
|
||||
|
||||
<para><emphasis remap='B'>popt.ps</emphasis> is a Postscript version of the above cited book
|
||||
chapter. It can be found in the source archive for popt available at:
|
||||
ftp://ftp.rpm.org/pub/rpm.</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
@@ -159,6 +159,7 @@ set(docbook_mann_EN
|
||||
preview.xml
|
||||
prj_add.xml
|
||||
ps.xml
|
||||
pull.xml
|
||||
push.xml
|
||||
put_comb.xml
|
||||
putmat.xml
|
||||
|
||||
@@ -58,7 +58,7 @@ mat_ae_vec mat_aet_vec mat_angles mat_arb_rot mat_eigen2x2 mat_fromto mat_inv
|
||||
mat_lookat mat_mul mat_scale_about_pt mat_trn mat_vec_ortho mat_vec_perp
|
||||
mat_xform_about_pt mat_xrot mat_yrot mat_zrot quat_mat2quat quat_quat2mat
|
||||
vo_model2view vo_pmat vo_pmodel2view vo_rmat vo_view2model wdb_attr wdb_bot_decimate
|
||||
wdb_list wdb_match wdb_nmg_collapse wdb_paths wdb_push wdb_search wdb_showmats
|
||||
wdb_list wdb_match wdb_nmg_collapse wdb_paths wdb_pull wdb_push wdb_search wdb_showmats
|
||||
wdb_xpush
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
<prompt>mged></prompt> <userinput>tree region1.r</userinput>
|
||||
region1.r/R
|
||||
u region2.r/R
|
||||
u sph.s
|
||||
u sph.s
|
||||
u comb.c/
|
||||
u arb.s
|
||||
</computeroutput>
|
||||
@@ -461,7 +461,7 @@ r3/R
|
||||
|
||||
<literallayout>
|
||||
<computeroutput>
|
||||
<prompt>mged></prompt> <userinput>comb -l spheres.c</userinput>
|
||||
<prompt>mged></prompt> <userinput>comb -l r3</userinput>
|
||||
Comb region lift failed - the following combs in the tree contain
|
||||
regions and are also used outside the tree of r3:
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<!-- Converted by db4-upgrade version 1.0 -->
|
||||
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="pull">
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>PULL</refentrytitle>
|
||||
<manvolnum>nged</manvolnum>
|
||||
<refmiscinfo class="source">BRL-CAD</refmiscinfo>
|
||||
<refmiscinfo class="manual">BRL-CAD User Commands</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv xml:id="name">
|
||||
<refname>pull</refname>
|
||||
<refpurpose>Pulls the effects of all transformation matrices that appear in
|
||||
any combinations or primitives in the trees from the leaves up to the specified <emphasis>objects</emphasis> or node.
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<!-- body begins here -->
|
||||
<refsynopsisdiv xml:id="synopsis">
|
||||
<cmdsynopsis sepchar=" ">
|
||||
<command>pull</command>
|
||||
<arg choice="opt" rep="norepeat"><replaceable>objects</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsection xml:id="description"><title>DESCRIPTION</title>
|
||||
|
||||
<para>Pulls the effects of all matrix transformations that appear in
|
||||
any combinations or primitives in the tree from the leaves up to the specified <emphasis>objects</emphasis>. This will restore the parameters of the <emphasis>primitive shapes</emphasis> if any of the transformation matrices were not identity matrices. All the transformation matrices visited will be set to the current transformation matrix as it moves up the tree. This command will fail, and no changes will be made, if the specified <emphasis>object</emphasis> is a primitive shape referenced by the list of <emphasis>objects</emphasis>.
|
||||
</para>
|
||||
</refsection>
|
||||
|
||||
<refsection xml:id="examples"><title>EXAMPLES</title>
|
||||
|
||||
<para>The example shows the use of the <command>pull</command> command to pull the effects of any transformation matrices from leaves(primitive shapes) of a tree up to the specified head objects.
|
||||
</para>
|
||||
|
||||
<example><title>Pull the effects of any transformation matrices from the leaves(primitive shapes) of the tree up to the specified head nodes(objects).</title>
|
||||
|
||||
<para>
|
||||
<prompt>mged></prompt><userinput>pull group1 regiona</userinput>
|
||||
</para>
|
||||
<para>Pulls the effects of any transformation matrices from the primitive shapes in the tree up to the root nodes specified by <emphasis>group1</emphasis> and <emphasis>regiona</emphasis>.
|
||||
</para>
|
||||
</example>
|
||||
|
||||
</refsection>
|
||||
|
||||
<refsection xml:id="author"><title>AUTHOR</title><para>BRL-CAD Team</para></refsection>
|
||||
|
||||
<refsection xml:id="bug_reports"><title>BUG REPORTS</title>
|
||||
|
||||
<para>
|
||||
Reports of bugs or problems should be submitted via electronic
|
||||
mail to <devs@brlcad.org>, or via the "cadbug.sh" script.
|
||||
</para>
|
||||
</refsection>
|
||||
</refentry>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -364,6 +364,18 @@ its entries will override any color assigned using the <a href="#mater">mater</a
|
||||
when drawing wireframe.
|
||||
</DD>
|
||||
<P>
|
||||
<DT><I>dbName</I> <A NAME="pull"><B>pull</B></A> <<I>objects</I>></DT>
|
||||
<DD>Pulls the effects of all transformation
|
||||
matrices that appear in the
|
||||
<a href="../mged/brlcad_glossary.html#SOLID">primitive solids</a> in the trees
|
||||
to the specified <I>objects</I> head up the tree. This will restore
|
||||
the parameters of the <I>primitive solids</I> if any of the
|
||||
transformation matrices are present. All the transformation
|
||||
matrices visited will correspond to the current matrix transformation for that node. This command will fail,
|
||||
and no changes will be made, if any <I>primitive solid</I> referenced as
|
||||
the list of <I>objects</I>.
|
||||
</DD>
|
||||
<P>
|
||||
<DT><I>dbName</I> <A NAME="push"><B>push</B></A> <<I>objects</I>></DT>
|
||||
<DD>Force the effects of all transformation
|
||||
matrices that appear in any
|
||||
|
||||
@@ -331,6 +331,8 @@
|
||||
<TD WIDTH="19%" VALIGN="MIDDLE">
|
||||
<FONT SIZE=2><P></FONT><A HREF="#ps"><FONT SIZE=2>ps</FONT></A></TD>
|
||||
<TD WIDTH="20%" VALIGN="MIDDLE">
|
||||
<FONT SIZE=2><P></FONT><A HREF="#pull"><FONT SIZE=2>pull</FONT></A></TD>
|
||||
<TD WIDTH="21%" VALIGN="MIDDLE">
|
||||
<FONT SIZE=2><P></FONT><A HREF="#push"><FONT SIZE=2>push</FONT></A></TD>
|
||||
<TD WIDTH="22%" VALIGN="MIDDLE">
|
||||
<FONT SIZE=2><P></FONT><A HREF="#putmat"><FONT SIZE=2>putmat</FONT></A></TD>
|
||||
@@ -2516,6 +2518,17 @@ foo.r_xpand/R
|
||||
</FONT><TT>mged></TT><FONT SIZE=2> <B>ps -l 10 -t "Test Fat Lines" fat_lines.ps</B> <BR>
|
||||
-- This time use fat lines. </P></DIR>
|
||||
|
||||
<P><HR ALIGN="RIGHT"></P>
|
||||
</FONT><B><DL>
|
||||
<DT><A NAME="pull"></A>pull</B> <<I>objects</I>></DT>
|
||||
<DD>The "pull" command pulls the effects of all transformation matrices that appear in any <A HREF="#SOLID">primitive shapes</A> or <A HREF="#COMBINATION">combinations</A> in the trees up to the specified <I>objects</I> heading the tree. This will restore the original the parameters of the <I>primitive shapes</I> if any of the transformation matrices are not identity matrices. All the transformation matrices visited up the tree will be set to the current transformation matrix. This command will fail, and no changes will be made, if the head is referenced by a <I>primitive shape</I>.</DD>
|
||||
<FONT SIZE=4><DT>Examples:</DT>
|
||||
</FONT><TT><DD>mged></TT> <B>pull group1 regiona</DD>
|
||||
</DL><DIR>
|
||||
|
||||
</B><FONT SIZE=2><P>-- Pull the effects of any transformation matrices from the <I>primitive shapes.</I> in the trees up to the heads indicated by <I>group1</I> and <I>regiona</I> </P>
|
||||
</DIR>
|
||||
|
||||
<P><HR ALIGN="RIGHT"></P>
|
||||
</FONT><B><DL>
|
||||
<DT><A NAME="push"></A>push</B> <<I>objects</I>></DT>
|
||||
|
||||
@@ -0,0 +1,396 @@
|
||||
Arbitrary Regular Polyhedron with up to 8 vertices : arb8 {
|
||||
point p1
|
||||
point p2
|
||||
point p3
|
||||
point p4
|
||||
point p5
|
||||
point p6
|
||||
point p7
|
||||
point p8
|
||||
p1 != p2 && p2 != p3 && p3 != p4 && p4 != p5 && p5 != p6 && p6 != p7 && p7 != p8
|
||||
}
|
||||
|
||||
Bounding Box (ARB8) : box {
|
||||
point V => corner vertex
|
||||
vector H => height vector
|
||||
vector W => width vector
|
||||
vector D => depth vector
|
||||
magnitude(H) > 0.0
|
||||
magnitude(W) > 0.0
|
||||
magnitude(D) > 0.0
|
||||
perpendicular(H, W) && perpendicular(W, D) && perpendicular(H, D)
|
||||
}
|
||||
|
||||
Right Parallelepiped (ARB8) : rpp {
|
||||
point min
|
||||
point max
|
||||
distance(min, max) > 0.0
|
||||
}
|
||||
|
||||
Arbitrary Regular Polyhedron with N faces : arbn {
|
||||
integer n => number of planes
|
||||
array planes {
|
||||
plane p => plane equation
|
||||
}
|
||||
for i in planes { magnitude(planes[i].p) > 0.0 }
|
||||
}
|
||||
|
||||
Arbitrary Faceted Solid : ars {
|
||||
integer p => number of points per waterline
|
||||
integer w => number of waterlines
|
||||
array points {
|
||||
point V => vertex position
|
||||
}
|
||||
p > 0
|
||||
w > 0
|
||||
}
|
||||
|
||||
Bag of Triangles : bot {
|
||||
integer c => number of vertices
|
||||
integer t => number of triangles
|
||||
enum orientation {unoriented, counter-clockwise, clockwise} => triangle orientation
|
||||
point V => vertex position
|
||||
enum facemode {center, appended}
|
||||
float t => face thickness
|
||||
c > 0 && 3 mod c == 0
|
||||
t > 0
|
||||
!(t < 0.0)
|
||||
}
|
||||
|
||||
Boundary Representation NURBS : brep
|
||||
|
||||
FASTGEN CLINE Cylinder : cline
|
||||
|
||||
Displacement Map : dsp {
|
||||
enum source {file, object} => data source
|
||||
string name => name of the data source
|
||||
float w => map width
|
||||
float n => map height
|
||||
boolean interpolate => surface normal interpolation
|
||||
float s => square cell size
|
||||
float e => cell height
|
||||
w > 0.0
|
||||
n > 0.0
|
||||
s > 0.0
|
||||
e > 0.0
|
||||
(source==file && file_exists(name)) || (source==object && object_exists(name))
|
||||
}
|
||||
|
||||
Extruded Bitmap : ebm {
|
||||
string name => name of the data source
|
||||
float w => width of bitmap
|
||||
float n => height of bitmap
|
||||
float d => extrusion distance
|
||||
file_exists(name)
|
||||
w > 0.0
|
||||
n > 0.0
|
||||
d > 0.0
|
||||
}
|
||||
|
||||
Elliptical Hyperboloid : ehy
|
||||
point V => vertex
|
||||
vector H => height vector
|
||||
vector A => ellipse base width vector
|
||||
float b => magnitude of ellipse base depth vector
|
||||
float c => apex to asymptotes distance
|
||||
magnitude(H) > 0.0
|
||||
magnitude(A) > 0.0
|
||||
perpendicular(H, A)
|
||||
b > 0.0
|
||||
c > 0.0
|
||||
}
|
||||
|
||||
Ellipsoid : ell {
|
||||
point V => vertex point
|
||||
vector A
|
||||
vector B
|
||||
vector C
|
||||
perpendicular(A, B)
|
||||
perpendicular(B, C)
|
||||
}
|
||||
|
||||
Elliptical Paraboloid : epa {
|
||||
point V => vertex
|
||||
vector H => height vector
|
||||
vector A => ellipse base width vector
|
||||
float b => magnitude of ellipse base depth vector
|
||||
magnitude(H) > 0.0
|
||||
magnitude(A) > 0.0
|
||||
perpendicular(H, A)
|
||||
b > 0.0
|
||||
}
|
||||
|
||||
Elliptical Torus : eto {
|
||||
point V => center point
|
||||
vector H => normal height vector
|
||||
float r => radius of revolution
|
||||
vector C => perpendicular ellipse orientation
|
||||
float d => magnitude of elliptical semi-minor axis
|
||||
magnitude(H) > 0.0
|
||||
r > 0.0
|
||||
d > 0.0
|
||||
}
|
||||
|
||||
Solid of Extrusion : extrude {
|
||||
point V => vertex position
|
||||
vector H => height vector
|
||||
vector A => sketch plane primary vector
|
||||
vector B => sketch plane secondary vector
|
||||
string name => name of the sketch object
|
||||
magnitude(H) > 0.0
|
||||
magnitude(A) > 0.0
|
||||
magnitude(B) > 0.0
|
||||
object_exists(name)
|
||||
}
|
||||
|
||||
Pseudo Solid Grip : grip {
|
||||
point V => vertex point
|
||||
vector H => height vector
|
||||
float m => magnitude
|
||||
magnitude(H) > 0.0
|
||||
m > 0.0
|
||||
}
|
||||
|
||||
Halfspace : half {
|
||||
vector H => outward pointing normal vector
|
||||
float d => distance from the origin
|
||||
magnitude(H) > 0.0
|
||||
}
|
||||
|
||||
Hyperboloid of One Sheet : hyp {
|
||||
point V => center vertex
|
||||
vector H => height vector
|
||||
vector A => ellipse base vector
|
||||
float b => magnitude of ellipse base depth vector
|
||||
float c => neck to base ratio
|
||||
magnitude(H) > 0.0
|
||||
magnitude(A) > 0.0
|
||||
perpendicular(H, A)
|
||||
b > 0.0
|
||||
c > 0.0
|
||||
!(c > 1.0)
|
||||
}
|
||||
|
||||
Metaball : metaball {
|
||||
enum method {0, 1, 2} => render method
|
||||
float t => threshold
|
||||
integer c => number of points
|
||||
array points {
|
||||
vector F => field strength vector
|
||||
float f => field strength
|
||||
}
|
||||
t > 0.0
|
||||
c > 0
|
||||
for i in points { magnitude(points[i].F) > 0.0 && points[i].f > 0.0 }
|
||||
}
|
||||
|
||||
n-Manifold Geometry : nmg
|
||||
|
||||
Particle System : part {
|
||||
point V => center point
|
||||
vector H => height vector
|
||||
float rV => V end radius
|
||||
float rH => H end radius
|
||||
magnitude(H) > 0.0
|
||||
rV > 0.0
|
||||
rH > 0.0
|
||||
!(rV + rH > magnitude(H))
|
||||
}
|
||||
|
||||
Pipe (wire) Solid : pipe {
|
||||
integer n => number of pipe points
|
||||
array points {
|
||||
point V => vertex point
|
||||
float i => inner diameter
|
||||
float o => outer diameter
|
||||
float r => bend radius
|
||||
}
|
||||
n > 1
|
||||
for i in points { points[i].o > 0.0 && points[i].i < points[i].o && !(points[i].r < 0.0) }
|
||||
// Bend section bends through more than 180 degrees
|
||||
for i in points { acos(vdot(points[i].V, points[i+1].V)) > 0.0 }
|
||||
}
|
||||
|
||||
Point Cloud : pnts {
|
||||
boolean file => points stored in a file
|
||||
integer n => number of points
|
||||
boolean oriented => points have orientation
|
||||
boolean color => points have color
|
||||
boolean size => points have size
|
||||
array points {
|
||||
point V => point position
|
||||
vector N => point normal vector
|
||||
integer C[3] => point color
|
||||
float s => point size
|
||||
}
|
||||
string pathname => name to source file data
|
||||
enum format { px, py, pz, cr, cg, cb, s, nx, ny, nz }
|
||||
enum units { mm, cm, m, in, ft }
|
||||
for i in points { oriented && magnitude(points[i].N) > 0.0 }
|
||||
for i in points { color && !(points[i].C[R] < 0 || points[i].C[R] > 255) && !(points[i].C[G] < 0 && points[i].C[G] > 255) && !(points[i].C[B] < 0 && points[i].C[B] > 255) }
|
||||
for i in points { size && !(points[i].s < 0.0) }
|
||||
file_exists(pathname)
|
||||
}
|
||||
|
||||
Right Elliptical Cylinder (TGC) : rec {
|
||||
point V => base center point
|
||||
vector H => height vector
|
||||
vector A => base ellipse primary axis
|
||||
vector B => base ellipse secondary axis
|
||||
magnitude(H) > 0.0
|
||||
magnitude(A) > 0.0
|
||||
magnitude(B) > 0.0
|
||||
perpendicular(H, A) && perpendicular(H, B) && perpendicular(A, B)
|
||||
}
|
||||
|
||||
Right Circular Cylinder (TGC) : rcc {
|
||||
point V => base center point
|
||||
vector H => height vector
|
||||
float r => cylinder radius
|
||||
magnitude(H) > 0.0
|
||||
r > 0
|
||||
}
|
||||
|
||||
Tapered Elliptical Cone (TGC) : tec {
|
||||
point V => base center point
|
||||
vector H => height vector
|
||||
vector A => base ellipse primary axis
|
||||
vector B => base ellipse secondary axis
|
||||
float r => ratio of base to top ellipse
|
||||
magnitude(H) > 0.0
|
||||
magnitude(A) > 0.0
|
||||
magnitude(B) > 0.0
|
||||
perpendicular(H, A) && perpendicular(H, B) && perpendicular(A, B)
|
||||
r > 0.0 || r < 0.0
|
||||
}
|
||||
|
||||
Tapered Right Cone (TGC) : trc {
|
||||
point V => base center point
|
||||
vector H => height vector
|
||||
float b => radius of base
|
||||
float t => radius of top
|
||||
magnitude(H) > 0.0
|
||||
b > 0.0
|
||||
t > 0.0
|
||||
}
|
||||
|
||||
Solid of Revolution : revolve {
|
||||
point V => vertex position
|
||||
vector R => axis of revolution
|
||||
vector S => vector in start plane
|
||||
float a => angle
|
||||
string name => name of 2D sketch
|
||||
magnitude(R) > 0.0
|
||||
magnitude(S) > 0.0
|
||||
a > 0.0
|
||||
object_exists(name)
|
||||
}
|
||||
|
||||
Right Hyperbolic Cone : rhc {
|
||||
point V => vertex
|
||||
vector H => height vector
|
||||
vector B => width vector
|
||||
float r => rectangular half-width
|
||||
float c => apex to asymptotes distance
|
||||
magnitude(H) > 0.0
|
||||
magnitude(B) > 0.0
|
||||
perpendicular(H, B)
|
||||
r > 0.0
|
||||
c > 0.0
|
||||
!(magnitude(B) < c)
|
||||
}
|
||||
|
||||
Right Parabolic Cone : rpc {
|
||||
point V => vertex
|
||||
vector H => height vector
|
||||
vector B => width vector
|
||||
float r => rectangular half-width
|
||||
magnitude(H) > 0.0
|
||||
magnitude(B) > 0.0
|
||||
perpendicular(H, B)
|
||||
r > 0.0
|
||||
}
|
||||
|
||||
2D Sketch : sketch {
|
||||
}
|
||||
|
||||
Sphere (ELL) : sph {
|
||||
point V => vertex point
|
||||
float r => radius
|
||||
r > 0.0
|
||||
}
|
||||
|
||||
Superquadratic Ellipsoid : superell {
|
||||
point V => center vertex point
|
||||
vector A => height vector
|
||||
vector B => width vector
|
||||
vector C => depth vector
|
||||
float n => north-south power
|
||||
float e => east-west power
|
||||
magnitude(A) > 0.0
|
||||
magnitude(B) > 0.0
|
||||
magnitude(C) > 0.0
|
||||
n > 0.0
|
||||
e > 0.0
|
||||
}
|
||||
|
||||
Generalized Truncated General Cone : tgc {
|
||||
point V => base center point
|
||||
vector H => height vector
|
||||
vector A => base ellipse primary axis
|
||||
vector B => base ellipse secondary axis
|
||||
float c => ratio of base A vector to top ellipse
|
||||
float d => ratio of base B vector to top ellipse
|
||||
magnitude(H) > 0.0
|
||||
magnitude(A) > 0.0
|
||||
magnitude(B) > 0.0
|
||||
perpendicular(A, B)
|
||||
c > 0.0
|
||||
d > 0.0
|
||||
}
|
||||
|
||||
Torus : tor {
|
||||
point V => center point
|
||||
vector H => normal height vector
|
||||
float r1 => outer radius from V to centerline
|
||||
float r2 => inner radius in direction of H
|
||||
r1 > 0.0
|
||||
r2 > 0.0
|
||||
!(r1 < r2)
|
||||
magnitude(H) > 0.0
|
||||
}
|
||||
|
||||
3D Volume : vol {
|
||||
string name => name of data source file
|
||||
integer f[3] => dimensions of file (number of cells)
|
||||
float l => lower threshold value
|
||||
float u => upper threshold value
|
||||
vector c => cell dimensions (width, height, depth)
|
||||
file_exists(name)
|
||||
f[X] > 0 && f[Y] > 0 && f[Z] > 0
|
||||
c[X] > 0.0 && c[Y] > 0.0 && c[Z] > 0.0
|
||||
l > 0.0
|
||||
u > 0.0
|
||||
u > l
|
||||
}
|
||||
|
||||
|
||||
DEPRECATED:
|
||||
// Bezier Spline : bspline
|
||||
// Height Field : hf
|
||||
// Polygonal Facets : poly
|
||||
// Instanced Submodel : submodel
|
||||
|
||||
|
||||
NON-PARAMETRIC:
|
||||
Uniform Binary Array : binunif {
|
||||
enum type {f, d, c, s, i, L, C, S, I, L} => minor type
|
||||
string name => source data file
|
||||
integer n => number of values to read
|
||||
file_exists(name)
|
||||
n > 0 || n == -1
|
||||
}
|
||||
// joint
|
||||
// combination
|
||||
// constraint
|
||||
// annotation
|
||||
+13
-1
@@ -873,7 +873,6 @@ private:
|
||||
BRNode* initialLoopBBox();
|
||||
|
||||
const ON_BrepFace* m_face;
|
||||
int m_adj_face_index;
|
||||
BRNode* m_root;
|
||||
std::list<BRNode*> m_sortedX;
|
||||
std::list<BRNode*> m_sortedY;
|
||||
@@ -2286,6 +2285,19 @@ ON_Boolean(ON_Brep* brepO, const ON_Brep* brepA, const ON_Brep* brepB, op_type o
|
||||
extern BREP_EXPORT ON_Curve*
|
||||
sub_curve(const ON_Curve* in, double a, double b);
|
||||
|
||||
|
||||
/**
|
||||
* Get the sub-surface whose u \in [a,b] or v \in [a, b]
|
||||
*
|
||||
* @param in [in] the surface to split
|
||||
* @param dir [in] 0: u-split, 1: v-split
|
||||
* @param a, b [in] either of them can be the larger one
|
||||
*
|
||||
* @return the result sub-surface. NULL for error.
|
||||
*/
|
||||
extern BREP_EXPORT ON_Surface*
|
||||
sub_surface(const ON_Surface* in, int dir, double a, double b);
|
||||
|
||||
} /* extern C++ */
|
||||
#endif
|
||||
|
||||
|
||||
+31
-34
@@ -1678,9 +1678,9 @@ typedef struct bu_hist bu_hist_t;
|
||||
* dynamic array.
|
||||
*
|
||||
* The table is currently un-ordered, and is merely an array of
|
||||
* pointers. The support routine nmg_tbl manipulates the array for
|
||||
* you. Pointers to be operated on (inserted, deleted, searched for)
|
||||
* are passed as a "pointer to long".
|
||||
* pointers. The support routines BU_*PTBL* and bu_ptbl* manipulate the
|
||||
* array for you. Pointers to be operated on (inserted, deleted, searched
|
||||
* for) are passed as a "pointer to long".
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1690,15 +1690,15 @@ typedef struct bu_hist bu_hist_t;
|
||||
*/
|
||||
struct bu_ptbl {
|
||||
struct bu_list l; /**< linked list for caller's use */
|
||||
off_t end; /**< index into buffer of first available location */
|
||||
size_t blen; /**< # of (long *)'s worth of storage at *buffer */
|
||||
long **buffer; /**< data storage area */
|
||||
off_t end; /**< index into buffer of first available location */
|
||||
size_t blen; /**< # of (long *)'s worth of storage at *buffer */
|
||||
long **buffer; /**< data storage area */
|
||||
};
|
||||
typedef struct bu_ptbl bu_ptbl_t;
|
||||
#define BU_PTBL_NULL ((struct bu_ptbl *)0)
|
||||
|
||||
/**
|
||||
* assert the integrity of a non-head node bu_ptbl struct.
|
||||
* assert the integrity of a bu_ptbl struct pointer.
|
||||
*/
|
||||
#define BU_CK_PTBL(_p) BU_CKMAG(_p, BU_PTBL_MAGIC, "bu_ptbl")
|
||||
|
||||
@@ -2651,17 +2651,6 @@ typedef struct bu_observer bu_observer_t;
|
||||
#define BU_OBSERVER_IS_INITIALIZED(_op) (((struct bu_observer *)(_op) != BU_OBSERVER_NULL) && LIKELY((_op)->magic == BU_OBSERVER_MAGIC))
|
||||
|
||||
|
||||
/**
|
||||
* DEPRECATED.
|
||||
*
|
||||
* Usage not recommended due to k&r callback (provides no type
|
||||
* checking)
|
||||
*/
|
||||
struct bu_cmdtab {
|
||||
char *ct_name;
|
||||
int (*ct_func)(void *data, int argc, const char *argv[]);
|
||||
};
|
||||
|
||||
/**@}*/
|
||||
|
||||
|
||||
@@ -3179,7 +3168,7 @@ BU_EXPORT extern char * bu_realpath(const char *path, char *resolved_path);
|
||||
* routine will set argv0 if path is provided and should generally be
|
||||
* set early on by bu_setprogname().
|
||||
*
|
||||
* this routine will return "(unknown)" if argv[0] cannot be
|
||||
* this routine will return "(BRL-CAD)" if argv[0] cannot be
|
||||
* identified but should never return NULL.
|
||||
*/
|
||||
DEPRECATED BU_EXPORT extern const char *bu_argv0(void);
|
||||
@@ -3191,29 +3180,36 @@ DEPRECATED BU_EXPORT extern const char *bu_argv0(void);
|
||||
* returns the full path to argv0, regardless of how the application
|
||||
* was invoked.
|
||||
*
|
||||
* this routine will return "(unknown)" if argv[0] cannot be
|
||||
* identified but should never return NULL.
|
||||
*
|
||||
* this routine will return "(BRL-CAD)" if argv[0] cannot be
|
||||
* identified but should never return NULL. this routine is not
|
||||
* thread-safe.
|
||||
*/
|
||||
BU_EXPORT extern const char *bu_argv0_full_path(void);
|
||||
|
||||
/**
|
||||
* get the name of the running application if they ran
|
||||
* bu_setprogname() first or if we know what it's supposed to be
|
||||
* anyways.
|
||||
* Get the name of the running application. application codes should
|
||||
* call bu_setprogname() first to ensure that the program name is
|
||||
* stored appropriately on platforms that do not have an intrinsic
|
||||
* method for tracking the program name automatically.
|
||||
*
|
||||
* while this routine is thread-safe and reentrant, the static string
|
||||
* returned is shared amongst all threads.
|
||||
*/
|
||||
BU_EXPORT extern const char *bu_getprogname(void);
|
||||
|
||||
/**
|
||||
* Set the name of the running application. This isn't necessary on
|
||||
* modern systems that support getprogname() and call setprogname()
|
||||
* before main() for you, but necessary otherwise for portability.
|
||||
* Set the name of the running application. This isn't strictly
|
||||
* necessary on platforms that have an intrinsic method for tracking
|
||||
* the program name automatically, but is still recommended for
|
||||
* portability and is necessary on some strict modes of compilation.
|
||||
*
|
||||
* while the implementation relies on a static string shared across
|
||||
* all threads, this routine is thread-safe and reentrant.
|
||||
*/
|
||||
BU_EXPORT extern void bu_setprogname(const char *path);
|
||||
|
||||
/**
|
||||
* returns the pathname for the current working directory.
|
||||
*
|
||||
*/
|
||||
BU_EXPORT extern char *bu_getcwd(char *buf, size_t size);
|
||||
|
||||
@@ -6238,12 +6234,13 @@ BU_EXPORT extern off_t bu_ftell(FILE *stream);
|
||||
*/
|
||||
BU_EXPORT extern int bu_str_isprint(const char *cp);
|
||||
|
||||
/** @file libbu/gethostname.c
|
||||
*
|
||||
* Portable gethostname()
|
||||
*
|
||||
/**
|
||||
* Get the current operating host's name. This is usually also the
|
||||
* network name of the current host. The name is written into the
|
||||
* provided hostname buffer of at least len size. The hostname is
|
||||
* always null-terminated and should be sized accordingly.
|
||||
*/
|
||||
BU_EXPORT extern int bu_gethostname(char *, size_t);
|
||||
BU_EXPORT extern int bu_gethostname(char *hostname, size_t len);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
@@ -55,6 +55,16 @@
|
||||
|
||||
#define BU_CMD_NULL (int (*)(void *, int, const char **))NULL
|
||||
|
||||
|
||||
/**
|
||||
* Generic keyword-to-command callback interface intended for use with
|
||||
* bu_cmd().
|
||||
*/
|
||||
struct bu_cmdtab {
|
||||
const char *ct_name;
|
||||
int (*ct_func)(void *data, int argc, const char *argv[]);
|
||||
};
|
||||
|
||||
struct bu_cmdhist {
|
||||
struct bu_list l;
|
||||
struct bu_vls h_command;
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#define __DM_NULL__
|
||||
#include "dm.h"
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
DM_EXPORT extern struct dm dm_null;
|
||||
|
||||
|
||||
@@ -180,6 +182,8 @@ null_makeCurrent(struct dm *dmp);
|
||||
DM_EXPORT extern void
|
||||
null_processEvents(struct dm *dmp);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __DM_NULL__ */
|
||||
|
||||
/** @} */
|
||||
|
||||
@@ -39,6 +39,7 @@ class QTkMainWindow: public QWindow {
|
||||
|
||||
public:
|
||||
QTkMainWindow(QPixmap *p, QWindow *parent = 0, struct dm *d = NULL);
|
||||
~QTkMainWindow();
|
||||
|
||||
virtual void render(QPainter *painter);
|
||||
public slots:
|
||||
@@ -60,6 +61,7 @@ private:
|
||||
|
||||
struct qt_vars {
|
||||
QApplication *qapp;
|
||||
QWindow *parent;
|
||||
QTkMainWindow *win;
|
||||
QColor fg, bg;
|
||||
QPixmap *pix;
|
||||
|
||||
+1
-2
@@ -256,7 +256,6 @@ struct dm {
|
||||
int (*dm_getDisplayImage)(struct dm *dmp, unsigned char **image);
|
||||
void (*dm_reshape)(struct dm *dmp, int width, int height);
|
||||
int (*dm_makeCurrent)(struct dm *dmp);
|
||||
void (*dm_processEvents)(struct dm *dmp);
|
||||
unsigned long dm_id; /**< @brief window id */
|
||||
int dm_displaylist; /**< @brief !0 means device has displaylist */
|
||||
int dm_stereo; /**< @brief stereo flag */
|
||||
@@ -329,7 +328,6 @@ struct dm {
|
||||
#define DM_GEN_DLISTS(_dmp, _range) _dmp->dm_genDLists(_dmp, _range)
|
||||
#define DM_GET_DISPLAY_IMAGE(_dmp, _image) _dmp->dm_getDisplayImage(_dmp, _image)
|
||||
#define DM_MAKE_CURRENT(_dmp) _dmp->dm_makeCurrent(_dmp)
|
||||
#define DM_PROCESS_EVENTS(_dmp) _dmp->dm_processEvents(_dmp)
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
@@ -422,6 +420,7 @@ DM_EXPORT extern void dm_draw_scale(struct dm *dmp,
|
||||
/* vers.c */
|
||||
DM_EXPORT extern const char *dm_version(void);
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
|
||||
@@ -930,6 +930,11 @@ GED_EXPORT extern int ged_comb_std(struct ged *gedp, int argc, const char *argv[
|
||||
*/
|
||||
GED_EXPORT extern int ged_combmem(struct ged *gedp, int argc, const char *argv[]);
|
||||
|
||||
/**
|
||||
* create, update, remove, and list geometric and dimensional constraints.
|
||||
*/
|
||||
GED_EXPORT extern int ged_constraint(struct ged *gedp, int argc, const char *argv[]);
|
||||
|
||||
/**
|
||||
* Import a database into the current database using an auto-incrementing or custom affix
|
||||
*/
|
||||
|
||||
+134
-53
@@ -40,26 +40,9 @@ __BEGIN_DECLS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* I C V _ R O T
|
||||
*
|
||||
* Rotate an image.
|
||||
* %s [-rifb | -a angle] [-# bytes] [-s squaresize] [-w width] [-n height] [-o outputfile] inputfile [> outputfile]
|
||||
*
|
||||
*/
|
||||
ICV_EXPORT extern int icv_rot(int argv, char **argc);
|
||||
|
||||
|
||||
/** @addtogroup image */
|
||||
/** @ingroup data */
|
||||
/** @{ */
|
||||
/** @file libicv/fileformat.c
|
||||
*
|
||||
* image read/write routines
|
||||
*
|
||||
* read/write images in a variety of formats.
|
||||
*
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
ICV_IMAGE_AUTO,
|
||||
@@ -130,19 +113,39 @@ typedef struct icv_image icv_image_t;
|
||||
*/
|
||||
#define ICV_IMAGE_IS_INITIALIZED(_i) (((struct icv_image *)(_i) != ICV_IMAGE_NULL) && LIKELY((_i)->magic == ICV_IMAGE_MAGIC))
|
||||
|
||||
/* Validation Macros */
|
||||
/**
|
||||
* Validates input icv_struct, if failure (in validation) returns -1
|
||||
*/
|
||||
#define ICV_IMAGE_VAL_INT(_i) if (!ICV_IMAGE_IS_INITIALIZED(_i)) return -1
|
||||
|
||||
/**
|
||||
* Validates input icv_struct, if failure (in validation) returns NULL
|
||||
*/
|
||||
#define ICV_IMAGE_VAL_PTR(_i) if (!ICV_IMAGE_IS_INITIALIZED(_i)) return NULL
|
||||
|
||||
|
||||
/* Data conversion MACROS */
|
||||
|
||||
/**
|
||||
* Converts to double (icv data) type from unsigned char(8bit).
|
||||
*/
|
||||
#define ICV_CONV_8BIT(data) ((double)(data))/255.0
|
||||
|
||||
/** @file libicv/fileformat.c
|
||||
*
|
||||
* image read/write routines
|
||||
*
|
||||
* read/write images in a variety of formats.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Finds the Image format based on heuristics depending on the file
|
||||
* name. @param filename Filename of the image whose format is to be
|
||||
* know. @param trimmedname Buffer for storing filename after
|
||||
* removing extensions @return File Format
|
||||
* name.
|
||||
* @param filename Filename of the image whose format is to be know
|
||||
* @param trimmedname Buffer for storing filename after removing
|
||||
* extensions
|
||||
* @return File Format
|
||||
*/
|
||||
ICV_EXPORT extern int icv_guess_file_format(const char *filename, char *trimmedname);
|
||||
|
||||
@@ -174,7 +177,8 @@ ICV_EXPORT extern icv_image_t *icv_create(int width, int height, ICV_COLOR_SPACE
|
||||
ICV_EXPORT int icv_writeline(icv_image_t *bif, int y, void *data, ICV_DATA type);
|
||||
|
||||
/**
|
||||
* Writes a pixel to the specified coordinates in the data of ICV struct.
|
||||
* Writes a pixel to the specified coordinates in the data of ICV
|
||||
* struct.
|
||||
*
|
||||
* @param bif ICV struct where data is to be written
|
||||
* @param x x-dir coordinate of the pixel
|
||||
@@ -199,14 +203,10 @@ ICV_EXPORT extern int icv_write(icv_image_t *bif, const char*filename, ICV_IMAGE
|
||||
|
||||
/**
|
||||
* Load a file into an ICV struct. For most formats, this will be
|
||||
* called with format=ICV_IMAGE_AUTO, hint_format=0, hint_width=0,
|
||||
* hint_height=0 and hint_depth=0 for default values. At the moment,
|
||||
* the data is packed into the data field as rgb24 (raw pix style).
|
||||
* called with format=ICV_IMAGE_AUTO.
|
||||
*
|
||||
* For pix and bw files, having width and height set to 0 will trigger
|
||||
* a heuristic sizing algorithm based on file size, assuming that the
|
||||
* image is square at first, then looking through a set of common
|
||||
* sizes, finally assuming 512x512.
|
||||
* The data is packed in icv_image struct in double format with varied
|
||||
* channels as per the specification of image to be loaded.
|
||||
*
|
||||
* To read stream from stdin pass NULL pointer for filename.
|
||||
*
|
||||
@@ -216,7 +216,6 @@ ICV_EXPORT extern int icv_write(icv_image_t *bif, const char*filename, ICV_IMAGE
|
||||
* size = total bytes read
|
||||
*
|
||||
* @param filename File to read
|
||||
|
||||
* @param hint_format Probable format of the file, typically
|
||||
* ICV_IMAGE_AUTO
|
||||
* @param hint_width Width when passed as parameter from calling
|
||||
@@ -237,7 +236,7 @@ ICV_EXPORT extern icv_image_t *icv_zero(icv_image_t *bif);
|
||||
* This function frees the allocated memory for a ICV Structure and
|
||||
* data.
|
||||
*/
|
||||
ICV_EXPORT extern void icv_destroy(icv_image_t *bif);
|
||||
ICV_EXPORT extern int icv_destroy(icv_image_t *bif);
|
||||
|
||||
/** @file libicv/color_space.c
|
||||
*
|
||||
@@ -277,12 +276,12 @@ typedef enum {
|
||||
#define icv_rgb2gray_crt(_a) icv_rgb2gray(_a, ICV_COLOR_RGB, 0.26, 0.66, 0.08)
|
||||
|
||||
/**
|
||||
* converts a three plane image to single plane image. This function
|
||||
* will combine or select planes of the image based on the input
|
||||
* arguments
|
||||
* converts a three channel rgb image to single channel gray-image.
|
||||
* This function will combine or select planes of the image based on
|
||||
* the input arguments.
|
||||
*
|
||||
* A normal calling of this functions is as follows:
|
||||
* icv_image_rgb2gray(bif, 0 ,0 ,0 ,0 ,0); where bif is the rgb image
|
||||
* icv_image_rgb2gray(bif, 0, 0, 0, 0); where bif is the rgb image
|
||||
* to be converted.
|
||||
*
|
||||
* @param color Chooses color planes to be selected for combination.
|
||||
@@ -371,11 +370,11 @@ ICV_EXPORT extern int icv_crop(icv_image_t *img,
|
||||
* All the pixels higher than the max range are set to MAX (1.0).
|
||||
* All the pixels lower than the min range are set to MIN (0.0).
|
||||
*
|
||||
* Note if an image(bif) is sanitized then, (bif->flags&&ICV_SANITIZED)
|
||||
* is true.
|
||||
* Note if an image(bif) is sanitized then,
|
||||
* (bif->flags&&ICV_SANITIZED) is true.
|
||||
*
|
||||
*/
|
||||
ICV_EXPORT void icv_sanitize(icv_image_t* img);
|
||||
ICV_EXPORT int icv_sanitize(icv_image_t* img);
|
||||
|
||||
/**
|
||||
* This adds a constant value to all the pixels of the image. Also if
|
||||
@@ -384,29 +383,30 @@ ICV_EXPORT void icv_sanitize(icv_image_t* img);
|
||||
*
|
||||
* Note to set the flag for a bif (icv_image struct);
|
||||
* bif->flags |= ICV_OPERATIONS_MODE;
|
||||
*
|
||||
*/
|
||||
ICV_EXPORT void icv_add_val(icv_image_t* img, double val);
|
||||
ICV_EXPORT int icv_add_val(icv_image_t* img, double val);
|
||||
|
||||
/**
|
||||
* This multiplies all the pixels of the image with a constant Value.
|
||||
* Also if the flag ICV_OPERATIONS_MODE is set this doesn't sanitize
|
||||
* the image.
|
||||
*/
|
||||
ICV_EXPORT void icv_multiply_val(icv_image_t* img, double val);
|
||||
ICV_EXPORT int icv_multiply_val(icv_image_t* img, double val);
|
||||
|
||||
/**
|
||||
* This divides all the pixels of the image with a constant Value.
|
||||
* Also if the flag ICV_OPERATIONS_MODE is set this doesn't sanitize
|
||||
* the image.
|
||||
*/
|
||||
ICV_EXPORT void icv_divide_val(icv_image_t* img, double val);
|
||||
ICV_EXPORT int icv_divide_val(icv_image_t* img, double val);
|
||||
|
||||
/**
|
||||
* This raises all the pixels of the image to a constant exponential
|
||||
* power. Also if the flag ICV_OPERATIONS_MODE is set this doesn't
|
||||
* sanitize the image.
|
||||
*/
|
||||
ICV_EXPORT void icv_pow_val(icv_image_t* img, double val);
|
||||
ICV_EXPORT int icv_pow_val(icv_image_t* img, double val);
|
||||
|
||||
/**
|
||||
* This routine adds pixel value of one image to pixel value of other
|
||||
@@ -422,6 +422,11 @@ ICV_EXPORT icv_image_t *icv_add(icv_image_t *img1, icv_image_t *img2);
|
||||
* image.
|
||||
*
|
||||
* Also it sanitizes the image.
|
||||
*
|
||||
* @param img1 First Image.
|
||||
* @param img2 Second Image.
|
||||
* @return New icv_image (img1 - img2)
|
||||
*
|
||||
*/
|
||||
ICV_EXPORT icv_image_t *icv_sub(icv_image_t *img1, icv_image_t *img2);
|
||||
|
||||
@@ -431,6 +436,11 @@ ICV_EXPORT icv_image_t *icv_sub(icv_image_t *img1, icv_image_t *img2);
|
||||
* image.
|
||||
*
|
||||
* Also it sanitizes the image.
|
||||
*
|
||||
* @param img1 First Image.
|
||||
* @param img2 Second Image.
|
||||
* @return New icv_image (img1 * img2)
|
||||
*
|
||||
*/
|
||||
ICV_EXPORT icv_image_t *icv_multiply(icv_image_t *img1, icv_image_t *img2);
|
||||
|
||||
@@ -440,8 +450,13 @@ ICV_EXPORT icv_image_t *icv_multiply(icv_image_t *img1, icv_image_t *img2);
|
||||
* image.
|
||||
*
|
||||
* Also it sanitizes the image.
|
||||
*
|
||||
* @param img1 First Image.
|
||||
* @param img2 Second Image.
|
||||
* @return New icv_image (img1 / img2)
|
||||
*
|
||||
*/
|
||||
ICV_EXPORT icv_image_t *icv_divides(icv_image_t *img1, icv_image_t *img2);
|
||||
ICV_EXPORT icv_image_t *icv_divide(icv_image_t *img1, icv_image_t *img2);
|
||||
|
||||
/**
|
||||
* Change the saturation of image pixels. If sat is set to 0.0 the
|
||||
@@ -471,14 +486,16 @@ typedef enum {
|
||||
ICV_FILTER_VERTICAL_GRAD,
|
||||
ICV_FILTER_HIGH_PASS,
|
||||
ICV_FILTER_NULL,
|
||||
ICV_FILTER_BOXCAR_AVERAGE,
|
||||
ICV_FILTER_3_LOW_PASS,
|
||||
ICV_FILTER_3_HIGH_PASS,
|
||||
ICV_FILTER_3_BOXCAR_AVERAGE,
|
||||
ICV_FILTER_3_ANIMATION_SMEAR,
|
||||
ICV_FILTER_3_NULL
|
||||
ICV_FILTER_BOXCAR_AVERAGE
|
||||
} ICV_FILTER;
|
||||
|
||||
typedef enum {
|
||||
ICV_FILTER3_LOW_PASS,
|
||||
ICV_FILTER3_HIGH_PASS,
|
||||
ICV_FILTER3_BOXCAR_AVERAGE,
|
||||
ICV_FILTER3_ANIMATION_SMEAR,
|
||||
ICV_FILTER3_NULL
|
||||
} ICV_FILTER3;
|
||||
|
||||
/**
|
||||
* Filters an image with the specified filter type. Basically
|
||||
@@ -497,13 +514,14 @@ ICV_EXPORT extern int icv_filter(icv_image_t *img, ICV_FILTER filter_type);
|
||||
* zero_padding for outbound pixels. Finds the resultant pixel with
|
||||
* the help of neighbouring pixels in all the three images.
|
||||
*
|
||||
*
|
||||
* @return Resultant image.
|
||||
*
|
||||
*/
|
||||
ICV_EXPORT extern icv_image_t *icv_filter3(icv_image_t *old_img,
|
||||
icv_image_t *curr_img,
|
||||
icv_image_t *new_img,
|
||||
ICV_FILTER filter_type);
|
||||
ICV_FILTER3 filter_type);
|
||||
|
||||
|
||||
/**
|
||||
@@ -588,16 +606,63 @@ ICV_EXPORT double *icv_sum(icv_image_t* img);
|
||||
*/
|
||||
ICV_EXPORT double *icv_max(icv_image_t* img);
|
||||
|
||||
/**
|
||||
* Calculates mode of the values of each channel.
|
||||
* Mode value are calculated for quantified data which is sent as
|
||||
* bins(histogram Information). For any image mode is a 'c' length
|
||||
* array where c is the number of channels.
|
||||
*
|
||||
* To calculate the mode of an icv_image, a default call is as follows
|
||||
* icv_mode(img, icv_hist(img, n_bins), n_bins);
|
||||
*
|
||||
* This call first calculates the histogram of the image. then finds
|
||||
* the mode values from histogram of each channel.
|
||||
*
|
||||
*/
|
||||
ICV_EXPORT int *icv_mode(icv_image_t* img, size_t** bins, int n_bins);
|
||||
|
||||
/**
|
||||
* Calculates median of the values of each channel.
|
||||
* Median value are calculated for quantified data which is sent as
|
||||
* bins(histogram information). For any image mode is a 'c' length
|
||||
* array, where c is the number of channels.
|
||||
*
|
||||
* To calculate the median of an icv_image, a default call is as
|
||||
* follows :
|
||||
* icv_median(img, icv_hist(img, n_bins), n_bins);
|
||||
*
|
||||
* This call first calculates the histogram of the image. then finds
|
||||
* the mode values from histogram of each channel.
|
||||
*
|
||||
*/
|
||||
ICV_EXPORT int *icv_median(icv_image_t* img, size_t** bins, int n_bins);
|
||||
|
||||
/**
|
||||
* Calculates the skewness in data.
|
||||
*
|
||||
* To calculate the skewness in an icv_image, a default call is as
|
||||
* follows :
|
||||
* icv_skew(img, icv_hist(img, n_bins), n_bins);
|
||||
*
|
||||
* @return c length double array where c is the number of channels in
|
||||
* the img
|
||||
*/
|
||||
ICV_EXPORT double *icv_skew(icv_image_t* img, size_t** bins, int n_bins);
|
||||
|
||||
/**
|
||||
* Calculates the variance in data.
|
||||
*
|
||||
* To calculate the variance in an icv_image, a default call is as
|
||||
* follows :
|
||||
* icv_variance(img, icv_hist(img, n_bins), n_bins);
|
||||
*
|
||||
* @return c length double array where c is the number of channels in
|
||||
* the img
|
||||
*/
|
||||
ICV_EXPORT double *icv_var(icv_image_t* img, size_t** bins, int n_bins);
|
||||
|
||||
|
||||
/** @file decimate.c
|
||||
/** @file size.c
|
||||
*
|
||||
* This file contains routines to scale down an image to a lower
|
||||
* resolution or scale up an image to an higher Resolution.
|
||||
@@ -633,14 +698,30 @@ typedef enum {
|
||||
* e.g. icv_resize(bif, ICV_RESIZE_BINTERP,1024,1024,0);
|
||||
* interpolates the output image to have the size of 1024X1024.
|
||||
*
|
||||
* resizes the image inplace.
|
||||
*
|
||||
* @param bif Image (packed in icv_image struct)
|
||||
* @param method One of the modes.
|
||||
* @param out_width Out Width.
|
||||
* @param out_height Out Height.
|
||||
* @param factor Integer type data representing the factor to be
|
||||
* shrunken
|
||||
* @return 0 on success and -1 on failure.
|
||||
*/
|
||||
|
||||
ICV_EXPORT int icv_resize(icv_image_t *bif, ICV_RESIZE_METHOD method, unsigned int out_width, unsigned int out_height, unsigned int factor);
|
||||
|
||||
|
||||
/** @} */
|
||||
/* end image utilities */
|
||||
|
||||
/**
|
||||
* I C V _ R O T
|
||||
*
|
||||
* Rotate an image.
|
||||
* %s [-rifb | -a angle] [-# bytes] [-s squaresize] [-w width] [-n height] [-o outputfile] inputfile [> outputfile]
|
||||
*
|
||||
*/
|
||||
ICV_EXPORT extern int icv_rot(int argv, char **argc);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __ICV_H__ */
|
||||
|
||||
+222
-112
@@ -2028,6 +2028,86 @@ struct rt_view_info {
|
||||
fastf_t curve_spacing;
|
||||
};
|
||||
|
||||
/**
|
||||
* R T _ S E L E C T I O N
|
||||
*
|
||||
* Specifies a subset of a primitive's geometry as the target for
|
||||
* an operation.
|
||||
*
|
||||
* TODO: This structure is tentative and subject to change or removal
|
||||
* without notice.
|
||||
*/
|
||||
struct rt_selection {
|
||||
void *s; /**< @brief primitive-specific selection object */
|
||||
};
|
||||
|
||||
/**
|
||||
* R T _ S E L E C T I O N _ L I S T
|
||||
*
|
||||
* TODO: This structure is tentative and subject to change or removal
|
||||
* without notice.
|
||||
*/
|
||||
struct rt_selection_list {
|
||||
struct bu_list l;
|
||||
struct rt_selection *obj;
|
||||
};
|
||||
|
||||
/**
|
||||
* R T _ S E L E C T I O N _ Q U E R Y
|
||||
*
|
||||
* Analogous to a database query. Specifies how to filter and sort
|
||||
* the selectable components of a primitive in order to find the most
|
||||
* relevant selections for a particular application.
|
||||
*
|
||||
* TODO: This structure is tentative and subject to change or removal
|
||||
* without notice.
|
||||
*/
|
||||
struct rt_selection_query {
|
||||
point_t start; /**< @brief start point of query ray */
|
||||
vect_t dir; /**< @brief direction of query ray */
|
||||
|
||||
/** Comparison function to specify a sort order for matching
|
||||
* selections. Should return <0 if the first selection should come
|
||||
* before the second selection, >0 if the second selection should
|
||||
* come before the first selection, and 0 otherwise.
|
||||
*
|
||||
* If cmp is NULL, selections are sorted by proximity to the start
|
||||
* point of the query ray.
|
||||
*/
|
||||
int (*cmp)(const struct rt_selection *, const struct rt_selection *);
|
||||
};
|
||||
|
||||
/**
|
||||
* R T _ S E L E C T I O N _ T R A N S L A T I O N
|
||||
*
|
||||
* Paramters of a translation applied to a selection.
|
||||
*
|
||||
* TODO: This structure is tentative and subject to change or removal
|
||||
* without notice.
|
||||
*/
|
||||
struct rt_selection_translation {
|
||||
fastf_t dx;
|
||||
fastf_t dy;
|
||||
fastf_t dz;
|
||||
};
|
||||
|
||||
/**
|
||||
* R T _ S E L E C T I O N _ O P E R A T I O N
|
||||
*
|
||||
* Describes an operation that can be applied to a selection.
|
||||
*
|
||||
* TODO: This structure is tentative and subject to change or removal
|
||||
* without notice.
|
||||
*/
|
||||
struct rt_selection_operation {
|
||||
#define RT_SELECTION_NOP 0
|
||||
#define RT_SELECTION_TRANSLATION 1
|
||||
int type;
|
||||
union {
|
||||
struct rt_selection_translation tran;
|
||||
} parameters;
|
||||
};
|
||||
|
||||
/**
|
||||
* R T _ F U N C T A B
|
||||
*
|
||||
@@ -2155,7 +2235,20 @@ struct rt_functab {
|
||||
int (*ft_oriented_bbox)(struct rt_arb_internal * /* bounding arb8 */,
|
||||
struct rt_db_internal * /*ip*/,
|
||||
const fastf_t);
|
||||
|
||||
/** get a list of the selections matching a query */
|
||||
struct rt_selection_list *(*ft_find_selections)(const struct rt_db_internal *,
|
||||
const struct rt_selection_query *);
|
||||
/** evaluate a logical selection expression (e.g. a INTERSECT b,
|
||||
* NOT a) to create a new selection
|
||||
*/
|
||||
struct rt_selection *(*ft_evaluate_selection)(const struct rt_db_internal *,
|
||||
int op,
|
||||
const struct rt_selection *,
|
||||
const struct rt_selection *);
|
||||
/** apply an operation to a selected subset of a primitive */
|
||||
int (*ft_process_selection)(struct rt_db_internal *,
|
||||
const struct rt_selection *,
|
||||
const struct rt_selection_operation *);
|
||||
};
|
||||
|
||||
|
||||
@@ -3657,112 +3750,56 @@ RT_EXPORT extern int db_full_path_match_top(const struct db_full_path *a,
|
||||
RT_EXPORT extern int db_full_path_search(const struct db_full_path *a,
|
||||
const struct directory *dp);
|
||||
|
||||
/**
|
||||
* search the database using a supplied list of filter criteria.
|
||||
* db_search_full_paths returns a bu_list of db_full_path structs to
|
||||
* instances of objects matching the filter criteria. Note that this is
|
||||
* a full path tree search of the entire database, not just the toplevel
|
||||
* objects that would be reported by the ls command. E.g., a
|
||||
* database with the following objects:
|
||||
*
|
||||
* r1 r2
|
||||
* | |
|
||||
* s1 s1
|
||||
*
|
||||
* would, if searched from the top level for s1, return both
|
||||
*
|
||||
* /r1/s1
|
||||
*
|
||||
* and
|
||||
*
|
||||
* /r2/s1
|
||||
*
|
||||
* instead of just s1. To iterate over the results, see examples of
|
||||
* iterating over bu_list structures. (Bear in mind the db_full_path
|
||||
* structures in the list are individually malloced.)
|
||||
*
|
||||
* To return only unique objects, use
|
||||
* db_search_unique_objects, which would return just
|
||||
*
|
||||
* s1
|
||||
*
|
||||
* in the above example. db_search_unique_objects returns a bu_ptbl of
|
||||
* (struct directory *) pointers. To iterate over this list use
|
||||
* BU_PTBL_LEN to get the size of the table and BU_PTBL_GET in a for
|
||||
* loop to access each element.
|
||||
*
|
||||
*/
|
||||
|
||||
/* search.c */
|
||||
|
||||
|
||||
/* DEPRECATED - db_full_path_list structure is replaced by
|
||||
* bu_ptbl and char ** arrays in new search functionality*/
|
||||
struct db_full_path_list {
|
||||
struct bu_list l;
|
||||
struct db_full_path *path;
|
||||
int local;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add an object to the db_full_path_list based on its database object name
|
||||
*/
|
||||
RT_EXPORT extern int db_full_path_list_add(const char *path, int local, struct db_i *dbip, struct db_full_path_list *path_list);
|
||||
|
||||
/**
|
||||
* Free all entries and the list of a db_full_path_list
|
||||
*/
|
||||
RT_EXPORT extern void db_free_full_path_list(struct db_full_path_list *path_list);
|
||||
|
||||
/**
|
||||
* Low level command to process the command line and create a "plan" corresponding to the
|
||||
* command arguments.
|
||||
*/
|
||||
RT_EXPORT extern void *db_search_formplan(char **argv,
|
||||
DEPRECATED RT_EXPORT extern int db_full_path_list_add(const char *path, int local, struct db_i *dbip, struct db_full_path_list *path_list);
|
||||
DEPRECATED RT_EXPORT extern void db_free_full_path_list(struct db_full_path_list *path_list);
|
||||
DEPRECATED RT_EXPORT extern void *db_search_formplan(char **argv,
|
||||
struct db_i *dbip,
|
||||
struct rt_wdb *wdbp);
|
||||
|
||||
/**
|
||||
* release memory for the formulated plan returned by
|
||||
* db_search_formplan().
|
||||
*/
|
||||
RT_EXPORT extern void db_search_freeplan(void **plan);
|
||||
|
||||
/**
|
||||
* Low level routines for invocation of search plans
|
||||
*/
|
||||
RT_EXPORT extern struct db_full_path_list *db_search_full_paths(void *searchplan,
|
||||
DEPRECATED RT_EXPORT extern void db_search_freeplan(void **plan);
|
||||
DEPRECATED RT_EXPORT extern struct db_full_path_list *db_search_full_paths(void *searchplan,
|
||||
struct db_full_path_list *path_list,
|
||||
struct db_i *dbip,
|
||||
struct rt_wdb *wdbp);
|
||||
|
||||
RT_EXPORT extern struct bu_ptbl *db_search_unique_objects(void *searchplan,
|
||||
DEPRECATED RT_EXPORT extern struct bu_ptbl *db_search_unique_objects(void *searchplan,
|
||||
struct db_full_path_list *path_list,
|
||||
struct db_i *dbip,
|
||||
struct rt_wdb *wdbp);
|
||||
|
||||
/* search.c */
|
||||
/**
|
||||
* Use the string form of a search plan to build and execute a search
|
||||
*/
|
||||
RT_EXPORT extern struct db_full_path_list *db_search_full_paths_strplan(const char *plan_string,
|
||||
struct db_full_path_list *path_list,
|
||||
struct db_i *dbip,
|
||||
struct rt_wdb *wdbp);
|
||||
|
||||
RT_EXPORT extern struct bu_ptbl *db_search_unique_objects_strplan(const char *plan_string,
|
||||
struct db_full_path_list *path_list,
|
||||
struct db_i *dbip,
|
||||
struct rt_wdb *wdbp);
|
||||
|
||||
/**
|
||||
* TODO: PROPOSED API for search functionality
|
||||
* D B _ S E A R C H _ P A T H
|
||||
*
|
||||
* This is the proposed replacement to all of the preceding search functionality -
|
||||
* the previous API calls will .
|
||||
* Programmatic interface to the find-command style search functionality
|
||||
* available in librt for databases. These functions search the
|
||||
* database using a supplied list of filter criteria and return either
|
||||
* db_full_path instances or directory pointers (depending on the function).
|
||||
* Both types of returns use a bu_ptbl container to hold the set of results.
|
||||
*
|
||||
* Design notes:
|
||||
*
|
||||
* * As long as struct db_i retains its pointer back to its parent rt_wdb
|
||||
* structure, and dbip is a parameter in rt_wdb, only one of the two is
|
||||
* needed as a parameter and either will work. Probably go with rt_wdb,
|
||||
* since it isn't tagged as private within the data structure definition.
|
||||
* since it isn't tagged as private within the data structure definition,
|
||||
* but on the other hand some ways db_i would be preferable since it
|
||||
* would allow the search functions to break out cleanly into a
|
||||
* hypothetical libgio/libdb that is separate from the raytracing.
|
||||
* Unfortunately, the need to get to the internal form of some of the
|
||||
* primitives means we do need rt_wdb available for now. If the ways
|
||||
* search currently is accessing rt_wdb could be avoided with a future
|
||||
* improvement/redesign, then db_i and using the private link to rt_wdb
|
||||
* is justified. Need to discuss before this API is finalized.
|
||||
*
|
||||
* * Plan strings are the most intuitive way for humans to spell out a search
|
||||
* pattern - db_search_formplan becomes a behind-the-scenes function that
|
||||
@@ -3772,42 +3809,70 @@ RT_EXPORT extern struct bu_ptbl *db_search_unique_objects_strplan(const char *pl
|
||||
* sufficient justification for the added API complexity without hard
|
||||
* evidence that complexity is needed.
|
||||
*
|
||||
* * Instead of having the user go through the trouble of generating full
|
||||
* path structures from string inputs, just accept char pointers to
|
||||
* object or path names and build the necessary additional data structures
|
||||
* in the backend. Again, minor possible performance gain from path list
|
||||
* re-use doesn't justify more API complexity without compelling evidence
|
||||
* it is needed.
|
||||
* * Offer simple function calls for the common cases of one path and an
|
||||
* array of paths, and for both input cases support returning either
|
||||
* a db_full_path set or a unique directory pointer set via table. This
|
||||
* should cover the most common programmatic situations, while still
|
||||
* allowing commands enough flexibility to do what they need to (see,
|
||||
* for example, combining results from search sets (multiple arrays
|
||||
* of paths) in libged's search result consolidation.)
|
||||
*
|
||||
* * instead of having multiple search function calls, add a search type
|
||||
* parameter that toggles between various search types. All of them can
|
||||
* return a bu_ptbl of pointers to db full paths, and the search type
|
||||
* will control how the search is done and what the expectations/guarantees
|
||||
* are for the results.
|
||||
* * Need to add a plan option for dealing with hidden geometry during the search,
|
||||
* maybe -nohide or something like that... The traversal by default shouldn't
|
||||
* traverse down anything hidden, but we should be able to override that at user request.
|
||||
*
|
||||
* * Need a flag to know what to do about hidden geometry during the search,
|
||||
* unless we make that one of the plan options - maybe -nohide or something
|
||||
* like that...
|
||||
* WARNING: THESE FUNCTIONS ARE STILL IN DEVELOPMENT - IT IS NOT YET
|
||||
* ASSUMED THAT THE SEARCH API IS IN ITS FINAL FORM - DO NOT DEPEND ON IT
|
||||
* REMAINING THE SAME UNTIL THIS WARNING IS REMOVED
|
||||
*
|
||||
* * One possible option to the enums for search types is to rely fully on the
|
||||
* first character of the path strings (which are currently fully informative in the
|
||||
* libged search command line interface) but the difficulty there is if more
|
||||
* search styles are added initial path string characters are a very constraining
|
||||
* selection mechanism. For future proofing I think the input conventions on the
|
||||
* path strings should be handled above this level.
|
||||
*/
|
||||
RT_EXPORT extern struct bu_ptbl *db_search_path(const char *plan_string,
|
||||
struct directory *dp,
|
||||
struct rt_wdb *wdbp);
|
||||
RT_EXPORT extern struct bu_ptbl *db_search_paths(const char *plan_string,
|
||||
int path_cnt,
|
||||
struct directory **paths,
|
||||
struct rt_wdb *wdbp);
|
||||
|
||||
/* Available search types */
|
||||
enum {
|
||||
DB_SEARCH_STANDARD = 0, /* Full path tree search starting with the set of objects having no parents */
|
||||
DB_SEARCH_UNIQ_OBJ, /* Like DB_SEARCH_STANDARD, but returns only unique object list without paths */
|
||||
DB_SEARCH_FLAT /* Instead of only starting with objects that don't have a parent, all objects are starting points for a full path tree search*/
|
||||
};
|
||||
/* Because the handling of the plan is now wrapped up inside the
|
||||
* search commands, we need a way to check ahead of time to see
|
||||
* if the string we have is valid. Not an issue for hard-coded
|
||||
* search strings in C logic, but may be needed when the string
|
||||
* is user (or script) generated.
|
||||
*
|
||||
* Returns: 1 if plan is valid, 0 if it is not */
|
||||
RT_EXPORT extern int db_search_plan_validate(const char *plan_string);
|
||||
|
||||
RT_EXPORT extern struct bu_ptbl *db_search(const char *plan_string,
|
||||
const char *path_strings[],
|
||||
struct rt_wdb *wdbp,
|
||||
int search_type);
|
||||
/* Properly free the tables returned by db_search_path and db_search_paths */
|
||||
RT_EXPORT extern void db_free_search_tbl(struct bu_ptbl *search_results);
|
||||
|
||||
/* Because a list of unique directory pointers is a common output
|
||||
* needed from search, functions are provided that produce a
|
||||
* table of directory pointers to unique leaf objects from the search
|
||||
* results. Note that db_free_search_tbl does *not* free the table returned
|
||||
* by db_search_obj, but a custom free is not needed - only directory
|
||||
* pointers are stored in the table, so a normal bu_ptbl_free combined
|
||||
* with a freeing of the table structure itself is sufficient.
|
||||
*/
|
||||
RT_EXPORT extern struct bu_ptbl *db_search_path_obj(const char *plan_string,
|
||||
struct directory *dp,
|
||||
struct rt_wdb *wdbp);
|
||||
RT_EXPORT extern struct bu_ptbl *db_search_paths_obj(const char *plan_string,
|
||||
int path_cnt,
|
||||
struct directory **paths,
|
||||
struct rt_wdb *wdbp);
|
||||
|
||||
/* For situations where performance is critical and there are no
|
||||
* search criteria that depend on depth (for example, wanting a list
|
||||
* of all brep objects with name matching pattern *.b) a truly flat
|
||||
* iteration through the directory objects will be much faster.
|
||||
*
|
||||
* Returns a bu_ptbl of directory pointers, since full paths are
|
||||
* meaningless in this type of search
|
||||
*/
|
||||
RT_EXPORT extern struct bu_ptbl *db_search_flat(const char *plan_string,
|
||||
struct rt_wdb *wdbp,
|
||||
int flags);
|
||||
|
||||
/* db_open.c */
|
||||
/**
|
||||
@@ -4912,6 +4977,7 @@ RT_EXPORT extern struct bu_ptbl *db_lookup_by_attr(struct db_i *dbip,
|
||||
int dir_flags,
|
||||
struct bu_attribute_value_set *avs,
|
||||
int op);
|
||||
|
||||
/* add entry to directory */
|
||||
|
||||
/**
|
||||
@@ -5035,6 +5101,50 @@ RT_EXPORT extern int db_regexp_match_all(struct bu_vls *dest,
|
||||
struct db_i *dbip,
|
||||
const char *pattern);
|
||||
|
||||
/* db_ls.c */
|
||||
/**
|
||||
* db_ls takes a database instance pointer and assembles a
|
||||
* directory pointer array of objects in the database according
|
||||
* to a set of flags.
|
||||
*
|
||||
* The caller is responsible for freeing the array.
|
||||
*
|
||||
* Returns -
|
||||
* integer count of objects in dpv
|
||||
* struct directory ** array of objects in dpv via argument
|
||||
*
|
||||
* WARNING: THIS FUNCTION IS STILL IN DEVELOPMENT - IT IS NOT YET
|
||||
* ASSUMED THAT THIS IS ITS FINAL FORM - DO NOT DEPEND ON IT REMAINING
|
||||
* THE SAME UNTIL THIS WARNING IS REMOVED
|
||||
*/
|
||||
#define DB_LS_PRIM 0x1 /* filter for primitives (solids)*/
|
||||
#define DB_LS_COMB 0x2 /* filter for combinations */
|
||||
#define DB_LS_REGION 0x4 /* filter for regions */
|
||||
#define DB_LS_HIDDEN 0x8 /* include hidden objects in results */
|
||||
#define DB_LS_NON_GEOM 0x10 /* filter for non-geometry objects */
|
||||
#define DB_LS_TOPS 0x20 /* filter for objects un-referenced by other objects */
|
||||
RT_EXPORT extern int db_ls(const struct db_i *dbip,
|
||||
int flags,
|
||||
struct directory ***dpv);
|
||||
|
||||
/**
|
||||
* convert an argv list of names to a directory pointer array.
|
||||
*
|
||||
* If db_lookup fails for any individual argv, an empty directory
|
||||
* structure is created and assigned the name and RT_DIR_PHONY_ADDR
|
||||
*
|
||||
* The returned directory ** structure is NULL terminated.
|
||||
*/
|
||||
RT_EXPORT extern struct directory **db_argv_to_dpv(const struct db_i *dbip,
|
||||
const char **argv);
|
||||
|
||||
|
||||
/**
|
||||
* convert a directory pointer array to an argv char pointer array.
|
||||
*/
|
||||
RT_EXPORT extern char **db_dpv_to_argv(struct directory **dpv);
|
||||
|
||||
|
||||
/* db_flags.c */
|
||||
/**
|
||||
* Given the internal form of a database object, return the
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ SYSV_EXPORT extern void *memset(void *s, int c, size_t n);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCHR
|
||||
SYSV_EXPORT extern char *strchr(char *sp, char c);
|
||||
SYSV_EXPORT extern char *strchr(const char *sp, int c);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#define __TCLCAD_H__
|
||||
|
||||
#include "common.h"
|
||||
#include "cmd.h"
|
||||
#include "tcl.h"
|
||||
#include "ged.h"
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ include(CheckIncludeFileCXX)
|
||||
include(CheckTypeSize)
|
||||
include(CheckLibraryExists)
|
||||
include(CheckStructHasMember)
|
||||
include(CheckCInline)
|
||||
|
||||
|
||||
###
|
||||
@@ -268,7 +269,7 @@ macro(BRLCAD_CHECK_C99_FORMAT_SPECIFIERS)
|
||||
set(CMAKE_C_FLAGS_TMP "${CMAKE_C_FLAGS}")
|
||||
set(CMAKE_C_FLAGS "")
|
||||
set(CMAKE_REQUIRED_DEFINITIONS_BAK ${CMAKE_REQUIRED_DEFINITIONS})
|
||||
CHECK_INCLUDE_file(stdint.h HAVE_STDINT_H)
|
||||
CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
|
||||
if(HAVE_STDINT_H)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "-DHAVE_STDINT_H=1")
|
||||
endif(HAVE_STDINT_H)
|
||||
|
||||
@@ -40,23 +40,23 @@
|
||||
# -fast-math results in non-IEEE floating point math among a handful
|
||||
# of other optimizations that cause substantial error in ray tracing
|
||||
# and tessellation (and probably more).
|
||||
BRLCAD_CHECK_C_FLAG(O3 GROUPS OPTIMIZE_C_FLAGS)
|
||||
BRLCAD_CHECK_C_FLAG(fstrength-reduce GROUPS OPTIMIZE_C_FLAGS)
|
||||
BRLCAD_CHECK_C_FLAG(fexpensive-optimizations GROUPS OPTIMIZE_C_FLAGS)
|
||||
BRLCAD_CHECK_C_FLAG(finline-functions GROUPS OPTIMIZE_C_FLAGS)
|
||||
BRLCAD_CHECK_C_FLAG("finline-limit=10000 --param inline-unit-growth=300 --param large-function-growth=300" GROUPS OPTIMIZE_C_FLAGS)
|
||||
BRLCAD_CHECK_CXX_FLAG(O3 GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
BRLCAD_CHECK_CXX_FLAG(fstrength-reduce GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
BRLCAD_CHECK_CXX_FLAG(fexpensive-optimizations GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
BRLCAD_CHECK_CXX_FLAG(finline-functions GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
BRLCAD_CHECK_CXX_FLAG("finline-limit=10000 --param inline-unit-growth=300 --param large-function-growth=300" GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
CHECK_C_FLAG(O3 GROUPS OPTIMIZE_C_FLAGS)
|
||||
CHECK_C_FLAG(fstrength-reduce GROUPS OPTIMIZE_C_FLAGS)
|
||||
CHECK_C_FLAG(fexpensive-optimizations GROUPS OPTIMIZE_C_FLAGS)
|
||||
CHECK_C_FLAG(finline-functions GROUPS OPTIMIZE_C_FLAGS)
|
||||
CHECK_C_FLAG("finline-limit=10000 --param inline-unit-growth=300 --param large-function-growth=300" GROUPS OPTIMIZE_C_FLAGS)
|
||||
CHECK_CXX_FLAG(O3 GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
CHECK_CXX_FLAG(fstrength-reduce GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
CHECK_CXX_FLAG(fexpensive-optimizations GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
CHECK_CXX_FLAG(finline-functions GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
CHECK_CXX_FLAG("finline-limit=10000 --param inline-unit-growth=300 --param large-function-growth=300" GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
if(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
|
||||
if(NOT BRLCAD_ENABLE_PROFILING AND NOT BRLCAD_FLAGS_DEBUG)
|
||||
BRLCAD_CHECK_C_FLAG(fomit-frame-pointer GROUPS OPTIMIZE_C_FLAGS)
|
||||
BRLCAD_CHECK_CXX_FLAG(fomit-frame-pointer GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
CHECK_C_FLAG(fomit-frame-pointer GROUPS OPTIMIZE_C_FLAGS)
|
||||
CHECK_CXX_FLAG(fomit-frame-pointer GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
else(NOT BRLCAD_ENABLE_PROFILING AND NOT BRLCAD_FLAGS_DEBUG)
|
||||
BRLCAD_CHECK_C_FLAG(fno-omit-frame-pointer GROUPS OPTIMIZE_C_FLAGS)
|
||||
BRLCAD_CHECK_CXX_FLAG(fno-omit-frame-pointer GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
CHECK_C_FLAG(fno-omit-frame-pointer GROUPS OPTIMIZE_C_FLAGS)
|
||||
CHECK_CXX_FLAG(fno-omit-frame-pointer GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
endif(NOT BRLCAD_ENABLE_PROFILING AND NOT BRLCAD_FLAGS_DEBUG)
|
||||
endif(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
|
||||
|
||||
@@ -83,11 +83,11 @@ endif(opt_conf_list)
|
||||
# only when compiling unoptimized (because the extra barrier checks
|
||||
# can affect the memory footprint and runtime performance.
|
||||
if(${BRLCAD_OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG)
|
||||
BRLCAD_CHECK_C_FLAG(fstack-protector-all)
|
||||
BRLCAD_CHECK_CXX_FLAG(fstack-protector-all)
|
||||
CHECK_C_FLAG(fstack-protector-all)
|
||||
CHECK_CXX_FLAG(fstack-protector-all)
|
||||
# checking both in case compiling c/c++ with different compilers
|
||||
BRLCAD_CHECK_C_FLAG(qstackprotect)
|
||||
BRLCAD_CHECK_CXX_FLAG(qstackprotect)
|
||||
CHECK_C_FLAG(qstackprotect)
|
||||
CHECK_CXX_FLAG(qstackprotect)
|
||||
endif(${BRLCAD_OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG)
|
||||
|
||||
# verbose warning flags. we intentionally try to turn on as many as
|
||||
@@ -96,58 +96,58 @@ endif(${BRLCAD_OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG)
|
||||
if(BRLCAD_ENABLE_COMPILER_WARNINGS OR BRLCAD_ENABLE_STRICT)
|
||||
# also of interest:
|
||||
# -Wunreachable-code -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -ansi
|
||||
# -Wformat=2 (after bu_fopen_uniq() is obsolete)
|
||||
BRLCAD_CHECK_C_FLAG(pedantic)
|
||||
BRLCAD_CHECK_CXX_FLAG(pedantic)
|
||||
# -Wformat=2 (after bu_fopen_uniq() is obsolete) -Wdocumentation (for Doxygen comments)
|
||||
CHECK_C_FLAG(pedantic)
|
||||
CHECK_CXX_FLAG(pedantic)
|
||||
|
||||
# FIXME: The Wall warnings are too verbose with Visual C++ (for
|
||||
# now). we have a lot to clean up.
|
||||
if(NOT MSVC)
|
||||
BRLCAD_CHECK_C_FLAG(Wall)
|
||||
BRLCAD_CHECK_CXX_FLAG(Wall)
|
||||
CHECK_C_FLAG(Wall)
|
||||
CHECK_CXX_FLAG(Wall)
|
||||
else(NOT MSVC)
|
||||
BRLCAD_CHECK_C_FLAG(W4)
|
||||
BRLCAD_CHECK_CXX_FLAG(W4)
|
||||
CHECK_C_FLAG(W4)
|
||||
CHECK_CXX_FLAG(W4)
|
||||
endif(NOT MSVC)
|
||||
|
||||
BRLCAD_CHECK_C_FLAG(Wextra)
|
||||
BRLCAD_CHECK_CXX_FLAG(Wextra)
|
||||
CHECK_C_FLAG(Wextra)
|
||||
CHECK_CXX_FLAG(Wextra)
|
||||
|
||||
BRLCAD_CHECK_C_FLAG(Wundef)
|
||||
BRLCAD_CHECK_CXX_FLAG(Wundef)
|
||||
CHECK_C_FLAG(Wundef)
|
||||
CHECK_CXX_FLAG(Wundef)
|
||||
|
||||
BRLCAD_CHECK_C_FLAG(Wfloat-equal)
|
||||
BRLCAD_CHECK_CXX_FLAG(Wfloat-equal)
|
||||
CHECK_C_FLAG(Wfloat-equal)
|
||||
CHECK_CXX_FLAG(Wfloat-equal)
|
||||
|
||||
BRLCAD_CHECK_C_FLAG(Wshadow)
|
||||
BRLCAD_CHECK_CXX_FLAG(Wshadow)
|
||||
CHECK_C_FLAG(Wshadow)
|
||||
CHECK_CXX_FLAG(Wshadow)
|
||||
|
||||
# report where we throw away const
|
||||
# BRLCAD_CHECK_C_FLAG(Wcast-qual)
|
||||
# BRLCAD_CHECK_CXX_FLAG(Wcast-qual)
|
||||
# CHECK_C_FLAG(Wcast-qual)
|
||||
# CHECK_CXX_FLAG(Wcast-qual)
|
||||
|
||||
# check for redundant declarations
|
||||
# BRLCAD_CHECK_C_FLAG(Wredundant-decls)
|
||||
# BRLCAD_CHECK_CXX_FLAG(Wredundant-decls)
|
||||
# CHECK_C_FLAG(Wredundant-decls)
|
||||
# CHECK_CXX_FLAG(Wredundant-decls)
|
||||
|
||||
# want C inline warnings, but versions of g++ (circa 4.7) spew
|
||||
# unquellable bogus warnings on default constructors that we don't
|
||||
# have access to (e.g., in opennurbs and boost), so turn them off
|
||||
BRLCAD_CHECK_C_FLAG(Winline)
|
||||
BRLCAD_CHECK_CXX_FLAG(Wno-inline)
|
||||
CHECK_C_FLAG(Winline)
|
||||
CHECK_CXX_FLAG(Wno-inline)
|
||||
|
||||
# Need this for tcl.h
|
||||
BRLCAD_CHECK_C_FLAG(Wno-long-long)
|
||||
BRLCAD_CHECK_CXX_FLAG(Wno-long-long)
|
||||
CHECK_C_FLAG(Wno-long-long)
|
||||
CHECK_CXX_FLAG(Wno-long-long)
|
||||
|
||||
# Need this for X11 headers using variadic macros
|
||||
BRLCAD_CHECK_C_FLAG(Wno-variadic-macros)
|
||||
BRLCAD_CHECK_CXX_FLAG(Wno-variadic-macros)
|
||||
CHECK_C_FLAG(Wno-variadic-macros)
|
||||
CHECK_CXX_FLAG(Wno-variadic-macros)
|
||||
endif(BRLCAD_ENABLE_COMPILER_WARNINGS OR BRLCAD_ENABLE_STRICT)
|
||||
|
||||
if(BRLCAD_ENABLE_STRICT)
|
||||
BRLCAD_CHECK_C_FLAG(Werror)
|
||||
BRLCAD_CHECK_CXX_FLAG(Werror)
|
||||
CHECK_C_FLAG(Werror)
|
||||
CHECK_CXX_FLAG(Werror)
|
||||
endif(BRLCAD_ENABLE_STRICT)
|
||||
|
||||
# End detection of flags intended for BRL-CAD use. Make sure all variables have
|
||||
|
||||
@@ -230,12 +230,15 @@ set(BRLCAD_OPENNURBS_BUILD_LABEL "Compile openNURBS ")
|
||||
set(BRLCAD_SCL_BUILD_LABEL "Compile NIST STEP Class Libraries ")
|
||||
set(BRLCAD_ENABLE_X11_LABEL "X11 support (optional) ")
|
||||
set(BRLCAD_ENABLE_OPENGL_LABEL "OpenGL support (optional) ")
|
||||
set(BRLCAD_ENABLE_QT_LABEL "Qt support (optional) ")
|
||||
set(BRLCAD_ENABLE_RTSERVER_LABEL "librtserver JDK support (optional) ")
|
||||
set(BRLCAD_ENABLE_RUNTIME_DEBUG_LABEL "Enable run-time debugging (optional) ")
|
||||
set(BRLCAD_ARCH_BITSETTING_LABEL "Build 32/64-bit release ")
|
||||
set(BRLCAD_OPTIMIZED_BUILD_LABEL "Build optimized release ")
|
||||
set(BRLCAD_FLAGS_DEBUG_LABEL "Build debuggable release")
|
||||
set(BRLCAD_ENABLE_PROFILING_LABEL "Build profile release ")
|
||||
set(C_COMPILER_STANDARD_LABEL "C compiler standard ")
|
||||
set(CXX_COMPILER_STANDARD_LABEL "C++ compiler standard")
|
||||
set(BRLCAD_ENABLE_SMP_LABEL "Build SMP-capable release ")
|
||||
set(BUILD_STATIC_LIBS_LABEL "Build static libraries ")
|
||||
set(BUILD_SHARED_LIBS_LABEL "Build dynamic libraries ")
|
||||
@@ -251,14 +254,15 @@ set(BUILD_REPORT_ITEMS
|
||||
|
||||
set(FEATURE_REPORT_ITEMS
|
||||
BRLCAD_ENABLE_X11 BRLCAD_ENABLE_OPENGL BRLCAD_ENABLE_RTSERVER
|
||||
BRLCAD_ENABLE_RUNTIME_DEBUG)
|
||||
BRLCAD_ENABLE_RUNTIME_DEBUG BRLCAD_ENABLE_QT)
|
||||
|
||||
set(OTHER_REPORT_ITEMS
|
||||
BRLCAD_ARCH_BITSETTING BRLCAD_OPTIMIZED_BUILD
|
||||
BRLCAD_FLAGS_DEBUG BRLCAD_ENABLE_PROFILING
|
||||
BRLCAD_ENABLE_SMP BUILD_STATIC_LIBS BUILD_SHARED_LIBS
|
||||
BRLCAD_ENABLE_COMPILER_WARNINGS BRLCAD_ENABLE_VERBOSE_PROGRESS
|
||||
BRLCAD_INSTALL_EXAMPLE_GEOMETRY BRLCAD_DOCBOOK_BUILD)
|
||||
BRLCAD_INSTALL_EXAMPLE_GEOMETRY BRLCAD_DOCBOOK_BUILD
|
||||
C_COMPILER_STANDARD CXX_COMPILER_STANDARD)
|
||||
|
||||
# Construct list of all items
|
||||
set(ALL_ITEMS)
|
||||
|
||||
@@ -52,7 +52,7 @@ endmacro(CHECK_OPT)
|
||||
# Take a target definition and find out what definitions its libraries
|
||||
# are using
|
||||
macro(GET_TARGET_DEFINES targetname target_libs)
|
||||
# Take care of compile flags and definitions
|
||||
# Take care of compile flags and definitions
|
||||
foreach(libitem ${target_libs})
|
||||
list(FIND BRLCAD_LIBS ${libitem} FOUNDIT)
|
||||
if(NOT ${FOUNDIT} STREQUAL "-1")
|
||||
@@ -113,26 +113,26 @@ endmacro(GET_TARGET_FLAGS)
|
||||
# When a build target source file list contains files that are NOT all
|
||||
# one language, we need to apply flags on a per-file basis
|
||||
macro(FLAGS_TO_FILES srcslist targetname)
|
||||
foreach(srcfile ${srcslist})
|
||||
get_property(file_language SOURCE ${srcfile} PROPERTY LANGUAGE)
|
||||
if(NOT file_language)
|
||||
get_filename_component(srcfile_ext ${srcfile} EXT)
|
||||
if(${srcfile_ext} STREQUAL ".cxx" OR ${srcfile_ext} STREQUAL ".cpp" OR ${srcfile_ext} STREQUAL ".cc")
|
||||
set(file_language CXX)
|
||||
endif(${srcfile_ext} STREQUAL ".cxx" OR ${srcfile_ext} STREQUAL ".cpp" OR ${srcfile_ext} STREQUAL ".cc")
|
||||
if(${srcfile_ext} STREQUAL ".c")
|
||||
set(file_language C)
|
||||
endif(${srcfile_ext} STREQUAL ".c")
|
||||
endif(NOT file_language)
|
||||
if(file_language)
|
||||
foreach(lib_flag ${${targetname}_${file_language}_FLAGS})
|
||||
set_property(SOURCE ${srcfile} APPEND PROPERTY COMPILE_FLAGS "${lib_flag}")
|
||||
endforeach(lib_flag ${${targetname}_${file_language}_FLAGS})
|
||||
endif(file_language)
|
||||
if("${file_language}" STREQUAL "C" AND NOT "${C_INLINE}" STREQUAL "inline")
|
||||
set_property(SOURCE ${srcfile} APPEND PROPERTY COMPILE_DEFINITIONS "inline=${C_INLINE}")
|
||||
endif("${file_language}" STREQUAL "C" AND NOT "${C_INLINE}" STREQUAL "inline")
|
||||
endforeach(srcfile ${srcslist})
|
||||
foreach(srcfile ${srcslist})
|
||||
get_property(file_language SOURCE ${srcfile} PROPERTY LANGUAGE)
|
||||
if(NOT file_language)
|
||||
get_filename_component(srcfile_ext ${srcfile} EXT)
|
||||
if(${srcfile_ext} STREQUAL ".cxx" OR ${srcfile_ext} STREQUAL ".cpp" OR ${srcfile_ext} STREQUAL ".cc")
|
||||
set(file_language CXX)
|
||||
endif(${srcfile_ext} STREQUAL ".cxx" OR ${srcfile_ext} STREQUAL ".cpp" OR ${srcfile_ext} STREQUAL ".cc")
|
||||
if(${srcfile_ext} STREQUAL ".c")
|
||||
set(file_language C)
|
||||
endif(${srcfile_ext} STREQUAL ".c")
|
||||
endif(NOT file_language)
|
||||
if(file_language)
|
||||
foreach(lib_flag ${${targetname}_${file_language}_FLAGS})
|
||||
set_property(SOURCE ${srcfile} APPEND PROPERTY COMPILE_FLAGS "${lib_flag}")
|
||||
endforeach(lib_flag ${${targetname}_${file_language}_FLAGS})
|
||||
endif(file_language)
|
||||
if("${file_language}" STREQUAL "C" AND NOT "${C_INLINE}" STREQUAL "inline")
|
||||
set_property(SOURCE ${srcfile} APPEND PROPERTY COMPILE_DEFINITIONS "inline=${C_INLINE}")
|
||||
endif("${file_language}" STREQUAL "C" AND NOT "${C_INLINE}" STREQUAL "inline")
|
||||
endforeach(srcfile ${srcslist})
|
||||
endmacro(FLAGS_TO_FILES)
|
||||
|
||||
# Handle C++ NO_STRICT settings
|
||||
@@ -211,17 +211,17 @@ macro(BRLCAD_ADDEXEC execname srcslist libslist)
|
||||
foreach(lib_flag ${${execname}_${exec_type}_FLAGS})
|
||||
set_property(TARGET ${execname} APPEND PROPERTY COMPILE_FLAGS "${lib_flag}")
|
||||
endforeach(lib_flag ${${execname}_${exec_type}_FLAGS})
|
||||
if(NOT "${C_INLINE}" STREQUAL "inline" AND "${exec_type}" STREQUAL "C")
|
||||
set_property(TARGET ${execname} APPEND PROPERTY COMPILE_DEFINITIONS "inline=${C_INLINE}")
|
||||
endif(NOT "${C_INLINE}" STREQUAL "inline" AND "${exec_type}" STREQUAL "C")
|
||||
if(NOT "${C_INLINE}" STREQUAL "inline" AND "${exec_type}" STREQUAL "C")
|
||||
set_property(TARGET ${execname} APPEND PROPERTY COMPILE_DEFINITIONS "inline=${C_INLINE}")
|
||||
endif(NOT "${C_INLINE}" STREQUAL "inline" AND "${exec_type}" STREQUAL "C")
|
||||
endif(${exec_type} STREQUAL "MIXED")
|
||||
|
||||
# If this target is marked as incompatible with the strict flags, disable them
|
||||
foreach(extraarg ${ARGN})
|
||||
if(${extraarg} MATCHES "NO_STRICT$" AND BRLCAD_ENABLE_STRICT)
|
||||
if(NOERROR_FLAG)
|
||||
set_property(TARGET ${execname} APPEND PROPERTY COMPILE_FLAGS "-Wno-error")
|
||||
endif(NOERROR_FLAG)
|
||||
set_property(TARGET ${execname} APPEND PROPERTY COMPILE_FLAGS "-Wno-error")
|
||||
endif(NOERROR_FLAG)
|
||||
endif(${extraarg} MATCHES "NO_STRICT$" AND BRLCAD_ENABLE_STRICT)
|
||||
endforeach(extraarg ${ARGN})
|
||||
|
||||
@@ -307,13 +307,13 @@ macro(BRLCAD_ADDLIB libname srcslist libslist)
|
||||
# If we haven't already taken care of the flags on a per-file basis,
|
||||
# apply them to the target now that we have one.
|
||||
if(NOT ${lib_type} STREQUAL "MIXED")
|
||||
# All one language - we can apply the flags to the target
|
||||
foreach(lib_flag ${${libname}_${lib_type}_FLAGS})
|
||||
set_property(TARGET ${libname} APPEND PROPERTY COMPILE_FLAGS "${lib_flag}")
|
||||
endforeach(lib_flag ${${libname}_${lib_type}_FLAGS})
|
||||
if(NOT "${C_INLINE}" STREQUAL "inline" AND "${lib_type}" STREQUAL "C")
|
||||
set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS "inline=${C_INLINE}")
|
||||
endif(NOT "${C_INLINE}" STREQUAL "inline" AND "${lib_type}" STREQUAL "C")
|
||||
# All one language - we can apply the flags to the target
|
||||
foreach(lib_flag ${${libname}_${lib_type}_FLAGS})
|
||||
set_property(TARGET ${libname} APPEND PROPERTY COMPILE_FLAGS "${lib_flag}")
|
||||
endforeach(lib_flag ${${libname}_${lib_type}_FLAGS})
|
||||
if(NOT "${C_INLINE}" STREQUAL "inline" AND "${lib_type}" STREQUAL "C")
|
||||
set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS "inline=${C_INLINE}")
|
||||
endif(NOT "${C_INLINE}" STREQUAL "inline" AND "${lib_type}" STREQUAL "C")
|
||||
endif(NOT ${lib_type} STREQUAL "MIXED")
|
||||
|
||||
foreach(extraarg ${ARGN})
|
||||
@@ -503,7 +503,7 @@ endmacro(BRLCAD_LIB_INCLUDE_DIRS)
|
||||
# to copy/symlink as dependencies, there is a potential for file names to
|
||||
# conflict with build target names. (This has actually been observed with
|
||||
# MSVC - our file INSTALL in the toplevel source directory conflicts with the
|
||||
# MSVC target named INSTALL.) To avoid conflicts and make the dependencies
|
||||
# MSVC target named INSTALL.) To avoid conflicts and make the dependencies
|
||||
# of the custom commands robust we supply full file paths as dependencies to
|
||||
# the file copying custom commands.
|
||||
|
||||
|
||||
@@ -62,12 +62,12 @@ macro(CHECK_C_INLINE RESULT)
|
||||
|
||||
if(NOT DEFINED HAVE_INLINE)
|
||||
|
||||
# initialize to empty
|
||||
set(${RESULT} "")
|
||||
# initialize to empty
|
||||
set(${RESULT} "")
|
||||
|
||||
# test candidates to find one that works
|
||||
foreach(INLINE "inline" "__inline__" "__inline")
|
||||
|
||||
# test candidates to find one that works
|
||||
foreach(INLINE "inline" "__inline__" "__inline")
|
||||
if(NOT HAVE_INLINE)
|
||||
string(TOUPPER "HAVE_${INLINE}_KEYWORD" HAVE_INLINE_KEYWORD)
|
||||
|
||||
set(PRE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
@@ -84,18 +84,21 @@ macro(CHECK_C_INLINE RESULT)
|
||||
}
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
return 0;
|
||||
return (argc > 0 || argv)?0:1;
|
||||
}" ${HAVE_INLINE_KEYWORD})
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS "${PRE_CMAKE_REQUIRED_FLAGS}")
|
||||
|
||||
if(${HAVE_INLINE_KEYWORD})
|
||||
set(HAVE_INLINE "${INLINE}" CACHE INTERNAL "C compiler provides inlining support")
|
||||
break()
|
||||
endif(${HAVE_INLINE_KEYWORD})
|
||||
endif(NOT HAVE_INLINE)
|
||||
endforeach(INLINE)
|
||||
|
||||
endforeach(INLINE)
|
||||
|
||||
endif(NOT DEFINED HAVE_INLINE)
|
||||
|
||||
# still not defined?
|
||||
if(NOT DEFINED HAVE_INLINE)
|
||||
set(HAVE_INLINE "" CACHE INTERNAL "C compiler does not provide inlining support")
|
||||
endif(NOT DEFINED HAVE_INLINE)
|
||||
|
||||
+118
-83
@@ -69,7 +69,8 @@ macro(ADD_NEW_FLAG FLAG_TYPE NEW_FLAG CONFIG_LIST)
|
||||
endif(${NEW_FLAG})
|
||||
endmacro(ADD_NEW_FLAG)
|
||||
|
||||
# Convenience language based wrapper for calling the correct compiler flag test macro
|
||||
# Convenience language based wrapper for calling the correct compiler
|
||||
# flag test macro
|
||||
macro(CHECK_COMPILER_FLAG FLAG_LANG NEW_FLAG RESULTVAR)
|
||||
if("${FLAG_LANG}" STREQUAL "C")
|
||||
CHECK_C_COMPILER_FLAG(${NEW_FLAG} ${RESULTVAR})
|
||||
@@ -80,38 +81,42 @@ macro(CHECK_COMPILER_FLAG FLAG_LANG NEW_FLAG RESULTVAR)
|
||||
endmacro(CHECK_COMPILER_FLAG LANG NEW_FLAG RESULTVAR)
|
||||
|
||||
|
||||
# Synopsis: BRLCAD_CHECK_FLAG(LANG flag [BUILD_TYPES type1 type2 ...] [GROUPS group1 group2 ...] [VARS var1 var2 ...] )
|
||||
# Synopsis: CHECK_FLAG(LANG flag [BUILD_TYPES type1 type2 ...] [GROUPS group1 group2 ...] [VARS var1 var2 ...] )
|
||||
#
|
||||
# BRLCAD_CHECK_FLAG is BRL-CAD's core macro for C/C++ flag testing. The first value
|
||||
# is the language to test (C or C++ currently). The second entry is the flag (without
|
||||
# preliminary dash).
|
||||
# CHECK_FLAG is BRL-CAD's core macro for C/C++ flag testing.
|
||||
# The first value is the language to test (C or C++ currently). The
|
||||
# second entry is the flag (without preliminary dash).
|
||||
#
|
||||
# If the first two mandatory options are the only ones provided, the a successful test
|
||||
# of the flag will result in its being assigned to *all* compilations using the appropriate global
|
||||
# C/C++ CMake variable. If optional parameters are included, they tell the macro what to do with the
|
||||
# test results instead of doing the default global assignment. Options include assigning the
|
||||
# flag to one or more of the variable lists associated with build types (e.g. Debug or Release),
|
||||
# appending the variable to a string that contains a group of variables, or assigning the flag to
|
||||
# a variable if that variable does not already hold a value. The assignments are not mutually
|
||||
# If the first two mandatory options are the only ones provided, a
|
||||
# successful test of the flag will result in its being assigned to
|
||||
# *all* compilations using the appropriate global C/C++ CMake
|
||||
# variable. If optional parameters are included, they tell the macro
|
||||
# what to do with the test results instead of doing the default global
|
||||
# assignment. Options include assigning the flag to one or more of
|
||||
# the variable lists associated with build types (e.g. Debug or
|
||||
# Release), appending the variable to a string that contains a group
|
||||
# of variables, or assigning the flag to a variable if that variable
|
||||
# does not already hold a value. The assignments are not mutually
|
||||
# exclusive - any or all of them may be used in a given command.
|
||||
#
|
||||
# For example, to test a flag and add it to the C Debug configuration flags:
|
||||
# For example, to test a flag and add it to the C Debug configuration
|
||||
# flags:
|
||||
#
|
||||
# BRLCAD_CHECK_FLAG(C ggdb3 BUILD_TYPES Debug)
|
||||
# CHECK_FLAG(C ggdb3 BUILD_TYPES Debug)
|
||||
#
|
||||
# To assign a C flag to a unique variable:
|
||||
#
|
||||
# BRLCAD_CHECK_FLAG(C c99 VARS C99_FLAG)
|
||||
# CHECK_FLAG(C c99 VARS C99_FLAG)
|
||||
#
|
||||
# To do all assignments at once, for multiple configs and vars:
|
||||
#
|
||||
# BRLCAD_CHECK_FLAG(C ggdb3
|
||||
# CHECK_FLAG(C ggdb3
|
||||
# BUILD_TYPES Debug Release
|
||||
# GROUPS DEBUG_FLAGS
|
||||
# VARS DEBUG1 DEBUG2)
|
||||
|
||||
include (CMakeParseArguments)
|
||||
macro(BRLCAD_CHECK_FLAG)
|
||||
macro(CHECK_FLAG)
|
||||
# Set up some variables and names
|
||||
set(FLAG_LANG ${ARGV0})
|
||||
set(flag ${ARGV1})
|
||||
@@ -167,15 +172,16 @@ macro(BRLCAD_CHECK_FLAG)
|
||||
endforeach(flag_var ${FLAG_VARS})
|
||||
endif(${ARGC} LESS 3)
|
||||
|
||||
endmacro(BRLCAD_CHECK_FLAG)
|
||||
endmacro(CHECK_FLAG)
|
||||
|
||||
# Convenience wrappers to call the primary checking function with a default language.
|
||||
macro(BRLCAD_CHECK_C_FLAG)
|
||||
BRLCAD_CHECK_FLAG(C ${ARGN})
|
||||
endmacro(BRLCAD_CHECK_C_FLAG)
|
||||
macro(BRLCAD_CHECK_CXX_FLAG)
|
||||
BRLCAD_CHECK_FLAG(CXX ${ARGN})
|
||||
endmacro(BRLCAD_CHECK_CXX_FLAG)
|
||||
# Convenience wrappers to call the primary checking function with a
|
||||
# default language.
|
||||
macro(CHECK_C_FLAG)
|
||||
CHECK_FLAG(C ${ARGN})
|
||||
endmacro(CHECK_C_FLAG)
|
||||
macro(CHECK_CXX_FLAG)
|
||||
CHECK_FLAG(CXX ${ARGN})
|
||||
endmacro(CHECK_CXX_FLAG)
|
||||
|
||||
# Clear out most CMake-assigned defaults - We're managing
|
||||
# our own compile flags, and don't (for example) want NDEBUG
|
||||
@@ -209,72 +215,101 @@ set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "$ENV{LDFLAGS}")
|
||||
#set(CMAKE_EXE_LINKER_FLAGS "")
|
||||
|
||||
# Check for c90 support with gnu extensions if we're not building for
|
||||
# a release so we get more broad portability testing. Since the
|
||||
# default is debug, it will be the more difficult to keep working
|
||||
# given it's the lesser feature-rich C standard.
|
||||
|
||||
# If nothing has been specified, set a default
|
||||
set(USING_DEFAULT_C_STANDARD 0)
|
||||
set(USING_DEFAULT_CXX_STANDARD 0)
|
||||
if(NOT DEFINED C_COMPILER_STANDARD OR "${C_COMPILER_STANDARD}" STREQUAL "")
|
||||
set(C_COMPILER_STANDARD "C89" CACHE STRING "Default C Standard" FORCE)
|
||||
set(USING_DEFAULT_C_STANDARD 1)
|
||||
else(NOT DEFINED C_COMPILER_STANDARD OR "${C_COMPILER_STANDARD}" STREQUAL "")
|
||||
string(TOUPPER "${C_COMPILER_STANDARD}" C_COMPILER_STANDARD)
|
||||
set(C_COMPILER_STANDARD "${C_COMPILER_STANDARD" CACHE STRING "C Standard" FORCE)
|
||||
endif(NOT DEFINED C_COMPILER_STANDARD OR "${C_COMPILER_STANDARD}" STREQUAL "")
|
||||
if(NOT DEFINED CXX_COMPILER_STANDARD OR "${CXX_COMPILER_STANDARD}" STREQUAL "")
|
||||
set(CXX_COMPILER_STANDARD "C++98" CACHE STRING "Default CXX Standard" FORCE)
|
||||
set(USING_DEFAULT_CXX_STANDARD 1)
|
||||
else(NOT DEFINED CXX_COMPILER_STANDARD OR "${CXX_COMPILER_STANDARD}" STREQUAL "")
|
||||
string(TOUPPER "${CXX_COMPILER_STANDARD}" CXX_COMPILER_STANDARD)
|
||||
set(CXX_COMPILER_STANDARD "${CXX_COMPILER_STANDARD" CACHE STRING "CXX Standard" FORCE)
|
||||
endif(NOT DEFINED CXX_COMPILER_STANDARD OR "${CXX_COMPILER_STANDARD}" STREQUAL "")
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND USING_DEFAULT_C_STANDARD)
|
||||
set(C_COMPILER_STANDARD "C99" CACHE STRING "Default C Standard" FORCE)
|
||||
endif("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND USING_DEFAULT_C_STANDARD)
|
||||
set(C_STD_OPTS "C89" "C99" "C11")
|
||||
set(CXX_STD_OPTS "C++98" "C++03" "C++11")
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(C_COMPILER_OPTS "GNU89" "GNU99" "GNU11")
|
||||
endif(CMAKE_COMPILER_IS_GNUCC)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CXX_COMPILER_OPTS "GNU++98" "GNU++11")
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
set_property(CACHE C_COMPILER_STANDARD PROPERTY STRINGS ${C_STD_OPTS} ${C_COMPILER_OPTS})
|
||||
set_property(CACHE CXX_COMPILER_STANDARD PROPERTY STRINGS ${CXX_STD_OPTS} ${CXX_COMPILER_OPTS})
|
||||
|
||||
CHECK_C_FLAG("pedantic")
|
||||
string(TOLOWER "${C_COMPILER_STANDARD}" C_STD_FLAG_INPUT)
|
||||
CHECK_C_FLAG("std=${C_STD_FLAG_INPUT}" BUILD_TYPES Debug)
|
||||
CHECK_C_FLAG("std=gnu99" BUILD_TYPES Release VARS C99_FLAG)
|
||||
CHECK_C_FLAG("D_POSIX_C_SOURCE=200112L")
|
||||
|
||||
# try to use -pipe to speed up the compiles
|
||||
BRLCAD_CHECK_C_FLAG(pipe)
|
||||
BRLCAD_CHECK_CXX_FLAG(pipe)
|
||||
CHECK_C_FLAG(pipe)
|
||||
CHECK_CXX_FLAG(pipe)
|
||||
|
||||
# check for -fno-strict-aliasing
|
||||
# XXX - THIS FLAG IS REQUIRED if any level of optimization is
|
||||
# enabled with GCC as we do use aliasing and type-punning.
|
||||
BRLCAD_CHECK_C_FLAG(fno-strict-aliasing)
|
||||
BRLCAD_CHECK_CXX_FLAG(fno-strict-aliasing)
|
||||
CHECK_C_FLAG(fno-strict-aliasing)
|
||||
CHECK_CXX_FLAG(fno-strict-aliasing)
|
||||
|
||||
# check for -fno-common (libtcl needs it on darwin)
|
||||
BRLCAD_CHECK_C_FLAG(fno-common)
|
||||
BRLCAD_CHECK_CXX_FLAG(fno-common)
|
||||
CHECK_C_FLAG(fno-common)
|
||||
CHECK_CXX_FLAG(fno-common)
|
||||
|
||||
# check for -fexceptions
|
||||
# this is needed to resolve __Unwind_Resume when compiling and
|
||||
# linking against openNURBS in librt for some binaries, for
|
||||
# example rttherm (i.e. any -static binaries)
|
||||
BRLCAD_CHECK_C_FLAG(fexceptions)
|
||||
BRLCAD_CHECK_CXX_FLAG(fexceptions)
|
||||
CHECK_C_FLAG(fexceptions)
|
||||
CHECK_CXX_FLAG(fexceptions)
|
||||
|
||||
# check for -ftemplate-depth-NN this is needed in libpc and
|
||||
# other code using boost where the template instantiation depth
|
||||
# needs to be increased from the default ANSI minimum of 17.
|
||||
BRLCAD_CHECK_CXX_FLAG(ftemplate-depth-128)
|
||||
CHECK_CXX_FLAG(ftemplate-depth-128)
|
||||
|
||||
# dynamic SSE optimizations for NURBS processing
|
||||
#
|
||||
# XXX disable the SSE flags for now as they can cause illegal instructions.
|
||||
# the test needs to also be tied to run-time functionality since gcc
|
||||
# may still output SSE instructions (e.g., for cross-compiling).
|
||||
# BRLCAD_CHECK_C_FLAG(msse)
|
||||
# BRLCAD_CHECK_C_FLAG(msse2)
|
||||
BRLCAD_CHECK_C_FLAG(msse3 BUILD_TYPES Debug)
|
||||
# CHECK_C_FLAG(msse)
|
||||
# CHECK_C_FLAG(msse2)
|
||||
CHECK_C_FLAG(msse3 BUILD_TYPES Debug)
|
||||
|
||||
# Check for c90 support with gnu extensions if we're not building for
|
||||
# a release so we get more broad portability testing. Since the
|
||||
# default is debug, it will be the more difficult to keep working
|
||||
# given it's the lesser feature-rich C standard.
|
||||
BRLCAD_CHECK_C_FLAG("std=gnu89" BUILD_TYPES Debug)
|
||||
|
||||
# Check for c99 support with gnu extensions when we are building for a
|
||||
# release so we get to leverage more system features where available.
|
||||
#
|
||||
# Also check for c99 conformance (with extensions) since some platform
|
||||
# environments require it due to c99-specific system headers (e.g.,
|
||||
# /System/Library/Frameworks/OpenGL.framework/Headers/gl.h on Mac OS X
|
||||
# having '//' comments embedded).
|
||||
BRLCAD_CHECK_C_FLAG("std=gnu99" BUILD_TYPES Release VARS C99_FLAG)
|
||||
|
||||
# Silence check for unused arguments (used to silence clang warnings about
|
||||
# unused options on the command line). By default clang generates a lot of
|
||||
# warnings about such arguments, and we don't really care.
|
||||
BRLCAD_CHECK_C_FLAG(Qunused-arguments)
|
||||
BRLCAD_CHECK_CXX_FLAG(Qunused-arguments)
|
||||
CHECK_C_FLAG(Qunused-arguments)
|
||||
CHECK_CXX_FLAG(Qunused-arguments)
|
||||
|
||||
# 64bit compilation flags
|
||||
if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
|
||||
BRLCAD_CHECK_C_FLAG(m64 VARS 64BIT_FLAG)
|
||||
BRLCAD_CHECK_C_FLAG("arch x86_64" VARS 64BIT_FLAG)
|
||||
BRLCAD_CHECK_C_FLAG(64 VARS 64BIT_FLAG)
|
||||
BRLCAD_CHECK_C_FLAG("mabi=64" VARS 64BIT_FLAG)
|
||||
CHECK_C_FLAG(m64 VARS 64BIT_FLAG)
|
||||
CHECK_C_FLAG("arch x86_64" VARS 64BIT_FLAG)
|
||||
CHECK_C_FLAG(64 VARS 64BIT_FLAG)
|
||||
CHECK_C_FLAG("mabi=64" VARS 64BIT_FLAG)
|
||||
if(NOT 64BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "64BIT")
|
||||
message(FATAL_ERROR "Trying to compile 64BIT but all 64 bit compiler flag tests failed!")
|
||||
endif(NOT 64BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "64BIT")
|
||||
BRLCAD_CHECK_C_FLAG(q64 VARS 64BIT_FLAG)
|
||||
CHECK_C_FLAG(q64 VARS 64BIT_FLAG)
|
||||
ADD_NEW_FLAG(C 64BIT_FLAG ALL)
|
||||
ADD_NEW_FLAG(CXX 64BIT_FLAG ALL)
|
||||
ADD_NEW_FLAG(SHARED_LINKER 64BIT_FLAG ALL)
|
||||
@@ -282,12 +317,12 @@ if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
|
||||
endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
|
||||
|
||||
# 32 bit compilation flags
|
||||
if(${CMAKE_WORD_SIZE} MATCHES "32BIT" AND NOT ${BRLCAD_WORD_SIZE} MATCHES "AUTO")
|
||||
BRLCAD_CHECK_C_FLAG(m32 VARS 32BIT_FLAG)
|
||||
BRLCAD_CHECK_C_FLAG("arch i686" VARS 32BIT_FLAG)
|
||||
BRLCAD_CHECK_C_FLAG(32 VARS 32BIT_FLAG)
|
||||
BRLCAD_CHECK_C_FLAG("mabi=32" VARS 32BIT_FLAG)
|
||||
BRLCAD_CHECK_C_FLAG(q32 VARS 32BIT_FLAG)
|
||||
if(${CMAKE_WORD_SIZE} MATCHES "32BIT" AND NOT ${WORD_SIZE} MATCHES "AUTO")
|
||||
CHECK_C_FLAG(m32 VARS 32BIT_FLAG)
|
||||
CHECK_C_FLAG("arch i686" VARS 32BIT_FLAG)
|
||||
CHECK_C_FLAG(32 VARS 32BIT_FLAG)
|
||||
CHECK_C_FLAG("mabi=32" VARS 32BIT_FLAG)
|
||||
CHECK_C_FLAG(q32 VARS 32BIT_FLAG)
|
||||
if(NOT 32BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "32BIT")
|
||||
message(FATAL_ERROR "Trying to compile 32BIT but all 32 bit compiler flag tests failed!")
|
||||
endif(NOT 32BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "32BIT")
|
||||
@@ -295,30 +330,30 @@ if(${CMAKE_WORD_SIZE} MATCHES "32BIT" AND NOT ${BRLCAD_WORD_SIZE} MATCHES "AUTO"
|
||||
ADD_NEW_FLAG(CXX 32BIT_FLAG ALL)
|
||||
ADD_NEW_FLAG(SHARED_LINKER 32BIT_FLAG ALL)
|
||||
ADD_NEW_FLAG(EXE_LINKER 32BIT_FLAG ALL)
|
||||
endif(${CMAKE_WORD_SIZE} MATCHES "32BIT" AND NOT ${BRLCAD_WORD_SIZE} MATCHES "AUTO")
|
||||
endif(${CMAKE_WORD_SIZE} MATCHES "32BIT" AND NOT ${WORD_SIZE} MATCHES "AUTO")
|
||||
|
||||
if(BRLCAD_ENABLE_PROFILING)
|
||||
BRLCAD_CHECK_C_FLAG(pg VARS PROFILE_FLAG)
|
||||
BRLCAD_CHECK_C_FLAG(p VARS PROFILE_FLAG)
|
||||
BRLCAD_CHECK_C_FLAG(prof_gen VARS PROFILE_FLAG)
|
||||
if(ENABLE_PROFILING)
|
||||
CHECK_C_FLAG(pg VARS PROFILE_FLAG)
|
||||
CHECK_C_FLAG(p VARS PROFILE_FLAG)
|
||||
CHECK_C_FLAG(prof_gen VARS PROFILE_FLAG)
|
||||
if(NOT PROFILE_FLAG)
|
||||
message("Warning - profiling requested, but don't know how to profile with this compiler - disabling.")
|
||||
set(BRLCAD_ENABLE_PROFILING OFF)
|
||||
set(ENABLE_PROFILING OFF)
|
||||
else(NOT PROFILE_FLAG)
|
||||
ADD_NEW_FLAG(C PROFILE_FLAG ALL)
|
||||
ADD_NEW_FLAG(CXX PROFILE_FLAG ALL)
|
||||
endif(NOT PROFILE_FLAG)
|
||||
endif(BRLCAD_ENABLE_PROFILING)
|
||||
endif(ENABLE_PROFILING)
|
||||
|
||||
# Debugging flags
|
||||
if(BRLCAD_FLAGS_DEBUG)
|
||||
BRLCAD_CHECK_C_FLAG(g GROUPS DEBUG_C_FLAGS)
|
||||
BRLCAD_CHECK_CXX_FLAG(g GROUPS DEBUG_CXX_FLAGS)
|
||||
if(FLAGS_DEBUG)
|
||||
CHECK_C_FLAG(g GROUPS DEBUG_C_FLAGS)
|
||||
CHECK_CXX_FLAG(g GROUPS DEBUG_CXX_FLAGS)
|
||||
if(APPLE)
|
||||
EXEC_PROGRAM(sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION)
|
||||
if(${MACOSX_VERSION} VERSION_LESS "10.5")
|
||||
BRLCAD_CHECK_C_FLAG(ggdb3 GROUPS DEBUG_C_FLAGS)
|
||||
BRLCAD_CHECK_CXX_FLAG(ggdb3 GROUPS DEBUG_CXX_FLAGS)
|
||||
CHECK_C_FLAG(ggdb3 GROUPS DEBUG_C_FLAGS)
|
||||
CHECK_CXX_FLAG(ggdb3 GROUPS DEBUG_CXX_FLAGS)
|
||||
else(${MACOSX_VERSION} VERSION_LESS "10.5")
|
||||
# CHECK_C_COMPILER_FLAG silently eats gstabs+ - also, compiler
|
||||
# apparently doesn't like mixing stabs with another debug flag.
|
||||
@@ -326,8 +361,8 @@ if(BRLCAD_FLAGS_DEBUG)
|
||||
set(DEBUG_CXX_FLAGS "-ggdb")
|
||||
endif(${MACOSX_VERSION} VERSION_LESS "10.5")
|
||||
else(APPLE)
|
||||
BRLCAD_CHECK_C_FLAG(ggdb3 GROUPS DEBUG_C_FLAGS)
|
||||
BRLCAD_CHECK_CXX_FLAG(ggdb3 GROUPS DEBUG_CXX_FLAGS)
|
||||
CHECK_C_FLAG(ggdb3 GROUPS DEBUG_C_FLAGS)
|
||||
CHECK_CXX_FLAG(ggdb3 GROUPS DEBUG_CXX_FLAGS)
|
||||
endif(APPLE)
|
||||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
set(debug_config_list "${CMAKE_CONFIGURATION_TYPES}")
|
||||
@@ -340,7 +375,7 @@ if(BRLCAD_FLAGS_DEBUG)
|
||||
ADD_NEW_FLAG(SHARED_LINKER DEBUG_C_FLAGS "${debug_config_list}")
|
||||
ADD_NEW_FLAG(EXE_LINKER DEBUG_C_FLAGS "${debug_config_list}")
|
||||
mark_as_advanced(DEBUG_FLAGS)
|
||||
endif(BRLCAD_FLAGS_DEBUG)
|
||||
endif(FLAGS_DEBUG)
|
||||
|
||||
|
||||
# Set the minimum compilation linkage for Mac systems if not already
|
||||
@@ -352,16 +387,16 @@ if(APPLE)
|
||||
endif(NOT MACOSX_DEPLOYMENT_TARGET)
|
||||
|
||||
if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.3")
|
||||
BRLCAD_CHECK_C_FLAG("mmacosx-version-min=10.3 -isysroot /Developer/SDKs/MacOSX10.3.9.sdk" VARS SDK_FLAG)
|
||||
CHECK_C_FLAG("mmacosx-version-min=10.3 -isysroot /Developer/SDKs/MacOSX10.3.9.sdk" VARS SDK_FLAG)
|
||||
endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.3")
|
||||
if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.4")
|
||||
BRLCAD_CHECK_C_FLAG("mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" VARS SDK_FLAG)
|
||||
CHECK_C_FLAG("mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" VARS SDK_FLAG)
|
||||
endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.4")
|
||||
if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.5")
|
||||
BRLCAD_CHECK_C_FLAG("mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk" VARS SDK_FLAG)
|
||||
CHECK_C_FLAG("mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk" VARS SDK_FLAG)
|
||||
endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.5")
|
||||
if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.6")
|
||||
BRLCAD_CHECK_C_FLAG("mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk" VARS SDK_FLAG)
|
||||
CHECK_C_FLAG("mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk" VARS SDK_FLAG)
|
||||
endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.6")
|
||||
|
||||
ADD_NEW_FLAG(C SDK_FLAG ALL)
|
||||
|
||||
@@ -140,10 +140,12 @@ if(NOT BRLCAD_IS_SUBBUILD)
|
||||
set(DISTCHECK_BUILD_CMD "$(MAKE)")
|
||||
set(DISTCHECK_INSTALL_CMD "$(MAKE) install")
|
||||
set(DISTCHECK_REGRESS_CMD "$(MAKE) regress")
|
||||
set(DISTCHECK_TEST_CMD "$(MAKE) test")
|
||||
else("${CMAKE_GENERATOR}" MATCHES "Make")
|
||||
set(DISTCHECK_BUILD_CMD "${CMAKE_COMMAND} -E build .")
|
||||
set(DISTCHECK_INSTALL_CMD "${CMAKE_COMMAND} -E build . --target install")
|
||||
set(DISTCHECK_REGRESS_CMD "${CMAKE_COMMAND} -E build . --target regress")
|
||||
set(DISTCHECK_TEST_CMD "${CMAKE_COMMAND} -E build . --target test")
|
||||
set(TARGET_REDIRECT "")
|
||||
endif("${CMAKE_GENERATOR}" MATCHES "Make")
|
||||
|
||||
|
||||
@@ -90,10 +90,15 @@ add_custom_target(distcheck-${TARGET_SUFFIX}
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Compiling using source from TGZ archive..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir distcheck-${TARGET_SUFFIX}/${CPACK_SOURCE_PACKAGE_FILE_NAME} @DISTCHECK_BUILD_CMD@ @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Compiling using source from TGZ archive... Done."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory regression and benchmark testing..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir distcheck-${TARGET_SUFFIX}/${CPACK_SOURCE_PACKAGE_FILE_NAME} @DISTCHECK_REGRESS_CMD@ @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory benchmark testing..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir distcheck-${TARGET_SUFFIX}/${CPACK_SOURCE_PACKAGE_FILE_NAME}/bench ../${BIN_DIR}/benchmark run TIMEFRAME=1 @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory regression and benchmark testing... Done."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory benchmark testing...Done."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory regression testing..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir distcheck-${TARGET_SUFFIX}/${CPACK_SOURCE_PACKAGE_FILE_NAME} @DISTCHECK_REGRESS_CMD@ @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory regression testing...Done."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory unit testing..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir distcheck-${TARGET_SUFFIX}/${CPACK_SOURCE_PACKAGE_FILE_NAME} @DISTCHECK_TEST_CMD@ @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory unit testing... Done."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Install from tgz build directory..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir distcheck-${TARGET_SUFFIX}/${CPACK_SOURCE_PACKAGE_FILE_NAME} @DISTCHECK_INSTALL_CMD@ @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Install from tgz build directory... Done."
|
||||
|
||||
@@ -61,10 +61,15 @@ add_custom_target(distcheck-${TARGET_SUFFIX}
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Compiling using source from TGZ archive..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir "distcheck-${TARGET_SUFFIX}/${build_dir}" @DISTCHECK_BUILD_CMD@ @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Compiling using source from TGZ archive... Done."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory regression and benchmark testing..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir "distcheck-${TARGET_SUFFIX}/${build_dir}" @DISTCHECK_REGRESS_CMD@ @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory benchmark testing..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir "distcheck-${TARGET_SUFFIX}/${build_dir}/bench" ../${BIN_DIR}/benchmark run TIMEFRAME=1 @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory regression and benchmark testing... Done."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory benchmark testing...Done."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory regression testing..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir "distcheck-${TARGET_SUFFIX}/${build_dir}" @DISTCHECK_REGRESS_CMD@ @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory regression testing...Done."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory unit testing..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir "distcheck-${TARGET_SUFFIX}/${build_dir}" @DISTCHECK_TEST_CMD@ @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Run build-directory unit testing... Done."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Install from tgz build directory..."
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir "distcheck-${TARGET_SUFFIX}/${build_dir}" @DISTCHECK_INSTALL_CMD@ @TARGET_REDIRECT@
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "-- distcheck-${TARGET_SUFFIX} - Install from tgz build directory... Done."
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
#endif
|
||||
#define chararraysize 2048
|
||||
int main(void) {
|
||||
char hostname[chararraysize];
|
||||
int res __attribute__((unused)) = 0;
|
||||
char hostname[chararraysize] __attribute__((unused));
|
||||
FILE *outfp = NULL;
|
||||
#ifdef _WIN32
|
||||
LPHOSTENT lpHostEntry;
|
||||
@@ -15,10 +16,21 @@ int main(void) {
|
||||
wVersionRequested = MAKEWORD(1, 1);
|
||||
WSAStartup(wVersionRequested, &wsaData);
|
||||
#endif
|
||||
hostname[chararraysize - 1] = '\0';
|
||||
gethostname(hostname, chararraysize - 1);
|
||||
|
||||
outfp = fopen("${BRLCAD_BINARY_DIR}/include/conf/HOST.tmp", "w");
|
||||
fprintf(outfp, "\"%s\"", hostname);
|
||||
|
||||
#if defined(_BSD_SOURCE) \
|
||||
|| defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 500 \
|
||||
|| defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112
|
||||
res = gethostname(hostname, chararraysize - 1);
|
||||
if (!res && hostname[0] != ' ')
|
||||
fprintf(outfp, "\"%s\"", hostname);
|
||||
else
|
||||
fprintf(outfp, "\"%s\"", "unknown");
|
||||
#else
|
||||
fprintf(outfp, "\"%s\"", "unknown");
|
||||
#endif
|
||||
|
||||
fclose(outfp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -9,9 +9,12 @@
|
||||
#define chararraysize 2048
|
||||
int main(void) {
|
||||
FILE *outfp = NULL;
|
||||
char *name = getenv(USERVAR);
|
||||
outfp = fopen("${BRLCAD_BINARY_DIR}/include/conf/USER.tmp", "w");
|
||||
printf("user name: %s\n", getenv(USERVAR));
|
||||
fprintf(outfp, "\"%s\"", getenv(USERVAR));
|
||||
if (!name)
|
||||
name = "unknown";
|
||||
printf("user name: %s\n", name);
|
||||
fprintf(outfp, "\"%s\"", name);
|
||||
fclose(outfp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ int
|
||||
main ()
|
||||
{
|
||||
int s;
|
||||
wait (&s);
|
||||
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
|
||||
;
|
||||
wait(&s);
|
||||
s = WIFEXITED(s) ? WEXITSTATUS(s) : 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -169,7 +169,7 @@ Usage: %s port_num\n\
|
||||
|
||||
other_refs:
|
||||
|
||||
...list of other refences, if any,
|
||||
...list of other references, if any,
|
||||
semicolon-separated, no other embellishments...
|
||||
|
||||
...both lists will go in the SEE ALSO section...
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
brlcad (7.24.2-0) unstable; urgency=low
|
||||
|
||||
* update brlcad version
|
||||
|
||||
-- Jordi Sayol <g.sayol@yahoo.es> Thu, 05 Sep 2013 23:44:51 +0200
|
||||
|
||||
brlcad (7.24.0-0) unstable; urgency=low
|
||||
|
||||
* update brlcad version
|
||||
|
||||
@@ -61,10 +61,6 @@ if(SH_EXEC)
|
||||
${SH_EXEC} ${CMAKE_SOURCE_DIR}/regress/red.sh ${CMAKE_SOURCE_DIR}
|
||||
DEPENDS mged
|
||||
)
|
||||
#add_custom_target(regress-vls_vprintf
|
||||
# ${SH_EXEC} ${CMAKE_SOURCE_DIR}/regress/vls_vprintf.sh ${CMAKE_SOURCE_DIR}
|
||||
# DEPENDS test_vls_vprintf
|
||||
# )
|
||||
add_custom_target(regress-nirt
|
||||
${SH_EXEC} ${CMAKE_SOURCE_DIR}/regress/nirt.sh ${CMAKE_SOURCE_DIR}
|
||||
DEPENDS mged nirt
|
||||
@@ -185,7 +181,6 @@ CMAKEFILES(
|
||||
tgms/m35.cg.gz
|
||||
tgms/solids-simple.mged
|
||||
tgms/solids.mged
|
||||
vls_vprintf.sh
|
||||
weight.sh
|
||||
)
|
||||
|
||||
|
||||
@@ -88,7 +88,8 @@ echo "running common.h inclusion order check..."
|
||||
# small performance savings.
|
||||
FILES="`grep -I -e '#[[:space:]]*include' $SRCFILES $INCFILES | grep -E 'common.h|<' | sed 's/:.*//g' | sort | uniq`"
|
||||
|
||||
EXEMPT="bin.h bio.h config_win.h pstdint.h uce-dirent.h ttcp.c"
|
||||
LEXERS="schema.h obj_grammar.c obj_grammar.cpp obj_scanner.h points_scan.c script.c"
|
||||
EXEMPT="bin.h bio.h config_win.h pstdint.h uce-dirent.h ttcp.c $LEXERS"
|
||||
|
||||
FOUND=
|
||||
for file in $FILES ; do
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
#!/bin/sh
|
||||
# V L S _ V P R I N T F . S H
|
||||
# BRL-CAD
|
||||
#
|
||||
# Copyright (c) 2010-2013 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
#
|
||||
# 3. The name of the author may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
###
|
||||
# for debugging uncomment the following:
|
||||
#set -x
|
||||
# Ensure /bin/sh
|
||||
export PATH || (echo "This isn't sh."; sh $0 $*; kill $$)
|
||||
|
||||
# source common library functionality, setting ARGS, NAME_OF_THIS,
|
||||
# PATH_TO_THIS, and THIS.
|
||||
. "$1/regress/library.sh"
|
||||
|
||||
TEST=vls_vprintf
|
||||
TESTSCRIPT=$TEST.sh
|
||||
TESTEXE=test_vls_vprintf
|
||||
TESTLOG=${TEST}_test.log
|
||||
TESTCMD="`ensearch $TESTEXE`"
|
||||
if test ! -f "$TESTCMD" ; then
|
||||
echo "Unable to find $TESTEXE, aborting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# another file for test output
|
||||
ERRLOG=${TEST}_test.stderr
|
||||
|
||||
rm -f $TESTLOG $ERRLOG
|
||||
|
||||
# the known number of expected failures is:
|
||||
KNOWNEXP=0
|
||||
# run the test and capture exit status
|
||||
`$TESTCMD 1> $TESTLOG 2>$ERRLOG`
|
||||
STATUS=$?
|
||||
# STATUS contains number of UNEXPECTED failures
|
||||
# get the failure numbers
|
||||
if [ -f $ERRLOG ] ; then
|
||||
EXP=`cat $ERRLOG`
|
||||
else
|
||||
EXP=0
|
||||
fi
|
||||
if [ $STATUS -ge 128 ] ; then
|
||||
# a signal received
|
||||
SIGNUM=`expr $STATUS - 128`
|
||||
echo "-> $TESTSCRIPT FAILED with signal $SIGNUM."
|
||||
if [ $SIGNUM -eq 11 ] ; then
|
||||
echo " (SIGSEGV, invalid memory reference)"
|
||||
fi
|
||||
echo " See file './regress/$TESTLOG' for results (may be empty with a code dump)."
|
||||
# allow the rest of the test to continue
|
||||
STATUS=`expr $STATUS - $SIGNUM - 128`
|
||||
fi
|
||||
|
||||
# FIXME: this if/else block can be more efficient
|
||||
if [ $STATUS -eq 0 ] ; then
|
||||
if [ $KNOWNEXP -ne 0 ] ; then
|
||||
if [ $EXP -eq $KNOWNEXP ] ; then
|
||||
echo "-> $TESTSCRIPT succeeded with $EXP expected failed test(s)."
|
||||
echo " See file './regress/$TESTLOG' for results."
|
||||
echo " Do NOT use the failures in production code."
|
||||
fi
|
||||
elif [ $EXP -ne 0 ] ; then
|
||||
echo "-> $TESTSCRIPT succeeded with $EXP expected failed test(s)."
|
||||
echo " But SURPRISE! We expected $KNOWNEXP failed tests so something has changed!"
|
||||
echo " See file './regress/$TESTLOG' for results and compare"
|
||||
echo " with file './src/libbu/test_vls.c'."
|
||||
echo " Do NOT use the failures in production code."
|
||||
else
|
||||
echo "-> $TESTSCRIPT succeeded with no failures of any kind."
|
||||
# but one more check
|
||||
if [ $KNOWNEXP -ne 0 ] ; then
|
||||
echo " But SURPRISE! We expected $KNOWNEXP failed tests so"
|
||||
echo " something has changed!"
|
||||
echo " See file './regress/$TESTLOG' for results and compare"
|
||||
echo " with file './src/libbu/test_vls.c'."
|
||||
else
|
||||
# remove test products since all appears well
|
||||
rm -f $TESTLOG $ERRLOG
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "-> $TESTSCRIPT unexpectedly FAILED $STATUS test(s)."
|
||||
echo " See files './regress/$TESTLOG' and."
|
||||
echo " './regress/$ERRLOG' for results."
|
||||
fi
|
||||
|
||||
exit $STATUS
|
||||
|
||||
# Local Variables:
|
||||
# mode: sh
|
||||
# tab-width: 8
|
||||
# sh-indentation: 4
|
||||
# sh-basic-offset: 4
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=4 tabstop=8
|
||||
@@ -177,6 +177,7 @@ endwhile(${current_level} LESS ${HIGHEST_TARGET_LEVEL})
|
||||
#endif(${HIGHEST_TARGET_LEVEL} GREATER 1)
|
||||
|
||||
CMAKEFILES(README external)
|
||||
CMAKEFILES(compat)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
|
||||
@@ -195,7 +195,7 @@ render_cut_init(render_t *render, const char *buf)
|
||||
vect_t v;
|
||||
|
||||
VSUB2(v, ray_pos, render->tie->mid);
|
||||
shot_len = 2.0 * render->tie->radius + MAGNITUDE(v) - render->tie->radius;;
|
||||
shot_len = 2.0 * render->tie->radius + MAGNITUDE(v) - render->tie->radius;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+2
-2
@@ -347,7 +347,7 @@ cmd_hist(void *clientData, int argc, const char **argv)
|
||||
static int
|
||||
wrapper_func(ClientData data, Tcl_Interp *interp, int argc, const char *argv[])
|
||||
{
|
||||
struct bu_cmdtab *ctp = (struct bu_cmdtab *)data;;
|
||||
struct bu_cmdtab *ctp = (struct bu_cmdtab *)data;
|
||||
|
||||
return ctp->ct_func(interp, argc, argv);
|
||||
}
|
||||
@@ -380,7 +380,7 @@ cmdInit(Tcl_Interp *interp)
|
||||
{"history", cmd_history},
|
||||
{"hist", cmd_hist},
|
||||
{"q", cmd_quit},
|
||||
{(char *)NULL, BU_CMD_NULL}
|
||||
{(const char *)NULL, BU_CMD_NULL}
|
||||
};
|
||||
|
||||
/* Register bwish/btclsh commands */
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#endif
|
||||
|
||||
#include "bu.h"
|
||||
#include "dm.h"
|
||||
|
||||
/* We need to be careful about tty resetting - xcodebuild
|
||||
* and resetTty were locking up. Add a tty check
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
This directory contains various header files that are used make code
|
||||
C89 compliant. Typically, files from this directory are used to
|
||||
provide a function declaration to compile BRL-CAD when a system
|
||||
doesn't know about the functions which are normally hidden for C89.
|
||||
When the whole world becomes POSIX- compliant this directory should be
|
||||
unnecessary.
|
||||
@@ -0,0 +1,166 @@
|
||||
Following are declarations of C functions available in libc but hidden
|
||||
by various standards after C89 or hidden by other undefined macros.
|
||||
|
||||
See man feature_test_macros(7) for a definitive list of all such
|
||||
macros.
|
||||
|
||||
==================================================================
|
||||
|
||||
------------------------------------------------------------------
|
||||
defs: _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
int fileno(FILE *stream);
|
||||
FILE *fdopen(int fd, const char *mode);
|
||||
------------------------------------------------------------------
|
||||
defs:_BSD_SOURCE || _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
|
||||
or cc -std=c99
|
||||
|
||||
#include <stdio.h>
|
||||
int snprintf(char *str, size_t size, const char *format, ...);
|
||||
------------------------------------------------------------------
|
||||
std: 4.4BSD, POSIX.1-2001.
|
||||
|
||||
#include <strings.h>
|
||||
int strcasecmp(const char *s1, const char *s2);
|
||||
int strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
------------------------------------------------------------------
|
||||
defs: _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200112L
|
||||
|
||||
#include <unistd.h>
|
||||
int gethostname(char *name, size_t len);
|
||||
------------------------------------------------------------------
|
||||
defs: _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
|
||||
|
||||
#include <stdlib.h>
|
||||
int posix_memalign(void **memptr, size_t alignment, size_t size);
|
||||
------------------------------------------------------------------
|
||||
defs: _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
char *realpath(const char *path, char *resolved_path);
|
||||
------------------------------------------------------------------
|
||||
defs: _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
|
||||
or cc -std=c99
|
||||
|
||||
#include <math.h>
|
||||
double hypot(double x, double y);
|
||||
------------------------------------------------------------------
|
||||
defs:
|
||||
|
||||
#include <stdlib.h>
|
||||
srand48(), drand()
|
||||
|
||||
fix: replace with rand()
|
||||
------------------------------------------------------------------
|
||||
defs: _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
|
||||
|
||||
#include <stdlib.h>
|
||||
random(), srandom()
|
||||
------------------------------------------------------------------
|
||||
|
||||
defs: _BSD_SOURCE || !(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
|
||||
|
||||
#include <unistd.h>
|
||||
getpagesize_compat.h
|
||||
------------------------------------------------------------------
|
||||
defs: _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
|
||||
|
||||
#include <ctype.h>
|
||||
isascii_compat.h
|
||||
------------------------------------------------------------------
|
||||
defs: _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
|
||||
or cc -std=c99
|
||||
|
||||
#include <math.h>
|
||||
isinf_compat.h
|
||||
------------------------------------------------------------------
|
||||
defs: _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
|
||||
or cc -std=c99
|
||||
|
||||
#include <math.h>
|
||||
isnan_compat.h
|
||||
------------------------------------------------------------------
|
||||
std: C99, POSIX.1-2001.
|
||||
|
||||
#include <math.h>
|
||||
modff_compat.h
|
||||
------------------------------------------------------------------
|
||||
defs: _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE ||
|
||||
_POSIX_C_SOURCE >= 200112L;
|
||||
or cc -std=c99
|
||||
|
||||
#include <math.h>
|
||||
nextafter_compat.h
|
||||
------------------------------------------------------------------
|
||||
defs: _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
|
||||
or cc -std=c99
|
||||
|
||||
#include <math.h>
|
||||
nextafterf_compat.h
|
||||
------------------------------------------------------------------
|
||||
defs: _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE ||
|
||||
_POSIX_C_SOURCE >= 200112L;
|
||||
or cc -std=c99
|
||||
|
||||
#include <math.h>
|
||||
rint_compat.h
|
||||
------------------------------------------------------------------
|
||||
stds: SVr4, 4.3BSD, POSIX.1-2001.
|
||||
|
||||
strdup_compat.h
|
||||
------------------------------------------------------------------
|
||||
|
||||
OTHER C89 FIXES documented here:
|
||||
===============================
|
||||
|
||||
------------------------------------------------------------------
|
||||
#include <netdb.h>
|
||||
struct hostent member 'h_addr' is defined as actual member
|
||||
'h_addr_list[0]' (for backward compatibility); that define is
|
||||
hidden by macros
|
||||
__USE_MISC || defined __USE_GNU
|
||||
|
||||
fix is to substitute 'h_addr_list[0]' for 'h_addr'
|
||||
affected several files (fixed):
|
||||
./src/util/ttcp.c
|
||||
./src/libpkg/pkg.c
|
||||
also affects (not fixed!):
|
||||
./src/other/tcl/win/tclWinSock.c
|
||||
------------------------------------------------------------------
|
||||
|
||||
#include <signal.h>
|
||||
signal handler struct __sighandler_t is typedef'd differently by several macros:
|
||||
|
||||
#ifdef HAVE_SIGHANDLER_T
|
||||
typedef __sighandler_t sighandler_t;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SIG_T
|
||||
typedef __sighandler_t sig_t;
|
||||
#endif
|
||||
|
||||
fix is to leverage portable function sigaction(2) in addition to
|
||||
signal(2) for platforms that have one but not the other.
|
||||
|
||||
only file affected:
|
||||
./src/libbu/interrupt.c
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <errno.h>
|
||||
|
||||
extern char *program_invocation_name;
|
||||
extern char *program_invocation_short_name;
|
||||
|
||||
not portable
|
||||
|
||||
proper fix is to use a bu_* function that does not use them
|
||||
|
||||
fixed by turning off its use for strict compatibility checks
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
#endif /* BRLCAD_SRC_COMPAT_H */
|
||||
@@ -0,0 +1,85 @@
|
||||
Following are declarations of C functions available in libc but hidden
|
||||
by various standards after C99 or hidden by other undefined macros.
|
||||
|
||||
See man feature_test_macros(7) for a definitive list of all such
|
||||
macros.
|
||||
|
||||
The fix is to use libbu/bu_* versions of those functions. Those bu_*
|
||||
functions not yet available are so marked.
|
||||
|
||||
Note that some bu_* functions use non-C99 solutions so they need to be
|
||||
fixed. Those functions are so marked.
|
||||
|
||||
There are currently seven functions NOT in C99. Of those seven, only
|
||||
three have no working bu_* solution.
|
||||
|
||||
==================================================================
|
||||
|
||||
------------------------------------------------------------------
|
||||
error: implicit declaration of function 'fdopen'
|
||||
error: implicit declaration of function 'fileno'
|
||||
|
||||
defs: _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE
|
||||
stds: POSIX.1-1990 (fdopen)
|
||||
|
||||
#include <stdio.h>
|
||||
int fileno(FILE *stream);
|
||||
FILE *fdopen(int fd, const char *mode);
|
||||
|
||||
fix:
|
||||
|
||||
use bu_fileno (not yet available)
|
||||
use bu_fdopen (not yet available)
|
||||
------------------------------------------------------------------
|
||||
error: implicit declaration of function 'posix_memalign'
|
||||
|
||||
defs: _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
|
||||
stds: POSIX.1d
|
||||
|
||||
#include <stdlib.h>
|
||||
int posix_memalign(void **memptr, size_t alignment, size_t size);
|
||||
|
||||
fix:
|
||||
|
||||
use bu_posix_memalign (not yet available)
|
||||
------------------------------------------------------------------
|
||||
error: implicit declaration of function 'gethostname'
|
||||
|
||||
defs: _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200112L (since glibc 2.12)
|
||||
defs: _BSD_SOURCE || _XOPEN_SOURCE >= 500 (before glibc 2.12)
|
||||
stds: POSIX.1-2001
|
||||
|
||||
#include <unistd.h>
|
||||
int gethostname(char *name, size_t len);
|
||||
|
||||
fix:
|
||||
|
||||
use bu_gethostname
|
||||
------------------------------------------------------------------
|
||||
error: implicit declaration of function 'realpath'
|
||||
|
||||
defs: _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
|
||||
stds: 4.4BSD, POSIX.1-2001.
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
char *realpath(const char *path, char *resolved_path);
|
||||
|
||||
fix:
|
||||
|
||||
use bu_realpath
|
||||
------------------------------------------------------------------
|
||||
error: implicit declaration of function 'strcasecmp'
|
||||
error: implicit declaration of function 'strncasecmp'
|
||||
|
||||
stds: 4.4BSD, POSIX.1-2001.
|
||||
|
||||
#include <strings.h>
|
||||
int strcasecmp(const char *s1, const char *s2);
|
||||
int strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
|
||||
fix:
|
||||
|
||||
use bu_strcasecmp
|
||||
use bu_strncasecmp
|
||||
------------------------------------------------------------------
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef BRLCAD_FDOPEN_COMPAT_H
|
||||
#define BRLCAD_FDOPEN_COMPAT_H
|
||||
|
||||
/* see file 'src/compat/README.compat' for more details */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
FILE *fdopen(int fd, const char *mode);
|
||||
|
||||
#endif /* BRLCAD_FDOPEN_COMPAT_H */
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef BRLCAD_FILENO_COMPAT_H
|
||||
#define BRLCAD_FILENO_COMPAT_H
|
||||
|
||||
/* see file 'src/compat/README.compat' for more details */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int fileno(FILE *stream);
|
||||
|
||||
#endif /* BRLCAD_FILENO_COMPAT_H */
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef BRLCAD_GETHOSTNAME_COMPAT_H
|
||||
#define BRLCAD_GETHOSTNAME_COMPAT_H
|
||||
|
||||
/* see file 'src/compat/README.compat' for more details */
|
||||
|
||||
int gethostname(char *name, size_t len);
|
||||
|
||||
#endif /* BRLCAD_GETHOSTNAME_COMPAT_H */
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef BRLCAD_HYPOT_COMPAT_H
|
||||
#define BRLCAD_HYPOT_COMPAT_H
|
||||
|
||||
/* see file 'src/compat/README.compat' for more details */
|
||||
|
||||
double hypot(double x, double y);
|
||||
|
||||
#endif /* BRLCAD_HYPOT_COMPAT_H */
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef BRLCAD_POSIX_MEMALIGN_COMPAT_H
|
||||
#define BRLCAD_POSIX_MEMALIGN_COMPAT_H
|
||||
|
||||
/* see file 'src/compat/README.compat' for more details */
|
||||
|
||||
int posix_memalign(void **memptr, size_t alignment, size_t size);
|
||||
|
||||
#endif /* BRLCAD_POSIX_MEMALIGN_COMPAT_H */
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef BRLCAD_REALPATH_COMPAT_H
|
||||
#define BRLCAD_REALPATH_COMPAT_H
|
||||
|
||||
/* see file 'src/compat/README.compat' for more details */
|
||||
|
||||
char *realpath(const char *path, char *resolved_path);
|
||||
|
||||
#endif /* BRLCAD_REALPATH_COMPAT_H */
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef BRLCAD_SNPRINTF_COMPAT_H
|
||||
#define BRLCAD_SNPRINTF_COMPAT_H
|
||||
|
||||
/* see file 'src/compat/README.compat' for more details */
|
||||
|
||||
int snprintf(char *str, size_t size, const char *format, ...);
|
||||
|
||||
#endif /* BRLCAD_SNPRINTF_COMPAT_H */
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef BRLCAD_STRCASECMP_COMPAT_H
|
||||
#define BRLCAD_STRCASECMP_COMPAT_H
|
||||
|
||||
/* see file 'src/compat/README.compat' for more details */
|
||||
|
||||
int strcasecmp(const char *s1, const char *s2);
|
||||
|
||||
#endif /* BRLCAD_STRCASECMP_COMPAT_H */
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef BRLCAD_STRNCASECMP_COMPAT_H
|
||||
#define BRLCAD_STRNCASECMP_COMPAT_H
|
||||
|
||||
/* see file 'src/compat/README.compat' for more details */
|
||||
|
||||
int strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
|
||||
#endif /* BRLCAD_STRNCASECMP_COMPAT_H */
|
||||
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
char *nam = tmpnam(NULL);
|
||||
int fd = open(nam, O_WRONLY);
|
||||
FILE *fp __attribute((unused))__ = fdopen(fd, "w");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
FILE *fp = tmpfile();
|
||||
int fd __attribute((unused))__ = fileno(fp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
const size_t bufsiz = 512;
|
||||
char *name = (char *)malloc(bufsiz);
|
||||
int res __attribute((unused))__ = gethostname(name, bufsiz);
|
||||
|
||||
if (name)
|
||||
free(name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
char *buf;
|
||||
const size_t bufsiz = 512;
|
||||
int res = posix_memalign(&buf, sizeof(void *), bufsiz);
|
||||
|
||||
if (!res && buf)
|
||||
free(buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main(int argc __attribute((unused))__, char **argv)
|
||||
{
|
||||
char *name = realpath(argv[0], NULL);
|
||||
|
||||
if (name)
|
||||
free(name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <strings.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
const char s1[] = "one";
|
||||
const char s2[] = "two";
|
||||
|
||||
int res __attribute((unused))__ = strcasecmp(s1, s2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <strings.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
const char s1[] = "one";
|
||||
const char s2[] = "two";
|
||||
|
||||
int res __attribute((unused))__ = strncasecmp(s1, s2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
+13
-7
@@ -55,28 +55,34 @@ case $CASE in
|
||||
|
||||
1)
|
||||
comgeom-g $OPT -v4 m35.cg4 $DB
|
||||
break;;
|
||||
break
|
||||
;;
|
||||
|
||||
2)
|
||||
comgeom-g $OPT m35a2.cg5 $DB
|
||||
break;;
|
||||
break
|
||||
;;
|
||||
|
||||
3)
|
||||
comgeom-g $OPT apache.cg $DB
|
||||
break;;
|
||||
break
|
||||
;;
|
||||
|
||||
4)
|
||||
comgeom-g $OPT avlb.cg5 $DB
|
||||
break;;
|
||||
break
|
||||
;;
|
||||
|
||||
5)
|
||||
comgeom-g $OPT -v1 atr.cg1 $DB
|
||||
break;;
|
||||
break
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Try /$1/ unknown"
|
||||
exit 1;
|
||||
break;;
|
||||
exit 1
|
||||
break
|
||||
;;
|
||||
esac
|
||||
|
||||
# Local Variables:
|
||||
|
||||
+14
-15
@@ -20,11 +20,11 @@
|
||||
*/
|
||||
/** @file conv/g-shell-rect.c
|
||||
*
|
||||
* This routine creates an single NMG shell from an object by
|
||||
* This routine creates a single NMG shell from an object by
|
||||
* raytracing and using the hit points as vertices in the shell.
|
||||
* Raytracing is done in the Y-direction primarily. The -r option
|
||||
* requests raytracing in the X and Z directions to refine the shape
|
||||
* of the shell.
|
||||
* of the shell. [Sept. 12, 2013: CANNOT FIND -r OPTION!]
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -97,8 +97,8 @@ static struct xray *xz_rays;
|
||||
static struct xray *yz_rays;
|
||||
static struct rt_i *rtip;
|
||||
static struct bn_tol tol;
|
||||
static char *usage="Usage:\n\
|
||||
%s [-d debug_level] [-b] [-n] [-v] [-i initial_ray_dir] [-g cell_size] [-d debug_level] -o brlcad_output_file database.g object1 object2...\n";
|
||||
static char *usage="Usage: %s [-a rpp_args] [-R edge_tol] [-p plotfile] [-X lvl]\n\
|
||||
[-d debug_level] [-b] [-n] [-i initial_ray_dir] [-g cell_size] -o brlcad_output_file database.g object1 object2...\n";
|
||||
static char dir_ch[3]={ 'X', 'Y', 'Z' };
|
||||
|
||||
static struct local_part *xy_parts=(struct local_part *)NULL;
|
||||
@@ -1659,7 +1659,7 @@ main(int argc, char **argv)
|
||||
BU_LIST_INIT(&subtract_rpp_head);
|
||||
|
||||
/* Get command line arguments. */
|
||||
while ((c=bu_getopt(argc, argv, "bi:a:s:nR:g:o:d:p:X:")) != -1) {
|
||||
while ((c=bu_getopt(argc, argv, "bi:a:nR:g:o:d:p:X:h?")) != -1) {
|
||||
switch (c) {
|
||||
case 'i': /* set initial ray direction */
|
||||
switch (*bu_optarg)
|
||||
@@ -1764,22 +1764,21 @@ main(int argc, char **argv)
|
||||
sscanf(bu_optarg, "%x", (unsigned int *)&RTG.NMG_debug);
|
||||
bu_log("%s: setting RTG.NMG_debug to x%x\n", argv[0], RTG.NMG_debug);
|
||||
break;
|
||||
default:
|
||||
bu_exit(1, usage, argv[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (bu_optind+1 >= argc) {
|
||||
if (bu_optind+1 >= argc)
|
||||
bu_exit(1, usage, argv[0]);
|
||||
}
|
||||
|
||||
if (output_file) {
|
||||
if ((fd_out = wdb_fopen(output_file)) == NULL) {
|
||||
perror(argv[0]);
|
||||
bu_exit(1, "ERROR: Cannot open output file (%s)\n", output_file);
|
||||
}
|
||||
mk_id(fd_out, "test g-sgp");
|
||||
}
|
||||
else
|
||||
if (!output_file)
|
||||
bu_exit(1, "ERROR: Output file must be specified!\n");
|
||||
if ((fd_out = wdb_fopen(output_file)) == NULL) {
|
||||
perror(argv[0]);
|
||||
bu_exit(1, "ERROR: Cannot open output file (%s)\n", output_file);
|
||||
}
|
||||
mk_id(fd_out, "test g-sgp");
|
||||
|
||||
if (plotfile) {
|
||||
if ((fd_plot = fopen(plotfile, "wb")) == NULL) {
|
||||
|
||||
+8
-12
@@ -405,7 +405,7 @@ int main(int argc, char *argv[])
|
||||
rt_init_resource(&rt_uniresource, 0, NULL);
|
||||
|
||||
/* process command line arguments */
|
||||
while ((c = bu_getopt(argc, argv, "vo:ys:f")) != -1) {
|
||||
while ((c = bu_getopt(argc, argv, "vo:ys:fh?")) != -1) {
|
||||
switch (c) {
|
||||
case 'v':
|
||||
verbose++;
|
||||
@@ -429,13 +429,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
default:
|
||||
bu_exit(1, usage, argv[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* param check */
|
||||
if (bu_optind+1 >= argc) {
|
||||
if (bu_optind+1 >= argc)
|
||||
bu_exit(1, usage, argv[0]);
|
||||
}
|
||||
|
||||
/* get database filename and object */
|
||||
db_file = argv[bu_optind++];
|
||||
object = argv[bu_optind];
|
||||
@@ -445,12 +444,11 @@ int main(int argc, char *argv[])
|
||||
perror(argv[0]);
|
||||
bu_exit(1, "Cannot open geometry database file %s\n", db_file);
|
||||
}
|
||||
if (db_dirbuild(dbip)) {
|
||||
if (db_dirbuild(dbip))
|
||||
bu_exit(1, "db_dirbuild() failed!\n");
|
||||
}
|
||||
if (verbose) {
|
||||
|
||||
if (verbose)
|
||||
fprintf(stderr, ">> opened db '%s'\n", dbip->dbi_title);
|
||||
}
|
||||
|
||||
/* setup output stream */
|
||||
if (out_file == NULL) {
|
||||
@@ -470,15 +468,13 @@ int main(int argc, char *argv[])
|
||||
db_update_nref(dbip, &rt_uniresource);
|
||||
|
||||
dp = db_lookup(dbip, object, 0);
|
||||
if (dp == RT_DIR_NULL) {
|
||||
if (dp == RT_DIR_NULL)
|
||||
bu_exit(1, "Object %s not found in database!\n", object);
|
||||
}
|
||||
|
||||
/* generate mesh list */
|
||||
db_functree(dbip, dp, NULL, mesh_tracker, &rt_uniresource, NULL);
|
||||
if (verbose) {
|
||||
if (verbose)
|
||||
fprintf(stderr, ">> mesh count: %d\n", mesh_count);
|
||||
}
|
||||
|
||||
/* write out header */
|
||||
write_header(dbip);
|
||||
|
||||
+11
-17
@@ -92,7 +92,8 @@ extern union tree *do_region_end1(struct db_tree_state *tsp, const struct db_ful
|
||||
extern union tree *do_region_end2(struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, genptr_t client_data);
|
||||
extern union tree *nmg_region_end(struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, genptr_t client_data);
|
||||
|
||||
static const char usage[] = "Usage: %s [-b] [-e] [-v] [-xX lvl] [-d tolerance_distance (mm) ] [-a abs_tol (mm)] [-r rel_tol] [-n norm_tol] [-o out_file] [-u units] brlcad_db.g object(s)\n";
|
||||
static const char usage[] = "Usage: %s [-b] [-e] [-v] [-xX lvl] [-d tolerance_distance] [-a abs_tol] [-r rel_tol] [-n norm_tol] [-o out_file] [-u units] brlcad_db.g object(s)\n\
|
||||
(units default to mm)\n";
|
||||
|
||||
static char *tok_sep = " \t";
|
||||
static int NMG_debug; /* saved arg of -X, for longjmp handling */
|
||||
@@ -104,7 +105,7 @@ static struct rt_tess_tol ttol;
|
||||
static struct bn_tol tol;
|
||||
static struct model *the_model;
|
||||
|
||||
static char *units = (char *)NULL;
|
||||
static char *units = "mm";
|
||||
static fastf_t scale_factor = 1.0;
|
||||
|
||||
static struct db_tree_state tree_state; /* includes tol & model */
|
||||
@@ -616,7 +617,7 @@ main(int argc, char **argv)
|
||||
BU_LIST_INIT(&RTG.rtg_vlfree); /* for vlist macros */
|
||||
|
||||
/* Get command line arguments. */
|
||||
while ((c = bu_getopt(argc, argv, "a:bd:en:o:r:vx:X:u:")) != -1) {
|
||||
while ((c = bu_getopt(argc, argv, "a:bd:en:o:r:vx:X:u:h?")) != -1) {
|
||||
switch (c) {
|
||||
case 'a': /* Absolute tolerance. */
|
||||
ttol.abs = atof(bu_optarg);
|
||||
@@ -655,24 +656,17 @@ main(int argc, char **argv)
|
||||
case 'u':
|
||||
units = bu_strdup(bu_optarg);
|
||||
scale_factor = bu_units_conversion(units);
|
||||
if (ZERO(scale_factor)) {
|
||||
if (ZERO(scale_factor))
|
||||
bu_exit(1, "Unrecognized units (%s)\n", units);
|
||||
}
|
||||
scale_factor = 1.0 / scale_factor;
|
||||
break;
|
||||
default:
|
||||
bu_exit(1, usage, argv[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bu_optind + 1 >= argc) {
|
||||
if (bu_optind + 1 >= argc)
|
||||
bu_exit(1, usage, argv[0]);
|
||||
}
|
||||
|
||||
if (!units) {
|
||||
units = "mm";
|
||||
}
|
||||
|
||||
if ((bot_dump == 1) && (eval_all == 1)) {
|
||||
bu_exit(1, "BOT Dump and Evaluate All are mutually exclusive\n");
|
||||
@@ -911,10 +905,10 @@ nmg_2_vrml(struct db_tree_state *tsp, const struct db_full_path *pathp, struct m
|
||||
is_light = 1;
|
||||
} else {
|
||||
path_2_vrml_id(&shape_name, full_path);
|
||||
fprintf(fp_out, "\t\tDEF %s Shape { \n", bu_vls_addr(&shape_name));
|
||||
fprintf(fp_out, "\t\tDEF %s Shape {\n", bu_vls_addr(&shape_name));
|
||||
|
||||
fprintf(fp_out, "\t\t\t# Component_ID: %ld %s\n", comb->region_id, full_path);
|
||||
fprintf(fp_out, "\t\t\tappearance Appearance { \n");
|
||||
fprintf(fp_out, "\t\t\tappearance Appearance {\n");
|
||||
|
||||
if (bu_strncmp("plastic", mat.shader, 7) == 0) {
|
||||
if (mat.shininess < 0) {
|
||||
@@ -1024,9 +1018,9 @@ nmg_2_vrml(struct db_tree_state *tsp, const struct db_full_path *pathp, struct m
|
||||
|
||||
if (!is_light) {
|
||||
nmg_triangulate_model(m, tol2);
|
||||
fprintf(fp_out, "\t\t\t} \n");
|
||||
fprintf(fp_out, "\t\t\tgeometry IndexedFaceSet { \n");
|
||||
fprintf(fp_out, "\t\t\t\tcoord Coordinate { \n");
|
||||
fprintf(fp_out, "\t\t\t}\n");
|
||||
fprintf(fp_out, "\t\t\tgeometry IndexedFaceSet {\n");
|
||||
fprintf(fp_out, "\t\t\t\tcoord Coordinate {\n");
|
||||
}
|
||||
|
||||
/* get list of vertices */
|
||||
|
||||
+6
-13
@@ -105,7 +105,8 @@ struct bu_structparse vrml_mat_parse[]={
|
||||
extern union tree *do_region_end(struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, genptr_t client_data);
|
||||
extern union tree *nmg_region_end(struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, genptr_t client_data);
|
||||
|
||||
static const char usage[] = "Usage: %s [-v] [-xX lvl] [-d tolerance_distance (mm) ] [-a abs_tol (mm)] [-r rel_tol] [-n norm_tol] [-o out_file] [-u units] brlcad_db.g object(s)\n";
|
||||
static const char usage[] = "Usage: %s [-v] [-xX lvl] [-d tolerance_distance] [-a abs_tol] [-r rel_tol] [-n norm_tol] [-P #_of_cpus] [-o out_file] [-u units] brlcad_db.g object(s)\n\
|
||||
(units default to mm)\n";
|
||||
|
||||
static char *tok_sep = " \t";
|
||||
static int NMG_debug; /* saved arg of -X, for longjmp handling */
|
||||
@@ -118,7 +119,7 @@ static struct rt_tess_tol ttol;
|
||||
static struct bn_tol tol;
|
||||
static struct model *the_model;
|
||||
|
||||
static char* units=NULL;
|
||||
static char* units="mm";
|
||||
static fastf_t scale_factor=1.0;
|
||||
|
||||
static struct db_tree_state tree_state; /* includes tol & model */
|
||||
@@ -392,7 +393,7 @@ main(int argc, char **argv)
|
||||
|
||||
BARRIER_CHECK;
|
||||
/* Get command line arguments. */
|
||||
while ((c = bu_getopt(argc, argv, "d:a:n:o:r:vx:P:X:u:")) != -1) {
|
||||
while ((c = bu_getopt(argc, argv, "d:a:n:o:r:vx:P:X:u:h?")) != -1) {
|
||||
switch (c) {
|
||||
case 'a': /* Absolute tolerance. */
|
||||
ttol.abs = atof(bu_optarg);
|
||||
@@ -429,23 +430,16 @@ main(int argc, char **argv)
|
||||
units = bu_strdup( bu_optarg );
|
||||
scale_factor = bu_units_conversion( units );
|
||||
if ( ZERO(scale_factor) )
|
||||
{
|
||||
bu_exit(1, "Unrecognized units (%s)\n", units );
|
||||
}
|
||||
scale_factor = 1.0 / scale_factor;
|
||||
break;
|
||||
default:
|
||||
bu_exit(1, usage, argv[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bu_optind+1 >= argc) {
|
||||
if (bu_optind+1 >= argc)
|
||||
bu_exit(1, usage, argv[0]);
|
||||
}
|
||||
|
||||
if ( !units )
|
||||
units = "mm";
|
||||
|
||||
/* Open BRL-CAD database */
|
||||
if ((dbip = db_open( argv[bu_optind], DB_OPEN_READONLY)) == DBI_NULL)
|
||||
@@ -453,9 +447,8 @@ main(int argc, char **argv)
|
||||
perror(argv[0]);
|
||||
bu_exit(1, "Cannot open geometry database file %s\n", argv[bu_optind] );
|
||||
}
|
||||
if ( db_dirbuild( dbip ) ) {
|
||||
if ( db_dirbuild( dbip ) )
|
||||
bu_exit(1, "db_dirbuild() failed!\n" );
|
||||
}
|
||||
|
||||
if (out_file == NULL) {
|
||||
outfp = stdout;
|
||||
|
||||
+6
-12
@@ -107,7 +107,7 @@ main(int argc, char **argv)
|
||||
the_model = nmg_mm();
|
||||
|
||||
/* Get command line arguments. */
|
||||
while ((c = bu_getopt(argc, argv, "r:a:n:o:vx:D:X:")) != -1) {
|
||||
while ((c = bu_getopt(argc, argv, "r:a:n:o:vx:D:X:h?")) != -1) {
|
||||
switch (c) {
|
||||
case 'r': /* Relative tolerance. */
|
||||
ttol.rel = atof(bu_optarg);
|
||||
@@ -140,13 +140,11 @@ main(int argc, char **argv)
|
||||
break;
|
||||
default:
|
||||
bu_exit(1, usage, argv[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bu_optind+1 >= argc) {
|
||||
if (bu_optind+1 >= argc)
|
||||
bu_exit(1, usage, argv[0]);
|
||||
}
|
||||
|
||||
/* Open output file */
|
||||
|
||||
@@ -158,9 +156,8 @@ main(int argc, char **argv)
|
||||
perror(argv[0]);
|
||||
bu_exit(1, "ERROR: Unable to open geometry database file (%s)\n", argv[0]);
|
||||
}
|
||||
if (db_dirbuild(dbip)) {
|
||||
if (db_dirbuild(dbip))
|
||||
bu_exit(1, "db_dirbuild failed\n");
|
||||
}
|
||||
|
||||
BN_CK_TOL(tree_state.ts_tol);
|
||||
RT_CK_TESS_TOL(tree_state.ts_ttol);
|
||||
@@ -272,18 +269,16 @@ output_nmg(struct nmgregion *r, const struct db_full_path *pathp, int UNUSED(reg
|
||||
continue;
|
||||
|
||||
/* loop through the edges in this loop (facet) */
|
||||
if (verbose) {
|
||||
if (verbose)
|
||||
printf("\tfacet:\n");
|
||||
}
|
||||
for (BU_LIST_FOR(eu, edgeuse, &lu->down_hd))
|
||||
{
|
||||
NMG_CK_EDGEUSE(eu);
|
||||
|
||||
v = eu->vu_p->v_p;
|
||||
NMG_CK_VERTEX(v);
|
||||
if (verbose) {
|
||||
if (verbose)
|
||||
printf("\t\t(%g %g %g)\n", V3ARGS(v->vg_p->coord));
|
||||
}
|
||||
}
|
||||
tot_polygons++;
|
||||
}
|
||||
@@ -423,9 +418,8 @@ union tree *do_region_end(struct db_tree_state *tsp, const struct db_full_path *
|
||||
r = ret_tree->tr_d.td_r;
|
||||
else
|
||||
{
|
||||
if (verbose) {
|
||||
if (verbose)
|
||||
bu_log("\tNothing left of this region after Boolean evaluation\n");
|
||||
}
|
||||
regions_written++; /* don't count as a failure */
|
||||
r = (struct nmgregion *)NULL;
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ Draw_entities(struct model *m, int de_list[], int no_of_des, fastf_t x, fastf_t
|
||||
|
||||
tmp_ptr = ptr->next;
|
||||
bu_free((char *)ptr, "Draw_entities: ptr");
|
||||
ptr = tmp_ptr;;
|
||||
ptr = tmp_ptr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -566,7 +566,7 @@ do_nmg_region_end(struct db_tree_state *tsp, const struct db_full_path *pathp, u
|
||||
|
||||
/* not unique, try adding a suffix */
|
||||
len = strlen(suffix);
|
||||
i = len - 1;;
|
||||
i = len - 1;
|
||||
suffix[i]++;
|
||||
while (suffix[i] > 'z' && i > 0) {
|
||||
suffix[i] = 'a';
|
||||
|
||||
@@ -1791,7 +1791,7 @@ write_shell_face_loop(char *name,
|
||||
dir_entry[15] = 1;
|
||||
dir_entry[14] = write_freeform(fp_param, bu_vls_addr(&str), dir_seq+1, 'P');
|
||||
|
||||
face_list[face_count++] = write_dir_entry(fp_dir, dir_entry);;
|
||||
face_list[face_count++] = write_dir_entry(fp_dir, dir_entry);
|
||||
|
||||
bu_free((char *)loop_list, "loop list");
|
||||
bu_vls_free(&str);
|
||||
|
||||
@@ -1274,7 +1274,7 @@ main(int argc, char **argv)
|
||||
|
||||
g_pts[grid_used].gid = gid;
|
||||
g_pts[grid_used].cid = cid;
|
||||
g_pts[grid_used].v = (struct vertex **)bu_calloc(pshell_count + 1, sizeof(struct vertex *), "g_pts vertex array");;
|
||||
g_pts[grid_used].v = (struct vertex **)bu_calloc(pshell_count + 1, sizeof(struct vertex *), "g_pts vertex array");
|
||||
VMOVE(g_pts[grid_used].pt, tmp);
|
||||
grid_used++;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
/* A S S E M B L Y _ P R O D U C T . C P P
|
||||
*
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2013 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file Assembly_Product.cpp
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include "raytrace.h"
|
||||
#include "Comb_Tree.h"
|
||||
#include "G_STEP_internal.h"
|
||||
#include "ON_Brep.h"
|
||||
|
||||
/*
|
||||
* To associate multiple objects in STEP, we must define and relate product definitions
|
||||
* for both shapes (BReps) and assembly objects (combs) that will relate the shapes.
|
||||
* Below is an example of how the structural definitions relate - in this instance, one
|
||||
* BRep and two instances of that BRep moved and added to an assembly.
|
||||
*
|
||||
* // Representation context
|
||||
* #10=DIMENSIONAL_EXPONENTS(1.E0,0.E0,0.E0,0.E0,0.E0,0.E0,0.E0);
|
||||
* #11=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
|
||||
* #12=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(1E1),#11);
|
||||
* #13=(CONVERSION_BASED_UNIT('INCH',#12)LENGTH_UNIT()NAMED_UNIT(#10));
|
||||
* #14=DIMENSIONAL_EXPONENTS(0.E0,0.E0,0.E0,0.E0,0.E0,0.E0,0.E0);
|
||||
* #15=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
|
||||
* #16=PLANE_ANGLE_MEASURE_WITH_UNIT(PLANE_ANGLE_MEASURE(0.0174532925199433),#15);
|
||||
* #17=(CONVERSION_BASED_UNIT('DEGREE',#16)NAMED_UNIT(*)PLANE_ANGLE_UNIT());
|
||||
* #18=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
|
||||
* #19=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.05),#13,'accuracy','Tolerance');
|
||||
* #20=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT
|
||||
* ((#19))GLOBAL_UNIT_ASSIGNED_CONTEXT((#13,#17,#18))REPRESENTATION_CONTEXT('ID52','3'));
|
||||
*
|
||||
* #100=APPLICATION_CONTEXT('CONFIGURATION CONTROLLED 3D DESIGNS OF MECHANICAL PARTS AND ASSEMBLIES');
|
||||
* #1001=DESIGN_CONTEXT('',#100,'design');
|
||||
*
|
||||
* // seems to be a list of AXIS2_PLACEMENT_3D objects - does this put all the axis
|
||||
* // in a representation context? Used by the REPRESENTATION_RELATIONSHIP objects.
|
||||
* #300=SHAPE_REPRESENTATION('',(...,#9004,#9013,...), #20);
|
||||
*
|
||||
* // Transformation definitions - I think these are similar to matrices over combs?
|
||||
*
|
||||
* #8001=CARTESIAN_POINT('',(0.E0,0.E0,0.E0));
|
||||
* #8002=DIRECTION('',(0.E0,0.E0,1.E0));
|
||||
* #8003=DIRECTION('',(1.E0,0.E0,0.E0));
|
||||
* #8004=AXIS2_PLACEMENT_3D('',#8001,#8002,#8003);
|
||||
*
|
||||
* #9001=CARTESIAN_POINT('',());
|
||||
* #9002=DIRECTION('',());
|
||||
* #9003=DIRECTION('',());
|
||||
* #9004=AXIS2_PLACEMENT_3D('',#9001,#9002,#9003);
|
||||
* #7001=ITEM_DEFINED_TRANSFORMATION('','',#8004,#9004);
|
||||
*
|
||||
* #9010=CARTESIAN_POINT('',());
|
||||
* #9011=DIRECTION('',());
|
||||
* #9012=DIRECTION('',());
|
||||
* #9013=AXIS2_PLACEMENT_3D('',#9010,#9011,#9012);
|
||||
* #7002=ITEM_DEFINED_TRANSFORMATION('','',#8004,#9013);
|
||||
*
|
||||
* // Solid shape representation Looks like this is the bit that needs to be created
|
||||
* // for each solid - should be done by the SHAPE_DEFINITION_REPRESENTATION logic.
|
||||
* #200=ADVANCED_BREP_SHAPE_REPRESENTATION();
|
||||
* #1002=MECHANICAL_CONTEXT('',#100,'mechanical');
|
||||
* #1003=PRODUCT('Geometric_Shape_01','Geometric_Shape_01','NOT SPECIFIED',(#1002));
|
||||
* #1004=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE('1','LAST_VERSION',#1003,.MADE.);
|
||||
* #1005=PRODUCT_DEFINITION('design','',#1004,#1001);
|
||||
* #1006=PRODUCT_DEFINITION_SHAPE('','Shape For Geometric_Shape_01',#1005);
|
||||
* #1007=SHAPE_DEFINITION_REPRESENTATION(#1006,#200);
|
||||
*
|
||||
* // Assembly shape representation
|
||||
* #5001=MECHANICAL_CONTEXT('',#100,'mechanical');
|
||||
* #5002=PRODUCT('Comb_01','Comb_01','NOT SPECIFIED',(#5001));
|
||||
* #5003=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE('1','LAST_VERSION',#5002,.MADE.);
|
||||
* #5004=PRODUCT_DEFINITION('design','',#5003,#1001);
|
||||
*
|
||||
* // Assembly components
|
||||
*
|
||||
* #2001=NEXT_ASSEMBLY_USAGE_OCCURRENCE('01','Next assembly relationship','Geometric_Shape_01',#5004,#1005,$);
|
||||
* #2002=PRODUCT_DEFINITION_SHAPE('Placement #01','Placement of Geometric_Shape_01 with respect to Comb_01',#2001);
|
||||
*
|
||||
* #3001=NEXT_ASSEMBLY_USAGE_OCCURRENCE('02','Next assembly relationship','Geometric_Shape_01',#5004,#1005,$);
|
||||
* #3002=PRODUCT_DEFINITION_SHAPE('Placement #02','Placement of Geometric_Shape_01 with respect to Comb_01',#3001);
|
||||
*
|
||||
* #4001=(REPRESENTATION_RELATIONSHIP('','',#200,#300)REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION(#7002)SHAPE_REPRESENTATION_RELATIONSHIP());
|
||||
* #4002=CONTEXT_DEPENDENT_SHAPE_REPRESENTATION(#4001,#3002);
|
||||
*
|
||||
* #6001=(REPRESENTATION_RELATIONSHIP('','',#200,#300)REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION(#7001)SHAPE_REPRESENTATION_RELATIONSHIP());
|
||||
* #6002=CONTEXT_DEPENDENT_SHAPE_REPRESENTATION(#6001,#2002);
|
||||
*
|
||||
*
|
||||
* Mapping from BRL-CAD to STEP
|
||||
*
|
||||
* Roughly speaking, the STEP requirement that each shape representation have an associated product appears
|
||||
* to translate to BRL-CAD as each brep object having a comb above it. To avoid introducing unnecessary combs,
|
||||
* it will be necessary to recognize when a brep referenced by one or more comb trees listed for export has
|
||||
* one and only one parent comb in the existing tree structure, which in turn does not have any other children.
|
||||
* Otherwise, repeated imports and exports will bury the brep below an ever deepening hierarchy of combs. When
|
||||
* a brep does not have this wrapper already in place, one will need to be explicitly created for it.
|
||||
* Hopefully, search can be used to quickly identify sets of geometry that need to be handled differently.
|
||||
* It may be that the assumption of shared naming - a comb with the same root name as its child brep - can be used
|
||||
* as a quick check to determine if the comb is a parent or not, if we accept that as a convention.
|
||||
*
|
||||
* Because combs reference combs in BRL-CAD, the step product definitions associated with combs will need to be
|
||||
* fully created before the assembly usage occurrences can start to be assembled. A search that collects all combs
|
||||
* will provide a convenient list for multiple passes that create and then assemble combs, as will a similar search
|
||||
* for solids (currently just breps...). Should also make sure the tree is union only for AP203, where booleans are
|
||||
* not supported. Once boolean evaluation is in place, should be able to default to brep solids for combs with non
|
||||
* union booleans below them.
|
||||
*
|
||||
*/
|
||||
|
||||
/* TODO - generic, move to the internal utility file */
|
||||
STEPentity *
|
||||
Create_AXIS2_PLACEMENT_3D(fastf_t pt_x, fastf_t pt_y, fastf_t pt_z,
|
||||
fastf_t d1_x, fastf_t d1_y, fastf_t d1_z,
|
||||
fastf_t d2_x, fastf_t d2_y, fastf_t d2_z,
|
||||
Registry *registry, InstMgr *instance_list) {
|
||||
SdaiCartesian_point *pnt = (SdaiCartesian_point *)registry->ObjCreate("CARTESIAN_POINT");
|
||||
pnt->name_("''");
|
||||
XYZ_to_Cartesian_point(pt_x, pt_y, pt_z, pnt);
|
||||
SdaiDirection *axis = (SdaiDirection *)registry->ObjCreate("DIRECTION");
|
||||
axis->name_("''");
|
||||
XYZ_to_Direction(d1_x, d1_y, d1_z, axis);
|
||||
SdaiDirection *ref = (SdaiDirection *)registry->ObjCreate("DIRECTION");
|
||||
ref->name_("''");
|
||||
XYZ_to_Direction(d2_x, d2_y, d2_z, ref);
|
||||
SdaiAxis2_placement_3d *placement = (SdaiAxis2_placement_3d *)registry->ObjCreate("AXIS2_PLACEMENT_3D");
|
||||
placement->name_("''");
|
||||
placement->location_(pnt);
|
||||
placement->axis_(axis);
|
||||
placement->ref_direction_(ref);
|
||||
instance_list->Append((STEPentity *)pnt, completeSE);
|
||||
instance_list->Append((STEPentity *)axis, completeSE);
|
||||
instance_list->Append((STEPentity *)ref, completeSE);
|
||||
instance_list->Append((STEPentity *)placement, completeSE);
|
||||
return (STEPentity *)placement;
|
||||
}
|
||||
|
||||
STEPentity *
|
||||
Identity_AXIS2_PLACEMENT_3D(Registry *registry, InstMgr *instance_list) {
|
||||
return Create_AXIS2_PLACEMENT_3D(0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, registry, instance_list);
|
||||
}
|
||||
|
||||
// Returns either an AXIS2_PLACEMENT_3D, a CARTESIAN_TRANSFORMATION_OPERATOR_3D, or NULL
|
||||
// If NULL, geometry is being deformed in a way not supported by AP203
|
||||
STEPentity *
|
||||
Mat_to_Rep(matp_t curr_matrix, Registry *registry, InstMgr *instance_list)
|
||||
{
|
||||
// TODO - investigate CARTESIAN_TRANSFORMATION_OPERATOR_3D, which seems to
|
||||
// allow uniform scaling as well and appears to be compatible with the
|
||||
// same slot used for AXIS2_PLACEMENT_3D - may be able to use the latter
|
||||
// for simple cases without scaling (i.e. VUNITIZE doesn't change the length
|
||||
// of X, Y or Z unit vectors after the matrix is applied), the former when
|
||||
// the there is uniform scaling (X, Y and Z lengths all change by the same
|
||||
// amount) and in the worst case (non-uniform scaling) will have to create
|
||||
// a new Brep and abandon the attempt to preserve the comb-level operation.
|
||||
|
||||
point_t origin, outorig;
|
||||
vect_t x_axis, y_axis, z_axis;
|
||||
vect_t outx, outy, outz;
|
||||
fastf_t xm, ym, zm;
|
||||
VSET(origin, 0, 0, 0);
|
||||
VSET(x_axis, 1, 0, 0);
|
||||
VSET(y_axis, 0, 1, 0);
|
||||
VSET(z_axis, 0, 0, 1);
|
||||
MAT4X3PNT(outorig, curr_matrix, origin);
|
||||
MAT4X3VEC(outx, curr_matrix, x_axis);
|
||||
MAT4X3VEC(outy, curr_matrix, y_axis);
|
||||
MAT4X3VEC(outz, curr_matrix, z_axis);
|
||||
xm = MAGNITUDE(outx);
|
||||
ym = MAGNITUDE(outy);
|
||||
zm = MAGNITUDE(outz);
|
||||
VUNITIZE(outx);
|
||||
VUNITIZE(outy);
|
||||
VUNITIZE(outz);
|
||||
if (NEAR_ZERO(xm - 1.0, RT_LEN_TOL) && NEAR_ZERO(ym - 1.0, RT_LEN_TOL) && NEAR_ZERO(zm - 1.0, RT_LEN_TOL)) {
|
||||
bu_log("AXIS2_PLACEMENT_3D cartesian_point: %f, %f, %f\n", outorig[0], outorig[1], outorig[2]);
|
||||
bu_log("AXIS2_PLACEMENT_3D axis: %f, %f, %f\n", outz[0], outz[1], outz[2]);
|
||||
bu_log("AXIS2_PLACEMENT_3D ref axis: %f, %f, %f\n", outx[0], outx[1], outx[2]);
|
||||
return Create_AXIS2_PLACEMENT_3D(outorig[0], outorig[1], outorig[2],
|
||||
outz[0], outz[1], outz[2], outx[0], outx[1], outx[2], registry, instance_list);
|
||||
} else {
|
||||
if (NEAR_ZERO(xm - ym, RT_LEN_TOL) && NEAR_ZERO(xm - zm, RT_LEN_TOL)) {
|
||||
bu_log("CARTESIAN_TRANSFORMATION_OPERATOR_3D local_origin: %f, %f, %f\n", outorig[0], outorig[1], outorig[2]);
|
||||
bu_log("CARTESIAN_TRANSFORMATION_OPERATOR_3D axis1: %f, %f, %f\n", outx[0], outx[1], outx[2]);
|
||||
bu_log("CARTESIAN_TRANSFORMATION_OPERATOR_3D axis2: %f, %f, %f\n", outy[0], outy[1], outy[2]);
|
||||
bu_log("CARTESIAN_TRANSFORMATION_OPERATOR_3D axis3: %f, %f, %f\n", outz[0], outz[1], outz[2]);
|
||||
bu_log("Scaling: %f\n", xm);
|
||||
return NULL;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Representation relationships are a complex type
|
||||
STEPentity *
|
||||
Build_Representation_Relationship(STEPentity *input_transformation, STEPentity *parent, STEPentity *child, Registry *registry, InstMgr *instance_list) {
|
||||
STEPattribute *attr;
|
||||
STEPcomplex *stepcomplex;
|
||||
const char *entNmArr[4] = {"representation_relationship", "representation_relationship_with_transformation", "shape_representation_relationship", "*"};
|
||||
STEPcomplex *complex_entity = new STEPcomplex(registry, (const char **)entNmArr, registry->GetEntityCnt() + 1);
|
||||
/* REPRESENTATION_RELATIONSHIP */
|
||||
stepcomplex = complex_entity->EntityPart("representation_relationship");
|
||||
stepcomplex->ResetAttributes();
|
||||
while ((attr = stepcomplex->NextAttribute()) != NULL) {
|
||||
//std::cout << " " << attr->Name() << "," << attr->NonRefType() << "\n";
|
||||
if (!bu_strcmp(attr->Name(), "name")) attr->StrToVal("''");
|
||||
if (!bu_strcmp(attr->Name(), "rep_1")) {
|
||||
attr->ptr.c = new (STEPentity *);
|
||||
*(attr->ptr.c) = parent;
|
||||
}
|
||||
if (!bu_strcmp(attr->Name(), "rep_2")) {
|
||||
attr->ptr.c = new (STEPentity *);
|
||||
*(attr->ptr.c) = child;
|
||||
}
|
||||
}
|
||||
|
||||
/* REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION */
|
||||
stepcomplex = complex_entity->EntityPart("representation_relationship_with_transformation");
|
||||
stepcomplex->ResetAttributes();
|
||||
while ((attr = stepcomplex->NextAttribute()) != NULL) {
|
||||
if (!bu_strcmp(attr->Name(), "transformation_operator")) {
|
||||
SdaiTransformation *transformation = new SdaiTransformation((SdaiItem_defined_transformation *)input_transformation);
|
||||
attr->ptr.sh = transformation;
|
||||
}
|
||||
}
|
||||
|
||||
instance_list->Append((STEPentity *)complex_entity, completeSE);
|
||||
|
||||
return complex_entity;
|
||||
}
|
||||
|
||||
void
|
||||
Add_Assembly_Product(struct directory *dp, struct db_i *dbip, struct bu_ptbl *children,
|
||||
struct comb_maps *maps,
|
||||
Registry *registry, InstMgr *instance_list)
|
||||
{
|
||||
struct rt_db_internal comb_intern;
|
||||
STEPentity *parent_shape = maps->comb_to_step_shape.find(dp)->second;
|
||||
rt_db_get_internal(&comb_intern, dp, dbip, bn_mat_identity, &rt_uniresource);
|
||||
RT_CK_DB_INTERNAL(&comb_intern);
|
||||
struct rt_comb_internal *comb = (struct rt_comb_internal *)(comb_intern.idb_ptr);
|
||||
for (int j = (int)BU_PTBL_LEN(children) - 1; j >= 0; j--){
|
||||
STEPentity *orig_transform = Identity_AXIS2_PLACEMENT_3D(registry, instance_list);
|
||||
STEPentity *curr_transform = NULL;
|
||||
struct directory *curr_dp = (struct directory *)BU_PTBL_GET(children, j);
|
||||
STEPentity *child_shape = maps->comb_to_step_shape.find(curr_dp)->second;
|
||||
if (!child_shape)
|
||||
child_shape = maps->brep_to_step_shape.find(curr_dp)->second;
|
||||
bu_log("%s under %s: ", curr_dp->d_namep, dp->d_namep);
|
||||
union tree *curr_node = db_find_named_leaf(comb->tree, curr_dp->d_namep);
|
||||
matp_t curr_matrix = curr_node->tr_l.tl_mat;
|
||||
if(curr_matrix) {
|
||||
bu_log(" - found matrix over %s in %s\n", curr_dp->d_namep, dp->d_namep);
|
||||
bn_mat_print(curr_dp->d_namep, curr_matrix);
|
||||
curr_transform = Mat_to_Rep(curr_matrix, registry, instance_list);
|
||||
} else {
|
||||
curr_transform = Identity_AXIS2_PLACEMENT_3D(registry, instance_list);
|
||||
bu_log("identity matrix\n");
|
||||
}
|
||||
if (curr_transform) {
|
||||
SdaiItem_defined_transformation *item_transform = (SdaiItem_defined_transformation *)registry->ObjCreate("ITEM_DEFINED_TRANSFORMATION");
|
||||
item_transform->name_("''");
|
||||
item_transform->description_("''");
|
||||
item_transform->transform_item_1_((SdaiRepresentation_item_ptr)orig_transform);
|
||||
item_transform->transform_item_2_((SdaiRepresentation_item_ptr)curr_transform);
|
||||
instance_list->Append((STEPentity *)item_transform, completeSE);
|
||||
SdaiNext_assembly_usage_occurrence *usage = (SdaiNext_assembly_usage_occurrence *)registry->ObjCreate("NEXT_ASSEMBLY_USAGE_OCCURRENCE");
|
||||
usage->id_("''");
|
||||
usage->name_("''");
|
||||
usage->description_("''");
|
||||
usage->reference_designator_("''");
|
||||
usage->relating_product_definition_((SdaiProduct_definition *)maps->comb_to_step.find(dp)->second);
|
||||
SdaiProduct_definition *child_def = (SdaiProduct_definition *)maps->comb_to_step.find(curr_dp)->second;
|
||||
if (!child_def)
|
||||
child_def = (SdaiProduct_definition *)maps->brep_to_step.find(curr_dp)->second;
|
||||
usage->related_product_definition_(child_def);
|
||||
instance_list->Append((STEPentity *)usage, completeSE);
|
||||
SdaiProduct_definition_shape *pshape = (SdaiProduct_definition_shape *)registry->ObjCreate("PRODUCT_DEFINITION_SHAPE");
|
||||
pshape->name_("''");
|
||||
pshape->description_("''");
|
||||
SdaiCharacterized_product_definition *cpd = new SdaiCharacterized_product_definition(usage);
|
||||
pshape->definition_(new SdaiCharacterized_definition(cpd));
|
||||
instance_list->Append((STEPentity *)pshape, completeSE);
|
||||
STEPentity *rep_rel = Build_Representation_Relationship(item_transform, parent_shape, child_shape, registry, instance_list);
|
||||
SdaiContext_dependent_shape_representation *cshape = (SdaiContext_dependent_shape_representation *)registry->ObjCreate("CONTEXT_DEPENDENT_SHAPE_REPRESENTATION");
|
||||
cshape->representation_relation_((SdaiShape_representation_relationship *)rep_rel);
|
||||
cshape->represented_product_relation_(pshape);
|
||||
instance_list->Append((STEPentity *)cshape, completeSE);
|
||||
} else {
|
||||
bu_log("non-uniform scaling detected: %s/%s\n", dp->d_namep, curr_dp->d_namep);
|
||||
}
|
||||
}
|
||||
rt_db_free_internal(&comb_intern);
|
||||
}
|
||||
|
||||
// Local Variables:
|
||||
// tab-width: 8
|
||||
// mode: C++
|
||||
// c-basic-offset: 4
|
||||
// indent-tabs-mode: t
|
||||
// c-file-style: "stroustrup"
|
||||
// End:
|
||||
// ex: shiftwidth=4 tabstop=8
|
||||
@@ -0,0 +1,47 @@
|
||||
/* Assembly_Product.h
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2013 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file step/Assembly_Product.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ASSEMBLY_PRODUCT_H_
|
||||
#define ASSEMBLY_PRODUCT_H_
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "ON_Brep.h"
|
||||
|
||||
STEPentity *Add_Assembly_Product(struct directory *dp,
|
||||
struct db_i *dbip,
|
||||
struct bu_ptbl *children,
|
||||
struct comb_maps *maps,
|
||||
Registry *registry,
|
||||
InstMgr *instance_list);
|
||||
|
||||
#endif /* ASSEMBLY_PRODUCT_H_ */
|
||||
/*
|
||||
* Local Variables:
|
||||
* tab-width: 8
|
||||
* mode: C
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "stroustrup"
|
||||
* End:
|
||||
* ex: shiftwidth=4 tabstop=8
|
||||
*/
|
||||
@@ -9,7 +9,16 @@ GENERATE_SCHEMA_INPUTS(${STEP_SCHEMA_FILE} gstep)
|
||||
set(gstep_SOURCES
|
||||
${express_srcs}
|
||||
../BRLCADWrapper.cpp
|
||||
Assembly_Product.cpp
|
||||
Comb_Tree.cpp
|
||||
Default_Geometric_Context.cpp
|
||||
G_STEP_Util.cpp
|
||||
ON_NurbsCurve.cpp
|
||||
ON_NurbsSurface.cpp
|
||||
ON_Brep.cpp
|
||||
Shape_Definition_Representation.cpp
|
||||
Shape_Representation.cpp
|
||||
Shape_Representation_Relationship.cpp
|
||||
g-step.cpp
|
||||
)
|
||||
|
||||
@@ -47,7 +56,13 @@ if(MSVC)
|
||||
set_target_properties(g-step PROPERTIES COMPILE_DEFINITIONS "${gstep_IMPORTS}")
|
||||
endif(MSVC)
|
||||
|
||||
CMAKEFILES(ON_Brep.h)
|
||||
set(IGNORE_FILES
|
||||
Assembly_Product.h
|
||||
ON_Brep.h
|
||||
Comb_Tree.h
|
||||
G_STEP_internal.h
|
||||
)
|
||||
CMAKEFILES(${IGNORE_FILES})
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
/* C O M B _ T R E E . C P P
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2013 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file Comb_Tree.cpp
|
||||
*
|
||||
* File for writing out a combination and its tree contents
|
||||
* into the STEPcode containers
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sstream>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include "bu.h"
|
||||
#include "raytrace.h"
|
||||
#include "G_STEP_internal.h"
|
||||
#include "STEPWrapper.h"
|
||||
#include "ON_Brep.h"
|
||||
#include "Assembly_Product.h"
|
||||
#include "Comb_Tree.h"
|
||||
|
||||
void
|
||||
Comb_to_STEP(struct directory *dp, Registry *registry, InstMgr *instance_list, STEPentity **shape, STEPentity **product) {
|
||||
std::ostringstream ss;
|
||||
ss << "'" << dp->d_namep << "'";
|
||||
std::string str = ss.str();
|
||||
|
||||
// MECHANICAL_CONTEXT
|
||||
SdaiMechanical_context *mech_context = (SdaiMechanical_context *)registry->ObjCreate("MECHANICAL_CONTEXT");
|
||||
instance_list->Append((STEPentity *)mech_context, completeSE);
|
||||
mech_context->name_("''");
|
||||
mech_context->discipline_type_("''");
|
||||
|
||||
// APPLICATION_CONTEXT - TODO, should be one of these per file?
|
||||
SdaiApplication_context *app_context = (SdaiApplication_context *)registry->ObjCreate("APPLICATION_CONTEXT");
|
||||
instance_list->Append((STEPentity *)app_context, completeSE);
|
||||
mech_context->frame_of_reference_(app_context);
|
||||
app_context->application_("'CONFIGURATION CONTROLLED 3D DESIGNS OF MECHANICAL PARTS AND ASSEMBLIES'");
|
||||
|
||||
// DESIGN_CONTEXT - TODO, should be one of these per file?
|
||||
SdaiDesign_context *design_context = (SdaiDesign_context *)registry->ObjCreate("DESIGN_CONTEXT");
|
||||
instance_list->Append((STEPentity *)design_context, completeSE);
|
||||
design_context->name_("''");
|
||||
design_context->life_cycle_stage_("'design'");
|
||||
design_context->frame_of_reference_(app_context);
|
||||
|
||||
// PRODUCT_DEFINITION
|
||||
SdaiProduct_definition *prod_def = (SdaiProduct_definition *)registry->ObjCreate("PRODUCT_DEFINITION");
|
||||
instance_list->Append((STEPentity *)prod_def, completeSE);
|
||||
prod_def->id_("''");
|
||||
prod_def->description_("''");
|
||||
prod_def->frame_of_reference_(design_context);
|
||||
|
||||
// PRODUCT_DEFINITION_FORMATION
|
||||
SdaiProduct_definition_formation *prod_def_form = (SdaiProduct_definition_formation *)registry->ObjCreate("PRODUCT_DEFINITION_FORMATION");
|
||||
instance_list->Append((STEPentity *)prod_def_form, completeSE);
|
||||
prod_def->formation_(prod_def_form);
|
||||
prod_def_form->id_("''");
|
||||
prod_def_form->description_("''");
|
||||
|
||||
// PRODUCT
|
||||
SdaiProduct *prod = (SdaiProduct *)registry->ObjCreate("PRODUCT");
|
||||
instance_list->Append((STEPentity *)prod, completeSE);
|
||||
prod_def_form->of_product_(prod);
|
||||
prod->id_("''");
|
||||
prod->name_(str.c_str());
|
||||
prod->description_("''");
|
||||
prod->frame_of_reference_()->AddNode(new EntityNode((SDAI_Application_instance *)mech_context));
|
||||
|
||||
// PRODUCT_DEFINITION_SHAPE
|
||||
SdaiProduct_definition_shape *pshape = (SdaiProduct_definition_shape *)registry->ObjCreate("PRODUCT_DEFINITION_SHAPE");
|
||||
instance_list->Append((STEPentity *)pshape, completeSE);
|
||||
pshape->name_("''");
|
||||
pshape->description_("'Comb shape definition'");
|
||||
SdaiCharacterized_product_definition *cpd = new SdaiCharacterized_product_definition(prod_def);
|
||||
pshape->definition_(new SdaiCharacterized_definition(cpd));
|
||||
|
||||
// SHAPE_DEFINITION_REPRESENTATION
|
||||
SdaiShape_definition_representation *shape_def_rep = (SdaiShape_definition_representation*)registry->ObjCreate("SHAPE_DEFINITION_REPRESENTATION");
|
||||
instance_list->Append((STEPentity *)shape_def_rep, completeSE);
|
||||
shape_def_rep->definition_(pshape);
|
||||
|
||||
// SHAPE_REPRESENTATION
|
||||
SdaiShape_representation*shape_rep = (SdaiShape_representation*)registry->ObjCreate("SHAPE_REPRESENTATION");
|
||||
instance_list->Append((STEPentity *)shape_rep, completeSE);
|
||||
shape_def_rep->used_representation_(shape_rep);
|
||||
|
||||
|
||||
(*product) = (STEPentity *)prod_def;
|
||||
(*shape) = (STEPentity *)shape_rep;
|
||||
}
|
||||
|
||||
STEPentity *
|
||||
Comb_Tree_to_STEP(struct directory *dp, struct rt_wdb *wdbp, Registry *registry, InstMgr *instance_list)
|
||||
{
|
||||
STEPentity *toplevel_comb = NULL;
|
||||
struct comb_maps *maps = new comb_maps;
|
||||
|
||||
std::set<struct directory *> non_wrapper_combs;
|
||||
|
||||
|
||||
/* Find all solids, make instances of them, insert them, and stick in *dp to STEPentity* map */
|
||||
const char *brep_search = "-type brep";
|
||||
struct bu_ptbl *breps = db_search_path_obj(brep_search, dp, wdbp);
|
||||
for (int j = (int)BU_PTBL_LEN(breps) - 1; j >= 0; j--){
|
||||
STEPentity *brep_shape;
|
||||
STEPentity *brep_product;
|
||||
struct directory *curr_dp = (struct directory *)BU_PTBL_GET(breps, j);
|
||||
struct rt_db_internal brep_intern;
|
||||
rt_db_get_internal(&brep_intern, curr_dp, wdbp->dbip, bn_mat_identity, &rt_uniresource);
|
||||
RT_CK_DB_INTERNAL(&brep_intern);
|
||||
ON_BRep_to_STEP(curr_dp, &brep_intern, registry, instance_list, &brep_shape, &brep_product);
|
||||
maps->brep_to_step[curr_dp] = brep_product;
|
||||
maps->brep_to_step_shape[curr_dp] = brep_shape;
|
||||
bu_log("Brep: %s\n", curr_dp->d_namep);
|
||||
}
|
||||
|
||||
/* Find all combs that are not already brep wrappers, make instances of them, insert them, and stick in *dp to STEPentity* map */
|
||||
const char *comb_search = "-type comb ! ( -nnodes 1 -below=1 -type brep )";
|
||||
struct bu_ptbl *combs = db_search_path_obj(comb_search, dp, wdbp);
|
||||
for (int j = (int)BU_PTBL_LEN(combs) - 1; j >= 0; j--){
|
||||
struct directory *curr_dp = (struct directory *)BU_PTBL_GET(combs, j);
|
||||
STEPentity *comb_shape;
|
||||
STEPentity *comb_product;
|
||||
Comb_to_STEP(curr_dp, registry, instance_list, &comb_shape, &comb_product);
|
||||
maps->comb_to_step[curr_dp] = comb_product;
|
||||
maps->comb_to_step_shape[curr_dp] = comb_shape;
|
||||
non_wrapper_combs.insert(curr_dp);
|
||||
bu_log("Comb non-wrapper: %s\n", curr_dp->d_namep);
|
||||
}
|
||||
|
||||
/* Find the combs that *are* wrappers, and point them to the product associated with their brep.
|
||||
* Change the name of the product, if appropriate */
|
||||
const char *comb_wrapper_search = "-type comb -nnodes 1 -below=1 -type brep";
|
||||
const char *comb_child_search = "-mindepth 1 -type brep";
|
||||
struct bu_ptbl *comb_wrappers = db_search_path_obj(comb_wrapper_search, dp, wdbp);
|
||||
for (int j = (int)BU_PTBL_LEN(comb_wrappers) - 1; j >= 0; j--){
|
||||
struct directory *curr_dp = (struct directory *)BU_PTBL_GET(comb_wrappers, j);
|
||||
/* Satisfying the search pattern isn't enough to qualify as a wrapping comb - there
|
||||
* must also be no matrix hanging over the primitive */
|
||||
struct rt_db_internal comb_intern;
|
||||
rt_db_get_internal(&comb_intern, curr_dp, wdbp->dbip, bn_mat_identity, &rt_uniresource);
|
||||
RT_CK_DB_INTERNAL(&comb_intern);
|
||||
struct rt_comb_internal *comb = (struct rt_comb_internal *)(comb_intern.idb_ptr);
|
||||
struct bu_ptbl *comb_child = db_search_path_obj(comb_child_search, curr_dp, wdbp);
|
||||
struct directory *child = (struct directory *)BU_PTBL_GET(comb_child, 0);
|
||||
bu_ptbl_free(comb_child);
|
||||
bu_free(comb_child, "free search result");
|
||||
union tree *curr_node = db_find_named_leaf(comb->tree, child->d_namep);
|
||||
if (!(curr_node->tr_l.tl_mat)) {
|
||||
std::ostringstream ss;
|
||||
ss << "'" << curr_dp->d_namep << "'";
|
||||
std::string str = ss.str();
|
||||
maps->comb_to_step[curr_dp] = maps->brep_to_step.find(child)->second;
|
||||
maps->comb_to_step_shape[curr_dp] = maps->brep_to_step_shape.find(child)->second;
|
||||
bu_log("Comb wrapper: %s\n", curr_dp->d_namep);
|
||||
((SdaiProduct_definition *)(maps->comb_to_step[curr_dp]))->formation_()->of_product_()->name_(str.c_str());
|
||||
}else{
|
||||
STEPentity *comb_shape;
|
||||
STEPentity *comb_product;
|
||||
Comb_to_STEP(curr_dp, registry, instance_list, &comb_shape, &comb_product);
|
||||
maps->comb_to_step[curr_dp] = comb_product;
|
||||
maps->comb_to_step_shape[curr_dp] = comb_shape;
|
||||
non_wrapper_combs.insert(curr_dp);
|
||||
bu_log("Comb non-wrapper (matrix over primitive): %s\n", curr_dp->d_namep);
|
||||
}
|
||||
rt_db_free_internal(&comb_intern);
|
||||
}
|
||||
|
||||
/* For each non-wrapper comb, get list of immediate children and call Assembly Product,
|
||||
* which will define the relationships between the comb and its children using
|
||||
* the appropriate step foo and the pointers in the map.*/
|
||||
|
||||
/* TODO - need to figure out how to pull matrices, translate them into STEP, and
|
||||
* where to associate them.*/
|
||||
const char *comb_children_search = "-mindepth 1 -maxdepth 1";
|
||||
for (std::set<struct directory *>::iterator it=non_wrapper_combs.begin(); it != non_wrapper_combs.end(); ++it) {
|
||||
bu_log("look for matrices in %s\n", (*it)->d_namep);
|
||||
struct bu_ptbl *comb_children = db_search_path_obj(comb_children_search, (*it), wdbp);
|
||||
Add_Assembly_Product((*it), wdbp->dbip, comb_children, maps, registry, instance_list);
|
||||
bu_ptbl_free(comb_children);
|
||||
bu_free(comb_children, "free search result");
|
||||
}
|
||||
|
||||
return toplevel_comb;
|
||||
}
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// tab-width: 8
|
||||
// mode: C++
|
||||
// c-basic-offset: 4
|
||||
// indent-tabs-mode: t
|
||||
// c-file-style: "stroustrup"
|
||||
// End:
|
||||
// ex: shiftwidth=4 tabstop=8
|
||||
@@ -0,0 +1,52 @@
|
||||
/* Comb_Tree.h
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2013 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file step/Comb_Tree.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef COMB_TREE_H_
|
||||
#define COMB_TREE_H_
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "ON_Brep.h"
|
||||
|
||||
struct comb_maps {
|
||||
std::map<struct directory *, STEPentity *> brep_to_step;
|
||||
std::map<struct directory *, STEPentity *> brep_to_step_shape;
|
||||
std::map<struct directory *, STEPentity *> comb_to_step;
|
||||
std::map<struct directory *, STEPentity *> comb_to_step_shape;
|
||||
};
|
||||
|
||||
STEPentity *Comb_Tree_to_STEP(struct directory *dp,
|
||||
struct rt_wdb *wdbp,
|
||||
Registry *registry,
|
||||
InstMgr *instance_list);
|
||||
|
||||
#endif /* COMB_TREE_H_ */
|
||||
/*
|
||||
* Local Variables:
|
||||
* tab-width: 8
|
||||
* mode: C
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "stroustrup"
|
||||
* End:
|
||||
* ex: shiftwidth=4 tabstop=8
|
||||
*/
|
||||
@@ -0,0 +1,218 @@
|
||||
/* D E F A U L T _ G E O M E T R I C _ C O N T E X T . C P P
|
||||
*
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2013 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file Default_Geometric_Context.cpp
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include "G_STEP_internal.h"
|
||||
|
||||
STEPcomplex *
|
||||
Add_Default_Geometric_Context(Registry *registry, InstMgr *instance_list)
|
||||
{
|
||||
|
||||
int instance_cnt = 0;
|
||||
STEPattribute *attr;
|
||||
STEPcomplex *stepcomplex;
|
||||
|
||||
/* Uncertainty measure with unit */
|
||||
SdaiUncertainty_measure_with_unit *uncertainty = (SdaiUncertainty_measure_with_unit *)registry->ObjCreate("UNCERTAINTY_MEASURE_WITH_UNIT");
|
||||
uncertainty->name_("'DISTANCE_ACCURACY_VALUE'");
|
||||
uncertainty->description_("'Threshold below which geometry imperfections (such as overlaps) are not considered errors.'");
|
||||
instance_list->Append(uncertainty, completeSE);
|
||||
instance_cnt++;
|
||||
|
||||
/** unit component of uncertainty measure with unit */
|
||||
const char *unitNmArr[4] = {"length_unit", "named_unit", "si_unit", "*"};
|
||||
STEPcomplex *unit_complex = new STEPcomplex(registry, (const char **)unitNmArr, instance_cnt);
|
||||
instance_list->Append((STEPentity *)unit_complex, completeSE);
|
||||
instance_cnt++;
|
||||
stepcomplex = unit_complex->head;
|
||||
while (stepcomplex) {
|
||||
if (!bu_strcmp(stepcomplex->EntityName(), "Si_Unit")) {
|
||||
stepcomplex->ResetAttributes();
|
||||
while ((attr = stepcomplex->NextAttribute()) != NULL) {
|
||||
if (!bu_strcmp(attr->Name(), "prefix")) attr->ptr.e = new SdaiSi_prefix_var(Si_prefix__milli);
|
||||
if (!bu_strcmp(attr->Name(), "name")) attr->ptr.e = new SdaiSi_unit_name_var(Si_unit_name__metre);
|
||||
}
|
||||
}
|
||||
stepcomplex = stepcomplex->sc;
|
||||
}
|
||||
|
||||
SdaiUnit *new_unit = new SdaiUnit((SdaiNamed_unit *)unit_complex);
|
||||
uncertainty->ResetAttributes();
|
||||
{
|
||||
while ((attr = uncertainty->NextAttribute()) != NULL) {
|
||||
if (!bu_strcmp(attr->Name(), "unit_component")) attr->ptr.sh = new_unit;
|
||||
if (!bu_strcmp(attr->Name(), "value_component")) attr->StrToVal("0.05");
|
||||
}
|
||||
}
|
||||
|
||||
/* Global Unit Assigned Context */
|
||||
const char *ua_entry_1_types[4] = {"named_unit", "si_unit", "solid_angle_unit", "*"};
|
||||
STEPcomplex *ua_entry_1 = new STEPcomplex(registry, (const char **)ua_entry_1_types, instance_cnt);
|
||||
stepcomplex = ua_entry_1->head;
|
||||
while (stepcomplex) {
|
||||
if (!bu_strcmp(stepcomplex->EntityName(), "Si_Unit")) {
|
||||
stepcomplex->ResetAttributes();
|
||||
while ((attr = stepcomplex->NextAttribute()) != NULL) {
|
||||
if (!bu_strcmp(attr->Name(), "name")) attr->ptr.e = new SdaiSi_unit_name_var(Si_unit_name__steradian);
|
||||
}
|
||||
}
|
||||
stepcomplex = stepcomplex->sc;
|
||||
}
|
||||
instance_list->Append((STEPentity *)ua_entry_1, completeSE);
|
||||
instance_cnt++;
|
||||
|
||||
const char *ua_entry_3_types[4] = {"named_unit", "plane_angle_unit", "si_unit", "*"};
|
||||
STEPcomplex *ua_entry_3 = new STEPcomplex(registry, (const char **)ua_entry_3_types, instance_cnt);
|
||||
stepcomplex = ua_entry_3->head;
|
||||
while (stepcomplex) {
|
||||
if (!bu_strcmp(stepcomplex->EntityName(), "Si_Unit")) {
|
||||
stepcomplex->ResetAttributes();
|
||||
while ((attr = stepcomplex->NextAttribute()) != NULL) {
|
||||
if (!bu_strcmp(attr->Name(), "name")) attr->ptr.e = new SdaiSi_unit_name_var(Si_unit_name__radian);
|
||||
}
|
||||
}
|
||||
stepcomplex = stepcomplex->sc;
|
||||
}
|
||||
instance_list->Append((STEPentity *)ua_entry_3, completeSE);
|
||||
instance_cnt++;
|
||||
|
||||
/* Plane Angle Measure */
|
||||
SdaiPlane_angle_measure_with_unit *p_ang_measure_with_unit = new SdaiPlane_angle_measure_with_unit();
|
||||
SdaiMeasure_value * p_ang_measure_value = new SdaiMeasure_value(DEG2RAD, config_control_design::t_measure_value);
|
||||
p_ang_measure_value->SetUnderlyingType(config_control_design::t_plane_angle_measure);
|
||||
p_ang_measure_with_unit->value_component_(p_ang_measure_value);
|
||||
SdaiUnit *p_ang_unit = new SdaiUnit((SdaiNamed_unit *)ua_entry_3);
|
||||
p_ang_measure_with_unit->unit_component_(p_ang_unit);
|
||||
instance_list->Append((STEPentity *)p_ang_measure_with_unit, completeSE);
|
||||
instance_cnt++;
|
||||
|
||||
/* Conversion based unit */
|
||||
const char *ua_entry_2_types[4] = {"conversion_based_unit", "named_unit", "plane_angle_unit", "*"};
|
||||
STEPcomplex *ua_entry_2 = new STEPcomplex(registry, (const char **)ua_entry_2_types, instance_cnt);
|
||||
|
||||
/** dimensional exponents **/
|
||||
SdaiDimensional_exponents *dimensional_exp = new SdaiDimensional_exponents();
|
||||
dimensional_exp->length_exponent_(0.0);
|
||||
dimensional_exp->mass_exponent_(0.0);
|
||||
dimensional_exp->time_exponent_(0.0);
|
||||
dimensional_exp->electric_current_exponent_(0.0);
|
||||
dimensional_exp->thermodynamic_temperature_exponent_(0.0);
|
||||
dimensional_exp->amount_of_substance_exponent_(0.0);
|
||||
dimensional_exp->luminous_intensity_exponent_(0.0);
|
||||
instance_list->Append((STEPentity *)dimensional_exp, completeSE);
|
||||
|
||||
stepcomplex = ua_entry_2->head;
|
||||
while (stepcomplex) {
|
||||
if (!bu_strcmp(stepcomplex->EntityName(), "Conversion_Based_Unit")) {
|
||||
stepcomplex->ResetAttributes();
|
||||
while ((attr = stepcomplex->NextAttribute()) != NULL) {
|
||||
if (!bu_strcmp(attr->Name(), "name")) attr->StrToVal("'DEGREES'");
|
||||
if (!bu_strcmp(attr->Name(), "conversion_factor")) {
|
||||
attr->ptr.c = new (STEPentity *);
|
||||
*(attr->ptr.c) = (STEPentity *)(p_ang_measure_with_unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!bu_strcmp(stepcomplex->EntityName(), "Named_Unit")) {
|
||||
stepcomplex->ResetAttributes();
|
||||
while ((attr = stepcomplex->NextAttribute()) != NULL) {
|
||||
if (!bu_strcmp(attr->Name(), "dimensions")) {
|
||||
attr->ptr.c = new (STEPentity *);
|
||||
*(attr->ptr.c) = (STEPentity *)(dimensional_exp);
|
||||
}
|
||||
}
|
||||
}
|
||||
stepcomplex = stepcomplex->sc;
|
||||
}
|
||||
|
||||
instance_list->Append((STEPentity *)ua_entry_2, completeSE);
|
||||
instance_cnt++;
|
||||
|
||||
/*
|
||||
* Now that we have the pieces, build the final complex type from four other types:
|
||||
*/
|
||||
const char *entNmArr[5] = {"geometric_representation_context", "global_uncertainty_assigned_context",
|
||||
"global_unit_assigned_context", "representation_context", "*"};
|
||||
STEPcomplex *complex_entity = new STEPcomplex(registry, (const char **)entNmArr, instance_cnt);
|
||||
stepcomplex = complex_entity->head;
|
||||
|
||||
while (stepcomplex) {
|
||||
|
||||
if (!bu_strcmp(stepcomplex->EntityName(), "Geometric_Representation_Context")) {
|
||||
stepcomplex->ResetAttributes();
|
||||
while ((attr = stepcomplex->NextAttribute()) != NULL) {
|
||||
if (!bu_strcmp(attr->Name(), "coordinate_space_dimension")) attr->StrToVal("3");
|
||||
}
|
||||
}
|
||||
|
||||
if (!bu_strcmp(stepcomplex->EntityName(), "Global_Uncertainty_Assigned_Context")) {
|
||||
stepcomplex->ResetAttributes();
|
||||
while ((attr = stepcomplex->NextAttribute()) != NULL) {
|
||||
if (!bu_strcmp(attr->Name(), "uncertainty")) {
|
||||
EntityAggregate *unc_agg = new EntityAggregate();
|
||||
unc_agg->AddNode(new EntityNode((SDAI_Application_instance *)uncertainty));
|
||||
attr->ptr.a = unc_agg;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!bu_strcmp(stepcomplex->EntityName(), "Global_Unit_Assigned_Context")) {
|
||||
stepcomplex->ResetAttributes();
|
||||
while ((attr = stepcomplex->NextAttribute()) != NULL) {
|
||||
std::string attrval;
|
||||
if (!bu_strcmp(attr->Name(), "units")) {
|
||||
EntityAggregate *unit_assigned_agg = new EntityAggregate();
|
||||
unit_assigned_agg->AddNode(new EntityNode((SDAI_Application_instance *)unit_complex));
|
||||
unit_assigned_agg->AddNode(new EntityNode((SDAI_Application_instance *)ua_entry_2));
|
||||
unit_assigned_agg->AddNode(new EntityNode((SDAI_Application_instance *)ua_entry_3));
|
||||
attr->ptr.a = unit_assigned_agg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bu_strcmp(stepcomplex->EntityName(), "Representation_Context")) {
|
||||
stepcomplex->ResetAttributes();
|
||||
while ((attr = stepcomplex->NextAttribute()) != NULL) {
|
||||
if (!bu_strcmp(attr->Name(), "context_identifier")) attr->StrToVal("'STANDARD'");
|
||||
if (!bu_strcmp(attr->Name(), "context_type")) attr->StrToVal("'3D'");
|
||||
}
|
||||
}
|
||||
stepcomplex = stepcomplex->sc;
|
||||
}
|
||||
|
||||
instance_list->Append((STEPentity *)complex_entity, completeSE);
|
||||
|
||||
return complex_entity;
|
||||
}
|
||||
|
||||
// Local Variables:
|
||||
// tab-width: 8
|
||||
// mode: C++
|
||||
// c-basic-offset: 4
|
||||
// indent-tabs-mode: t
|
||||
// c-file-style: "stroustrup"
|
||||
// End:
|
||||
// ex: shiftwidth=4 tabstop=8
|
||||
@@ -0,0 +1,69 @@
|
||||
/* G _ S T E P _ U T I L . C P P
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2013 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file G_STEP_util.cpp
|
||||
*
|
||||
* General utilities for translating data to STEPcode containers
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <map>
|
||||
|
||||
#include "G_STEP_internal.h"
|
||||
|
||||
void
|
||||
XYZ_to_Cartesian_point(double x, double y, double z, SdaiCartesian_point *step_pnt) {
|
||||
RealAggregate_ptr coord_vals = step_pnt->coordinates_();
|
||||
RealNode *xnode = new RealNode();
|
||||
xnode->value = x;
|
||||
coord_vals->AddNode(xnode);
|
||||
RealNode *ynode = new RealNode();
|
||||
ynode->value = y;
|
||||
coord_vals->AddNode(ynode);
|
||||
RealNode *znode = new RealNode();
|
||||
znode->value = z;
|
||||
coord_vals->AddNode(znode);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
XYZ_to_Direction(double x, double y, double z, SdaiDirection *step_direction) {
|
||||
RealAggregate_ptr coord_vals = step_direction->direction_ratios_();
|
||||
RealNode *xnode = new RealNode();
|
||||
xnode->value = x;
|
||||
coord_vals->AddNode(xnode);
|
||||
RealNode *ynode = new RealNode();
|
||||
ynode->value = y;
|
||||
coord_vals->AddNode(ynode);
|
||||
RealNode *znode = new RealNode();
|
||||
znode->value = z;
|
||||
coord_vals->AddNode(znode);
|
||||
}
|
||||
|
||||
// Local Variables:
|
||||
// tab-width: 8
|
||||
// mode: C++
|
||||
// c-basic-offset: 4
|
||||
// indent-tabs-mode: t
|
||||
// c-file-style: "stroustrup"
|
||||
// End:
|
||||
// ex: shiftwidth=4 tabstop=8
|
||||
@@ -0,0 +1,47 @@
|
||||
/* G _ S T E P _ I N T E R N A L . H
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2013 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file step/G_STEP_internal.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef G_STEP_internal_H_
|
||||
#define G_STEP_internal_H_
|
||||
|
||||
#include "STEPWrapper.h"
|
||||
|
||||
void XYZ_to_Cartesian_point(double x, double y, double z, SdaiCartesian_point *step_pnt);
|
||||
void XYZ_to_Direction(double x, double y, double z, SdaiDirection *step_direction);
|
||||
|
||||
STEPentity * Add_Shape_Representation_Relationship(Registry *registry, InstMgr *instance_list, SdaiRepresentation *shape_rep, SdaiRepresentation *manifold_shape);
|
||||
SdaiRepresentation * Add_Shape_Representation(Registry *registry, InstMgr *instance_list, SdaiRepresentation_context *context);
|
||||
STEPentity * Add_Shape_Definition_Representation(Registry *registry, InstMgr *instance_list, SdaiRepresentation *sdairep);
|
||||
STEPcomplex * Add_Default_Geometric_Context(Registry *registry, InstMgr *instance_list);
|
||||
|
||||
#endif /* G_STEP_internal_H_ */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* tab-width: 8
|
||||
* mode: C
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "stroustrup"
|
||||
* End:
|
||||
* ex: shiftwidth=4 tabstop=8
|
||||
*/
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user