Compare commits
1060 Commits
OpenSceneG
...
OpenSceneG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43792651f0 | ||
|
|
fb91677fce | ||
|
|
dab855f141 | ||
|
|
01b510865f | ||
|
|
6c08cc5937 | ||
|
|
7f3fe7baed | ||
|
|
ae233b9392 | ||
|
|
1712176900 | ||
|
|
967e2b7926 | ||
|
|
64d4e6a913 | ||
|
|
ae33aeed8a | ||
|
|
49bf375b68 | ||
|
|
40a0c1cde2 | ||
|
|
bfd9ec30ca | ||
|
|
599715e1d1 | ||
|
|
3fc3fc060f | ||
|
|
29199a9a68 | ||
|
|
b8a76a0ce0 | ||
|
|
a927748a73 | ||
|
|
5d53cb13d5 | ||
|
|
aa3766ca70 | ||
|
|
b5743c1c9f | ||
|
|
894800115c | ||
|
|
0574e17eaa | ||
|
|
9e1362445c | ||
|
|
a1af64be80 | ||
|
|
f02caa5371 | ||
|
|
6d1a94c785 | ||
|
|
1163ebb25b | ||
|
|
4563195a18 | ||
|
|
00ca996576 | ||
|
|
7ab4faeae1 | ||
|
|
4e90ccb13a | ||
|
|
5c70f4828f | ||
|
|
bdcba7220c | ||
|
|
cfa9c3682f | ||
|
|
8f8f217ee7 | ||
|
|
ec0faff644 | ||
|
|
201e73c3c1 | ||
|
|
cb3868872e | ||
|
|
9f45b89722 | ||
|
|
18b8d05d1f | ||
|
|
ae10c4ef89 | ||
|
|
6222373479 | ||
|
|
5be809ab04 | ||
|
|
da79cd85e4 | ||
|
|
211764ca2d | ||
|
|
8041a24a4f | ||
|
|
b011470dfe | ||
|
|
3155b1722c | ||
|
|
40fc0eb263 | ||
|
|
38e68ed7f1 | ||
|
|
15fd3bdcc2 | ||
|
|
1858366514 | ||
|
|
241efbaa33 | ||
|
|
5c6c51c887 | ||
|
|
817780e67c | ||
|
|
7ed9ef7db0 | ||
|
|
12d20ee257 | ||
|
|
2bed6a2dca | ||
|
|
315e749cce | ||
|
|
0b5d743411 | ||
|
|
0029d8fc46 | ||
|
|
a5d6c1a6a3 | ||
|
|
65f85fee6d | ||
|
|
df14b9980a | ||
|
|
7ba85b16db | ||
|
|
bda1350be4 | ||
|
|
31f2e7902f | ||
|
|
e89336a306 | ||
|
|
9a8abe7fee | ||
|
|
01b27a9fb2 | ||
|
|
21f735d653 | ||
|
|
4dfa7485c1 | ||
|
|
7bbc1c419b | ||
|
|
ab029febbd | ||
|
|
d5d19ac1a4 | ||
|
|
44da3958c3 | ||
|
|
26e3f00882 | ||
|
|
fb6e1d4d9f | ||
|
|
e4fa4f9119 | ||
|
|
a9c1dd1a4a | ||
|
|
102e5c2439 | ||
|
|
264746a5c2 | ||
|
|
dfa3c9a2c9 | ||
|
|
b795e65a39 | ||
|
|
b1dbb9e96b | ||
|
|
4f6add4c14 | ||
|
|
edb1eede40 | ||
|
|
9cccbcd7b7 | ||
|
|
1bf529b391 | ||
|
|
83b84eb2f4 | ||
|
|
90325a5895 | ||
|
|
c2bc684eb2 | ||
|
|
5b439806ce | ||
|
|
5574c50607 | ||
|
|
31cb807db3 | ||
|
|
3326c26a60 | ||
|
|
8d70cc0b0f | ||
|
|
3558d1d010 | ||
|
|
be47c9f44a | ||
|
|
6dab8c3380 | ||
|
|
bbc8e7b58c | ||
|
|
9d8c98395e | ||
|
|
abbf13d7bf | ||
|
|
431c34024c | ||
|
|
ba50def217 | ||
|
|
7592acf224 | ||
|
|
62f5a4d3bc | ||
|
|
0c345e76d4 | ||
|
|
d4ec341573 | ||
|
|
371778e0e7 | ||
|
|
ca58e0db21 | ||
|
|
a6e017dc3c | ||
|
|
e843836292 | ||
|
|
e7447a46be | ||
|
|
ec23bf1b1c | ||
|
|
285240fd2d | ||
|
|
bf5cad7a0c | ||
|
|
c81ba225c9 | ||
|
|
79967399fe | ||
|
|
adced1b3dc | ||
|
|
0e64a4773a | ||
|
|
f86dbaed74 | ||
|
|
6612b98ddb | ||
|
|
67ef3fd2c5 | ||
|
|
4ae4b9fdf5 | ||
|
|
e1c5969b0e | ||
|
|
029c114c4c | ||
|
|
bc7f1cf5ac | ||
|
|
34c458f075 | ||
|
|
7e84617d24 | ||
|
|
aab533c046 | ||
|
|
b2e40572e5 | ||
|
|
f175cad6d8 | ||
|
|
2d2b13361b | ||
|
|
aa7b0becf7 | ||
|
|
4f3e2c2e82 | ||
|
|
ebee4b6721 | ||
|
|
e383ef95bc | ||
|
|
2741c38c0d | ||
|
|
a15b93432a | ||
|
|
3d4ff7ae02 | ||
|
|
cc3f8eba8b | ||
|
|
5802844f52 | ||
|
|
98c3d362e5 | ||
|
|
9c6f1ac45a | ||
|
|
3e340bb23d | ||
|
|
1bbcc0ea44 | ||
|
|
b3f1204c64 | ||
|
|
df731d8244 | ||
|
|
29857b3b19 | ||
|
|
b608c191c1 | ||
|
|
d3d0c28f61 | ||
|
|
c78d065d51 | ||
|
|
171bc9da21 | ||
|
|
2bb480759f | ||
|
|
4ff8df73bc | ||
|
|
8631eaaf40 | ||
|
|
ed2aa7c90f | ||
|
|
8cd7d36982 | ||
|
|
d843de261e | ||
|
|
c60cff5eb6 | ||
|
|
18726b72ea | ||
|
|
04e10363bb | ||
|
|
ee4d49c398 | ||
|
|
a6774396bd | ||
|
|
c37b478ed6 | ||
|
|
339026a0f2 | ||
|
|
e68110f303 | ||
|
|
1490271272 | ||
|
|
8faa9d3f63 | ||
|
|
8297d8f0cb | ||
|
|
439c3a866b | ||
|
|
8954964c32 | ||
|
|
7e75fa6a66 | ||
|
|
ced46026e5 | ||
|
|
36ba62e69a | ||
|
|
721505f7c9 | ||
|
|
e4eb3896dd | ||
|
|
98df276818 | ||
|
|
c3bad2bd04 | ||
|
|
e4ad3d311d | ||
|
|
fc05e7d8b1 | ||
|
|
d58a21ca5f | ||
|
|
03e08d7918 | ||
|
|
6ce7cc9d6a | ||
|
|
2646423be7 | ||
|
|
625ea05d3f | ||
|
|
f963397726 | ||
|
|
7c97bab944 | ||
|
|
89052bec27 | ||
|
|
99120af181 | ||
|
|
166f949592 | ||
|
|
145d93073c | ||
|
|
db00cb1613 | ||
|
|
1420393b00 | ||
|
|
440445aa8b | ||
|
|
07bccafd05 | ||
|
|
6df979f8c8 | ||
|
|
aef27c4387 | ||
|
|
d3061ac0f7 | ||
|
|
4adc16bcdd | ||
|
|
6a051be85a | ||
|
|
cbb9881003 | ||
|
|
be40ac8aad | ||
|
|
919a1e5286 | ||
|
|
85acee5dcc | ||
|
|
77326d2c17 | ||
|
|
ea3b08526d | ||
|
|
437377b5d5 | ||
|
|
c7f2e570ed | ||
|
|
b9540fc9f1 | ||
|
|
fa8de3058f | ||
|
|
1194f8941c | ||
|
|
1a922f0f28 | ||
|
|
ce1d7c0c90 | ||
|
|
3c50ac6f04 | ||
|
|
b783a7468e | ||
|
|
4e2c17ee02 | ||
|
|
578a910ad0 | ||
|
|
e0f4fb0952 | ||
|
|
6ad6bf8b5a | ||
|
|
0b702d27de | ||
|
|
d3f2c6e505 | ||
|
|
12d62940bc | ||
|
|
ffcece130a | ||
|
|
e2d7743a80 | ||
|
|
6298312cf0 | ||
|
|
1a3a801857 | ||
|
|
5ee4a99de0 | ||
|
|
9097925163 | ||
|
|
f29ddb0e05 | ||
|
|
96cd49d43a | ||
|
|
cd666f61e8 | ||
|
|
1224e0883a | ||
|
|
fde95d5ccf | ||
|
|
d0e12bd379 | ||
|
|
9acbe3e44f | ||
|
|
eb9b99b5ec | ||
|
|
42f06bf81a | ||
|
|
76dd3698ce | ||
|
|
a571574a1c | ||
|
|
223c603a8c | ||
|
|
91716f6e06 | ||
|
|
b8345534c5 | ||
|
|
33cba8392a | ||
|
|
2ab6a762c8 | ||
|
|
cc68950e7a | ||
|
|
59c1483fb9 | ||
|
|
cb37bf2446 | ||
|
|
3a34e2869b | ||
|
|
849333d43e | ||
|
|
a15813c4a7 | ||
|
|
a606fd688c | ||
|
|
af8696ca57 | ||
|
|
fc6fa1e268 | ||
|
|
a40c476aa4 | ||
|
|
fadc4661e7 | ||
|
|
3c6b26c970 | ||
|
|
316a7a4dbd | ||
|
|
ff66ca022e | ||
|
|
2540c7dd57 | ||
|
|
d4afe154f0 | ||
|
|
7eafde35e2 | ||
|
|
734463fcc7 | ||
|
|
abb63e3199 | ||
|
|
c5733fef14 | ||
|
|
b51adc6f24 | ||
|
|
1f3551820b | ||
|
|
17241da4e5 | ||
|
|
5aeca01828 | ||
|
|
1153ea5feb | ||
|
|
965b7ddc72 | ||
|
|
bd3c5ac0fa | ||
|
|
10d16c92fe | ||
|
|
81b336756b | ||
|
|
c37d72957a | ||
|
|
e1bdee5338 | ||
|
|
630f5087dc | ||
|
|
b1a5228972 | ||
|
|
33d158e290 | ||
|
|
fa727038a4 | ||
|
|
3d1c38f5e8 | ||
|
|
2d55740b3e | ||
|
|
6130f292a7 | ||
|
|
d6b0cd64f1 | ||
|
|
a13c6405d8 | ||
|
|
b514b435f4 | ||
|
|
281800539e | ||
|
|
6fda032aa2 | ||
|
|
aed3339e43 | ||
|
|
a358bd7370 | ||
|
|
cbaf9d639c | ||
|
|
5c7a6a25a0 | ||
|
|
eae23b01c3 | ||
|
|
f394179baf | ||
|
|
a019c74de1 | ||
|
|
7a7c64211c | ||
|
|
1dd7f10e19 | ||
|
|
411431f3be | ||
|
|
6710fbc78a | ||
|
|
51403143bd | ||
|
|
4c75313ced | ||
|
|
04631ff9ae | ||
|
|
d277a85537 | ||
|
|
3e8249591b | ||
|
|
16e1ea70a6 | ||
|
|
66d77e3ebd | ||
|
|
4291a8e193 | ||
|
|
7db0ba0bea | ||
|
|
8e3b5e41c7 | ||
|
|
9b64144a2f | ||
|
|
d62c34efe8 | ||
|
|
2bf68cab53 | ||
|
|
d44b4d21b9 | ||
|
|
2014d6162c | ||
|
|
be179b481d | ||
|
|
5ac339d7b2 | ||
|
|
e5680b2b4f | ||
|
|
8c134750e6 | ||
|
|
f9855c35ec | ||
|
|
4004b37ee8 | ||
|
|
ac264a4a0c | ||
|
|
ef9987559e | ||
|
|
89d9da4fbe | ||
|
|
ca1f1e5abe | ||
|
|
d85759c61c | ||
|
|
065b1d4978 | ||
|
|
b328758058 | ||
|
|
f0a044ee77 | ||
|
|
84f300fdaf | ||
|
|
789c35381d | ||
|
|
75cd471254 | ||
|
|
2b45fd1510 | ||
|
|
baa25411fd | ||
|
|
49fbc56587 | ||
|
|
d2d89498ad | ||
|
|
a51e95222d | ||
|
|
998582e945 | ||
|
|
e02ef22062 | ||
|
|
c898bc0ce7 | ||
|
|
0308a2005e | ||
|
|
a7b057feee | ||
|
|
c7744b15a3 | ||
|
|
29157f24d9 | ||
|
|
1787efc9a3 | ||
|
|
48f683ec3f | ||
|
|
eb17751edd | ||
|
|
c7bf776bcb | ||
|
|
69f9377093 | ||
|
|
55a0381687 | ||
|
|
f623f6e83f | ||
|
|
6b48e4b1ea | ||
|
|
2d9097bb26 | ||
|
|
e4b2562f7b | ||
|
|
85d993cdef | ||
|
|
88ce4a3786 | ||
|
|
e0c279bf3d | ||
|
|
7b598c5701 | ||
|
|
aa8402ce81 | ||
|
|
4161762cff | ||
|
|
1fe0f0c0d6 | ||
|
|
b36f7e1fe7 | ||
|
|
c17d85c241 | ||
|
|
33db349781 | ||
|
|
2e7ef9ed62 | ||
|
|
55e89e4466 | ||
|
|
d542961ca3 | ||
|
|
99313d225b | ||
|
|
a3b91f9294 | ||
|
|
908432c732 | ||
|
|
e17535813f | ||
|
|
39fc490a64 | ||
|
|
a6284b0e03 | ||
|
|
0897368fa6 | ||
|
|
1c88753551 | ||
|
|
f23f2c351f | ||
|
|
a40aa3a734 | ||
|
|
0739b09519 | ||
|
|
bda89b113e | ||
|
|
fe667cdd2b | ||
|
|
d46e0fcc79 | ||
|
|
87cd4530f5 | ||
|
|
8a971d96d2 | ||
|
|
894b161878 | ||
|
|
71ee1a7047 | ||
|
|
069d86ae8b | ||
|
|
b176c3a223 | ||
|
|
9d4b44f956 | ||
|
|
29ac92df0e | ||
|
|
5e629d1236 | ||
|
|
78c2f98b7a | ||
|
|
ba94ea8c7d | ||
|
|
3be239bdb2 | ||
|
|
2f7fb53ff7 | ||
|
|
c28221b06f | ||
|
|
778f4e321d | ||
|
|
1a00a2ce3c | ||
|
|
d87ec7cb18 | ||
|
|
c21eef7afb | ||
|
|
2efce3965a | ||
|
|
f260737cd8 | ||
|
|
7bcdaa74bf | ||
|
|
6a19b04d22 | ||
|
|
53d99109bd | ||
|
|
12a484593c | ||
|
|
ded06dc421 | ||
|
|
c2e7eacc06 | ||
|
|
ef1d205a2e | ||
|
|
6904a5eda6 | ||
|
|
e37d22ad27 | ||
|
|
b5a2dc4cfb | ||
|
|
2287f1190b | ||
|
|
458993fa88 | ||
|
|
9b4c6e25ea | ||
|
|
1def3b3512 | ||
|
|
1289528770 | ||
|
|
fa499dc55f | ||
|
|
c380ac5a1f | ||
|
|
803d0dc60c | ||
|
|
a5ebf338ac | ||
|
|
edd11bac2d | ||
|
|
df8dbd9c81 | ||
|
|
3b192f5119 | ||
|
|
8418e3cb40 | ||
|
|
95ebf1fe71 | ||
|
|
5275c11d06 | ||
|
|
46eeac4514 | ||
|
|
fb75c50714 | ||
|
|
4add5f6fd1 | ||
|
|
b1559ce696 | ||
|
|
536384457a | ||
|
|
6bf59ffae9 | ||
|
|
418dc34776 | ||
|
|
98bd058317 | ||
|
|
85c510ba27 | ||
|
|
8745ec7d69 | ||
|
|
5bf69c9cbb | ||
|
|
1d599c0572 | ||
|
|
dee703a6f3 | ||
|
|
ec457e34c3 | ||
|
|
5a6a3f1edd | ||
|
|
af7bb82175 | ||
|
|
4f3b1baee4 | ||
|
|
9bd7fa7e6e | ||
|
|
3ddafa1078 | ||
|
|
20cb9625ea | ||
|
|
910927145e | ||
|
|
85fffc2e76 | ||
|
|
1a600c1178 | ||
|
|
375253ae8a | ||
|
|
c8752d6c18 | ||
|
|
cedffd3adb | ||
|
|
788bead9fe | ||
|
|
4f91d9769e | ||
|
|
1697eb526d | ||
|
|
a9602c6906 | ||
|
|
c0b696ba52 | ||
|
|
21b633e73b | ||
|
|
0d5194bfd4 | ||
|
|
f4c26f9cc8 | ||
|
|
adced97dcd | ||
|
|
adb7a49c10 | ||
|
|
f0270f934e | ||
|
|
28ca8277f8 | ||
|
|
05cb054140 | ||
|
|
03285f5fe1 | ||
|
|
ddc221ecc7 | ||
|
|
ad01f19db8 | ||
|
|
2cc53e2256 | ||
|
|
de53ed75f4 | ||
|
|
502eced994 | ||
|
|
767096631a | ||
|
|
df0f01c828 | ||
|
|
02beb8c74a | ||
|
|
aabf60c8e5 | ||
|
|
0ea6cdeb96 | ||
|
|
f4fe462b28 | ||
|
|
8951acabb7 | ||
|
|
4324e9a915 | ||
|
|
c862344929 | ||
|
|
840b926ca7 | ||
|
|
74d090845f | ||
|
|
75bd8e9a1e | ||
|
|
ef47733ea1 | ||
|
|
4c6511fd50 | ||
|
|
a4174763f8 | ||
|
|
3327b6a621 | ||
|
|
b43c467d30 | ||
|
|
1b942fed64 | ||
|
|
6055dee411 | ||
|
|
4de4375fce | ||
|
|
9b1445d5b9 | ||
|
|
9d2b1b539c | ||
|
|
1d4a0e767c | ||
|
|
bc6a7b03ab | ||
|
|
215cd5f29b | ||
|
|
de17dad958 | ||
|
|
666a55c0a0 | ||
|
|
4ad20a413a | ||
|
|
1cd6541bfd | ||
|
|
f8151127e3 | ||
|
|
288e1853b9 | ||
|
|
c01ed02147 | ||
|
|
2225339208 | ||
|
|
4f561d84b3 | ||
|
|
34eab50197 | ||
|
|
c85437e967 | ||
|
|
33545ab332 | ||
|
|
26c57f125d | ||
|
|
8a6e04b84d | ||
|
|
a5c32da4ff | ||
|
|
e754fc5aab | ||
|
|
ca3e855b9c | ||
|
|
d01fc6ab1b | ||
|
|
e7d8a2cfe6 | ||
|
|
ffe77a785a | ||
|
|
60fc821764 | ||
|
|
3313327ab4 | ||
|
|
bd4b6e9b8c | ||
|
|
6458db7765 | ||
|
|
f8ada4953d | ||
|
|
4511281f04 | ||
|
|
aad0a2a2ba | ||
|
|
f63d33c003 | ||
|
|
de1031b264 | ||
|
|
c7b6dd9a18 | ||
|
|
3ce53b56c7 | ||
|
|
8e49efd496 | ||
|
|
9027e7a9af | ||
|
|
528fdbb75c | ||
|
|
f4836d7aa1 | ||
|
|
cf73a329b3 | ||
|
|
ca3fe5d352 | ||
|
|
993ec64657 | ||
|
|
4c32c577d5 | ||
|
|
25f4baf990 | ||
|
|
7d719d998e | ||
|
|
71cb98dce4 | ||
|
|
73d7d31d60 | ||
|
|
a8889d7922 | ||
|
|
315aeeb557 | ||
|
|
97cd954c01 | ||
|
|
6b5a1ac2da | ||
|
|
946175385f | ||
|
|
55fe4967ad | ||
|
|
388531e834 | ||
|
|
b038baf676 | ||
|
|
4896fe6e05 | ||
|
|
3a623717a9 | ||
|
|
c3611c5875 | ||
|
|
1b55a56731 | ||
|
|
bceaef6f06 | ||
|
|
5363736caa | ||
|
|
69f5e5c5e5 | ||
|
|
33782a5177 | ||
|
|
3297702173 | ||
|
|
905f3673d5 | ||
|
|
9a554f7eec | ||
|
|
c8190d9c54 | ||
|
|
d8c17e4c4c | ||
|
|
c0ac01c576 | ||
|
|
6b3704ce09 | ||
|
|
45160a2129 | ||
|
|
6f356aeb97 | ||
|
|
0114ac4734 | ||
|
|
bad3a92fc3 | ||
|
|
25eff6e27c | ||
|
|
fe439b3707 | ||
|
|
4957d7bb55 | ||
|
|
9d92a26693 | ||
|
|
b58efff175 | ||
|
|
1ff5d3c53d | ||
|
|
91f8dbb583 | ||
|
|
d6845c4c7d | ||
|
|
f2c1a3ea8a | ||
|
|
5178a0ec66 | ||
|
|
78a808e444 | ||
|
|
eba1072dfa | ||
|
|
47f518d1c7 | ||
|
|
fd90f1a6ef | ||
|
|
3c611dcf30 | ||
|
|
a14b6b9e24 | ||
|
|
b021f0c518 | ||
|
|
cd4b4b8bfe | ||
|
|
070b9c2cd9 | ||
|
|
9b1841d009 | ||
|
|
16bae8830e | ||
|
|
9748fdd605 | ||
|
|
d3b2d9b074 | ||
|
|
37682c6668 | ||
|
|
e9a18a7466 | ||
|
|
57a543b683 | ||
|
|
799801c201 | ||
|
|
cf440dfec3 | ||
|
|
12bfb6d79a | ||
|
|
25ec33d863 | ||
|
|
db572a9142 | ||
|
|
c0e7e733ec | ||
|
|
c470752182 | ||
|
|
d952172559 | ||
|
|
98c197edad | ||
|
|
b813d1b31b | ||
|
|
d7c2d6863d | ||
|
|
89ea6d596c | ||
|
|
51fee6f75c | ||
|
|
e02ae68aa9 | ||
|
|
b147a22af1 | ||
|
|
270fd48536 | ||
|
|
b2762c4788 | ||
|
|
e3d1c4ba04 | ||
|
|
a7a7115581 | ||
|
|
1228897b72 | ||
|
|
8ea639f564 | ||
|
|
017b4315bc | ||
|
|
b6fe330b85 | ||
|
|
0d8ae3bd66 | ||
|
|
a751eb0326 | ||
|
|
b7882c57f8 | ||
|
|
a1f59b6241 | ||
|
|
d08d778608 | ||
|
|
410b90334a | ||
|
|
f92baedf2b | ||
|
|
8527492638 | ||
|
|
2517c1e77e | ||
|
|
9addcc050d | ||
|
|
6ae07ce0e2 | ||
|
|
6bdd83413d | ||
|
|
d25de5e92e | ||
|
|
fccd05b290 | ||
|
|
bf8c3cc07e | ||
|
|
38f7fabb10 | ||
|
|
ed918cf6be | ||
|
|
d7ba995370 | ||
|
|
f1b5b75128 | ||
|
|
5b15436935 | ||
|
|
8264b31fa1 | ||
|
|
d946a6536e | ||
|
|
d0994c4ad3 | ||
|
|
9f55408ca3 | ||
|
|
56a2cc65d0 | ||
|
|
fdaa75400b | ||
|
|
6524788516 | ||
|
|
d423aff288 | ||
|
|
59df690e3e | ||
|
|
e158c78ffa | ||
|
|
d903423ded | ||
|
|
2c4bb15bb6 | ||
|
|
344908faad | ||
|
|
a90bdd1833 | ||
|
|
05cd6878a5 | ||
|
|
6962b9e49f | ||
|
|
8eb351d722 | ||
|
|
f1faa4aa90 | ||
|
|
341abcb315 | ||
|
|
672a5d14fe | ||
|
|
54835570a0 | ||
|
|
1fa288a399 | ||
|
|
9da7bbf802 | ||
|
|
98df67c918 | ||
|
|
d4c1634571 | ||
|
|
beae8ab67f | ||
|
|
7bf815332e | ||
|
|
eaba09027e | ||
|
|
5288263528 | ||
|
|
aa28f1a3fd | ||
|
|
35330867c5 | ||
|
|
094733def5 | ||
|
|
297dd32011 | ||
|
|
a36ff70df4 | ||
|
|
cac16cb590 | ||
|
|
96188d0240 | ||
|
|
3b3d932d30 | ||
|
|
8abd7c3a76 | ||
|
|
37bd44042a | ||
|
|
ca5c93a983 | ||
|
|
5eaf95ed0f | ||
|
|
39646d2dff | ||
|
|
fa65527fee | ||
|
|
f6ad4628f4 | ||
|
|
453bbc8608 | ||
|
|
5d975da41a | ||
|
|
10b5f0d041 | ||
|
|
2a1f7f0f7a | ||
|
|
b62cb79c7e | ||
|
|
d75cc7f84d | ||
|
|
11388f3519 | ||
|
|
ab9c0898c3 | ||
|
|
69effce44e | ||
|
|
771dc7d645 | ||
|
|
453e595636 | ||
|
|
89829f8153 | ||
|
|
c1568bb735 | ||
|
|
f1bb6592bb | ||
|
|
014246bef6 | ||
|
|
7468904dd6 | ||
|
|
98c9d0e88f | ||
|
|
ee172b840c | ||
|
|
3754dc4230 | ||
|
|
4dd8ad2f16 | ||
|
|
0de253ad2c | ||
|
|
915a645761 | ||
|
|
7255a23b03 | ||
|
|
f5e1d17c13 | ||
|
|
5bb6fe2ee7 | ||
|
|
2090fb1450 | ||
|
|
d75cd032b9 | ||
|
|
52c14132b4 | ||
|
|
ee0832c182 | ||
|
|
60af3fd6fc | ||
|
|
18dbdc2e86 | ||
|
|
b2cd130cc2 | ||
|
|
fd4dc1b9c6 | ||
|
|
b18840d438 | ||
|
|
0790bf18ec | ||
|
|
720551d549 | ||
|
|
0ccf7d8383 | ||
|
|
3455431129 | ||
|
|
4f5379389d | ||
|
|
20eba3fb74 | ||
|
|
566b4cd999 | ||
|
|
7b9474e33e | ||
|
|
b5aa966d12 | ||
|
|
3f9e5dbfaa | ||
|
|
ad2cb03a68 | ||
|
|
bfec6546ce | ||
|
|
c7c1913561 | ||
|
|
45c7ca720c | ||
|
|
c80c7dd5b9 | ||
|
|
239c18eddb | ||
|
|
a063d1dfb0 | ||
|
|
de4e08e868 | ||
|
|
2d10404a2f | ||
|
|
766dcf4aeb | ||
|
|
822b1c9566 | ||
|
|
484ead14b5 | ||
|
|
80a6e5eb2a | ||
|
|
bc2e8034fe | ||
|
|
2f541fc076 | ||
|
|
c73f33d27c | ||
|
|
9bba7bbee0 | ||
|
|
5e56fb6eb6 | ||
|
|
70e1c60819 | ||
|
|
545a5d02c7 | ||
|
|
4741893563 | ||
|
|
521a951b58 | ||
|
|
f1cc01c6b8 | ||
|
|
bad9854d71 | ||
|
|
ae61033a32 | ||
|
|
5141397d6f | ||
|
|
848b047708 | ||
|
|
3d07ab5664 | ||
|
|
d7bc94d7cd | ||
|
|
edb4c4e554 | ||
|
|
73e4e55328 | ||
|
|
4b28e22d34 | ||
|
|
649bc16753 | ||
|
|
5034e223ec | ||
|
|
0b451491b0 | ||
|
|
5471bb9932 | ||
|
|
10834cdea4 | ||
|
|
9568a062f1 | ||
|
|
ff74744556 | ||
|
|
10b6309f79 | ||
|
|
72200de866 | ||
|
|
b28612bce2 | ||
|
|
e062524cb4 | ||
|
|
756b9c389a | ||
|
|
d703c58936 | ||
|
|
b1c858d8f8 | ||
|
|
71814fe266 | ||
|
|
32907d679f | ||
|
|
0ff3f48693 | ||
|
|
1cb2fc259e | ||
|
|
20da8e55a8 | ||
|
|
48c31e5885 | ||
|
|
37cd3b419c | ||
|
|
284d7c911d | ||
|
|
b2ffdacd80 | ||
|
|
19a51b5aff | ||
|
|
c1fd14fb2c | ||
|
|
f4f6aa288d | ||
|
|
fd5f9741d3 | ||
|
|
3b5f9f1e5d | ||
|
|
144e44a749 | ||
|
|
01593240ed | ||
|
|
f058fc299e | ||
|
|
24eb2f6c43 | ||
|
|
10186190f6 | ||
|
|
351ac1614c | ||
|
|
61bd2b825f | ||
|
|
f66a285b01 | ||
|
|
1bbab1fcc7 | ||
|
|
36a93d9cf3 | ||
|
|
ec797b3a81 | ||
|
|
8c6f65caca | ||
|
|
e4057b65ee | ||
|
|
3aebed206e | ||
|
|
78d731a316 | ||
|
|
ad78c21e07 | ||
|
|
ac975bf79a | ||
|
|
af13e84093 | ||
|
|
d8525815fd | ||
|
|
46172c931e | ||
|
|
ab3ecd129d | ||
|
|
df0fcbdf9b | ||
|
|
c3af8b1c8e | ||
|
|
e41ee9f951 | ||
|
|
f75e43e93a | ||
|
|
9cd739d45c | ||
|
|
c47d63ba1c | ||
|
|
5e95d6e3b5 | ||
|
|
a4aa8fbcd2 | ||
|
|
29c0e913d7 | ||
|
|
91d20fb3ec | ||
|
|
9b83cad247 | ||
|
|
4f684d16f2 | ||
|
|
8ea9fad93a | ||
|
|
c569b8a1f3 | ||
|
|
ad72dc66ce | ||
|
|
09e6261e9a | ||
|
|
0daf1f007a | ||
|
|
b7fa3f6f3c | ||
|
|
907a51b198 | ||
|
|
ed2bbbf23b | ||
|
|
af30f0769a | ||
|
|
ff8c6aa32b | ||
|
|
8c98220878 | ||
|
|
6ec4c64914 | ||
|
|
1f4e712fd8 | ||
|
|
400e6eb09a | ||
|
|
8147bd4df8 | ||
|
|
7e43decf4c | ||
|
|
df12c7bc68 | ||
|
|
9cce90e920 | ||
|
|
45085f3eea | ||
|
|
236832f669 | ||
|
|
87e8f06522 | ||
|
|
5fe30854dd | ||
|
|
eb01f3365f | ||
|
|
7c6dbe0ed8 | ||
|
|
3c52c2578f | ||
|
|
13d0292f29 | ||
|
|
e7bfc59f5a | ||
|
|
56bc3ae194 | ||
|
|
eb5a656f4e | ||
|
|
281f55a55c | ||
|
|
7a6ec46535 | ||
|
|
99fd6ed93a | ||
|
|
830bb21a32 | ||
|
|
4bde492d8c | ||
|
|
fb9181ff17 | ||
|
|
03cec07df8 | ||
|
|
82318cfd04 | ||
|
|
3b4184295e | ||
|
|
66c857b645 | ||
|
|
c03b64731b | ||
|
|
723ebd3334 | ||
|
|
8346e82cf5 | ||
|
|
34044c5989 | ||
|
|
d4c6af753f | ||
|
|
38171cc1b9 | ||
|
|
d8cfc9b1f5 | ||
|
|
21865d3ec1 | ||
|
|
5a9e957412 | ||
|
|
0fdb54d8bb | ||
|
|
026314bf83 | ||
|
|
90ccb05fb1 | ||
|
|
195ad58494 | ||
|
|
bce664dcab | ||
|
|
794a3ff257 | ||
|
|
3bbd4bbfd6 | ||
|
|
57150bb86a | ||
|
|
a3d25add27 | ||
|
|
a3314e35a7 | ||
|
|
8c276a0b5e | ||
|
|
134a2e69a0 | ||
|
|
36409f8597 | ||
|
|
4cb79dcddf | ||
|
|
306a9dd6db | ||
|
|
5a87473444 | ||
|
|
62331769ac | ||
|
|
169d9f550e | ||
|
|
5c264c7c74 | ||
|
|
edc966c4c2 | ||
|
|
1b02cf99dc | ||
|
|
b1c93f05f6 | ||
|
|
55d4756d31 | ||
|
|
65cb2e625f | ||
|
|
71af4851c7 | ||
|
|
260334e4fe | ||
|
|
976df65bcc | ||
|
|
e9e3a533ea | ||
|
|
8f4335825b | ||
|
|
48fe06fec3 | ||
|
|
922b85b386 | ||
|
|
fa77f50260 | ||
|
|
3ec2c22ad4 | ||
|
|
00f6622ac8 | ||
|
|
ae08a5b261 | ||
|
|
c35159fdde | ||
|
|
4aaf24b5d8 | ||
|
|
8552faf774 | ||
|
|
0b5852948d | ||
|
|
bf15614df6 | ||
|
|
f388d6a938 | ||
|
|
a961b880bb | ||
|
|
9f1672ca4c | ||
|
|
44113cfa14 | ||
|
|
90d5c9d0c6 | ||
|
|
7615c7073c | ||
|
|
91f7895735 | ||
|
|
8bdb22c22e | ||
|
|
1d328ba0d4 | ||
|
|
47e07244b9 | ||
|
|
9510df9c2e | ||
|
|
95a822b70d | ||
|
|
9cca510d6c | ||
|
|
40723ca8ac | ||
|
|
4923c88bd0 | ||
|
|
8dd9c54229 | ||
|
|
21686c27af | ||
|
|
9e47480bc7 | ||
|
|
0d74d508df | ||
|
|
0969a5384b | ||
|
|
93d4090169 | ||
|
|
17161a9363 | ||
|
|
cc079453da | ||
|
|
377a553295 | ||
|
|
ff119b78cd | ||
|
|
19d02d8c78 | ||
|
|
7f39dc3499 | ||
|
|
274aa49f8a | ||
|
|
5209b33c31 | ||
|
|
5052432cc7 | ||
|
|
22eae68e48 | ||
|
|
0598ac3b69 | ||
|
|
fbeabc23e0 | ||
|
|
5c5ab84420 | ||
|
|
7ec5632bcc | ||
|
|
97b37cb117 | ||
|
|
d57ad27fcc | ||
|
|
6ea2adf1f5 | ||
|
|
28af7882f5 | ||
|
|
b5474780c3 | ||
|
|
d07f3d5662 | ||
|
|
c7b66322be | ||
|
|
d71a6f6cab | ||
|
|
b55ed0c56b | ||
|
|
995ead176a | ||
|
|
b000198cc4 | ||
|
|
dc1b52aa7c | ||
|
|
9c97895116 | ||
|
|
f494bc5b8a | ||
|
|
e1930d127e | ||
|
|
2be243deda | ||
|
|
ff299eb104 | ||
|
|
a214a677f8 | ||
|
|
04a3f0da1c | ||
|
|
4f6b405edf | ||
|
|
b4b5b5ea41 | ||
|
|
ed4bd41574 | ||
|
|
898a0c11c2 | ||
|
|
f738ab8fe2 | ||
|
|
c266cef6b1 | ||
|
|
b0cf7823a7 | ||
|
|
45ccf11161 | ||
|
|
c478ad08fc | ||
|
|
db83ee7add | ||
|
|
d2e29efcd9 | ||
|
|
08883dbf6c | ||
|
|
0a5a91f5a1 | ||
|
|
8759984f52 | ||
|
|
8044188457 | ||
|
|
d10d0137b9 | ||
|
|
13878d9a2e | ||
|
|
99a294ebae | ||
|
|
befa2112f8 | ||
|
|
4a18b9cee1 | ||
|
|
58f4290310 | ||
|
|
6d9206224d | ||
|
|
2582e0342a | ||
|
|
7945f94246 | ||
|
|
5484981693 | ||
|
|
2ce8fbdcf9 | ||
|
|
8fec858b49 | ||
|
|
bc747b0935 | ||
|
|
141296c323 | ||
|
|
ed617f87df | ||
|
|
c8ef144532 | ||
|
|
95a359bdab | ||
|
|
9499cfa420 | ||
|
|
4a5e9e1861 | ||
|
|
6af69a3615 | ||
|
|
86d2eb1e4a | ||
|
|
11bd5f39d4 | ||
|
|
908f49f6e3 | ||
|
|
7f042b803a | ||
|
|
38efb23901 | ||
|
|
d3dda658a8 | ||
|
|
5c2a4b014e | ||
|
|
0c9214636f | ||
|
|
43d19c11cf | ||
|
|
8d5bfeddee | ||
|
|
6c047f7abe | ||
|
|
94c6c9d32a | ||
|
|
a2c1dc85dc | ||
|
|
ff35465a33 | ||
|
|
8d8852bc23 | ||
|
|
78e22f24c2 | ||
|
|
8c8421e7a2 | ||
|
|
f5105510f3 | ||
|
|
f930e707e8 | ||
|
|
3cec676d98 | ||
|
|
8303f03b24 | ||
|
|
4adb68c802 | ||
|
|
1efe363137 | ||
|
|
f17fe26c64 | ||
|
|
9bc5d7f000 | ||
|
|
8ecf508fda | ||
|
|
0b39044666 | ||
|
|
9c8e44659f | ||
|
|
87b79bd221 | ||
|
|
3de3b2dccc | ||
|
|
0c234e7997 | ||
|
|
f0c2b89fc5 | ||
|
|
dceb3cbe88 | ||
|
|
b6886cdbb2 | ||
|
|
0448b31f93 | ||
|
|
5400e570c7 | ||
|
|
7cd4641ece | ||
|
|
38f6cddc2c | ||
|
|
b6292f4537 | ||
|
|
c6c5cdaf89 | ||
|
|
927942a0f8 | ||
|
|
49e7358bf6 | ||
|
|
56001f3d82 | ||
|
|
bcbd50af39 | ||
|
|
760ccdf2ef | ||
|
|
367c107c11 | ||
|
|
6f6f56c795 | ||
|
|
4584cf2440 | ||
|
|
c49bd6e4eb | ||
|
|
f17b307305 | ||
|
|
7a7ee85f69 | ||
|
|
7f8183f64c | ||
|
|
800ca9b8ed | ||
|
|
fe207a09c1 | ||
|
|
77227e6c55 | ||
|
|
a68e173f3a | ||
|
|
a414997ea5 | ||
|
|
02f131c7fe | ||
|
|
384d2921fd | ||
|
|
6595562442 | ||
|
|
c8001915f6 | ||
|
|
fcc8426226 | ||
|
|
268b79d03f | ||
|
|
f81ff952a2 | ||
|
|
ced418ccb5 |
191
AUTHORS.txt
191
AUTHORS.txt
@@ -1,6 +1,6 @@
|
|||||||
OpenSceneGraph Library 2.6.0
|
OpenSceneGraph Library 2.8.2
|
||||||
|
|
||||||
324 Contributors:
|
373 Contributors:
|
||||||
|
|
||||||
Firstname Surname
|
Firstname Surname
|
||||||
-----------------
|
-----------------
|
||||||
@@ -9,89 +9,99 @@ Don Burns
|
|||||||
Marco Jez
|
Marco Jez
|
||||||
Paul Martz
|
Paul Martz
|
||||||
Mike Weiblen
|
Mike Weiblen
|
||||||
|
Mathias Fr<46>hlich
|
||||||
Eric Wing
|
Eric Wing
|
||||||
Brede Johansen
|
|
||||||
Stephan Huber
|
Stephan Huber
|
||||||
|
Brede Johansen
|
||||||
Geoff Michel
|
Geoff Michel
|
||||||
Farshid Lashkari
|
Farshid Lashkari
|
||||||
Bob Kuehne
|
Bob Kuehne
|
||||||
Mathias Fr<46>hlich
|
|
||||||
Eric Sokolowsky
|
|
||||||
Ulrich Hertlein
|
Ulrich Hertlein
|
||||||
|
Eric Sokolowsky
|
||||||
|
Jean-Sebastien Guay
|
||||||
Martin Lavery
|
Martin Lavery
|
||||||
David Callu
|
David Callu
|
||||||
Tree
|
Tree
|
||||||
Jean-Sebastien Guay
|
|
||||||
Luigi Calori
|
Luigi Calori
|
||||||
Trajce Nikolov
|
Trajce Nikolov
|
||||||
Mike Wittman
|
Mike Wittman
|
||||||
Pavel Moloshtan
|
Wojciech Lewandowski
|
||||||
|
Paul Melis
|
||||||
Colin McDonald
|
Colin McDonald
|
||||||
Tom Jolley
|
|
||||||
Andy Skinner
|
Andy Skinner
|
||||||
Roger James
|
Roger James
|
||||||
Norman Vine
|
Pavel Moloshtan
|
||||||
|
Mattias Helsing
|
||||||
|
Tom Jolley
|
||||||
Jeremy Moles
|
Jeremy Moles
|
||||||
|
Jason Beverage
|
||||||
|
Norman Vine
|
||||||
|
Cedric Pinson
|
||||||
|
Art Tevs
|
||||||
Alberto Farre
|
Alberto Farre
|
||||||
|
Roland Smeenk
|
||||||
|
Michael Platings
|
||||||
Andr<EFBFBD> Garneau
|
Andr<EFBFBD> Garneau
|
||||||
Wojciech Lewandowski
|
|
||||||
Ruben Lopez
|
Ruben Lopez
|
||||||
Randall Hopper
|
Randall Hopper
|
||||||
Art Tevs
|
Jason Daly
|
||||||
|
J.P. Delport
|
||||||
|
Adrian Egli
|
||||||
Olaf Flebbe
|
Olaf Flebbe
|
||||||
|
Mathieu Marache
|
||||||
Gideon May
|
Gideon May
|
||||||
Don Tidrow
|
Don Tidrow
|
||||||
|
Sherman Wilcox
|
||||||
Romano Jos<6F> Magacho da Silva
|
Romano Jos<6F> Magacho da Silva
|
||||||
Philip Lowman
|
Per Fahlberg
|
||||||
Paul Melis
|
|
||||||
Michael Platings
|
|
||||||
Michael Gronager
|
Michael Gronager
|
||||||
|
Joakim Simonsson
|
||||||
|
David Spilling
|
||||||
Daniel Sj<53>lie
|
Daniel Sj<53>lie
|
||||||
Chris Hanson
|
Chris Hanson
|
||||||
Adrian Egli
|
Alberto Luaces
|
||||||
Sherman Wilcox
|
Philip Lowman
|
||||||
Per Fahlberg
|
Chris Denham
|
||||||
J.P. Delport
|
|
||||||
David Spilling
|
|
||||||
Melchior Franz
|
Melchior Franz
|
||||||
Joran Jessurun
|
Lionel Lagarde
|
||||||
Joakim Simonsson
|
|
||||||
Jason Beverage
|
|
||||||
Jason Daly
|
|
||||||
Frederic Marmond
|
|
||||||
David Fries
|
David Fries
|
||||||
|
Bryan Thrall
|
||||||
|
Terry Welsh
|
||||||
|
Serge Lages
|
||||||
|
Joran Jessurun
|
||||||
|
Frederic Marmond
|
||||||
Boris Bralo
|
Boris Bralo
|
||||||
Yefei He
|
Yefei He
|
||||||
Terry Welsh
|
Tim Moore
|
||||||
|
Stephane Lamoliatte
|
||||||
Sondra Iverson
|
Sondra Iverson
|
||||||
Serge Lages
|
|
||||||
Rune Schmidt Jensen
|
Rune Schmidt Jensen
|
||||||
Rainer Oder
|
Rainer Oder
|
||||||
|
Neil Groves
|
||||||
Mike Connell
|
Mike Connell
|
||||||
Mathieu Marache
|
Martin Aumueller
|
||||||
Glenn Waldron
|
Mario Valle
|
||||||
|
Gordon Tomlinson
|
||||||
|
Gino van den Bergen
|
||||||
Carlo Camporesi
|
Carlo Camporesi
|
||||||
Ben Discoe
|
Ben Discoe
|
||||||
Andreas Ekstrand
|
Andreas Ekstrand
|
||||||
Stephane Lamoliatte
|
Thibault Genessay
|
||||||
|
Sukender
|
||||||
Sasa Bistrovic
|
Sasa Bistrovic
|
||||||
Martin Naylor
|
Martin Naylor
|
||||||
Martin Aumueller
|
|
||||||
Markus Trenkwalder
|
Markus Trenkwalder
|
||||||
Mario Valle
|
|
||||||
Loic Dachary
|
Loic Dachary
|
||||||
Joseph Steel
|
Joseph Steel
|
||||||
John Shue
|
John Shue
|
||||||
Jan Peciva
|
Jan Peciva
|
||||||
Jan Ciger
|
Jan Ciger
|
||||||
Gordon Tomlinson
|
Glenn Waldron
|
||||||
Gino van den Bergen
|
|
||||||
Bryan Thrall
|
|
||||||
Brad Colbert
|
Brad Colbert
|
||||||
Vivek Rajan
|
Vivek Rajan
|
||||||
Thibault Genessay
|
|
||||||
Sean Spicer
|
Sean Spicer
|
||||||
Ravi Mathur
|
Ravi Mathur
|
||||||
|
Peter Hrenka
|
||||||
Nikolaus Hanekamp
|
Nikolaus Hanekamp
|
||||||
Neil Salter
|
Neil Salter
|
||||||
Mihai Radu
|
Mihai Radu
|
||||||
@@ -100,41 +110,48 @@ Luc Frauciel
|
|||||||
Laurens Voerman
|
Laurens Voerman
|
||||||
David Guthrie
|
David Guthrie
|
||||||
Corbin Holtz
|
Corbin Holtz
|
||||||
Cedric Pinson
|
|
||||||
Brad Christiansen
|
Brad Christiansen
|
||||||
|
Blasius Czink
|
||||||
Toshiyuki Takahei
|
Toshiyuki Takahei
|
||||||
Thom DeCarlo
|
Thom DeCarlo
|
||||||
|
Tatsuhiro Nishioka
|
||||||
Simon Julier
|
Simon Julier
|
||||||
Sebastien Grignard
|
Sebastien Grignard
|
||||||
Romano Magacho
|
Romano Magacho
|
||||||
Roland Smeenk
|
Richard Schmidt
|
||||||
|
Riccardo Corsi
|
||||||
|
Ralf Habacker
|
||||||
Paul de Repentigny
|
Paul de Repentigny
|
||||||
|
Liang Aibin
|
||||||
Leandro Motta Barros
|
Leandro Motta Barros
|
||||||
|
John Vidar Larring
|
||||||
John Kelso
|
John Kelso
|
||||||
Daniel Larimer
|
Daniel Larimer
|
||||||
|
Csaba Halasz
|
||||||
Colin Dunlop
|
Colin Dunlop
|
||||||
Bruce Clay
|
Bruce Clay
|
||||||
Alberto Luaces
|
|
||||||
Alberto Barbati
|
Alberto Barbati
|
||||||
Vladimir Shabanov
|
Vladimir Shabanov
|
||||||
Uwe Woessner
|
Uwe Woessner
|
||||||
Tony Horrobin
|
Tony Horrobin
|
||||||
Tim Moore
|
|
||||||
Sohey Yamamoto
|
Sohey Yamamoto
|
||||||
Richard Schmidt
|
Rudolf Wiedemann
|
||||||
Rafa Gaitan
|
Rafa Gaitan
|
||||||
Phil Atkin
|
Phil Atkin
|
||||||
Peter Hrenka
|
Miguel Escriva
|
||||||
Neil Groves
|
|
||||||
Mattias Linde
|
Mattias Linde
|
||||||
Mattias Helsing
|
|
||||||
Maria Ten
|
Maria Ten
|
||||||
Ken Sewell
|
Ken Sewell
|
||||||
Julian Ortiz
|
Julian Ortiz
|
||||||
Jeremy Bell
|
Jeremy Bell
|
||||||
|
Jaromir Vitek
|
||||||
James French
|
James French
|
||||||
|
Gary Quinn
|
||||||
Garrett Potts
|
Garrett Potts
|
||||||
Gabor Dorka
|
Gabor Dorka
|
||||||
|
Fabio Mierlo
|
||||||
|
Fabien Lavignotte
|
||||||
|
Doug McCorkle
|
||||||
Donn Mielcarek
|
Donn Mielcarek
|
||||||
Donald Cipperly
|
Donald Cipperly
|
||||||
Domenico Mangieri
|
Domenico Mangieri
|
||||||
@@ -142,54 +159,69 @@ Charles Cole
|
|||||||
Blake Williams
|
Blake Williams
|
||||||
Antoine Hue
|
Antoine Hue
|
||||||
Andrew Bettison
|
Andrew Bettison
|
||||||
|
Andreas Goebel
|
||||||
Anders Backman
|
Anders Backman
|
||||||
Ali Botorabi
|
Ali Botorabi
|
||||||
Zach Deedler
|
Zach Deedler
|
||||||
Yuzhong Shen
|
Yuzhong Shen
|
||||||
|
Wang Rui
|
||||||
Tugkan Calapoglu
|
Tugkan Calapoglu
|
||||||
Tim Daoust
|
Tim Daoust
|
||||||
Terrex
|
Terrex
|
||||||
|
Tanguy Fautr<74>
|
||||||
Sylvain Marie
|
Sylvain Marie
|
||||||
Steve Lunsford
|
Steve Lunsford
|
||||||
Stephane Simon
|
Stephane Simon
|
||||||
Stephan Eilemann
|
Stephan Eilemann
|
||||||
Stanislav Blinov
|
Stanislav Blinov
|
||||||
|
Sergey Leontyev
|
||||||
Sebastian Messerschmidt
|
Sebastian Messerschmidt
|
||||||
Rudolf Wiedemann
|
Rene Molenaar
|
||||||
Riccardo Corsi
|
|
||||||
Ralf Kern
|
Ralf Kern
|
||||||
|
Pierre Haritchabalet
|
||||||
Perry Miller
|
Perry Miller
|
||||||
|
Paul Obermeier
|
||||||
|
Neil Hughes
|
||||||
Nathan Monteleone
|
Nathan Monteleone
|
||||||
Miguel Escriva
|
Morn<EFBFBD> Pistorius
|
||||||
Michael Henheffer
|
Michael Henheffer
|
||||||
|
Michael Guerrero
|
||||||
Maya Leonard
|
Maya Leonard
|
||||||
Max Behensky
|
Max Bandazian
|
||||||
Mathew May
|
Mathew May
|
||||||
|
Martin Spott
|
||||||
Martijn Kragtwijk
|
Martijn Kragtwijk
|
||||||
Liang Aibin
|
Konstantin Sinitsyn
|
||||||
Kevin Moiule
|
Kevin Moiule
|
||||||
Keith Steffen
|
Keith Steffen
|
||||||
|
Katharina Plugge
|
||||||
Joseph Winston
|
Joseph Winston
|
||||||
John Aughey
|
John Aughey
|
||||||
Johan Nouvel
|
Johan Nouvel
|
||||||
|
Jim Vaughan
|
||||||
|
James Moliere
|
||||||
Igor Kravtchenko
|
Igor Kravtchenko
|
||||||
|
He Sicong
|
||||||
Gustavo Wagner
|
Gustavo Wagner
|
||||||
|
Guillaume Chouvenc
|
||||||
Gerrick Bivins
|
Gerrick Bivins
|
||||||
George Tarantilis
|
George Tarantilis
|
||||||
Fabio Mierlo
|
Frederic Bouvier
|
||||||
|
Ferdi Smit
|
||||||
|
Ewe Woessner
|
||||||
|
Erik den Dekker
|
||||||
|
Emmanuel Roche
|
||||||
Edgar Ellis
|
Edgar Ellis
|
||||||
Doug McCorkle
|
Don Leich
|
||||||
David Ergo
|
David Ergo
|
||||||
Daniel Trstenjak
|
Daniel Trstenjak
|
||||||
Csaba Halasz
|
Christophe Loustaunau
|
||||||
Brad Anderegg
|
Brad Anderegg
|
||||||
Andrew Sampson
|
Andrew Sampson
|
||||||
Andrew Lorino
|
Andrew Lorino
|
||||||
Andreas Goebel
|
|
||||||
Zbigniew Sroczynski
|
Zbigniew Sroczynski
|
||||||
Yuri Vilmanis
|
Yuri Vilmanis
|
||||||
Warren Macchi
|
Warren Macchi
|
||||||
Wang Rui
|
|
||||||
Wang Lam
|
Wang Lam
|
||||||
Walter J. Altice
|
Walter J. Altice
|
||||||
Volker Walkiewicz
|
Volker Walkiewicz
|
||||||
@@ -203,37 +235,44 @@ Tyge
|
|||||||
Troy Yee
|
Troy Yee
|
||||||
Tomas Hnilica
|
Tomas Hnilica
|
||||||
Tino Schwarze
|
Tino Schwarze
|
||||||
|
Thomas Weidner
|
||||||
Thom Carlo
|
Thom Carlo
|
||||||
Tery Welsh
|
|
||||||
Tatsuhiro Nishioka
|
|
||||||
Tanguy Fautr<74>
|
|
||||||
Steven Thomas
|
Steven Thomas
|
||||||
|
Simon Hammett
|
||||||
Sid Byce
|
Sid Byce
|
||||||
Shuxing Xiao
|
Shuxing Xiao
|
||||||
Shane Arnott
|
Shane Arnott
|
||||||
Sebastien Kuntz
|
Sebastien Kuntz
|
||||||
Ruth Lang
|
Ruth Lang
|
||||||
|
Ruben Smelik
|
||||||
|
Ross Anderson
|
||||||
Ronny Krueger
|
Ronny Krueger
|
||||||
Robert Swain
|
Robert Swain
|
||||||
|
Rob Bloemkool
|
||||||
Rick Pingry
|
Rick Pingry
|
||||||
Rene Molenaar
|
Rick Appleton
|
||||||
|
Ricard Schmidt
|
||||||
Reinhard Sainitzer
|
Reinhard Sainitzer
|
||||||
Rein Kadijk
|
Rein Kadijk
|
||||||
Raymond de Vries
|
Raymond de Vries
|
||||||
|
Ragnar Hammarqvist
|
||||||
Qing Shen
|
Qing Shen
|
||||||
|
Piotr Rak
|
||||||
Philipp Siemoleit
|
Philipp Siemoleit
|
||||||
Philipp M<>chler
|
Philipp M<>chler
|
||||||
Paul Obermeier
|
Petr Salinger
|
||||||
|
Paul Palumbo
|
||||||
Paul Fredrikson
|
Paul Fredrikson
|
||||||
|
Paul Fotheringham
|
||||||
|
Patrick Hartling
|
||||||
Parag Chaudhur
|
Parag Chaudhur
|
||||||
Panagiotis Papadakos
|
Panagiotis Papadakos
|
||||||
|
Panagiotis Koutsourakis
|
||||||
Orhun Birsoy
|
Orhun Birsoy
|
||||||
Ole-Morten Duesund
|
Ole-Morten Duesund
|
||||||
Nicolas Brodu
|
Nicolas Brodu
|
||||||
Neil Hughes
|
|
||||||
Nathan Cournia
|
Nathan Cournia
|
||||||
Morten Haukness
|
Morten Haukness
|
||||||
Morn<EFBFBD> Pistorius
|
|
||||||
Mirko Viviani
|
Mirko Viviani
|
||||||
Mikkel Gjøl
|
Mikkel Gjøl
|
||||||
Mike Garrity
|
Mike Garrity
|
||||||
@@ -241,53 +280,59 @@ Michael Polak
|
|||||||
Michael Morrison
|
Michael Morrison
|
||||||
Michael Logan
|
Michael Logan
|
||||||
Max Rhiener
|
Max Rhiener
|
||||||
|
Max Behensky
|
||||||
Mauricio Hofmam
|
Mauricio Hofmam
|
||||||
Matthew May
|
Matthew May
|
||||||
Matt Green
|
Matt Green
|
||||||
Matt Burke
|
Matt Burke
|
||||||
Mathia Walker
|
Mathia Walker
|
||||||
Mason Menninger
|
Mason Menninger
|
||||||
Martin Spott
|
Martins Innus
|
||||||
Martin Amueller
|
|
||||||
Mario Guimaraes
|
Mario Guimaraes
|
||||||
Marin Lavery
|
Marin Lavery
|
||||||
Marco Lehmann
|
Marco Lehmann
|
||||||
|
Marcin Prus
|
||||||
|
Maciej Krol
|
||||||
|
Lukas Diduch
|
||||||
Louis Hamilton
|
Louis Hamilton
|
||||||
Lilin Xiong
|
Lilin Xiong
|
||||||
Lewis Harmon
|
Lewis Harmon
|
||||||
Lars Nilson
|
Lars Nilson
|
||||||
|
Kyle Centers
|
||||||
Kristopher Bixler
|
Kristopher Bixler
|
||||||
Karsten Weiss
|
Karsten Weiss
|
||||||
Karl Heijdenberg
|
Karl Heijdenberg
|
||||||
|
Jutta Sauer
|
||||||
|
Julian Scheid
|
||||||
Josh Portway
|
Josh Portway
|
||||||
John Vidar Larring
|
|
||||||
John Tan
|
John Tan
|
||||||
John Grant
|
John Grant
|
||||||
John Donovan
|
John Donovan
|
||||||
John Davis
|
John Davis
|
||||||
|
John Argentieri
|
||||||
Joan Abadie
|
Joan Abadie
|
||||||
|
Jeroen den Dekker
|
||||||
Jean-Christophe Lombardo
|
Jean-Christophe Lombardo
|
||||||
Jay Zuckerman
|
Jay Zuckerman
|
||||||
Jason Howlett
|
Jason Howlett
|
||||||
Jason Ballenger
|
Jason Ballenger
|
||||||
J.E. Hoffmann
|
J.E. Hoffmann
|
||||||
|
Humar Carmona
|
||||||
Henrique Bucher
|
Henrique Bucher
|
||||||
He Sicong
|
|
||||||
Hautio Jari
|
Hautio Jari
|
||||||
Guillaume Millet
|
Guillaume Millet
|
||||||
Graeme Harkness
|
Graeme Harkness
|
||||||
|
Glen Waldron
|
||||||
Gian Lorenzetto
|
Gian Lorenzetto
|
||||||
George Papagiannakis
|
George Papagiannakis
|
||||||
Gary Quinn
|
|
||||||
Galen Faidley
|
Galen Faidley
|
||||||
Frederic Bouvier
|
|
||||||
Frashid Lashkari
|
|
||||||
Frank Warmerdam
|
Frank Warmerdam
|
||||||
|
Frank Midgley
|
||||||
Frank Lindeman
|
Frank Lindeman
|
||||||
Frank Lichtenheld
|
Frank Lichtenheld
|
||||||
Ferdinand Cornelissen
|
Ferdinand Cornelissen
|
||||||
|
Fajran Iman
|
||||||
Fabien Dachicourt
|
Fabien Dachicourt
|
||||||
Emmanuel Roche
|
|
||||||
Edmond Gheury
|
Edmond Gheury
|
||||||
Ed Ralston
|
Ed Ralston
|
||||||
Duvan Cope
|
Duvan Cope
|
||||||
@@ -297,14 +342,15 @@ Douglas A. Pouk
|
|||||||
Dean Iverson
|
Dean Iverson
|
||||||
David Jung
|
David Jung
|
||||||
David Gurhrie
|
David Gurhrie
|
||||||
|
Danny Valente
|
||||||
Daniel Stien
|
Daniel Stien
|
||||||
Daniel Olivier
|
|
||||||
Dan Minor
|
Dan Minor
|
||||||
Cyril Brulebois
|
Cyril Brulebois
|
||||||
|
Cory Riddell
|
||||||
Clay Fowler
|
Clay Fowler
|
||||||
Chuck Sembroski
|
Chuck Sembroski
|
||||||
Chuck Seberion
|
Chuck Seberion
|
||||||
Christophe Loustaunau
|
Christopher Blaesius
|
||||||
Christian Kaser
|
Christian Kaser
|
||||||
Chris McGlone
|
Chris McGlone
|
||||||
Carlos Garcea
|
Carlos Garcea
|
||||||
@@ -312,11 +358,13 @@ Bruno Herbelin
|
|||||||
Brian Keener
|
Brian Keener
|
||||||
Brandon Hamm
|
Brandon Hamm
|
||||||
Bora Utka
|
Bora Utka
|
||||||
Blasius Czink
|
Bj<EFBFBD>rn Hein
|
||||||
|
Bill Prendergast
|
||||||
Benoit Laniel
|
Benoit Laniel
|
||||||
Ben van Basten
|
Ben van Basten
|
||||||
Bart Gallet
|
Bart Gallet
|
||||||
Axel Volley
|
Axel Volley
|
||||||
|
Andy Preece
|
||||||
Andrew Reyonolds
|
Andrew Reyonolds
|
||||||
Andreas Jochens
|
Andreas Jochens
|
||||||
Andre Normann
|
Andre Normann
|
||||||
@@ -327,4 +375,5 @@ Alberto Jaspe
|
|||||||
Alan Purvis
|
Alan Purvis
|
||||||
Alan Ott
|
Alan Ott
|
||||||
Alan Harris
|
Alan Harris
|
||||||
|
Alan Dickinson
|
||||||
Adam Richard
|
Adam Richard
|
||||||
|
|||||||
400
CMakeLists.txt
400
CMakeLists.txt
@@ -1,11 +1,10 @@
|
|||||||
|
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
|
||||||
ELSE(WIN32)
|
ELSE(WIN32)
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
|
||||||
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7)
|
|
||||||
MESSAGE("Warning: A critical CMake bug exists in 2.4.6 and below. Trying to build Universal Binaries will result in a compile error that seems unrelated. Either avoid building Universal Binaries by changing the CMAKE_OSX_ARCHITECTURES field to list only your architecture, or upgrade to the current CVS version of CMake or a newer stable version if it exists.")
|
|
||||||
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7)
|
|
||||||
ELSE(APPLE)
|
ELSE(APPLE)
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0 FATAL_ERROR)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0 FATAL_ERROR)
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
@@ -19,14 +18,20 @@ if(COMMAND cmake_policy)
|
|||||||
# Works around warnings about escaped quotes in ADD_DEFINITIONS
|
# Works around warnings about escaped quotes in ADD_DEFINITIONS
|
||||||
# statements.
|
# statements.
|
||||||
cmake_policy(SET CMP0005 NEW)
|
cmake_policy(SET CMP0005 NEW)
|
||||||
|
|
||||||
|
# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
|
||||||
|
# quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below."
|
||||||
|
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0)
|
||||||
|
cmake_policy(SET CMP0008 OLD)
|
||||||
|
endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0)
|
||||||
endif(COMMAND cmake_policy)
|
endif(COMMAND cmake_policy)
|
||||||
|
|
||||||
PROJECT(OpenSceneGraph)
|
PROJECT(OpenSceneGraph)
|
||||||
|
|
||||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 2)
|
SET(OPENSCENEGRAPH_MAJOR_VERSION 2)
|
||||||
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
|
SET(OPENSCENEGRAPH_MINOR_VERSION 8)
|
||||||
SET(OPENSCENEGRAPH_PATCH_VERSION 1)
|
SET(OPENSCENEGRAPH_PATCH_VERSION 3)
|
||||||
SET(OPENSCENEGRAPH_SOVERSION 48)
|
SET(OPENSCENEGRAPH_SOVERSION 65)
|
||||||
|
|
||||||
# set to 0 when not a release candidate, non zero means that any generated
|
# set to 0 when not a release candidate, non zero means that any generated
|
||||||
# svn tags will be treated as release candidates of given number
|
# svn tags will be treated as release candidates of given number
|
||||||
@@ -57,16 +62,6 @@ SET(OpenThreads_SOURCE_DIR ${OpenSceneGraph_SOURCE_DIR})
|
|||||||
# Maybe this can be used override existing behavior if needed?
|
# Maybe this can be used override existing behavior if needed?
|
||||||
SET(CMAKE_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
|
SET(CMAKE_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
|
||||||
|
|
||||||
# Mainly for Windows as a convenience. This will find a directory in parallel with the
|
|
||||||
# OSG source that contains 3rd party headers and libraries.
|
|
||||||
# Use of relative paths in CMake is ill-advised, but don't know of any alternatives in this case
|
|
||||||
#SET(CMAKE_INCLUDE_PATH "${OpenSceneGraph_SOURCE_DIR}/../3rdParty/include;${CMAKE_INCLUDE_PATH}")
|
|
||||||
#SET(CMAKE_LIBRARY_PATH "${OpenSceneGraph_SOURCE_DIR}/../3rdParty/lib;${CMAKE_LIBRARY_PATH}")
|
|
||||||
IF(USING_OSG_OP_OT_TRIPLE_SET)
|
|
||||||
SET(CMAKE_INCLUDE_PATH "${OpenSceneGraph_SOURCE_DIR}/../../3rdParty/include;${CMAKE_INCLUDE_PATH}")
|
|
||||||
SET(CMAKE_LIBRARY_PATH "${OpenSceneGraph_SOURCE_DIR}/../../3rdParty/lib;${CMAKE_LIBRARY_PATH}")
|
|
||||||
ENDIF(USING_OSG_OP_OT_TRIPLE_SET)
|
|
||||||
|
|
||||||
|
|
||||||
# Okay, here's the problem: On some platforms, linking against OpenThreads
|
# Okay, here's the problem: On some platforms, linking against OpenThreads
|
||||||
# is not enough and explicit linking to the underlying thread library
|
# is not enough and explicit linking to the underlying thread library
|
||||||
@@ -88,8 +83,9 @@ ENDIF(CMAKE_SYSTEM MATCHES IRIX)
|
|||||||
OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making svn branches, tags, updating ChangeLog." OFF)
|
OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making svn branches, tags, updating ChangeLog." OFF)
|
||||||
IF (OSG_MAINTAINER)
|
IF (OSG_MAINTAINER)
|
||||||
|
|
||||||
SET(OPENSCENEGRAPH_SVN "trunk")
|
#SET(OPENSCENEGRAPH_SVN "trunk")
|
||||||
#SET(OPENSCENEGRAPH_SVN "branches")
|
SET(OPENSCENEGRAPH_SVN "branches")
|
||||||
|
|
||||||
SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION})
|
SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION})
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -98,12 +94,12 @@ IF (OSG_MAINTAINER)
|
|||||||
SET(SVNCOMMAND svn)
|
SET(SVNCOMMAND svn)
|
||||||
SET(SVNTRUNKDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk)
|
SET(SVNTRUNKDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk)
|
||||||
SET(SVNTAGDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags)
|
SET(SVNTAGDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags)
|
||||||
SET(SVNBRANCHDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branch)
|
SET(SVNBRANCHDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches)
|
||||||
|
|
||||||
IF (OPENSCENEGRAPH_SVN STREQUAL "trunk")
|
IF (OPENSCENEGRAPH_SVN STREQUAL "trunk")
|
||||||
SET(SVNSOURCEDIR ${SVNTRUNKDIR})
|
SET(SVNSOURCEDIR ${SVNTRUNKDIR})
|
||||||
ELSE (OPENSCENEGRAPH_SVN STREQUAL "trunk")
|
ELSE (OPENSCENEGRAPH_SVN STREQUAL "trunk")
|
||||||
SET(SVNSOURCEDIR ${SVNBRANCH_DIR}/${OPENSCENEGRAPH_BRANCH})
|
SET(SVNSOURCEDIR ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH})
|
||||||
ENDIF(OPENSCENEGRAPH_SVN STREQUAL "trunk")
|
ENDIF(OPENSCENEGRAPH_SVN STREQUAL "trunk")
|
||||||
|
|
||||||
|
|
||||||
@@ -133,11 +129,11 @@ IF (OSG_MAINTAINER)
|
|||||||
#
|
#
|
||||||
# Provide target for generating ChangeLog
|
# Provide target for generating ChangeLog
|
||||||
#
|
#
|
||||||
SET(SVN2LOG ~/bin/svn2log.py)
|
SET(GENERATELOGS svn2cl)
|
||||||
SET(GENERATELOGS svn log -v --xml | python ${SVN2LOG} -L -H)
|
|
||||||
|
|
||||||
ADD_CUSTOM_TARGET(ChangeLog
|
ADD_CUSTOM_TARGET(ChangeLog
|
||||||
COMMAND ${GENERATELOGS}
|
COMMAND ${SVNCOMMAND} update
|
||||||
|
COMMAND ${GENERATELOGS} ${SVNSOURCEDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
ENDIF(OSG_MAINTAINER)
|
ENDIF(OSG_MAINTAINER)
|
||||||
@@ -184,6 +180,11 @@ IF(WIN32)
|
|||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
ENDIF(WIN32_USE_MP)
|
ENDIF(WIN32_USE_MP)
|
||||||
|
|
||||||
|
# turn off various warnings
|
||||||
|
# foreach(warning 4244 4251 4267 4275 4290 4786 4305 4996)
|
||||||
|
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd${warning}")
|
||||||
|
# endforeach(warning)
|
||||||
|
|
||||||
# More MSVC specific compilation flags
|
# More MSVC specific compilation flags
|
||||||
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
|
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
|
||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
|
||||||
@@ -196,7 +197,7 @@ IF(WIN32)
|
|||||||
ADD_DEFINITIONS(-DNOMINMAX)
|
ADD_DEFINITIONS(-DNOMINMAX)
|
||||||
ENDIF(UNIX)
|
ENDIF(UNIX)
|
||||||
########################################################################################################
|
########################################################################################################
|
||||||
# the foolowing options are MSVC specific,
|
# the following options are MSVC specific,
|
||||||
# the first OSG_MSVC_VERSIONED_DLL activate a custom build-time layout that should allow to run examples and application
|
# the first OSG_MSVC_VERSIONED_DLL activate a custom build-time layout that should allow to run examples and application
|
||||||
# fron bin folder without requiring installation step.
|
# fron bin folder without requiring installation step.
|
||||||
# it also prepend "osg${OPENSCENEGRAPH_SOVERSION}-" to only .dll files, leaving .lib files untouched in lib
|
# it also prepend "osg${OPENSCENEGRAPH_SOVERSION}-" to only .dll files, leaving .lib files untouched in lib
|
||||||
@@ -256,6 +257,15 @@ MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGSPHERE)
|
|||||||
OPTION(OSG_USE_FLOAT_BOUNDINGBOX "Set to ON to build OpenSceneGraph with float BoundingBox instead of double." ON)
|
OPTION(OSG_USE_FLOAT_BOUNDINGBOX "Set to ON to build OpenSceneGraph with float BoundingBox instead of double." ON)
|
||||||
MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGBOX)
|
MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGBOX)
|
||||||
|
|
||||||
|
OPTION(OSG_USE_UTF8_FILENAME "Set to ON to use a UTF8 locale for filenames instead of the default locale." OFF)
|
||||||
|
MARK_AS_ADVANCED(OSG_USE_UTF8_FILENAME)
|
||||||
|
|
||||||
|
OPTION(OSG_DISABLE_MSVC_WARNINGS "Set to OFF to not disable MSVC warnings generated by OSG headers." ON)
|
||||||
|
MARK_AS_ADVANCED(OSG_DISABLE_MSVC_WARNINGS)
|
||||||
|
|
||||||
|
OPTION(OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION "Set to ON to use the ref_ptr<> T* operator() output conversion. " ON)
|
||||||
|
|
||||||
|
OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG components that use C++ exceptions." ON)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Set Config file
|
# Set Config file
|
||||||
@@ -266,6 +276,15 @@ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Config.in"
|
|||||||
# INSTALL_FILES(/include/osg/ FILES "${OPENSCENEGRAPH_CONFIG_HEADER}")
|
# INSTALL_FILES(/include/osg/ FILES "${OPENSCENEGRAPH_CONFIG_HEADER}")
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Optional build components
|
||||||
|
|
||||||
|
# OSG Applications
|
||||||
|
OPTION(BUILD_OSG_APPLICATIONS "Enable to build OSG Applications (e.g. osgviewer)" ON)
|
||||||
|
|
||||||
|
# OSG Examples
|
||||||
|
OPTION(BUILD_OSG_EXAMPLES "Enable to build OSG Examples" OFF)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# 3rd Party Dependency Stuff
|
# 3rd Party Dependency Stuff
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
@@ -274,42 +293,23 @@ ENDIF(WIN32)
|
|||||||
|
|
||||||
# Common to all platforms:
|
# Common to all platforms:
|
||||||
FIND_PACKAGE(FreeType)
|
FIND_PACKAGE(FreeType)
|
||||||
FIND_PACKAGE(FLTK)
|
|
||||||
FIND_PACKAGE(GLUT)
|
|
||||||
FIND_PACKAGE(SDL)
|
|
||||||
FIND_PACKAGE(FOX)
|
|
||||||
FIND_PACKAGE(Inventor)
|
FIND_PACKAGE(Inventor)
|
||||||
FIND_PACKAGE(Jasper)
|
FIND_PACKAGE(Jasper)
|
||||||
|
FIND_PACKAGE(OpenEXR)
|
||||||
FIND_PACKAGE(COLLADA)
|
FIND_PACKAGE(COLLADA)
|
||||||
|
FIND_PACKAGE(FBX)
|
||||||
|
FIND_PACKAGE(ZLIB)
|
||||||
FIND_PACKAGE(Xine)
|
FIND_PACKAGE(Xine)
|
||||||
FIND_PACKAGE(OpenVRML)
|
FIND_PACKAGE(OpenVRML)
|
||||||
FIND_PACKAGE(Performer)
|
FIND_PACKAGE(Performer)
|
||||||
FIND_PACKAGE(ZLIB)
|
|
||||||
FIND_PACKAGE(GDAL)
|
FIND_PACKAGE(GDAL)
|
||||||
FIND_PACKAGE(CURL)
|
FIND_PACKAGE(CURL)
|
||||||
|
FIND_PACKAGE(ITK)
|
||||||
SET(wxWidgets_USE_LIBS base core gl net)
|
FIND_PACKAGE(LibVNCServer)
|
||||||
FIND_PACKAGE(wxWidgets)
|
FIND_PACKAGE(OurDCMTK)
|
||||||
|
FIND_PACKAGE(OpenAL)
|
||||||
# To select a specific version of QT define DESIRED_QT_VERSION
|
FIND_PACKAGE(XUL)
|
||||||
# via cmake -DDESIRED_QT_VERSION=4
|
FIND_PACKAGE(FFmpeg)
|
||||||
IF (DESIRED_QT_VERSION)
|
|
||||||
|
|
||||||
IF (DESIRED_QT_VERSION MATCHES 4)
|
|
||||||
FIND_PACKAGE(Qt4)
|
|
||||||
ELSE(DESIRED_QT_VERSION MATCHES 4)
|
|
||||||
FIND_PACKAGE(Qt3)
|
|
||||||
ENDIF(DESIRED_QT_VERSION MATCHES 4)
|
|
||||||
|
|
||||||
ELSE(DESIRED_QT_VERSION)
|
|
||||||
|
|
||||||
FIND_PACKAGE(Qt4)
|
|
||||||
|
|
||||||
IF (NOT QT4_FOUND)
|
|
||||||
FIND_PACKAGE(Qt3)
|
|
||||||
ENDIF(NOT QT4_FOUND)
|
|
||||||
|
|
||||||
ENDIF(DESIRED_QT_VERSION)
|
|
||||||
|
|
||||||
#use pkg-config to find various modues
|
#use pkg-config to find various modues
|
||||||
INCLUDE(FindPkgConfig OPTIONAL)
|
INCLUDE(FindPkgConfig OPTIONAL)
|
||||||
@@ -328,17 +328,46 @@ IF(PKG_CONFIG_FOUND)
|
|||||||
|
|
||||||
PKG_CHECK_MODULES(RSVG librsvg-2.0)
|
PKG_CHECK_MODULES(RSVG librsvg-2.0)
|
||||||
PKG_CHECK_MODULES(CAIRO cairo)
|
PKG_CHECK_MODULES(CAIRO cairo)
|
||||||
|
PKG_CHECK_MODULES(POPPLER poppler-glib)
|
||||||
|
|
||||||
ENDIF(PKG_CONFIG_FOUND)
|
ENDIF(PKG_CONFIG_FOUND)
|
||||||
|
|
||||||
|
#optional example related dependencies
|
||||||
|
IF (BUILD_OSG_EXAMPLES)
|
||||||
|
|
||||||
|
|
||||||
|
FIND_PACKAGE(FLTK)
|
||||||
|
FIND_PACKAGE(GLUT)
|
||||||
|
FIND_PACKAGE(SDL)
|
||||||
|
FIND_PACKAGE(FOX)
|
||||||
|
|
||||||
|
SET(wxWidgets_USE_LIBS base core gl net)
|
||||||
|
FIND_PACKAGE(wxWidgets)
|
||||||
|
|
||||||
|
# To select a specific version of QT define DESIRED_QT_VERSION
|
||||||
|
# via cmake -DDESIRED_QT_VERSION=4
|
||||||
|
IF (DESIRED_QT_VERSION)
|
||||||
|
|
||||||
|
IF (DESIRED_QT_VERSION MATCHES 4)
|
||||||
|
FIND_PACKAGE(Qt4)
|
||||||
|
ELSE(DESIRED_QT_VERSION MATCHES 4)
|
||||||
|
FIND_PACKAGE(Qt3)
|
||||||
|
ENDIF(DESIRED_QT_VERSION MATCHES 4)
|
||||||
|
|
||||||
|
ELSE(DESIRED_QT_VERSION)
|
||||||
|
|
||||||
|
FIND_PACKAGE(Qt4)
|
||||||
|
|
||||||
|
IF (NOT QT4_FOUND)
|
||||||
|
FIND_PACKAGE(Qt3)
|
||||||
|
ENDIF(NOT QT4_FOUND)
|
||||||
|
|
||||||
|
ENDIF(DESIRED_QT_VERSION)
|
||||||
|
|
||||||
|
ENDIF(BUILD_OSG_EXAMPLES)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Enable workaround for OpenGL driver crash with occlusion query
|
|
||||||
#
|
|
||||||
OPTION(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL "Set to ON to build OcclussionQueryNode with a workaround for multi-threaded OpenGL driver occlussion query crash. " OFF)
|
|
||||||
IF(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
|
|
||||||
ADD_DEFINITIONS(-DFORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
|
|
||||||
ENDIF(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -375,7 +404,7 @@ IF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
|
|||||||
ENDIF(WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Linux")
|
ENDIF(WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
ENDIF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
|
ENDIF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
|
||||||
|
|
||||||
OPTION(OSG_GLU_TESS_CALLBACK_TRIPLEDOT "Set to ON to build build with variable parameter (...) version of GLU tesselator callback" ${DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT})
|
OPTION(OSG_GLU_TESS_CALLBACK_TRIPLEDOT "Set to ON to build with variable parameter (...) version of GLU tesselator callback" ${DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT})
|
||||||
IF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
|
IF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
|
||||||
ADD_DEFINITIONS(-DGLU_TESS_CALLBACK_TRIPLEDOT)
|
ADD_DEFINITIONS(-DGLU_TESS_CALLBACK_TRIPLEDOT)
|
||||||
ENDIF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
|
ENDIF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
|
||||||
@@ -421,17 +450,19 @@ ENDIF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
|||||||
# Installation stuff
|
# Installation stuff
|
||||||
|
|
||||||
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")
|
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")
|
||||||
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX=${CMAKE_DEBUG_POSTFIX})
|
||||||
ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX="${CMAKE_DEBUG_POSTFIX}")
|
|
||||||
ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
IF(UNIX AND NOT WIN32)
|
||||||
ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX='\"${CMAKE_DEBUG_POSTFIX}\"')
|
|
||||||
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
|
||||||
IF(UNIX AND NOT WIN32 AND NOT APPLE)
|
|
||||||
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
ADD_DEFINITIONS("-D_DEBUG")
|
ADD_DEFINITIONS("-D_DEBUG")
|
||||||
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
ENDIF(UNIX AND NOT WIN32 AND NOT APPLE)
|
ENDIF(UNIX AND NOT WIN32)
|
||||||
|
|
||||||
|
IF(CYGWIN)
|
||||||
|
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
ADD_DEFINITIONS("-D_DEBUG")
|
||||||
|
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
ENDIF(CYGWIN)
|
||||||
|
|
||||||
IF(UNIX AND NOT WIN32 AND NOT APPLE)
|
IF(UNIX AND NOT WIN32 AND NOT APPLE)
|
||||||
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
||||||
@@ -509,31 +540,6 @@ SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} CACHE STRING "You may add additiona
|
|||||||
# This is unofficial so this may be removed or changed at anytime.
|
# This is unofficial so this may be removed or changed at anytime.
|
||||||
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} CACHE STRING "(EXPERIMENTAL) You may add additional search paths here. Use ; to separate multiple paths.")
|
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} CACHE STRING "(EXPERIMENTAL) You may add additional search paths here. Use ; to separate multiple paths.")
|
||||||
|
|
||||||
|
|
||||||
# Dynamic vs Static Linking
|
|
||||||
OPTION(DYNAMIC_OPENSCENEGRAPH "Set to ON to build OpenSceneGraph for dynamic linking. Use OFF for static." ON)
|
|
||||||
IF (DYNAMIC_OPENSCENEGRAPH)
|
|
||||||
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED")
|
|
||||||
ELSE (DYNAMIC_OPENSCENEGRAPH)
|
|
||||||
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
|
|
||||||
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
|
||||||
|
|
||||||
INCLUDE(OsgMacroUtils)
|
|
||||||
# OSG Core
|
|
||||||
ADD_SUBDIRECTORY(src)
|
|
||||||
|
|
||||||
# OSG Applications
|
|
||||||
OPTION(BUILD_OSG_APPLICATIONS "Enable to build OSG Applications (e.g. osgviewer)" ON)
|
|
||||||
IF (BUILD_OSG_APPLICATIONS)
|
|
||||||
ADD_SUBDIRECTORY(applications)
|
|
||||||
ENDIF(BUILD_OSG_APPLICATIONS)
|
|
||||||
|
|
||||||
# OSG Examples
|
|
||||||
OPTION(BUILD_OSG_EXAMPLES "Enable to build OSG Examples" OFF)
|
|
||||||
IF (BUILD_OSG_EXAMPLES)
|
|
||||||
ADD_SUBDIRECTORY(examples)
|
|
||||||
ENDIF(BUILD_OSG_EXAMPLES)
|
|
||||||
|
|
||||||
# This is for an advanced option to give aggressive warnings
|
# This is for an advanced option to give aggressive warnings
|
||||||
# under different compilers. If yours is not implemented, this option
|
# under different compilers. If yours is not implemented, this option
|
||||||
# will not be made available.
|
# will not be made available.
|
||||||
@@ -548,13 +554,17 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
# errors instead of warnings for certain issues, including superfluous
|
# errors instead of warnings for certain issues, including superfluous
|
||||||
# semicolons and commas, and the use of long long. -fpermissive seems
|
# semicolons and commas, and the use of long long. -fpermissive seems
|
||||||
# to be the workaround.
|
# to be the workaround.
|
||||||
SET(OSG_AGGRESSIVE_WARNING_FLAGS "-Wall -Wparentheses -Wformat=2 -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -fpermissive")
|
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -fpermissive)
|
||||||
|
|
||||||
|
# Previous included -Wformat=2 in OSG_AGGRESSIVE_WARNING_FLAGS but had to remove it due to standard library errors
|
||||||
|
|
||||||
|
|
||||||
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
# FIXME: What are good aggressive warning flags for Visual Studio?
|
# FIXME: What are good aggressive warning flags for Visual Studio?
|
||||||
# And do we need to further subcase this for different versions of VS?
|
# And do we need to further subcase this for different versions of VS?
|
||||||
# CMake variables: MSVC60, MSVC70, MSVC71, MSVC80, CMAKE_COMPILER_2005
|
# CMake variables: MSVC60, MSVC70, MSVC71, MSVC80, CMAKE_COMPILER_2005
|
||||||
SET(OSG_AGGRESSIVE_WARNING_FLAGS "/Wall /W4")
|
SET(OSG_AGGRESSIVE_WARNING_FLAGS /W4 /wd4706 /wd4127 /wd4100)
|
||||||
|
|
||||||
|
|
||||||
ELSE(MSVC)
|
ELSE(MSVC)
|
||||||
@@ -567,26 +577,53 @@ ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
# This part is for the CMake menu option to toggle the warnings on/off.
|
# This part is for the CMake menu option to toggle the warnings on/off.
|
||||||
# This will only be made available if we set values for OSG_AGGRESSIVE_WARNING_FLAGS.
|
# This will only be made available if we set values for OSG_AGGRESSIVE_WARNING_FLAGS.
|
||||||
IF(OSG_AGGRESSIVE_WARNING_FLAGS)
|
IF(OSG_AGGRESSIVE_WARNING_FLAGS)
|
||||||
OPTION(OSG_USE_AGGRESSIVE_WARNINGS "Enable to activate aggressive warnings" OFF)
|
|
||||||
|
IF (APPLE)
|
||||||
|
SET(DEFAULT_USE_AGGRESSIVE_WARNINGS OFF)
|
||||||
|
ELSE(APPLE)
|
||||||
|
SET(DEFAULT_USE_AGGRESSIVE_WARNINGS ON)
|
||||||
|
ENDIF(APPLE)
|
||||||
|
|
||||||
|
OPTION(OSG_USE_AGGRESSIVE_WARNINGS "Enable to activate aggressive warnings" ${DEFAULT_USE_AGGRESSIVE_WARNINGS})
|
||||||
MARK_AS_ADVANCED(OSG_USE_AGGRESSIVE_WARNINGS)
|
MARK_AS_ADVANCED(OSG_USE_AGGRESSIVE_WARNINGS)
|
||||||
|
|
||||||
IF(OSG_USE_AGGRESSIVE_WARNINGS)
|
IF(OSG_USE_AGGRESSIVE_WARNINGS)
|
||||||
IF(NOT "${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
|
# Add flags defined by OSG_AGGRESSIVE_WARNING_FLAGS if they aren't already there
|
||||||
SET(OLD_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE INTERNAL "Old CXX flags")
|
FOREACH(flag ${OSG_AGGRESSIVE_WARNING_FLAGS})
|
||||||
SET(OLD_CMAKE_CXX_FLAGS_WAS_SET 1 CACHE INTERNAL "Old CXX flags was set")
|
IF(NOT CMAKE_CXX_FLAGS MATCHES "${flag}")
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSG_AGGRESSIVE_WARNING_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||||
ENDIF(NOT "${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
|
ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "${flag}")
|
||||||
|
ENDFOREACH(flag)
|
||||||
ELSE(OSG_USE_AGGRESSIVE_WARNINGS)
|
ELSE(OSG_USE_AGGRESSIVE_WARNINGS)
|
||||||
# FIXME: This will lose any changes made after OLD_CMAKE_CXX_FLAGS was
|
# Remove all flags considered aggresive
|
||||||
# set. The better way would be to parse the string and remove each
|
FOREACH(flag ${OSG_AGGRESSIVE_WARNING_FLAGS})
|
||||||
# option explicitly.
|
STRING(REGEX REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
IF("${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
|
ENDFOREACH(flag)
|
||||||
SET(CMAKE_CXX_FLAGS "${OLD_CMAKE_CXX_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
|
||||||
SET(OLD_CMAKE_CXX_FLAGS_WAS_SET 0 CACHE INTERNAL "Old CXX flags was set")
|
|
||||||
ENDIF("${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
|
|
||||||
ENDIF(OSG_USE_AGGRESSIVE_WARNINGS)
|
ENDIF(OSG_USE_AGGRESSIVE_WARNINGS)
|
||||||
ENDIF(OSG_AGGRESSIVE_WARNING_FLAGS)
|
ENDIF(OSG_AGGRESSIVE_WARNING_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
# Dynamic vs Static Linking
|
||||||
|
OPTION(DYNAMIC_OPENSCENEGRAPH "Set to ON to build OpenSceneGraph for dynamic linking. Use OFF for static." ON)
|
||||||
|
IF (DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED")
|
||||||
|
ELSE (DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
|
||||||
|
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
|
||||||
|
INCLUDE(OsgMacroUtils)
|
||||||
|
# OSG Core
|
||||||
|
ADD_SUBDIRECTORY(src)
|
||||||
|
|
||||||
|
IF (BUILD_OSG_APPLICATIONS)
|
||||||
|
ADD_SUBDIRECTORY(applications)
|
||||||
|
ENDIF(BUILD_OSG_APPLICATIONS)
|
||||||
|
|
||||||
|
IF (BUILD_OSG_EXAMPLES)
|
||||||
|
ADD_SUBDIRECTORY(examples)
|
||||||
|
ENDIF(BUILD_OSG_EXAMPLES)
|
||||||
|
|
||||||
|
|
||||||
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
|
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
|
||||||
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
|
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
@@ -635,33 +672,24 @@ ADD_CUSTOM_TARGET(wrappers
|
|||||||
COMMAND ${GENWRAPPER} -c ${OpenSceneGraph_SOURCE_DIR}/src/osgWrappers/genwrapper.conf -l ${OpenSceneGraph_SOURCE_DIR}
|
COMMAND ${GENWRAPPER} -c ${OpenSceneGraph_SOURCE_DIR}/src/osgWrappers/genwrapper.conf -l ${OpenSceneGraph_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
OPTION(BUILD_REF_DOCS "Build OpenSceneGraph reference documentation using doxygen (use: make DoxygenDoc)" OFF)
|
|
||||||
|
|
||||||
IF(BUILD_REF_DOCS)
|
|
||||||
SET(BUILD_DOCUMENTATION YES)
|
|
||||||
OPTION(BUILD_REF_DOCS_SEARCHENGINE "Enable doxygen's search engine (requires that documentation to be installed on a php enabled web server)" OFF)
|
|
||||||
OPTION(BUILD_REF_DOCS_TAGFILE "Generate a tag file named osg.tag on the documentation web server" OFF)
|
|
||||||
ENDIF(BUILD_REF_DOCS)
|
|
||||||
|
|
||||||
# For Doxygen
|
# For Doxygen
|
||||||
#FIXME: I haven't figured out what to do with OSG's multiple doxyfiles
|
|
||||||
# and footer.
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
|
INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
|
||||||
OPTION(BUILD_DOCUMENTATION "Build osg documentation" OFF)
|
OPTION(BUILD_DOCUMENTATION "Build OpenSceneGraph reference documentation using doxygen (use: make DoxygenDoc)" OFF)
|
||||||
|
MARK_AS_ADVANCED(CLEAR BUILD_DOCUMENTATION)
|
||||||
# To build the documention, you will have to enable it
|
# To build the documention, you will have to enable it
|
||||||
# and then do the equivalent of "make DoxygenDoc".
|
# and then do the equivalent of "make DoxygenDoc".
|
||||||
IF(BUILD_DOCUMENTATION)
|
IF(BUILD_DOCUMENTATION)
|
||||||
SET(BUILD_DOCUMENTATION YES)
|
|
||||||
|
|
||||||
|
OPTION(BUILD_REF_DOCS_SEARCHENGINE "Enable doxygen's search engine (requires that documentation to be installed on a php enabled web server)" OFF)
|
||||||
IF(BUILD_REF_DOCS_SEARCHENGINE)
|
IF(BUILD_REF_DOCS_SEARCHENGINE)
|
||||||
SET(SEARCHENGINE YES)
|
SET(SEARCHENGINE YES)
|
||||||
ELSE(BUILD_REF_DOCS_SEARCHENGINE)
|
ELSE(BUILD_REF_DOCS_SEARCHENGINE)
|
||||||
SET(SEARCHENGINE NO)
|
SET(SEARCHENGINE NO)
|
||||||
ENDIF(BUILD_REF_DOCS_SEARCHENGINE)
|
ENDIF(BUILD_REF_DOCS_SEARCHENGINE)
|
||||||
|
|
||||||
|
OPTION(BUILD_REF_DOCS_TAGFILE "Generate a tag file named osg.tag on the documentation web server" OFF)
|
||||||
IF(BUILD_REF_DOCS_TAGFILE)
|
IF(BUILD_REF_DOCS_TAGFILE)
|
||||||
SET(GENERATE_TAGFILE "doc/OpenSceneGraphReferenceDocs/osg.tag")
|
SET(GENERATE_TAGFILE "${OpenSceneGraph_BINARY_DIR}/doc/OpenSceneGraphReferenceDocs/osg.tag")
|
||||||
ELSE(BUILD_REF_DOCS_TAGFILE)
|
ELSE(BUILD_REF_DOCS_TAGFILE)
|
||||||
SET(GENERATE_TAGFILE "")
|
SET(GENERATE_TAGFILE "")
|
||||||
ENDIF(BUILD_REF_DOCS_TAGFILE)
|
ENDIF(BUILD_REF_DOCS_TAGFILE)
|
||||||
@@ -671,29 +699,148 @@ IF(BUILD_DOCUMENTATION)
|
|||||||
ELSE(DOT)
|
ELSE(DOT)
|
||||||
SET(HAVE_DOT NO)
|
SET(HAVE_DOT NO)
|
||||||
ENDIF(DOT)
|
ENDIF(DOT)
|
||||||
# This processes our Doxyfile.in and substitutes paths to generate
|
|
||||||
|
# If html help generation was requested. DOCUMENTATION_HTML_HELP is defined by Documentation.cmake
|
||||||
|
SET(GENERATE_HTMLHELP "NO")
|
||||||
|
IF(DOCUMENTATION_HTML_HELP)
|
||||||
|
# on windows Documentation.cmake finds the html help workshop fi it exists. On u*ix we might have it with wine but no way to point it out
|
||||||
|
IF(NOT WIN32)
|
||||||
|
SET(HTML_HELP_COMPILER "" CACHE FILEPATH "Enter location of the HTML help compiler to let doxygen compile html")
|
||||||
|
MARK_AS_ADVANCED(HTML_HELP_COMPILER)
|
||||||
|
ENDIF(NOT WIN32)
|
||||||
|
# this var sets a proper value in .doxygen files when coniguring them below
|
||||||
|
SET(GENERATE_HTMLHELP "YES")
|
||||||
|
endif(DOCUMENTATION_HTML_HELP)
|
||||||
|
|
||||||
|
# This processes our doxyfile.cmake and substitutes paths to generate
|
||||||
# a final Doxyfile
|
# a final Doxyfile
|
||||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/doxyfile.cmake
|
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/doxyfile.cmake
|
||||||
${PROJECT_BINARY_DIR}/doc/doxyfile
|
${PROJECT_BINARY_DIR}/doc/openscenegraph.doxyfile
|
||||||
)
|
)
|
||||||
|
# copy the osg logo to documentations target folder
|
||||||
|
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PlatformSpecifics/Windows/icons/src/osg32-32.png
|
||||||
|
${PROJECT_BINARY_DIR}/doc/OpenSceneGraphReferenceDocs/osg32-32.png COPYONLY
|
||||||
|
)
|
||||||
|
#INSTALL(FILES ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}ReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm DESTINATION doc OPTIONAL COMPONENT openscenegraph-doc)
|
||||||
|
INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/doc/OpenSceneGraphReferenceDocs DESTINATION doc COMPONENT openscenegraph-doc)
|
||||||
|
|
||||||
|
# now set up openthreads documentation generation
|
||||||
|
IF(BUILD_REF_DOCS_TAGFILE)
|
||||||
|
SET(GENERATE_TAGFILE "${OpenSceneGraph_BINARY_DIR}/doc/OpenThreadsReferenceDocs/ot.tag")
|
||||||
|
ENDIF(BUILD_REF_DOCS_TAGFILE)
|
||||||
|
|
||||||
|
# This processes our openthreads.doxyfile.cmake and generate a final doxyfile
|
||||||
|
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/openthreads.doxyfile.cmake
|
||||||
|
${PROJECT_BINARY_DIR}/doc/openthreads.doxyfile
|
||||||
|
)
|
||||||
|
# copy the osg logo to documentations target folder
|
||||||
|
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PlatformSpecifics/Windows/icons/src/osg32-32.png
|
||||||
|
${PROJECT_BINARY_DIR}/doc/OpenThreadsReferenceDocs/osg32-32.png COPYONLY
|
||||||
|
)
|
||||||
|
#INSTALL(FILES ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}ReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm DESTINATION doc OPTIONAL COMPONENT openscenegraph-doc)
|
||||||
|
INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/doc/OpenThreadsReferenceDocs DESTINATION doc COMPONENT openthreads-doc)
|
||||||
|
|
||||||
|
# Process our other doxyfiles but don't create targets for these
|
||||||
|
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/all_Doxyfile
|
||||||
|
${PROJECT_BINARY_DIR}/doc/all_Doxyfile)
|
||||||
|
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/auto_Doxyfile
|
||||||
|
${PROJECT_BINARY_DIR}/doc/auto_Doxyfile)
|
||||||
|
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/core_Doxyfile
|
||||||
|
${PROJECT_BINARY_DIR}/doc/core_Doxyfile)
|
||||||
|
|
||||||
# This creates a new target to build documentation.
|
# This creates a new target to build documentation.
|
||||||
# It runs ${DOXYGEN} which is the full path and executable to
|
# It runs ${DOXYGEN} which is the full path and executable to
|
||||||
# Doxygen on your system, set by the FindDoxygen.cmake module
|
# Doxygen on your system, set by the FindDoxygen.cmake module
|
||||||
# (called by FindDocumentation.cmake).
|
# (called by FindDocumentation.cmake).
|
||||||
# It runs the final generated Doxyfile against it.
|
# It runs the final generated Doxyfile against it.
|
||||||
# The DOT_PATH is substituted into the Doxyfile.
|
# The DOT_PATH is substituted into the Doxyfile.
|
||||||
ADD_CUSTOM_TARGET(DoxygenDoc ${DOXYGEN}
|
ADD_CUSTOM_TARGET(doc_openscenegraph ${DOXYGEN}
|
||||||
${PROJECT_BINARY_DIR}/doc/doxyfile
|
${PROJECT_BINARY_DIR}/doc/openscenegraph.doxyfile
|
||||||
|
)
|
||||||
|
ADD_CUSTOM_TARGET(doc_openthreads ${DOXYGEN}
|
||||||
|
${PROJECT_BINARY_DIR}/doc/openthreads.doxyfile
|
||||||
)
|
)
|
||||||
ENDIF(BUILD_DOCUMENTATION)
|
ENDIF(BUILD_DOCUMENTATION)
|
||||||
|
|
||||||
|
OPTION(BUILD_DASHBOARD_REPORTS "Set to ON to activate reporting of OpenSceneGraph builds here http://www.cdash.org/CDashPublic/index.php?project=OpenSceneGraph" OFF)
|
||||||
|
IF(BUILD_DASHBOARD_REPORTS)
|
||||||
|
# The following are required to uses Dart and the Cdash dashboard
|
||||||
|
# viewable here : http://www.cdash.org/CDashPublic/index.php?project=OpenSceneGraph
|
||||||
|
INCLUDE(Dart)
|
||||||
|
ENDIF(BUILD_DASHBOARD_REPORTS)
|
||||||
|
|
||||||
|
# present the packaging option only if we have the cpack command defined (effectively >= 2.6.0)
|
||||||
|
IF(CMAKE_CPACK_COMMAND)
|
||||||
|
OPTION(BUILD_OSG_PACKAGES "Set to ON to generate CPack configuration files and packaging targets" OFF)
|
||||||
|
IF(BUILD_OSG_PACKAGES)
|
||||||
|
INCLUDE(OsgCPack)
|
||||||
|
ENDIF(BUILD_OSG_PACKAGES)
|
||||||
|
ENDIF(CMAKE_CPACK_COMMAND)
|
||||||
|
|
||||||
|
# Generate pkg-config configuration file
|
||||||
|
|
||||||
|
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/pkgconfig/openscenegraph.pc.in
|
||||||
|
${PROJECT_BINARY_DIR}/packaging/pkgconfig/openscenegraph.pc
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
INSTALL(FILES ${PROJECT_BINARY_DIR}/packaging/pkgconfig/openscenegraph.pc DESTINATION lib${LIB_POSTFIX}/pkgconfig COMPONENT libopenscenegraph-dev)
|
||||||
|
|
||||||
|
# Run this as late as possible so users can easier spot the message
|
||||||
|
IF (${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local")
|
||||||
|
SET(REQUIRES_LIBPATH_MESSAGE ON)
|
||||||
|
ENDIF(${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local")
|
||||||
|
|
||||||
|
IF(REQUIRES_LIBPATH_MESSAGE)
|
||||||
|
|
||||||
|
IF (NOT OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE)
|
||||||
|
|
||||||
|
SET(OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether the libpath message has been reported before")
|
||||||
|
|
||||||
|
MESSAGE("\nThe build system is configured to instal libraries to ${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}\n"
|
||||||
|
"Your applications may not be able to find your installed libraries unless you:\n"
|
||||||
|
" set your LD_LIBRARY_PATH (user specific) or\n"
|
||||||
|
" update your ld.so configuration (system wide)")
|
||||||
|
IF(IS_DIRECTORY /etc/ld.so.conf.d)
|
||||||
|
MESSAGE("You have an ld.so.conf.d directory on your system, so if you wish to ensure that\n"
|
||||||
|
"applications find the installed osg libraries, system wide, you could install a\n"
|
||||||
|
"openscenegraph specific ld.so configuration with:\n"
|
||||||
|
" sudo make install_ld_conf\n")
|
||||||
|
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/ld.so.conf.d/openscenegraph.conf.in
|
||||||
|
${PROJECT_BINARY_DIR}/packaging/ld.so.conf.d/openscenegraph.conf
|
||||||
|
)
|
||||||
|
ADD_CUSTOM_TARGET(install_ld_conf ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
${PROJECT_BINARY_DIR}/packaging/ld.so.conf.d/openscenegraph.conf
|
||||||
|
/etc/ld.so.conf.d/openscenegraph.conf
|
||||||
|
COMMAND ldconfig
|
||||||
|
COMMENT "Copying openscenegraph.conf to /etc/ld.so.conf.d and running ldconfig"
|
||||||
|
)
|
||||||
|
ELSE(IS_DIRECTORY /etc/ld.so.conf.d)
|
||||||
|
IF(EXISTS /etc/ld.so.conf)
|
||||||
|
MESSAGE("You have an ld.so.conf file in /etc, if you wish to ensure \n"
|
||||||
|
"that applications find the installed osg libraries, system wide, you\n"
|
||||||
|
"could add ${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX} to it.")
|
||||||
|
ENDIF(EXISTS /etc/ld.so.conf)
|
||||||
|
ENDIF(IS_DIRECTORY /etc/ld.so.conf.d)
|
||||||
|
|
||||||
|
# emit a message during installation.
|
||||||
|
INSTALL(CODE "MESSAGE(\"Libraries were installed to ${CMAKE_INSTALL_PREFIX}lib${LIB_POSTFIX}.\\nYou may need to update your ld.so configuration. \")")
|
||||||
|
|
||||||
|
ENDIF(NOT OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE)
|
||||||
|
|
||||||
|
ELSE(REQUIRES_LIBPATH_MESSAGE)
|
||||||
|
|
||||||
|
SET(OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE 0 CACHE INTERNAL "Flag to track whether the libpath message has been reported before")
|
||||||
|
|
||||||
|
ENDIF(REQUIRES_LIBPATH_MESSAGE)
|
||||||
|
|
||||||
|
|
||||||
# This needs to be run very last so other parts of the scripts can take
|
# This needs to be run very last so other parts of the scripts can take
|
||||||
# advantage of this.
|
# advantage of this.
|
||||||
IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||||
SET(OSG_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
|
SET(OSG_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
|
||||||
ENDIF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
ENDIF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
### uninstall target
|
### uninstall target
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
@@ -703,4 +850,3 @@ CONFIGURE_FILE(
|
|||||||
IMMEDIATE @ONLY)
|
IMMEDIATE @ONLY)
|
||||||
ADD_CUSTOM_TARGET(uninstall
|
ADD_CUSTOM_TARGET(uninstall
|
||||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||||
|
|
||||||
|
|||||||
@@ -68,8 +68,13 @@ int main(int, const char**)
|
|||||||
|
|
||||||
CHECK_CXX_SOURCE_RUNS("
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <intrin.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#pragma intrinsic(_InterlockedAnd)
|
||||||
|
#pragma intrinsic(_InterlockedOr)
|
||||||
|
#pragma intrinsic(_InterlockedXor)
|
||||||
|
|
||||||
int main(int, const char**)
|
int main(int, const char**)
|
||||||
{
|
{
|
||||||
volatile long value = 0;
|
volatile long value = 0;
|
||||||
@@ -90,6 +95,24 @@ int main(int, const char**)
|
|||||||
}
|
}
|
||||||
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
||||||
|
|
||||||
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_SUN AND NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
|
#include <libkern/OSAtomic.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
volatile int32_t value = 0;
|
||||||
|
long data = 0;
|
||||||
|
long * volatile ptr = &data;
|
||||||
|
|
||||||
|
OSAtomicIncrement32(&value);
|
||||||
|
OSMemoryBarrier();
|
||||||
|
OSAtomicDecrement32(&value);
|
||||||
|
OSAtomicCompareAndSwapInt(value, 1, &value);
|
||||||
|
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
|
||||||
|
}
|
||||||
|
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
||||||
|
|
||||||
|
|
||||||
|
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_SUN AND NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
||||||
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
|
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
|
||||||
ENDIF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_SUN AND NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
ENDIF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_SUN AND NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
||||||
|
|||||||
@@ -55,12 +55,13 @@ ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES SEARCHPATHLIST DEBUGS
|
|||||||
|
|
||||||
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
|
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
|
||||||
FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D")
|
FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D")
|
||||||
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype234;freetype234MT;freetype235" ${OSG_3RDPARTY_BIN} "_D")
|
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype234;freetype234MT;freetype235;freetype237" ${OSG_3RDPARTY_BIN} "_D")
|
||||||
IF(FREETYPE_FOUND)
|
IF(FREETYPE_FOUND)
|
||||||
#forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
|
#forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
|
||||||
SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "")
|
SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
|
||||||
SET(FREETYPE_INCLUDE_DIR_freetype2 ${FREETYPE_INCLUDE_DIR} CACHE PATH "")
|
SET(FREETYPE_INCLUDE_DIR_freetype2 ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
|
||||||
MARK_AS_ADVANCED(FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2)
|
MARK_AS_ADVANCED(FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2)
|
||||||
|
SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
|
||||||
ENDIF(FREETYPE_FOUND)
|
ENDIF(FREETYPE_FOUND)
|
||||||
FIND_DEPENDENCY(CURL curl/curl.h "libcurl;curllib" ${OSG_3RDPARTY_BIN} "D")
|
FIND_DEPENDENCY(CURL curl/curl.h "libcurl;curllib" ${OSG_3RDPARTY_BIN} "D")
|
||||||
FIND_DEPENDENCY(JPEG jpeglib.h libjpeg ${OSG_3RDPARTY_BIN} "D")
|
FIND_DEPENDENCY(JPEG jpeglib.h libjpeg ${OSG_3RDPARTY_BIN} "D")
|
||||||
|
|||||||
@@ -1,15 +1,33 @@
|
|||||||
# Locate gdal
|
# Locate Collada
|
||||||
# This module defines
|
# This module defines:
|
||||||
# COLLADA_LIBRARY
|
|
||||||
# COLLADA_FOUND, if false, do not try to link to gdal
|
|
||||||
# COLLADA_INCLUDE_DIR, where to find the headers
|
# COLLADA_INCLUDE_DIR, where to find the headers
|
||||||
#
|
#
|
||||||
|
# COLLADA_LIBRARY, COLLADA_LIBRARY_DEBUG
|
||||||
|
# COLLADA_FOUND, if false, do not try to link to Collada dynamically
|
||||||
|
#
|
||||||
|
# COLLADA_LIBRARY_STATIC, COLLADA_LIBRARY_STATIC_DEBUG
|
||||||
|
# COLLADA_STATIC_FOUND, if false, do not try to link to Collada statically
|
||||||
|
#
|
||||||
# $COLLADA_DIR is an environment variable that would
|
# $COLLADA_DIR is an environment variable that would
|
||||||
# correspond to the ./configure --prefix=$COLLADA_DIR
|
# correspond to the ./configure --prefix=$COLLADA_DIR
|
||||||
#
|
#
|
||||||
# Created by Robert Osfield.
|
# Created by Robert Osfield.
|
||||||
|
|
||||||
|
SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory")
|
||||||
|
|
||||||
|
IF(APPLE)
|
||||||
|
SET(COLLADA_BUILDNAME "mac")
|
||||||
|
ELSEIF(MINGW)
|
||||||
|
SET(COLLADA_BUILDNAME "mingw")
|
||||||
|
ELSEIF(MSVC90)
|
||||||
|
SET(COLLADA_BUILDNAME "vc9")
|
||||||
|
ELSE(APPLE)
|
||||||
|
SET(COLLADA_BUILDNAME "vc8")
|
||||||
|
ENDIF(APPLE)
|
||||||
|
|
||||||
|
|
||||||
FIND_PATH(COLLADA_INCLUDE_DIR dae.h
|
FIND_PATH(COLLADA_INCLUDE_DIR dae.h
|
||||||
|
${COLLADA_DOM_ROOT}/include
|
||||||
$ENV{COLLADA_DIR}/include
|
$ENV{COLLADA_DIR}/include
|
||||||
$ENV{COLLADA_DIR}
|
$ENV{COLLADA_DIR}
|
||||||
$ENV{OSGDIR}/include
|
$ENV{OSGDIR}/include
|
||||||
@@ -29,9 +47,11 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
|
|||||||
/usr/freeware/include
|
/usr/freeware/include
|
||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(COLLADA_LIBRARY
|
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
|
||||||
NAMES collada_dom collada14dom
|
NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22
|
||||||
PATHS
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
|
||||||
|
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4
|
||||||
$ENV{COLLADA_DIR}/lib
|
$ENV{COLLADA_DIR}/lib
|
||||||
$ENV{COLLADA_DIR}/lib-dbg
|
$ENV{COLLADA_DIR}/lib-dbg
|
||||||
$ENV{COLLADA_DIR}
|
$ENV{COLLADA_DIR}
|
||||||
@@ -52,9 +72,189 @@ FIND_LIBRARY(COLLADA_LIBRARY
|
|||||||
/usr/freeware/lib64
|
/usr/freeware/lib64
|
||||||
)
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
|
||||||
|
NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
|
||||||
|
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d
|
||||||
|
$ENV{COLLADA_DIR}/lib
|
||||||
|
$ENV{COLLADA_DIR}/lib-dbg
|
||||||
|
$ENV{COLLADA_DIR}
|
||||||
|
$ENV{OSGDIR}/lib
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/lib
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_STATIC_LIBRARY
|
||||||
|
NAMES libcollada14dom21-s libcollada14dom22-s
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
|
||||||
|
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4
|
||||||
|
$ENV{COLLADA_DIR}/lib
|
||||||
|
$ENV{COLLADA_DIR}/lib-dbg
|
||||||
|
$ENV{COLLADA_DIR}
|
||||||
|
$ENV{OSGDIR}/lib
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/lib
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
|
||||||
|
NAMES collada_dom-sd collada14dom-sd libcollada14dom21-sd libcollada14dom22-sd
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
|
||||||
|
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d
|
||||||
|
$ENV{COLLADA_DIR}/lib
|
||||||
|
$ENV{COLLADA_DIR}/lib-dbg
|
||||||
|
$ENV{COLLADA_DIR}
|
||||||
|
$ENV{OSGDIR}/lib
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/lib
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
# find extra libraries that the static linking requires
|
||||||
|
|
||||||
|
FIND_PACKAGE(LibXml2)
|
||||||
|
IF (LIBXML2_FOUND)
|
||||||
|
SET(COLLADA_LIBXML_LIBRARY ${LIBXML2_LIBRARIES})
|
||||||
|
ELSE(LIBXML2_FOUND)
|
||||||
|
IF(WIN32)
|
||||||
|
FIND_LIBRARY(COLLADA_LIBXML_LIBRARY
|
||||||
|
NAMES libxml2
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/libxml2/win32/lib
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/libxml2/mingw/lib
|
||||||
|
)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
ENDIF(LIBXML2_FOUND)
|
||||||
|
|
||||||
|
FIND_PACKAGE(ZLIB)
|
||||||
|
IF (ZLIB_FOUND)
|
||||||
|
SET(COLLADA_ZLIB_LIBRARY ${ZLIB_LIBRARY})
|
||||||
|
ELSE(ZLIB_FOUND)
|
||||||
|
IF(WIN32)
|
||||||
|
FIND_LIBRARY(COLLADA_ZLIB_LIBRARY
|
||||||
|
NAMES zlib
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/libxml2/win32/lib
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/libxml2/mingw/lib
|
||||||
|
)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
ENDIF(ZLIB_FOUND)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY
|
||||||
|
NAMES pcrecpp
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY_DEBUG
|
||||||
|
NAMES pcrecpp-d
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_PCRE_LIBRARY
|
||||||
|
NAMES pcre
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_PCRE_LIBRARY_DEBUG
|
||||||
|
NAMES pcre-d
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/${COLLADA_BUILDNAME}
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_MINIZIP_LIBRARY
|
||||||
|
NAMES minizip
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/minizip/win32/lib
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/minizip/mac
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_MINIZIP_LIBRARY_DEBUG
|
||||||
|
NAMES minizip-d
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/minizip/win32/lib
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/minizip/mac
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
|
||||||
|
NAMES libboost_filesystem boost_filesystem
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
|
||||||
|
NAMES libboost_filesystem-d boost_filesystem-d
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
|
||||||
|
NAMES libboost_system boost_system
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
|
||||||
|
NAMES libboost_system-d boost_system-d
|
||||||
|
PATHS
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||||
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
SET(COLLADA_FOUND "NO")
|
SET(COLLADA_FOUND "NO")
|
||||||
IF(COLLADA_LIBRARY AND COLLADA_INCLUDE_DIR)
|
IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
|
||||||
SET(COLLADA_FOUND "YES")
|
IF (COLLADA_INCLUDE_DIR)
|
||||||
ENDIF(COLLADA_LIBRARY AND COLLADA_INCLUDE_DIR)
|
SET(COLLADA_FOUND "YES")
|
||||||
|
ENDIF(COLLADA_INCLUDE_DIR)
|
||||||
|
ENDIF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
|
||||||
|
|||||||
51
CMakeModules/FindFBX.cmake
Normal file
51
CMakeModules/FindFBX.cmake
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# Locate FBX
|
||||||
|
# This module defines:
|
||||||
|
# FBX_INCLUDE_DIR, where to find the headers
|
||||||
|
#
|
||||||
|
# FBX_LIBRARY, FBX_LIBRARY_DEBUG
|
||||||
|
# FBX_FOUND
|
||||||
|
#
|
||||||
|
# $FBX_DIR is an environment variable that would
|
||||||
|
# correspond to the ./configure --prefix=$FBX_DIR
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
SET(FBX_ROOT "$ENV{PROGRAMFILES}/Autodesk/FBX/FbxSdk/2010.2" CACHE PATH "Location of FBX SDK directory")
|
||||||
|
ELSE(WIN32)
|
||||||
|
SET(FBX_ROOT $ENV{FBX_DIR} CACHE PATH "Location of FBX SDK directory")
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
|
IF(APPLE)
|
||||||
|
SET(FBX_LIBNAME "libfbxsdk_gcc4_ub")
|
||||||
|
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(FBX_LIBNAME "libfbxsdk_gcc4")#TODO: libs are provided for GCC 3.4 & 4.0 in both 32 and 64 bit versions, but I don't know how to confgure that here.
|
||||||
|
ELSEIF(MSVC71)
|
||||||
|
SET(FBX_LIBNAME "fbxsdk_md2003")
|
||||||
|
ELSEIF(MSVC80)
|
||||||
|
SET(FBX_LIBNAME "fbxsdk_md2005")
|
||||||
|
ELSEIF(MSVC90 OR MSVC_VER>1500)
|
||||||
|
SET(FBX_LIBNAME "fbxsdk_md2008")
|
||||||
|
ENDIF(APPLE)
|
||||||
|
|
||||||
|
IF(CMAKE_CL_64)
|
||||||
|
SET(FBX_LIBNAME ${FBX_LIBNAME}_amd64)
|
||||||
|
ENDIF(CMAKE_CL_64)
|
||||||
|
|
||||||
|
IF(APPLE)
|
||||||
|
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME})
|
||||||
|
ELSE(APPLE)
|
||||||
|
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
||||||
|
ENDIF(APPLE)
|
||||||
|
|
||||||
|
FIND_PATH(FBX_INCLUDE_DIR fbxsdk.h
|
||||||
|
${FBX_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(FBX_LIBRARY ${FBX_LIBNAME} ${FBX_ROOT}/lib)
|
||||||
|
|
||||||
|
FIND_LIBRARY(FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG} ${FBX_ROOT}/lib)
|
||||||
|
|
||||||
|
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
||||||
|
SET(FBX_FOUND "YES")
|
||||||
|
ELSE(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
||||||
|
SET(FBX_FOUND "NO")
|
||||||
|
ENDIF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
||||||
165
CMakeModules/FindFFmpeg.cmake
Normal file
165
CMakeModules/FindFFmpeg.cmake
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
# Locate ffmpeg
|
||||||
|
# This module defines
|
||||||
|
# FFMPEG_LIBRARIES
|
||||||
|
# FFMPEG_FOUND, if false, do not try to link to ffmpeg
|
||||||
|
# FFMPEG_INCLUDE_DIR, where to find the headers
|
||||||
|
#
|
||||||
|
# $FFMPEG_DIR is an environment variable that would
|
||||||
|
# correspond to the ./configure --prefix=$FFMPEG_DIR
|
||||||
|
#
|
||||||
|
# Created by Robert Osfield.
|
||||||
|
|
||||||
|
|
||||||
|
#In ffmpeg code, old version use "#include <header.h>" and newer use "#include <libname/header.h>"
|
||||||
|
#In OSG ffmpeg plugin, we use "#include <header.h>" for compatibility with old version of ffmpeg
|
||||||
|
|
||||||
|
#We have to search the path which contain the header.h (usefull for old version)
|
||||||
|
#and search the path which contain the libname/header.h (usefull for new version)
|
||||||
|
|
||||||
|
#Then we need to include ${FFMPEG_libname_INCLUDE_DIRS} (in old version case, use by ffmpeg header and osg plugin code)
|
||||||
|
# (in new version case, use by ffmpeg header)
|
||||||
|
#and ${FFMPEG_libname_INCLUDE_DIRS/libname} (in new version case, use by osg plugin code)
|
||||||
|
|
||||||
|
|
||||||
|
# Macro to find header and lib directories
|
||||||
|
# example: FFMPEG_FIND(AVFORMAT avformat avformat.h)
|
||||||
|
MACRO(FFMPEG_FIND varname shortname headername)
|
||||||
|
# old version of ffmpeg put header in $prefix/include/[ffmpeg]
|
||||||
|
# so try to find header in include directory
|
||||||
|
|
||||||
|
FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername}
|
||||||
|
PATHS
|
||||||
|
${FFMPEG_ROOT}/include
|
||||||
|
$ENV{FFMPEG_DIR}/include
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
/sw/include # Fink
|
||||||
|
/opt/local/include # DarwinPorts
|
||||||
|
/opt/csw/include # Blastwave
|
||||||
|
/opt/include
|
||||||
|
/usr/freeware/include
|
||||||
|
PATH_SUFFIXES ffmpeg
|
||||||
|
DOC "Location of FFMPEG Headers"
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ${headername}
|
||||||
|
PATHS
|
||||||
|
${FFMPEG_ROOT}/include
|
||||||
|
$ENV{FFMPEG_DIR}/include
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
/sw/include # Fink
|
||||||
|
/opt/local/include # DarwinPorts
|
||||||
|
/opt/csw/include # Blastwave
|
||||||
|
/opt/include
|
||||||
|
/usr/freeware/include
|
||||||
|
PATH_SUFFIXES ffmpeg
|
||||||
|
DOC "Location of FFMPEG Headers"
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES
|
||||||
|
NAMES ${shortname}
|
||||||
|
PATHS
|
||||||
|
${FFMPEG_ROOT}/lib
|
||||||
|
$ENV{FFMPEG_DIR}/lib
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
DOC "Location of FFMPEG Libraries"
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS)
|
||||||
|
SET(FFMPEG_${varname}_FOUND 1)
|
||||||
|
ENDIF(FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS)
|
||||||
|
|
||||||
|
ENDMACRO(FFMPEG_FIND)
|
||||||
|
|
||||||
|
SET(FFMPEG_ROOT "$ENV{FFMPEG_DIR}" CACHE PATH "Location of FFMPEG")
|
||||||
|
|
||||||
|
# find stdint.h
|
||||||
|
IF(WIN32)
|
||||||
|
|
||||||
|
FIND_PATH(FFMPEG_STDINT_INCLUDE_DIR stdint.h
|
||||||
|
PATHS
|
||||||
|
${FFMPEG_ROOT}/include
|
||||||
|
$ENV{FFMPEG_DIR}/include
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
/sw/include # Fink
|
||||||
|
/opt/local/include # DarwinPorts
|
||||||
|
/opt/csw/include # Blastwave
|
||||||
|
/opt/include
|
||||||
|
/usr/freeware/include
|
||||||
|
PATH_SUFFIXES ffmpeg
|
||||||
|
DOC "Location of FFMPEG stdint.h Header"
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (FFMPEG_STDINT_INCLUDE_DIR)
|
||||||
|
SET(STDINT_OK TRUE)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ELSE()
|
||||||
|
|
||||||
|
SET(STDINT_OK TRUE)
|
||||||
|
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FFMPEG_FIND(LIBAVFORMAT avformat avformat.h)
|
||||||
|
FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h)
|
||||||
|
FFMPEG_FIND(LIBAVCODEC avcodec avcodec.h)
|
||||||
|
FFMPEG_FIND(LIBAVUTIL avutil avutil.h)
|
||||||
|
FFMPEG_FIND(LIBSWSCALE swscale swscale.h) # not sure about the header to look for here.
|
||||||
|
|
||||||
|
SET(FFMPEG_FOUND "NO")
|
||||||
|
# Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional.
|
||||||
|
IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK)
|
||||||
|
|
||||||
|
SET(FFMPEG_FOUND "YES")
|
||||||
|
|
||||||
|
SET(FFMPEG_INCLUDE_DIRS
|
||||||
|
${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat
|
||||||
|
${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice
|
||||||
|
${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec
|
||||||
|
${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavutil
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (${FFMPEG_STDINT_INCLUDE_DIR})
|
||||||
|
SET(FFMPEG_INCLUDE_DIRS
|
||||||
|
${FFMPEG_INCLUDE_DIRS}
|
||||||
|
${FFMPEG_STDINT_INCLUDE_DIR}
|
||||||
|
${FFMPEG_STDINT_INCLUDE_DIR}/libavformat
|
||||||
|
${FFMPEG_STDINT_INCLUDE_DIR}/libavdevice
|
||||||
|
${FFMPEG_STDINT_INCLUDE_DIR}/libavcodec
|
||||||
|
${FFMPEG_STDINT_INCLUDE_DIR}/libavutil
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
SET(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBAVFORMAT_LIBRARY_DIRS})
|
||||||
|
|
||||||
|
# Note we don't add FFMPEG_LIBSWSCALE_LIBRARIES here, it will be added if found later.
|
||||||
|
SET(FFMPEG_LIBRARIES
|
||||||
|
${FFMPEG_LIBAVFORMAT_LIBRARIES}
|
||||||
|
${FFMPEG_LIBAVDEVICE_LIBRARIES}
|
||||||
|
${FFMPEG_LIBAVCODEC_LIBRARIES}
|
||||||
|
${FFMPEG_LIBAVUTIL_LIBRARIES})
|
||||||
|
|
||||||
|
ELSE ()
|
||||||
|
|
||||||
|
# MESSAGE(STATUS "Could not find FFMPEG")
|
||||||
|
|
||||||
|
ENDIF()
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
# #include "gdal.h"
|
# #include "gdal.h"
|
||||||
|
|
||||||
FIND_PATH(GDAL_INCLUDE_DIR gdal.h
|
FIND_PATH(GDAL_INCLUDE_DIR gdal.h
|
||||||
|
PATHS
|
||||||
$ENV{GDAL_DIR}
|
$ENV{GDAL_DIR}
|
||||||
NO_DEFAULT_PATH
|
NO_DEFAULT_PATH
|
||||||
PATH_SUFFIXES include
|
PATH_SUFFIXES include
|
||||||
|
|||||||
@@ -1,10 +1,41 @@
|
|||||||
# - Locate Inventor
|
#
|
||||||
|
# Find Open Inventor
|
||||||
|
#
|
||||||
# This module defines:
|
# This module defines:
|
||||||
# INVENTOR_FOUND, if false, do not try to link against Inventor.
|
# INVENTOR_FOUND, if false, do not try to link against Inventor.
|
||||||
# INVENTOR_INCLUDE_DIR, where to find headers.
|
# INVENTOR_INCLUDE_DIR, where to find headers.
|
||||||
# INVENTOR_LIBRARY, the library to link against.
|
# INVENTOR_LIBRARY, the library to link against.
|
||||||
# INVENTOR_LIBRARY_DEBUG, the debug library to link against.
|
# INVENTOR_LIBRARY_DEBUG, the debug library to link against.
|
||||||
|
# INVENTOR_SOWIN_LIBRARY, the SoWin library - window binding library for Inventor
|
||||||
|
# INVENTOR_SOWIN_LIBRARY, the SoWin debug library
|
||||||
|
# INVENTOR_SOXT_LIBRARY, the SoXt library - window binding library for Inventor
|
||||||
|
# INVENTOR_SOXT_LIBRARY, the SoXt debug library
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Inventor
|
||||||
|
#
|
||||||
|
# notes:
|
||||||
|
# - Coin is honored over SGI Inventor
|
||||||
|
# - Coin is detected by coin-config script, COINDIR environment variable,
|
||||||
|
# and finally standard system locations are searched
|
||||||
|
# - SGI Inventor is searched at standard system locations only
|
||||||
|
#
|
||||||
|
|
||||||
|
# coin-config tells much of Coin instalation (if present)
|
||||||
|
execute_process (COMMAND coin-config --prefix
|
||||||
|
OUTPUT_VARIABLE COIN_PREFIX
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
# try to find Inventor includes (priority paths)
|
||||||
|
FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h
|
||||||
|
${COIN_PREFIX}/include
|
||||||
|
$ENV{COINDIR}/include
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
# try to find Inventor includes (regular paths)
|
||||||
FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h
|
FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
/usr/include
|
/usr/include
|
||||||
@@ -12,52 +43,164 @@ FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h
|
|||||||
/opt/local/include
|
/opt/local/include
|
||||||
/opt/csw/include
|
/opt/csw/include
|
||||||
/opt/include
|
/opt/include
|
||||||
$ENV{COINDIR}/include
|
|
||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(INVENTOR_LIBRARY
|
# default Inventor lib search paths
|
||||||
NAMES coin2 Coin
|
SET(INVENTOR_LIB_SEARCH_PATH
|
||||||
PATHS
|
|
||||||
/usr/local/lib
|
/usr/local/lib
|
||||||
/usr/lib
|
/usr/lib
|
||||||
/sw/lib
|
/sw/lib
|
||||||
/opt/local/lib
|
/opt/local/lib
|
||||||
/opt/csw/lib
|
/opt/csw/lib
|
||||||
/opt/lib
|
/opt/lib
|
||||||
$ENV{COINDIR}/lib
|
|
||||||
)
|
)
|
||||||
IF(NOT INVENTOR_LIBRARY)
|
|
||||||
# If we can't find libCoin try libInventor
|
|
||||||
FIND_LIBRARY(INVENTOR_LIBRARY
|
|
||||||
NAMES Inventor
|
|
||||||
PATHS
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
)
|
|
||||||
ENDIF(NOT INVENTOR_LIBRARY)
|
|
||||||
|
|
||||||
|
# try to find Coin release lib (priority paths)
|
||||||
|
FIND_LIBRARY(INVENTOR_LIBRARY_RELEASE
|
||||||
|
NAMES coin5 coin4 coin3 coin2 coin1 Coin
|
||||||
|
PATHS ${COIN_PREFIX}/lib
|
||||||
|
$ENV{COINDIR}/lib
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
# try to find Coin release lib (regular paths)
|
||||||
|
FIND_LIBRARY(INVENTOR_LIBRARY_RELEASE
|
||||||
|
NAMES coin5 coin4 coin3 coin2 coin1 Coin
|
||||||
|
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||||
|
)
|
||||||
|
|
||||||
|
# try to find SGI Inventor lib
|
||||||
|
FIND_LIBRARY(INVENTOR_LIBRARY_RELEASE
|
||||||
|
NAMES Inventor
|
||||||
|
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||||
|
)
|
||||||
|
|
||||||
|
# try to find Coin debug lib (priority paths)
|
||||||
FIND_LIBRARY(INVENTOR_LIBRARY_DEBUG
|
FIND_LIBRARY(INVENTOR_LIBRARY_DEBUG
|
||||||
NAMES coin2d
|
NAMES coin5d coin4d coin3d coin2d coin1d
|
||||||
PATHS
|
PATHS ${COIN_PREFIX}/lib
|
||||||
/usr/local/lib
|
$ENV{COINDIR}/lib
|
||||||
/usr/lib
|
NO_DEFAULT_PATH
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
$ENV{COINDIR}/lib
|
|
||||||
)
|
)
|
||||||
IF(NOT INVENTOR_LIBRARY_DEBUG)
|
|
||||||
IF(INVENTOR_LIBRARY)
|
|
||||||
SET(INVENTOR_LIBRARY_DEBUG ${INVENTOR_LIBRARY})
|
|
||||||
ENDIF(INVENTOR_LIBRARY)
|
|
||||||
ENDIF(NOT INVENTOR_LIBRARY_DEBUG)
|
|
||||||
|
|
||||||
|
# try to find Coin debug lib (regular paths)
|
||||||
|
FIND_LIBRARY(INVENTOR_LIBRARY_DEBUG
|
||||||
|
NAMES coin5d coin4d coin3d coin2d coin1d
|
||||||
|
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||||
|
)
|
||||||
|
|
||||||
|
# set release to debug if only debug found
|
||||||
|
IF(NOT INVENTOR_LIBRARY_RELEASE AND INVENTOR_LIBRARY_DEBUG)
|
||||||
|
SET(INVENTOR_LIBRARY_RELEASE ${INVENTOR_LIBRARY_DEBUG})
|
||||||
|
ENDIF(NOT INVENTOR_LIBRARY_RELEASE AND INVENTOR_LIBRARY_DEBUG)
|
||||||
|
|
||||||
|
# set debug to release (if only release found)
|
||||||
|
IF(NOT INVENTOR_LIBRARY_DEBUG AND INVENTOR_LIBRARY_RELEASE)
|
||||||
|
SET(INVENTOR_LIBRARY_DEBUG ${INVENTOR_LIBRARY_RELEASE})
|
||||||
|
ENDIF(NOT INVENTOR_LIBRARY_DEBUG AND INVENTOR_LIBRARY_RELEASE)
|
||||||
|
|
||||||
|
# INVENTOR_LIBRARY
|
||||||
|
IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
||||||
|
SET(INVENTOR_LIBRARY
|
||||||
|
optimized ${INVENTOR_LIBRARY_RELEASE}
|
||||||
|
debug ${INVENTOR_LIBRARY_DEBUG})
|
||||||
|
ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
||||||
|
SET(INVENTOR_LIBRARY
|
||||||
|
${INVENTOR_LIBRARY_RELEASE})
|
||||||
|
ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
||||||
|
|
||||||
|
# set INVENTOR_FOUND appropriately
|
||||||
SET(INVENTOR_FOUND "NO")
|
SET(INVENTOR_FOUND "NO")
|
||||||
IF(INVENTOR_INCLUDE_DIR AND INVENTOR_LIBRARY)
|
IF(INVENTOR_INCLUDE_DIR AND INVENTOR_LIBRARY)
|
||||||
SET(INVENTOR_FOUND "YES")
|
SET(INVENTOR_FOUND "YES")
|
||||||
ENDIF(INVENTOR_INCLUDE_DIR AND INVENTOR_LIBRARY)
|
ENDIF(INVENTOR_INCLUDE_DIR AND INVENTOR_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# SoWin
|
||||||
|
#
|
||||||
|
# notes: SoWin is searched by COINDIR environment variable
|
||||||
|
# (as expected to be located at Windows platform)
|
||||||
|
|
||||||
|
# try to find SoWin lib (priority paths)
|
||||||
|
FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY
|
||||||
|
NAMES sowin1
|
||||||
|
PATHS $ENV{COINDIR}/lib
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
# try to find SoWin lib (regular paths)
|
||||||
|
FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY
|
||||||
|
NAMES sowin1
|
||||||
|
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||||
|
)
|
||||||
|
|
||||||
|
# try to find SoWin debug lib (priority paths)
|
||||||
|
FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY_DEBUG
|
||||||
|
NAMES sowin1d
|
||||||
|
PATHS $ENV{COINDIR}/lib
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
# try to find SoWin debug lib (regular paths)
|
||||||
|
FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY_DEBUG
|
||||||
|
NAMES sowin1d
|
||||||
|
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||||
|
)
|
||||||
|
|
||||||
|
# SoWin debug library defaults to non-debug lib
|
||||||
|
IF(NOT INVENTOR_SOWIN_LIBRARY_DEBUG)
|
||||||
|
IF(INVENTOR_SOWIN_LIBRARY)
|
||||||
|
SET(INVENTOR_SOWIN_LIBRARY_DEBUG INVENTOR_SOWIN_LIBRARY)
|
||||||
|
ENDIF(INVENTOR_SOWIN_LIBRARY)
|
||||||
|
ENDIF(NOT INVENTOR_SOWIN_LIBRARY_DEBUG)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# SoXt
|
||||||
|
#
|
||||||
|
# notes:
|
||||||
|
# - SoXt is detected by soxt-config script (as expected by
|
||||||
|
# Coin's SoXt on Linux/Unix) and on standard system locations
|
||||||
|
# - SGI's InventorXt support is missing now
|
||||||
|
#
|
||||||
|
|
||||||
|
# soxt-config tells much of SoXt instalation (if present)
|
||||||
|
execute_process (COMMAND soxt-config --prefix
|
||||||
|
OUTPUT_VARIABLE SOXT_PREFIX
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
# try to find SoXt lib (priority paths)
|
||||||
|
FIND_LIBRARY(INVENTOR_SOXT_LIBRARY
|
||||||
|
NAMES soxt1 SoXt
|
||||||
|
PATHS ${SOXT_PREFIX}/lib
|
||||||
|
$ENV{COINDIR}/lib
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
# try to find SoXt lib (regular paths)
|
||||||
|
FIND_LIBRARY(INVENTOR_SOXT_LIBRARY
|
||||||
|
NAMES soxt1 SoXt
|
||||||
|
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||||
|
)
|
||||||
|
|
||||||
|
# try to find SoXt debug lib (priority paths)
|
||||||
|
FIND_LIBRARY(INVENTOR_SOXT_LIBRARY_DEBUG
|
||||||
|
NAMES soxt1d
|
||||||
|
PATHS ${SOXT_PREFIX}/lib
|
||||||
|
$ENV{COINDIR}/lib
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
# try to find SoXt debug lib (regular paths)
|
||||||
|
FIND_LIBRARY(INVENTOR_SOXT_LIBRARY_DEBUG
|
||||||
|
NAMES soxt1d
|
||||||
|
PATHS ${INVENTOR_LIB_SEARCH_PATH}
|
||||||
|
)
|
||||||
|
|
||||||
|
# SoXt debug library defaults to non-debug lib
|
||||||
|
IF(NOT INVENTOR_SOXT_LIBRARY_DEBUG)
|
||||||
|
IF(INVENTOR_SOXT_LIBRARY)
|
||||||
|
SET(INVENTOR_SOXT_LIBRARY_DEBUG INVENTOR_SOXT_LIBRARY)
|
||||||
|
ENDIF(INVENTOR_SOXT_LIBRARY)
|
||||||
|
ENDIF(NOT INVENTOR_SOXT_LIBRARY_DEBUG)
|
||||||
|
|||||||
74
CMakeModules/FindLibVNCServer.cmake
Normal file
74
CMakeModules/FindLibVNCServer.cmake
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
# Locate libvncserver
|
||||||
|
# This module defines
|
||||||
|
# LIBVNCSERVER_LIBRARY
|
||||||
|
# LIBVNCSERVER_FOUND, if false, do not try to link to libvncserver
|
||||||
|
# LIBVNCSERVER_INCLUDE_DIR, where to find the headers
|
||||||
|
#
|
||||||
|
# $LIBVNCSERVER_DIR is an environment variable that would
|
||||||
|
# correspond to the ./configure --prefix=$LIBVNCSERVER_DIR
|
||||||
|
# used in building libvncserver.
|
||||||
|
|
||||||
|
FIND_PATH(LIBVNCSERVER_INCLUDE_DIR rfb/rfb.h
|
||||||
|
$ENV{LIBVNCSERVER_DIR}/include
|
||||||
|
$ENV{LIBVNCSERVER_DIR}
|
||||||
|
$ENV{OSGDIR}/include
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/include
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
/sw/include # Fink
|
||||||
|
/opt/local/include # DarwinPorts
|
||||||
|
/opt/csw/include # Blastwave
|
||||||
|
/opt/include
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||||
|
/usr/freeware/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(LIBVNCCLIENT_LIBRARY
|
||||||
|
NAMES vncclient
|
||||||
|
PATHS
|
||||||
|
$ENV{LIBVNCSERVER_DIR}/lib
|
||||||
|
$ENV{LIBVNCSERVER_DIR}
|
||||||
|
$ENV{OSGDIR}/lib
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/lib
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(LIBVNCSERVER_LIBRARY
|
||||||
|
NAMES vncserver
|
||||||
|
PATHS
|
||||||
|
$ENV{LIBVNCSERVER_DIR}/lib
|
||||||
|
$ENV{LIBVNCSERVER_DIR}
|
||||||
|
$ENV{OSGDIR}/lib
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/lib
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(LIBVNCSERVER_FOUND "NO")
|
||||||
|
IF(LIBVNCSERVER_LIBRARY AND LIBVNCSERVER_INCLUDE_DIR)
|
||||||
|
SET(LIBVNCSERVER_FOUND "YES")
|
||||||
|
ENDIF(LIBVNCSERVER_LIBRARY AND LIBVNCSERVER_INCLUDE_DIR)
|
||||||
|
|
||||||
|
|
||||||
@@ -10,37 +10,42 @@
|
|||||||
# Created by Robert Osfield.
|
# Created by Robert Osfield.
|
||||||
|
|
||||||
FIND_PATH(OSG_INCLUDE_DIR osg/Node
|
FIND_PATH(OSG_INCLUDE_DIR osg/Node
|
||||||
|
${OSG_DIR}/include
|
||||||
$ENV{OSG_DIR}/include
|
$ENV{OSG_DIR}/include
|
||||||
$ENV{OSG_DIR}
|
$ENV{OSG_DIR}
|
||||||
$ENV{OSGDIR}/include
|
$ENV{OSGDIR}/include
|
||||||
$ENV{OSGDIR}
|
$ENV{OSGDIR}
|
||||||
$ENV{OSG_ROOT}/include
|
$ENV{OSG_ROOT}/include
|
||||||
~/Library/Frameworks
|
NO_DEFAULT_PATH
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/include
|
|
||||||
/usr/include
|
|
||||||
/sw/include # Fink
|
|
||||||
/opt/local/include # DarwinPorts
|
|
||||||
/opt/csw/include # Blastwave
|
|
||||||
/opt/include
|
|
||||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
|
||||||
/usr/freeware/include
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
FIND_PATH(OSG_INCLUDE_DIR osg/Node)
|
||||||
|
|
||||||
MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||||
|
|
||||||
FIND_LIBRARY(${MYLIBRARY}
|
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
|
||||||
NAMES ${MYLIBRARYNAME}
|
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
|
||||||
PATHS
|
PATHS
|
||||||
|
${OSG_DIR}/lib/Debug
|
||||||
|
${OSG_DIR}/lib
|
||||||
|
$ENV{OSG_DIR}/lib/debug
|
||||||
$ENV{OSG_DIR}/lib
|
$ENV{OSG_DIR}/lib
|
||||||
$ENV{OSG_DIR}
|
$ENV{OSG_DIR}
|
||||||
$ENV{OSGDIR}/lib
|
$ENV{OSGDIR}/lib
|
||||||
$ENV{OSGDIR}
|
$ENV{OSGDIR}
|
||||||
$ENV{OSG_ROOT}/lib
|
$ENV{OSG_ROOT}/lib
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
|
||||||
|
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
|
||||||
|
PATHS
|
||||||
~/Library/Frameworks
|
~/Library/Frameworks
|
||||||
/Library/Frameworks
|
/Library/Frameworks
|
||||||
/usr/local/lib
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
/usr/lib
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
/sw/lib
|
/sw/lib
|
||||||
/opt/local/lib
|
/opt/local/lib
|
||||||
/opt/csw/lib
|
/opt/csw/lib
|
||||||
@@ -48,16 +53,57 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
|||||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||||
/usr/freeware/lib64
|
/usr/freeware/lib64
|
||||||
)
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(${MYLIBRARY}
|
||||||
|
NAMES ${MYLIBRARYNAME}
|
||||||
|
PATHS
|
||||||
|
${OSG_DIR}/lib/Release
|
||||||
|
${OSG_DIR}/lib
|
||||||
|
$ENV{OSG_DIR}/lib/Release
|
||||||
|
$ENV{OSG_DIR}/lib
|
||||||
|
$ENV{OSG_DIR}
|
||||||
|
$ENV{OSGDIR}/lib
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/lib
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(${MYLIBRARY}
|
||||||
|
NAMES ${MYLIBRARYNAME}
|
||||||
|
PATHS
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
IF( NOT ${MYLIBRARY}_DEBUG)
|
||||||
|
IF(MYLIBRARY)
|
||||||
|
SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
|
||||||
|
ENDIF(MYLIBRARY)
|
||||||
|
ENDIF( NOT ${MYLIBRARY}_DEBUG)
|
||||||
|
|
||||||
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
|
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
|
||||||
|
|
||||||
FIND_OSG_LIBRARY(OSG_LIBRARY osg)
|
FIND_OSG_LIBRARY(OSG_LIBRARY osg)
|
||||||
|
FIND_OSG_LIBRARY(OSGGA_LIBRARY osgGA)
|
||||||
FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
|
FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
|
||||||
FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
|
FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
|
||||||
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
|
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
|
||||||
|
FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
|
||||||
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
|
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
|
||||||
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
|
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
|
||||||
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
|
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
|
||||||
|
FIND_OSG_LIBRARY(OSGVOLUME_LIBRARY osgVolume)
|
||||||
|
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
|
||||||
|
|
||||||
SET(OSG_FOUND "NO")
|
SET(OSG_FOUND "NO")
|
||||||
IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
|
IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
|
||||||
|
|||||||
77
CMakeModules/FindOpenEXR.cmake
Normal file
77
CMakeModules/FindOpenEXR.cmake
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# Locate OpenEXR
|
||||||
|
# This module defines
|
||||||
|
# OPENEXR_LIBRARY
|
||||||
|
# OPENEXR_FOUND, if false, do not try to link to OpenEXR
|
||||||
|
# OPENEXR_INCLUDE_DIR, where to find the headers
|
||||||
|
#
|
||||||
|
# $OPENEXR_DIR is an environment variable that would
|
||||||
|
# correspond to the ./configure --prefix=$OPENEXR_DIR
|
||||||
|
#
|
||||||
|
# Created by Robert Osfield.
|
||||||
|
|
||||||
|
FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
|
||||||
|
$ENV{OPENEXR_DIR}/include
|
||||||
|
$ENV{OPENEXR_DIR}
|
||||||
|
$ENV{OSGDIR}/include
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/include
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
/sw/include # Fink
|
||||||
|
/opt/local/include # DarwinPorts
|
||||||
|
/opt/csw/include # Blastwave
|
||||||
|
/opt/include
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||||
|
/usr/freeware/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(OPENEXR_IlmIlf_LIBRARY
|
||||||
|
NAMES IlmImf
|
||||||
|
PATHS
|
||||||
|
$ENV{OPENEXR_DIR}/lib
|
||||||
|
$ENV{OPENEXR_DIR}
|
||||||
|
$ENV{OSGDIR}/lib
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/lib
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(OPENEXR_Half_LIBRARY
|
||||||
|
NAMES Half
|
||||||
|
PATHS
|
||||||
|
$ENV{OPENEXR_DIR}/lib
|
||||||
|
$ENV{OPENEXR_DIR}
|
||||||
|
$ENV{OSGDIR}/lib
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/lib
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(OPENEXR_FOUND "NO")
|
||||||
|
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_Half_LIBRARY)
|
||||||
|
SET(OPENEXR_LIBRARIES
|
||||||
|
${OPENEXR_IlmIlf_LIBRARY}
|
||||||
|
${OPENEXR_Half_LIBRARY}
|
||||||
|
)
|
||||||
|
SET(OPENEXR_FOUND "YES")
|
||||||
|
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_Half_LIBRARY)
|
||||||
180
CMakeModules/FindOurDCMTK.cmake
Normal file
180
CMakeModules/FindOurDCMTK.cmake
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
# - find DCMTK libraries
|
||||||
|
#
|
||||||
|
|
||||||
|
# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK
|
||||||
|
# DCMTK_LIBRARIES - Files to link against to use DCMTK
|
||||||
|
# DCMTK_FOUND - If false, don't try to use DCMTK
|
||||||
|
# DCMTK_DIR - (optional) Source directory for DCMTK
|
||||||
|
#
|
||||||
|
# DCMTK_DIR can be used to make it simpler to find the various include
|
||||||
|
# directories and compiled libraries if you've just compiled it in the
|
||||||
|
# source tree. Just set it to the root of the tree where you extracted
|
||||||
|
# the source.
|
||||||
|
#
|
||||||
|
# Written for VXL by Amitha Perera.
|
||||||
|
# Modified by Robert Osfied to enable support for install placements of DCMTK 3.5.4 versions onwards
|
||||||
|
|
||||||
|
FIND_PATH( DCMTK_ROOT_INCLUDE_DIR dcmtk/config/osconfig.h
|
||||||
|
${DCMTK_DIR}/config/include
|
||||||
|
${DCMTK_DIR}/include
|
||||||
|
/usr/local/include/
|
||||||
|
/usr/include/
|
||||||
|
/usr/local/dicom/include/
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
|
||||||
|
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/config
|
||||||
|
${DCMTK_DIR}/config/include
|
||||||
|
${DCMTK_DIR}/include
|
||||||
|
/usr/local/include/dcmtk/config
|
||||||
|
/usr/include/dcmtk/config
|
||||||
|
/usr/local/dicom/include/dcmtk/config
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
|
||||||
|
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/ofstd
|
||||||
|
${DCMTK_DIR}/ofstd/include
|
||||||
|
${DCMTK_DIR}/include/ofstd
|
||||||
|
/usr/local/include/dcmtk/ofstd
|
||||||
|
/usr/include/dcmtk/ofstd
|
||||||
|
/usr/local/dicom/include/dcmtk/ofstd
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
|
||||||
|
${DCMTK_DIR}/ofstd/libsrc
|
||||||
|
${DCMTK_DIR}/ofstd/libsrc/Release
|
||||||
|
${DCMTK_DIR}/ofstd/libsrc/Debug
|
||||||
|
${DCMTK_DIR}/ofstd/Release
|
||||||
|
${DCMTK_DIR}/ofstd/Debug
|
||||||
|
${DCMTK_DIR}/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/dicom/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
|
||||||
|
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmdata
|
||||||
|
${DCMTK_DIR}/dcmdata/include
|
||||||
|
${DCMTK_DIR}/include/dcmdata
|
||||||
|
/usr/local/include/dcmtk/dcmdata
|
||||||
|
/usr/include/dcmtk/dcmdata
|
||||||
|
/usr/local/dicom/include/dcmtk/dcmdata
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
|
||||||
|
${DCMTK_DIR}/dcmdata/libsrc
|
||||||
|
${DCMTK_DIR}/dcmdata/libsrc/Release
|
||||||
|
${DCMTK_DIR}/dcmdata/libsrc/Debug
|
||||||
|
${DCMTK_DIR}/dcmdata/Release
|
||||||
|
${DCMTK_DIR}/dcmdata/Debug
|
||||||
|
${DCMTK_DIR}/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/dicom/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
|
||||||
|
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimgle
|
||||||
|
${DCMTK_DIR}/dcmimgle/include
|
||||||
|
${DCMTK_DIR}/include/dcmimgle
|
||||||
|
/usr/local/include/dcmtk/dcmimgle
|
||||||
|
/usr/include/dcmtk/dcmimgle
|
||||||
|
/usr/local/dicom/include/dcmtk/dcmimgle
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
|
||||||
|
${DCMTK_DIR}/dcmimgle/libsrc
|
||||||
|
${DCMTK_DIR}/dcmimgle/libsrc/Release
|
||||||
|
${DCMTK_DIR}/dcmimgle/libsrc/Debug
|
||||||
|
${DCMTK_DIR}/dcmimgle/Release
|
||||||
|
${DCMTK_DIR}/dcmimgle/Debug
|
||||||
|
${DCMTK_DIR}/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/dicom/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
|
||||||
|
${DCMTK_DIR}/imagectn/libsrc/Release
|
||||||
|
${DCMTK_DIR}/imagectn/libsrc/
|
||||||
|
${DCMTK_DIR}/imagectn/libsrc/Debug
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/dicom/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
|
||||||
|
${DCMTK_DIR}/dcmnet/libsrc/Release
|
||||||
|
${DCMTK_DIR}/dcmnet/libsrc/Debug
|
||||||
|
${DCMTK_DIR}/dcmnet/libsrc/
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/dicom/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
IF( DCMTK_config_INCLUDE_DIR
|
||||||
|
AND DCMTK_ofstd_INCLUDE_DIR
|
||||||
|
AND DCMTK_ofstd_LIBRARY
|
||||||
|
AND DCMTK_dcmdata_INCLUDE_DIR
|
||||||
|
AND DCMTK_dcmdata_LIBRARY
|
||||||
|
AND DCMTK_dcmimgle_INCLUDE_DIR
|
||||||
|
AND DCMTK_dcmimgle_LIBRARY )
|
||||||
|
|
||||||
|
SET( DCMTK_FOUND "YES" )
|
||||||
|
SET( DCMTK_INCLUDE_DIRS
|
||||||
|
${DCMTK_config_INCLUDE_DIR}
|
||||||
|
${DCMTK_ofstd_INCLUDE_DIR}
|
||||||
|
${DCMTK_dcmdata_INCLUDE_DIR}
|
||||||
|
${DCMTK_dcmimgle_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
SET( DCMTK_LIBRARIES
|
||||||
|
${DCMTK_dcmimgle_LIBRARY}
|
||||||
|
${DCMTK_dcmdata_LIBRARY}
|
||||||
|
${DCMTK_ofstd_LIBRARY}
|
||||||
|
${DCMTK_config_LIBRARY}
|
||||||
|
)
|
||||||
|
|
||||||
|
IF(DCMTK_imagedb_LIBRARY)
|
||||||
|
SET( DCMTK_LIBRARIES
|
||||||
|
${DCMTK_LIBRARIES}
|
||||||
|
${DCMTK_imagedb_LIBRARY}
|
||||||
|
)
|
||||||
|
ENDIF(DCMTK_imagedb_LIBRARY)
|
||||||
|
|
||||||
|
IF(DCMTK_dcmnet_LIBRARY)
|
||||||
|
SET( DCMTK_LIBRARIES
|
||||||
|
${DCMTK_LIBRARIES}
|
||||||
|
${DCMTK_dcmnet_LIBRARY}
|
||||||
|
)
|
||||||
|
ENDIF(DCMTK_dcmnet_LIBRARY)
|
||||||
|
|
||||||
|
IF( WIN32 )
|
||||||
|
SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
|
||||||
|
ENDIF( WIN32 )
|
||||||
|
|
||||||
|
ENDIF( DCMTK_config_INCLUDE_DIR
|
||||||
|
AND DCMTK_ofstd_INCLUDE_DIR
|
||||||
|
AND DCMTK_ofstd_LIBRARY
|
||||||
|
AND DCMTK_dcmdata_INCLUDE_DIR
|
||||||
|
AND DCMTK_dcmdata_LIBRARY
|
||||||
|
AND DCMTK_dcmimgle_INCLUDE_DIR
|
||||||
|
AND DCMTK_dcmimgle_LIBRARY )
|
||||||
|
|
||||||
|
IF( NOT DCMTK_FOUND )
|
||||||
|
SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." )
|
||||||
|
MARK_AS_ADVANCED( DCMTK_DIR )
|
||||||
|
ENDIF( NOT DCMTK_FOUND )
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
FIND_PATH(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h)
|
FIND_PATH(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h)
|
||||||
FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime)
|
FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime)
|
||||||
ELSE(APPLE)
|
ELSE()
|
||||||
FIND_PATH(QUICKTIME_INCLUDE_DIR QuickTime.h
|
FIND_PATH(QUICKTIME_INCLUDE_DIR QuickTime.h
|
||||||
$ENV{QUICKTIME_DIR}/include
|
$ENV{QUICKTIME_DIR}/include
|
||||||
$ENV{QUICKTIME_DIR}
|
$ENV{QUICKTIME_DIR}
|
||||||
@@ -39,11 +39,24 @@ ELSE(APPLE)
|
|||||||
PATH_SUFFIXES lib64 lib
|
PATH_SUFFIXES lib64 lib
|
||||||
)
|
)
|
||||||
FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime)
|
FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime)
|
||||||
ENDIF(APPLE)
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
SET(QUICKTIME_FOUND "NO")
|
SET(QUICKTIME_FOUND "NO")
|
||||||
IF(QUICKTIME_LIBRARY AND QUICKTIME_INCLUDE_DIR)
|
IF(QUICKTIME_LIBRARY AND QUICKTIME_INCLUDE_DIR)
|
||||||
SET(QUICKTIME_FOUND "YES")
|
SET(QUICKTIME_FOUND "YES")
|
||||||
ENDIF(QUICKTIME_LIBRARY AND QUICKTIME_INCLUDE_DIR)
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
IF(APPLE)
|
||||||
|
#Quicktime is not supported under 64bit OSX build so we need to detect it and disable it.
|
||||||
|
#First check to see if we are running with a native 64-bit compiler (10.6 default) and implicit arch
|
||||||
|
IF(NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
SET(QUICKTIME_FOUND "NO")
|
||||||
|
ELSE()
|
||||||
|
#Otherwise check to see if 64-bit is explicitly called for.
|
||||||
|
LIST(FIND CMAKE_OSX_ARCHITECTURES "x86_64" has64Compile)
|
||||||
|
IF(NOT has64Compile EQUAL -1)
|
||||||
|
SET(QUICKTIME_FOUND "NO")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|||||||
235
CMakeModules/FindXUL.cmake
Normal file
235
CMakeModules/FindXUL.cmake
Normal file
@@ -0,0 +1,235 @@
|
|||||||
|
# Locate XUL
|
||||||
|
# This module defines
|
||||||
|
# XUL_LIBRARIES
|
||||||
|
# XUL_FOUND, if false, do not try to link to gdal
|
||||||
|
# XUL_INCLUDE_DIR, where to find the headers
|
||||||
|
#
|
||||||
|
# $XUL_DIR is an environment variable that would
|
||||||
|
# correspond to the ./configure --prefix=$XUL_DIR
|
||||||
|
#
|
||||||
|
# Created by Robert Osfield.
|
||||||
|
|
||||||
|
#use pkg-config to find various modues
|
||||||
|
INCLUDE(FindPkgConfig OPTIONAL)
|
||||||
|
|
||||||
|
IF(PKG_CONFIG_FOUND)
|
||||||
|
|
||||||
|
INCLUDE(FindPkgConfig)
|
||||||
|
|
||||||
|
pkg_check_modules(XULRUNNER_XPCOM xulrunner-xpcom<=1.8.9)
|
||||||
|
pkg_check_modules(XULRUNNER_JS xulrunner-js)
|
||||||
|
pkg_check_modules(XULRUNNER_NSPR xulrunner-nspr)
|
||||||
|
pkg_check_modules(XULRUNNER_NSS xulrunner-nss)
|
||||||
|
|
||||||
|
ENDIF(PKG_CONFIG_FOUND)
|
||||||
|
|
||||||
|
# Added check to make sure that nsIBaseWindow.h is available, as it's not a standard part the of 1.8.x SDK
|
||||||
|
FIND_PATH(NSIBASEWINDOW_INCLUDE_DIR widget/nsIBaseWindow.h
|
||||||
|
PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
|
||||||
|
$ENV{OSG_DIR}/include/xulrunner
|
||||||
|
$ENV{OSG_DIR}/include
|
||||||
|
$ENV{OSG_DIR}/xulrunner
|
||||||
|
$ENV{OSG_DIR}
|
||||||
|
$ENV{OSGDIR}/include/xulrunner
|
||||||
|
$ENV{OSGDIR}/include
|
||||||
|
$ENV{OSGDIR}/xulrunner
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/include/xulrunner
|
||||||
|
$ENV{OSG_ROOT}/include
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/include/xulrunner
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include/xulrunner
|
||||||
|
/usr/include
|
||||||
|
/sw/include/xulrunner # Fink
|
||||||
|
/sw/include # Fink
|
||||||
|
/opt/local/include/xulrunner # DarwinPorts
|
||||||
|
/opt/local/include # DarwinPorts
|
||||||
|
/opt/csw/include/xulrunner # Blastwave
|
||||||
|
/opt/csw/include # Blastwave
|
||||||
|
/opt/include/xulrunner
|
||||||
|
/opt/include
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/xulrunner
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||||
|
/usr/freeware/include/xulrunner
|
||||||
|
/usr/freeware/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_PATH(XUL_INCLUDE_DIR nsEmbedAPI.h
|
||||||
|
PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
|
||||||
|
$ENV{OSG_DIR}/include/xulrunner
|
||||||
|
$ENV{OSG_DIR}/include
|
||||||
|
$ENV{OSG_DIR}/xulrunner
|
||||||
|
$ENV{OSG_DIR}
|
||||||
|
$ENV{OSGDIR}/include/xulrunner
|
||||||
|
$ENV{OSGDIR}/include
|
||||||
|
$ENV{OSGDIR}/xulrunner
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/include/xulrunner
|
||||||
|
$ENV{OSG_ROOT}/include
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/include/xulrunner
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include/xulrunner
|
||||||
|
/usr/include
|
||||||
|
/sw/include/xulrunner # Fink
|
||||||
|
/sw/include # Fink
|
||||||
|
/opt/local/include/xulrunner # DarwinPorts
|
||||||
|
/opt/local/include # DarwinPorts
|
||||||
|
/opt/csw/include/xulrunner # Blastwave
|
||||||
|
/opt/csw/include # Blastwave
|
||||||
|
/opt/include/xulrunner
|
||||||
|
/opt/include
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/xulrunner
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||||
|
/usr/freeware/include/xulrunner
|
||||||
|
/usr/freeware/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_PATH(NSPR_INCLUDE_DIR prtypes.h
|
||||||
|
PATHS ${XULRUNNER_NSPR_INCLUDE_DIRS}
|
||||||
|
$ENV{OSG_DIR}/include/nspr
|
||||||
|
$ENV{OSG_DIR}/include
|
||||||
|
$ENV{OSG_DIR}/nspr
|
||||||
|
$ENV{OSG_DIR}
|
||||||
|
$ENV{OSGDIR}/include/nspr
|
||||||
|
$ENV{OSGDIR}/include
|
||||||
|
$ENV{OSGDIR}/nspr
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/include/nspr
|
||||||
|
$ENV{OSG_ROOT}/include
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/include/nspr
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include/nspr
|
||||||
|
/usr/include
|
||||||
|
/sw/include/nspr # Fink
|
||||||
|
/sw/include # Fink
|
||||||
|
/opt/local/include/nspr # DarwinPorts
|
||||||
|
/opt/local/include # DarwinPorts
|
||||||
|
/opt/csw/include/nspr # Blastwave
|
||||||
|
/opt/csw/include # Blastwave
|
||||||
|
/opt/include/nspr
|
||||||
|
/opt/include
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/nspr
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||||
|
/usr/freeware/include/nspr
|
||||||
|
/usr/freeware/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_PATH(MOZJS_INCLUDE_DIR jsapi.h
|
||||||
|
PATHS ${XULRUNNER_JS_INCLUDE_DIRS}
|
||||||
|
$ENV{OSG_DIR}/include/mozjs
|
||||||
|
$ENV{OSG_DIR}/include
|
||||||
|
$ENV{OSG_DIR}/mozjs
|
||||||
|
$ENV{OSG_DIR}
|
||||||
|
$ENV{OSGDIR}/include/mozjs
|
||||||
|
$ENV{OSGDIR}/include
|
||||||
|
$ENV{OSGDIR}/mozjs
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/include/mozjs
|
||||||
|
$ENV{OSG_ROOT}/include
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/include/mozjs
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include/mozjs
|
||||||
|
/usr/include
|
||||||
|
/sw/include/mozjs # Fink
|
||||||
|
/sw/include # Fink
|
||||||
|
/opt/local/include/mozjs # DarwinPorts
|
||||||
|
/opt/local/include # DarwinPorts
|
||||||
|
/opt/csw/include/mozjs # Blastwave
|
||||||
|
/opt/csw/include # Blastwave
|
||||||
|
/opt/include/mozjs
|
||||||
|
/opt/include
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/mozjs
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
|
||||||
|
/usr/freeware/include/mozjs
|
||||||
|
/usr/freeware/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_PATH(XUL_DIR
|
||||||
|
NAMES components/appshell.xpt
|
||||||
|
PATHS
|
||||||
|
$ENV{OSG_DIR}/lib
|
||||||
|
$ENV{OSG_DIR}
|
||||||
|
$ENV{OSGDIR}/lib
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/lib
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib/xulrunner
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib/xulrunner
|
||||||
|
/usr/lib
|
||||||
|
/sw/lib/xulrunner
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib/xulrunner
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib/xulrunner
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib/xulrunner
|
||||||
|
/opt/lib
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||||
|
/usr/freeware/lib64/xulrunner
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
MACRO(FIND_XUL_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||||
|
|
||||||
|
FIND_LIBRARY(${MYLIBRARY}
|
||||||
|
PATHS ${XULRUNNER_XPCOM_LIBRARY_DIRS}
|
||||||
|
PATHS ${XULRUNNER_JS_LIBRARY_DIRS}
|
||||||
|
PATHS ${XULRUNNER_NSPR_LIBRARY_DIRS}
|
||||||
|
PATHS ${XULRUNNER_NSS_LIBRARY_DIRS}
|
||||||
|
NAMES ${MYLIBRARYNAME}
|
||||||
|
PATHS
|
||||||
|
$ENV{OSG_DIR}/lib
|
||||||
|
$ENV{OSG_DIR}
|
||||||
|
$ENV{OSGDIR}/lib
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}/lib
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib/xulrunner
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib/xulrunner
|
||||||
|
/usr/lib
|
||||||
|
/sw/lib/xulrunner
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib/xulrunner
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib/xulrunner
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib/xulrunner
|
||||||
|
/opt/lib
|
||||||
|
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||||
|
/usr/freeware/lib64/xulrunner
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
ENDMACRO(FIND_XUL_LIBRARY LIBRARY LIBRARYNAME)
|
||||||
|
|
||||||
|
|
||||||
|
FIND_XUL_LIBRARY(XUL_LIBRARY xul plds4 plc4 nspr4)
|
||||||
|
FIND_XUL_LIBRARY(XUL_MOZJS_LIBRARY mozjs)
|
||||||
|
FIND_XUL_LIBRARY(XUL_XPCOM_LIBRARY xpcom)
|
||||||
|
FIND_XUL_LIBRARY(XUL_PLUGIN_LIBRARY plds4)
|
||||||
|
FIND_XUL_LIBRARY(XUL_NSS_LIBRARY nss3)
|
||||||
|
|
||||||
|
|
||||||
|
SET(XUL_FOUND "NO")
|
||||||
|
IF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)
|
||||||
|
|
||||||
|
SET(XUL_FOUND "YES")
|
||||||
|
SET(XUL_LIBRARIES ${XUL_LIBRARY} ${XUL_MOZJS_LIBRARY} ${XUL_XPCOM_LIBRARY} ${XUL_PLUGIN_LIBRARY} ${XUL_NSS_LIBRARY})
|
||||||
|
SET(XUL_INCLUDE_DIRS ${XUL_INCLUDE_DIR} ${NSPR_INCLUDE_DIR} ${MOZJS_INCLUDE_DIR})
|
||||||
|
|
||||||
|
ENDIF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)
|
||||||
|
|
||||||
|
# MESSAGE("XUL_INCLUDE_DIR " ${XUL_INCLUDE_DIR})
|
||||||
|
# MESSAGE("XUL_LIBRARIES " ${XUL_LIBRARIES})
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
# Locate gdal
|
# Locate zlib
|
||||||
# This module defines
|
# This module defines
|
||||||
# ZLIB_LIBRARY
|
# ZLIB_LIBRARY
|
||||||
# ZLIB_FOUND, if false, do not try to link to gdal
|
# ZLIB_FOUND, if false, do not try to link to zlib
|
||||||
# ZLIB_INCLUDE_DIR, where to find the headers
|
# ZLIB_INCLUDE_DIR, where to find the headers
|
||||||
#
|
#
|
||||||
# $ZLIB_DIR is an environment variable that would
|
# $ZLIB_DIR is an environment variable that would
|
||||||
# correspond to the ./configure --prefix=$ZLIB_DIR
|
# correspond to the ./configure --prefix=$ZLIB_DIR
|
||||||
# used in building gdal.
|
# used in building zlib.
|
||||||
#
|
#
|
||||||
# Created by Ulrich Hertlein.
|
# Created by Ulrich Hertlein.
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
|
|||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(ZLIB_LIBRARY
|
FIND_LIBRARY(ZLIB_LIBRARY
|
||||||
NAMES z libz
|
NAMES z libz zlib
|
||||||
PATHS
|
PATHS
|
||||||
$ENV{ZLIB_DIR}/lib
|
$ENV{ZLIB_DIR}/lib
|
||||||
$ENV{ZLIB_DIR}
|
$ENV{ZLIB_DIR}
|
||||||
|
|||||||
@@ -22,17 +22,19 @@ SOURCE_GROUP(
|
|||||||
)
|
)
|
||||||
|
|
||||||
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||||
HANDLE_MSVC_DLL()
|
HANDLE_MSVC_DLL()
|
||||||
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||||
|
|
||||||
INSTALL(
|
INSTALL(
|
||||||
TARGETS ${LIB_NAME}
|
TARGETS ${LIB_NAME}
|
||||||
RUNTIME DESTINATION ${INSTALL_BINDIR}
|
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
|
||||||
LIBRARY DESTINATION ${INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT libopenscenegraph
|
||||||
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR}
|
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
|
||||||
)
|
)
|
||||||
|
|
||||||
# FIXME: Do not run for OS X framework
|
# FIXME: Do not run for OS X framework
|
||||||
INSTALL(
|
INSTALL(
|
||||||
FILES ${LIB_PUBLIC_HEADERS}
|
FILES ${LIB_PUBLIC_HEADERS}
|
||||||
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}
|
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}
|
||||||
|
COMPONENT libopenscenegraph-dev
|
||||||
)
|
)
|
||||||
|
|||||||
144
CMakeModules/OsgCPack.cmake
Normal file
144
CMakeModules/OsgCPack.cmake
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
# This script sets up packaging targets for each "COMPONENT" as specified in INSTALL commands
|
||||||
|
#
|
||||||
|
# for each component a CPackConfig-<component>.cmake is generated in the build tree
|
||||||
|
# and a target is added to call cpack for it (e.g. package_openscenegaph
|
||||||
|
# A target for generating a package with everything that gets INSTALLED is generated (package_openscenegraph-all)
|
||||||
|
# A target for making all of the abaove packages is generated (package_ALL)
|
||||||
|
#
|
||||||
|
# package filenames are created on the form <package>-<platform>-<arch>[-<compiler>]-<build_type>[-static].tar.gz
|
||||||
|
# ...where compiler optionally set using a cmake gui (OSG_CPACK_COMPILER). This script tries to guess compiler version for msvc generators
|
||||||
|
# ...build_type matches CMAKE_BUILD_TYPE for all generators but the msvc ones
|
||||||
|
|
||||||
|
# resolve architecture. The reason i "change" i686 to i386 is that debian packages
|
||||||
|
# require i386 so this is for the future
|
||||||
|
IF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
|
||||||
|
SET(SYSTEM_ARCH "i386")
|
||||||
|
ELSE()
|
||||||
|
SET(SYSTEM_ARCH ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# set a default system name - use CMake setting (Linux|Windows|...)
|
||||||
|
SET(SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
|
||||||
|
#message(STATUS "CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}")
|
||||||
|
#message(STATUS "CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
|
|
||||||
|
# for msvc the SYSTEM_NAME is set win32/64 instead of "Windows"
|
||||||
|
IF(MSVC)
|
||||||
|
IF(CMAKE_CL_64)
|
||||||
|
SET(SYSTEM_NAME "win64")
|
||||||
|
ELSE()
|
||||||
|
SET(SYSTEM_NAME "win32")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
# Guess the compiler (is this desired for other platforms than windows?)
|
||||||
|
IF(NOT DEFINED OSG_CPACK_COMPILER)
|
||||||
|
INCLUDE(OsgDetermineCompiler)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# expose the compiler setting to the user
|
||||||
|
SET(OSG_CPACK_COMPILER "${OSG_COMPILER}" CACHE STRING "This ia short string (vc90, vc80sp1, gcc-4.3, ...) describing your compiler. The string is used for creating package filenames")
|
||||||
|
|
||||||
|
IF(OSG_CPACK_COMPILER)
|
||||||
|
SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH}-${OSG_CPACK_COMPILER})
|
||||||
|
ELSE()
|
||||||
|
SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
## variables that apply to all packages
|
||||||
|
SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${OPENSCENEGRAPH_VERSION}")
|
||||||
|
|
||||||
|
# these goes for all platforms. Setting these stops the CPack.cmake script from generating options about other package compression formats (.z .tz, etc.)
|
||||||
|
IF(WIN32)
|
||||||
|
SET(CPACK_GENERATOR "ZIP")
|
||||||
|
ELSE()
|
||||||
|
SET(CPACK_GENERATOR "TGZ")
|
||||||
|
ENDIF()
|
||||||
|
SET(CPACK_SOURCE_GENERATOR "TGZ")
|
||||||
|
|
||||||
|
|
||||||
|
# for ms visual studio we use it's internally defined variable to get the configuration (debug,release, ...)
|
||||||
|
IF(MSVC_IDE)
|
||||||
|
SET(OSG_CPACK_CONFIGURATION "$(OutDir)")
|
||||||
|
SET(PACKAGE_TARGET_PREFIX "Package ")
|
||||||
|
ELSE()
|
||||||
|
# on un*x an empty CMAKE_BUILD_TYPE means release
|
||||||
|
IF(CMAKE_BUILD_TYPE)
|
||||||
|
SET(OSG_CPACK_CONFIGURATION ${CMAKE_BUILD_TYPE})
|
||||||
|
ELSE()
|
||||||
|
SET(OSG_CPACK_CONFIGURATION "Release")
|
||||||
|
ENDIF()
|
||||||
|
SET(PACKAGE_TARGET_PREFIX "package_")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Get all defined components
|
||||||
|
GET_CMAKE_PROPERTY(CPACK_COMPONENTS_ALL COMPONENTS)
|
||||||
|
IF(NOT CPACK_COMPONENTS_ALL)
|
||||||
|
# cmake 2.6.0 don't supply the COMPONENTS property.
|
||||||
|
# I set it manually to be the packages that can always be packaged
|
||||||
|
MESSAGE("When building packages please consider using cmake version 2.6.1 or above")
|
||||||
|
SET(CPACK_COMPONENTS_ALL libopenscenegraph libopenthreads openscenegraph libopenscenegraph-dev libopenthreads-dev)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Create a target that will be used to generate all packages defined below
|
||||||
|
SET(PACKAGE_ALL_TARGETNAME "${PACKAGE_TARGET_PREFIX}ALL")
|
||||||
|
ADD_CUSTOM_TARGET(${PACKAGE_ALL_TARGETNAME})
|
||||||
|
|
||||||
|
MACRO(GENERATE_PACKAGING_TARGET package_name)
|
||||||
|
SET(CPACK_PACKAGE_NAME ${package_name})
|
||||||
|
|
||||||
|
# the doc packages don't need a system-arch specification
|
||||||
|
IF(${package} MATCHES -doc)
|
||||||
|
SET(OSG_PACKAGE_FILE_NAME ${package_name}-${OPENSCENEGRAPH_VERSION})
|
||||||
|
ELSE()
|
||||||
|
SET(OSG_PACKAGE_FILE_NAME ${package_name}-${OPENSCENEGRAPH_VERSION}-${OSG_CPACK_SYSTEM_SPEC_STRING}-${OSG_CPACK_CONFIGURATION})
|
||||||
|
IF(NOT DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
SET(OSG_PACKAGE_FILE_NAME ${OSG_PACKAGE_FILE_NAME}-static)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
CONFIGURE_FILE("${OpenSceneGraph_SOURCE_DIR}/CMakeModules/OsgCPackConfig.cmake.in" "${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake" IMMEDIATE)
|
||||||
|
|
||||||
|
SET(PACKAGE_TARGETNAME "${PACKAGE_TARGET_PREFIX}${package_name}")
|
||||||
|
|
||||||
|
# This is naive and will probably need fixing eventually
|
||||||
|
IF(MSVC)
|
||||||
|
SET(MOVE_COMMAND "move")
|
||||||
|
ELSE()
|
||||||
|
SET(MOVE_COMMAND "mv")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Set in and out archive filenames. Windows = zip, others = tar.gz
|
||||||
|
IF(WIN32)
|
||||||
|
SET(ARCHIVE_EXT "zip")
|
||||||
|
ELSE()
|
||||||
|
SET(ARCHIVE_EXT "tar.gz")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Create a target that creates the current package
|
||||||
|
# and rename the package to give it proper filename
|
||||||
|
ADD_CUSTOM_TARGET(${PACKAGE_TARGETNAME})
|
||||||
|
ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_TARGETNAME}
|
||||||
|
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
|
||||||
|
COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
|
||||||
|
COMMENT "Run CPack packaging for ${package_name}..."
|
||||||
|
)
|
||||||
|
# Add the exact same custom command to the all package generating target.
|
||||||
|
# I can't use add_dependencies to do this because it would allow parallell building of packages so am going brute here
|
||||||
|
ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_ALL_TARGETNAME}
|
||||||
|
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
|
||||||
|
COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
|
||||||
|
)
|
||||||
|
ENDMACRO(GENERATE_PACKAGING_TARGET)
|
||||||
|
|
||||||
|
# Create configs and targets for a package including all components
|
||||||
|
SET(OSG_CPACK_COMPONENT ALL)
|
||||||
|
GENERATE_PACKAGING_TARGET(openscenegraph-all)
|
||||||
|
|
||||||
|
# Create configs and targets for each component
|
||||||
|
FOREACH(package ${CPACK_COMPONENTS_ALL})
|
||||||
|
SET(OSG_CPACK_COMPONENT ${package})
|
||||||
|
GENERATE_PACKAGING_TARGET(${package})
|
||||||
|
ENDFOREACH()
|
||||||
71
CMakeModules/OsgCPackConfig.cmake.in
Normal file
71
CMakeModules/OsgCPackConfig.cmake.in
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
# This file will be configured to contain variables for CPack. These variables
|
||||||
|
# should be set in the CMake list file of the project before CPack module is
|
||||||
|
# included. Example variables are:
|
||||||
|
# CPACK_GENERATOR - Generator used to create package
|
||||||
|
# CPACK_INSTALL_CMAKE_PROJECTS - For each project (path, name, component)
|
||||||
|
# CPACK_CMAKE_GENERATOR - CMake Generator used for the projects
|
||||||
|
# CPACK_INSTALL_COMMANDS - Extra commands to install components
|
||||||
|
# CPACK_INSTALL_DIRECTORIES - Extra directories to install
|
||||||
|
# CPACK_PACKAGE_DESCRIPTION_FILE - Description file for the package
|
||||||
|
# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Summary of the package
|
||||||
|
# CPACK_PACKAGE_EXECUTABLES - List of pairs of executables and labels
|
||||||
|
# CPACK_PACKAGE_FILE_NAME - Name of the package generated
|
||||||
|
# CPACK_PACKAGE_ICON - Icon used for the package
|
||||||
|
# CPACK_PACKAGE_INSTALL_DIRECTORY - Name of directory for the installer
|
||||||
|
# CPACK_PACKAGE_NAME - Package project name
|
||||||
|
# CPACK_PACKAGE_VENDOR - Package project vendor
|
||||||
|
# CPACK_PACKAGE_VERSION - Package project version
|
||||||
|
# CPACK_PACKAGE_VERSION_MAJOR - Package project version (major)
|
||||||
|
# CPACK_PACKAGE_VERSION_MINOR - Package project version (minor)
|
||||||
|
# CPACK_PACKAGE_VERSION_PATCH - Package project version (patch)
|
||||||
|
|
||||||
|
# There are certain generator specific ones
|
||||||
|
|
||||||
|
# NSIS Generator:
|
||||||
|
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Name of the registry key for the installer
|
||||||
|
# CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra commands used during uninstall
|
||||||
|
# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra commands used during install
|
||||||
|
|
||||||
|
|
||||||
|
SET(CPACK_BINARY_BUNDLE "${CPACK_BINARY_BUNDLE}")
|
||||||
|
SET(CPACK_BINARY_CYGWIN "${CPACK_BINARY_CYGWIN}")
|
||||||
|
SET(CPACK_BINARY_DEB "${CPACK_BINARY_DEB}")
|
||||||
|
SET(CPACK_BINARY_NSIS "${CPACK_BINARY_NSIS}")
|
||||||
|
SET(CPACK_BINARY_OSXX11 "${CPACK_BINARY_OSXX11}")
|
||||||
|
SET(CPACK_BINARY_PACKAGEMAKER "${CPACK_BINARY_PACKAGEMAKER}")
|
||||||
|
SET(CPACK_BINARY_RPM "${CPACK_BINARY_RPM}")
|
||||||
|
SET(CPACK_BINARY_STGZ "${CPACK_BINARY_STGZ}")
|
||||||
|
SET(CPACK_BINARY_TBZ2 "${CPACK_BINARY_TBZ2}")
|
||||||
|
SET(CPACK_BINARY_TGZ "${CPACK_BINARY_TGZ}")
|
||||||
|
SET(CPACK_BINARY_TZ "${CPACK_BINARY_TZ}")
|
||||||
|
SET(CPACK_BINARY_ZIP "${CPACK_BINARY_ZIP}")
|
||||||
|
SET(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
|
||||||
|
SET(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL}")
|
||||||
|
SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
|
||||||
|
SET(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
|
||||||
|
SET(CPACK_GENERATOR "${CPACK_GENERATOR}")
|
||||||
|
SET(CPACK_INSTALL_CMAKE_PROJECTS "${OpenSceneGraph_BINARY_DIR};OpenSceneGraph;${OSG_CPACK_COMPONENT};/")
|
||||||
|
SET(CPACK_INSTALL_PREFIX "${CPACK_INSTALL_PREFIX}")
|
||||||
|
SET(CPACK_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;")
|
||||||
|
SET(CPACK_NSIS_DISPLAY_NAME "${CMAKE_PROJECT_NAME} ${OPENSCENEGRAPH_VERSION}")
|
||||||
|
SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
|
||||||
|
SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
|
||||||
|
SET(CPACK_OUTPUT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CPackConfig-${OSG_CPACK_COMPONENT}.cmake")
|
||||||
|
SET(CPACK_PACKAGE_DEFAULT_LOCATION "/")
|
||||||
|
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenSceneGraph_SOURCE_DIR}/README.txt")
|
||||||
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The OpenSceneGraph is an open source high performance 3d graphics toolkit")
|
||||||
|
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}")
|
||||||
|
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||||
|
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CMAKE_PROJECT_NAME}-${OPENSCENEGRAPH_VERSION}")
|
||||||
|
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
|
||||||
|
SET(CPACK_PACKAGE_RELOCATABLE "true")
|
||||||
|
SET(CPACK_PACKAGE_VENDOR "The OpenSceneGraph developers and contributors lead by Robert Osfield")
|
||||||
|
SET(CPACK_PACKAGE_VERSION "${OPENSCENEGRAPH_VERSION}")
|
||||||
|
SET(CPACK_PACKAGE_VERSION_MAJOR "${OPENSCENEGRAPH_MAJOR_VERSION}")
|
||||||
|
SET(CPACK_PACKAGE_VERSION_MINOR "${OPENSCENEGRAPH_MINOR_VERSION}")
|
||||||
|
SET(CPACK_PACKAGE_VERSION_PATCH "${OPENSCENEGRAPH_PATCH_VERSION}")
|
||||||
|
SET(CPACK_RESOURCE_FILE_LICENSE "${OpenSceneGraph_SOURCE_DIR}/LICENSE.txt")
|
||||||
|
SET(CPACK_RESOURCE_FILE_README "${OpenSceneGraph_SOURCE_DIR}/README.txt")
|
||||||
|
SET(CPACK_RESOURCE_FILE_WELCOME "${OpenSceneGraph_SOURCE_DIR}/NEWS.txt")
|
||||||
|
SET(CPACK_SET_DESTDIR "OFF")
|
||||||
|
SET(CPACK_STRIP_FILES "ON")
|
||||||
81
CMakeModules/OsgDetermineCompiler.cmake
Normal file
81
CMakeModules/OsgDetermineCompiler.cmake
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
# - Figure out what compiler (and version) cmake is generating for
|
||||||
|
# Once done this will define:
|
||||||
|
#
|
||||||
|
# Variable:
|
||||||
|
# OSG_COMPILER
|
||||||
|
#
|
||||||
|
|
||||||
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
|
EXEC_PROGRAM(
|
||||||
|
${CMAKE_CXX_COMPILER}
|
||||||
|
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
|
||||||
|
OUTPUT_VARIABLE gcc_compiler_version
|
||||||
|
)
|
||||||
|
#MESSAGE("GCC Version: ${gcc_compiler_version}")
|
||||||
|
|
||||||
|
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
IF(MSVC)
|
||||||
|
IF(MSVC60)
|
||||||
|
SET(OSG_COMPILER "vc60")
|
||||||
|
ENDIF(MSVC60)
|
||||||
|
IF(MSVC70)
|
||||||
|
SET(OSG_COMPILER "vc70")
|
||||||
|
ENDIF(MSVC70)
|
||||||
|
IF(MSVC71)
|
||||||
|
SET(OSG_COMPILER "vc71")
|
||||||
|
ENDIF(MSVC71)
|
||||||
|
IF(MSVC80)
|
||||||
|
SET(OSG_COMPILER "vc80")
|
||||||
|
ENDIF(MSVC80)
|
||||||
|
IF(MSVC90)
|
||||||
|
SET(OSG_COMPILER "vc90")
|
||||||
|
ENDIF(MSVC90)
|
||||||
|
|
||||||
|
IF(MSVC80)
|
||||||
|
MESSAGE(STATUS "Checking if compiler has service pack 1 installed...")
|
||||||
|
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" "int main() {return 0;}\n")
|
||||||
|
|
||||||
|
TRY_COMPILE(_TRY_RESULT
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
|
||||||
|
CMAKE_FLAGS -D CMAKE_VERBOSE_MAKEFILE=ON
|
||||||
|
OUTPUT_VARIABLE OUTPUT
|
||||||
|
)
|
||||||
|
|
||||||
|
IF(_TRY_RESULT)
|
||||||
|
# parse for exact compiler version
|
||||||
|
STRING(REGEX MATCH "Compiler Version [0-9]+.[0-9]+.[0-9]+.[0-9]+" vc_compiler_version "${OUTPUT}")
|
||||||
|
IF(vc_compiler_version)
|
||||||
|
#MESSAGE("${vc_compiler_version}")
|
||||||
|
STRING(REGEX MATCHALL "[0-9]+" CL_VERSION_LIST "${vc_compiler_version}")
|
||||||
|
LIST(GET CL_VERSION_LIST 0 CL_MAJOR_VERSION)
|
||||||
|
LIST(GET CL_VERSION_LIST 1 CL_MINOR_VERSION)
|
||||||
|
LIST(GET CL_VERSION_LIST 2 CL_PATCH_VERSION)
|
||||||
|
LIST(GET CL_VERSION_LIST 3 CL_EXTRA_VERSION)
|
||||||
|
ENDIF(vc_compiler_version)
|
||||||
|
|
||||||
|
# Standard vc80 is 14.00.50727.42, sp1 14.00.50727.762, sp2?
|
||||||
|
# Standard vc90 is 9.0.30729.1, sp1 ?
|
||||||
|
IF(CL_EXTRA_VERSION EQUAL 762)
|
||||||
|
SET(OSG_COMPILER "vc80sp1")
|
||||||
|
ELSE(CL_EXTRA_VERSION EQUAL 762)
|
||||||
|
SET(OSG_COMPILER "vc80")
|
||||||
|
ENDIF(CL_EXTRA_VERSION EQUAL 762)
|
||||||
|
|
||||||
|
# parse for exact visual studio version
|
||||||
|
#IF(MSVC_IDE)
|
||||||
|
# string(REGEX MATCH "Visual Studio Version [0-9]+.[0-9]+.[0-9]+.[0-9]+" vs_version "${OUTPUT}")
|
||||||
|
# IF(vs_version)
|
||||||
|
# MESSAGE("${vs_version}")
|
||||||
|
# string(REGEX MATCHALL "[0-9]+" VS_VERSION_LIST "${vs_version}")
|
||||||
|
# list(GET VS_VERSION_LIST 0 VS_MAJOR_VERSION)
|
||||||
|
# list(GET VS_VERSION_LIST 1 VS_MINOR_VERSION)
|
||||||
|
# list(GET VS_VERSION_LIST 2 VS_PATCH_VERSION)
|
||||||
|
# list(GET VS_VERSION_LIST 3 VS_EXTRA_VERSION)
|
||||||
|
# ENDIF(vs_version)
|
||||||
|
#ENDIF(MSVC_IDE)
|
||||||
|
ENDIF(_TRY_RESULT)
|
||||||
|
ENDIF(MSVC80)
|
||||||
|
ENDIF(MSVC)
|
||||||
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
@@ -30,11 +30,7 @@ MACRO(LINK_INTERNAL TRGTNAME)
|
|||||||
#CMake 2.4.7, at least seem to use PREFIX instead of IMPORT_PREFIX for computing linkage info to use into projects,
|
#CMake 2.4.7, at least seem to use PREFIX instead of IMPORT_PREFIX for computing linkage info to use into projects,
|
||||||
# so we full path name to specify linkage, this prevent automatic inferencing of dependencies, so we add explicit depemdencies
|
# so we full path name to specify linkage, this prevent automatic inferencing of dependencies, so we add explicit depemdencies
|
||||||
#to library targets used
|
#to library targets used
|
||||||
IF(NOT MSVC_IDE)
|
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib")
|
||||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib")
|
|
||||||
ELSE(NOT MSVC_IDE)
|
|
||||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
|
|
||||||
ENDIF(NOT MSVC_IDE)
|
|
||||||
ADD_DEPENDENCIES(${TRGTNAME} ${LINKLIB})
|
ADD_DEPENDENCIES(${TRGTNAME} ${LINKLIB})
|
||||||
ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}" debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
|
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}" debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
|
||||||
@@ -134,6 +130,13 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
|||||||
IF(NOT TARGET_LABEL)
|
IF(NOT TARGET_LABEL)
|
||||||
SET(TARGET_LABEL "${TARGET_DEFAULT_LABEL_PREFIX} ${TARGET_NAME}")
|
SET(TARGET_LABEL "${TARGET_DEFAULT_LABEL_PREFIX} ${TARGET_NAME}")
|
||||||
ENDIF(NOT TARGET_LABEL)
|
ENDIF(NOT TARGET_LABEL)
|
||||||
|
|
||||||
|
## plugins gets put in libopenscenegraph by default
|
||||||
|
IF(${ARGC} GREATER 1)
|
||||||
|
SET(PACKAGE_COMPONENT libopenscenegraph-${ARGV1})
|
||||||
|
ELSE(${ARGC} GREATER 1)
|
||||||
|
SET(PACKAGE_COMPONENT libopenscenegraph)
|
||||||
|
ENDIF(${ARGC} GREATER 1)
|
||||||
|
|
||||||
# here we use the command to generate the library
|
# here we use the command to generate the library
|
||||||
|
|
||||||
@@ -188,14 +191,14 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
|||||||
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
|
||||||
ARCHIVE DESTINATION lib/${OSG_PLUGINS}
|
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
|
||||||
LIBRARY DESTINATION bin/${OSG_PLUGINS} )
|
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
|
||||||
ELSE(WIN32)
|
ELSE(WIN32)
|
||||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
|
||||||
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
|
||||||
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} )
|
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
ENDMACRO(SETUP_PLUGIN)
|
ENDMACRO(SETUP_PLUGIN)
|
||||||
|
|
||||||
@@ -277,7 +280,7 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME)
|
|||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin BUNDLE DESTINATION bin)
|
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin BUNDLE DESTINATION bin)
|
||||||
ELSE(APPLE)
|
ELSE(APPLE)
|
||||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin )
|
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph )
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
ENDMACRO(SETUP_APPLICATION)
|
ENDMACRO(SETUP_APPLICATION)
|
||||||
@@ -304,7 +307,7 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
|
|||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
|
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
|
||||||
ELSE(APPLE)
|
ELSE(APPLE)
|
||||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin )
|
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
ENDMACRO(SETUP_EXAMPLE)
|
ENDMACRO(SETUP_EXAMPLE)
|
||||||
@@ -341,18 +344,20 @@ MACRO(HANDLE_MSVC_DLL)
|
|||||||
|
|
||||||
IF(NOT MSVC_IDE)
|
IF(NOT MSVC_IDE)
|
||||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../bin/${LIB_PREFIX}${LIB_SOVERSION}-")
|
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../bin/${LIB_PREFIX}${LIB_SOVERSION}-")
|
||||||
SET(NEW_LIB_NAME "${OUTPUT_BINDIR}/${LIB_PREFIX}${LIB_SOVERSION}-${LIB_NAME}")
|
IF (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||||
ADD_CUSTOM_COMMAND(
|
SET(NEW_LIB_NAME "${OUTPUT_BINDIR}/${LIB_PREFIX}${LIB_SOVERSION}-${LIB_NAME}")
|
||||||
TARGET ${LIB_NAME}
|
ADD_CUSTOM_COMMAND(
|
||||||
POST_BUILD
|
TARGET ${LIB_NAME}
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.lib" "${OUTPUT_LIBDIR}/${LIB_NAME}.lib"
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.exp" "${OUTPUT_LIBDIR}/${LIB_NAME}.exp"
|
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.lib" "${OUTPUT_LIBDIR}/${LIB_NAME}.lib"
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.lib"
|
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.exp" "${OUTPUT_LIBDIR}/${LIB_NAME}.exp"
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.exp"
|
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.lib"
|
||||||
)
|
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.exp"
|
||||||
ELSE(NOT MSVC_IDE)
|
)
|
||||||
|
ENDIF (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||||
|
ELSE(NOT MSVC_IDE)
|
||||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
|
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
|
||||||
ENDIF(NOT MSVC_IDE)
|
ENDIF(NOT MSVC_IDE)
|
||||||
|
|
||||||
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
|
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
|
||||||
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
|
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
|
||||||
|
|||||||
13
CTestConfig.cmake
Normal file
13
CTestConfig.cmake
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
## This file should be placed in the root directory of your project.
|
||||||
|
## Then modify the CMakeLists.txt file in the root directory of your
|
||||||
|
## project to incorporate the testing dashboard.
|
||||||
|
## # The following are required to uses Dart and the Cdash dashboard
|
||||||
|
## ENABLE_TESTING()
|
||||||
|
## INCLUDE(Dart)
|
||||||
|
set(CTEST_PROJECT_NAME "OpenSceneGraph")
|
||||||
|
set(CTEST_NIGHTLY_START_TIME "00:00:00 CET")
|
||||||
|
|
||||||
|
set(CTEST_DROP_METHOD "http")
|
||||||
|
set(CTEST_DROP_SITE "cdash.openscenegraph.org")
|
||||||
|
set(CTEST_DROP_LOCATION "/submit.php?project=OpenSceneGraph")
|
||||||
|
set(CTEST_DROP_SITE_CDASH TRUE)
|
||||||
@@ -13,8 +13,9 @@
|
|||||||
under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
|
under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
|
||||||
or later.
|
or later.
|
||||||
|
|
||||||
Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid in the wxWindows
|
Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid
|
||||||
section below. The LGPL in the final section of this license.
|
out in the wxWindows section below. The LGPL is contained in the
|
||||||
|
final section of this license.
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@@ -187,7 +188,7 @@ modification follow. Pay close attention to the difference between a
|
|||||||
former contains code derived from the library, whereas the latter must
|
former contains code derived from the library, whereas the latter must
|
||||||
be combined with the library in order to run.
|
be combined with the library in order to run.
|
||||||
|
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
0. This License Agreement applies to any software library or other
|
0. This License Agreement applies to any software library or other
|
||||||
|
|||||||
208
NEWS.txt
208
NEWS.txt
@@ -1,6 +1,214 @@
|
|||||||
OSG News
|
OSG News
|
||||||
========
|
========
|
||||||
|
|
||||||
|
= !OpenSceneGraph 2.8.2 release - bug fix release =
|
||||||
|
|
||||||
|
PERTHSHIRE, Scotland - 28th July 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.8 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.8 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
|
||||||
|
|
||||||
|
=== Open-source development delivers industry-leading features and performance ===
|
||||||
|
The !OpenSceneGraph 2.8.2 release is the culmination of 10 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
|
||||||
|
|
||||||
|
=== Updates between 2.8.2 and 2.8.1 releases include: ===
|
||||||
|
|
||||||
|
* Build fixes for:
|
||||||
|
* !RedHat Enterprise Linux
|
||||||
|
* Building of dicom plugin with ITK under Linux
|
||||||
|
* Crash fixes to:
|
||||||
|
* crash during window destruction under Windows when using closing a MFC based !GraphicsWindow
|
||||||
|
* deadlock under Windows due threading issues with atomic operations in Win32 Barrier implementation
|
||||||
|
* !OpenFlight plugin crashed due to not handling spaces at the end of option strings
|
||||||
|
* !OpenFlight plugin crashed when exported scene graphs contain no TexEnv objects
|
||||||
|
* osganimationtimeline crashed when example model was not found
|
||||||
|
* Bug fixes to :
|
||||||
|
* vertical anchor in osgWidget::Widow was inverted
|
||||||
|
* bsp an mdl plugins to better handling transparency and lighting
|
||||||
|
* computation of sector range in osgSim::!LightPoint
|
||||||
|
* extension checking of FBO packed stencil support
|
||||||
|
* position of tabs at corners of manipulators
|
||||||
|
* threading bug in .osg plugin that occurred during multi-threaded initialization
|
||||||
|
* alignment of Text what setting alignment after assign text string
|
||||||
|
* loading of compressed texture arrays
|
||||||
|
* texture generate mipmap for non power of two textures
|
||||||
|
* regression in X11 key symbol remapping, improved support for Russian keyboards
|
||||||
|
* regression of !StencilMask setting in !RenderStage
|
||||||
|
* small memory leak in X11 usage
|
||||||
|
* Transform::computeBound() double !BoundingSphere support
|
||||||
|
* Resize handling when master and slave Cameras share the same !GraphicsContext
|
||||||
|
* Handling of locale in plugins and env var parsing so it always follows the '.' decimal place convention regardless of the desktop/application locale.
|
||||||
|
|
||||||
|
=== Updates between 2.8.1 and 2.8.0 releases include: ===
|
||||||
|
|
||||||
|
* Build fixes under FreeBSD and IBM AIX, and RedHat Enterprise Linux
|
||||||
|
* Improved compatibility with SWIG wrapper building
|
||||||
|
* Crash fixes in osg::State, osg::Geometry and osgWidget
|
||||||
|
* Bug fixes to :
|
||||||
|
* draw instanced support
|
||||||
|
* Optimizer - MergeGeometryVisitor, RemoveLoadedProxyNodesVisitor and SpatializeGroupsVistor
|
||||||
|
* hdr image loader
|
||||||
|
* handling of opacity maps in 3ds loader
|
||||||
|
* dxf loader
|
||||||
|
* frame buffer object
|
||||||
|
* cursor/event handling in windows
|
||||||
|
* windows threading
|
||||||
|
* memory leak in Collada loader
|
||||||
|
* fixes to display lists/vbo creation that prevent crash under ATI drivers
|
||||||
|
* subface PolygonOffset setting in OpenFlight
|
||||||
|
* osgconv --formats under OSX
|
||||||
|
* osgTerrain::Layer bounding volume calculation
|
||||||
|
|
||||||
|
=== Updates between 2.8 and 2.6 include: ===
|
||||||
|
|
||||||
|
* New osgVolume library for volume rendering, with support for:
|
||||||
|
* High quality GPU based Ray tracing
|
||||||
|
* Transfer functions
|
||||||
|
* Per pixel lighting
|
||||||
|
* Iso surface rendering
|
||||||
|
* Maximum Intensity Projection rendering
|
||||||
|
* Non-power-of-two 3D textures, and 3D texture compression
|
||||||
|
* DICOM loading for reading dicom medical data
|
||||||
|
* New osgAnimation library for character and scene animation.
|
||||||
|
* New plugin for reading Biovision hierarchical files (.BVH) to generate character motion animations.
|
||||||
|
* New osgShadow support for Light Space Perspective Shadow Maps (LispSM).
|
||||||
|
* Three new scene graph widgets for placing traditional 2D capability into fully interactive 3D scenes:
|
||||||
|
* PDF widget (based on libPoppler)
|
||||||
|
* VNC client widget (based on libVNCServer)
|
||||||
|
* Internet browser client widget (based on Gecko/UBrowser)
|
||||||
|
* New plugins for loading Half-Life 2 maps and models.
|
||||||
|
* New plugin for loading EXR, high dynamic range imagery
|
||||||
|
* Improvements to !DatabasePager, tailored for low latency paging.
|
||||||
|
* Improved runtime stats collection and on screen reporting.
|
||||||
|
* Performance improvements through optimization of matrix operations.
|
||||||
|
* Support for the OpenGL "draw instanced" extension.
|
||||||
|
* Support for zlib compressed native .ive and .gz files
|
||||||
|
* Improvements to COLLADA support.
|
||||||
|
* Build reporting using CDash
|
||||||
|
* New packaging support using CPack
|
||||||
|
* A wide range of build and bug fixes
|
||||||
|
|
||||||
|
=== Downloads and Licensing ===
|
||||||
|
!OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the [http://www.openscenegraph.org/projects/osg/wiki/Downloads Downloads] section of the openscenegraph.org website.
|
||||||
|
|
||||||
|
!OpenSceneGraph is released under the [http://www.openscenegraph.org/projects/osg/wiki/Legal OpenSceneGraph Public License], which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the !OpenSceneGraph libraries without restricting the licensing of the user's software.
|
||||||
|
|
||||||
|
=== !OpenSceneGraph Books now available ===
|
||||||
|
|
||||||
|
The !OpenSceneGraph Quick Start Guide is now available in Chinese as well as English, and alongside the Reference Manual, books can be found at [http://www.osgbooks.com OsgBooks].
|
||||||
|
|
||||||
|
=== Professional support and services ===
|
||||||
|
!OpenSceneGraph project is backed up with professional services by [http://www.openscenegraph.com OpenSceneGraph Professional Services], based in Scotland, and [http://www.skew-matrix.com Skew-Matrix] and [http://www.blue-newt.com Blue-Newt Software] both based in the USA, and a range of [wiki:Community/Contractors Contractors] from around the world. Services available include:
|
||||||
|
|
||||||
|
* Confidential Professional Support
|
||||||
|
* Bespoke development
|
||||||
|
* Consultancy
|
||||||
|
* Training
|
||||||
|
|
||||||
|
=== Community support and contributions ===
|
||||||
|
The diverse and growing community of over 2000 developers is centred around the public osg-users mailing list, where members discuss how best to use !OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
|
||||||
|
|
||||||
|
The !OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the [http://www.openscenegraph.org/projects/osg/wiki/Support/Contributors/TwoPointEight 365 individuals] from around the world that have directly contributed to the development and refinement of the !OpenSceneGraph code base.
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
About !OpenSceneGraph: [[BR]]
|
||||||
|
The !OpenSceneGraph Project was founded in September 1999 by Don Burns and Robert Osfield.
|
||||||
|
Further information, screenshots, downloads, documentation, and support links can be found on the !OpenSceneGraph project website http://www.openscenegraph.org.
|
||||||
|
|
||||||
|
About !OpenSceneGraph Professional Services:[[BR]]
|
||||||
|
!OpenSceneGraph Professional Services, founded by project lead Robert Osfield in April 2001, is based in Callander, Perhshire, Scotland, and provides professional services on top of !OpenSceneGraph. Further information about the services it provides can be found at http://www.openscenegraph.com.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
= !OpenSceneGraph 2.8.1 release - bug fix release =
|
||||||
|
|
||||||
|
PERTHSHIRE, Scotland - 19th May 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8.1, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.8 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.8 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
|
||||||
|
|
||||||
|
=== Open-source development delivers industry-leading features and performance ===
|
||||||
|
The !OpenSceneGraph 2.8.1 release is the culmination of 10 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
|
||||||
|
|
||||||
|
=== Updates between 2.8.1 and 2.8.0 releases include: ===
|
||||||
|
|
||||||
|
* Build fixes under FreeBSD and IBM AIX, and RedHat Enterprise Linux.
|
||||||
|
* Improved compatibility with SWIG wrapper building
|
||||||
|
* Crash fixes in osg::State, osg::Geometry and osgWidget.
|
||||||
|
* Bug fixes to :
|
||||||
|
* draw instanced support
|
||||||
|
* Optimizer - MergeGeometryVisitor, RemoveLoadedProxyNodesVisitor and SpatializeGroupsVistor
|
||||||
|
* hdr image loader
|
||||||
|
* handling of opacity maps in 3ds loader
|
||||||
|
* dxf loader
|
||||||
|
* frame buffer object
|
||||||
|
* cursor/event handling in windows
|
||||||
|
* windows threading
|
||||||
|
* memory leak in Collada loader
|
||||||
|
* fixes to display lists/vbo creation that prevent crash under ATI drivers
|
||||||
|
* subface PolygonOffset setting in OpenFlight
|
||||||
|
* osgconv --formats under OSX
|
||||||
|
* osgTerrain::Layer bounding volume calculation.
|
||||||
|
|
||||||
|
=== Updates between 2.8 and 2.6 include: ===
|
||||||
|
|
||||||
|
* New osgVolume library for volume rendering, with support for:
|
||||||
|
* High quality GPU based Ray tracing
|
||||||
|
* Transfer functions
|
||||||
|
* Per pixel lighting
|
||||||
|
* Iso surface rendering
|
||||||
|
* Maximum Intensity Projection rendering
|
||||||
|
* Non-power-of-two 3D textures, and 3D texture compression
|
||||||
|
* DICOM loading for reading dicom medical data
|
||||||
|
* New osgAnimation library for character and scene animation.
|
||||||
|
* New plugin for reading Biovision hierarchical files (.BVH) to generate character motion animations.
|
||||||
|
* New osgShadow support for Light Space Perspective Shadow Maps (LispSM).
|
||||||
|
* Three new scene graph widgets for placing traditional 2D capability into fully interactive 3D scenes:
|
||||||
|
* PDF widget (based on libPoppler)
|
||||||
|
* VNC client widget (based on libVNCServer)
|
||||||
|
* Internet browser client widget (based on Gecko/UBrowser)
|
||||||
|
* New plugins for loading Half-Life 2 maps and models.
|
||||||
|
* New plugin for loading EXR, high dynamic range imagery
|
||||||
|
* Improvements to !DatabasePager, tailored for low latency paging.
|
||||||
|
* Improved runtime stats collection and on screen reporting.
|
||||||
|
* Performance improvements through optimization of matrix operations.
|
||||||
|
* Support for the OpenGL "draw instanced" extension.
|
||||||
|
* Support for zlib compressed native .ive and .gz files
|
||||||
|
* Improvements to COLLADA support.
|
||||||
|
* Build reporting using CDash
|
||||||
|
* New packaging support using CPack
|
||||||
|
* A wide range of build and bug fixes
|
||||||
|
|
||||||
|
=== Downloads and Licensing ===
|
||||||
|
!OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the [http://www.openscenegraph.org/projects/osg/wiki/Downloads Downloads] section of the openscenegraph.org website.
|
||||||
|
|
||||||
|
!OpenSceneGraph is released under the [http://www.openscenegraph.org/projects/osg/wiki/Legal OpenSceneGraph Public License], which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the !OpenSceneGraph libraries without restricting the licensing of the user's software.
|
||||||
|
|
||||||
|
=== !OpenSceneGraph Books now available ===
|
||||||
|
|
||||||
|
The !OpenSceneGraph Quick Start Guide is now available in Chinese as well as English, and alongside the Reference Manual, books can be found at [http://www.osgbooks.com OsgBooks].
|
||||||
|
|
||||||
|
=== Professional support and services ===
|
||||||
|
!OpenSceneGraph project is backed up with professional services by [http://www.openscenegraph.com OpenSceneGraph Professional Services], based in Scotland, and [http://www.skew-matrix.com Skew-Matrix] and [http://www.blue-newt.com Blue-Newt Software] both based in the USA, and a range of [wiki:Community/Contractors Contractors] from around the world. Services available include:
|
||||||
|
|
||||||
|
* Confidential Professional Support
|
||||||
|
* Bespoke development
|
||||||
|
* Consultancy
|
||||||
|
* Training
|
||||||
|
|
||||||
|
=== Community support and contributions ===
|
||||||
|
The diverse and growing community of over 2000 developers is centred around the public osg-users mailing list, where members discuss how best to use !OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
|
||||||
|
|
||||||
|
The !OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the [http://www.openscenegraph.org/projects/osg/wiki/Support/Contributors/TwoPointEight 365 individuals] from around the world that have directly contributed to the development and refinement of the !OpenSceneGraph code base.
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
About !OpenSceneGraph: [[BR]]
|
||||||
|
The !OpenSceneGraph Project was founded in September 1999 by Don Burns and Robert Osfield.
|
||||||
|
Further information, screenshots, downloads, documentation, and support links can be found on the !OpenSceneGraph project website http://www.openscenegraph.org.
|
||||||
|
|
||||||
|
About !OpenSceneGraph Professional Services:[[BR]]
|
||||||
|
!OpenSceneGraph Professional Services, founded by project lead Robert Osfield in April 2001, is based in Callander, Perhshire, Scotland, and provides professional services on top of !OpenSceneGraph. Further information about the services it provides can be found at http://www.openscenegraph.com.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
= !OpenSceneGraph 2.6 release adds osgWidget library, KdTree intersections, Anti-aliased FBOsand much more. =
|
= !OpenSceneGraph 2.6 release adds osgWidget library, KdTree intersections, Anti-aliased FBOsand much more. =
|
||||||
|
|
||||||
PERTHSHIRE, Scotland - 5th August 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.6, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.6 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.6 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
|
PERTHSHIRE, Scotland - 5th August 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.6, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.6 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.6 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ REM trees.
|
|||||||
REM mew 2004-07-16
|
REM mew 2004-07-16
|
||||||
|
|
||||||
cd ..\..
|
cd ..\..
|
||||||
set PATH=%CD%\OpenThreads\bin\win32;%CD%\OpenSceneGraph\bin\win32;%CD%\3rdParty\bin;%PATH%
|
set PATH=%CD%\OpenThreads\bin\win32;%CD%\bin;%CD%\3rdParty\bin;%PATH%
|
||||||
set OSG_FILE_PATH=%CD%\OpenSceneGraph-Data;%CD%\OpenSceneGraph-Data\Images;%CD%\OpenSceneGraph-Data\fonts;%OSG_FILE_PATH%
|
set OSG_FILE_PATH=%CD%\OpenSceneGraph-Data;%OSG_FILE_PATH%
|
||||||
|
|
||||||
REM uncomment one of these for your desired notify level...
|
REM uncomment one of these for your desired notify level...
|
||||||
rem set OSG_NOTIFY_LEVEL=ALWAYS
|
rem set OSG_NOTIFY_LEVEL=ALWAYS
|
||||||
|
|||||||
@@ -12,10 +12,9 @@ subscribe to our public mailing list:
|
|||||||
http://www.openscenegraph.org/projects/osg/wiki/MailingLists
|
http://www.openscenegraph.org/projects/osg/wiki/MailingLists
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Robert Osfield.
|
Robert Osfield.
|
||||||
Project Lead.
|
Project Lead.
|
||||||
26th August 2008.
|
28th July 2009.
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,16 @@
|
|||||||
#ifndef _OPENTHREADS_CONFIG
|
#ifndef _OPENTHREADS_CONFIG
|
||||||
#define _OPENTHREADS_CONFIG
|
#define _OPENTHREADS_CONFIG
|
||||||
|
|
||||||
|
#include <AvailabilityMacros.h>
|
||||||
|
|
||||||
|
#define _OPENTHREADS_ATOMIC_USE_MUTEX
|
||||||
|
|
||||||
|
#if defined(MAC_OS_X_VERSION_10_5)
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||||
|
#define _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC
|
||||||
|
#undef _OPENTHREADS_ATOMIC_USE_MUTEX
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
/* #undef _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS */
|
/* #undef _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS */
|
||||||
/* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */
|
/* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */
|
||||||
/* #undef _OPENTHREADS_ATOMIC_USE_SUN */
|
/* #undef _OPENTHREADS_ATOMIC_USE_SUN */
|
||||||
|
|||||||
24
Xcode/OpenSceneGraph/osgAnimation-Info.plist
Normal file
24
Xcode/OpenSceneGraph/osgAnimation-Info.plist
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>English</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>osgAnimation</string>
|
||||||
|
<key>CFBundleGetInfoString</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>org.OpenSceneGraph.osgAnimation</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>2.7.0</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
24
Xcode/OpenSceneGraph/osgVolume-Info.plist
Normal file
24
Xcode/OpenSceneGraph/osgVolume-Info.plist
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>English</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>osgVolume</string>
|
||||||
|
<key>CFBundleGetInfoString</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>org.OpenSceneGraph.osgVolume</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>2.7.0</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -1,24 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>English</string>
|
<string>English</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>OpenThreads</string>
|
<string>osgWidget</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>org.OpenThreads.OpenThreads</string>
|
<string>org.OpenSceneGraph.osgWidget</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string></string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>2.2.0</string>
|
<string>2.2.0</string>
|
||||||
<key>CSResourcesFileMapped</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
18
Xcode/OpenSceneGraph/osganimationviewer-Info.plist
Normal file
18
Xcode/OpenSceneGraph/osganimationviewer-Info.plist
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>English</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>osganimationviewer</string>
|
||||||
|
<key>CFBundleGetInfoString</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>org.OpenSceneGraph.osganimationviewer</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string></string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>osgmanipulator</string>
|
<string>osgmanipulator-example</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>com.MySoftwareCompany.osgmanipulator</string>
|
<string>com.MySoftwareCompany.osgmanipulator</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
|
|||||||
Binary file not shown.
@@ -1,449 +0,0 @@
|
|||||||
// !$*UTF8*$!
|
|
||||||
{
|
|
||||||
archiveVersion = 1;
|
|
||||||
classes = {
|
|
||||||
};
|
|
||||||
objectVersion = 42;
|
|
||||||
objects = {
|
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
|
||||||
00DAF8AA0BBE1A0E00EFEB98 /* Block in Headers */ = {isa = PBXBuildFile; fileRef = 00DAF8A70BBE1A0E00EFEB98 /* Block */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
00DAF8AB0BBE1A0F00EFEB98 /* ReadWriteMutex in Headers */ = {isa = PBXBuildFile; fileRef = 00DAF8A80BBE1A0E00EFEB98 /* ReadWriteMutex */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
00DAF8AC0BBE1A0F00EFEB98 /* ReentrantMutex in Headers */ = {isa = PBXBuildFile; fileRef = 00DAF8A90BBE1A0E00EFEB98 /* ReentrantMutex */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
8D07F2BE0486CC7A007CD1D0 /* OpenThreads_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32BAE0B70371A74B00C91783 /* OpenThreads_Prefix.pch */; };
|
|
||||||
8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
|
|
||||||
8D07F2C40486CC7A007CD1D0 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB77AAFE841565C02AAC07 /* Carbon.framework */; };
|
|
||||||
BE11833405D6FE3900EB53E5 /* PThreadBarrierPrivateData.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11832C05D6FE3800EB53E5 /* PThreadBarrierPrivateData.h */; };
|
|
||||||
BE11833605D6FE3900EB53E5 /* PThreadConditionPrivateData.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11832E05D6FE3800EB53E5 /* PThreadConditionPrivateData.h */; };
|
|
||||||
BE11833805D6FE3900EB53E5 /* PThreadMutexPrivateData.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11833005D6FE3800EB53E5 /* PThreadMutexPrivateData.h */; };
|
|
||||||
BE11833905D6FE3900EB53E5 /* PThreadPrivateData.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11833105D6FE3800EB53E5 /* PThreadPrivateData.h */; };
|
|
||||||
BE11835105D7022C00EB53E5 /* PThread.c++ in Sources */ = {isa = PBXBuildFile; fileRef = BE11832A05D6FE3800EB53E5 /* PThread.c++ */; };
|
|
||||||
BE11835205D7022C00EB53E5 /* PThreadBarrier.c++ in Sources */ = {isa = PBXBuildFile; fileRef = BE11832B05D6FE3800EB53E5 /* PThreadBarrier.c++ */; };
|
|
||||||
BE11835405D7022C00EB53E5 /* PThreadCondition.c++ in Sources */ = {isa = PBXBuildFile; fileRef = BE11832D05D6FE3800EB53E5 /* PThreadCondition.c++ */; };
|
|
||||||
BE11835605D7022C00EB53E5 /* PThreadMutex.c++ in Sources */ = {isa = PBXBuildFile; fileRef = BE11832F05D6FE3800EB53E5 /* PThreadMutex.c++ */; };
|
|
||||||
BE11837D05D7083B00EB53E5 /* Barrier in Headers */ = {isa = PBXBuildFile; fileRef = BE11836E05D7082A00EB53E5 /* Barrier */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
BE11837E05D7083B00EB53E5 /* Condition in Headers */ = {isa = PBXBuildFile; fileRef = BE11836F05D7082A00EB53E5 /* Condition */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
BE11837F05D7083B00EB53E5 /* Exports in Headers */ = {isa = PBXBuildFile; fileRef = BE11837005D7082A00EB53E5 /* Exports */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
BE11838005D7083B00EB53E5 /* Mutex in Headers */ = {isa = PBXBuildFile; fileRef = BE11837105D7082A00EB53E5 /* Mutex */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
BE11838105D7083B00EB53E5 /* ScopedLock in Headers */ = {isa = PBXBuildFile; fileRef = BE11837205D7082A00EB53E5 /* ScopedLock */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
BE11838205D7083B00EB53E5 /* Thread in Headers */ = {isa = PBXBuildFile; fileRef = BE11837305D7082A00EB53E5 /* Thread */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
/* End PBXBuildFile section */
|
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
|
||||||
00DAF8A70BBE1A0E00EFEB98 /* Block */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = Block; path = ../../include/OpenThreads/Block; sourceTree = SOURCE_ROOT; };
|
|
||||||
00DAF8A80BBE1A0E00EFEB98 /* ReadWriteMutex */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = ReadWriteMutex; path = ../../include/OpenThreads/ReadWriteMutex; sourceTree = SOURCE_ROOT; };
|
|
||||||
00DAF8A90BBE1A0E00EFEB98 /* ReentrantMutex */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = ReentrantMutex; path = ../../include/OpenThreads/ReentrantMutex; sourceTree = SOURCE_ROOT; };
|
|
||||||
089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
|
||||||
08FB77AAFE841565C02AAC07 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
|
|
||||||
32BAE0B70371A74B00C91783 /* OpenThreads_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenThreads_Prefix.pch; sourceTree = SOURCE_ROOT; };
|
|
||||||
8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
|
||||||
8D07F2C80486CC7A007CD1D0 /* OpenThreads.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OpenThreads.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
BE11832A05D6FE3800EB53E5 /* PThread.c++ */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "PThread.c++"; path = "../../src/OpenThreads/pthreads/PThread.c++"; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11832B05D6FE3800EB53E5 /* PThreadBarrier.c++ */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "PThreadBarrier.c++"; path = "../../src/OpenThreads/pthreads/PThreadBarrier.c++"; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11832C05D6FE3800EB53E5 /* PThreadBarrierPrivateData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PThreadBarrierPrivateData.h; path = ../../src/OpenThreads/pthreads/PThreadBarrierPrivateData.h; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11832D05D6FE3800EB53E5 /* PThreadCondition.c++ */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "PThreadCondition.c++"; path = "../../src/OpenThreads/pthreads/PThreadCondition.c++"; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11832E05D6FE3800EB53E5 /* PThreadConditionPrivateData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PThreadConditionPrivateData.h; path = ../../src/OpenThreads/pthreads/PThreadConditionPrivateData.h; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11832F05D6FE3800EB53E5 /* PThreadMutex.c++ */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = "PThreadMutex.c++"; path = "../../src/OpenThreads/pthreads/PThreadMutex.c++"; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11833005D6FE3800EB53E5 /* PThreadMutexPrivateData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PThreadMutexPrivateData.h; path = ../../src/OpenThreads/pthreads/PThreadMutexPrivateData.h; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11833105D6FE3800EB53E5 /* PThreadPrivateData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PThreadPrivateData.h; path = ../../src/OpenThreads/pthreads/PThreadPrivateData.h; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11836E05D7082A00EB53E5 /* Barrier */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = Barrier; path = ../../include/OpenThreads/Barrier; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11836F05D7082A00EB53E5 /* Condition */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = Condition; path = ../../include/OpenThreads/Condition; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11837005D7082A00EB53E5 /* Exports */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = Exports; path = ../../include/OpenThreads/Exports; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11837105D7082A00EB53E5 /* Mutex */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = Mutex; path = ../../include/OpenThreads/Mutex; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11837205D7082A00EB53E5 /* ScopedLock */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = ScopedLock; path = ../../include/OpenThreads/ScopedLock; sourceTree = SOURCE_ROOT; };
|
|
||||||
BE11837305D7082A00EB53E5 /* Thread */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = Thread; path = ../../include/OpenThreads/Thread; sourceTree = SOURCE_ROOT; };
|
|
||||||
/* End PBXFileReference section */
|
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
|
||||||
8D07F2C30486CC7A007CD1D0 /* Frameworks */ = {
|
|
||||||
isa = PBXFrameworksBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
8D07F2C40486CC7A007CD1D0 /* Carbon.framework in Frameworks */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXFrameworksBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
|
||||||
034768DDFF38A45A11DB9C8B /* Products */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
8D07F2C80486CC7A007CD1D0 /* OpenThreads.framework */,
|
|
||||||
);
|
|
||||||
name = Products;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
0867D691FE84028FC02AAC07 /* OpenThreads */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
BE11833F05D7005800EB53E5 /* Header */,
|
|
||||||
08FB77ACFE841707C02AAC07 /* Source */,
|
|
||||||
089C1665FE841158C02AAC07 /* Resources */,
|
|
||||||
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
|
|
||||||
034768DDFF38A45A11DB9C8B /* Products */,
|
|
||||||
);
|
|
||||||
name = OpenThreads;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
08FB77AAFE841565C02AAC07 /* Carbon.framework */,
|
|
||||||
);
|
|
||||||
name = "External Frameworks and Libraries";
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
089C1665FE841158C02AAC07 /* Resources */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
8D07F2C70486CC7A007CD1D0 /* Info.plist */,
|
|
||||||
089C1666FE841158C02AAC07 /* InfoPlist.strings */,
|
|
||||||
);
|
|
||||||
name = Resources;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
08FB77ACFE841707C02AAC07 /* Source */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
BE11832A05D6FE3800EB53E5 /* PThread.c++ */,
|
|
||||||
BE11832B05D6FE3800EB53E5 /* PThreadBarrier.c++ */,
|
|
||||||
BE11832C05D6FE3800EB53E5 /* PThreadBarrierPrivateData.h */,
|
|
||||||
BE11832D05D6FE3800EB53E5 /* PThreadCondition.c++ */,
|
|
||||||
BE11832E05D6FE3800EB53E5 /* PThreadConditionPrivateData.h */,
|
|
||||||
BE11832F05D6FE3800EB53E5 /* PThreadMutex.c++ */,
|
|
||||||
BE11833005D6FE3800EB53E5 /* PThreadMutexPrivateData.h */,
|
|
||||||
BE11833105D6FE3800EB53E5 /* PThreadPrivateData.h */,
|
|
||||||
32BAE0B70371A74B00C91783 /* OpenThreads_Prefix.pch */,
|
|
||||||
);
|
|
||||||
name = Source;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
BE11833F05D7005800EB53E5 /* Header */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
BE11835905D7027D00EB53E5 /* OpenThreads */,
|
|
||||||
);
|
|
||||||
name = Header;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
BE11835905D7027D00EB53E5 /* OpenThreads */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
BE11836E05D7082A00EB53E5 /* Barrier */,
|
|
||||||
00DAF8A70BBE1A0E00EFEB98 /* Block */,
|
|
||||||
BE11836F05D7082A00EB53E5 /* Condition */,
|
|
||||||
BE11837005D7082A00EB53E5 /* Exports */,
|
|
||||||
BE11837105D7082A00EB53E5 /* Mutex */,
|
|
||||||
00DAF8A80BBE1A0E00EFEB98 /* ReadWriteMutex */,
|
|
||||||
00DAF8A90BBE1A0E00EFEB98 /* ReentrantMutex */,
|
|
||||||
BE11837205D7082A00EB53E5 /* ScopedLock */,
|
|
||||||
BE11837305D7082A00EB53E5 /* Thread */,
|
|
||||||
);
|
|
||||||
name = OpenThreads;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
/* End PBXGroup section */
|
|
||||||
|
|
||||||
/* Begin PBXHeadersBuildPhase section */
|
|
||||||
8D07F2BD0486CC7A007CD1D0 /* Headers */ = {
|
|
||||||
isa = PBXHeadersBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
00DAF8AA0BBE1A0E00EFEB98 /* Block in Headers */,
|
|
||||||
00DAF8AB0BBE1A0F00EFEB98 /* ReadWriteMutex in Headers */,
|
|
||||||
00DAF8AC0BBE1A0F00EFEB98 /* ReentrantMutex in Headers */,
|
|
||||||
BE11837D05D7083B00EB53E5 /* Barrier in Headers */,
|
|
||||||
BE11837E05D7083B00EB53E5 /* Condition in Headers */,
|
|
||||||
BE11837F05D7083B00EB53E5 /* Exports in Headers */,
|
|
||||||
BE11838005D7083B00EB53E5 /* Mutex in Headers */,
|
|
||||||
BE11838105D7083B00EB53E5 /* ScopedLock in Headers */,
|
|
||||||
BE11838205D7083B00EB53E5 /* Thread in Headers */,
|
|
||||||
8D07F2BE0486CC7A007CD1D0 /* OpenThreads_Prefix.pch in Headers */,
|
|
||||||
BE11833405D6FE3900EB53E5 /* PThreadBarrierPrivateData.h in Headers */,
|
|
||||||
BE11833605D6FE3900EB53E5 /* PThreadConditionPrivateData.h in Headers */,
|
|
||||||
BE11833805D6FE3900EB53E5 /* PThreadMutexPrivateData.h in Headers */,
|
|
||||||
BE11833905D6FE3900EB53E5 /* PThreadPrivateData.h in Headers */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXHeadersBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
|
||||||
8D07F2BC0486CC7A007CD1D0 /* OpenThreads */ = {
|
|
||||||
isa = PBXNativeTarget;
|
|
||||||
buildConfigurationList = 0011012F0873634F0015C576 /* Build configuration list for PBXNativeTarget "OpenThreads" */;
|
|
||||||
buildPhases = (
|
|
||||||
8D07F2BD0486CC7A007CD1D0 /* Headers */,
|
|
||||||
8D07F2BF0486CC7A007CD1D0 /* Resources */,
|
|
||||||
8D07F2C10486CC7A007CD1D0 /* Sources */,
|
|
||||||
8D07F2C30486CC7A007CD1D0 /* Frameworks */,
|
|
||||||
8D07F2C50486CC7A007CD1D0 /* Rez */,
|
|
||||||
);
|
|
||||||
buildRules = (
|
|
||||||
);
|
|
||||||
dependencies = (
|
|
||||||
);
|
|
||||||
name = OpenThreads;
|
|
||||||
productInstallPath = "$(HOME)/Library/Frameworks";
|
|
||||||
productName = OpenThreads;
|
|
||||||
productReference = 8D07F2C80486CC7A007CD1D0 /* OpenThreads.framework */;
|
|
||||||
productType = "com.apple.product-type.framework";
|
|
||||||
};
|
|
||||||
/* End PBXNativeTarget section */
|
|
||||||
|
|
||||||
/* Begin PBXProject section */
|
|
||||||
0867D690FE84028FC02AAC07 /* Project object */ = {
|
|
||||||
isa = PBXProject;
|
|
||||||
buildConfigurationList = 001101330873634F0015C576 /* Build configuration list for PBXProject "OpenThreads" */;
|
|
||||||
hasScannedForEncodings = 1;
|
|
||||||
mainGroup = 0867D691FE84028FC02AAC07 /* OpenThreads */;
|
|
||||||
productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */;
|
|
||||||
projectDirPath = "";
|
|
||||||
targets = (
|
|
||||||
8D07F2BC0486CC7A007CD1D0 /* OpenThreads */,
|
|
||||||
);
|
|
||||||
};
|
|
||||||
/* End PBXProject section */
|
|
||||||
|
|
||||||
/* Begin PBXResourcesBuildPhase section */
|
|
||||||
8D07F2BF0486CC7A007CD1D0 /* Resources */ = {
|
|
||||||
isa = PBXResourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXResourcesBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXRezBuildPhase section */
|
|
||||||
8D07F2C50486CC7A007CD1D0 /* Rez */ = {
|
|
||||||
isa = PBXRezBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXRezBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
|
||||||
8D07F2C10486CC7A007CD1D0 /* Sources */ = {
|
|
||||||
isa = PBXSourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
BE11835105D7022C00EB53E5 /* PThread.c++ in Sources */,
|
|
||||||
BE11835205D7022C00EB53E5 /* PThreadBarrier.c++ in Sources */,
|
|
||||||
BE11835405D7022C00EB53E5 /* PThreadCondition.c++ in Sources */,
|
|
||||||
BE11835605D7022C00EB53E5 /* PThreadMutex.c++ in Sources */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXSourcesBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXVariantGroup section */
|
|
||||||
089C1666FE841158C02AAC07 /* InfoPlist.strings */ = {
|
|
||||||
isa = PBXVariantGroup;
|
|
||||||
children = (
|
|
||||||
089C1667FE841158C02AAC07 /* English */,
|
|
||||||
);
|
|
||||||
name = InfoPlist.strings;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
/* End PBXVariantGroup section */
|
|
||||||
|
|
||||||
/* Begin XCBuildConfiguration section */
|
|
||||||
001101300873634F0015C576 /* Development */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
COPY_PHASE_STRIP = NO;
|
|
||||||
DEBUGGING_SYMBOLS = YES;
|
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
|
||||||
FRAMEWORK_VERSION = A;
|
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
|
||||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
|
||||||
GCC_ENABLE_TRIGRAPHS = NO;
|
|
||||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
|
||||||
GCC_PREFIX_HEADER = OpenThreads_Prefix.pch;
|
|
||||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
|
||||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
|
|
||||||
GCC_WARN_UNKNOWN_PRAGMAS = NO;
|
|
||||||
INFOPLIST_FILE = Info.plist;
|
|
||||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
|
||||||
LIBRARY_STYLE = Dynamic;
|
|
||||||
MACH_O_TYPE = mh_dylib;
|
|
||||||
OTHER_CFLAGS = "";
|
|
||||||
OTHER_LDFLAGS = (
|
|
||||||
"-seg1addr",
|
|
||||||
0x1FF00000,
|
|
||||||
);
|
|
||||||
PRODUCT_NAME = OpenThreads;
|
|
||||||
SECTORDER_FLAGS = "";
|
|
||||||
SYMROOT = ../OpenSceneGraph/build;
|
|
||||||
WARNING_CFLAGS = (
|
|
||||||
"-Wmost",
|
|
||||||
"-Wno-four-char-constants",
|
|
||||||
"-Wno-unknown-pragmas",
|
|
||||||
);
|
|
||||||
WRAPPER_EXTENSION = framework;
|
|
||||||
ZERO_LINK = YES;
|
|
||||||
};
|
|
||||||
name = Development;
|
|
||||||
};
|
|
||||||
001101310873634F0015C576 /* Deployment */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
COPY_PHASE_STRIP = YES;
|
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
|
||||||
FRAMEWORK_VERSION = A;
|
|
||||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
|
||||||
GCC_ENABLE_TRIGRAPHS = NO;
|
|
||||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
|
||||||
GCC_PREFIX_HEADER = OpenThreads_Prefix.pch;
|
|
||||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
|
||||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
|
|
||||||
GCC_WARN_UNKNOWN_PRAGMAS = NO;
|
|
||||||
INFOPLIST_FILE = Info.plist;
|
|
||||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
|
||||||
LIBRARY_STYLE = Dynamic;
|
|
||||||
MACH_O_TYPE = mh_dylib;
|
|
||||||
OTHER_CFLAGS = "";
|
|
||||||
OTHER_LDFLAGS = (
|
|
||||||
"-seg1addr",
|
|
||||||
0x1FF00000,
|
|
||||||
);
|
|
||||||
PRODUCT_NAME = OpenThreads;
|
|
||||||
SECTORDER_FLAGS = "";
|
|
||||||
STRIP_INSTALLED_PRODUCT = YES;
|
|
||||||
WARNING_CFLAGS = (
|
|
||||||
"-Wmost",
|
|
||||||
"-Wno-four-char-constants",
|
|
||||||
"-Wno-unknown-pragmas",
|
|
||||||
);
|
|
||||||
WRAPPER_EXTENSION = framework;
|
|
||||||
ZERO_LINK = NO;
|
|
||||||
};
|
|
||||||
name = Deployment;
|
|
||||||
};
|
|
||||||
001101320873634F0015C576 /* Default */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
|
||||||
FRAMEWORK_VERSION = A;
|
|
||||||
GCC_ENABLE_TRIGRAPHS = NO;
|
|
||||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
|
||||||
GCC_PREFIX_HEADER = OpenThreads_Prefix.pch;
|
|
||||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
|
||||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
|
|
||||||
GCC_WARN_UNKNOWN_PRAGMAS = NO;
|
|
||||||
INFOPLIST_FILE = Info.plist;
|
|
||||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
|
||||||
LIBRARY_STYLE = Dynamic;
|
|
||||||
MACH_O_TYPE = mh_dylib;
|
|
||||||
OTHER_CFLAGS = "";
|
|
||||||
OTHER_LDFLAGS = (
|
|
||||||
"-seg1addr",
|
|
||||||
0x1FF00000,
|
|
||||||
);
|
|
||||||
PRODUCT_NAME = OpenThreads;
|
|
||||||
SECTORDER_FLAGS = "";
|
|
||||||
WARNING_CFLAGS = (
|
|
||||||
"-Wmost",
|
|
||||||
"-Wno-four-char-constants",
|
|
||||||
"-Wno-unknown-pragmas",
|
|
||||||
);
|
|
||||||
WRAPPER_EXTENSION = framework;
|
|
||||||
};
|
|
||||||
name = Default;
|
|
||||||
};
|
|
||||||
001101340873634F0015C576 /* Development */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ARCHS = (
|
|
||||||
ppc,
|
|
||||||
i386,
|
|
||||||
);
|
|
||||||
GCC_AUTO_VECTORIZATION = YES;
|
|
||||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
|
|
||||||
GCC_MODEL_TUNING = G5;
|
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
|
||||||
HEADER_SEARCH_PATHS = (
|
|
||||||
../../include,
|
|
||||||
"$(inherited)",
|
|
||||||
);
|
|
||||||
PREBINDING = NO;
|
|
||||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
|
||||||
STRIP_STYLE = "non-global";
|
|
||||||
};
|
|
||||||
name = Development;
|
|
||||||
};
|
|
||||||
001101350873634F0015C576 /* Deployment */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ARCHS = (
|
|
||||||
ppc,
|
|
||||||
i386,
|
|
||||||
);
|
|
||||||
DEPLOYMENT_POSTPROCESSING = YES;
|
|
||||||
GCC_AUTO_VECTORIZATION = YES;
|
|
||||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
|
|
||||||
GCC_MODEL_TUNING = G5;
|
|
||||||
GCC_OPTIMIZATION_LEVEL = s;
|
|
||||||
HEADER_SEARCH_PATHS = ../../include;
|
|
||||||
PREBINDING = NO;
|
|
||||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
|
||||||
STRIP_STYLE = "non-global";
|
|
||||||
};
|
|
||||||
name = Deployment;
|
|
||||||
};
|
|
||||||
001101360873634F0015C576 /* Default */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ARCHS = (
|
|
||||||
ppc,
|
|
||||||
i386,
|
|
||||||
);
|
|
||||||
GCC_AUTO_VECTORIZATION = YES;
|
|
||||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
|
|
||||||
GCC_MODEL_TUNING = G5;
|
|
||||||
GCC_OPTIMIZATION_LEVEL = 3;
|
|
||||||
HEADER_SEARCH_PATHS = ../../include;
|
|
||||||
PREBINDING = NO;
|
|
||||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
|
||||||
STRIP_STYLE = "non-global";
|
|
||||||
};
|
|
||||||
name = Default;
|
|
||||||
};
|
|
||||||
/* End XCBuildConfiguration section */
|
|
||||||
|
|
||||||
/* Begin XCConfigurationList section */
|
|
||||||
0011012F0873634F0015C576 /* Build configuration list for PBXNativeTarget "OpenThreads" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
001101300873634F0015C576 /* Development */,
|
|
||||||
001101310873634F0015C576 /* Deployment */,
|
|
||||||
001101320873634F0015C576 /* Default */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Default;
|
|
||||||
};
|
|
||||||
001101330873634F0015C576 /* Build configuration list for PBXProject "OpenThreads" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
001101340873634F0015C576 /* Development */,
|
|
||||||
001101350873634F0015C576 /* Deployment */,
|
|
||||||
001101360873634F0015C576 /* Default */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Default;
|
|
||||||
};
|
|
||||||
/* End XCConfigurationList section */
|
|
||||||
};
|
|
||||||
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
//
|
|
||||||
// Prefix header for all source files of the 'OpenThreads' target in the 'OpenThreads' project.
|
|
||||||
//
|
|
||||||
|
|
||||||
//#include <Carbon/Carbon.h>
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>BuildVersion</key>
|
|
||||||
<string>38</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>ProjectName</key>
|
|
||||||
<string>CarbonProjectTemplates</string>
|
|
||||||
<key>SourceVersion</key>
|
|
||||||
<string>140000</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -26,20 +26,20 @@ SET(TARGET_COMMON_LIBRARIES
|
|||||||
osgText
|
osgText
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(osgviewer)
|
IF(DYNAMIC_OPENSCENEGRAPH)
|
||||||
ADD_SUBDIRECTORY(osgarchive)
|
|
||||||
ADD_SUBDIRECTORY(osgconv)
|
|
||||||
ADD_SUBDIRECTORY(osgversion)
|
|
||||||
ADD_SUBDIRECTORY(osgfilecache)
|
|
||||||
|
|
||||||
#REWRITE_CMAKELIST(ADD_OSG_EXAMPLE)
|
ADD_SUBDIRECTORY(osgviewer)
|
||||||
|
ADD_SUBDIRECTORY(osgarchive)
|
||||||
|
ADD_SUBDIRECTORY(osgconv)
|
||||||
|
ADD_SUBDIRECTORY(osgfilecache)
|
||||||
|
ADD_SUBDIRECTORY(osgversion)
|
||||||
|
|
||||||
#MESSAGE("---->${MY_EXAMPLE_LIST}<---------")
|
ELSE(DYNAMIC_OPENSCENEGRAPH)
|
||||||
##########to get all the variables of Cmake
|
|
||||||
#GET_CMAKE_PROPERTY(MYVARS VARIABLES)
|
# need to define this on win32 or linker cries about _declspecs
|
||||||
#FOREACH(myvar ${MYVARS})
|
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
|
||||||
# FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt
|
|
||||||
# "${myvar} -->${${myvar}}<-\n"
|
ADD_SUBDIRECTORY(osgversion)
|
||||||
# )
|
|
||||||
#ENDFOREACH(myvar)
|
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,12 @@ int main( int argc, char **argv )
|
|||||||
else if (fileType==osgDB::DIRECTORY)
|
else if (fileType==osgDB::DIRECTORY)
|
||||||
{
|
{
|
||||||
osgDB::DirectoryContents directory = osgDB::getDirectoryContents(arguments[pos]);
|
osgDB::DirectoryContents directory = osgDB::getDirectoryContents(arguments[pos]);
|
||||||
files.insert(files.end(),directory.begin(),directory.end());
|
osgDB::DirectoryContents::iterator it = directory.begin();
|
||||||
|
while( it != directory.end())
|
||||||
|
{
|
||||||
|
files.push_back(filePath + "/" + (*it));
|
||||||
|
++it;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -493,6 +493,17 @@ static void usage( const char *prog, const char *msg )
|
|||||||
" their own color values (--addMissingColours also accepted)."<< std::endl;
|
" their own color values (--addMissingColours also accepted)."<< std::endl;
|
||||||
osg::notify(osg::NOTICE)<<" --overallNormal - Replace normals with a single overall normal."<< std::endl;
|
osg::notify(osg::NOTICE)<<" --overallNormal - Replace normals with a single overall normal."<< std::endl;
|
||||||
|
|
||||||
|
osg::notify( osg::NOTICE ) << std::endl;
|
||||||
|
osg::notify( osg::NOTICE ) <<
|
||||||
|
" --formats - Lists all supported formats and their supported options." << std::endl;
|
||||||
|
osg::notify( osg::NOTICE ) <<
|
||||||
|
" --format <format> - Displays information about the spefied <format>, where <format>\n"
|
||||||
|
" is the file extension, such as \"flt\"." << std::endl;
|
||||||
|
osg::notify( osg::NOTICE ) <<
|
||||||
|
" --plugins - Lists all supported plugin files." << std::endl;
|
||||||
|
osg::notify( osg::NOTICE ) <<
|
||||||
|
" --plugin >plugin> - Displays information about the spefied <plugin>, where <plugin>\n"
|
||||||
|
" is the plugin's full path and file name." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -507,8 +518,8 @@ int main( int argc, char **argv )
|
|||||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--help-env","Display environmental variables available");
|
arguments.getApplicationUsage()->addCommandLineOption("--help-env","Display environmental variables available");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--formats","List supported file formats");
|
//arguments.getApplicationUsage()->addCommandLineOption("--formats","List supported file formats");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--plugins","List database olugins");
|
//arguments.getApplicationUsage()->addCommandLineOption("--plugins","List database olugins");
|
||||||
|
|
||||||
|
|
||||||
// if user request help write it out to cout.
|
// if user request help write it out to cout.
|
||||||
|
|||||||
@@ -22,11 +22,14 @@
|
|||||||
#include <osgDB/ReadFile>
|
#include <osgDB/ReadFile>
|
||||||
#include <osgDB/WriteFile>
|
#include <osgDB/WriteFile>
|
||||||
#include <osgDB/FileUtils>
|
#include <osgDB/FileUtils>
|
||||||
|
#include <osgDB/FileCache>
|
||||||
|
#include <osgDB/FileNameUtils>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
static bool s_ExitApplication = false;
|
static bool s_ExitApplication = false;
|
||||||
|
|
||||||
@@ -134,6 +137,8 @@ public:
|
|||||||
LoadDataVisitor():
|
LoadDataVisitor():
|
||||||
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
|
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
|
||||||
_currentLevel(0) {}
|
_currentLevel(0) {}
|
||||||
|
|
||||||
|
void setFileCache(osgDB::FileCache* fileCache) { _fileCache = fileCache; }
|
||||||
|
|
||||||
void addExtents(unsigned int maxLevel, double minX, double minY, double maxX, double maxY)
|
void addExtents(unsigned int maxLevel, double minX, double minY, double maxX, double maxY)
|
||||||
{
|
{
|
||||||
@@ -242,9 +247,8 @@ public:
|
|||||||
filename = plod.getFileName(i);
|
filename = plod.getFileName(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::notify(osg::NOTICE)<<"reading "<<filename<<std::endl;
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Node> node = osgDB::readNodeFile(filename);
|
osg::ref_ptr<osg::Node> node = readNodeFileAndWriteToCache(filename);
|
||||||
|
|
||||||
if (!s_ExitApplication && node.valid()) node->accept(*this);
|
if (!s_ExitApplication && node.valid()) node->accept(*this);
|
||||||
}
|
}
|
||||||
@@ -267,6 +271,37 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
osg::Node* readNodeFileAndWriteToCache(const std::string& filename)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (_fileCache.valid() && osgDB::containsServerAddress(filename))
|
||||||
|
{
|
||||||
|
if (_fileCache->existsInCache(filename))
|
||||||
|
{
|
||||||
|
osg::notify(osg::NOTICE)<<"reading from FileCache: "<<filename<<std::endl;
|
||||||
|
return _fileCache->readNode(filename, osgDB::Registry::instance()->getOptions()).takeNode();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
|
||||||
|
|
||||||
|
osg::Node* node = osgDB::readNodeFile(filename);
|
||||||
|
if (node)
|
||||||
|
{
|
||||||
|
osg::notify(osg::NOTICE)<<"write to FileCache : "<<filename<<std::endl;
|
||||||
|
|
||||||
|
_fileCache->writeNode(*node, filename, osgDB::Registry::instance()->getOptions());
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
|
||||||
|
return osgDB::readNodeFile(filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
inline void pushMatrix(osg::Matrix& matrix) { _matrixStack.push_back(matrix); }
|
inline void pushMatrix(osg::Matrix& matrix) { _matrixStack.push_back(matrix); }
|
||||||
@@ -332,7 +367,8 @@ protected:
|
|||||||
typedef std::vector<Extents> ExtentsList;
|
typedef std::vector<Extents> ExtentsList;
|
||||||
typedef std::vector<osg::Matrix> MatrixStack;
|
typedef std::vector<osg::Matrix> MatrixStack;
|
||||||
typedef std::vector<osg::CoordinateSystemNode*> CSNStack;
|
typedef std::vector<osg::CoordinateSystemNode*> CSNStack;
|
||||||
|
|
||||||
|
osg::ref_ptr<osgDB::FileCache> _fileCache;
|
||||||
|
|
||||||
ExtentsList _extentsList;
|
ExtentsList _extentsList;
|
||||||
unsigned int _currentLevel;
|
unsigned int _currentLevel;
|
||||||
@@ -384,6 +420,26 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
LoadDataVisitor ldv;
|
LoadDataVisitor ldv;
|
||||||
|
|
||||||
|
std::string fileCachePath;
|
||||||
|
while(arguments.read("--file-cache",fileCachePath) || arguments.read("-c",fileCachePath)) {}
|
||||||
|
|
||||||
|
if (fileCachePath.empty())
|
||||||
|
{
|
||||||
|
const char* env_fileCachePath = getenv("OSG_FILE_CACHE");
|
||||||
|
if (env_fileCachePath)
|
||||||
|
{
|
||||||
|
fileCachePath = env_fileCachePath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileCachePath.empty())
|
||||||
|
{
|
||||||
|
std::cout<<"No path to the file cache defined, please set OSG_FILE_PATH env var, or use --file-cache <directory> to set a suitable directory for the file cache."<<std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ldv.setFileCache(new osgDB::FileCache(fileCachePath));
|
||||||
|
|
||||||
unsigned int maxLevels = 0;
|
unsigned int maxLevels = 0;
|
||||||
while(arguments.read("-l",maxLevels))
|
while(arguments.read("-l",maxLevels))
|
||||||
{
|
{
|
||||||
@@ -396,18 +452,24 @@ int main( int argc, char **argv )
|
|||||||
ldv.addExtents(maxLevels, minX, minY, maxX, maxY);
|
ldv.addExtents(maxLevels, minX, minY, maxX, maxY);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string fileCache;
|
|
||||||
while(arguments.read("--file-cache",fileCache) || arguments.read("-c",fileCache)) {}
|
|
||||||
|
|
||||||
if (!fileCache.empty())
|
std::string filename;
|
||||||
{
|
for(int i=1; i<arguments.argc(); ++i)
|
||||||
std::string str("OSG_FILE_CACHE=");
|
{
|
||||||
str += fileCache;
|
if (!arguments.isOption(i))
|
||||||
|
{
|
||||||
putenv(strdup((char*)str.c_str()));
|
filename = arguments[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
|
if (filename.empty())
|
||||||
|
{
|
||||||
|
std::cout<<"No file to load specified."<<std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Node> loadedModel = ldv.readNodeFileAndWriteToCache(filename);
|
||||||
if (!loadedModel)
|
if (!loadedModel)
|
||||||
{
|
{
|
||||||
std::cout<<"No data loaded, please specify a database to load"<<std::endl;
|
std::cout<<"No data loaded, please specify a database to load"<<std::endl;
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
SET(TARGET_SRC osgversion.cpp )
|
SET(TARGET_SRC osgversion.cpp )
|
||||||
|
|
||||||
|
IF (OSG_MAINTAINER)
|
||||||
|
SET(TARGET_SRC ${TARGET_SRC} Contributors.cpp )
|
||||||
|
ADD_DEFINITIONS("-DBUILD_CONTRIBUTORS")
|
||||||
|
ENDIF(OSG_MAINTAINER)
|
||||||
|
|
||||||
SET(TARGET_COMMON_LIBRARIES
|
SET(TARGET_COMMON_LIBRARIES
|
||||||
OpenThreads
|
OpenThreads
|
||||||
osg
|
osg
|
||||||
|
osgDB
|
||||||
)
|
)
|
||||||
|
|
||||||
SETUP_COMMANDLINE_APPLICATION(osgversion)
|
SETUP_COMMANDLINE_APPLICATION(osgversion)
|
||||||
|
|||||||
838
applications/osgversion/Contributors.cpp
Normal file
838
applications/osgversion/Contributors.cpp
Normal file
@@ -0,0 +1,838 @@
|
|||||||
|
// The majority of the application is dedicated to building the
|
||||||
|
// current contribitors list by parsing the ChangeLog, it just takes
|
||||||
|
// one line in the main itself to report the version number.
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
#include <vector>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <OpenThreads/Version>
|
||||||
|
|
||||||
|
#include <osg/Notify>
|
||||||
|
#include <osg/Version>
|
||||||
|
#include <osg/ArgumentParser>
|
||||||
|
#include <osg/ApplicationUsage>
|
||||||
|
|
||||||
|
#include <osg/Matrix>
|
||||||
|
#include <osg/Plane>
|
||||||
|
#include <osg/BoundingBox>
|
||||||
|
#include <osg/BoundingSphere>
|
||||||
|
|
||||||
|
#include <osgDB/fstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma setlocale("C")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef pair<string, string> NamePair;
|
||||||
|
typedef map<NamePair, unsigned int> NameMap;
|
||||||
|
typedef vector<string> Words;
|
||||||
|
|
||||||
|
NamePair EmptyNamePair;
|
||||||
|
NamePair NameRobertOsfield("Robert", "Osfield");
|
||||||
|
NamePair NameDonBurns ("Don", "Burns");
|
||||||
|
|
||||||
|
|
||||||
|
const char* validNames[] =
|
||||||
|
{
|
||||||
|
"de",
|
||||||
|
"den",
|
||||||
|
"van"
|
||||||
|
};
|
||||||
|
|
||||||
|
const char* invalidNames[] =
|
||||||
|
{
|
||||||
|
"Added",
|
||||||
|
"AnimationPath",
|
||||||
|
"AnimationPathCallback",
|
||||||
|
"AnimationPathManipulator",
|
||||||
|
"ArgumentParser",
|
||||||
|
"AttrData",
|
||||||
|
"AutoTransform",
|
||||||
|
"AutoTransform.",
|
||||||
|
"Azimuth",
|
||||||
|
"BlenColour(Vec4",
|
||||||
|
"Camera",
|
||||||
|
"CameraBarrierCallback",
|
||||||
|
"CameraNode",
|
||||||
|
"Canvas",
|
||||||
|
"CluserCullingCallback",
|
||||||
|
"ClusterCullingCallback",
|
||||||
|
"CoordinateSystem",
|
||||||
|
"CoordinateSystemNode",
|
||||||
|
"CoordinateSystemNode&",
|
||||||
|
"CopyOp",
|
||||||
|
"Copyright",
|
||||||
|
"Core",
|
||||||
|
"Creator",
|
||||||
|
"CullCallbacks",
|
||||||
|
"CullingSettngs",
|
||||||
|
"CullVisitor",
|
||||||
|
"CullVistor",
|
||||||
|
"Cygwin",
|
||||||
|
"DatabasePager",
|
||||||
|
"DataSet",
|
||||||
|
"DataVariance",
|
||||||
|
"DeleteHandler",
|
||||||
|
"DisplaySettings",
|
||||||
|
"Drawable",
|
||||||
|
"DrawElementsUByte",
|
||||||
|
"Endian",
|
||||||
|
"Escape",
|
||||||
|
"EventQueue",
|
||||||
|
"Face",
|
||||||
|
"Files",
|
||||||
|
"Fixed",
|
||||||
|
"Fixes",
|
||||||
|
"FluidProgram",
|
||||||
|
"FontImplementation",
|
||||||
|
"FrameStats",
|
||||||
|
"Framstamp",
|
||||||
|
"FreeBSD",
|
||||||
|
"Geode",
|
||||||
|
"GeoemtryTechnique",
|
||||||
|
"GeometryTechnique",
|
||||||
|
"GeoSet",
|
||||||
|
"GraphicsContext",
|
||||||
|
"GraphicsContextImplementation",
|
||||||
|
"GraphicsThread",
|
||||||
|
"GraphicsWindowX11",
|
||||||
|
"Group",
|
||||||
|
"Image",
|
||||||
|
"ImageOptions",
|
||||||
|
"Images",
|
||||||
|
"Images/SolarSystem",
|
||||||
|
"ImageStream",
|
||||||
|
"Improved",
|
||||||
|
"IndexBlock",
|
||||||
|
"IndexFaceSets",
|
||||||
|
"IntersectVisitor",
|
||||||
|
"Inventor",
|
||||||
|
"KdTree",
|
||||||
|
"KeyboardMouse",
|
||||||
|
"KeyboardMouseCallback",
|
||||||
|
"LightModel",
|
||||||
|
"LightPointNode",
|
||||||
|
"LineSegment",
|
||||||
|
"LineStipple",
|
||||||
|
"Logos",
|
||||||
|
"LongIDRecord",
|
||||||
|
"Make",
|
||||||
|
"Makefile",
|
||||||
|
"Material",
|
||||||
|
"Matrix",
|
||||||
|
"Matrix*",
|
||||||
|
"MatrixManipulator",
|
||||||
|
"MatrixTransform",
|
||||||
|
"MemoryManager",
|
||||||
|
"MergeGeometryVisitor",
|
||||||
|
"MeshRecord",
|
||||||
|
"Mode",
|
||||||
|
"Mr",
|
||||||
|
"Multigen",
|
||||||
|
"New",
|
||||||
|
"NewCullVisitor",
|
||||||
|
"NodeVisitor",
|
||||||
|
"Object",
|
||||||
|
"OpenDX",
|
||||||
|
"OpenSceneGraph",
|
||||||
|
"OpenSceneGraph-2",
|
||||||
|
"OpenSceneGraph-osgWidget-dev",
|
||||||
|
"OpenThreads",
|
||||||
|
"OperationThread",
|
||||||
|
"Optimizer",
|
||||||
|
"OrientationConverter",
|
||||||
|
"Osfields",
|
||||||
|
"Ouput",
|
||||||
|
"Output",
|
||||||
|
"OveralyNode",
|
||||||
|
"PagedLOD",
|
||||||
|
"PageLOD",
|
||||||
|
"Paging",
|
||||||
|
"ParentList",
|
||||||
|
"Performer",
|
||||||
|
"PickHandler",
|
||||||
|
"PixelDataBufferObject",
|
||||||
|
"PolygonStipple",
|
||||||
|
"PolytopeVisitor",
|
||||||
|
"PrimitiveIndexFunctor",
|
||||||
|
"Prodcuer",
|
||||||
|
"Producer",
|
||||||
|
"ProducerEventCallback",
|
||||||
|
"Program",
|
||||||
|
"Proxy",
|
||||||
|
"ProxyNode",
|
||||||
|
"Quake3",
|
||||||
|
"Quicktime",
|
||||||
|
"ReaderWriters",
|
||||||
|
"ReentrantMutex",
|
||||||
|
"Referenced",
|
||||||
|
"ReferenceFrame",
|
||||||
|
"Removed",
|
||||||
|
"RemoveLoadedProxyNodes",
|
||||||
|
"RenderStage",
|
||||||
|
"RenderTargetFallback",
|
||||||
|
"RenderToTextureStage",
|
||||||
|
"SceneGraphBuilder",
|
||||||
|
"SceneView",
|
||||||
|
"Sequence",
|
||||||
|
"Shape",
|
||||||
|
"SimpleViewer",
|
||||||
|
"SimpleViewer",
|
||||||
|
"SmokeTrailEffect",
|
||||||
|
"Source",
|
||||||
|
"SpotExponent",
|
||||||
|
"State",
|
||||||
|
"StateAttribute",
|
||||||
|
"Stats",
|
||||||
|
"StatsVisitor",
|
||||||
|
"Studio",
|
||||||
|
"Support",
|
||||||
|
"Switch",
|
||||||
|
"TechniqueEventHandler",
|
||||||
|
"TerraPage",
|
||||||
|
"TessellationHints",
|
||||||
|
"TestManipulator",
|
||||||
|
"TestSupportCallback",
|
||||||
|
"TexEnv",
|
||||||
|
"TexMat(Matrix",
|
||||||
|
"Texture",
|
||||||
|
"Texture2DArray",
|
||||||
|
"Texture3D",
|
||||||
|
"TextureCubeMap",
|
||||||
|
"TextureObjectManager",
|
||||||
|
"TextureRectangle",
|
||||||
|
"TextureRectangle(Image*",
|
||||||
|
"TextureType",
|
||||||
|
"Texuture",
|
||||||
|
"TriStripVisitor",
|
||||||
|
"TrPageViewer",
|
||||||
|
"Uniform",
|
||||||
|
"UseFarLineSegments",
|
||||||
|
"UserData",
|
||||||
|
"Valve",
|
||||||
|
"Vec*",
|
||||||
|
"Vec2d",
|
||||||
|
"Vec3d",
|
||||||
|
"Vec4ub",
|
||||||
|
"Version",
|
||||||
|
"VertexData",
|
||||||
|
"View",
|
||||||
|
"Viewer",
|
||||||
|
"ViewPoint",
|
||||||
|
"Viewport",
|
||||||
|
"Viewport",
|
||||||
|
"Visual",
|
||||||
|
"VisualStudio",
|
||||||
|
"WindowData",
|
||||||
|
"Windows",
|
||||||
|
"X",
|
||||||
|
"Xcode",
|
||||||
|
"Y"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct TypoCorrection
|
||||||
|
{
|
||||||
|
const char* original;
|
||||||
|
const char* corrected;
|
||||||
|
};
|
||||||
|
|
||||||
|
TypoCorrection typoCorrections[] =
|
||||||
|
{
|
||||||
|
{"Aderian", "Adrian"},
|
||||||
|
{"Adndre", "Andre"},
|
||||||
|
{"Adrain", "Adrian"},
|
||||||
|
{"Amueller", "Aumueller"},
|
||||||
|
{"Andew", "Andrew"},
|
||||||
|
{"André", "Andr<EFBFBD>"},
|
||||||
|
{"Antione", "Antoine"},
|
||||||
|
{"Antonoine", "Antoine"},
|
||||||
|
{"Atr", "Art"},
|
||||||
|
{"Baverage", "Beverage"},
|
||||||
|
{"Bistroviae", "Bistrovic"},
|
||||||
|
{"Callue", "Callu"},
|
||||||
|
{"Christaiansen", "Christiansen"},
|
||||||
|
{"Cobin", "Corbin"},
|
||||||
|
{"Comporesi", "Camporesi"},
|
||||||
|
{"Connel", "Connell"},
|
||||||
|
{"Cullu", "Callu"},
|
||||||
|
{"Daneil", "Daniel"},
|
||||||
|
{"Daust", "Daoust"},
|
||||||
|
{"Daved", "David"},
|
||||||
|
{"Drederic", "Frederic"},
|
||||||
|
{"Eileman", "Eilemann"},
|
||||||
|
{"Elgi", "Egli"},
|
||||||
|
{"Fabian", "Fabien"},
|
||||||
|
{"Fautre", "Fautr<EFBFBD>"},
|
||||||
|
{"Frashid", "Farshid"},
|
||||||
|
{"Fred", "Frederic"},
|
||||||
|
{"Fredrick", "Frederic"},
|
||||||
|
{"Fredric", "Frederic"},
|
||||||
|
{"Froechlich", "Fr<EFBFBD>hlich"},
|
||||||
|
{"Froehilch", "Fr<EFBFBD>hlich"},
|
||||||
|
{"Froehlich", "Fr<EFBFBD>hlich"},
|
||||||
|
{"Froelich", "Fr<EFBFBD>hlich"},
|
||||||
|
{"Froenlich", "Fr<EFBFBD>hlich"},
|
||||||
|
{"Fröhlich", "Fr<EFBFBD>hlich"},
|
||||||
|
{"Fruciel", "Frauciel"},
|
||||||
|
{"García", "Garcea"},
|
||||||
|
{"Garrat", "Garrett"},
|
||||||
|
{"Garret", "Garrett"},
|
||||||
|
{"Geof", "Geoff"},
|
||||||
|
{"Giatan", "Gaitan"},
|
||||||
|
{"Gronenger", "Gronager"},
|
||||||
|
{"Gronger", "Gronager"},
|
||||||
|
{"Haritchablaet", "Haritchabalet"},
|
||||||
|
{"Hebelin", "Herbelin"},
|
||||||
|
{"Heirtlein", "Hertlein"},
|
||||||
|
{"Heirtlein", "Hertlein"},
|
||||||
|
{"Hertleinm", "Hertlein"},
|
||||||
|
{"Hertlien", "Hertlein"},
|
||||||
|
{"Hi", "He"},
|
||||||
|
{"Hooper", "Hopper"},
|
||||||
|
{"Inverson", "Iverson"},
|
||||||
|
{"Iversion", "Iverson"},
|
||||||
|
{"Jean-Sebastein", "Jean-Sebastien"},
|
||||||
|
{"Jean-Sebastian", "Jean-Sebastien"},
|
||||||
|
{"Jean-Sebastirn", "Jean-Sebastien"},
|
||||||
|
{"Jea-Sebastien", "Jean-Sebastien"},
|
||||||
|
{"Johhansen", "Johansen"},
|
||||||
|
{"Johnansen", "Johansen"},
|
||||||
|
{"Johnasen", "Johansen"},
|
||||||
|
{"Jolly", "Jolley"},
|
||||||
|
{"Jose", "Jos<EFBFBD>"},
|
||||||
|
{"José", "Jos<EFBFBD>"},
|
||||||
|
{"Joson", "Jason"},
|
||||||
|
{"J", "Jos<EFBFBD>"},
|
||||||
|
{"Keuhne", "Kuehne"},
|
||||||
|
{"Kheune", "Kuehne"},
|
||||||
|
{"Lagrade", "Lagarde"},
|
||||||
|
{"Largade", "Lagarde"},
|
||||||
|
{"Larshkari", "Lashkari"},
|
||||||
|
{"Lashakari", "Lashkari"},
|
||||||
|
{"Lashari", "Lashkari"},
|
||||||
|
{"Lasharki", "Lashkari"},
|
||||||
|
{"Laskari", "Lashkari"},
|
||||||
|
{"Leandowski", "Lewandowski"},
|
||||||
|
{"Lawandowski", "Lewandowski"},
|
||||||
|
{"Lucas", "Luaces"},
|
||||||
|
{"Lugi", "Luigi"},
|
||||||
|
{"Lweandowski", "Lewandowski"},
|
||||||
|
{"Maceij", "Maciej"},
|
||||||
|
{"Machler", "M<EFBFBD>chler"},
|
||||||
|
{"Macro", "Marco"},
|
||||||
|
{"Maechler", "M<EFBFBD>chler"},
|
||||||
|
{"Mahai", "Mihai"},
|
||||||
|
{"Mammond", "Marmond"},
|
||||||
|
{"March", "Marco"},
|
||||||
|
{"Martsz", "Martz"},
|
||||||
|
{"Marz", "Martz"},
|
||||||
|
{"Matz", "Martz"},
|
||||||
|
{"Melchoir", "Melchior"},
|
||||||
|
{"Mellis", "Melis"},
|
||||||
|
{"Messerschimdt", "Messerschmidt"},
|
||||||
|
{"Micheal", "Michael"},
|
||||||
|
{"Mihair", "Mihai"},
|
||||||
|
{"Molishtan", "Moloshtan"},
|
||||||
|
{"Molishtan", "Moloshtan"},
|
||||||
|
{"Moloshton", "Moloshtan"},
|
||||||
|
{"Morné", "Morn<EFBFBD>"},
|
||||||
|
{"Morne", "Morn<EFBFBD>"},
|
||||||
|
{"Moule", "Moiule"},
|
||||||
|
{"Narache", "Marache"},
|
||||||
|
{"Nicklov", "Nikolov"},
|
||||||
|
{"Nickolov", "Nikolov"},
|
||||||
|
{"Olad", "Olaf"},
|
||||||
|
{"Olar", "Olaf"},
|
||||||
|
{"Oritz", "Ortiz"},
|
||||||
|
{"Osfeld", "Osfield"},
|
||||||
|
{"Osfied", "Osfield"},
|
||||||
|
{"Pail", "Paul"},
|
||||||
|
{"Rajce", "Trajce"},
|
||||||
|
{"Randal", "Randall"},
|
||||||
|
{"Robet", "Robert"},
|
||||||
|
{"Rodger", "Roger"},
|
||||||
|
{"Rolad", "Roland"},
|
||||||
|
{"Rucard", "Richard"},
|
||||||
|
{"Sekender", "Sukender"},
|
||||||
|
{"Sewel", "Sewell"},
|
||||||
|
{"Simmonson", "Simonsson"},
|
||||||
|
{"Simmonsson", "Simonsson"},
|
||||||
|
{"Sjolie", "Sj<EFBFBD>lie"},
|
||||||
|
{"Sjölie", "Sj<EFBFBD>lie"},
|
||||||
|
{"Skinnder", "Skinner"},
|
||||||
|
{"Sokolosky", "Sokolowsky"},
|
||||||
|
{"Sokolowky", "Sokolowsky"},
|
||||||
|
{"Sokolowki", "Sokolowsky"},
|
||||||
|
{"Sokolowski", "Sokolowsky"},
|
||||||
|
{"Sokolsky", "Sokolowsky"},
|
||||||
|
{"Sokolwsky", "Sokolowsky"},
|
||||||
|
{"Sonda", "Sondra"},
|
||||||
|
{"Stansilav", "Stanislav"},
|
||||||
|
{"Stefan", "Stephan"},
|
||||||
|
{"Stell", "Steel"},
|
||||||
|
{"Sylvan", "Sylvain"},
|
||||||
|
{"Takeahei", "Takahei"},
|
||||||
|
{"Takehei", "Takahei"},
|
||||||
|
{"Tery", "Terry"},
|
||||||
|
{"Tarantilils", "Tarantilis"},
|
||||||
|
{"Trastenjak", "Trstenjak"},
|
||||||
|
{"Urlich", "Ulrich"},
|
||||||
|
{"Vines", "Vine"},
|
||||||
|
{"Waldrom", "Waldron"},
|
||||||
|
{"Wedner", "Weidner"},
|
||||||
|
{"Weidemann", "Wiedemann"},
|
||||||
|
{"Wieblen", "Weiblen"},
|
||||||
|
{"Woesnner", "Woessner"},
|
||||||
|
{"Wojchiech", "Wojciech"},
|
||||||
|
{"Wojiech", "Wojciech"},
|
||||||
|
{"Xennon", "Hanson"},
|
||||||
|
{"Yefrei", "Yefei"},
|
||||||
|
{"Yfei", "Yefei"}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct NameCorrection
|
||||||
|
{
|
||||||
|
const char* originalFirst;
|
||||||
|
const char* originalSecond;
|
||||||
|
const char* correctedFirst;
|
||||||
|
const char* correctedSecond;
|
||||||
|
};
|
||||||
|
|
||||||
|
NameCorrection nameCorrections[] =
|
||||||
|
{
|
||||||
|
{"Marc", "Sciabica",
|
||||||
|
"Mark", "Sciabica"},
|
||||||
|
{"Jean", "Sebastien",
|
||||||
|
"Jean-Sebastien", "Guay"},
|
||||||
|
{"Michale", "Platings",
|
||||||
|
"Michael", "Platings"},
|
||||||
|
{"Mick", "",
|
||||||
|
"Maik", "Keller"},
|
||||||
|
{"Gary", "Quin",
|
||||||
|
"Gary", "Quinn"},
|
||||||
|
{"BjornHein", "",
|
||||||
|
"Bj<EFBFBD>rn", "Hein"},
|
||||||
|
{"Bjorn", "Hein",
|
||||||
|
"Bj<EFBFBD>rn", "Hein"},
|
||||||
|
{"Erik", "van",
|
||||||
|
"Erik", "den Dekker"},
|
||||||
|
{"Erik", "den",
|
||||||
|
"Erik", "den Dekker"},
|
||||||
|
{"Jeoen", "den",
|
||||||
|
"Jeroen", "den Dekker"},
|
||||||
|
{"John", "Vidar",
|
||||||
|
"John", "Vidar Larring"},
|
||||||
|
{"John", "Vida",
|
||||||
|
"John", "Vidar Larring"},
|
||||||
|
{"Sebastien", "Messerschmidt",
|
||||||
|
"Sebastian", "Messerschmidt"},
|
||||||
|
{"Mattias", "Fr<EFBFBD>hlich",
|
||||||
|
"Mathias", "Fr<EFBFBD>hlich"},
|
||||||
|
{"Mathias", "Helsing",
|
||||||
|
"Mattias", "Helsing"},
|
||||||
|
{"Jose", "Delport",
|
||||||
|
"J.P.", "Delport"},
|
||||||
|
{"Jos<EFBFBD>", "Delport",
|
||||||
|
"J.P.", "Delport"},
|
||||||
|
{"Franz", "Melchior",
|
||||||
|
"Melchior", "Franz"},
|
||||||
|
{"Glen", "Waldon",
|
||||||
|
"Glenn", "Waldron"},
|
||||||
|
{"Ralf", "Karn",
|
||||||
|
"Ralf", "Kern"},
|
||||||
|
{"Donny", "Cipperly",
|
||||||
|
"Donald", "Cipperly"},
|
||||||
|
{"Gino", "van",
|
||||||
|
"Gino", "van den Bergen"},
|
||||||
|
{"Radu", "Mihai",
|
||||||
|
"Mihai", "Radu"},
|
||||||
|
{"Art", "Trevs",
|
||||||
|
"Art", "Tevs"},
|
||||||
|
{"Tim", "More",
|
||||||
|
"Tim", "Moore"},
|
||||||
|
{"Andre", "Garneau",
|
||||||
|
"Andr<EFBFBD>", "Garneau"},
|
||||||
|
{"Eric", "Hammil",
|
||||||
|
"Chris", "Hanson"},
|
||||||
|
{"Paul", "de",
|
||||||
|
"Paul", "de Repentigny"},
|
||||||
|
{"Raymond", "de",
|
||||||
|
"Raymond", "de Vries"},
|
||||||
|
{"Nick", "",
|
||||||
|
"Trajce", "Nikolov"},
|
||||||
|
{"Daniel", "",
|
||||||
|
"Daniel", "Sj<EFBFBD>lie"},
|
||||||
|
{"Julia", "Ortiz",
|
||||||
|
"Julian", "Ortiz"},
|
||||||
|
{"Rune", "Schmidt",
|
||||||
|
"Rune", "Schmidt Jensen"},
|
||||||
|
{"Romano", "Jos<EFBFBD>",
|
||||||
|
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
||||||
|
{"Rommano", "Silva",
|
||||||
|
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
||||||
|
{"Leandro", "Motta",
|
||||||
|
"Leandro", "Motta Barros"},
|
||||||
|
{"A", "Botorabi",
|
||||||
|
"Ali", "Botorabi"},
|
||||||
|
{"Waltice", "",
|
||||||
|
"Walter", "J. Altice"},
|
||||||
|
{"Drew", "",
|
||||||
|
"Drew", "Whitehouse"},
|
||||||
|
{"Douglas", "A",
|
||||||
|
"Douglas", "A. Pouk"},
|
||||||
|
{"Colin", "MacDonald",
|
||||||
|
"Colin", "McDonald"},
|
||||||
|
{"Nikolov", "Trajce",
|
||||||
|
"Trajce", "Nikolov"},
|
||||||
|
{"Frauciel", "Luc",
|
||||||
|
"Luc", "Frauciel"},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
bool validName(const string& first)
|
||||||
|
{
|
||||||
|
// Check for valid names
|
||||||
|
for (unsigned int i = 0; i < sizeof(validNames) / sizeof(char*); ++i)
|
||||||
|
{
|
||||||
|
if (first == validNames[i])
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (first.empty()) return false;
|
||||||
|
|
||||||
|
if (first[0] < 'A' || first[0] > 'Z') return false;
|
||||||
|
|
||||||
|
if (first.size() >= 2 && (first[1] < 'a' || first[1] > 'z') && (first[1] != '.') && (first[1] != ',')) return false;
|
||||||
|
|
||||||
|
// Check for invalid names
|
||||||
|
for (unsigned int i = 0; i < sizeof(invalidNames) / sizeof(char*); ++i)
|
||||||
|
{
|
||||||
|
if (first == invalidNames[i])
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default to a valid name
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string typoCorrection(const string& name)
|
||||||
|
{
|
||||||
|
// Loop over all known typo corrections
|
||||||
|
for (unsigned int i = 0; i < sizeof(typoCorrections) / sizeof(TypoCorrection); ++i)
|
||||||
|
{
|
||||||
|
// If a typo is found
|
||||||
|
if (name == typoCorrections[i].original)
|
||||||
|
{
|
||||||
|
// Return the correction
|
||||||
|
return typoCorrections[i].corrected;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void nameCorrection(NamePair& name)
|
||||||
|
{
|
||||||
|
// Loop over all known name corrections
|
||||||
|
for (unsigned int i = 0; i < sizeof(nameCorrections) / sizeof(NameCorrection); ++i)
|
||||||
|
{
|
||||||
|
// If a matching name is found
|
||||||
|
if (name.first == nameCorrections[i].originalFirst &&
|
||||||
|
name.second == nameCorrections[i].originalSecond)
|
||||||
|
{
|
||||||
|
// Return the correction
|
||||||
|
name.first = nameCorrections[i].correctedFirst;
|
||||||
|
name.second = nameCorrections[i].correctedSecond;
|
||||||
|
|
||||||
|
// Early out, since we don't want corrections of corrections
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void lastValidCharacter(const string& name, unsigned int& pos, char c)
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < pos; ++i)
|
||||||
|
{
|
||||||
|
if (name[i] == c)
|
||||||
|
{
|
||||||
|
pos = i;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void lastValidCharacter(const string& name, unsigned int& last)
|
||||||
|
{
|
||||||
|
lastValidCharacter(name, last, '.');
|
||||||
|
lastValidCharacter(name, last, ',');
|
||||||
|
lastValidCharacter(name, last, '\'');
|
||||||
|
lastValidCharacter(name, last, '/');
|
||||||
|
lastValidCharacter(name, last, '\\');
|
||||||
|
lastValidCharacter(name, last, ':');
|
||||||
|
lastValidCharacter(name, last, ';');
|
||||||
|
lastValidCharacter(name, last, ')');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NamePair createName(const string& first, const string& second)
|
||||||
|
{
|
||||||
|
if (first.empty()) return EmptyNamePair;
|
||||||
|
|
||||||
|
// cout << "first = " << first << " second = " << second << endl;
|
||||||
|
|
||||||
|
unsigned int last = first.size();
|
||||||
|
lastValidCharacter(first, last);
|
||||||
|
|
||||||
|
if (last == 0) return EmptyNamePair;
|
||||||
|
|
||||||
|
string name;
|
||||||
|
|
||||||
|
name.append(first.begin(), first.begin() + last);
|
||||||
|
|
||||||
|
if (!validName(name)) return EmptyNamePair;
|
||||||
|
|
||||||
|
name = typoCorrection(name);
|
||||||
|
|
||||||
|
if (second.empty() ||
|
||||||
|
!validName(second))
|
||||||
|
{
|
||||||
|
// filter any single or two letter words as unlike to be names.
|
||||||
|
if (name.size() <= 2) return EmptyNamePair;
|
||||||
|
|
||||||
|
return NamePair(name, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
last = second.size();
|
||||||
|
|
||||||
|
lastValidCharacter(second, last);
|
||||||
|
|
||||||
|
if (last > 0)
|
||||||
|
{
|
||||||
|
string surname(second.begin(), second.begin() + last);
|
||||||
|
|
||||||
|
if (validName(surname))
|
||||||
|
{
|
||||||
|
surname = typoCorrection(surname);
|
||||||
|
return NamePair(name, surname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// filter any single or two letter words as unlike to be names.
|
||||||
|
if (name.size() <= 2) return EmptyNamePair;
|
||||||
|
|
||||||
|
return NamePair(name, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool submissionsSequence(const Words& words, unsigned int& i)
|
||||||
|
{
|
||||||
|
if (i + 1 >= words.size()) return false;
|
||||||
|
|
||||||
|
if (words[i] == "From" ||
|
||||||
|
words[i] == "from" ||
|
||||||
|
words[i] == "From:" ||
|
||||||
|
words[i] == "from:" ||
|
||||||
|
words[i] == "Merged" ||
|
||||||
|
words[i] == "Integrated") return true;
|
||||||
|
|
||||||
|
if (i + 2 >= words.size()) return false;
|
||||||
|
|
||||||
|
if (words[i] == "submitted" && words[i + 1] == "by")
|
||||||
|
{
|
||||||
|
i += 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (words[i] == "Folded" && words[i + 1] == "in")
|
||||||
|
{
|
||||||
|
i += 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (words[i] == "Rolled" && words[i + 1] == "in")
|
||||||
|
{
|
||||||
|
i += 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (words[i] == "Checked" && words[i + 1] == "in")
|
||||||
|
{
|
||||||
|
i += 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i + 3 >= words.size()) return false;
|
||||||
|
|
||||||
|
if (words[i] == "sent" && words[i + 1] == "in" && words[i + 2] == "by")
|
||||||
|
{
|
||||||
|
i += 2;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void readContributors(NameMap& names, const string& file)
|
||||||
|
{
|
||||||
|
osgDB::ifstream fin(file.c_str());
|
||||||
|
|
||||||
|
Words words;
|
||||||
|
while(fin)
|
||||||
|
{
|
||||||
|
string keyword;
|
||||||
|
fin >> keyword;
|
||||||
|
words.push_back(keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
string blank_string;
|
||||||
|
|
||||||
|
for(unsigned int i = 0; i < words.size(); ++i)
|
||||||
|
{
|
||||||
|
if (submissionsSequence(words, i))
|
||||||
|
{
|
||||||
|
if (i + 2 < words.size() && validName(words[i + 1]))
|
||||||
|
{
|
||||||
|
NamePair name = createName(words[i + 1], words[i + 2]);
|
||||||
|
nameCorrection(name);
|
||||||
|
if (!name.first.empty()) ++names[name];
|
||||||
|
i += 2;
|
||||||
|
}
|
||||||
|
else if (i + 1 < words.size() && validName(words[i + 1]))
|
||||||
|
{
|
||||||
|
NamePair name = createName(words[i + 1], blank_string);
|
||||||
|
nameCorrection(name);
|
||||||
|
if (!name.first.empty()) ++names[name];
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (words[i] == "robert")
|
||||||
|
{
|
||||||
|
++names[NameRobertOsfield];
|
||||||
|
}
|
||||||
|
else if (words[i] == "don")
|
||||||
|
{
|
||||||
|
++names[NameDonBurns];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// reassign fisrt name entries to their full names entries
|
||||||
|
if (names.size() > 1)
|
||||||
|
{
|
||||||
|
for (NameMap::iterator itr = names.begin(); itr != names.end(); )
|
||||||
|
{
|
||||||
|
if (itr->first.second.empty())
|
||||||
|
{
|
||||||
|
NameMap::iterator next_itr = itr;
|
||||||
|
++next_itr;
|
||||||
|
|
||||||
|
if (next_itr != names.end() && itr->first.first == next_itr->first.first)
|
||||||
|
{
|
||||||
|
next_itr->second += itr->second;
|
||||||
|
names.erase(itr);
|
||||||
|
itr = next_itr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
++itr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
++itr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove the double entries from Robert's contributions
|
||||||
|
if (names.size() > 1)
|
||||||
|
{
|
||||||
|
for (NameMap::iterator itr = names.begin(); itr != names.end(); ++itr)
|
||||||
|
{
|
||||||
|
if (itr->first != NameRobertOsfield && itr->first != NameDonBurns)
|
||||||
|
{
|
||||||
|
names[NameRobertOsfield] -= itr->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void buildContributors(NameMap& names)
|
||||||
|
{
|
||||||
|
// top five contributors
|
||||||
|
++names[NamePair("Robert", "Osfield")];
|
||||||
|
++names[NamePair("Don", "Burns")];
|
||||||
|
++names[NamePair("Marco", "Jez")];
|
||||||
|
++names[NamePair("Mike", "Weiblen")];
|
||||||
|
++names[NamePair("Geoff", "Michel")];
|
||||||
|
++names[NamePair("Ben", "van Basten")];
|
||||||
|
|
||||||
|
// contributors that don't appear in the ChangeLog due to their contributions
|
||||||
|
// being before CVS started for the OSG, or before the name logging began.
|
||||||
|
++names[NamePair("Karsten", "Weiss")];
|
||||||
|
++names[NamePair("Graeme", "Harkness")];
|
||||||
|
++names[NamePair("Axel", "Volley")];
|
||||||
|
++names[NamePair("Nikolaus", "Hanekamp")];
|
||||||
|
++names[NamePair("Kristopher", "Bixler")];
|
||||||
|
++names[NamePair("Tanguy", "Fautr<EFBFBD>")];
|
||||||
|
++names[NamePair("J.E.", "Hoffmann")];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void printContributors(const std::string& changeLog, bool printNumEntries)
|
||||||
|
{
|
||||||
|
NameMap names;
|
||||||
|
buildContributors(names);
|
||||||
|
if (!changeLog.empty())
|
||||||
|
{
|
||||||
|
readContributors(names, changeLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef multimap<unsigned int, NamePair> SortedNameMap;
|
||||||
|
|
||||||
|
SortedNameMap sortedNames;
|
||||||
|
for (NameMap::iterator itr = names.begin(); itr != names.end(); ++itr)
|
||||||
|
{
|
||||||
|
sortedNames.insert(SortedNameMap::value_type(itr->second, itr->first));
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << names.size() << " Contributors:" << endl << endl;
|
||||||
|
|
||||||
|
if (printNumEntries)
|
||||||
|
{
|
||||||
|
cout << "Entries Firstname Surname" << endl;
|
||||||
|
cout << "-------------------------" << endl;
|
||||||
|
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
|
||||||
|
{
|
||||||
|
cout << sitr->first << "\t" << sitr->second.first << " " << sitr->second.second << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cout << "Firstname Surname" << endl;
|
||||||
|
cout << "-----------------" << endl;
|
||||||
|
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
|
||||||
|
{
|
||||||
|
cout << sitr->second.first << " " << sitr->second.second << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,14 @@
|
|||||||
|
// The majority of the application is dedicated to building the
|
||||||
|
// current contribitors list by parsing the ChangeLog, it just takes
|
||||||
|
// one line in the main itself to report the version number.
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
#include <vector>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <OpenThreads/Version>
|
||||||
|
|
||||||
|
#include <osg/Notify>
|
||||||
#include <osg/Version>
|
#include <osg/Version>
|
||||||
#include <osg/ArgumentParser>
|
#include <osg/ArgumentParser>
|
||||||
#include <osg/ApplicationUsage>
|
#include <osg/ApplicationUsage>
|
||||||
@@ -7,916 +18,137 @@
|
|||||||
#include <osg/BoundingBox>
|
#include <osg/BoundingBox>
|
||||||
#include <osg/BoundingSphere>
|
#include <osg/BoundingSphere>
|
||||||
|
|
||||||
|
#ifdef BUILD_CONTRIBUTORS
|
||||||
#include <OpenThreads/Version>
|
extern void printContributors(const std::string& changeLog, bool printNumEntries);
|
||||||
|
|
||||||
#include <set>
|
|
||||||
#include <vector>
|
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
|
|
||||||
// the majority of the application is dedicated to building the
|
|
||||||
// current contribitors list by parsing the ChangeLog, it just takes
|
|
||||||
// one line in the main itself to report the version number.
|
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#pragma setlocale("C")
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef std::pair<std::string, std::string> NamePair;
|
using namespace std;
|
||||||
typedef std::map<NamePair,unsigned int> NameMap;
|
|
||||||
typedef std::vector< std::string > Words;
|
|
||||||
|
|
||||||
NamePair EmptyNamePair;
|
int main( int argc, char** argv)
|
||||||
NamePair NameRobertOsfield("Robert","Osfield");
|
|
||||||
NamePair NameDonBurns("Don","Burns");
|
|
||||||
|
|
||||||
bool validName(const std::string& first)
|
|
||||||
{
|
{
|
||||||
if (first=="de") return true;
|
osg::ArgumentParser arguments(&argc, argv);
|
||||||
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName() + " [options]");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help", "Display this information");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("--version-number", "Print out version number only");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("--major-number", "Print out major version number only");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("--minor-number", "Print out minor version number only");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("--patch-number", "Print out patch version number only");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("--so-number ", "Print out shared object version number only");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-version-number", "Print out version number for OpenThreads only");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-soversion-number", "Print out shared object version number for OpenThreads only");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("Matrix::value_type", "Print the value of Matrix::value_type");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type", "Print the value of Plane::value_type");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type", "Print the value of BoundingSphere::value_type");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type", "Print the value of BoundingBox::value_type");
|
||||||
|
|
||||||
|
#ifdef BUILD_CONTRIBUTORS
|
||||||
if (first.empty()) return false;
|
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>", "Read the ChangeLog to generate an estimated contributors list.");
|
||||||
if (first[0]<'A' || first[0]>'Z') return false;
|
arguments.getApplicationUsage()->addCommandLineOption("--entries", "Print out number of entries into the ChangeLog file for each contributor.");
|
||||||
|
|
||||||
if (first.size()>=2 && (first[1]<'a' || first[1]>'z') && (first[1]!='.') && (first[1]!=',')) return false;
|
|
||||||
|
|
||||||
if (first=="Xcode") return false;
|
|
||||||
if (first=="Added") return false;
|
|
||||||
if (first=="Camera") return false;
|
|
||||||
if (first=="CameraNode") return false;
|
|
||||||
if (first=="CopyOp") return false;
|
|
||||||
if (first=="Fixed") return false;
|
|
||||||
if (first=="View") return false;
|
|
||||||
if (first=="GraphicsContext") return false;
|
|
||||||
if (first=="WindowData") return false;
|
|
||||||
if (first=="ViewPoint") return false;
|
|
||||||
if (first=="PickHandler") return false;
|
|
||||||
if (first=="Program") return false;
|
|
||||||
if (first=="Object") return false;
|
|
||||||
if (first=="OpenSceneGraph") return false;
|
|
||||||
if (first=="SpotExponent") return false;
|
|
||||||
if (first=="Framstamp") return false;
|
|
||||||
if (first=="Stats") return false;
|
|
||||||
if (first=="Group") return false;
|
|
||||||
if (first=="Texture") return false;
|
|
||||||
if (first=="Texture2DArray") return false;
|
|
||||||
if (first=="Creator") return false;
|
|
||||||
if (first=="CullVisitor") return false;
|
|
||||||
if (first=="Drawable") return false;
|
|
||||||
if (first=="Geode") return false;
|
|
||||||
if (first=="GeoSet") return false;
|
|
||||||
if (first=="Image") return false;
|
|
||||||
if (first=="Face") return false;
|
|
||||||
if (first=="Images/SolarSystem") return false;
|
|
||||||
if (first=="IntersectVisitor") return false;
|
|
||||||
if (first=="LongIDRecord") return false;
|
|
||||||
if (first=="Makefile") return false;
|
|
||||||
if (first=="Matrix") return false;
|
|
||||||
if (first=="MemoryManager") return false;
|
|
||||||
if (first=="MeshRecord") return false;
|
|
||||||
if (first=="Multigen") return false;
|
|
||||||
if (first=="NewCullVisitor") return false;
|
|
||||||
if (first=="Output") return false;
|
|
||||||
if (first=="PageLOD") return false;
|
|
||||||
if (first=="Improved") return false;
|
|
||||||
if (first=="PagedLOD") return false;
|
|
||||||
if (first=="Referenced") return false;
|
|
||||||
if (first=="StateAttribute") return false;
|
|
||||||
if (first=="Switch") return false;
|
|
||||||
if (first=="TechniqueEventHandler") return false;
|
|
||||||
if (first=="Uniform") return false;
|
|
||||||
if (first=="Vec*") return false;
|
|
||||||
if (first=="Viewer") return false;
|
|
||||||
if (first=="VisualStudio") return false;
|
|
||||||
if (first=="X") return false;
|
|
||||||
if (first=="Y") return false;
|
|
||||||
if (first=="Producer") return false;
|
|
||||||
if (first=="New") return false;
|
|
||||||
if (first=="Removed") return false;
|
|
||||||
if (first=="Ouput") return false;
|
|
||||||
if (first=="ReaderWriters") return false;
|
|
||||||
if (first=="NodeVisitor") return false;
|
|
||||||
if (first=="Fixes") return false;
|
|
||||||
if (first=="FontImplementation") return false;
|
|
||||||
if (first=="DisplaySettings") return false;
|
|
||||||
if (first=="AnimationPath") return false;
|
|
||||||
if (first=="AnimationPathCallback") return false;
|
|
||||||
if (first=="AnimationPathManipulator") return false;
|
|
||||||
if (first=="ArgumentParser") return false;
|
|
||||||
if (first=="AttrData") return false;
|
|
||||||
if (first=="Azimuth") return false;
|
|
||||||
if (first=="CluserCullingCallback") return false;
|
|
||||||
if (first=="ClusterCullingCallback") return false;
|
|
||||||
if (first=="CoordinateSystem") return false;
|
|
||||||
if (first=="CoordinateSystemNode") return false;
|
|
||||||
if (first=="CoordinateSystemNode&") return false;
|
|
||||||
if (first=="Copyright") return false;
|
|
||||||
if (first=="Cygwin") return false;
|
|
||||||
if (first=="CullCallbacks") return false;
|
|
||||||
if (first=="CullingSettngs") return false;
|
|
||||||
if (first=="DataVariance") return false;
|
|
||||||
if (first=="DatabasePager") return false;
|
|
||||||
if (first=="DrawElementsUByte") return false;
|
|
||||||
if (first=="Escape") return false;
|
|
||||||
if (first=="FluidProgram") return false;
|
|
||||||
if (first=="FrameStats") return false;
|
|
||||||
if (first=="FreeBSD") return false;
|
|
||||||
if (first=="GraphicsContextImplementation") return false;
|
|
||||||
if (first=="GraphicsThread") return false;
|
|
||||||
if (first=="Images") return false;
|
|
||||||
if (first=="IndexBlock") return false;
|
|
||||||
if (first=="Inventor") return false;
|
|
||||||
if (first=="Make") return false;
|
|
||||||
if (first=="Material") return false;
|
|
||||||
if (first=="MergeGeometryVisitor") return false;
|
|
||||||
if (first=="Mode") return false;
|
|
||||||
if (first=="Prodcuer") return false;
|
|
||||||
if (first=="ProxyNode") return false;
|
|
||||||
if (first=="ReentrantMutex") return false;
|
|
||||||
if (first=="ReferenceFrame") return false;
|
|
||||||
if (first=="RemoveLoadedProxyNodes") return false;
|
|
||||||
if (first=="RenderTargetFallback") return false;
|
|
||||||
if (first=="RenderToTextureStage") return false;
|
|
||||||
if (first=="Sequence") return false;
|
|
||||||
if (first=="Shape") return false;
|
|
||||||
if (first=="TessellationHints") return false;
|
|
||||||
if (first=="Support") return false;
|
|
||||||
if (first=="State") return false;
|
|
||||||
if (first=="SmokeTrailEffect") return false;
|
|
||||||
if (first=="TexEnv") return false;
|
|
||||||
if (first=="Texture3D") return false;
|
|
||||||
if (first=="TextureCubeMap") return false;
|
|
||||||
if (first=="TextureObjectManager") return false;
|
|
||||||
if (first=="TextureRectangle(Image*") return false;
|
|
||||||
if (first=="TextureType") return false;
|
|
||||||
if (first=="Texuture") return false;
|
|
||||||
if (first=="TriStripVisitor") return false;
|
|
||||||
if (first=="UserData") return false;
|
|
||||||
if (first=="Viewport") return false;
|
|
||||||
if (first=="Visual") return false;
|
|
||||||
if (first=="Studio") return false;
|
|
||||||
if (first=="Vec2d") return false;
|
|
||||||
if (first=="Vec3d") return false;
|
|
||||||
if (first=="Windows") return false;
|
|
||||||
if (first=="Version") return false;
|
|
||||||
if (first=="Viewport") return false;
|
|
||||||
if (first=="Core") return false;
|
|
||||||
if (first=="DataSet") return false;
|
|
||||||
if (first=="Endian") return false;
|
|
||||||
if (first=="ImageOptions") return false;
|
|
||||||
if (first=="ImageStream") return false;
|
|
||||||
if (first=="KeyboardMouse") return false;
|
|
||||||
if (first=="KeyboardMouseCallback") return false;
|
|
||||||
if (first=="AutoTransform") return false;
|
|
||||||
if (first=="AutoTransform.") return false;
|
|
||||||
if (first=="LightModel") return false;
|
|
||||||
if (first=="MatrixManipulator") return false;
|
|
||||||
if (first=="MatrixTransform") return false;
|
|
||||||
if (first=="OpenDX") return false;
|
|
||||||
if (first=="ParentList") return false;
|
|
||||||
if (first=="TerraPage") return false;
|
|
||||||
if (first=="OveralyNode") return false;
|
|
||||||
if (first=="OpenThreads") return false;
|
|
||||||
if (first=="PolygonStipple") return false;
|
|
||||||
if (first=="SceneView") return false;
|
|
||||||
if (first=="PrimitiveIndexFunctor") return false;
|
|
||||||
if (first=="PolytopeVisitor") return false;
|
|
||||||
if (first=="Performer") return false;
|
|
||||||
if (first=="Paging") return false;
|
|
||||||
if (first=="CameraBarrierCallback") return false;
|
|
||||||
if (first=="TestSupportCallback") return false;
|
|
||||||
if (first=="Quake3") return false;
|
|
||||||
if (first=="BlenColour(Vec4") return false;
|
|
||||||
if (first=="UseFarLineSegments") return false;
|
|
||||||
if (first=="TextureRectangle") return false;
|
|
||||||
if (first=="DeleteHandler") return false;
|
|
||||||
if (first=="EventQueue") return false;
|
|
||||||
if (first=="TrPageViewer") return false;
|
|
||||||
if (first=="TestManipulator") return false;
|
|
||||||
if (first=="ProducerEventCallback") return false;
|
|
||||||
if (first=="OrientationConverter") return false;
|
|
||||||
if (first=="Logos") return false;
|
|
||||||
if (first=="StatsVisitor") return false;
|
|
||||||
if (first=="LineStipple") return false;
|
|
||||||
if (first=="Files") return false;
|
|
||||||
if (first=="Mr") return false;
|
|
||||||
if (first=="Osfields") return false;
|
|
||||||
if (first=="Optimizer") return false;
|
|
||||||
if (first=="RenderStage") return false;
|
|
||||||
if (first=="Matrix*") return false;
|
|
||||||
if (first=="Vec4ub") return false;
|
|
||||||
if (first=="Proxy") return false;
|
|
||||||
if (first=="CullVistor") return false;
|
|
||||||
if (first=="SimpleViewer") return false;
|
|
||||||
if (first=="TexMat(Matrix") return false;
|
|
||||||
if (first=="GraphicsWindowX11") return false;
|
|
||||||
if (first=="OperationThread") return false;
|
|
||||||
if (first=="SimpleViewer") return false;
|
|
||||||
if (first=="IndexFaceSets") return false;
|
|
||||||
if (first=="Quicktime") return false;
|
|
||||||
if (first=="SceneGraphBuilder") return false;
|
|
||||||
if (first=="LightPointNode") return false;
|
|
||||||
if (first=="GeometryTechnique") return false;
|
|
||||||
if (first=="GeoemtryTechnique") return false;
|
|
||||||
if (first=="KdTree") return false;
|
|
||||||
if (first=="LineSegment") return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string typoCorrection(const std::string& name)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
if (name=="") return "";
|
|
||||||
if (name=="") return "";
|
|
||||||
if (name=="") return "";
|
|
||||||
if (name=="") return "";
|
|
||||||
#endif
|
#endif
|
||||||
if (name=="Weidemann") return "Wiedemann";
|
|
||||||
if (name=="Martsz") return "Martz";
|
|
||||||
if (name=="Matz") return "Martz";
|
|
||||||
if (name=="Froenlich") return "Fr<EFBFBD>hlich";
|
|
||||||
if (name=="Froechlich") return "Fr<EFBFBD>hlich";
|
|
||||||
if (name=="Froelich") return "Fr<EFBFBD>hlich";
|
|
||||||
if (name=="Fruciel") return "Frauciel";
|
|
||||||
if (name=="Hebelin") return "Herbelin";
|
|
||||||
if (name=="Jea-Sebastien") return "Jean-Sebastien";
|
|
||||||
if (name=="Jean-Sebastian") return "Jean-Sebastien";
|
|
||||||
if (name=="Robet") return "Robert";
|
|
||||||
if (name=="Morné") return "Morn<EFBFBD>";
|
|
||||||
if (name=="Adndre") return "Andre";
|
|
||||||
if (name=="Mellis") return "Melis";
|
|
||||||
if (name=="Rajce") return "Trajce";
|
|
||||||
if (name=="Trastenjak") return "Trstenjak";
|
|
||||||
if (name=="Baverage") return "Beverage";
|
|
||||||
if (name=="Bistroviae") return "Bistrovic";
|
|
||||||
if (name=="Christaiansen") return "Christiansen";
|
|
||||||
if (name=="Cobin") return "Corbin";
|
|
||||||
if (name=="Connel") return "Connell";
|
|
||||||
if (name=="Daust") return "Daoust";
|
|
||||||
if (name=="Lugi") return "Luigi";
|
|
||||||
if (name=="Daved") return "David";
|
|
||||||
if (name=="Fred") return "Frederic";
|
|
||||||
if (name=="Drederic") return "Frederic";
|
|
||||||
if (name=="Fredrick") return "Frederic";
|
|
||||||
if (name=="Fredric") return "Frederic";
|
|
||||||
if (name=="Garrat") return "Garrett";
|
|
||||||
if (name=="Geof") return "Geoff";
|
|
||||||
if (name=="Gronenger") return "Gronager";
|
|
||||||
if (name=="Gronger") return "Gronager";
|
|
||||||
if (name=="Heirtlein") return "Hertlein";
|
|
||||||
if (name=="Heirtlein") return "Hertlein";
|
|
||||||
if (name=="Heirtlein") return "Hertlein";
|
|
||||||
if (name=="Hertlien") return "Hertlein";
|
|
||||||
if (name=="Narache") return "Marache";
|
|
||||||
if (name=="Hi") return "He";
|
|
||||||
if (name=="Hooper") return "Hopper";
|
|
||||||
if (name=="Inverson") return "Iverson";
|
|
||||||
if (name=="Iversion") return "Iverson";
|
|
||||||
if (name=="Jeoen") return "Joran";
|
|
||||||
if (name=="Johhansen") return "Johansen";
|
|
||||||
if (name=="Johnansen") return "Johansen";
|
|
||||||
if (name=="Johnasen") return "Johansen";
|
|
||||||
if (name=="Jolly") return "Jolley";
|
|
||||||
if (name=="Jose") return "Jos<EFBFBD>";
|
|
||||||
if (name=="Joson") return "Jason";
|
|
||||||
if (name=="J") return "Jos<EFBFBD>";
|
|
||||||
if (name=="Keuhne") return "Kuehne";
|
|
||||||
if (name=="Kheune") return "Kuehne";
|
|
||||||
if (name=="Lashakari") return "Lashkari";
|
|
||||||
if (name=="Lashari") return "Lashkari";
|
|
||||||
if (name=="Lasharki") return "Lashkari";
|
|
||||||
if (name=="Laskari") return "Lashkari";
|
|
||||||
if (name=="Macro") return "Marco";
|
|
||||||
if (name=="Mammond") return "Marmond";
|
|
||||||
if (name=="March") return "Marco";
|
|
||||||
if (name=="Marz") return "Martz";
|
|
||||||
if (name=="Micheal") return "Michael";
|
|
||||||
if (name=="Molishtan") return "Moloshtan";
|
|
||||||
if (name=="Molishtan") return "Moloshtan";
|
|
||||||
if (name=="Moloshton") return "Moloshtan";
|
|
||||||
if (name=="Moule") return "Moiule";
|
|
||||||
if (name=="Nicklov") return "Nikolov";
|
|
||||||
if (name=="Nickolov") return "Nikolov";
|
|
||||||
if (name=="Olad") return "Olaf";
|
|
||||||
if (name=="Olar") return "Olaf";
|
|
||||||
if (name=="Oritz") return "Ortiz";
|
|
||||||
if (name=="Osfied") return "Osfield";
|
|
||||||
if (name=="Pail") return "Paul";
|
|
||||||
if (name=="Randal") return "Randall";
|
|
||||||
if (name=="Rodger") return "Roger";
|
|
||||||
if (name=="Sewel") return "Sewell";
|
|
||||||
if (name=="Sjolie") return "Sj<EFBFBD>lie";
|
|
||||||
if (name=="Sokolosky") return "Sokolowsky";
|
|
||||||
if (name=="Sokolowski") return "Sokolowsky";
|
|
||||||
if (name=="Sokolsky") return "Sokolowsky";
|
|
||||||
if (name=="Sonda") return "Sondra";
|
|
||||||
if (name=="Stansilav") return "Stanislav";
|
|
||||||
if (name=="Stefan") return "Stephan";
|
|
||||||
if (name=="Stell") return "Steel";
|
|
||||||
if (name=="Takeahei") return "Takahei";
|
|
||||||
if (name=="Takehei") return "Takahei";
|
|
||||||
if (name=="Tarantilils") return "Tarantilis";
|
|
||||||
if (name=="Vines") return "Vine";
|
|
||||||
if (name=="Wieblen") return "Weiblen";
|
|
||||||
if (name=="Xennon") return "Hanson";
|
|
||||||
if (name=="Yefrei") return "Yefei";
|
|
||||||
if (name=="Yfei") return "Yefei";
|
|
||||||
if (name=="Antonoine") return "Antoine";
|
|
||||||
if (name=="Antione") return "Antoine";
|
|
||||||
if (name=="Andew") return "Andrew";
|
|
||||||
if (name=="Daneil") return "Daniel";
|
|
||||||
if (name=="André") return "Andr<EFBFBD>";
|
|
||||||
if (name=="García") return "Garcea";
|
|
||||||
if (name=="Sjölie") return "Sj<EFBFBD>lie";
|
|
||||||
if (name=="José") return "Jos<EFBFBD>";
|
|
||||||
if (name=="Fröhlich") return "Fr<EFBFBD>hlich";
|
|
||||||
if (name=="Froehlich") return "Fr<EFBFBD>hlich";
|
|
||||||
if (name=="Eileman") return "Eilemann";
|
|
||||||
if (name=="Skinnder") return "Skinner";
|
|
||||||
if (name=="Mihair") return "Mihai";
|
|
||||||
if (name=="Mahai") return "Mihai";
|
|
||||||
if (name=="Wojiech" || name=="Wojchiech") return "Wojciech";
|
|
||||||
if (name=="Leandowski" || name=="Lawandowski") return "Lewandowski";
|
|
||||||
if (name=="Aderian") return "Adrian";
|
|
||||||
if (name=="Callue") return "Callu";
|
|
||||||
if (name=="Waldrom") return "Waldron";
|
|
||||||
if (name=="Atr") return "Art";
|
|
||||||
if (name=="Sylvan") return "Sylvain";
|
|
||||||
if (name=="Giatan") return "Gaitan";
|
|
||||||
if (name=="Melchoir") return "Melchior";
|
|
||||||
if (name=="Simmonsson") return "Simonsson";
|
|
||||||
if (name=="Simmonson") return "Simonsson";
|
|
||||||
if (name=="Sokolwsky") return "Sokolowsky";
|
|
||||||
if (name=="Cullu") return "Callu";
|
|
||||||
if (name=="Comporesi") return "Camporesi";
|
|
||||||
if (name=="Machler") return "M<EFBFBD>chler";
|
|
||||||
if (name=="Maechler") return "M<EFBFBD>chler";
|
|
||||||
if (name=="Messerschimdt") return "Messerschmidt";
|
|
||||||
if (name=="Garret") return "Garrett";
|
|
||||||
if (name=="Adrain") return "Adrian";
|
|
||||||
if (name=="Elgi") return "Egli";
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
void nameCorrection(NamePair& name)
|
// if user request help write it out to cout.
|
||||||
{
|
if (arguments.read("-h") || arguments.read("--help"))
|
||||||
if (name.first=="John" && name.second=="Vidar")
|
|
||||||
{
|
{
|
||||||
name.first = "John";
|
cout << arguments.getApplicationUsage()->getCommandLineUsage() << endl;
|
||||||
name.second = "Vidar Larring";
|
arguments.getApplicationUsage()->write(cout, arguments.getApplicationUsage()->getCommandLineOptions());
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.first=="Sebastien" && name.second=="Messerschmidt")
|
|
||||||
{
|
|
||||||
name.first = "Sebastian";
|
|
||||||
name.second = "Messerschmidt";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((name.first=="Jose" || name.first=="Jos<EFBFBD>") && name.second=="Delport")
|
|
||||||
{
|
|
||||||
name.first = "J.P.";
|
|
||||||
name.second = "Delport";
|
|
||||||
}
|
|
||||||
if (name.first=="Franz" && name.second=="Melchior")
|
|
||||||
{
|
|
||||||
name.first = "Melchior";
|
|
||||||
name.second = "Franz";
|
|
||||||
}
|
|
||||||
if (name.first=="Glen" && name.second=="Waldon")
|
|
||||||
{
|
|
||||||
name.first = "Glenn";
|
|
||||||
name.second = "Waldron";
|
|
||||||
}
|
|
||||||
if (name.first=="Ralf" && name.second=="Karn")
|
|
||||||
{
|
|
||||||
name.first = "Ralf";
|
|
||||||
name.second = "Kern";
|
|
||||||
}
|
|
||||||
if (name.first=="Donny" && name.second=="Cipperly")
|
|
||||||
{
|
|
||||||
name.first = "Donald";
|
|
||||||
name.second = "Cipperly";
|
|
||||||
}
|
|
||||||
if (name.first=="Gino" && name.second=="")
|
|
||||||
{
|
|
||||||
name.first = "Gino";
|
|
||||||
name.second = "van den Bergen";
|
|
||||||
}
|
|
||||||
if (name.first=="Radu" && name.second=="Mihai")
|
|
||||||
{
|
|
||||||
name.first = "Mihai";
|
|
||||||
name.second = "Radu";
|
|
||||||
}
|
|
||||||
if (name.first=="Art" && name.second=="Trevs")
|
|
||||||
{
|
|
||||||
name.first = "Art";
|
|
||||||
name.second = "Tevs";
|
|
||||||
}
|
|
||||||
if (name.first=="Tim" && name.second=="More")
|
|
||||||
{
|
|
||||||
name.first = "Tim";
|
|
||||||
name.second = "Moore";
|
|
||||||
}
|
|
||||||
if (name.first=="Andre" && name.second=="Garneau")
|
|
||||||
{
|
|
||||||
name.first = "Andr<EFBFBD>";
|
|
||||||
name.second = "Garneau";
|
|
||||||
}
|
|
||||||
if (name.first=="Eric" && name.second=="Hammil")
|
|
||||||
{
|
|
||||||
name.first = "Chris";
|
|
||||||
name.second = "Hanson";
|
|
||||||
}
|
|
||||||
if (name.first=="Paul" && name.second=="de")
|
|
||||||
{
|
|
||||||
name.first = "Paul";
|
|
||||||
name.second = "de Repentigny";
|
|
||||||
}
|
|
||||||
if (name.first=="Raymond" && name.second=="de")
|
|
||||||
{
|
|
||||||
name.first = "Raymond";
|
|
||||||
name.second = "de Vries";
|
|
||||||
}
|
|
||||||
if (name.first=="Nick" && name.second=="")
|
|
||||||
{
|
|
||||||
name.first = "Trajce";
|
|
||||||
name.second = "Nikolov";
|
|
||||||
}
|
|
||||||
if (name.first=="Daniel" && name.second=="")
|
|
||||||
{
|
|
||||||
name.first = "Daniel";
|
|
||||||
name.second = "Sj<EFBFBD>lie";
|
|
||||||
}
|
|
||||||
if (name.first=="Julia" && name.second=="Ortiz")
|
|
||||||
{
|
|
||||||
name.first = "Julian";
|
|
||||||
name.second = "Ortiz";
|
|
||||||
}
|
|
||||||
if (name.first=="Rune" && name.second=="Schmidt")
|
|
||||||
{
|
|
||||||
name.first = "Rune";
|
|
||||||
name.second = "Schmidt Jensen";
|
|
||||||
}
|
|
||||||
if (name.first=="Romano" && name.second=="Jos<EFBFBD>")
|
|
||||||
{
|
|
||||||
name.first = "Romano";
|
|
||||||
name.second = "Jos<EFBFBD> Magacho da Silva";
|
|
||||||
}
|
|
||||||
if (name.first=="Rommano" && name.second=="Silva")
|
|
||||||
{
|
|
||||||
name.first = "Romano";
|
|
||||||
name.second = "Jos<EFBFBD> Magacho da Silva";
|
|
||||||
}
|
|
||||||
if (name.first=="Leandro" && name.second=="Motta")
|
|
||||||
{
|
|
||||||
name.first = "Leandro";
|
|
||||||
name.second = "Motta Barros";
|
|
||||||
}
|
|
||||||
if (name.first=="A" && name.second=="Botorabi")
|
|
||||||
{
|
|
||||||
name.first = "Ali";
|
|
||||||
name.second = "Botorabi";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name.first=="Waltice" && name.second=="")
|
|
||||||
{
|
|
||||||
name.first = "Walter";
|
|
||||||
name.second = "J. Altice";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name.first=="Drew" && name.second=="")
|
|
||||||
{
|
|
||||||
name.first = "Drew";
|
|
||||||
name.second = "Whitehouse";
|
|
||||||
}
|
|
||||||
if (name.first=="Douglas" && name.second=="A")
|
|
||||||
{
|
|
||||||
name.first = "Douglas";
|
|
||||||
name.second = "A. Pouk";
|
|
||||||
}
|
|
||||||
if (name.first=="Colin" && name.second=="MacDonald")
|
|
||||||
{
|
|
||||||
name.first = "Colin";
|
|
||||||
name.second = "McDonald";
|
|
||||||
}
|
|
||||||
if (name.first=="Nikolov" && name.second=="Trajce")
|
|
||||||
{
|
|
||||||
name.first = "Trajce";
|
|
||||||
name.second = "Nikolov";
|
|
||||||
}
|
|
||||||
if (name.first=="Frauciel" && name.second=="Luc")
|
|
||||||
{
|
|
||||||
name.first = "Luc";
|
|
||||||
name.second = "Frauciel";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void lastValidCharacter(const std::string& name, unsigned int& pos,char c)
|
|
||||||
{
|
|
||||||
for(unsigned int i=0;i<pos;++i)
|
|
||||||
{
|
|
||||||
if (name[i]==c)
|
|
||||||
{
|
|
||||||
pos = i;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void lastValidCharacter(const std::string& name, unsigned int& last)
|
|
||||||
{
|
|
||||||
lastValidCharacter(name, last, '.');
|
|
||||||
lastValidCharacter(name, last, ',');
|
|
||||||
lastValidCharacter(name, last, '\'');
|
|
||||||
lastValidCharacter(name, last, '/');
|
|
||||||
lastValidCharacter(name, last, '\\');
|
|
||||||
lastValidCharacter(name, last, ':');
|
|
||||||
lastValidCharacter(name, last, ';');
|
|
||||||
lastValidCharacter(name, last, ')');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NamePair createName(const std::string& first, const std::string& second)
|
|
||||||
{
|
|
||||||
if (first.empty()) return EmptyNamePair;
|
|
||||||
|
|
||||||
unsigned int last = first.size();
|
|
||||||
lastValidCharacter(first, last);
|
|
||||||
|
|
||||||
if (last==0) return EmptyNamePair;
|
|
||||||
|
|
||||||
std::string name;
|
|
||||||
|
|
||||||
name.append(first.begin(), first.begin()+last);
|
|
||||||
|
|
||||||
if (!validName(name)) return EmptyNamePair;
|
|
||||||
|
|
||||||
name = typoCorrection(name);
|
|
||||||
|
|
||||||
if (second.empty() ||
|
|
||||||
!validName(second))
|
|
||||||
{
|
|
||||||
// filter any single or two letter words as unlike to be names.
|
|
||||||
if (name.size()<=2) return EmptyNamePair;
|
|
||||||
|
|
||||||
return NamePair(name,"");
|
|
||||||
}
|
|
||||||
|
|
||||||
last = second.size();
|
|
||||||
|
|
||||||
lastValidCharacter(second, last);
|
|
||||||
|
|
||||||
if (last>0)
|
|
||||||
{
|
|
||||||
std::string surname(second.begin(), second.begin()+last);
|
|
||||||
|
|
||||||
if (validName(surname))
|
|
||||||
{
|
|
||||||
surname = typoCorrection(surname);
|
|
||||||
return NamePair(name, surname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// filter any single or two letter words as unlike to be names.
|
|
||||||
if (name.size()<=2) return EmptyNamePair;
|
|
||||||
|
|
||||||
return NamePair(name,"");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool submissionsSequence(const Words& words, unsigned int& i)
|
|
||||||
{
|
|
||||||
if (i+1>=words.size()) return false;
|
|
||||||
|
|
||||||
if (words[i]=="From" ||
|
|
||||||
words[i]=="from" ||
|
|
||||||
words[i]=="From:" ||
|
|
||||||
words[i]=="from:" ||
|
|
||||||
words[i]=="Merged" ||
|
|
||||||
words[i]=="Integrated") return true;
|
|
||||||
|
|
||||||
if (i+2>=words.size()) return false;
|
|
||||||
|
|
||||||
if (words[i]=="submitted" && words[i+1]=="by")
|
|
||||||
{
|
|
||||||
i+=1;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (words[i]=="Folded" && words[i+1]=="in")
|
|
||||||
{
|
|
||||||
i+=1;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (words[i]=="Rolled" && words[i+1]=="in")
|
|
||||||
{
|
|
||||||
i+=1;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (words[i]=="Checked" && words[i+1]=="in")
|
|
||||||
{
|
|
||||||
i+=1;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i+3>=words.size()) return false;
|
|
||||||
|
|
||||||
if (words[i]=="sent" && words[i+1]=="in" && words[i+2]=="by")
|
|
||||||
{
|
|
||||||
i+=2;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void readContributors(NameMap& names, const std::string& file)
|
|
||||||
{
|
|
||||||
std::ifstream fin(file.c_str());
|
|
||||||
|
|
||||||
Words words;
|
|
||||||
while(fin)
|
|
||||||
{
|
|
||||||
std::string keyword;
|
|
||||||
fin >> keyword;
|
|
||||||
words.push_back(keyword);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string blank_string;
|
|
||||||
|
|
||||||
for(unsigned int i=0; i< words.size(); ++i)
|
|
||||||
{
|
|
||||||
if (submissionsSequence(words,i))
|
|
||||||
{
|
|
||||||
if (i+2<words.size() && validName(words[i+1]))
|
|
||||||
{
|
|
||||||
NamePair name = createName(words[i+1], words[i+2]);
|
|
||||||
nameCorrection(name);
|
|
||||||
if (!name.first.empty()) ++names[name];
|
|
||||||
i+=2;
|
|
||||||
}
|
|
||||||
else if (i+1<words.size() && validName(words[i+1]))
|
|
||||||
{
|
|
||||||
NamePair name = createName(words[i+1], blank_string);
|
|
||||||
nameCorrection(name);
|
|
||||||
if (!name.first.empty()) ++names[name];
|
|
||||||
i+=1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (words[i]=="robert:")
|
|
||||||
{
|
|
||||||
++names[NameRobertOsfield];
|
|
||||||
}
|
|
||||||
else if (words[i]=="don:")
|
|
||||||
{
|
|
||||||
++names[NameDonBurns];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// reassign fisrt name entries to their full names entries
|
|
||||||
if (names.size()>1)
|
|
||||||
{
|
|
||||||
for(NameMap::iterator itr = names.begin();
|
|
||||||
itr != names.end();
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (itr->first.second.empty())
|
|
||||||
{
|
|
||||||
NameMap::iterator next_itr = itr;
|
|
||||||
++next_itr;
|
|
||||||
|
|
||||||
if (next_itr!=names.end() && itr->first.first==next_itr->first.first)
|
|
||||||
{
|
|
||||||
next_itr->second += itr->second;
|
|
||||||
names.erase(itr);
|
|
||||||
itr = next_itr;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++itr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++itr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove the double entries from Robert's contributions
|
|
||||||
if (names.size()>1)
|
|
||||||
{
|
|
||||||
for(NameMap::iterator itr = names.begin();
|
|
||||||
itr != names.end();
|
|
||||||
++itr)
|
|
||||||
{
|
|
||||||
if (itr->first != NameRobertOsfield && itr->first != NameDonBurns )
|
|
||||||
{
|
|
||||||
names[NameRobertOsfield] -= itr->second;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void buildContributors(NameMap& names)
|
|
||||||
{
|
|
||||||
// top five contributors
|
|
||||||
++names[NamePair("Robert","Osfield")];
|
|
||||||
++names[NamePair("Don","Burns")];
|
|
||||||
++names[NamePair("Marco","Jez")];
|
|
||||||
++names[NamePair("Mike","Weiblen")];
|
|
||||||
++names[NamePair("Geoff","Michel")];
|
|
||||||
++names[NamePair("Ben","van Basten")];
|
|
||||||
|
|
||||||
// contributors that don't appear in the ChangeLog due to their contributions
|
|
||||||
// being before CVS started for the OSG, or before the name logging began.
|
|
||||||
++names[NamePair("Karsten","Weiss")];
|
|
||||||
++names[NamePair("Graeme","Harkness")];
|
|
||||||
++names[NamePair("Axel","Volley")];
|
|
||||||
++names[NamePair("Nikolaus","Hanekamp")];
|
|
||||||
++names[NamePair("Kristopher","Bixler")];
|
|
||||||
++names[NamePair("Tanguy","Fautr<EFBFBD>")];
|
|
||||||
++names[NamePair("J.E.","Hoffmann")];
|
|
||||||
}
|
|
||||||
|
|
||||||
int main( int argc, char **argv)
|
|
||||||
{
|
|
||||||
osg::ArgumentParser arguments(&argc,argv);
|
|
||||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options]");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--entries","Print out number of entries into the ChangeLog file for each contributor.");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--version-number","Print out version number only");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--major-number","Print out major version number only");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--minor-number","Print out minor version number only");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--patch-number","Print out patch version number only");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--so-number ","Print out shared object version number only");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-version-number","Print out version number for OpenThreads only");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-soversion-number","Print out shared object version number for OpenThreads only");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("Matrix::value_type","Print the value of Matrix::value_type");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type","Print the value of Plane::value_type");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type","Print the value of BoundingSphere::value_type");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type","Print the value of BoundingBox::value_type");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>","Read the ChangeLog to generate an estimated contributors list.");
|
|
||||||
|
|
||||||
if (arguments.read("--version-number"))
|
if (arguments.read("--version-number"))
|
||||||
{
|
{
|
||||||
std::cout<<osgGetVersion()<<std::endl;
|
cout << osgGetVersion() << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.read("--major-number"))
|
if (arguments.read("--major-number"))
|
||||||
{
|
{
|
||||||
std::cout<<OPENSCENEGRAPH_MAJOR_VERSION<<std::endl;
|
cout << OPENSCENEGRAPH_MAJOR_VERSION << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.read("--minor-number"))
|
if (arguments.read("--minor-number"))
|
||||||
{
|
{
|
||||||
std::cout<<OPENSCENEGRAPH_MINOR_VERSION<<std::endl;
|
cout << OPENSCENEGRAPH_MINOR_VERSION << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.read("--patch-number"))
|
if (arguments.read("--patch-number"))
|
||||||
{
|
{
|
||||||
std::cout<<OPENSCENEGRAPH_PATCH_VERSION<<std::endl;
|
cout << OPENSCENEGRAPH_PATCH_VERSION << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.read("--soversion-number") || arguments.read("--so-number") )
|
if (arguments.read("--soversion-number") || arguments.read("--so-number") )
|
||||||
{
|
{
|
||||||
std::cout<<osgGetSOVersion()<<std::endl;
|
cout << osgGetSOVersion() << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (arguments.read("--openthreads-version-number"))
|
if (arguments.read("--openthreads-version-number"))
|
||||||
{
|
{
|
||||||
std::cout<<OpenThreadsGetVersion()<<std::endl;
|
cout << OpenThreadsGetVersion() << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (arguments.read("--openthreads-major-number"))
|
if (arguments.read("--openthreads-major-number"))
|
||||||
{
|
{
|
||||||
std::cout<<OPENTHREADS_MAJOR_VERSION<<std::endl;
|
cout << OPENTHREADS_MAJOR_VERSION << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.read("--openthreads-minor-number"))
|
if (arguments.read("--openthreads-minor-number"))
|
||||||
{
|
{
|
||||||
std::cout<<OPENTHREADS_MINOR_VERSION<<std::endl;
|
cout << OPENTHREADS_MINOR_VERSION << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.read("--openthreads-patch-number"))
|
if (arguments.read("--openthreads-patch-number"))
|
||||||
{
|
{
|
||||||
std::cout<<OPENTHREADS_PATCH_VERSION<<std::endl;
|
cout << OPENTHREADS_PATCH_VERSION << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.read("--openthreads-soversion-number"))
|
if (arguments.read("--openthreads-soversion-number"))
|
||||||
{
|
{
|
||||||
std::cout<<OpenThreadsGetSOVersion()<<std::endl;
|
cout << OpenThreadsGetSOVersion() << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (arguments.read("Matrix::value_type"))
|
if (arguments.read("Matrix::value_type"))
|
||||||
{
|
{
|
||||||
std::cout<<((sizeof(osg::Matrix::value_type)==4)?"float":"double")<<std::endl;
|
cout << ((sizeof(osg::Matrix::value_type) == 4) ? "float" : "double") << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.read("Plane::value_type"))
|
if (arguments.read("Plane::value_type"))
|
||||||
{
|
{
|
||||||
std::cout<<((sizeof(osg::Plane::value_type)==4)?"float":"double")<<std::endl;
|
cout << ((sizeof(osg::Plane::value_type) == 4) ? "float" : "double") << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.read("BoundingSphere::value_type"))
|
if (arguments.read("BoundingSphere::value_type"))
|
||||||
{
|
{
|
||||||
std::cout<<((sizeof(osg::BoundingSphere::value_type)==4)?"float":"double")<<std::endl;
|
cout << ((sizeof(osg::BoundingSphere::value_type) == 4) ? "float" : "double") << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.read("BoundingBox::value_type"))
|
if (arguments.read("BoundingBox::value_type"))
|
||||||
{
|
{
|
||||||
std::cout<<((sizeof(osg::BoundingBox::value_type)==4)?"float":"double")<<std::endl;
|
cout << ((sizeof(osg::BoundingBox::value_type) == 4) ? "float" : "double") << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout<<osgGetLibraryName()<< " "<< osgGetVersion()<<std::endl<<std::endl;
|
|
||||||
|
|
||||||
bool printContributors = false;
|
cout << osgGetLibraryName() << " " << osgGetVersion() << endl << endl;
|
||||||
bool printNumEntries = false;
|
|
||||||
while ( arguments.read("--entries"))
|
#ifdef BUILD_CONTRIBUTORS
|
||||||
|
string changeLog;
|
||||||
|
while (arguments.read("-r", changeLog) ||
|
||||||
|
arguments.read("--read", changeLog))
|
||||||
{
|
{
|
||||||
printContributors = true;
|
printContributors(changeLog, arguments.read("--entries"));
|
||||||
printNumEntries = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string changeLog;
|
|
||||||
while ( arguments.read("-r",changeLog) || arguments.read("--read",changeLog)) printContributors = true;
|
|
||||||
|
|
||||||
// if user request help write it out to cout.
|
|
||||||
if (arguments.read("-h") || arguments.read("--help"))
|
|
||||||
{
|
|
||||||
std::cout<<arguments.getApplicationUsage()->getCommandLineUsage()<<std::endl;
|
|
||||||
arguments.getApplicationUsage()->write(std::cout,arguments.getApplicationUsage()->getCommandLineOptions());
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (printContributors)
|
|
||||||
{
|
|
||||||
NameMap names;
|
|
||||||
buildContributors(names);
|
|
||||||
if (!changeLog.empty())
|
|
||||||
{
|
|
||||||
readContributors(names, changeLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef std::multimap<unsigned int, NamePair> SortedNameMap;
|
|
||||||
|
|
||||||
SortedNameMap sortedNames;
|
|
||||||
for(NameMap::iterator itr = names.begin();
|
|
||||||
itr != names.end();
|
|
||||||
++itr)
|
|
||||||
{
|
|
||||||
sortedNames.insert(SortedNameMap::value_type(itr->second, itr->first));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout<<names.size()<<" Contributors:"<<std::endl<<std::endl;
|
|
||||||
|
|
||||||
if (printNumEntries)
|
|
||||||
{
|
|
||||||
std::cout<<"Entries Firstname Surname"<<std::endl;
|
|
||||||
std::cout<<"-------------------------"<<std::endl;
|
|
||||||
for(SortedNameMap::reverse_iterator sitr = sortedNames.rbegin();
|
|
||||||
sitr != sortedNames.rend();
|
|
||||||
++sitr)
|
|
||||||
{
|
|
||||||
std::cout<<sitr->first<<"\t"<<sitr->second.first<<" "<<sitr->second.second<<std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cout<<"Firstname Surname"<<std::endl;
|
|
||||||
std::cout<<"-----------------"<<std::endl;
|
|
||||||
for(SortedNameMap::reverse_iterator sitr = sortedNames.rbegin();
|
|
||||||
sitr != sortedNames.rend();
|
|
||||||
++sitr)
|
|
||||||
{
|
|
||||||
std::cout<<sitr->second.first<<" "<<sitr->second.second<<std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
2
configure
vendored
2
configure
vendored
@@ -1 +1 @@
|
|||||||
cmake . -DCMAKE_BUILD_TYPE=Release
|
cmake . -DCMAKE_BUILD_TYPE=Release $@
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -348,7 +348,7 @@ SHOW_USED_FILES = YES
|
|||||||
# The QUIET tag can be used to turn on/off the messages that are generated
|
# The QUIET tag can be used to turn on/off the messages that are generated
|
||||||
# by doxygen. Possible values are YES and NO. If left blank NO is used.
|
# by doxygen. Possible values are YES and NO. If left blank NO is used.
|
||||||
|
|
||||||
QUIET = NO
|
QUIET = YES
|
||||||
|
|
||||||
# The WARNINGS tag can be used to turn on/off the warning messages that are
|
# The WARNINGS tag can be used to turn on/off the warning messages that are
|
||||||
# generated by doxygen. Possible values are YES and NO. If left blank
|
# generated by doxygen. Possible values are YES and NO. If left blank
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,10 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<address><small>Generated at $datetime for the <a href="http://www.openscenegraph.org/">OpenSceneGraph</a>
|
<table border="0"><tr><td>
|
||||||
|
<img src="osg32-32.png" alt="osg logo" />
|
||||||
|
</td><td>
|
||||||
|
<address><small>Generated at $datetime for the <a href="http://www.openscenegraph.org/">$projectname</a>
|
||||||
by <a href="http://www.doxygen.org">doxygen</a> $doxygenversion.</small></address>
|
by <a href="http://www.doxygen.org">doxygen</a> $doxygenversion.</small></address>
|
||||||
<!-- Dimitri van Heesch's e-mail address removed, lest he get messages on the Open Scene Graph -->
|
<!-- Dimitri van Heesch's e-mail address removed, lest he get messages on the OpenSceneGraph -->
|
||||||
|
</td></tr></table>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
254
doc/Doxyfiles/openthreads.doxyfile.cmake
Normal file
254
doc/Doxyfiles/openthreads.doxyfile.cmake
Normal file
@@ -0,0 +1,254 @@
|
|||||||
|
# Doxyfile 1.5.7.1
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Project related configuration options
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
DOXYFILE_ENCODING = UTF-8
|
||||||
|
PROJECT_NAME = OpenThreads
|
||||||
|
PROJECT_NUMBER = ${OPENTHREADS_VERSION}
|
||||||
|
OUTPUT_DIRECTORY = "${PROJECT_BINARY_DIR}/doc/"
|
||||||
|
CREATE_SUBDIRS = NO
|
||||||
|
OUTPUT_LANGUAGE = English
|
||||||
|
BRIEF_MEMBER_DESC = YES
|
||||||
|
REPEAT_BRIEF = YES
|
||||||
|
ABBREVIATE_BRIEF =
|
||||||
|
ALWAYS_DETAILED_SEC = NO
|
||||||
|
INLINE_INHERITED_MEMB = NO
|
||||||
|
FULL_PATH_NAMES = YES
|
||||||
|
STRIP_FROM_PATH = "${OpenSceneGraph_SOURCE_DIR}/include/"
|
||||||
|
STRIP_FROM_INC_PATH =
|
||||||
|
SHORT_NAMES = YES
|
||||||
|
JAVADOC_AUTOBRIEF = YES
|
||||||
|
QT_AUTOBRIEF = NO
|
||||||
|
MULTILINE_CPP_IS_BRIEF = NO
|
||||||
|
INHERIT_DOCS = YES
|
||||||
|
SEPARATE_MEMBER_PAGES = NO
|
||||||
|
TAB_SIZE = 8
|
||||||
|
ALIASES =
|
||||||
|
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||||
|
OPTIMIZE_OUTPUT_JAVA = NO
|
||||||
|
OPTIMIZE_FOR_FORTRAN = NO
|
||||||
|
OPTIMIZE_OUTPUT_VHDL = NO
|
||||||
|
BUILTIN_STL_SUPPORT = NO
|
||||||
|
CPP_CLI_SUPPORT = NO
|
||||||
|
SIP_SUPPORT = NO
|
||||||
|
IDL_PROPERTY_SUPPORT = YES
|
||||||
|
DISTRIBUTE_GROUP_DOC = NO
|
||||||
|
SUBGROUPING = YES
|
||||||
|
TYPEDEF_HIDES_STRUCT = NO
|
||||||
|
SYMBOL_CACHE_SIZE = 0
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Build related configuration options
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
EXTRACT_ALL = YES
|
||||||
|
EXTRACT_PRIVATE = NO
|
||||||
|
EXTRACT_STATIC = NO
|
||||||
|
EXTRACT_LOCAL_CLASSES = NO
|
||||||
|
EXTRACT_LOCAL_METHODS = NO
|
||||||
|
EXTRACT_ANON_NSPACES = NO
|
||||||
|
HIDE_UNDOC_MEMBERS = NO
|
||||||
|
HIDE_UNDOC_CLASSES = NO
|
||||||
|
HIDE_FRIEND_COMPOUNDS = NO
|
||||||
|
HIDE_IN_BODY_DOCS = NO
|
||||||
|
INTERNAL_DOCS = NO
|
||||||
|
CASE_SENSE_NAMES = YES
|
||||||
|
HIDE_SCOPE_NAMES = NO
|
||||||
|
SHOW_INCLUDE_FILES = YES
|
||||||
|
INLINE_INFO = YES
|
||||||
|
SORT_MEMBER_DOCS = YES
|
||||||
|
SORT_BRIEF_DOCS = NO
|
||||||
|
SORT_GROUP_NAMES = NO
|
||||||
|
SORT_BY_SCOPE_NAME = NO
|
||||||
|
GENERATE_TODOLIST = YES
|
||||||
|
GENERATE_TESTLIST = YES
|
||||||
|
GENERATE_BUGLIST = YES
|
||||||
|
GENERATE_DEPRECATEDLIST= YES
|
||||||
|
ENABLED_SECTIONS =
|
||||||
|
MAX_INITIALIZER_LINES = 30
|
||||||
|
SHOW_USED_FILES = YES
|
||||||
|
SHOW_DIRECTORIES = YES
|
||||||
|
SHOW_FILES = YES
|
||||||
|
SHOW_NAMESPACES = YES
|
||||||
|
FILE_VERSION_FILTER =
|
||||||
|
LAYOUT_FILE =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to warning and progress messages
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
QUIET = YES
|
||||||
|
WARNINGS = YES
|
||||||
|
WARN_IF_UNDOCUMENTED = YES
|
||||||
|
WARN_IF_DOC_ERROR = YES
|
||||||
|
WARN_NO_PARAMDOC = NO
|
||||||
|
WARN_FORMAT = "$file:$line: $text"
|
||||||
|
WARN_LOGFILE =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the input files
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
INPUT = "${OpenSceneGraph_SOURCE_DIR}/include/OpenThreads"
|
||||||
|
INPUT_ENCODING = UTF-8
|
||||||
|
FILE_PATTERNS = *include* \
|
||||||
|
*.cpp
|
||||||
|
RECURSIVE = YES
|
||||||
|
EXCLUDE = .svn
|
||||||
|
EXCLUDE_SYMLINKS = NO
|
||||||
|
EXCLUDE_PATTERNS = */.svn/*
|
||||||
|
EXCLUDE_SYMBOLS =
|
||||||
|
EXAMPLE_PATH =
|
||||||
|
EXAMPLE_PATTERNS =
|
||||||
|
EXAMPLE_RECURSIVE = NO
|
||||||
|
IMAGE_PATH =
|
||||||
|
INPUT_FILTER =
|
||||||
|
FILTER_PATTERNS =
|
||||||
|
FILTER_SOURCE_FILES = NO
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to source browsing
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
SOURCE_BROWSER = NO
|
||||||
|
INLINE_SOURCES = NO
|
||||||
|
STRIP_CODE_COMMENTS = YES
|
||||||
|
REFERENCED_BY_RELATION = YES
|
||||||
|
REFERENCES_RELATION = YES
|
||||||
|
REFERENCES_LINK_SOURCE = YES
|
||||||
|
USE_HTAGS = NO
|
||||||
|
VERBATIM_HEADERS = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the alphabetical class index
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
ALPHABETICAL_INDEX = YES
|
||||||
|
COLS_IN_ALPHA_INDEX = 2
|
||||||
|
IGNORE_PREFIX =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the HTML output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_HTML = YES
|
||||||
|
HTML_OUTPUT = OpenThreadsReferenceDocs
|
||||||
|
HTML_FILE_EXTENSION = .html
|
||||||
|
HTML_HEADER =
|
||||||
|
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
|
||||||
|
HTML_STYLESHEET =
|
||||||
|
HTML_ALIGN_MEMBERS = YES
|
||||||
|
HTML_DYNAMIC_SECTIONS = NO
|
||||||
|
GENERATE_DOCSET = NO
|
||||||
|
DOCSET_FEEDNAME = "Doxygen generated docs"
|
||||||
|
DOCSET_BUNDLE_ID = org.doxygen.Project
|
||||||
|
GENERATE_HTMLHELP = ${GENERATE_HTMLHELP}
|
||||||
|
CHM_FILE = "../OpenThreadsReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm"
|
||||||
|
HHC_LOCATION = "${HTML_HELP_COMPILER}"
|
||||||
|
GENERATE_CHI = NO
|
||||||
|
CHM_INDEX_ENCODING =
|
||||||
|
BINARY_TOC = NO
|
||||||
|
TOC_EXPAND = NO
|
||||||
|
GENERATE_QHP = NO
|
||||||
|
QCH_FILE =
|
||||||
|
QHP_NAMESPACE = org.doxygen.Project
|
||||||
|
QHP_VIRTUAL_FOLDER = doc
|
||||||
|
QHG_LOCATION =
|
||||||
|
DISABLE_INDEX = NO
|
||||||
|
ENUM_VALUES_PER_LINE = 4
|
||||||
|
GENERATE_TREEVIEW = NO
|
||||||
|
TREEVIEW_WIDTH = 250
|
||||||
|
FORMULA_FONTSIZE = 10
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the LaTeX output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_LATEX = NO
|
||||||
|
LATEX_OUTPUT = latex
|
||||||
|
LATEX_CMD_NAME = latex
|
||||||
|
MAKEINDEX_CMD_NAME = makeindex
|
||||||
|
COMPACT_LATEX = NO
|
||||||
|
PAPER_TYPE = a4wide
|
||||||
|
EXTRA_PACKAGES =
|
||||||
|
LATEX_HEADER =
|
||||||
|
PDF_HYPERLINKS = NO
|
||||||
|
USE_PDFLATEX = NO
|
||||||
|
LATEX_BATCHMODE = NO
|
||||||
|
LATEX_HIDE_INDICES = NO
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the RTF output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_RTF = NO
|
||||||
|
RTF_OUTPUT = rtf
|
||||||
|
COMPACT_RTF = NO
|
||||||
|
RTF_HYPERLINKS = NO
|
||||||
|
RTF_STYLESHEET_FILE =
|
||||||
|
RTF_EXTENSIONS_FILE =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the man page output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_MAN = NO
|
||||||
|
MAN_OUTPUT = man
|
||||||
|
MAN_EXTENSION = .3
|
||||||
|
MAN_LINKS = NO
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the XML output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_XML = NO
|
||||||
|
XML_OUTPUT = xml
|
||||||
|
XML_SCHEMA =
|
||||||
|
XML_DTD =
|
||||||
|
XML_PROGRAMLISTING = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options for the AutoGen Definitions output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_AUTOGEN_DEF = NO
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the Perl module output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
GENERATE_PERLMOD = NO
|
||||||
|
PERLMOD_LATEX = NO
|
||||||
|
PERLMOD_PRETTY = YES
|
||||||
|
PERLMOD_MAKEVAR_PREFIX =
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the preprocessor
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
ENABLE_PREPROCESSING = YES
|
||||||
|
MACRO_EXPANSION = NO
|
||||||
|
EXPAND_ONLY_PREDEF = NO
|
||||||
|
SEARCH_INCLUDES = YES
|
||||||
|
INCLUDE_PATH =
|
||||||
|
INCLUDE_FILE_PATTERNS =
|
||||||
|
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
|
||||||
|
EXPAND_AS_DEFINED =
|
||||||
|
SKIP_FUNCTION_MACROS = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration::additions related to external references
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
TAGFILES =
|
||||||
|
GENERATE_TAGFILE = ${GENERATE_TAGFILE}
|
||||||
|
ALLEXTERNALS = NO
|
||||||
|
EXTERNAL_GROUPS = YES
|
||||||
|
PERL_PATH = /usr/bin/perl
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration options related to the dot tool
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
CLASS_DIAGRAMS = YES
|
||||||
|
MSCGEN_PATH =
|
||||||
|
HIDE_UNDOC_RELATIONS = YES
|
||||||
|
HAVE_DOT = YES
|
||||||
|
DOT_FONTNAME = FreeSans
|
||||||
|
DOT_FONTSIZE = 10
|
||||||
|
DOT_FONTPATH =
|
||||||
|
CLASS_GRAPH = YES
|
||||||
|
COLLABORATION_GRAPH = NO
|
||||||
|
GROUP_GRAPHS = YES
|
||||||
|
UML_LOOK = NO
|
||||||
|
TEMPLATE_RELATIONS = YES
|
||||||
|
INCLUDE_GRAPH = NO
|
||||||
|
INCLUDED_BY_GRAPH = NO
|
||||||
|
CALL_GRAPH = NO
|
||||||
|
CALLER_GRAPH = NO
|
||||||
|
GRAPHICAL_HIERARCHY = YES
|
||||||
|
DIRECTORY_GRAPH = YES
|
||||||
|
DOT_IMAGE_FORMAT = png
|
||||||
|
DOT_PATH =
|
||||||
|
DOTFILE_DIRS =
|
||||||
|
DOT_GRAPH_MAX_NODES = 50
|
||||||
|
MAX_DOT_GRAPH_DEPTH = 0
|
||||||
|
DOT_TRANSPARENT = YES
|
||||||
|
DOT_MULTI_TARGETS = NO
|
||||||
|
GENERATE_LEGEND = YES
|
||||||
|
DOT_CLEANUP = YES
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Configuration::additions related to the search engine
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
SEARCHENGINE = ${SEARCHENGINE}
|
||||||
@@ -16,7 +16,9 @@ SET(TARGET_COMMON_LIBRARIES
|
|||||||
|
|
||||||
IF(DYNAMIC_OPENSCENEGRAPH)
|
IF(DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
|
||||||
|
ADD_SUBDIRECTORY(osg2cpp)
|
||||||
ADD_SUBDIRECTORY(osganimate)
|
ADD_SUBDIRECTORY(osganimate)
|
||||||
|
ADD_SUBDIRECTORY(osgautocapture)
|
||||||
ADD_SUBDIRECTORY(osgautotransform)
|
ADD_SUBDIRECTORY(osgautotransform)
|
||||||
ADD_SUBDIRECTORY(osgbillboard)
|
ADD_SUBDIRECTORY(osgbillboard)
|
||||||
ADD_SUBDIRECTORY(osgblendequation)
|
ADD_SUBDIRECTORY(osgblendequation)
|
||||||
@@ -28,13 +30,16 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgcopy)
|
ADD_SUBDIRECTORY(osgcopy)
|
||||||
ADD_SUBDIRECTORY(osgcubemap)
|
ADD_SUBDIRECTORY(osgcubemap)
|
||||||
ADD_SUBDIRECTORY(osgdelaunay)
|
ADD_SUBDIRECTORY(osgdelaunay)
|
||||||
|
ADD_SUBDIRECTORY(osgcluster)
|
||||||
ADD_SUBDIRECTORY(osgdepthpartition)
|
ADD_SUBDIRECTORY(osgdepthpartition)
|
||||||
ADD_SUBDIRECTORY(osgdepthpeeling)
|
ADD_SUBDIRECTORY(osgdepthpeeling)
|
||||||
|
ADD_SUBDIRECTORY(osgdrawinstanced)
|
||||||
ADD_SUBDIRECTORY(osgdistortion)
|
ADD_SUBDIRECTORY(osgdistortion)
|
||||||
ADD_SUBDIRECTORY(osgfadetext)
|
ADD_SUBDIRECTORY(osgfadetext)
|
||||||
ADD_SUBDIRECTORY(osgfont)
|
ADD_SUBDIRECTORY(osgfont)
|
||||||
ADD_SUBDIRECTORY(osgforest)
|
ADD_SUBDIRECTORY(osgforest)
|
||||||
ADD_SUBDIRECTORY(osgfxbrowser)
|
ADD_SUBDIRECTORY(osgfxbrowser)
|
||||||
|
ADD_SUBDIRECTORY(osggameoflife)
|
||||||
ADD_SUBDIRECTORY(osggeodemo)
|
ADD_SUBDIRECTORY(osggeodemo)
|
||||||
ADD_SUBDIRECTORY(osggeometry)
|
ADD_SUBDIRECTORY(osggeometry)
|
||||||
ADD_SUBDIRECTORY(osggeometryshaders)
|
ADD_SUBDIRECTORY(osggeometryshaders)
|
||||||
@@ -59,6 +64,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgmultitexturecontrol)
|
ADD_SUBDIRECTORY(osgmultitexturecontrol)
|
||||||
ADD_SUBDIRECTORY(osgoccluder)
|
ADD_SUBDIRECTORY(osgoccluder)
|
||||||
ADD_SUBDIRECTORY(osgocclusionquery)
|
ADD_SUBDIRECTORY(osgocclusionquery)
|
||||||
|
ADD_SUBDIRECTORY(osgpackeddepthstencil)
|
||||||
ADD_SUBDIRECTORY(osgpagedlod)
|
ADD_SUBDIRECTORY(osgpagedlod)
|
||||||
ADD_SUBDIRECTORY(osgparametric)
|
ADD_SUBDIRECTORY(osgparametric)
|
||||||
ADD_SUBDIRECTORY(osgparticle)
|
ADD_SUBDIRECTORY(osgparticle)
|
||||||
@@ -72,6 +78,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgprerender)
|
ADD_SUBDIRECTORY(osgprerender)
|
||||||
ADD_SUBDIRECTORY(osgprerendercubemap)
|
ADD_SUBDIRECTORY(osgprerendercubemap)
|
||||||
ADD_SUBDIRECTORY(osgreflect)
|
ADD_SUBDIRECTORY(osgreflect)
|
||||||
|
ADD_SUBDIRECTORY(osgrobot)
|
||||||
ADD_SUBDIRECTORY(osgscalarbar)
|
ADD_SUBDIRECTORY(osgscalarbar)
|
||||||
ADD_SUBDIRECTORY(osgscreencapture)
|
ADD_SUBDIRECTORY(osgscreencapture)
|
||||||
ADD_SUBDIRECTORY(osgscribe)
|
ADD_SUBDIRECTORY(osgscribe)
|
||||||
@@ -83,6 +90,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgsharedarray)
|
ADD_SUBDIRECTORY(osgsharedarray)
|
||||||
ADD_SUBDIRECTORY(osgsimplifier)
|
ADD_SUBDIRECTORY(osgsimplifier)
|
||||||
ADD_SUBDIRECTORY(osgsimulation)
|
ADD_SUBDIRECTORY(osgsimulation)
|
||||||
|
ADD_SUBDIRECTORY(osgsidebyside)
|
||||||
ADD_SUBDIRECTORY(osgslice)
|
ADD_SUBDIRECTORY(osgslice)
|
||||||
ADD_SUBDIRECTORY(osgspacewarp)
|
ADD_SUBDIRECTORY(osgspacewarp)
|
||||||
ADD_SUBDIRECTORY(osgspheresegment)
|
ADD_SUBDIRECTORY(osgspheresegment)
|
||||||
@@ -99,11 +107,40 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgtexture3D)
|
ADD_SUBDIRECTORY(osgtexture3D)
|
||||||
ADD_SUBDIRECTORY(osgtexturerectangle)
|
ADD_SUBDIRECTORY(osgtexturerectangle)
|
||||||
ADD_SUBDIRECTORY(osgthirdpersonview)
|
ADD_SUBDIRECTORY(osgthirdpersonview)
|
||||||
ADD_SUBDIRECTORY(osgunittests)
|
|
||||||
ADD_SUBDIRECTORY(osgvertexprogram)
|
ADD_SUBDIRECTORY(osgvertexprogram)
|
||||||
ADD_SUBDIRECTORY(osgvolume)
|
ADD_SUBDIRECTORY(osgvolume)
|
||||||
ADD_SUBDIRECTORY(osgwindows)
|
ADD_SUBDIRECTORY(osgwindows)
|
||||||
|
ADD_SUBDIRECTORY(osganimationhardware)
|
||||||
|
ADD_SUBDIRECTORY(osganimationtimeline)
|
||||||
|
ADD_SUBDIRECTORY(osganimationnode)
|
||||||
|
ADD_SUBDIRECTORY(osganimationmakepath)
|
||||||
|
ADD_SUBDIRECTORY(osganimationskinning)
|
||||||
|
ADD_SUBDIRECTORY(osganimationsolid)
|
||||||
|
ADD_SUBDIRECTORY(osganimationviewer)
|
||||||
|
ADD_SUBDIRECTORY(osgbrowser)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetaddremove)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetbox)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetcanvas)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetframe)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetinput)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetlabel)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetmessagebox)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetmenu)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetnotebook)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetperformance)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetscrolled)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetshader)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetstyled)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgettable)
|
||||||
|
ADD_SUBDIRECTORY(osgwidgetwindow)
|
||||||
|
|
||||||
|
IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
|
||||||
|
ADD_SUBDIRECTORY(osgunittests)
|
||||||
|
ADD_SUBDIRECTORY(osgmemorytest)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ADD_SUBDIRECTORY(osgpdf)
|
||||||
|
|
||||||
IF (BUILD_OSG_WRAPPERS)
|
IF (BUILD_OSG_WRAPPERS)
|
||||||
ADD_SUBDIRECTORY(osgintrospection)
|
ADD_SUBDIRECTORY(osgintrospection)
|
||||||
ENDIF(BUILD_OSG_WRAPPERS)
|
ENDIF(BUILD_OSG_WRAPPERS)
|
||||||
@@ -129,8 +166,12 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ENDIF(wxWidgets_FOUND)
|
ENDIF(wxWidgets_FOUND)
|
||||||
|
|
||||||
IF (QT_FOUND)
|
IF (QT_FOUND)
|
||||||
ADD_SUBDIRECTORY(osgviewerQT)
|
OPTION(BUILD_QT_EXAMPLES "Enable the build of the examples that depend on Qt" ON)
|
||||||
ENDIF(QT_FOUND)
|
|
||||||
|
IF (BUILD_QT_EXAMPLES AND QT_QTOPENGL_LIBRARY)
|
||||||
|
ADD_SUBDIRECTORY(osgviewerQT)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF (FLTK_FOUND)
|
IF (FLTK_FOUND)
|
||||||
ADD_SUBDIRECTORY(osgviewerFLTK)
|
ADD_SUBDIRECTORY(osgviewerFLTK)
|
||||||
@@ -150,27 +191,20 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgviewerCocoa)
|
ADD_SUBDIRECTORY(osgviewerCocoa)
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
IF (BUILD_OSGWIDGET)
|
|
||||||
ADD_SUBDIRECTORY(osgwidgetaddremove)
|
|
||||||
ADD_SUBDIRECTORY(osgwidgetbox)
|
IF (LIBVNCSERVER_FOUND)
|
||||||
ADD_SUBDIRECTORY(osgwidgetcanvas)
|
ADD_SUBDIRECTORY(osgvnc)
|
||||||
ADD_SUBDIRECTORY(osgwidgetframe)
|
ENDIF(LIBVNCSERVER_FOUND)
|
||||||
ADD_SUBDIRECTORY(osgwidgetinput)
|
|
||||||
ADD_SUBDIRECTORY(osgwidgetlabel)
|
|
||||||
ADD_SUBDIRECTORY(osgwidgetmenu)
|
|
||||||
ADD_SUBDIRECTORY(osgwidgetnotebook)
|
|
||||||
ADD_SUBDIRECTORY(osgwidgetscrolled)
|
|
||||||
ADD_SUBDIRECTORY(osgwidgetshader)
|
|
||||||
ADD_SUBDIRECTORY(osgwidgetstyled)
|
|
||||||
ADD_SUBDIRECTORY(osgwidgettable)
|
|
||||||
ADD_SUBDIRECTORY(osgwidgetwindow)
|
|
||||||
ENDIF(BUILD_OSGWIDGET)
|
|
||||||
|
|
||||||
|
|
||||||
#ADD_SUBDIRECTORY(osgcegui)
|
#ADD_SUBDIRECTORY(osgcegui)
|
||||||
|
|
||||||
#to add subject to find socket#ADD_SUBDIRECTORY(osgcluster)
|
#to add subject to find socket#ADD_SUBDIRECTORY(osgcluster)
|
||||||
|
|
||||||
ELSE(DYNAMIC_OPENSCENEGRAPH)
|
ELSE(DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
#needed on win32 or the linker get confused by _declspec declarations
|
||||||
|
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(osgstaticviewer)
|
ADD_SUBDIRECTORY(osgstaticviewer)
|
||||||
|
|
||||||
|
|||||||
6
examples/osg2cpp/CMakeLists.txt
Normal file
6
examples/osg2cpp/CMakeLists.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
SET(TARGET_SRC
|
||||||
|
osg2cpp.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
#### end var setup ###
|
||||||
|
SETUP_APPLICATION(osg2cpp)
|
||||||
102
examples/osg2cpp/osg2cpp.cpp
Normal file
102
examples/osg2cpp/osg2cpp.cpp
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
#include <osg/ArgumentParser>
|
||||||
|
#include <osg/ApplicationUsage>
|
||||||
|
|
||||||
|
#include <osgDB/ReadFile>
|
||||||
|
#include <osgDB/FileNameUtils>
|
||||||
|
#include <osgDB/fstream>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
void writeShader(osg::Shader* shader, const std::string& cppFileName, const std::string& variableName)
|
||||||
|
{
|
||||||
|
osgDB::ofstream fout(cppFileName.c_str());
|
||||||
|
if (!fout)
|
||||||
|
{
|
||||||
|
std::cout<<"Error: could not open file `"<<cppFileName<<"` for writing."<<std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string shaderSource = shader->getShaderSource();
|
||||||
|
|
||||||
|
std::string variableString = std::string("char ")+variableName+std::string("[] = ");
|
||||||
|
|
||||||
|
std::string::size_type startOfLine = 0;
|
||||||
|
std::string::size_type endOfLine = shaderSource.find_first_of('\n', startOfLine);
|
||||||
|
|
||||||
|
if (endOfLine==std::string::npos)
|
||||||
|
{
|
||||||
|
fout<<variableString<<shaderSource<<"\\n\";"<<std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string padding(variableString.size(),' ');
|
||||||
|
|
||||||
|
fout<<variableString<<"\""<<shaderSource.substr(startOfLine,endOfLine-startOfLine)<<"\\n\""<<std::endl;
|
||||||
|
startOfLine = endOfLine+1;
|
||||||
|
endOfLine = shaderSource.find_first_of('\n', startOfLine);
|
||||||
|
|
||||||
|
while (endOfLine != std::string::npos)
|
||||||
|
{
|
||||||
|
fout<<padding<<"\""<<shaderSource.substr(startOfLine,endOfLine-startOfLine)<<"\\n\""<<std::endl;
|
||||||
|
startOfLine = endOfLine + 1;
|
||||||
|
endOfLine = shaderSource.find_first_of('\n', startOfLine);
|
||||||
|
}
|
||||||
|
fout<<padding<<"\""<<shaderSource.substr(startOfLine,endOfLine-startOfLine)<<"\\n\";"<<std::endl;
|
||||||
|
}
|
||||||
|
std::cout<<"Written shader to `"<<cppFileName<<"`"<<std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main( int argc, char **argv )
|
||||||
|
{
|
||||||
|
// use an ArgumentParser object to manage the program arguments.
|
||||||
|
osg::ArgumentParser arguments(&argc,argv);
|
||||||
|
|
||||||
|
// set up the usage document, in case we need to print out how to use this program.
|
||||||
|
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
||||||
|
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a utility for converting between various input and output databases formats.");
|
||||||
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("--shader <filename>","Shader file to create a .cpp file for.");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
|
||||||
|
|
||||||
|
// if user request help write it out to cout.
|
||||||
|
if (arguments.read("-h") || arguments.read("--help"))
|
||||||
|
{
|
||||||
|
arguments.getApplicationUsage()->write(std::cout);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string filename;
|
||||||
|
if (arguments.read("--shader",filename))
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Shader> shader = osgDB::readShaderFile(filename);
|
||||||
|
if (shader.valid())
|
||||||
|
{
|
||||||
|
std::string name = osgDB::getStrippedName(filename);
|
||||||
|
std::string invalidCharacters = "-+/\\*=(){}[]:;<>,.?@'~#`!\"";
|
||||||
|
std::string numbericCharacters = "0123456789";
|
||||||
|
std::string::size_type pos = name.find_first_of(invalidCharacters);
|
||||||
|
while (pos != std::string::npos)
|
||||||
|
{
|
||||||
|
name[pos] = '_';
|
||||||
|
pos = name.find_first_of(invalidCharacters);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string ext = osgDB::getFileExtension(filename);
|
||||||
|
std::string cppFileName = name + "_" + ext + ".cpp";
|
||||||
|
std::string variableName = name + "_" + ext;
|
||||||
|
writeShader(shader.get(), cppFileName, variableName);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout<<"Error: could not find file '"<<filename<<"'"<<std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout<<"No appropriate command line options used."<<std::endl;
|
||||||
|
|
||||||
|
arguments.getApplicationUsage()->write(std::cout);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
3
examples/osganimationhardware/CMakeLists.txt
Normal file
3
examples/osganimationhardware/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SET(TARGET_SRC osganimationhardware.cpp )
|
||||||
|
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||||
|
SETUP_EXAMPLE(osganimationhardware)
|
||||||
264
examples/osganimationhardware/osganimationhardware.cpp
Normal file
264
examples/osganimationhardware/osganimationhardware.cpp
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
* Copyright (C) 2009 Cedric Pinson <cedric.pinson@plopbyte.net>
|
||||||
|
*
|
||||||
|
* This library is open source and may be redistributed and/or modified under
|
||||||
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* OpenSceneGraph Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <osgDB/ReadFile>
|
||||||
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
|
#include <osgGA/TrackballManipulator>
|
||||||
|
#include <osgGA/FlightManipulator>
|
||||||
|
#include <osgGA/DriveManipulator>
|
||||||
|
#include <osgGA/KeySwitchMatrixManipulator>
|
||||||
|
#include <osgGA/StateSetManipulator>
|
||||||
|
#include <osgGA/AnimationPathManipulator>
|
||||||
|
#include <osgGA/TerrainManipulator>
|
||||||
|
#include <osg/Drawable>
|
||||||
|
#include <osg/MatrixTransform>
|
||||||
|
|
||||||
|
#include <osgAnimation/BasicAnimationManager>
|
||||||
|
#include <osgAnimation/RigGeometry>
|
||||||
|
#include <osgAnimation/RigTransformHardware>
|
||||||
|
#include <osgAnimation/AnimationManagerBase>
|
||||||
|
#include <osgAnimation/BoneMapVisitor>
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
|
||||||
|
static unsigned int getRandomValueinRange(unsigned int v)
|
||||||
|
{
|
||||||
|
return static_cast<unsigned int>((rand() * 1.0 * v)/(RAND_MAX-1));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Program> program;
|
||||||
|
// show how to override the default RigTransformHardware for customized usage
|
||||||
|
struct MyRigTransformHardware : public osgAnimation::RigTransformHardware
|
||||||
|
{
|
||||||
|
|
||||||
|
void operator()(osgAnimation::RigGeometry& geom)
|
||||||
|
{
|
||||||
|
if (_needInit)
|
||||||
|
if (!init(geom))
|
||||||
|
return;
|
||||||
|
computeMatrixPaletteUniform(geom.getMatrixFromSkeletonToGeometry(), geom.getInvMatrixFromSkeletonToGeometry());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool init(osgAnimation::RigGeometry& geom)
|
||||||
|
{
|
||||||
|
osg::Vec3Array* pos = dynamic_cast<osg::Vec3Array*>(geom.getVertexArray());
|
||||||
|
if (!pos) {
|
||||||
|
osg::notify(osg::WARN) << "RigTransformHardware no vertex array in the geometry " << geom.getName() << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!geom.getSkeleton()) {
|
||||||
|
osg::notify(osg::WARN) << "RigTransformHardware no skeleting set in geometry " << geom.getName() << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
osgAnimation::BoneMapVisitor mapVisitor;
|
||||||
|
geom.getSkeleton()->accept(mapVisitor);
|
||||||
|
osgAnimation::BoneMap bm = mapVisitor.getBoneMap();
|
||||||
|
|
||||||
|
if (!createPalette(pos->size(),bm, geom.getVertexInfluenceSet().getVertexToBoneList()))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
int attribIndex = 11;
|
||||||
|
int nbAttribs = getNumVertexAttrib();
|
||||||
|
|
||||||
|
// use a global program for all avatar
|
||||||
|
if (!program.valid()) {
|
||||||
|
program = new osg::Program;
|
||||||
|
program->setName("HardwareSkinning");
|
||||||
|
if (!_shader.valid())
|
||||||
|
_shader = osg::Shader::readShaderFile(osg::Shader::VERTEX,"shaders/skinning.vert");
|
||||||
|
|
||||||
|
if (!_shader.valid()) {
|
||||||
|
osg::notify(osg::WARN) << "RigTransformHardware can't load VertexShader" << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// replace max matrix by the value from uniform
|
||||||
|
{
|
||||||
|
std::string str = _shader->getShaderSource();
|
||||||
|
std::string toreplace = std::string("MAX_MATRIX");
|
||||||
|
std::size_t start = str.find(toreplace);
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << getMatrixPaletteUniform()->getNumElements();
|
||||||
|
str.replace(start, toreplace.size(), ss.str());
|
||||||
|
_shader->setShaderSource(str);
|
||||||
|
osg::notify(osg::INFO) << "Shader " << str << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
program->addShader(_shader.get());
|
||||||
|
|
||||||
|
for (int i = 0; i < nbAttribs; i++)
|
||||||
|
{
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << "boneWeight" << i;
|
||||||
|
program->addBindAttribLocation(ss.str(), attribIndex + i);
|
||||||
|
|
||||||
|
osg::notify(osg::INFO) << "set vertex attrib " << ss.str() << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < nbAttribs; i++)
|
||||||
|
{
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << "boneWeight" << i;
|
||||||
|
geom.setVertexAttribData(attribIndex + i, osg::Geometry::ArrayData(getVertexAttrib(i),osg::Geometry::BIND_PER_VERTEX));
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::StateSet> ss = new osg::StateSet;
|
||||||
|
ss->addUniform(getMatrixPaletteUniform());
|
||||||
|
ss->addUniform(new osg::Uniform("nbBonesPerVertex", getNumBonesPerVertex()));
|
||||||
|
ss->setAttributeAndModes(program.get());
|
||||||
|
geom.setStateSet(ss.get());
|
||||||
|
_needInit = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct SetupRigGeometry : public osg::NodeVisitor
|
||||||
|
{
|
||||||
|
bool _hardware;
|
||||||
|
SetupRigGeometry( bool hardware = true) : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _hardware(hardware) {}
|
||||||
|
|
||||||
|
void apply(osg::Geode& geode)
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < geode.getNumDrawables(); i++)
|
||||||
|
apply(*geode.getDrawable(i));
|
||||||
|
}
|
||||||
|
void apply(osg::Drawable& geom)
|
||||||
|
{
|
||||||
|
if (_hardware) {
|
||||||
|
osgAnimation::RigGeometry* rig = dynamic_cast<osgAnimation::RigGeometry*>(&geom);
|
||||||
|
if (rig)
|
||||||
|
rig->setRigTransformImplementation(new MyRigTransformHardware);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
if (geom.getName() != std::string("BoundingBox")) // we disable compute of bounding box for all geometry except our bounding box
|
||||||
|
geom.setComputeBoundingBoxCallback(new osg::Drawable::ComputeBoundingBoxCallback);
|
||||||
|
// geom.setInitialBound(new osg::Drawable::ComputeBoundingBoxCallback);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
osg::Group* createCharacterInstance(osg::Group* character, bool hardware)
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Group> c ;
|
||||||
|
if (hardware)
|
||||||
|
c = osg::clone(character, osg::CopyOp::DEEP_COPY_ALL & ~osg::CopyOp::DEEP_COPY_PRIMITIVES & ~osg::CopyOp::DEEP_COPY_ARRAYS);
|
||||||
|
else
|
||||||
|
c = osg::clone(character, osg::CopyOp::DEEP_COPY_ALL);
|
||||||
|
|
||||||
|
osgAnimation::AnimationManagerBase* animationManager = dynamic_cast<osgAnimation::AnimationManagerBase*>(c->getUpdateCallback());
|
||||||
|
|
||||||
|
osgAnimation::BasicAnimationManager* anim = dynamic_cast<osgAnimation::BasicAnimationManager*>(animationManager);
|
||||||
|
const osgAnimation::AnimationList& list = animationManager->getAnimationList();
|
||||||
|
int v = getRandomValueinRange(list.size());
|
||||||
|
if (list[v]->getName() == std::string("MatIpo_ipo")) {
|
||||||
|
anim->playAnimation(list[v].get());
|
||||||
|
v = (v + 1)%list.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
anim->playAnimation(list[v].get());
|
||||||
|
|
||||||
|
SetupRigGeometry switcher(hardware);
|
||||||
|
c->accept(switcher);
|
||||||
|
|
||||||
|
return c.release();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main (int argc, char* argv[])
|
||||||
|
{
|
||||||
|
std::cerr << "This example works better with nathan.osg" << std::endl;
|
||||||
|
|
||||||
|
osg::ArgumentParser psr(&argc, argv);
|
||||||
|
|
||||||
|
osgViewer::Viewer viewer(psr);
|
||||||
|
|
||||||
|
bool hardware = true;
|
||||||
|
int maxChar = 10;
|
||||||
|
while (psr.read("--software")) { hardware = false; }
|
||||||
|
while (psr.read("--number", maxChar)) {}
|
||||||
|
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Group> root = dynamic_cast<osg::Group*>(osgDB::readNodeFiles(psr));
|
||||||
|
if (!root)
|
||||||
|
{
|
||||||
|
std::cout << psr.getApplicationName() <<": No data loaded" << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
osgAnimation::AnimationManagerBase* animationManager = dynamic_cast<osgAnimation::AnimationManagerBase*>(root->getUpdateCallback());
|
||||||
|
if(!animationManager)
|
||||||
|
{
|
||||||
|
osg::notify(osg::FATAL) << "no AnimationManagerBase found, updateCallback need to animate elements" << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Group> scene = new osg::Group;
|
||||||
|
|
||||||
|
// add the state manipulator
|
||||||
|
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
|
||||||
|
|
||||||
|
// add the thread model handler
|
||||||
|
viewer.addEventHandler(new osgViewer::ThreadingHandler);
|
||||||
|
|
||||||
|
// add the window size toggle handler
|
||||||
|
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
|
||||||
|
|
||||||
|
// add the stats handler
|
||||||
|
viewer.addEventHandler(new osgViewer::StatsHandler);
|
||||||
|
|
||||||
|
// add the help handler
|
||||||
|
viewer.addEventHandler(new osgViewer::HelpHandler(psr.getApplicationUsage()));
|
||||||
|
|
||||||
|
// add the LOD Scale handler
|
||||||
|
viewer.addEventHandler(new osgViewer::LODScaleHandler);
|
||||||
|
|
||||||
|
// add the screen capture handler
|
||||||
|
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
|
||||||
|
|
||||||
|
viewer.setSceneData(scene.get());
|
||||||
|
|
||||||
|
viewer.realize();
|
||||||
|
|
||||||
|
double xChar = maxChar;
|
||||||
|
double yChar = xChar * 9.0/16;
|
||||||
|
for (double i = 0.0; i < xChar; i++) {
|
||||||
|
for (double j = 0.0; j < yChar; j++) {
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Group> c = createCharacterInstance(root.get(), hardware);
|
||||||
|
osg::MatrixTransform* tr = new osg::MatrixTransform;
|
||||||
|
tr->setMatrix(osg::Matrix::translate( 2.0 * (i - xChar * .5),
|
||||||
|
0.0,
|
||||||
|
2.0 * (j - yChar * .5)));
|
||||||
|
tr->addChild(c.get());
|
||||||
|
scene->addChild(tr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
std::cout << "created " << xChar * yChar << " instance" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
return viewer.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
3
examples/osganimationmakepath/CMakeLists.txt
Normal file
3
examples/osganimationmakepath/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SET(TARGET_SRC osganimationmakepath.cpp )
|
||||||
|
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||||
|
SETUP_EXAMPLE(osganimationmakepath)
|
||||||
338
examples/osganimationmakepath/osganimationmakepath.cpp
Normal file
338
examples/osganimationmakepath/osganimationmakepath.cpp
Normal file
@@ -0,0 +1,338 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
*
|
||||||
|
* This library is open source and may be redistributed and/or modified under
|
||||||
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* OpenSceneGraph Public License for more details.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Jeremy Moles <jeremy@emperorlinux.com>
|
||||||
|
* Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <osg/io_utils>
|
||||||
|
#include <osg/Geometry>
|
||||||
|
#include <osg/Shape>
|
||||||
|
#include <osg/ShapeDrawable>
|
||||||
|
#include <osg/Material>
|
||||||
|
#include <osg/MatrixTransform>
|
||||||
|
#include <osgViewer/Viewer>
|
||||||
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
|
#include <osgGA/TrackballManipulator>
|
||||||
|
#include <osgAnimation/Sampler>
|
||||||
|
|
||||||
|
class AnimtkUpdateCallback : public osg::NodeCallback
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
META_Object(osgAnimation, AnimtkUpdateCallback);
|
||||||
|
|
||||||
|
AnimtkUpdateCallback()
|
||||||
|
{
|
||||||
|
_sampler = new osgAnimation::Vec3CubicBezierSampler;
|
||||||
|
_playing = false;
|
||||||
|
_lastUpdate = 0;
|
||||||
|
}
|
||||||
|
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
|
||||||
|
osg::Object(val, copyop),
|
||||||
|
osg::NodeCallback(val, copyop),
|
||||||
|
_sampler(val._sampler),
|
||||||
|
_startTime(val._startTime),
|
||||||
|
_currentTime(val._currentTime),
|
||||||
|
_playing(val._playing),
|
||||||
|
_lastUpdate(val._lastUpdate)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Callback method called by the NodeVisitor when visiting a node.*/
|
||||||
|
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||||
|
{
|
||||||
|
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
|
||||||
|
nv->getFrameStamp() &&
|
||||||
|
nv->getFrameStamp()->getFrameNumber() != _lastUpdate)
|
||||||
|
{
|
||||||
|
|
||||||
|
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
|
||||||
|
_currentTime = osg::Timer::instance()->tick();
|
||||||
|
|
||||||
|
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
|
||||||
|
{
|
||||||
|
osg::MatrixTransform* transform = dynamic_cast<osg::MatrixTransform*>(node);
|
||||||
|
if (transform) {
|
||||||
|
osg::Vec3 result;
|
||||||
|
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||||
|
float duration = _sampler->getEndTime() - _sampler->getStartTime();
|
||||||
|
t = fmod(t, duration);
|
||||||
|
t += _sampler->getStartTime();
|
||||||
|
_sampler->getValueAt(t, result);
|
||||||
|
transform->setMatrix(osg::Matrix::translate(result));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// note, callback is responsible for scenegraph traversal so
|
||||||
|
// they must call traverse(node,nv) to ensure that the
|
||||||
|
// scene graph subtree (and associated callbacks) are traversed.
|
||||||
|
traverse(node,nv);
|
||||||
|
}
|
||||||
|
|
||||||
|
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
|
||||||
|
void stop() { _currentTime = _startTime; _playing = false;}
|
||||||
|
|
||||||
|
osg::ref_ptr<osgAnimation::Vec3CubicBezierSampler> _sampler;
|
||||||
|
osg::Timer_t _startTime;
|
||||||
|
osg::Timer_t _currentTime;
|
||||||
|
bool _playing;
|
||||||
|
int _lastUpdate;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class AnimtkStateSetUpdateCallback : public osg::StateSet::Callback
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
META_Object(osgAnimation, AnimtkStateSetUpdateCallback);
|
||||||
|
|
||||||
|
AnimtkStateSetUpdateCallback()
|
||||||
|
{
|
||||||
|
_sampler = new osgAnimation::Vec4LinearSampler;
|
||||||
|
_playing = false;
|
||||||
|
_lastUpdate = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
|
||||||
|
osg::Object(val, copyop),
|
||||||
|
osg::StateSet::Callback(val, copyop),
|
||||||
|
_sampler(val._sampler),
|
||||||
|
_startTime(val._startTime),
|
||||||
|
_currentTime(val._currentTime),
|
||||||
|
_playing(val._playing),
|
||||||
|
_lastUpdate(val._lastUpdate)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Callback method called by the NodeVisitor when visiting a node.*/
|
||||||
|
virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv)
|
||||||
|
{
|
||||||
|
if (state &&
|
||||||
|
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
|
||||||
|
nv->getFrameStamp() &&
|
||||||
|
nv->getFrameStamp()->getFrameNumber() != _lastUpdate) {
|
||||||
|
|
||||||
|
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
|
||||||
|
_currentTime = osg::Timer::instance()->tick();
|
||||||
|
|
||||||
|
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
|
||||||
|
{
|
||||||
|
osg::Material* material = dynamic_cast<osg::Material*>(state->getAttribute(osg::StateAttribute::MATERIAL));
|
||||||
|
if (material)
|
||||||
|
{
|
||||||
|
osg::Vec4 result;
|
||||||
|
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||||
|
float duration = _sampler->getEndTime() - _sampler->getStartTime();
|
||||||
|
t = fmod(t, duration);
|
||||||
|
t += _sampler->getStartTime();
|
||||||
|
_sampler->getValueAt(t, result);
|
||||||
|
material->setDiffuse(osg::Material::FRONT_AND_BACK, result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
|
||||||
|
void stop() { _currentTime = _startTime; _playing = false;}
|
||||||
|
|
||||||
|
osg::ref_ptr<osgAnimation::Vec4LinearSampler> _sampler;
|
||||||
|
osg::Timer_t _startTime;
|
||||||
|
osg::Timer_t _currentTime;
|
||||||
|
bool _playing;
|
||||||
|
int _lastUpdate;
|
||||||
|
};
|
||||||
|
|
||||||
|
// This won't really give good results in any situation, but it does demonstrate
|
||||||
|
// on possible "fast" usage...
|
||||||
|
class MakePathTimeCallback: public AnimtkUpdateCallback
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Geode> _geode;
|
||||||
|
float _lastAdd;
|
||||||
|
float _addSeconds;
|
||||||
|
|
||||||
|
public:
|
||||||
|
MakePathTimeCallback(osg::Geode* geode):
|
||||||
|
_geode(geode),
|
||||||
|
_lastAdd(0.0f),
|
||||||
|
_addSeconds(0.08f) {
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||||
|
{
|
||||||
|
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||||
|
|
||||||
|
if(_lastAdd + _addSeconds <= t && t <= 8.0f)
|
||||||
|
{
|
||||||
|
osg::Vec3 pos;
|
||||||
|
|
||||||
|
_sampler->getValueAt(t, pos);
|
||||||
|
|
||||||
|
_geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(pos, 0.5f)));
|
||||||
|
_geode->dirtyBound();
|
||||||
|
|
||||||
|
_lastAdd += _addSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
AnimtkUpdateCallback::operator()(node, nv);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// This will give great results if you DO NOT have VSYNC enabled and can generate
|
||||||
|
// decent FPS.
|
||||||
|
class MakePathDistanceCallback: public AnimtkUpdateCallback
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Geode> _geode;
|
||||||
|
osg::Vec3 _lastAdd;
|
||||||
|
float _threshold;
|
||||||
|
unsigned int _count;
|
||||||
|
|
||||||
|
public:
|
||||||
|
MakePathDistanceCallback(osg::Geode* geode):
|
||||||
|
_geode(geode),
|
||||||
|
_threshold(0.5f),
|
||||||
|
_count(0) {}
|
||||||
|
|
||||||
|
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||||
|
{
|
||||||
|
static bool countReported = false;
|
||||||
|
|
||||||
|
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||||
|
|
||||||
|
osg::Vec3 pos;
|
||||||
|
|
||||||
|
_sampler->getValueAt(t, pos);
|
||||||
|
|
||||||
|
osg::Vec3 distance = _lastAdd - pos;
|
||||||
|
|
||||||
|
if(t <= 8.0f && distance.length() >= _threshold)
|
||||||
|
{
|
||||||
|
_geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(pos, 0.25f)));
|
||||||
|
_lastAdd = pos;
|
||||||
|
_count++;
|
||||||
|
}
|
||||||
|
else if(t > 8.0f)
|
||||||
|
{
|
||||||
|
if(!countReported) std::cout << "Created " << _count << " nodes." << std::endl;
|
||||||
|
countReported = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
AnimtkUpdateCallback::operator()(node, nv);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
osg::StateSet* setupStateSet()
|
||||||
|
{
|
||||||
|
osg::StateSet* st = new osg::StateSet();
|
||||||
|
|
||||||
|
st->setAttributeAndModes(new osg::Material(), true);
|
||||||
|
st->setMode(GL_BLEND, true);
|
||||||
|
|
||||||
|
AnimtkStateSetUpdateCallback* callback = new AnimtkStateSetUpdateCallback();
|
||||||
|
osgAnimation::Vec4KeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(0, osg::Vec4(1,0,0,1)));
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(2, osg::Vec4(0.,1,0,1)));
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(4, osg::Vec4(0,0,1,1)));
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(6, osg::Vec4(0,0,1,1)));
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(8, osg::Vec4(0,1,0,1)));
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(10, osg::Vec4(1,0,0,1)));
|
||||||
|
callback->start();
|
||||||
|
st->setUpdateCallback(callback);
|
||||||
|
|
||||||
|
return st;
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode)
|
||||||
|
{
|
||||||
|
osg::Vec3 v[5];
|
||||||
|
|
||||||
|
v[0] = osg::Vec3( 0, 0, 0);
|
||||||
|
v[1] = osg::Vec3(20, 40, 60);
|
||||||
|
v[2] = osg::Vec3(40, 60, 20);
|
||||||
|
v[3] = osg::Vec3(60, 20, 40);
|
||||||
|
v[4] = osg::Vec3( 0, 0, 0);
|
||||||
|
|
||||||
|
osg::MatrixTransform* node = new osg::MatrixTransform();
|
||||||
|
AnimtkUpdateCallback* callback = new MakePathDistanceCallback(staticGeode);
|
||||||
|
osgAnimation::Vec3CubicBezierKeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
|
||||||
|
|
||||||
|
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(0, osgAnimation::Vec3CubicBezier(
|
||||||
|
v[0],
|
||||||
|
v[0] + (v[0] - v[3]),
|
||||||
|
v[1] - (v[1] - v[0])
|
||||||
|
)));
|
||||||
|
|
||||||
|
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(2, osgAnimation::Vec3CubicBezier(
|
||||||
|
v[1],
|
||||||
|
v[1] + (v[1] - v[0]),
|
||||||
|
v[2] - (v[2] - v[1])
|
||||||
|
)));
|
||||||
|
|
||||||
|
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(4, osgAnimation::Vec3CubicBezier(
|
||||||
|
v[2],
|
||||||
|
v[2] + (v[2] - v[1]),
|
||||||
|
v[3] - (v[3] - v[2])
|
||||||
|
)));
|
||||||
|
|
||||||
|
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(6, osgAnimation::Vec3CubicBezier(
|
||||||
|
v[3],
|
||||||
|
v[3] + (v[3] - v[2]),
|
||||||
|
v[4] - (v[4] - v[3])
|
||||||
|
)));
|
||||||
|
|
||||||
|
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(8, osgAnimation::Vec3CubicBezier(
|
||||||
|
v[4],
|
||||||
|
v[4] + (v[4] - v[3]),
|
||||||
|
v[0] - (v[0] - v[4])
|
||||||
|
)));
|
||||||
|
|
||||||
|
callback->start();
|
||||||
|
node->setUpdateCallback(callback);
|
||||||
|
|
||||||
|
osg::Geode* geode = new osg::Geode();
|
||||||
|
|
||||||
|
geode->setStateSet(setupStateSet());
|
||||||
|
geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f, 0.0f, 0.0f), 2)));
|
||||||
|
|
||||||
|
node->addChild(geode);
|
||||||
|
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
osg::ArgumentParser arguments(&argc, argv);
|
||||||
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
|
||||||
|
osgGA::TrackballManipulator* tbm = new osgGA::TrackballManipulator();
|
||||||
|
|
||||||
|
viewer.setCameraManipulator(tbm);
|
||||||
|
|
||||||
|
viewer.addEventHandler(new osgViewer::StatsHandler());
|
||||||
|
viewer.addEventHandler(new osgViewer::WindowSizeHandler());
|
||||||
|
|
||||||
|
osg::Group* root = new osg::Group();
|
||||||
|
osg::Geode* geode = new osg::Geode();
|
||||||
|
|
||||||
|
geode->setStateSet(setupStateSet());
|
||||||
|
|
||||||
|
root->setInitialBound(osg::BoundingSphere(osg::Vec3(10,0,20), 50));
|
||||||
|
root->addChild(setupAnimtkNode(geode));
|
||||||
|
root->addChild(geode);
|
||||||
|
|
||||||
|
viewer.setSceneData(root);
|
||||||
|
|
||||||
|
// tbm->setDistance(150);
|
||||||
|
|
||||||
|
return viewer.run();
|
||||||
|
}
|
||||||
3
examples/osganimationnode/CMakeLists.txt
Normal file
3
examples/osganimationnode/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SET(TARGET_SRC osganimationnode.cpp )
|
||||||
|
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||||
|
SETUP_EXAMPLE(osganimationnode)
|
||||||
274
examples/osganimationnode/osganimationnode.cpp
Normal file
274
examples/osganimationnode/osganimationnode.cpp
Normal file
@@ -0,0 +1,274 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
*
|
||||||
|
* This library is open source and may be redistributed and/or modified under
|
||||||
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* OpenSceneGraph Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <osg/Geometry>
|
||||||
|
#include <osg/Shape>
|
||||||
|
#include <osg/ShapeDrawable>
|
||||||
|
#include <osgViewer/Viewer>
|
||||||
|
#include <osgGA/TrackballManipulator>
|
||||||
|
#include <osg/MatrixTransform>
|
||||||
|
#include <osg/Material>
|
||||||
|
#include <osgAnimation/Sampler>
|
||||||
|
|
||||||
|
class AnimtkUpdateCallback : public osg::NodeCallback
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
META_Object(osgAnimation, AnimtkUpdateCallback);
|
||||||
|
|
||||||
|
AnimtkUpdateCallback()
|
||||||
|
{
|
||||||
|
_sampler = new osgAnimation::Vec3CubicBezierSampler;
|
||||||
|
_playing = false;
|
||||||
|
_lastUpdate = 0;
|
||||||
|
}
|
||||||
|
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
|
||||||
|
osg::Object(val, copyop),
|
||||||
|
osg::NodeCallback(val, copyop),
|
||||||
|
_sampler(val._sampler),
|
||||||
|
_startTime(val._startTime),
|
||||||
|
_currentTime(val._currentTime),
|
||||||
|
_playing(val._playing),
|
||||||
|
_lastUpdate(val._lastUpdate)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Callback method called by the NodeVisitor when visiting a node.*/
|
||||||
|
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||||
|
{
|
||||||
|
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
|
||||||
|
nv->getFrameStamp() &&
|
||||||
|
nv->getFrameStamp()->getFrameNumber() != _lastUpdate) {
|
||||||
|
|
||||||
|
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
|
||||||
|
_currentTime = osg::Timer::instance()->tick();
|
||||||
|
|
||||||
|
if (_playing && _sampler.get() && _sampler->getKeyframeContainer()) {
|
||||||
|
osg::MatrixTransform* transform = dynamic_cast<osg::MatrixTransform*>(node);
|
||||||
|
if (transform) {
|
||||||
|
osg::Vec3 result;
|
||||||
|
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||||
|
float duration = _sampler->getEndTime() - _sampler->getStartTime();
|
||||||
|
t = fmod(t, duration);
|
||||||
|
t += _sampler->getStartTime();
|
||||||
|
_sampler->getValueAt(t, result);
|
||||||
|
transform->setMatrix(osg::Matrix::translate(result));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// note, callback is responsible for scenegraph traversal so
|
||||||
|
// they must call traverse(node,nv) to ensure that the
|
||||||
|
// scene graph subtree (and associated callbacks) are traversed.
|
||||||
|
traverse(node,nv);
|
||||||
|
}
|
||||||
|
|
||||||
|
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
|
||||||
|
void stop() { _currentTime = _startTime; _playing = false;}
|
||||||
|
|
||||||
|
osg::ref_ptr<osgAnimation::Vec3CubicBezierSampler> _sampler;
|
||||||
|
osg::Timer_t _startTime;
|
||||||
|
osg::Timer_t _currentTime;
|
||||||
|
bool _playing;
|
||||||
|
int _lastUpdate;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class AnimtkStateSetUpdateCallback : public osg::StateSet::Callback
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
META_Object(osgAnimation, AnimtkStateSetUpdateCallback);
|
||||||
|
|
||||||
|
AnimtkStateSetUpdateCallback()
|
||||||
|
{
|
||||||
|
_sampler = new osgAnimation::Vec4LinearSampler;
|
||||||
|
_playing = false;
|
||||||
|
_lastUpdate = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
|
||||||
|
osg::Object(val, copyop),
|
||||||
|
osg::StateSet::Callback(val, copyop),
|
||||||
|
_sampler(val._sampler),
|
||||||
|
_startTime(val._startTime),
|
||||||
|
_currentTime(val._currentTime),
|
||||||
|
_playing(val._playing),
|
||||||
|
_lastUpdate(val._lastUpdate)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Callback method called by the NodeVisitor when visiting a node.*/
|
||||||
|
virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv)
|
||||||
|
{
|
||||||
|
if (state &&
|
||||||
|
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
|
||||||
|
nv->getFrameStamp() &&
|
||||||
|
nv->getFrameStamp()->getFrameNumber() != _lastUpdate)
|
||||||
|
{
|
||||||
|
|
||||||
|
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
|
||||||
|
_currentTime = osg::Timer::instance()->tick();
|
||||||
|
|
||||||
|
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
|
||||||
|
{
|
||||||
|
osg::Material* material = dynamic_cast<osg::Material*>(state->getAttribute(osg::StateAttribute::MATERIAL));
|
||||||
|
if (material)
|
||||||
|
{
|
||||||
|
osg::Vec4 result;
|
||||||
|
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
|
||||||
|
float duration = _sampler->getEndTime() - _sampler->getStartTime();
|
||||||
|
t = fmod(t, duration);
|
||||||
|
t += _sampler->getStartTime();
|
||||||
|
_sampler->getValueAt(t, result);
|
||||||
|
material->setDiffuse(osg::Material::FRONT_AND_BACK, result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
|
||||||
|
void stop() { _currentTime = _startTime; _playing = false;}
|
||||||
|
|
||||||
|
osg::ref_ptr<osgAnimation::Vec4LinearSampler> _sampler;
|
||||||
|
osg::Timer_t _startTime;
|
||||||
|
osg::Timer_t _currentTime;
|
||||||
|
bool _playing;
|
||||||
|
int _lastUpdate;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
osg::Geode* createAxis()
|
||||||
|
{
|
||||||
|
osg::Geode* geode = new osg::Geode;
|
||||||
|
osg::ref_ptr<osg::Geometry> geometry (new osg::Geometry());
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 10.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 10.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 10.0));
|
||||||
|
geometry->setVertexArray (vertices.get());
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec4Array> colors (new osg::Vec4Array());
|
||||||
|
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
|
geometry->setColorArray (colors.get());
|
||||||
|
|
||||||
|
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||||
|
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
||||||
|
|
||||||
|
geode->addDrawable( geometry.get() );
|
||||||
|
geode->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
|
||||||
|
return geode;
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::StateSet* setupStateSet()
|
||||||
|
{
|
||||||
|
osg::StateSet* st = new osg::StateSet;
|
||||||
|
st->setAttributeAndModes(new osg::Material, true);
|
||||||
|
st->setMode(GL_BLEND, true);
|
||||||
|
AnimtkStateSetUpdateCallback* callback = new AnimtkStateSetUpdateCallback;
|
||||||
|
osgAnimation::Vec4KeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(0, osg::Vec4(0,0,0,0)));
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(2, osg::Vec4(0.5,0,0,0.5)));
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(4, osg::Vec4(0,0.5,0,1)));
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(6, osg::Vec4(0,0,0.5,1)));
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(8, osg::Vec4(1,1,1,0.5)));
|
||||||
|
keys->push_back(osgAnimation::Vec4Keyframe(10, osg::Vec4(0,0,0,0)));
|
||||||
|
callback->start();
|
||||||
|
st->setUpdateCallback(callback);
|
||||||
|
return st;
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::Node* setupCube()
|
||||||
|
{
|
||||||
|
osg::Geode* geode = new osg::Geode;
|
||||||
|
geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f,0.0f,0.0f),2)));
|
||||||
|
geode->setStateSet(setupStateSet());
|
||||||
|
return geode;
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::MatrixTransform* setupAnimtkNode()
|
||||||
|
{
|
||||||
|
osg::Vec3 v[5];
|
||||||
|
v[0] = osg::Vec3(0,0,0);
|
||||||
|
v[1] = osg::Vec3(10,-50,0);
|
||||||
|
v[2] = osg::Vec3(30,-10,20);
|
||||||
|
v[3] = osg::Vec3(-10,20,-20);
|
||||||
|
v[4] = osg::Vec3(0,0,0);
|
||||||
|
osg::MatrixTransform* node = new osg::MatrixTransform;
|
||||||
|
AnimtkUpdateCallback* callback = new AnimtkUpdateCallback;
|
||||||
|
osgAnimation::Vec3CubicBezierKeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
|
||||||
|
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(0, osgAnimation::Vec3CubicBezier(
|
||||||
|
v[0], // pos
|
||||||
|
v[0] + (v[0] - v[3]), // p1
|
||||||
|
v[1] - (v[1] - v[0]) // p2
|
||||||
|
)));
|
||||||
|
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(2, osgAnimation::Vec3CubicBezier(
|
||||||
|
v[1], // pos
|
||||||
|
v[1] + (v[1] - v[0]),
|
||||||
|
v[2] - (v[2] - v[1])
|
||||||
|
)));
|
||||||
|
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(4, osgAnimation::Vec3CubicBezier(
|
||||||
|
v[2], // pos
|
||||||
|
v[2] + (v[2] - v[1]),
|
||||||
|
v[3] - (v[3] - v[2])
|
||||||
|
)));
|
||||||
|
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(6, osgAnimation::Vec3CubicBezier(
|
||||||
|
v[3], // pos
|
||||||
|
v[3] + (v[3] - v[2]),
|
||||||
|
v[4] - (v[4] - v[3])
|
||||||
|
)));
|
||||||
|
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(8, osgAnimation::Vec3CubicBezier(
|
||||||
|
v[4], // pos
|
||||||
|
v[4] + (v[4] - v[3]),
|
||||||
|
v[0] - (v[0] - v[4])
|
||||||
|
)));
|
||||||
|
|
||||||
|
callback->start();
|
||||||
|
node->setUpdateCallback(callback);
|
||||||
|
node->addChild(setupCube());
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main (int argc, char* argv[])
|
||||||
|
{
|
||||||
|
osg::ArgumentParser arguments(&argc, argv);
|
||||||
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
|
||||||
|
osgGA::TrackballManipulator* manipulator = new osgGA::TrackballManipulator();
|
||||||
|
viewer.setCameraManipulator(manipulator);
|
||||||
|
|
||||||
|
osg::Group* root = new osg::Group;
|
||||||
|
root->setInitialBound(osg::BoundingSphere(osg::Vec3(10,0,10), 30));
|
||||||
|
root->addChild(createAxis());
|
||||||
|
|
||||||
|
osg::MatrixTransform* node = setupAnimtkNode();
|
||||||
|
node->addChild(createAxis());
|
||||||
|
root->addChild(node);
|
||||||
|
|
||||||
|
viewer.setSceneData( root );
|
||||||
|
viewer.realize();
|
||||||
|
|
||||||
|
while (!viewer.done())
|
||||||
|
{
|
||||||
|
viewer.frame();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
examples/osganimationskinning/CMakeLists.txt
Normal file
3
examples/osganimationskinning/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SET(TARGET_SRC osganimationskinning.cpp )
|
||||||
|
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||||
|
SETUP_EXAMPLE(osganimationskinning)
|
||||||
274
examples/osganimationskinning/osganimationskinning.cpp
Normal file
274
examples/osganimationskinning/osganimationskinning.cpp
Normal file
@@ -0,0 +1,274 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
* Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
|
||||||
|
*
|
||||||
|
* This library is open source and may be redistributed and/or modified under
|
||||||
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* OpenSceneGraph Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <osg/Geometry>
|
||||||
|
#include <osg/MatrixTransform>
|
||||||
|
#include <osg/Geode>
|
||||||
|
#include <osgViewer/Viewer>
|
||||||
|
#include <osgGA/TrackballManipulator>
|
||||||
|
#include <osgDB/WriteFile>
|
||||||
|
#include <osgUtil/SmoothingVisitor>
|
||||||
|
#include <osg/io_utils>
|
||||||
|
|
||||||
|
#include <osgAnimation/Bone>
|
||||||
|
#include <osgAnimation/Skeleton>
|
||||||
|
#include <osgAnimation/RigGeometry>
|
||||||
|
#include <osgAnimation/BasicAnimationManager>
|
||||||
|
#include <osgAnimation/UpdateMatrixTransform>
|
||||||
|
#include <osgAnimation/UpdateBone>
|
||||||
|
#include <osgAnimation/StackedTransform>
|
||||||
|
#include <osgAnimation/StackedTranslateElement>
|
||||||
|
#include <osgAnimation/StackedRotateAxisElement>
|
||||||
|
|
||||||
|
osg::Geode* createAxis()
|
||||||
|
{
|
||||||
|
osg::Geode* geode (new osg::Geode());
|
||||||
|
osg::Geometry* geometry (new osg::Geometry());
|
||||||
|
|
||||||
|
osg::Vec3Array* vertices (new osg::Vec3Array());
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 1.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 1.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 1.0));
|
||||||
|
geometry->setVertexArray (vertices);
|
||||||
|
|
||||||
|
osg::Vec4Array* colors (new osg::Vec4Array());
|
||||||
|
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
|
geometry->setColorArray (colors);
|
||||||
|
|
||||||
|
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||||
|
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
||||||
|
|
||||||
|
geode->addDrawable( geometry );
|
||||||
|
return geode;
|
||||||
|
}
|
||||||
|
|
||||||
|
osgAnimation::RigGeometry* createTesselatedBox(int nsplit, float size)
|
||||||
|
{
|
||||||
|
osgAnimation::RigGeometry* riggeometry = new osgAnimation::RigGeometry;
|
||||||
|
|
||||||
|
osg::Geometry* geometry = new osg::Geometry;
|
||||||
|
osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());
|
||||||
|
osg::ref_ptr<osg::Vec3Array> colors (new osg::Vec3Array());
|
||||||
|
geometry->setVertexArray (vertices.get());
|
||||||
|
geometry->setColorArray (colors.get());
|
||||||
|
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||||
|
|
||||||
|
float step = size / nsplit;
|
||||||
|
float s = 0.5/4.0;
|
||||||
|
for (int i = 0; i < nsplit; i++)
|
||||||
|
{
|
||||||
|
float x = -1 + i * step;
|
||||||
|
std::cout << x << std::endl;
|
||||||
|
vertices->push_back (osg::Vec3 ( x, s, s));
|
||||||
|
vertices->push_back (osg::Vec3 ( x, -s, s));
|
||||||
|
vertices->push_back (osg::Vec3 ( x, -s, -s));
|
||||||
|
vertices->push_back (osg::Vec3 ( x, s, -s));
|
||||||
|
osg::Vec3 c (0,0,0);
|
||||||
|
c[i%3] = 1;
|
||||||
|
colors->push_back (c);
|
||||||
|
colors->push_back (c);
|
||||||
|
colors->push_back (c);
|
||||||
|
colors->push_back (c);
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::UIntArray> array = new osg::UIntArray;
|
||||||
|
for (int i = 0; i < nsplit - 1; i++)
|
||||||
|
{
|
||||||
|
int base = i * 4;
|
||||||
|
array->push_back(base);
|
||||||
|
array->push_back(base+1);
|
||||||
|
array->push_back(base+4);
|
||||||
|
array->push_back(base+1);
|
||||||
|
array->push_back(base+5);
|
||||||
|
array->push_back(base+4);
|
||||||
|
|
||||||
|
array->push_back(base+3);
|
||||||
|
array->push_back(base);
|
||||||
|
array->push_back(base+4);
|
||||||
|
array->push_back(base+7);
|
||||||
|
array->push_back(base+3);
|
||||||
|
array->push_back(base+4);
|
||||||
|
|
||||||
|
array->push_back(base+5);
|
||||||
|
array->push_back(base+1);
|
||||||
|
array->push_back(base+2);
|
||||||
|
array->push_back(base+2);
|
||||||
|
array->push_back(base+6);
|
||||||
|
array->push_back(base+5);
|
||||||
|
|
||||||
|
array->push_back(base+2);
|
||||||
|
array->push_back(base+3);
|
||||||
|
array->push_back(base+7);
|
||||||
|
array->push_back(base+6);
|
||||||
|
array->push_back(base+2);
|
||||||
|
array->push_back(base+7);
|
||||||
|
}
|
||||||
|
|
||||||
|
geometry->addPrimitiveSet(new osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES, array->size(), &array->front()));
|
||||||
|
geometry->setUseDisplayList( false );
|
||||||
|
riggeometry->setSourceGeometry(geometry);
|
||||||
|
return riggeometry;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void initVertexMap(osgAnimation::Bone* b0,
|
||||||
|
osgAnimation::Bone* b1,
|
||||||
|
osgAnimation::Bone* b2,
|
||||||
|
osgAnimation::RigGeometry* geom,
|
||||||
|
osg::Vec3Array* array)
|
||||||
|
{
|
||||||
|
osgAnimation::VertexInfluenceSet vertexesInfluences;
|
||||||
|
osgAnimation::VertexInfluenceMap* vim = new osgAnimation::VertexInfluenceMap;
|
||||||
|
|
||||||
|
(*vim)[b0->getName()].setName(b0->getName());
|
||||||
|
(*vim)[b1->getName()].setName(b1->getName());
|
||||||
|
(*vim)[b2->getName()].setName(b2->getName());
|
||||||
|
|
||||||
|
for (int i = 0; i < (int)array->size(); i++)
|
||||||
|
{
|
||||||
|
float val = (*array)[i][0];
|
||||||
|
std::cout << val << std::endl;
|
||||||
|
if (val >= -1 && val <= 0)
|
||||||
|
(*vim)[b0->getName()].push_back(osgAnimation::VertexIndexWeight(i,1));
|
||||||
|
else if ( val > 0 && val <= 1)
|
||||||
|
(*vim)[b1->getName()].push_back(osgAnimation::VertexIndexWeight(i,1));
|
||||||
|
else if ( val > 1)
|
||||||
|
(*vim)[b2->getName()].push_back(osgAnimation::VertexIndexWeight(i,1));
|
||||||
|
}
|
||||||
|
|
||||||
|
geom->setInfluenceMap(vim);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int main (int argc, char* argv[])
|
||||||
|
{
|
||||||
|
osg::ArgumentParser arguments(&argc, argv);
|
||||||
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
|
||||||
|
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
|
||||||
|
|
||||||
|
osg::ref_ptr<osgAnimation::Skeleton> skelroot = new osgAnimation::Skeleton;
|
||||||
|
skelroot->setDefaultUpdateCallback();
|
||||||
|
osg::ref_ptr<osgAnimation::Bone> root = new osgAnimation::Bone;
|
||||||
|
root->setInvBindMatrixInSkeletonSpace(osg::Matrix::inverse(osg::Matrix::translate(-1,0,0)));
|
||||||
|
root->setName("root");
|
||||||
|
osgAnimation::UpdateBone* pRootUpdate = new osgAnimation::UpdateBone("root");
|
||||||
|
pRootUpdate->getStackedTransforms().push_back(new osgAnimation::StackedTranslateElement("translate",osg::Vec3(-1,0,0)));
|
||||||
|
root->setUpdateCallback(pRootUpdate);
|
||||||
|
|
||||||
|
osg::ref_ptr<osgAnimation::Bone> right0 = new osgAnimation::Bone;
|
||||||
|
right0->setInvBindMatrixInSkeletonSpace(osg::Matrix::inverse(osg::Matrix::translate(0,0,0)));
|
||||||
|
right0->setName("right0");
|
||||||
|
osgAnimation::UpdateBone* pRight0Update = new osgAnimation::UpdateBone("right0");
|
||||||
|
pRight0Update->getStackedTransforms().push_back(new osgAnimation::StackedTranslateElement("translate", osg::Vec3(1,0,0)));
|
||||||
|
pRight0Update->getStackedTransforms().push_back(new osgAnimation::StackedRotateAxisElement("rotate", osg::Vec3(0,0,1), 0));
|
||||||
|
right0->setUpdateCallback(pRight0Update);
|
||||||
|
|
||||||
|
osg::ref_ptr<osgAnimation::Bone> right1 = new osgAnimation::Bone;
|
||||||
|
right1->setInvBindMatrixInSkeletonSpace(osg::Matrix::inverse(osg::Matrix::translate(1,0,0)));
|
||||||
|
right1->setName("right1");
|
||||||
|
osgAnimation::UpdateBone* pRight1Update = new osgAnimation::UpdateBone("right1");
|
||||||
|
pRight1Update->getStackedTransforms().push_back(new osgAnimation::StackedTranslateElement("translate", osg::Vec3(1,0,0)));
|
||||||
|
pRight1Update->getStackedTransforms().push_back(new osgAnimation::StackedRotateAxisElement("rotate", osg::Vec3(0,0,1), 0));
|
||||||
|
right1->setUpdateCallback(pRight1Update);
|
||||||
|
|
||||||
|
root->addChild(right0.get());
|
||||||
|
right0->addChild(right1.get());
|
||||||
|
skelroot->addChild(root.get());
|
||||||
|
|
||||||
|
osg::Group* scene = new osg::Group;
|
||||||
|
osg::ref_ptr<osgAnimation::BasicAnimationManager> manager = new osgAnimation::BasicAnimationManager;
|
||||||
|
scene->setUpdateCallback(manager.get());
|
||||||
|
|
||||||
|
osgAnimation::Animation* anim = new osgAnimation::Animation;
|
||||||
|
{
|
||||||
|
osgAnimation::FloatKeyframeContainer* keys0 = new osgAnimation::FloatKeyframeContainer;
|
||||||
|
keys0->push_back(osgAnimation::FloatKeyframe(0,0));
|
||||||
|
keys0->push_back(osgAnimation::FloatKeyframe(3,osg::PI_2));
|
||||||
|
keys0->push_back(osgAnimation::FloatKeyframe(6,osg::PI_2));
|
||||||
|
osgAnimation::FloatLinearSampler* sampler = new osgAnimation::FloatLinearSampler;
|
||||||
|
sampler->setKeyframeContainer(keys0);
|
||||||
|
osgAnimation::FloatLinearChannel* channel = new osgAnimation::FloatLinearChannel(sampler);
|
||||||
|
channel->setName("rotate");
|
||||||
|
channel->setTargetName("right0");
|
||||||
|
anim->addChannel(channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
osgAnimation::FloatKeyframeContainer* keys1 = new osgAnimation::FloatKeyframeContainer;
|
||||||
|
keys1->push_back(osgAnimation::FloatKeyframe(0,0));
|
||||||
|
keys1->push_back(osgAnimation::FloatKeyframe(3,0));
|
||||||
|
keys1->push_back(osgAnimation::FloatKeyframe(6,osg::PI_2));
|
||||||
|
osgAnimation::FloatLinearSampler* sampler = new osgAnimation::FloatLinearSampler;
|
||||||
|
sampler->setKeyframeContainer(keys1);
|
||||||
|
osgAnimation::FloatLinearChannel* channel = new osgAnimation::FloatLinearChannel(sampler);
|
||||||
|
channel->setName("rotate");
|
||||||
|
channel->setTargetName("right1");
|
||||||
|
anim->addChannel(channel);
|
||||||
|
}
|
||||||
|
manager->registerAnimation(anim);
|
||||||
|
manager->buildTargetReference();
|
||||||
|
|
||||||
|
// let's start !
|
||||||
|
manager->playAnimation(anim);
|
||||||
|
|
||||||
|
// we will use local data from the skeleton
|
||||||
|
osg::MatrixTransform* rootTransform = new osg::MatrixTransform;
|
||||||
|
rootTransform->setMatrix(osg::Matrix::rotate(osg::PI_2,osg::Vec3(1,0,0)));
|
||||||
|
right0->addChild(createAxis());
|
||||||
|
right0->setDataVariance(osg::Object::DYNAMIC);
|
||||||
|
right1->addChild(createAxis());
|
||||||
|
right1->setDataVariance(osg::Object::DYNAMIC);
|
||||||
|
osg::MatrixTransform* trueroot = new osg::MatrixTransform;
|
||||||
|
trueroot->setMatrix(osg::Matrix(root->getMatrixInBoneSpace().ptr()));
|
||||||
|
trueroot->addChild(createAxis());
|
||||||
|
trueroot->addChild(skelroot.get());
|
||||||
|
trueroot->setDataVariance(osg::Object::DYNAMIC);
|
||||||
|
rootTransform->addChild(trueroot);
|
||||||
|
scene->addChild(rootTransform);
|
||||||
|
|
||||||
|
osgAnimation::RigGeometry* geom = createTesselatedBox(4, 4.0);
|
||||||
|
osg::Geode* geode = new osg::Geode;
|
||||||
|
geode->addDrawable(geom);
|
||||||
|
skelroot->addChild(geode);
|
||||||
|
osg::ref_ptr<osg::Vec3Array> src = dynamic_cast<osg::Vec3Array*>(geom->getSourceGeometry()->getVertexArray());
|
||||||
|
geom->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
|
||||||
|
geom->setDataVariance(osg::Object::DYNAMIC);
|
||||||
|
|
||||||
|
initVertexMap(root.get(), right0.get(), right1.get(), geom, src.get());
|
||||||
|
|
||||||
|
// let's run !
|
||||||
|
viewer.setSceneData( scene );
|
||||||
|
viewer.realize();
|
||||||
|
|
||||||
|
while (!viewer.done())
|
||||||
|
{
|
||||||
|
viewer.frame();
|
||||||
|
}
|
||||||
|
|
||||||
|
osgDB::writeNodeFile(*scene, "skinning.osg");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
3
examples/osganimationsolid/CMakeLists.txt
Normal file
3
examples/osganimationsolid/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SET(TARGET_SRC osganimationsolid.cpp )
|
||||||
|
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||||
|
SETUP_EXAMPLE(osganimationsolid)
|
||||||
124
examples/osganimationsolid/osganimationsolid.cpp
Normal file
124
examples/osganimationsolid/osganimationsolid.cpp
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
* Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
|
||||||
|
*
|
||||||
|
* This library is open source and may be redistributed and/or modified under
|
||||||
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* OpenSceneGraph Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <osg/Geometry>
|
||||||
|
#include <osg/Shape>
|
||||||
|
#include <osg/ShapeDrawable>
|
||||||
|
#include <osgViewer/Viewer>
|
||||||
|
#include <osgGA/TrackballManipulator>
|
||||||
|
#include <osg/MatrixTransform>
|
||||||
|
|
||||||
|
#include <osgAnimation/BasicAnimationManager>
|
||||||
|
#include <osgAnimation/Channel>
|
||||||
|
#include <osgAnimation/UpdateMatrixTransform>
|
||||||
|
#include <osgAnimation/StackedTranslateElement>
|
||||||
|
|
||||||
|
using namespace osgAnimation;
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Geode> createAxis()
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Geode> geode (new osg::Geode());
|
||||||
|
osg::ref_ptr<osg::Geometry> geometry (new osg::Geometry());
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 10.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 10.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
|
||||||
|
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 10.0));
|
||||||
|
geometry->setVertexArray (vertices.get());
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec4Array> colors (new osg::Vec4Array());
|
||||||
|
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
|
geometry->setColorArray (colors.get());
|
||||||
|
|
||||||
|
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||||
|
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
||||||
|
|
||||||
|
geode->addDrawable( geometry.get() );
|
||||||
|
geode->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
|
||||||
|
return geode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main (int argc, char* argv[])
|
||||||
|
{
|
||||||
|
osg::ArgumentParser arguments(&argc, argv);
|
||||||
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
|
||||||
|
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
|
||||||
|
|
||||||
|
osg::Group* root = new osg::Group;
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Geode> axe = createAxis();
|
||||||
|
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
|
||||||
|
geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f,0.0f,0.0f),0.5)));
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::MatrixTransform> trans = new osg::MatrixTransform();
|
||||||
|
trans->setName("AnimatedNode");
|
||||||
|
trans->setDataVariance(osg::Object::DYNAMIC);
|
||||||
|
osgAnimation::UpdateMatrixTransform* updatecb = new osgAnimation::UpdateMatrixTransform("AnimatedCallback");
|
||||||
|
updatecb->getStackedTransforms().push_back(new osgAnimation::StackedTranslateElement("position"));
|
||||||
|
trans->setUpdateCallback(updatecb);
|
||||||
|
trans->setMatrix(osg::Matrix::identity());
|
||||||
|
trans->addChild (geode.get());
|
||||||
|
|
||||||
|
root->addChild (axe.get());
|
||||||
|
root->addChild (trans.get());
|
||||||
|
|
||||||
|
// Define a scheduler for our animations
|
||||||
|
osg::Group* grp = new osg::Group;
|
||||||
|
osgAnimation::BasicAnimationManager* mng = new osgAnimation::BasicAnimationManager();
|
||||||
|
grp->setUpdateCallback(mng);
|
||||||
|
|
||||||
|
grp->addChild(root);
|
||||||
|
|
||||||
|
// And we finaly define our channel
|
||||||
|
osgAnimation::Vec3LinearChannel* channelAnimation1 = new osgAnimation::Vec3LinearChannel;
|
||||||
|
channelAnimation1->setTargetName("AnimatedCallback");
|
||||||
|
channelAnimation1->setName("position");
|
||||||
|
channelAnimation1->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(0, osg::Vec3(0,0,0)));
|
||||||
|
channelAnimation1->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(2, osg::Vec3(1,1,0)));
|
||||||
|
osgAnimation::Animation* anim1 = new osgAnimation::Animation;
|
||||||
|
anim1->addChannel(channelAnimation1);
|
||||||
|
anim1->setPlaymode(osgAnimation::Animation::PPONG);
|
||||||
|
|
||||||
|
|
||||||
|
osgAnimation::Vec3LinearChannel* channelAnimation2 = new osgAnimation::Vec3LinearChannel;
|
||||||
|
channelAnimation2->setTargetName("AnimatedCallback");
|
||||||
|
channelAnimation2->setName("euler");
|
||||||
|
channelAnimation2->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(0, osg::Vec3(0,0,0)));
|
||||||
|
channelAnimation2->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(1.5, osg::Vec3(2*osg::PI,0,0)));
|
||||||
|
osgAnimation::Animation* anim2 = new osgAnimation::Animation;
|
||||||
|
anim2->addChannel(channelAnimation2);
|
||||||
|
anim2->setPlaymode(osgAnimation::Animation::LOOP);
|
||||||
|
|
||||||
|
|
||||||
|
// We register all animation inside the scheduler
|
||||||
|
mng->registerAnimation(anim1);
|
||||||
|
mng->registerAnimation(anim2);
|
||||||
|
|
||||||
|
mng->playAnimation(anim1);
|
||||||
|
mng->playAnimation(anim2);
|
||||||
|
|
||||||
|
viewer.setSceneData( grp );
|
||||||
|
return viewer.run();
|
||||||
|
}
|
||||||
3
examples/osganimationtimeline/CMakeLists.txt
Normal file
3
examples/osganimationtimeline/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SET(TARGET_SRC osganimationtimeline.cpp )
|
||||||
|
SET(TARGET_ADDED_LIBRARIES osgAnimation )
|
||||||
|
SETUP_EXAMPLE(osganimationtimeline)
|
||||||
222
examples/osganimationtimeline/osganimationtimeline.cpp
Normal file
222
examples/osganimationtimeline/osganimationtimeline.cpp
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
* Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
|
||||||
|
*
|
||||||
|
* This library is open source and may be redistributed and/or modified under
|
||||||
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* OpenSceneGraph Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <osgDB/ReadFile>
|
||||||
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
|
#include <osgGA/TrackballManipulator>
|
||||||
|
#include <osgGA/FlightManipulator>
|
||||||
|
#include <osgGA/DriveManipulator>
|
||||||
|
#include <osgGA/KeySwitchMatrixManipulator>
|
||||||
|
#include <osgGA/StateSetManipulator>
|
||||||
|
#include <osgGA/AnimationPathManipulator>
|
||||||
|
#include <osgGA/TerrainManipulator>
|
||||||
|
|
||||||
|
#include <osgAnimation/Bone>
|
||||||
|
#include <osgAnimation/Skeleton>
|
||||||
|
#include <osgAnimation/RigGeometry>
|
||||||
|
#include <osgAnimation/Timeline>
|
||||||
|
#include <osgAnimation/AnimationManagerBase>
|
||||||
|
#include <osgAnimation/TimelineAnimationManager>
|
||||||
|
|
||||||
|
#include <osgAnimation/ActionStripAnimation>
|
||||||
|
#include <osgAnimation/ActionBlendIn>
|
||||||
|
#include <osgAnimation/ActionBlendOut>
|
||||||
|
#include <osgAnimation/ActionAnimation>
|
||||||
|
|
||||||
|
|
||||||
|
struct NoseBegin : public osgAnimation::Action::Callback
|
||||||
|
{
|
||||||
|
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* nv)
|
||||||
|
{
|
||||||
|
std::cout << "sacrebleu, it scratches my nose, let me scratch it" << std::endl;
|
||||||
|
std::cout << "process NoseBegin call back " << action->getName() << std::endl << std::endl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct NoseEnd : public osgAnimation::Action::Callback
|
||||||
|
{
|
||||||
|
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* nv)
|
||||||
|
{
|
||||||
|
std::cout << "shhhrt shrrrrt shhhhhhrrrrt, haaa it's better"<< std::endl;
|
||||||
|
std::cout << "process NoseEnd call back " << action->getName() << std::endl << std::endl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ExampleTimelineUsage : public osgGA::GUIEventHandler
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osgAnimation::ActionStripAnimation> _mainLoop;
|
||||||
|
osg::ref_ptr<osgAnimation::ActionStripAnimation> _scratchHead;
|
||||||
|
osg::ref_ptr<osgAnimation::ActionStripAnimation> _scratchNose;
|
||||||
|
osg::ref_ptr<osgAnimation::TimelineAnimationManager> _manager;
|
||||||
|
|
||||||
|
bool _releaseKey;
|
||||||
|
|
||||||
|
ExampleTimelineUsage(osgAnimation::TimelineAnimationManager* manager)
|
||||||
|
{
|
||||||
|
_releaseKey = false;
|
||||||
|
_manager = manager;
|
||||||
|
|
||||||
|
const osgAnimation::AnimationList& list = _manager->getAnimationList();
|
||||||
|
osgAnimation::AnimationMap map;
|
||||||
|
for (osgAnimation::AnimationList::const_iterator it = list.begin(); it != list.end(); it++)
|
||||||
|
map[(*it)->getName()] = *it;
|
||||||
|
|
||||||
|
_mainLoop = new osgAnimation::ActionStripAnimation(map["Idle_Main"].get(),0.0,0.0);
|
||||||
|
_mainLoop->setLoop(0); // means forever
|
||||||
|
|
||||||
|
_scratchHead = new osgAnimation::ActionStripAnimation(map["Idle_Head_Scratch.02"].get(),0.2,0.3);
|
||||||
|
_scratchHead->setLoop(1); // one time
|
||||||
|
|
||||||
|
map["Idle_Nose_Scratch.01"]->setDuration(10.0); // set this animation duration to 10 seconds
|
||||||
|
_scratchNose = new osgAnimation::ActionStripAnimation(map["Idle_Nose_Scratch.01"].get(),0.2,0.3);
|
||||||
|
_scratchNose->setLoop(1); // one time
|
||||||
|
|
||||||
|
// add the main loop at priority 0 at time 0.
|
||||||
|
|
||||||
|
osgAnimation::Timeline* tml = _manager->getTimeline();
|
||||||
|
tml->play();
|
||||||
|
tml->addActionAt(0.0, _mainLoop.get(), 0);
|
||||||
|
|
||||||
|
|
||||||
|
// add a scratch head priority 1 at 3.0 second.
|
||||||
|
tml->addActionAt(5.0, _scratchHead.get(), 1);
|
||||||
|
|
||||||
|
// populate time with scratch head
|
||||||
|
for (int i = 1; i < 20; i++)
|
||||||
|
{
|
||||||
|
// we add a scratch head priority 1 each 10 second
|
||||||
|
// note:
|
||||||
|
// it's possible to add the same instance more then once on the timeline
|
||||||
|
// the only things you need to take care is if you remove it. It will remove
|
||||||
|
// all instance that exist on the timeline. If you need to differtiate
|
||||||
|
// it's better to create a new instance
|
||||||
|
tml->addActionAt(5.0 + 10.0 * i, _scratchHead.get(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// we will add the scratch nose action only when the player hit a key
|
||||||
|
// in the operator()
|
||||||
|
|
||||||
|
// now we will add callback at end and begin of animation of Idle_Nose_Scratch.02
|
||||||
|
_scratchNose->setCallback(0.0, new NoseBegin);
|
||||||
|
_scratchNose->setCallback(_scratchNose->getNumFrames()-1, new NoseEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&)
|
||||||
|
{
|
||||||
|
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
|
||||||
|
{
|
||||||
|
_releaseKey = true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||||
|
{
|
||||||
|
if (nv && nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
|
||||||
|
{
|
||||||
|
if (_releaseKey) // we hit a key and release it execute an action
|
||||||
|
{
|
||||||
|
osgAnimation::Timeline* tml = _manager->getTimeline();
|
||||||
|
// dont play if already playing
|
||||||
|
if (!tml->isActive(_scratchNose.get()))
|
||||||
|
{
|
||||||
|
// add this animation on top of two other
|
||||||
|
// we add one to evaluate the animation at the next frame, else we
|
||||||
|
// will miss the current frame
|
||||||
|
tml->addActionAt(tml->getCurrentFrame() + 1, _scratchNose.get(), 2);
|
||||||
|
}
|
||||||
|
_releaseKey = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(nv);
|
||||||
|
if (ev && ev->getActionAdapter() && !ev->getEvents().empty())
|
||||||
|
{
|
||||||
|
for(osgGA::EventQueue::Events::iterator itr = ev->getEvents().begin();
|
||||||
|
itr != ev->getEvents().end();
|
||||||
|
++itr)
|
||||||
|
{
|
||||||
|
handleWithCheckAgainstIgnoreHandledEventsMask(*(*itr), *(ev->getActionAdapter()), node, nv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
traverse(node, nv);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
int main (int argc, char* argv[])
|
||||||
|
{
|
||||||
|
std::cerr << "This example works only with nathan.osg" << std::endl;
|
||||||
|
|
||||||
|
osg::ArgumentParser psr(&argc, argv);
|
||||||
|
|
||||||
|
osgViewer::Viewer viewer(psr);
|
||||||
|
|
||||||
|
std::string file = "nathan.osg";
|
||||||
|
if(argc >= 2)
|
||||||
|
file = psr[1];
|
||||||
|
|
||||||
|
// replace the manager
|
||||||
|
osg::Group* root = dynamic_cast<osg::Group*>(osgDB::readNodeFile(file));
|
||||||
|
if (!root) {
|
||||||
|
osg::notify(osg::FATAL) << "can't read file " << file << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
osgAnimation::AnimationManagerBase* animationManager = dynamic_cast<osgAnimation::AnimationManagerBase*>(root->getUpdateCallback());
|
||||||
|
if(!animationManager)
|
||||||
|
{
|
||||||
|
osg::notify(osg::FATAL) << "Did not find AnimationManagerBase updateCallback needed to animate elements" << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::ref_ptr<osgAnimation::TimelineAnimationManager> tl = new osgAnimation::TimelineAnimationManager(*animationManager);
|
||||||
|
root->setUpdateCallback(tl.get());
|
||||||
|
|
||||||
|
ExampleTimelineUsage* callback = new ExampleTimelineUsage(tl.get());
|
||||||
|
root->setEventCallback(callback);
|
||||||
|
root->getUpdateCallback()->addNestedCallback(callback);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// add the state manipulator
|
||||||
|
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
|
||||||
|
|
||||||
|
// add the thread model handler
|
||||||
|
viewer.addEventHandler(new osgViewer::ThreadingHandler);
|
||||||
|
|
||||||
|
// add the window size toggle handler
|
||||||
|
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
|
||||||
|
|
||||||
|
// add the stats handler
|
||||||
|
viewer.addEventHandler(new osgViewer::StatsHandler);
|
||||||
|
|
||||||
|
// add the help handler
|
||||||
|
viewer.addEventHandler(new osgViewer::HelpHandler(psr.getApplicationUsage()));
|
||||||
|
|
||||||
|
// add the LOD Scale handler
|
||||||
|
viewer.addEventHandler(new osgViewer::LODScaleHandler);
|
||||||
|
|
||||||
|
// add the screen capture handler
|
||||||
|
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
|
||||||
|
|
||||||
|
viewer.setSceneData(root);
|
||||||
|
|
||||||
|
return viewer.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
124
examples/osganimationviewer/AnimtkViewer
Normal file
124
examples/osganimationviewer/AnimtkViewer
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
*
|
||||||
|
* This library is open source and may be redistributed and/or modified under
|
||||||
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* OpenSceneGraph Public License for more details.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
* jeremy Moles <jeremy@emperorlinux.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef ANIMTKVIEWER_H
|
||||||
|
#define ANIMTKVIEWER_H
|
||||||
|
|
||||||
|
#include <osg/Node>
|
||||||
|
#include <osgDB/ReadFile>
|
||||||
|
#include <osgAnimation/BasicAnimationManager>
|
||||||
|
|
||||||
|
class AnimtkViewerModelController
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef std::vector<std::string> AnimationMapVector;
|
||||||
|
|
||||||
|
static AnimtkViewerModelController& instance()
|
||||||
|
{
|
||||||
|
static AnimtkViewerModelController avmc;
|
||||||
|
return avmc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool setModel(osgAnimation::BasicAnimationManager* model)
|
||||||
|
{
|
||||||
|
AnimtkViewerModelController& self = instance();
|
||||||
|
self._model = model;
|
||||||
|
for (osgAnimation::AnimationList::const_iterator it = self._model->getAnimationList().begin(); it != self._model->getAnimationList().end(); it++)
|
||||||
|
self._map[(*it)->getName()] = *it;
|
||||||
|
|
||||||
|
for(osgAnimation::AnimationMap::iterator it = self._map.begin(); it != self._map.end(); it++)
|
||||||
|
self._amv.push_back(it->first);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool list()
|
||||||
|
{
|
||||||
|
std::cout << "Animation List:" << std::endl;
|
||||||
|
for(osgAnimation::AnimationMap::iterator it = _map.begin(); it != _map.end(); it++)
|
||||||
|
std::cout << it->first << std::endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool play()
|
||||||
|
{
|
||||||
|
if(_focus < _amv.size())
|
||||||
|
{
|
||||||
|
std::cout << "Play " << _amv[_focus] << std::endl;
|
||||||
|
_model->playAnimation(_map[_amv[_focus]].get());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool stop()
|
||||||
|
{
|
||||||
|
if(_focus < _amv.size())
|
||||||
|
{
|
||||||
|
std::cout << "Stop " << _amv[_focus] << std::endl;
|
||||||
|
_model->stopAnimation(_map[_amv[_focus]].get());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool next()
|
||||||
|
{
|
||||||
|
_focus = (_focus + 1) % _map.size();
|
||||||
|
std::cout << "Current now is " << _amv[_focus] << std::endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool previous()
|
||||||
|
{
|
||||||
|
_focus = (_map.size() + _focus - 1) % _map.size();
|
||||||
|
std::cout << "Current now is " << _amv[_focus] << std::endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool playByName(const std::string& name)
|
||||||
|
{
|
||||||
|
for(unsigned int i = 0; i < _amv.size(); i++) if(_amv[i] == name) _focus = i;
|
||||||
|
_model->playAnimation(_map[name].get());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& getCurrentAnimationName() const
|
||||||
|
{
|
||||||
|
return _amv[_focus];
|
||||||
|
}
|
||||||
|
|
||||||
|
const AnimationMapVector& getAnimationMap() const
|
||||||
|
{
|
||||||
|
return _amv;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
osg::ref_ptr<osgAnimation::BasicAnimationManager> _model;
|
||||||
|
osgAnimation::AnimationMap _map;
|
||||||
|
AnimationMapVector _amv;
|
||||||
|
unsigned int _focus;
|
||||||
|
|
||||||
|
AnimtkViewerModelController():
|
||||||
|
_model(0),
|
||||||
|
_focus(0) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
174
examples/osganimationviewer/AnimtkViewer.cpp
Normal file
174
examples/osganimationviewer/AnimtkViewer.cpp
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
*
|
||||||
|
* This library is open source and may be redistributed and/or modified under
|
||||||
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* OpenSceneGraph Public License for more details.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
* jeremy Moles <jeremy@emperorlinux.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "AnimtkViewerKeyHandler"
|
||||||
|
#include "AnimtkViewerGUI"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <osg/io_utils>
|
||||||
|
#include <osg/Geometry>
|
||||||
|
#include <osg/MatrixTransform>
|
||||||
|
#include <osg/Geode>
|
||||||
|
#include <osgViewer/Viewer>
|
||||||
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
|
#include <osgWidget/ViewerEventHandlers>
|
||||||
|
#include <osgGA/TrackballManipulator>
|
||||||
|
#include <osgGA/StateSetManipulator>
|
||||||
|
#include <osgDB/ReadFile>
|
||||||
|
#include <osgAnimation/AnimationManagerBase>
|
||||||
|
#include <osgAnimation/Bone>
|
||||||
|
|
||||||
|
const int WIDTH = 1440;
|
||||||
|
const int HEIGHT = 900;
|
||||||
|
|
||||||
|
|
||||||
|
osg::Geode* createAxis()
|
||||||
|
{
|
||||||
|
osg::Geode* geode = new osg::Geode();
|
||||||
|
osg::Geometry* geometry = new osg::Geometry();
|
||||||
|
osg::Vec3Array* vertices = new osg::Vec3Array();
|
||||||
|
osg::Vec4Array* colors = new osg::Vec4Array();
|
||||||
|
|
||||||
|
vertices->push_back(osg::Vec3(0.0f, 0.0f, 0.0f));
|
||||||
|
vertices->push_back(osg::Vec3(1.0f, 0.0f, 0.0f));
|
||||||
|
vertices->push_back(osg::Vec3(0.0f, 0.0f, 0.0f));
|
||||||
|
vertices->push_back(osg::Vec3(0.0f, 1.0f, 0.0f));
|
||||||
|
vertices->push_back(osg::Vec3(0.0f, 0.0f, 0.0f));
|
||||||
|
vertices->push_back(osg::Vec3(0.0f, 0.0f, 1.0f));
|
||||||
|
|
||||||
|
colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 1.0f));
|
||||||
|
colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
|
colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
|
|
||||||
|
geometry->setVertexArray(vertices);
|
||||||
|
geometry->setColorArray(colors);
|
||||||
|
geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
|
||||||
|
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES, 0, 6));
|
||||||
|
geometry->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
|
||||||
|
|
||||||
|
geode->addDrawable(geometry);
|
||||||
|
|
||||||
|
return geode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct AnimationManagerFinder : public osg::NodeVisitor
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osgAnimation::BasicAnimationManager> _am;
|
||||||
|
AnimationManagerFinder() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}
|
||||||
|
void apply(osg::Node& node) {
|
||||||
|
if (_am.valid())
|
||||||
|
return;
|
||||||
|
if (node.getUpdateCallback()) {
|
||||||
|
osgAnimation::AnimationManagerBase* b = dynamic_cast<osgAnimation::AnimationManagerBase*>(node.getUpdateCallback());
|
||||||
|
if (b) {
|
||||||
|
_am = new osgAnimation::BasicAnimationManager(*b);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
traverse(node);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct AddHelperBone : public osg::NodeVisitor
|
||||||
|
{
|
||||||
|
AddHelperBone() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}
|
||||||
|
void apply(osg::Transform& node) {
|
||||||
|
osgAnimation::Bone* bone = dynamic_cast<osgAnimation::Bone*>(&node);
|
||||||
|
if (bone)
|
||||||
|
bone->addChild(createAxis());
|
||||||
|
traverse(node);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
osg::ArgumentParser arguments(&argc, argv);
|
||||||
|
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
||||||
|
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a 3d poker game client");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","List command line options.");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("--drawbone","draw helps to display bones.");
|
||||||
|
|
||||||
|
if (arguments.read("-h") || arguments.read("--help"))
|
||||||
|
{
|
||||||
|
arguments.getApplicationUsage()->write(std::cout, osg::ApplicationUsage::COMMAND_LINE_OPTION);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arguments.argc()<=1)
|
||||||
|
{
|
||||||
|
arguments.getApplicationUsage()->write(std::cout, osg::ApplicationUsage::COMMAND_LINE_OPTION);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool drawBone = false;
|
||||||
|
if (arguments.read("--drawbone"))
|
||||||
|
drawBone = true;
|
||||||
|
|
||||||
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
osg::ref_ptr<osg::Group> group = new osg::Group();
|
||||||
|
|
||||||
|
osg::Group* node = dynamic_cast<osg::Group*>(osgDB::readNodeFiles(arguments)); //dynamic_cast<osgAnimation::AnimationManager*>(osgDB::readNodeFile(psr[1]));
|
||||||
|
if(!node)
|
||||||
|
{
|
||||||
|
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set our Singleton's model.
|
||||||
|
AnimationManagerFinder finder;
|
||||||
|
node->accept(finder);
|
||||||
|
if (finder._am.valid()) {
|
||||||
|
node->setUpdateCallback(finder._am.get());
|
||||||
|
AnimtkViewerModelController::setModel(finder._am.get());
|
||||||
|
} else {
|
||||||
|
osg::notify(osg::WARN) << "no osgAnimation::AnimationManagerBase found in the subgraph, no animations available" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (drawBone) {
|
||||||
|
osg::notify(osg::INFO) << "Add Bones Helper" << std::endl;
|
||||||
|
AddHelperBone addHelper;
|
||||||
|
node->accept(addHelper);
|
||||||
|
}
|
||||||
|
node->addChild(createAxis());
|
||||||
|
|
||||||
|
AnimtkViewerGUI* gui = new AnimtkViewerGUI(&viewer, WIDTH, HEIGHT, 0x1234);
|
||||||
|
osg::Camera* camera = gui->createParentOrthoCamera();
|
||||||
|
|
||||||
|
node->setNodeMask(0x0001);
|
||||||
|
|
||||||
|
group->addChild(node);
|
||||||
|
group->addChild(camera);
|
||||||
|
|
||||||
|
viewer.addEventHandler(new AnimtkKeyEventHandler());
|
||||||
|
viewer.addEventHandler(new osgViewer::StatsHandler());
|
||||||
|
viewer.addEventHandler(new osgViewer::WindowSizeHandler());
|
||||||
|
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
|
||||||
|
viewer.addEventHandler(new osgWidget::MouseHandler(gui));
|
||||||
|
viewer.addEventHandler(new osgWidget::KeyboardHandler(gui));
|
||||||
|
viewer.addEventHandler(new osgWidget::ResizeHandler(gui, camera));
|
||||||
|
viewer.setSceneData(group.get());
|
||||||
|
|
||||||
|
viewer.setUpViewInWindow(40, 40, WIDTH, HEIGHT);
|
||||||
|
|
||||||
|
return viewer.run();
|
||||||
|
}
|
||||||
46
examples/osganimationviewer/AnimtkViewerGUI
Normal file
46
examples/osganimationviewer/AnimtkViewerGUI
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
|
||||||
|
Jeremy Moles <jeremy@emperorlinux.com>
|
||||||
|
Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ANIMTKVIEWERGUI_H
|
||||||
|
#define ANIMTKVIEWERGUI_H
|
||||||
|
|
||||||
|
#include <osgWidget/WindowManager>
|
||||||
|
|
||||||
|
class AnimtkViewerGUI: public osgWidget::WindowManager {
|
||||||
|
osg::ref_ptr<osgWidget::Box> _buttonBox;
|
||||||
|
osg::ref_ptr<osgWidget::Box> _listBox;
|
||||||
|
osg::ref_ptr<osgWidget::Box> _labelBox;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
osgWidget::Widget* _createButton(const std::string&);
|
||||||
|
|
||||||
|
bool _buttonPush(osgWidget::Event&);
|
||||||
|
bool _listMouseHover(osgWidget::Event&);
|
||||||
|
|
||||||
|
void _createButtonBox();
|
||||||
|
void _createListBox();
|
||||||
|
void _createLabelBox();
|
||||||
|
|
||||||
|
public:
|
||||||
|
AnimtkViewerGUI(osgViewer::View*, float, float, unsigned int);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
407
examples/osganimationviewer/AnimtkViewerGUI.cpp
Normal file
407
examples/osganimationviewer/AnimtkViewerGUI.cpp
Normal file
@@ -0,0 +1,407 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
*
|
||||||
|
* This library is open source and may be redistributed and/or modified under
|
||||||
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* OpenSceneGraph Public License for more details.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
* jeremy Moles <jeremy@emperorlinux.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "AnimtkViewer"
|
||||||
|
#include "AnimtkViewerGUI"
|
||||||
|
|
||||||
|
#include <osg/Version>
|
||||||
|
#include <osgWidget/WindowManager>
|
||||||
|
#include <osgAnimation/EaseMotion>
|
||||||
|
|
||||||
|
const std::string IMAGE_PATH = "osgWidget/";
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct Sampler: public osg::Drawable::UpdateCallback
|
||||||
|
{
|
||||||
|
T _motion;
|
||||||
|
Sampler() {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef Sampler<osgAnimation::OutQuadMotion> WidgetSampler;
|
||||||
|
|
||||||
|
struct ButtonFunctor: public WidgetSampler
|
||||||
|
{
|
||||||
|
float _direction;
|
||||||
|
float _previous;
|
||||||
|
|
||||||
|
const float _speed;
|
||||||
|
|
||||||
|
ButtonFunctor(): _speed(5) { _direction = -_speed; _previous = 0;}
|
||||||
|
|
||||||
|
bool enter(osgWidget::Event&)
|
||||||
|
{
|
||||||
|
_direction = _speed;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool leave(osgWidget::Event&)
|
||||||
|
{
|
||||||
|
_direction = -_speed;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void update(osg::NodeVisitor* nv , osg::Drawable* geom)
|
||||||
|
{
|
||||||
|
const osg::FrameStamp* f = nv->getFrameStamp();
|
||||||
|
float dt = f->getSimulationTime() - _previous;
|
||||||
|
_previous = f->getSimulationTime();
|
||||||
|
update(dt,dynamic_cast<osgWidget::Widget*>(geom));
|
||||||
|
}
|
||||||
|
|
||||||
|
void update(float t, osgWidget::Widget* w)
|
||||||
|
{
|
||||||
|
if (!w) return;
|
||||||
|
_motion.update(t*_direction);
|
||||||
|
float val = _motion.getValue()*0.5;
|
||||||
|
val += 0.5;
|
||||||
|
if (val >= 1.0)
|
||||||
|
val = 1.0;
|
||||||
|
w->setColor(osg::Vec4(val, val, val, 1));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct LabelFunctor: public WidgetSampler
|
||||||
|
{
|
||||||
|
float _previous;
|
||||||
|
bool _active;
|
||||||
|
|
||||||
|
const float _fadeOutTime;
|
||||||
|
|
||||||
|
osgAnimation::OutCubicMotion _scaleSampler;
|
||||||
|
|
||||||
|
LabelFunctor():
|
||||||
|
_fadeOutTime(1.5f)
|
||||||
|
{
|
||||||
|
_previous = 0.0f;
|
||||||
|
_active = false;
|
||||||
|
|
||||||
|
_scaleSampler = osgAnimation::OutCubicMotion(0.5, 1.0, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setActive(bool active)
|
||||||
|
{
|
||||||
|
_active = active;
|
||||||
|
|
||||||
|
if(active) _motion.reset();
|
||||||
|
|
||||||
|
_scaleSampler.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void update(osg::NodeVisitor* nv , osg::Drawable* geom)
|
||||||
|
{
|
||||||
|
const osg::FrameStamp* f = nv->getFrameStamp();
|
||||||
|
|
||||||
|
float st = f->getSimulationTime();
|
||||||
|
float dt = st - _previous;
|
||||||
|
|
||||||
|
_previous = st;
|
||||||
|
|
||||||
|
if(!_active) return;
|
||||||
|
|
||||||
|
update(dt, dynamic_cast<osgWidget::Label*>(geom));
|
||||||
|
updateScale(dt, dynamic_cast<osgWidget::Label*>(geom));
|
||||||
|
}
|
||||||
|
|
||||||
|
void update(float t, osgWidget::Label* w)
|
||||||
|
{
|
||||||
|
if(!w) return;
|
||||||
|
|
||||||
|
_motion.update(t / _fadeOutTime);
|
||||||
|
|
||||||
|
float val = _motion.getValue();
|
||||||
|
|
||||||
|
if(val >= 1.0f) {
|
||||||
|
_motion.reset();
|
||||||
|
_active = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
w->setFontColor(osg::Vec4(0.0f, 0.0f, 0.0f, (1.0f - val) * 0.7f));
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateScale(float t, osgWidget::Label* w)
|
||||||
|
{
|
||||||
|
_scaleSampler.update(t);
|
||||||
|
float val = _scaleSampler.getValue();
|
||||||
|
osgWidget::Window* win = w->getParent();
|
||||||
|
win->setScale(val);
|
||||||
|
win->update();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct ListFunctor: public osg::NodeCallback
|
||||||
|
{
|
||||||
|
float _previous;
|
||||||
|
int _direction;
|
||||||
|
|
||||||
|
osgAnimation::InQuadMotion _transformSampler;
|
||||||
|
|
||||||
|
ListFunctor()
|
||||||
|
{
|
||||||
|
_direction = 1;
|
||||||
|
_previous = 0;
|
||||||
|
|
||||||
|
_transformSampler.update(1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void toggleShown()
|
||||||
|
{
|
||||||
|
if(_direction == 1) _direction = -1;
|
||||||
|
|
||||||
|
else _direction = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||||
|
{
|
||||||
|
const osg::FrameStamp* f = nv->getFrameStamp();
|
||||||
|
|
||||||
|
float st = f->getSimulationTime();
|
||||||
|
float dt = st - _previous;
|
||||||
|
|
||||||
|
_previous = st;
|
||||||
|
|
||||||
|
_transformSampler.update((dt * _direction) / 0.5f);
|
||||||
|
|
||||||
|
float val = _transformSampler.getValue();
|
||||||
|
|
||||||
|
if(val > 1.0f || val < 0.0f) return;
|
||||||
|
|
||||||
|
osgWidget::Window* win = dynamic_cast<osgWidget::Window*>(node);
|
||||||
|
|
||||||
|
float w = win->getWidth();
|
||||||
|
float wmw = win->getWindowManager()->getWidth();
|
||||||
|
|
||||||
|
win->setX((wmw - w) + (val * w));
|
||||||
|
win->update();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// This is a temporary hack to "prevent" dragging on Widgets and Windows.
|
||||||
|
bool eatDrag(osgWidget::Event&)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
AnimtkViewerGUI::AnimtkViewerGUI(osgViewer::View* view, float w, float h, unsigned int mask):
|
||||||
|
osgWidget::WindowManager(view, w, h, mask, 0)
|
||||||
|
{
|
||||||
|
_createButtonBox();
|
||||||
|
_createLabelBox();
|
||||||
|
_createListBox();
|
||||||
|
|
||||||
|
_labelBox->setAnchorHorizontal(osgWidget::Window::HA_LEFT);
|
||||||
|
_labelBox->setY(74.0f);
|
||||||
|
_labelBox->setVisibilityMode(osgWidget::Window::VM_ENTIRE);
|
||||||
|
|
||||||
|
_listBox->setOrigin(getWidth(), 74.0f);
|
||||||
|
|
||||||
|
addChild(_buttonBox.get());
|
||||||
|
addChild(_labelBox.get());
|
||||||
|
addChild(_listBox.get());
|
||||||
|
|
||||||
|
resizeAllWindows();
|
||||||
|
|
||||||
|
// Remember, you can't call resizePercent until AFTER the box is parented
|
||||||
|
// by a WindowManager; how could it possibly resize itself if it doesn't know
|
||||||
|
// how large it's viewable area is?
|
||||||
|
_buttonBox->resizePercent(100.0f);
|
||||||
|
_buttonBox->resizeAdd(0.0f, 10.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
osgWidget::Widget* AnimtkViewerGUI::_createButton(const std::string& name)
|
||||||
|
{
|
||||||
|
osgWidget::Widget* b = new osgWidget::Widget(name, 64.0f, 64.0f);
|
||||||
|
|
||||||
|
if(!b) return 0;
|
||||||
|
|
||||||
|
b->setImage(IMAGE_PATH + name + ".png", true);
|
||||||
|
b->setEventMask(osgWidget::EVENT_MASK_MOUSE_DRAG);
|
||||||
|
|
||||||
|
ButtonFunctor* bt = new ButtonFunctor();
|
||||||
|
b->setUpdateCallback(bt);
|
||||||
|
|
||||||
|
b->addCallback(new osgWidget::Callback(&ButtonFunctor::enter, bt, osgWidget::EVENT_MOUSE_ENTER));
|
||||||
|
b->addCallback(new osgWidget::Callback(&ButtonFunctor::leave, bt, osgWidget::EVENT_MOUSE_LEAVE));
|
||||||
|
b->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_buttonPush, this, osgWidget::EVENT_MOUSE_PUSH));
|
||||||
|
b->addCallback(new osgWidget::Callback(&eatDrag, osgWidget::EVENT_MOUSE_DRAG));
|
||||||
|
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AnimtkViewerGUI::_listMouseHover(osgWidget::Event& ev)
|
||||||
|
{
|
||||||
|
osgWidget::Label* l = dynamic_cast<osgWidget::Label*>(ev.getWidget());
|
||||||
|
|
||||||
|
if(!l) return false;
|
||||||
|
|
||||||
|
if(ev.type == osgWidget::EVENT_MOUSE_ENTER) l->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
|
|
||||||
|
else if(ev.type == osgWidget::EVENT_MOUSE_LEAVE) l->setFontColor(1.0f, 1.0f, 1.0f, 0.3f);
|
||||||
|
|
||||||
|
else if(ev.type == osgWidget::EVENT_MOUSE_PUSH) {
|
||||||
|
AnimtkViewerModelController::instance().playByName(ev.getWidget()->getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
else return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AnimtkViewerGUI::_buttonPush(osgWidget::Event& ev)
|
||||||
|
{
|
||||||
|
if(!ev.getWidget()) return false;
|
||||||
|
|
||||||
|
osgWidget::Label* l = static_cast<osgWidget::Label*>(_labelBox->getByName("label"));
|
||||||
|
|
||||||
|
if(!l) return false;
|
||||||
|
|
||||||
|
LabelFunctor* lf = dynamic_cast<LabelFunctor*>(l->getUpdateCallback());
|
||||||
|
|
||||||
|
if(!lf) return false;
|
||||||
|
|
||||||
|
// We're safe at this point, so begin processing.
|
||||||
|
AnimtkViewerModelController& mc = AnimtkViewerModelController::instance();
|
||||||
|
std::string name = ev.getWidget()->getName();
|
||||||
|
|
||||||
|
if(name == "play") mc.play();
|
||||||
|
|
||||||
|
else if(name == "stop") mc.stop();
|
||||||
|
|
||||||
|
else if(name == "next")
|
||||||
|
{
|
||||||
|
mc.next();
|
||||||
|
|
||||||
|
l->setFontColor(osg::Vec4(0.0f, 0.0f, 0.0f, 0.7f));
|
||||||
|
l->setLabel(mc.getCurrentAnimationName());
|
||||||
|
lf->setActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(name == "back")
|
||||||
|
{
|
||||||
|
mc.previous();
|
||||||
|
|
||||||
|
l->setFontColor(osg::Vec4(0.0f, 0.0f, 0.0f, 0.7f));
|
||||||
|
l->setLabel(mc.getCurrentAnimationName());
|
||||||
|
lf->setActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(name == "pause")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(name == "open")
|
||||||
|
{
|
||||||
|
ListFunctor* lsf = dynamic_cast<ListFunctor*>(_listBox->getUpdateCallback());
|
||||||
|
|
||||||
|
if(!lsf) return false;
|
||||||
|
|
||||||
|
lsf->toggleShown();
|
||||||
|
}
|
||||||
|
|
||||||
|
else return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AnimtkViewerGUI::_createButtonBox()
|
||||||
|
{
|
||||||
|
_buttonBox = new osgWidget::Box("buttonBox", osgWidget::Box::HORIZONTAL);
|
||||||
|
|
||||||
|
osgWidget::Widget* space = new osgWidget::Widget("nullSpace", 0.0f, 0.0f);
|
||||||
|
osgWidget::Widget* back = _createButton("back");
|
||||||
|
osgWidget::Widget* next = _createButton("next");
|
||||||
|
osgWidget::Widget* play = _createButton("play");
|
||||||
|
osgWidget::Widget* pause = _createButton("pause");
|
||||||
|
osgWidget::Widget* stop = _createButton("stop");
|
||||||
|
osgWidget::Widget* open = _createButton("open");
|
||||||
|
|
||||||
|
space->setCanFill(true);
|
||||||
|
space->setColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
|
_buttonBox->addWidget(space);
|
||||||
|
_buttonBox->addWidget(back);
|
||||||
|
_buttonBox->addWidget(next);
|
||||||
|
_buttonBox->addWidget(play);
|
||||||
|
_buttonBox->addWidget(pause);
|
||||||
|
_buttonBox->addWidget(stop);
|
||||||
|
_buttonBox->addWidget(open);
|
||||||
|
_buttonBox->addWidget(osg::clone(space, "space1", osg::CopyOp::DEEP_COPY_ALL));
|
||||||
|
_buttonBox->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.7f);
|
||||||
|
|
||||||
|
_buttonBox->setEventMask(osgWidget::EVENT_MASK_MOUSE_DRAG);
|
||||||
|
_buttonBox->addCallback(new osgWidget::Callback(&eatDrag, osgWidget::EVENT_MOUSE_DRAG));
|
||||||
|
}
|
||||||
|
|
||||||
|
void AnimtkViewerGUI::_createListBox()
|
||||||
|
{
|
||||||
|
_listBox = new osgWidget::Box("listBox", osgWidget::Box::VERTICAL);
|
||||||
|
|
||||||
|
const AnimtkViewerModelController::AnimationMapVector& amv =
|
||||||
|
AnimtkViewerModelController::instance().getAnimationMap()
|
||||||
|
;
|
||||||
|
|
||||||
|
for(
|
||||||
|
AnimtkViewerModelController::AnimationMapVector::const_iterator i = amv.begin();
|
||||||
|
i != amv.end();
|
||||||
|
i++
|
||||||
|
)
|
||||||
|
{
|
||||||
|
osgWidget::Label* label = new osgWidget::Label(*i);
|
||||||
|
|
||||||
|
label->setCanFill(true);
|
||||||
|
label->setFont("fonts/Vera.ttf");
|
||||||
|
label->setFontSize(15);
|
||||||
|
label->setFontColor(1.0f, 1.0f, 1.0f, 0.3f);
|
||||||
|
label->setPadding(5.0f);
|
||||||
|
label->setAlignHorizontal(osgWidget::Widget::HA_RIGHT);
|
||||||
|
label->setLabel(*i);
|
||||||
|
label->setEventMask(osgWidget::EVENT_MASK_MOUSE_DRAG);
|
||||||
|
label->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_listMouseHover, this, osgWidget::EVENT_MOUSE_ENTER));
|
||||||
|
label->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_listMouseHover, this, osgWidget::EVENT_MOUSE_LEAVE));
|
||||||
|
label->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_listMouseHover, this, osgWidget::EVENT_MOUSE_PUSH));
|
||||||
|
|
||||||
|
_listBox->addWidget(label);
|
||||||
|
}
|
||||||
|
|
||||||
|
ListFunctor* lf = new ListFunctor();
|
||||||
|
|
||||||
|
_listBox->setUpdateCallback(lf);
|
||||||
|
_listBox->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.7f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AnimtkViewerGUI::_createLabelBox()
|
||||||
|
{
|
||||||
|
_labelBox = new osgWidget::Box("labelBox", osgWidget::Box::VERTICAL);
|
||||||
|
|
||||||
|
osgWidget::Label* label = new osgWidget::Label("label");
|
||||||
|
|
||||||
|
label->setFont("fonts/Vera.ttf");
|
||||||
|
label->setFontSize(50);
|
||||||
|
label->setFontColor(0.0f, 0.0f, 0.0f, 0.7f);
|
||||||
|
label->setAlignHorizontal(osgWidget::Widget::HA_LEFT);
|
||||||
|
label->setPadding(10.0f);
|
||||||
|
|
||||||
|
LabelFunctor* lf = new LabelFunctor();
|
||||||
|
label->setUpdateCallback(lf);
|
||||||
|
|
||||||
|
_labelBox->addWidget(label);
|
||||||
|
_labelBox->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
}
|
||||||
53
examples/osganimationviewer/AnimtkViewerKeyHandler
Normal file
53
examples/osganimationviewer/AnimtkViewerKeyHandler
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
*
|
||||||
|
* Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ANIMTKVIEWER_KEYHANDLER_H
|
||||||
|
#define ANIMTKVIEWER_KEYHANDLER_H
|
||||||
|
|
||||||
|
#include "AnimtkViewer"
|
||||||
|
|
||||||
|
#include <osgGA/GUIEventHandler>
|
||||||
|
|
||||||
|
class AnimtkKeyEventHandler : public osgGA::GUIEventHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AnimtkKeyEventHandler();
|
||||||
|
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa,
|
||||||
|
osg::Object*, osg::NodeVisitor*);
|
||||||
|
void printUsage() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
enum Binding
|
||||||
|
{
|
||||||
|
List,
|
||||||
|
Help,
|
||||||
|
Play,
|
||||||
|
Next,
|
||||||
|
Prev
|
||||||
|
};
|
||||||
|
|
||||||
|
std::map<Binding, int> _actionKeys;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
63
examples/osganimationviewer/AnimtkViewerKeyHandler.cpp
Normal file
63
examples/osganimationviewer/AnimtkViewerKeyHandler.cpp
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
/* -*-c++-*-
|
||||||
|
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
*
|
||||||
|
* Cedric Pinson <mornifle@plopbyte.net>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "AnimtkViewerKeyHandler"
|
||||||
|
|
||||||
|
AnimtkKeyEventHandler::AnimtkKeyEventHandler()
|
||||||
|
{
|
||||||
|
_actionKeys[List] = 'l';
|
||||||
|
_actionKeys[Help] = 'h';
|
||||||
|
_actionKeys[Play] = 'p';
|
||||||
|
_actionKeys[Next] = ']';
|
||||||
|
_actionKeys[Prev] = '[';
|
||||||
|
}
|
||||||
|
|
||||||
|
void AnimtkKeyEventHandler::printUsage() const
|
||||||
|
{
|
||||||
|
std::cout << (char) _actionKeys.find(Help)->second << " for Help" << std::endl;
|
||||||
|
std::cout << (char) _actionKeys.find(List)->second << " for List" << std::endl;
|
||||||
|
std::cout << (char) _actionKeys.find(Play)->second << " for Play" << std::endl;
|
||||||
|
std::cout << (char) _actionKeys.find(Next)->second << " for select Next item" << std::endl;
|
||||||
|
std::cout << (char) _actionKeys.find(Prev)->second << " for select Previous item" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool AnimtkKeyEventHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&,
|
||||||
|
osg::Object*, osg::NodeVisitor*)
|
||||||
|
{
|
||||||
|
AnimtkViewerModelController& mc = AnimtkViewerModelController::instance();
|
||||||
|
if(ea.getEventType() == osgGA::GUIEventAdapter::KEYDOWN)
|
||||||
|
{
|
||||||
|
if (ea.getKey() == _actionKeys[List]) return mc.list();
|
||||||
|
else if (ea.getKey() == _actionKeys[Play]) return mc.play();
|
||||||
|
else if (ea.getKey() == _actionKeys[Next]) return mc.next();
|
||||||
|
else if (ea.getKey() == _actionKeys[Prev]) return mc.previous();
|
||||||
|
else if (ea.getKey() == _actionKeys[Help])
|
||||||
|
{
|
||||||
|
printUsage();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
7
examples/osganimationviewer/CMakeLists.txt
Normal file
7
examples/osganimationviewer/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
SET(TARGET_SRC
|
||||||
|
AnimtkViewer.cpp
|
||||||
|
AnimtkViewerKeyHandler.cpp
|
||||||
|
AnimtkViewerGUI.cpp
|
||||||
|
)
|
||||||
|
SET(TARGET_ADDED_LIBRARIES osgAnimation osgWidget)
|
||||||
|
SETUP_EXAMPLE(osganimationviewer)
|
||||||
4
examples/osgautocapture/CMakeLists.txt
Normal file
4
examples/osgautocapture/CMakeLists.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
SET(TARGET_SRC osgautocapture.cpp )
|
||||||
|
|
||||||
|
#### end var setup ###
|
||||||
|
SETUP_EXAMPLE(osgautocapture)
|
||||||
346
examples/osgautocapture/osgautocapture.cpp
Normal file
346
examples/osgautocapture/osgautocapture.cpp
Normal file
@@ -0,0 +1,346 @@
|
|||||||
|
/**
|
||||||
|
* TODO:
|
||||||
|
* 1) Change example to use offscreen rendering (pbuffer) so that it becomes a true commandline tool with now windows
|
||||||
|
* 2) Make example work with other threading models than SingleThreaded
|
||||||
|
* 3) Add support for autocapture to movies
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include <osg/ArgumentParser>
|
||||||
|
#include <osg/CoordinateSystemNode>
|
||||||
|
#include <osg/Matrix>
|
||||||
|
#include <osg/NodeVisitor>
|
||||||
|
|
||||||
|
#include <osgUtil/IntersectionVisitor>
|
||||||
|
#include <osgUtil/GLObjectsVisitor>
|
||||||
|
|
||||||
|
#include <osgDB/ReadFile>
|
||||||
|
#include <osgDB/WriteFile>
|
||||||
|
|
||||||
|
#include <osgGA/DriveManipulator>
|
||||||
|
#include <osgGA/FlightManipulator>
|
||||||
|
#include <osgGA/KeySwitchMatrixManipulator>
|
||||||
|
#include <osgGA/TerrainManipulator>
|
||||||
|
#include <osgGA/TrackballManipulator>
|
||||||
|
|
||||||
|
#include <osgTerrain/Terrain>
|
||||||
|
#include <osgTerrain/GeometryTechnique>
|
||||||
|
|
||||||
|
#include <osgViewer/Viewer>
|
||||||
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
|
#include <osgViewer/Renderer>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
/** Helper class*/
|
||||||
|
template<class T>
|
||||||
|
class FindTopMostNodeOfTypeVisitor : public osg::NodeVisitor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FindTopMostNodeOfTypeVisitor():
|
||||||
|
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
|
||||||
|
_foundNode(0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void apply(osg::Node& node)
|
||||||
|
{
|
||||||
|
T* result = dynamic_cast<T*>(&node);
|
||||||
|
if (result)
|
||||||
|
_foundNode = result;
|
||||||
|
else
|
||||||
|
traverse(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
T* _foundNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Convenience function*/
|
||||||
|
template<class T>
|
||||||
|
T* findTopMostNodeOfType(osg::Node* node)
|
||||||
|
{
|
||||||
|
if (!node) return 0;
|
||||||
|
|
||||||
|
FindTopMostNodeOfTypeVisitor<T> fnotv;
|
||||||
|
node->accept(fnotv);
|
||||||
|
|
||||||
|
return fnotv._foundNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Capture the frame buffer and write image to disk*/
|
||||||
|
class WindowCaptureCallback : public osg::Camera::DrawCallback
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
WindowCaptureCallback(GLenum readBuffer, const std::string& name):
|
||||||
|
_readBuffer(readBuffer),
|
||||||
|
_fileName(name)
|
||||||
|
{
|
||||||
|
_image = new osg::Image;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void operator () (osg::RenderInfo& renderInfo) const
|
||||||
|
{
|
||||||
|
glReadBuffer(_readBuffer);
|
||||||
|
|
||||||
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||||
|
osg::GraphicsContext* gc = renderInfo.getState()->getGraphicsContext();
|
||||||
|
if (gc->getTraits())
|
||||||
|
{
|
||||||
|
GLenum pixelFormat;
|
||||||
|
|
||||||
|
if (gc->getTraits()->alpha)
|
||||||
|
pixelFormat = GL_RGBA;
|
||||||
|
else
|
||||||
|
pixelFormat = GL_RGB;
|
||||||
|
|
||||||
|
int width = gc->getTraits()->width;
|
||||||
|
int height = gc->getTraits()->height;
|
||||||
|
|
||||||
|
std::cout<<"Capture: size="<<width<<"x"<<height<<", format="<<(pixelFormat == GL_RGBA ? "GL_RGBA":"GL_RGB")<<std::endl;
|
||||||
|
|
||||||
|
_image->readPixels(0, 0, width, height, pixelFormat, GL_UNSIGNED_BYTE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_fileName.empty())
|
||||||
|
{
|
||||||
|
std::cout << "Writing to: " << _fileName << std::endl;
|
||||||
|
osgDB::writeImageFile(*_image, _fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
GLenum _readBuffer;
|
||||||
|
std::string _fileName;
|
||||||
|
osg::ref_ptr<osg::Image> _image;
|
||||||
|
mutable OpenThreads::Mutex _mutex;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/** Do Culling only while loading PagedLODs*/
|
||||||
|
class CustomRenderer : public osgViewer::Renderer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CustomRenderer(osg::Camera* camera)
|
||||||
|
: osgViewer::Renderer(camera),
|
||||||
|
_cullOnly(true)
|
||||||
|
{
|
||||||
|
setTargetFrameRate(1);
|
||||||
|
setMinimumTimeAvailableForGLCompileAndDeletePerFrame(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set flag to omit drawing in renderingTraversals */
|
||||||
|
void setCullOnly(bool on) { _cullOnly = on; }
|
||||||
|
|
||||||
|
virtual void operator () (osg::GraphicsContext* /*context*/)
|
||||||
|
{
|
||||||
|
if (_graphicsThreadDoesCull)
|
||||||
|
{
|
||||||
|
if (_cullOnly)
|
||||||
|
cull();
|
||||||
|
else
|
||||||
|
cull_draw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void cull()
|
||||||
|
{
|
||||||
|
osgUtil::SceneView* sceneView = _sceneView[0].get();
|
||||||
|
if (!sceneView || _done ) return;
|
||||||
|
|
||||||
|
updateSceneView(sceneView);
|
||||||
|
|
||||||
|
osgViewer::View* view = dynamic_cast<osgViewer::View*>(_camera->getView());
|
||||||
|
if (view) sceneView->setFusionDistance(view->getFusionDistanceMode(), view->getFusionDistanceValue());
|
||||||
|
|
||||||
|
sceneView->inheritCullSettings(*(sceneView->getCamera()));
|
||||||
|
sceneView->cull();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _cullOnly;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//===============================================================
|
||||||
|
// MAIN
|
||||||
|
//
|
||||||
|
int main( int argc, char **argv )
|
||||||
|
{
|
||||||
|
osg::ArgumentParser arguments(&argc, argv);
|
||||||
|
osg::ApplicationUsage* usage = arguments.getApplicationUsage();
|
||||||
|
|
||||||
|
usage->setApplicationName(arguments.getApplicationName());
|
||||||
|
usage->setDescription(arguments.getApplicationName()+" loads a model, sets a camera position and automatically captures screenshot to disk");
|
||||||
|
usage->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||||
|
usage->addCommandLineOption("--camera <lat> <lon> <alt> <heading> <incline> <roll>", "Specify camera position for image capture. Angles are specified in degrees and altitude in meters above sealevel (e.g. --camera 55 10 300000 0 30 0)");
|
||||||
|
usage->addCommandLineOption("--filename", "Filename for the captured image", "autocapture.jpg");
|
||||||
|
usage->addCommandLineOption("--db-threads", "Number of DatabasePager threads to use", "2");
|
||||||
|
usage->addCommandLineOption("--active", "Use active rendering instead of passive / lazy rendering");
|
||||||
|
|
||||||
|
// Construct the viewer and register options arguments.
|
||||||
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
|
||||||
|
if (arguments.argc()<=1)
|
||||||
|
{
|
||||||
|
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get user specified number of DatabaseThreads
|
||||||
|
int dbThreads = 2;
|
||||||
|
arguments.read("--db-threads", dbThreads);
|
||||||
|
if (dbThreads < 1) dbThreads = 1;
|
||||||
|
|
||||||
|
osg::DisplaySettings::instance()->setNumOfDatabaseThreadsHint(dbThreads);
|
||||||
|
|
||||||
|
// Get user specified file name
|
||||||
|
std::string fileName("autocapture.jpg");
|
||||||
|
arguments.read("--filename", fileName);
|
||||||
|
|
||||||
|
// Rendering mode is passive by default
|
||||||
|
bool activeMode = false;
|
||||||
|
if (arguments.read("--active"))
|
||||||
|
activeMode = true;
|
||||||
|
|
||||||
|
// Read camera settings for screenshot
|
||||||
|
double lat=50;
|
||||||
|
double lon=10;
|
||||||
|
double alt=2000;
|
||||||
|
double heading=0;
|
||||||
|
double incline=45;
|
||||||
|
double roll=0;
|
||||||
|
bool camera_specified=false;
|
||||||
|
if (arguments.read("--camera", lat, lon, alt, heading, incline, roll))
|
||||||
|
{
|
||||||
|
camera_specified=true;
|
||||||
|
lat = osg::DegreesToRadians(lat);
|
||||||
|
lon = osg::DegreesToRadians(lon);
|
||||||
|
heading = osg::DegreesToRadians(heading);
|
||||||
|
incline = osg::DegreesToRadians(incline);
|
||||||
|
roll = osg::DegreesToRadians(roll);
|
||||||
|
}
|
||||||
|
|
||||||
|
// load the data
|
||||||
|
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
|
||||||
|
if (!loadedModel)
|
||||||
|
{
|
||||||
|
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// any option left unread are converted into errors to write out later.
|
||||||
|
arguments.reportRemainingOptionsAsUnrecognized();
|
||||||
|
|
||||||
|
// report any errors if they have occurred when parsing the program arguments.
|
||||||
|
if (arguments.errors())
|
||||||
|
{
|
||||||
|
arguments.writeErrorMessages(std::cout);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup specified camera
|
||||||
|
if (camera_specified)
|
||||||
|
{
|
||||||
|
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(loadedModel.get());
|
||||||
|
if(!csn) return 1;
|
||||||
|
|
||||||
|
// Compute eye point in world coordiantes
|
||||||
|
osg::Vec3d eye;
|
||||||
|
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(lat, lon, alt, eye.x(), eye.y(), eye.z());
|
||||||
|
|
||||||
|
// Build matrix for computing target vector
|
||||||
|
osg::Matrixd target_matrix = osg::Matrixd::rotate(-heading, osg::Vec3d(1,0,0),
|
||||||
|
-lat, osg::Vec3d(0,1,0),
|
||||||
|
lon, osg::Vec3d(0,0,1));
|
||||||
|
|
||||||
|
// Compute tangent vector ...
|
||||||
|
osg::Vec3d tangent = target_matrix.preMult(osg::Vec3d(0, 0, 1));
|
||||||
|
|
||||||
|
// Compute non-inclined, non-rolled up vector ...
|
||||||
|
osg::Vec3d up(eye);
|
||||||
|
up.normalize();
|
||||||
|
|
||||||
|
// Incline by rotating the target- and up vector around the tangent/up-vector
|
||||||
|
// cross-product ...
|
||||||
|
osg::Vec3d up_cross_tangent = up ^ tangent;
|
||||||
|
osg::Matrixd incline_matrix = osg::Matrixd::rotate(incline, up_cross_tangent);
|
||||||
|
osg::Vec3d target = incline_matrix.preMult(tangent);
|
||||||
|
|
||||||
|
// Roll by rotating the up vector around the target vector ...
|
||||||
|
osg::Matrixd roll_matrix = incline_matrix * osg::Matrixd::rotate(roll, target);
|
||||||
|
up = roll_matrix.preMult(up);
|
||||||
|
|
||||||
|
viewer.getCamera()->setViewMatrixAsLookAt(eye, eye+target, up);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Only add camera manipulators if camera is not specified
|
||||||
|
camera_specified=false;
|
||||||
|
osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
|
||||||
|
|
||||||
|
keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() );
|
||||||
|
keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
|
||||||
|
keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
|
||||||
|
keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Optimize DatabasePager for auto-capture
|
||||||
|
osgDB::DatabasePager* pager = viewer.getDatabasePager();
|
||||||
|
pager->setDoPreCompile(false);
|
||||||
|
|
||||||
|
// Install custom renderer
|
||||||
|
osg::ref_ptr<CustomRenderer> customRenderer = new CustomRenderer(viewer.getCamera());
|
||||||
|
viewer.getCamera()->setRenderer(customRenderer.get());
|
||||||
|
|
||||||
|
// Override threading model
|
||||||
|
viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
|
||||||
|
|
||||||
|
// Set the final SceneData to show
|
||||||
|
viewer.setSceneData(loadedModel.get());
|
||||||
|
|
||||||
|
// Realize GUI
|
||||||
|
viewer.realize();
|
||||||
|
|
||||||
|
//--- Load PageLOD tiles ---
|
||||||
|
|
||||||
|
// Initiate the first PagedLOD request
|
||||||
|
viewer.frame();
|
||||||
|
|
||||||
|
osg::Timer_t beforeLoadTick = osg::Timer::instance()->tick();
|
||||||
|
|
||||||
|
// Keep updating and culling until full level of detail is reached
|
||||||
|
while(!viewer.done() && pager->getRequestsInProgress())
|
||||||
|
{
|
||||||
|
// std::cout <<pager->getRequestsInProgress()<<" ";
|
||||||
|
viewer.updateTraversal();
|
||||||
|
viewer.renderingTraversals();
|
||||||
|
}
|
||||||
|
// std::cout<<std::endl;
|
||||||
|
|
||||||
|
osg::Timer_t afterLoadTick = osg::Timer::instance()->tick();
|
||||||
|
std::cout<<"Load and Compile time = "<<osg::Timer::instance()->delta_s(beforeLoadTick, afterLoadTick)<<" seconds"<<std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
//--- Capture the image!!! ---
|
||||||
|
if (!activeMode)
|
||||||
|
{
|
||||||
|
// Do cull and draw to render the scene correctly
|
||||||
|
customRenderer->setCullOnly(false);
|
||||||
|
|
||||||
|
// Add the WindowCaptureCallback now that we have full resolution
|
||||||
|
viewer.getCamera()->setFinalDrawCallback(new WindowCaptureCallback(GL_BACK, fileName));
|
||||||
|
|
||||||
|
osg::Timer_t beforeRenderTick = osg::Timer::instance()->tick();
|
||||||
|
|
||||||
|
// Do rendering with capture callback
|
||||||
|
viewer.renderingTraversals();
|
||||||
|
|
||||||
|
osg::Timer_t afterRenderTick = osg::Timer::instance()->tick();
|
||||||
|
std::cout<<"Rendring time = "<<osg::Timer::instance()->delta_s(beforeRenderTick, afterRenderTick) <<" seconds"<<std::endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return viewer.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
9
examples/osgbrowser/CMakeLists.txt
Normal file
9
examples/osgbrowser/CMakeLists.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
SET(TARGET_SRC
|
||||||
|
osgbrowser.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(TARGET_ADDED_LIBRARIES osgWidget)
|
||||||
|
|
||||||
|
#### end var setup ###
|
||||||
|
SETUP_EXAMPLE(osgbrowser)
|
||||||
|
|
||||||
41
examples/osgbrowser/osgbrowser.cpp
Normal file
41
examples/osgbrowser/osgbrowser.cpp
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#include <osgViewer/Viewer>
|
||||||
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
|
|
||||||
|
#include <osgWidget/Browser>
|
||||||
|
|
||||||
|
int main(int argc,char** argv)
|
||||||
|
{
|
||||||
|
osg::ArgumentParser arguments(&argc, argv);
|
||||||
|
|
||||||
|
osgWidget::BrowserManager::instance()->init(arguments[0]);
|
||||||
|
|
||||||
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
|
||||||
|
osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),
|
||||||
|
osg::Vec3(1.0f,0.0f,0.0f),
|
||||||
|
osg::Vec3(0.0f,0.0f,1.0f),
|
||||||
|
osg::Vec4(1.0f,1.0f,1.0f,1.0f),
|
||||||
|
osgWidget::GeometryHints::RESIZE_HEIGHT_TO_MAINTAINCE_ASPECT_RATIO);
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Group> group = new osg::Group;
|
||||||
|
|
||||||
|
for(int i=1; i<arguments.argc(); ++i)
|
||||||
|
{
|
||||||
|
if (!arguments.isOption(i))
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osgWidget::Browser> browser = new osgWidget::Browser;
|
||||||
|
if (browser->open(arguments[i], hints))
|
||||||
|
{
|
||||||
|
group->addChild(browser.get());
|
||||||
|
|
||||||
|
hints.position.x() += 1.1f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
viewer.setSceneData(group.get());
|
||||||
|
|
||||||
|
viewer.addEventHandler(new osgViewer::StatsHandler);
|
||||||
|
|
||||||
|
return viewer.run();
|
||||||
|
}
|
||||||
12
examples/osgcluster/CMakeLists.txt
Normal file
12
examples/osgcluster/CMakeLists.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
SET(TARGET_SRC
|
||||||
|
broadcaster.cpp
|
||||||
|
receiver.cpp
|
||||||
|
osgcluster.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (WIN32)
|
||||||
|
SET(TARGET_EXTERNAL_LIBRARIES ws2_32)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
|
#### end var setup ###
|
||||||
|
SETUP_EXAMPLE(osgcluster)
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
#if defined(__linux)
|
#if defined(__linux)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <linux/sockios.h>
|
#include <linux/sockios.h>
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#elif defined(__sgi)
|
#elif defined(__sgi)
|
||||||
@@ -164,7 +164,7 @@ void Broadcaster::setHost( const char *hostname )
|
|||||||
struct hostent *h;
|
struct hostent *h;
|
||||||
if( (h = gethostbyname( hostname )) == 0L )
|
if( (h = gethostbyname( hostname )) == 0L )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Broadcaster::setHost() - Cannot resolv an address for \"%s\".\n", hostname );
|
fprintf( stderr, "Broadcaster::setHost() - Cannot resolve an address for \"%s\".\n", hostname );
|
||||||
_address = 0;
|
_address = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -196,7 +196,7 @@ void Broadcaster::sync( void )
|
|||||||
unsigned int size = sizeof( SOCKADDR_IN );
|
unsigned int size = sizeof( SOCKADDR_IN );
|
||||||
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
||||||
int err = WSAGetLastError ();
|
int err = WSAGetLastError ();
|
||||||
int *dum = (int*) _buffer;
|
if (err!=0) fprintf( stderr, "Broadcaster::sync() - error %d\n",err );
|
||||||
#else
|
#else
|
||||||
unsigned int size = sizeof( struct sockaddr_in );
|
unsigned int size = sizeof( struct sockaddr_in );
|
||||||
sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ class DataConverter
|
|||||||
_swapBytes = !_swapBytes;
|
_swapBytes = !_swapBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
cameraPacket._masterKilled = readUInt();
|
cameraPacket._masterKilled = readUInt()!=0;
|
||||||
|
|
||||||
read(cameraPacket._matrix);
|
read(cameraPacket._matrix);
|
||||||
read(cameraPacket._frameStamp);
|
read(cameraPacket._frameStamp);
|
||||||
@@ -413,7 +413,7 @@ void CameraPacket::readEventQueue(osgViewer::Viewer& viewer)
|
|||||||
|
|
||||||
void CameraPacket::writeEventQueue(osgViewer::Viewer& viewer)
|
void CameraPacket::writeEventQueue(osgViewer::Viewer& viewer)
|
||||||
{
|
{
|
||||||
osg::notify(osg::INFO)<<"recieved events = "<<_events.size()<<std::endl;
|
osg::notify(osg::INFO)<<"received events = "<<_events.size()<<std::endl;
|
||||||
|
|
||||||
viewer.getEventQueue()->appendEvents(_events);
|
viewer.getEventQueue()->appendEvents(_events);
|
||||||
}
|
}
|
||||||
@@ -437,7 +437,7 @@ int main( int argc, char **argv )
|
|||||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-m","Set viewer to MASTER mode, sending view via packets.");
|
arguments.getApplicationUsage()->addCommandLineOption("-m","Set viewer to MASTER mode, sending view via packets.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-s","Set viewer to SLAVE mode, reciving view via packets.");
|
arguments.getApplicationUsage()->addCommandLineOption("-s","Set viewer to SLAVE mode, receiving view via packets.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-n <int>","Socket number to transmit packets");
|
arguments.getApplicationUsage()->addCommandLineOption("-n <int>","Socket number to transmit packets");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-f <float>","Field of view of camera");
|
arguments.getApplicationUsage()->addCommandLineOption("-f <float>","Field of view of camera");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-o <float>","Offset angle of camera");
|
arguments.getApplicationUsage()->addCommandLineOption("-o <float>","Offset angle of camera");
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ void Receiver::sync( void )
|
|||||||
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
|
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
|
||||||
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
|
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
|
||||||
int err = WSAGetLastError ();
|
int err = WSAGetLastError ();
|
||||||
int *dum = (int*) _buffer;
|
if (err!=0) fprintf( stderr, "Receiver::sync() - error %d\n",err );
|
||||||
|
|
||||||
while( select( _so+1, &fdset, 0L, 0L, &tv ) )
|
while( select( _so+1, &fdset, 0L, 0L, &tv ) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include <osgUtil/Optimizer>
|
#include <osgUtil/Optimizer>
|
||||||
#include <osgDB/ReadFile>
|
#include <osgDB/ReadFile>
|
||||||
|
|
||||||
@@ -44,19 +46,19 @@
|
|||||||
|
|
||||||
// class to handle events with a pick
|
// class to handle events with a pick
|
||||||
class PickHandler : public osgGA::GUIEventHandler {
|
class PickHandler : public osgGA::GUIEventHandler {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
PickHandler():
|
PickHandler():
|
||||||
_mx(0.0f),
|
_mx(0.0f),
|
||||||
_my(0.0f) {}
|
_my(0.0f) {}
|
||||||
|
|
||||||
~PickHandler() {}
|
~PickHandler() {}
|
||||||
|
|
||||||
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
|
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
|
||||||
{
|
{
|
||||||
osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
|
osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
|
||||||
if (!view) return false;
|
if (!view) return false;
|
||||||
|
|
||||||
switch(ea.getEventType())
|
switch(ea.getEventType())
|
||||||
{
|
{
|
||||||
case(osgGA::GUIEventAdapter::PUSH):
|
case(osgGA::GUIEventAdapter::PUSH):
|
||||||
@@ -78,7 +80,7 @@ public:
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pick(osgViewer::View* view, float x, float y)
|
void pick(osgViewer::View* view, float x, float y)
|
||||||
{
|
{
|
||||||
osg::Node* node = 0;
|
osg::Node* node = 0;
|
||||||
@@ -91,7 +93,7 @@ public:
|
|||||||
osg::NodePath& nodePath = intersection.nodePath;
|
osg::NodePath& nodePath = intersection.nodePath;
|
||||||
node = (nodePath.size()>=1)?nodePath[nodePath.size()-1]:0;
|
node = (nodePath.size()>=1)?nodePath[nodePath.size()-1]:0;
|
||||||
parent = (nodePath.size()>=2)?dynamic_cast<osg::Group*>(nodePath[nodePath.size()-2]):0;
|
parent = (nodePath.size()>=2)?dynamic_cast<osg::Group*>(nodePath[nodePath.size()-2]):0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// now we try to decorate the hit node by the osgFX::Scribe to show that its been "picked"
|
// now we try to decorate the hit node by the osgFX::Scribe to show that its been "picked"
|
||||||
if (parent && node)
|
if (parent && node)
|
||||||
@@ -119,7 +121,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float _mx, _my;
|
float _mx, _my;
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -130,26 +132,28 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
// use an ArgumentParser object to manage the program arguments.
|
// use an ArgumentParser object to manage the program arguments.
|
||||||
osg::ArgumentParser arguments(&argc,argv);
|
osg::ArgumentParser arguments(&argc,argv);
|
||||||
|
|
||||||
// read the scene from the list of file specified commandline args.
|
// read the scene from the list of file specified commandline args.
|
||||||
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments);
|
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments);
|
||||||
|
|
||||||
if (!scene) return 1;
|
if (!scene)
|
||||||
|
{
|
||||||
|
std::cout << argv[0] << ": requires filename argument." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
// construct the viewer.
|
// construct the viewer.
|
||||||
osgViewer::CompositeViewer viewer(arguments);
|
osgViewer::CompositeViewer viewer(arguments);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (arguments.read("-1"))
|
if (arguments.read("-1"))
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
osgViewer::View* view = new osgViewer::View;
|
osgViewer::View* view = new osgViewer::View;
|
||||||
|
view->setName("Single view");
|
||||||
view->setSceneData(osgDB::readNodeFile("fountain.osg"));
|
view->setSceneData(osgDB::readNodeFile("fountain.osg"));
|
||||||
|
|
||||||
view->addEventHandler( new osgViewer::StatsHandler );
|
view->addEventHandler( new osgViewer::StatsHandler );
|
||||||
|
|
||||||
view->setUpViewAcrossAllScreens();
|
view->setUpViewAcrossAllScreens();
|
||||||
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||||
viewer.addView(view);
|
viewer.addView(view);
|
||||||
@@ -162,6 +166,7 @@ int main( int argc, char **argv )
|
|||||||
// view one
|
// view one
|
||||||
{
|
{
|
||||||
osgViewer::View* view = new osgViewer::View;
|
osgViewer::View* view = new osgViewer::View;
|
||||||
|
view->setName("View one");
|
||||||
viewer.addView(view);
|
viewer.addView(view);
|
||||||
|
|
||||||
view->setUpViewOnSingleScreen(0);
|
view->setUpViewOnSingleScreen(0);
|
||||||
@@ -174,30 +179,31 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
view->addEventHandler( statesetManipulator.get() );
|
view->addEventHandler( statesetManipulator.get() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// view two
|
// view two
|
||||||
{
|
{
|
||||||
osgViewer::View* view = new osgViewer::View;
|
osgViewer::View* view = new osgViewer::View;
|
||||||
|
view->setName("View two");
|
||||||
viewer.addView(view);
|
viewer.addView(view);
|
||||||
|
|
||||||
view->setUpViewOnSingleScreen(1);
|
view->setUpViewOnSingleScreen(1);
|
||||||
view->setSceneData(scene.get());
|
view->setSceneData(scene.get());
|
||||||
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||||
|
|
||||||
view->addEventHandler( new osgViewer::StatsHandler );
|
view->addEventHandler( new osgViewer::StatsHandler );
|
||||||
|
|
||||||
|
|
||||||
// add the handler for doing the picking
|
// add the handler for doing the picking
|
||||||
view->addEventHandler(new PickHandler());
|
view->addEventHandler(new PickHandler());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (arguments.read("-3") || viewer.getNumViews()==0)
|
if (arguments.read("-3") || viewer.getNumViews()==0)
|
||||||
{
|
{
|
||||||
|
|
||||||
osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
|
osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
|
||||||
if (!wsi)
|
if (!wsi)
|
||||||
{
|
{
|
||||||
osg::notify(osg::NOTICE)<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
osg::notify(osg::NOTICE)<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
@@ -233,9 +239,11 @@ int main( int argc, char **argv )
|
|||||||
// view one
|
// view one
|
||||||
{
|
{
|
||||||
osgViewer::View* view = new osgViewer::View;
|
osgViewer::View* view = new osgViewer::View;
|
||||||
|
view->setName("View one");
|
||||||
viewer.addView(view);
|
viewer.addView(view);
|
||||||
|
|
||||||
view->setSceneData(scene.get());
|
view->setSceneData(scene.get());
|
||||||
|
view->getCamera()->setName("Cam one");
|
||||||
view->getCamera()->setViewport(new osg::Viewport(0,0, traits->width/2, traits->height/2));
|
view->getCamera()->setViewport(new osg::Viewport(0,0, traits->width/2, traits->height/2));
|
||||||
view->getCamera()->setGraphicsContext(gc.get());
|
view->getCamera()->setGraphicsContext(gc.get());
|
||||||
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||||
@@ -245,7 +253,7 @@ int main( int argc, char **argv )
|
|||||||
statesetManipulator->setStateSet(view->getCamera()->getOrCreateStateSet());
|
statesetManipulator->setStateSet(view->getCamera()->getOrCreateStateSet());
|
||||||
|
|
||||||
view->addEventHandler( statesetManipulator.get() );
|
view->addEventHandler( statesetManipulator.get() );
|
||||||
|
|
||||||
view->addEventHandler( new osgViewer::StatsHandler );
|
view->addEventHandler( new osgViewer::StatsHandler );
|
||||||
view->addEventHandler( new osgViewer::HelpHandler );
|
view->addEventHandler( new osgViewer::HelpHandler );
|
||||||
view->addEventHandler( new osgViewer::WindowSizeHandler );
|
view->addEventHandler( new osgViewer::WindowSizeHandler );
|
||||||
@@ -256,25 +264,29 @@ int main( int argc, char **argv )
|
|||||||
// view two
|
// view two
|
||||||
{
|
{
|
||||||
osgViewer::View* view = new osgViewer::View;
|
osgViewer::View* view = new osgViewer::View;
|
||||||
|
view->setName("View two");
|
||||||
viewer.addView(view);
|
viewer.addView(view);
|
||||||
|
|
||||||
view->setSceneData(scene.get());
|
view->setSceneData(scene.get());
|
||||||
|
view->getCamera()->setName("Cam two");
|
||||||
view->getCamera()->setViewport(new osg::Viewport(traits->width/2,0, traits->width/2, traits->height/2));
|
view->getCamera()->setViewport(new osg::Viewport(traits->width/2,0, traits->width/2, traits->height/2));
|
||||||
view->getCamera()->setGraphicsContext(gc.get());
|
view->getCamera()->setGraphicsContext(gc.get());
|
||||||
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
view->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||||
|
|
||||||
// add the handler for doing the picking
|
// add the handler for doing the picking
|
||||||
view->addEventHandler(new PickHandler());
|
view->addEventHandler(new PickHandler());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// view three
|
// view three
|
||||||
{
|
{
|
||||||
osgViewer::View* view = new osgViewer::View;
|
osgViewer::View* view = new osgViewer::View;
|
||||||
|
view->setName("View three");
|
||||||
viewer.addView(view);
|
viewer.addView(view);
|
||||||
|
|
||||||
view->setSceneData(osgDB::readNodeFile("cessnafire.osg"));
|
view->setSceneData(osgDB::readNodeFile("cessnafire.osg"));
|
||||||
|
|
||||||
|
view->getCamera()->setName("Cam three");
|
||||||
view->getCamera()->setProjectionMatrixAsPerspective(30.0, double(traits->width) / double(traits->height/2), 1.0, 1000.0);
|
view->getCamera()->setProjectionMatrixAsPerspective(30.0, double(traits->width) / double(traits->height/2), 1.0, 1000.0);
|
||||||
view->getCamera()->setViewport(new osg::Viewport(0, traits->height/2, traits->width, traits->height/2));
|
view->getCamera()->setViewport(new osg::Viewport(0, traits->height/2, traits->width, traits->height/2));
|
||||||
view->getCamera()->setGraphicsContext(gc.get());
|
view->getCamera()->setGraphicsContext(gc.get());
|
||||||
@@ -283,11 +295,12 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while (arguments.read("-s")) { viewer.setThreadingModel(osgViewer::CompositeViewer::SingleThreaded); }
|
while (arguments.read("-s")) { viewer.setThreadingModel(osgViewer::CompositeViewer::SingleThreaded); }
|
||||||
while (arguments.read("-g")) { viewer.setThreadingModel(osgViewer::CompositeViewer::CullDrawThreadPerContext); }
|
while (arguments.read("-g")) { viewer.setThreadingModel(osgViewer::CompositeViewer::CullDrawThreadPerContext); }
|
||||||
while (arguments.read("-c")) { viewer.setThreadingModel(osgViewer::CompositeViewer::CullThreadPerCameraDrawThreadPerContext); }
|
while (arguments.read("-c")) { viewer.setThreadingModel(osgViewer::CompositeViewer::CullThreadPerCameraDrawThreadPerContext); }
|
||||||
|
|
||||||
// run the viewer's main frame loop
|
// run the viewer's main frame loop
|
||||||
return viewer.run();
|
return viewer.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,18 +9,18 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <osg/Geometry>
|
#include <osg/Geometry>
|
||||||
#include <osg/Geode>
|
#include <osg/Geode>
|
||||||
#include <osgDB/FileUtils>
|
#include <osgDB/FileUtils>
|
||||||
|
#include <osgDB/fstream>
|
||||||
|
|
||||||
bool Utility::readFile(const char* fName, std::string& s)
|
bool Utility::readFile(const char* fName, std::string& s)
|
||||||
{
|
{
|
||||||
std::string foundFile = osgDB::findDataFile(fName);
|
std::string foundFile = osgDB::findDataFile(fName);
|
||||||
if (foundFile.empty()) return false;
|
if (foundFile.empty()) return false;
|
||||||
|
|
||||||
std::ifstream is;//(fName);
|
osgDB::ifstream is;//(fName);
|
||||||
is.open(foundFile.c_str());
|
is.open(foundFile.c_str());
|
||||||
if (is.fail())
|
if (is.fail())
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,7 @@ double Utility::getNoise(unsigned x, unsigned y, unsigned random)
|
|||||||
int n = x + y * 57 + random * 131;
|
int n = x + y * 57 + random * 131;
|
||||||
n = (n<<13) ^ n;
|
n = (n<<13) ^ n;
|
||||||
double noise = (1.0f - ( (n * (n * n * 15731 + 789221) +
|
double noise = (1.0f - ( (n * (n * n * 15731 + 789221) +
|
||||||
1376312589)&0x7fffffff)* 0.000000000931322574615478515625f);
|
1376312589)&0x7fffffff)* 0.000000000931322574615478515625f);
|
||||||
return noise;
|
return noise;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,13 +86,13 @@ double Utility::smoothNoise(unsigned width, unsigned height, unsigned x, unsigne
|
|||||||
return noise[x + y*width];
|
return noise[x + y*width];
|
||||||
|
|
||||||
double corners = (noise[x-1 + (y-1) *width]
|
double corners = (noise[x-1 + (y-1) *width]
|
||||||
+noise[x+1 + (y-1)*width]
|
+noise[x+1 + (y-1)*width]
|
||||||
+noise[x-1 + (y+1) * width]
|
+noise[x-1 + (y+1) * width]
|
||||||
+noise[x+1 + (y+1) * width]) / 16.0;
|
+noise[x+1 + (y+1) * width]) / 16.0;
|
||||||
double sides = (noise[x-1 + y*width]
|
double sides = (noise[x-1 + y*width]
|
||||||
+noise[x+1 + y*width]
|
+noise[x+1 + y*width]
|
||||||
+noise[x + (y-1)*width]
|
+noise[x + (y-1)*width]
|
||||||
+noise[x + (y+1)*width]) / 8.0;
|
+noise[x + (y+1)*width]) / 8.0;
|
||||||
double center = noise[x + y*width] / 4.0;
|
double center = noise[x + y*width] / 4.0;
|
||||||
|
|
||||||
return corners + sides + center;
|
return corners + sides + center;
|
||||||
|
|||||||
@@ -174,27 +174,12 @@ public:
|
|||||||
private:
|
private:
|
||||||
void rotate(float x, float y)
|
void rotate(float x, float y)
|
||||||
{
|
{
|
||||||
osg::Matrixd baseMatrix = _modelGroupTransform->getMatrix();
|
osg::Matrix baseMatrix = _modelGroupTransform->getMatrix();
|
||||||
|
|
||||||
osg::Matrixd preTransMatrix;
|
baseMatrix.preMultTranslate(_rotCenter);
|
||||||
osg::Matrixd postTransMatrix;
|
baseMatrix.preMultRotate(osg::Quat((x - _prevX) * 3, osg::Vec3d(0.0, 0.0, 1.0)));
|
||||||
osg::Matrixd rotMatrixX;
|
baseMatrix.preMultRotate(osg::Quat(-(y - _prevY) * 3, (baseMatrix * osg::Vec3d(1.0, 0.0, 0.0))));
|
||||||
osg::Matrixd rotMatrixZ;
|
baseMatrix.preMultTranslate(-_rotCenter);
|
||||||
|
|
||||||
preTransMatrix.makeTranslate(_rotCenter);
|
|
||||||
postTransMatrix.makeTranslate(-_rotCenter);
|
|
||||||
|
|
||||||
rotMatrixZ.makeRotate((x - _prevX) * 3., osg::Vec3d(0.0, 0.0,1.0));
|
|
||||||
|
|
||||||
baseMatrix.preMult(preTransMatrix);
|
|
||||||
baseMatrix.preMult(rotMatrixZ);
|
|
||||||
baseMatrix.preMult(postTransMatrix);
|
|
||||||
|
|
||||||
rotMatrixX.makeRotate(-(y - _prevY) * 3., (baseMatrix * osg::Vec3d(1.0, 0.0,0.0)));
|
|
||||||
|
|
||||||
baseMatrix.preMult(preTransMatrix);
|
|
||||||
baseMatrix.preMult(rotMatrixX);
|
|
||||||
baseMatrix.preMult(postTransMatrix);
|
|
||||||
|
|
||||||
_modelGroupTransform->setMatrix(baseMatrix);
|
_modelGroupTransform->setMatrix(baseMatrix);
|
||||||
|
|
||||||
|
|||||||
4
examples/osgdrawinstanced/CMakeLists.txt
Normal file
4
examples/osgdrawinstanced/CMakeLists.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
SET(TARGET_SRC osgdrawinstanced.cpp )
|
||||||
|
|
||||||
|
#### end var setup ###
|
||||||
|
SETUP_EXAMPLE(osgdrawinstanced)
|
||||||
150
examples/osgdrawinstanced/osgdrawinstanced.cpp
Normal file
150
examples/osgdrawinstanced/osgdrawinstanced.cpp
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
/* OpenSceneGraph example, osgdrawinstanced.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
//
|
||||||
|
// This code is copyright (c) 2008 Skew Matrix Software LLC. You may use
|
||||||
|
// the code under the licensing terms described above.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <osgDB/ReadFile>
|
||||||
|
#include <osgViewer/Viewer>
|
||||||
|
#include <osg/Geometry>
|
||||||
|
#include <osg/Texture2D>
|
||||||
|
|
||||||
|
#include <osgDB/WriteFile>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
void
|
||||||
|
createDAIGeometry( osg::Geometry& geom, int nInstances=1 )
|
||||||
|
{
|
||||||
|
const float halfDimX( .5 );
|
||||||
|
const float halfDimZ( .5 );
|
||||||
|
|
||||||
|
osg::Vec3Array* v = new osg::Vec3Array;
|
||||||
|
v->resize( 4 );
|
||||||
|
geom.setVertexArray( v );
|
||||||
|
|
||||||
|
// Geometry for a single quad.
|
||||||
|
(*v)[ 0 ] = osg::Vec3( -halfDimX, 0., -halfDimZ );
|
||||||
|
(*v)[ 1 ] = osg::Vec3( halfDimX, 0., -halfDimZ );
|
||||||
|
(*v)[ 2 ] = osg::Vec3( halfDimX, 0., halfDimZ );
|
||||||
|
(*v)[ 3 ] = osg::Vec3( -halfDimX, 0., halfDimZ );
|
||||||
|
|
||||||
|
// Use the DrawArraysInstanced PrimitiveSet and tell it to draw 1024 instances.
|
||||||
|
geom.addPrimitiveSet( new osg::DrawArrays( GL_QUADS, 0, 4, nInstances ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
osg::StateSet*
|
||||||
|
createStateSet()
|
||||||
|
{
|
||||||
|
osg::ref_ptr< osg::StateSet > ss = new osg::StateSet;
|
||||||
|
|
||||||
|
// Create a vertex program that references the gl_InstanceID to
|
||||||
|
// render each instance uniquely. gl_InstanceID will be in the range
|
||||||
|
// 0 to numInstances-1 (1023 in our case).
|
||||||
|
std::string vertexSource =
|
||||||
|
"uniform sampler2D osgLogo; \n"
|
||||||
|
"uniform float osg_SimulationTime; \n"
|
||||||
|
|
||||||
|
"void main() \n"
|
||||||
|
"{ \n"
|
||||||
|
// Using the instance ID, generate "texture coords" for this instance.
|
||||||
|
"vec2 tC; \n"
|
||||||
|
"const float r = gl_InstanceID / 32.; \n"
|
||||||
|
"tC.s = fract( r ); tC.t = floor( r ) / 32.; \n"
|
||||||
|
// Get the color from the OSG logo.
|
||||||
|
"gl_FrontColor = texture2D( osgLogo, tC ); \n"
|
||||||
|
|
||||||
|
// Use the (scaled) tex coord to translate the position of the vertices.
|
||||||
|
"vec4 pos = vec4( tC.s * 48., 0., tC.t * 48., 1. ); \n"
|
||||||
|
|
||||||
|
// Compute a rotation angle from the instanceID and elapsed time.
|
||||||
|
"float timeOffset = gl_InstanceID / (32. * 32.); \n"
|
||||||
|
"float angle = ( osg_SimulationTime - timeOffset ) * 6.283; \n"
|
||||||
|
"float sa = sin( angle ); \n"
|
||||||
|
"float ca = cos( angle ); \n"
|
||||||
|
// New orientation, rotate around z axis.
|
||||||
|
"vec4 newX = vec4( ca, sa, 0., 0. ); \n"
|
||||||
|
"vec4 newY = vec4( sa, ca, 0., 0. ); \n"
|
||||||
|
"vec4 newZ = vec4( 0., 0., 1., 0. ); \n"
|
||||||
|
"mat4 mV = mat4( newX, newY, newZ, pos ); \n"
|
||||||
|
"gl_Position = ( gl_ModelViewProjectionMatrix * mV * gl_Vertex ); \n"
|
||||||
|
"} \n";
|
||||||
|
|
||||||
|
osg::ref_ptr< osg::Shader > vertexShader = new osg::Shader();
|
||||||
|
vertexShader->setType( osg::Shader::VERTEX );
|
||||||
|
vertexShader->setShaderSource( vertexSource );
|
||||||
|
|
||||||
|
osg::ref_ptr< osg::Program > program = new osg::Program();
|
||||||
|
program->addShader( vertexShader.get() );
|
||||||
|
|
||||||
|
ss->setAttribute( program.get(),
|
||||||
|
osg::StateAttribute::ON | osg::StateAttribute::PROTECTED );
|
||||||
|
|
||||||
|
osg::ref_ptr< osg::Image> iLogo = osgDB::readImageFile( "Images/osg128.png" );
|
||||||
|
if( !iLogo.valid() )
|
||||||
|
{
|
||||||
|
osg::notify( osg::ALWAYS ) << "Can't open image file osg128.png" << std::endl;
|
||||||
|
return( NULL );
|
||||||
|
}
|
||||||
|
osg::Texture2D* texLogo = new osg::Texture2D( iLogo.get() );
|
||||||
|
texLogo->setFilter( osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR );
|
||||||
|
texLogo->setFilter( osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR );
|
||||||
|
|
||||||
|
ss->setTextureAttribute( 0, texLogo );
|
||||||
|
|
||||||
|
osg::ref_ptr< osg::Uniform > texLogoUniform =
|
||||||
|
new osg::Uniform( "osgLogo", 0 );
|
||||||
|
ss->addUniform( texLogoUniform.get() );
|
||||||
|
|
||||||
|
return( ss.release() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main( int argc, char **argv )
|
||||||
|
{
|
||||||
|
osg::ArgumentParser arguments(&argc, argv);
|
||||||
|
|
||||||
|
// Make a scene graph consisting of a single Geode, containing
|
||||||
|
// a single Geometry, and a single PrimitiveSet.
|
||||||
|
osg::ref_ptr< osg::Geode > geode = new osg::Geode;
|
||||||
|
|
||||||
|
osg::ref_ptr< osg::Geometry > geom = new osg::Geometry;
|
||||||
|
// Configure the Geometry for use with EXT_draw_arrays:
|
||||||
|
// DL off and buffer objects on.
|
||||||
|
geom->setUseDisplayList( false );
|
||||||
|
geom->setUseVertexBufferObjects( true );
|
||||||
|
// OSG has no clue where out vertex shader will place the geometric data,
|
||||||
|
// so specify an initial bound to allow proper culling and near/far computation.
|
||||||
|
osg::BoundingBox bb( -1., -.1, -1., 49., 1., 49. );
|
||||||
|
geom->setInitialBound( bb );
|
||||||
|
// Add geometric data and the PrimitiveSet. Specify numInstances as 32*32 or 1024.
|
||||||
|
createDAIGeometry( *geom, 32*32 );
|
||||||
|
geode->addDrawable( geom.get() );
|
||||||
|
|
||||||
|
// Create a StateSet to render the instanced Geometry.
|
||||||
|
osg::ref_ptr< osg::StateSet > ss = createStateSet();
|
||||||
|
geode->setStateSet( ss.get() );
|
||||||
|
|
||||||
|
// osgDB::writeNodeFile(*geode, "instanced.osg");
|
||||||
|
|
||||||
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
viewer.setSceneData( geode.get() );
|
||||||
|
return viewer.run();
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ void textInfo(osgText::Text* text)
|
|||||||
const osgText::Text::TextureGlyphQuadMap& tgqm = text->getTextureGlyphQuadMap();
|
const osgText::Text::TextureGlyphQuadMap& tgqm = text->getTextureGlyphQuadMap();
|
||||||
|
|
||||||
const osgText::Text::TextureGlyphQuadMap::const_iterator tgqmi = tgqm.begin();
|
const osgText::Text::TextureGlyphQuadMap::const_iterator tgqmi = tgqm.begin();
|
||||||
|
|
||||||
const osgText::Text::GlyphQuads& gq = tgqmi->second;
|
const osgText::Text::GlyphQuads& gq = tgqmi->second;
|
||||||
|
|
||||||
osgText::String& s = text->getText();
|
osgText::String& s = text->getText();
|
||||||
@@ -59,7 +59,7 @@ osg::Camera* createOrthoCamera(double width, double height)
|
|||||||
camera->setViewMatrix(osg::Matrix::identity());
|
camera->setViewMatrix(osg::Matrix::identity());
|
||||||
camera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
camera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
||||||
camera->setRenderOrder(osg::Camera::POST_RENDER);
|
camera->setRenderOrder(osg::Camera::POST_RENDER);
|
||||||
|
|
||||||
return camera;
|
return camera;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ int main(int argc, char** argv)
|
|||||||
// Make sure we have the minimum args...
|
// Make sure we have the minimum args...
|
||||||
if(argc <= 2)
|
if(argc <= 2)
|
||||||
{
|
{
|
||||||
osg::notify(osg::FATAL) << "usage: " << args[0] << " FONTFILE [sizes...]" << std::endl;
|
osg::notify(osg::FATAL) << "usage: " << args[0] << " fontfile size1 [size2 ...]" << std::endl;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ int main(int argc, char** argv)
|
|||||||
viewer.addEventHandler(new osgViewer::WindowSizeHandler());
|
viewer.addEventHandler(new osgViewer::WindowSizeHandler());
|
||||||
|
|
||||||
osg::Group* group = new osg::Group();
|
osg::Group* group = new osg::Group();
|
||||||
osg::Camera* camera = createOrthoCamera(1280.0f, 1024.0f);
|
osg::Camera* camera = createOrthoCamera(1280.0f, 1024.0f);
|
||||||
|
|
||||||
// Create the list of desired sizes.
|
// Create the list of desired sizes.
|
||||||
Sizes sizes;
|
Sizes sizes;
|
||||||
@@ -138,3 +138,4 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
return viewer.run();
|
return viewer.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,12 +36,15 @@
|
|||||||
#include <osgDB/ReadFile>
|
#include <osgDB/ReadFile>
|
||||||
#include <osgDB/FileUtils>
|
#include <osgDB/FileUtils>
|
||||||
|
|
||||||
#include <osgUtil/IntersectVisitor>
|
#include <osgUtil/LineSegmentIntersector>
|
||||||
|
#include <osgUtil/IntersectionVisitor>
|
||||||
#include <osgUtil/SmoothingVisitor>
|
#include <osgUtil/SmoothingVisitor>
|
||||||
|
|
||||||
#include <osgText/Text>
|
#include <osgText/Text>
|
||||||
|
|
||||||
#include <osgViewer/Viewer>
|
#include <osgViewer/Viewer>
|
||||||
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
|
|
||||||
#include <osgGA/StateSetManipulator>
|
#include <osgGA/StateSetManipulator>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -508,22 +511,22 @@ void ForestTechniqueManager::createTreeList(osg::Node* terrain,const osg::Vec3&
|
|||||||
|
|
||||||
if (terrain)
|
if (terrain)
|
||||||
{
|
{
|
||||||
osgUtil::IntersectVisitor iv;
|
osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector =
|
||||||
osg::ref_ptr<osg::LineSegment> segDown = new osg::LineSegment;
|
new osgUtil::LineSegmentIntersector(tree->_position,tree->_position+osg::Vec3(0.0f,0.0f,size.z()));
|
||||||
|
|
||||||
segDown->set(tree->_position,tree->_position+osg::Vec3(0.0f,0.0f,size.z()));
|
osgUtil::IntersectionVisitor iv(intersector.get());
|
||||||
iv.addLineSegment(segDown.get());
|
|
||||||
|
|
||||||
terrain->accept(iv);
|
terrain->accept(iv);
|
||||||
|
|
||||||
if (iv.hits())
|
if (intersector->containsIntersections())
|
||||||
{
|
{
|
||||||
osgUtil::IntersectVisitor::HitList& hitList = iv.getHitList(segDown.get());
|
osgUtil::LineSegmentIntersector::Intersections& intersections = intersector->getIntersections();
|
||||||
if (!hitList.empty())
|
for(osgUtil::LineSegmentIntersector::Intersections::iterator itr = intersections.begin();
|
||||||
|
itr != intersections.end();
|
||||||
|
++itr)
|
||||||
{
|
{
|
||||||
osg::Vec3 ip = hitList.front().getWorldIntersectPoint();
|
const osgUtil::LineSegmentIntersector::Intersection& intersection = *itr;
|
||||||
osg::Vec3 np = hitList.front().getWorldIntersectNormal();
|
tree->_position = intersection.getWorldIntersectPoint();
|
||||||
tree->_position = ip;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1099,6 +1102,9 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
osg::ref_ptr<ForestTechniqueManager> ttm = new ForestTechniqueManager;
|
osg::ref_ptr<ForestTechniqueManager> ttm = new ForestTechniqueManager;
|
||||||
|
|
||||||
|
// add the stats handler
|
||||||
|
viewer.addEventHandler(new osgViewer::StatsHandler);
|
||||||
|
|
||||||
viewer.addEventHandler(new TechniqueEventHandler(ttm.get()));
|
viewer.addEventHandler(new TechniqueEventHandler(ttm.get()));
|
||||||
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
|
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
|
||||||
|
|
||||||
|
|||||||
11
examples/osggameoflife/CMakeLists.txt
Normal file
11
examples/osggameoflife/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
SET(TARGET_SRC
|
||||||
|
GameOfLifePass.cpp
|
||||||
|
osggameoflife.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(TARGET_H
|
||||||
|
GameOfLifePass.h
|
||||||
|
)
|
||||||
|
|
||||||
|
#### end var setup ###
|
||||||
|
SETUP_EXAMPLE(osggameoflife)
|
||||||
204
examples/osggameoflife/GameOfLifePass.cpp
Normal file
204
examples/osggameoflife/GameOfLifePass.cpp
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
/* OpenSceneGraph example, osggameoflife.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "GameOfLifePass.h"
|
||||||
|
#include <osgDB/FileUtils>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
ProcessPass::ProcessPass(osg::TextureRectangle *in_tex,
|
||||||
|
osg::TextureRectangle *out_tex,
|
||||||
|
int width, int height):
|
||||||
|
_TextureWidth(width),
|
||||||
|
_TextureHeight(height)
|
||||||
|
{
|
||||||
|
_RootGroup = new osg::Group;
|
||||||
|
|
||||||
|
_InTexture = in_tex;
|
||||||
|
_OutTexture = out_tex;
|
||||||
|
|
||||||
|
_Camera = new osg::Camera;
|
||||||
|
setupCamera();
|
||||||
|
_Camera->addChild(createTexturedQuad().get());
|
||||||
|
|
||||||
|
_RootGroup->addChild(_Camera.get());
|
||||||
|
|
||||||
|
setShader("shaders/gameoflife.frag");
|
||||||
|
}
|
||||||
|
|
||||||
|
ProcessPass::~ProcessPass()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Group> ProcessPass::createTexturedQuad()
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Group> top_group = new osg::Group;
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Geode> quad_geode = new osg::Geode;
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec3Array> quad_coords = new osg::Vec3Array; // vertex coords
|
||||||
|
// counter-clockwise
|
||||||
|
quad_coords->push_back(osg::Vec3d(0, 0, -1));
|
||||||
|
quad_coords->push_back(osg::Vec3d(1, 0, -1));
|
||||||
|
quad_coords->push_back(osg::Vec3d(1, 1, -1));
|
||||||
|
quad_coords->push_back(osg::Vec3d(0, 1, -1));
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec2Array> quad_tcoords = new osg::Vec2Array; // texture coords
|
||||||
|
quad_tcoords->push_back(osg::Vec2(0, 0));
|
||||||
|
quad_tcoords->push_back(osg::Vec2(_TextureWidth, 0));
|
||||||
|
quad_tcoords->push_back(osg::Vec2(_TextureWidth, _TextureHeight));
|
||||||
|
quad_tcoords->push_back(osg::Vec2(0, _TextureHeight));
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Geometry> quad_geom = new osg::Geometry;
|
||||||
|
osg::ref_ptr<osg::DrawArrays> quad_da = new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4);
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec4Array> quad_colors = new osg::Vec4Array;
|
||||||
|
quad_colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
|
||||||
|
|
||||||
|
quad_geom->setVertexArray(quad_coords.get());
|
||||||
|
quad_geom->setTexCoordArray(0, quad_tcoords.get());
|
||||||
|
quad_geom->addPrimitiveSet(quad_da.get());
|
||||||
|
quad_geom->setColorArray(quad_colors.get());
|
||||||
|
quad_geom->setColorBinding(osg::Geometry::BIND_OVERALL);
|
||||||
|
|
||||||
|
_StateSet = quad_geom->getOrCreateStateSet();
|
||||||
|
_StateSet->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
|
||||||
|
_StateSet->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);
|
||||||
|
|
||||||
|
_StateSet->setTextureAttributeAndModes(0, _InTexture.get(), osg::StateAttribute::ON);
|
||||||
|
|
||||||
|
_StateSet->addUniform(new osg::Uniform("textureIn", 0));
|
||||||
|
|
||||||
|
quad_geode->addDrawable(quad_geom.get());
|
||||||
|
|
||||||
|
top_group->addChild(quad_geode.get());
|
||||||
|
|
||||||
|
return top_group;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProcessPass::setupCamera()
|
||||||
|
{
|
||||||
|
// clearing
|
||||||
|
_Camera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
|
// projection and view
|
||||||
|
_Camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1,0,1));
|
||||||
|
_Camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
||||||
|
_Camera->setViewMatrix(osg::Matrix::identity());
|
||||||
|
|
||||||
|
// viewport
|
||||||
|
_Camera->setViewport(0, 0, _TextureWidth, _TextureHeight);
|
||||||
|
|
||||||
|
_Camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||||
|
_Camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
|
||||||
|
|
||||||
|
_Camera->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER), _OutTexture.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProcessPass::setShader(std::string filename)
|
||||||
|
{
|
||||||
|
std::string foundFile = osgDB::findDataFile(filename);
|
||||||
|
if (foundFile.empty())
|
||||||
|
{
|
||||||
|
osg::notify(osg::NOTICE)<<"Could not file shader file: "<<filename<<std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Shader> fshader = new osg::Shader( osg::Shader::FRAGMENT );
|
||||||
|
fshader->loadShaderSourceFromFile(foundFile);
|
||||||
|
|
||||||
|
_FragmentProgram = 0;
|
||||||
|
_FragmentProgram = new osg::Program;
|
||||||
|
|
||||||
|
_FragmentProgram->addShader(fshader.get());
|
||||||
|
|
||||||
|
_StateSet->setAttributeAndModes(_FragmentProgram.get(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE );
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
GameOfLifePass::GameOfLifePass(osg::Image *in_image)
|
||||||
|
{
|
||||||
|
_TextureWidth = in_image->s();
|
||||||
|
_TextureHeight = in_image->t();
|
||||||
|
|
||||||
|
_RootGroup = new osg::Group;
|
||||||
|
|
||||||
|
_BranchSwith[0] = new osg::Switch;
|
||||||
|
_BranchSwith[1] = new osg::Switch;
|
||||||
|
|
||||||
|
_RootGroup->addChild(_BranchSwith[0].get());
|
||||||
|
_RootGroup->addChild(_BranchSwith[1].get());
|
||||||
|
|
||||||
|
_ActiveBranch = 0;
|
||||||
|
activateBranch();
|
||||||
|
|
||||||
|
createOutputTextures();
|
||||||
|
_InOutTextureLife[0]->setImage(in_image);
|
||||||
|
|
||||||
|
_ProcessPass[0] = new ProcessPass(_InOutTextureLife[0].get(),
|
||||||
|
_InOutTextureLife[1].get(),
|
||||||
|
_TextureWidth, _TextureHeight);
|
||||||
|
|
||||||
|
// For the other pass, the input/output textures are flipped
|
||||||
|
_ProcessPass[1] = new ProcessPass(_InOutTextureLife[1].get(),
|
||||||
|
_InOutTextureLife[0].get(),
|
||||||
|
_TextureWidth, _TextureHeight);
|
||||||
|
|
||||||
|
_BranchSwith[0]->addChild(_ProcessPass[0]->getRoot().get());
|
||||||
|
_BranchSwith[1]->addChild(_ProcessPass[1]->getRoot().get());
|
||||||
|
}
|
||||||
|
|
||||||
|
GameOfLifePass::~GameOfLifePass()
|
||||||
|
{
|
||||||
|
delete _ProcessPass[0];
|
||||||
|
delete _ProcessPass[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::TextureRectangle> GameOfLifePass::getOutputTexture()
|
||||||
|
{
|
||||||
|
int out_tex = (_ActiveBranch == 0) ? 1 : 0;
|
||||||
|
return _ProcessPass[out_tex]->getOutputTexture();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameOfLifePass::activateBranch()
|
||||||
|
{
|
||||||
|
int onb = _ActiveBranch;
|
||||||
|
int offb = (onb == 1) ? 0 : 1;
|
||||||
|
|
||||||
|
_BranchSwith[onb]->setAllChildrenOn();
|
||||||
|
_BranchSwith[offb]->setAllChildrenOff();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameOfLifePass::flip()
|
||||||
|
{
|
||||||
|
_ActiveBranch = (_ActiveBranch == 1) ? 0 : 1;
|
||||||
|
activateBranch();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameOfLifePass::createOutputTextures()
|
||||||
|
{
|
||||||
|
for (int i=0; i<2; i++) {
|
||||||
|
_InOutTextureLife[i] = new osg::TextureRectangle;
|
||||||
|
|
||||||
|
_InOutTextureLife[i]->setTextureSize(_TextureWidth, _TextureHeight);
|
||||||
|
_InOutTextureLife[i]->setInternalFormat(GL_RGBA);
|
||||||
|
_InOutTextureLife[i]->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST);
|
||||||
|
_InOutTextureLife[i]->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
83
examples/osggameoflife/GameOfLifePass.h
Normal file
83
examples/osggameoflife/GameOfLifePass.h
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
/* OpenSceneGraph example, osggameoflife.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef GAMEOFLIFEPASS_H
|
||||||
|
#define GAMEOFLIFEPASS_H 1
|
||||||
|
|
||||||
|
#include <osg/ref_ptr>
|
||||||
|
#include <osg/Group>
|
||||||
|
#include <osg/Switch>
|
||||||
|
#include <osg/Camera>
|
||||||
|
#include <osg/Geode>
|
||||||
|
#include <osg/Geometry>
|
||||||
|
#include <osg/Texture2D>
|
||||||
|
#include <osg/TextureRectangle>
|
||||||
|
|
||||||
|
class ProcessPass {
|
||||||
|
public:
|
||||||
|
ProcessPass(osg::TextureRectangle *in_tex,
|
||||||
|
osg::TextureRectangle *out_tex,
|
||||||
|
int width, int height);
|
||||||
|
~ProcessPass();
|
||||||
|
osg::ref_ptr<osg::Group> getRoot() { return _RootGroup; }
|
||||||
|
osg::ref_ptr<osg::TextureRectangle> getOutputTexture() { return _OutTexture; }
|
||||||
|
void setShader(std::string filename);
|
||||||
|
|
||||||
|
private:
|
||||||
|
osg::ref_ptr<osg::Group> createTexturedQuad();
|
||||||
|
void setupCamera();
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Group> _RootGroup;
|
||||||
|
osg::ref_ptr<osg::Camera> _Camera;
|
||||||
|
osg::ref_ptr<osg::TextureRectangle> _InTexture;
|
||||||
|
osg::ref_ptr<osg::TextureRectangle> _OutTexture;
|
||||||
|
int _TextureWidth;
|
||||||
|
int _TextureHeight;
|
||||||
|
osg::ref_ptr<osg::Program> _FragmentProgram;
|
||||||
|
osg::ref_ptr<osg::StateSet> _StateSet;
|
||||||
|
};
|
||||||
|
|
||||||
|
class GameOfLifePass {
|
||||||
|
public:
|
||||||
|
GameOfLifePass(osg::Image *in_image);
|
||||||
|
~GameOfLifePass();
|
||||||
|
osg::ref_ptr<osg::Group> getRoot() { return _RootGroup; }
|
||||||
|
osg::ref_ptr<osg::TextureRectangle> getOutputTexture();
|
||||||
|
void setShader(std::string filename);
|
||||||
|
// Switch branches so we flip textures
|
||||||
|
void flip();
|
||||||
|
|
||||||
|
private:
|
||||||
|
osg::ref_ptr<osg::Group> createTexturedQuad();
|
||||||
|
void setupCamera();
|
||||||
|
void createOutputTextures();
|
||||||
|
void activateBranch();
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Group> _RootGroup;
|
||||||
|
osg::ref_ptr<osg::Camera> _Camera;
|
||||||
|
osg::ref_ptr<osg::TextureRectangle> _InOutTextureLife[2];
|
||||||
|
int _TextureWidth;
|
||||||
|
int _TextureHeight;
|
||||||
|
int _ActiveBranch;
|
||||||
|
osg::ref_ptr<osg::Program> _FragmentProgram;
|
||||||
|
osg::ref_ptr<osg::StateSet> _StateSet;
|
||||||
|
osg::ref_ptr<osg::Switch> _BranchSwith[2];
|
||||||
|
ProcessPass *_ProcessPass[2];
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //GAMEOFLIFEPASS_H
|
||||||
154
examples/osggameoflife/osggameoflife.cpp
Normal file
154
examples/osggameoflife/osggameoflife.cpp
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
/* OpenSceneGraph example, osggameoflife.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <osg/Vec3>
|
||||||
|
#include <osg/Vec4>
|
||||||
|
#include <osg/Geometry>
|
||||||
|
#include <osg/Geode>
|
||||||
|
#include <osg/TextureRectangle>
|
||||||
|
|
||||||
|
#include <osgDB/FileUtils>
|
||||||
|
#include <osgDB/ReadFile>
|
||||||
|
|
||||||
|
#include <osgViewer/Viewer>
|
||||||
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
|
|
||||||
|
#include <osgGA/TrackballManipulator>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "GameOfLifePass.h"
|
||||||
|
|
||||||
|
GameOfLifePass *golpass;
|
||||||
|
osg::ref_ptr<osg::StateSet> geomss; // stateset where we can attach textures
|
||||||
|
|
||||||
|
osg::Node* createScene(osg::Image *start_im)
|
||||||
|
{
|
||||||
|
int width = start_im->s();
|
||||||
|
int height = start_im->t();
|
||||||
|
|
||||||
|
osg::Group* topnode = new osg::Group;
|
||||||
|
|
||||||
|
// create quad to display image on
|
||||||
|
osg::ref_ptr<osg::Geode> geode = new osg::Geode();
|
||||||
|
|
||||||
|
// each geom will contain a quad
|
||||||
|
osg::ref_ptr<osg::DrawArrays> da = new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4);
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array;
|
||||||
|
colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec2Array> tcoords = new osg::Vec2Array; // texture coords
|
||||||
|
tcoords->push_back(osg::Vec2(0, 0));
|
||||||
|
tcoords->push_back(osg::Vec2(width, 0));
|
||||||
|
tcoords->push_back(osg::Vec2(width, height));
|
||||||
|
tcoords->push_back(osg::Vec2(0, height));
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec3Array> vcoords = new osg::Vec3Array; // vertex coords
|
||||||
|
osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
|
||||||
|
|
||||||
|
// initial viewer camera looks along y
|
||||||
|
vcoords->push_back(osg::Vec3d(0, 0, 0));
|
||||||
|
vcoords->push_back(osg::Vec3d(width, 0, 0));
|
||||||
|
vcoords->push_back(osg::Vec3d(width, 0, height));
|
||||||
|
vcoords->push_back(osg::Vec3d(0, 0, height));
|
||||||
|
|
||||||
|
geom->setVertexArray(vcoords.get());
|
||||||
|
geom->setTexCoordArray(0,tcoords.get());
|
||||||
|
geom->addPrimitiveSet(da.get());
|
||||||
|
geom->setColorArray(colors.get());
|
||||||
|
geom->setColorBinding(osg::Geometry::BIND_OVERALL);
|
||||||
|
geomss = geom->getOrCreateStateSet();
|
||||||
|
geomss->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
||||||
|
|
||||||
|
geode->addDrawable(geom.get());
|
||||||
|
|
||||||
|
topnode->addChild(geode.get());
|
||||||
|
|
||||||
|
// create the ping pong processing passes
|
||||||
|
golpass = new GameOfLifePass(start_im);
|
||||||
|
topnode->addChild(golpass->getRoot().get());
|
||||||
|
|
||||||
|
// attach the output of the processing to the geom
|
||||||
|
geomss->setTextureAttributeAndModes(0,
|
||||||
|
golpass->getOutputTexture().get(),
|
||||||
|
osg::StateAttribute::ON);
|
||||||
|
return topnode;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
// use an ArgumentParser object to manage the program arguments.
|
||||||
|
osg::ArgumentParser arguments(&argc,argv);
|
||||||
|
|
||||||
|
// set up the usage document, in case we need to print out how to use this program.
|
||||||
|
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates ping pong rendering with FBOs and mutliple rendering branches. It uses Conway's Game of Life to illustrate the concept.");
|
||||||
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] --startim start_image");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("--startim","The initial image to seed the game of life with.");
|
||||||
|
|
||||||
|
// if user request help write it out to cout.
|
||||||
|
if (arguments.read("-h") || arguments.read("--help"))
|
||||||
|
{
|
||||||
|
arguments.getApplicationUsage()->write(std::cout);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string startName("");
|
||||||
|
while(arguments.read("--startim", startName)) {}
|
||||||
|
|
||||||
|
if (startName == "") {
|
||||||
|
arguments.getApplicationUsage()->write(std::cout);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// load the image
|
||||||
|
osg::ref_ptr<osg::Image> startIm = osgDB::readImageFile(startName);
|
||||||
|
|
||||||
|
if (!startIm) {
|
||||||
|
std::cout << "Could not load start image.\n";
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::Node* scene = createScene(startIm.get());
|
||||||
|
|
||||||
|
// construct the viewer.
|
||||||
|
osgViewer::Viewer viewer;
|
||||||
|
viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
|
||||||
|
|
||||||
|
// add the stats handler
|
||||||
|
viewer.addEventHandler(new osgViewer::StatsHandler);
|
||||||
|
|
||||||
|
viewer.setSceneData(scene);
|
||||||
|
|
||||||
|
viewer.realize();
|
||||||
|
viewer.setCameraManipulator( new osgGA::TrackballManipulator );
|
||||||
|
|
||||||
|
while(!viewer.done())
|
||||||
|
{
|
||||||
|
viewer.frame();
|
||||||
|
// flip the textures after we've completed a frame
|
||||||
|
golpass->flip();
|
||||||
|
// attach the proper output to view
|
||||||
|
geomss->setTextureAttributeAndModes(0,
|
||||||
|
golpass->getOutputTexture().get(),
|
||||||
|
osg::StateAttribute::ON);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -110,7 +110,7 @@ int main( int argc, char **argv )
|
|||||||
osg::Node* rootnode = osgDB::readNodeFiles(arguments);
|
osg::Node* rootnode = osgDB::readNodeFiles(arguments);
|
||||||
if (!rootnode)
|
if (!rootnode)
|
||||||
{
|
{
|
||||||
osg::notify(osg::NOTICE)<<"Please specify and geo model filename on the command line."<<std::endl;
|
osg::notify(osg::NOTICE)<<"Please specify a geo model filename on the command line."<<std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,11 +84,12 @@ static const char* geomSource = {
|
|||||||
"#version 120\n"
|
"#version 120\n"
|
||||||
"#extension GL_EXT_geometry_shader4 : enable\n"
|
"#extension GL_EXT_geometry_shader4 : enable\n"
|
||||||
"uniform float u_anim1;\n"
|
"uniform float u_anim1;\n"
|
||||||
"varying vec4 v_color;\n"
|
"varying in vec4 v_color[];\n"
|
||||||
|
"varying out vec4 v_color_out;\n"
|
||||||
"void main(void)\n"
|
"void main(void)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" vec4 v = gl_PositionIn[0];\n"
|
" vec4 v = gl_PositionIn[0];\n"
|
||||||
" v_color = v;\n"
|
" v_color_out = v + v_color[0];\n"
|
||||||
"\n"
|
"\n"
|
||||||
" gl_Position = v + vec4(u_anim1,0.,0.,0.); EmitVertex();\n"
|
" gl_Position = v + vec4(u_anim1,0.,0.,0.); EmitVertex();\n"
|
||||||
" gl_Position = v - vec4(u_anim1,0.,0.,0.); EmitVertex();\n"
|
" gl_Position = v - vec4(u_anim1,0.,0.,0.); EmitVertex();\n"
|
||||||
@@ -105,10 +106,10 @@ static const char* fragSource = {
|
|||||||
"#version 120\n"
|
"#version 120\n"
|
||||||
"#extension GL_EXT_geometry_shader4 : enable\n"
|
"#extension GL_EXT_geometry_shader4 : enable\n"
|
||||||
"uniform float u_anim1;\n"
|
"uniform float u_anim1;\n"
|
||||||
"varying vec4 v_color;\n"
|
"varying vec4 v_color_out;\n"
|
||||||
"void main(void)\n"
|
"void main(void)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" gl_FragColor = v_color;\n"
|
" gl_FragColor = v_color_out;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -178,7 +179,7 @@ public:
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int main( int argc, char *argv[] )
|
int main( int , char** )
|
||||||
{
|
{
|
||||||
osg::Geode* root( new osg::Geode );
|
osg::Geode* root( new osg::Geode );
|
||||||
root->addDrawable( new SomePoints );
|
root->addDrawable( new SomePoints );
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
if (cv)
|
if (cv)
|
||||||
{
|
{
|
||||||
osg::Vec3 eyePointLocal = cv->getEyeLocal();
|
osg::Vec3 eyePointLocal = cv->getEyeLocal();
|
||||||
matrix.preMult(osg::Matrix::translate(eyePointLocal.x(),eyePointLocal.y(),0.0f));
|
matrix.preMultTranslate(osg::Vec3(eyePointLocal.x(),eyePointLocal.y(),0.0f));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
if (cv)
|
if (cv)
|
||||||
{
|
{
|
||||||
osg::Vec3 eyePointLocal = cv->getEyeLocal();
|
osg::Vec3 eyePointLocal = cv->getEyeLocal();
|
||||||
matrix.postMult(osg::Matrix::translate(-eyePointLocal.x(),-eyePointLocal.y(),0.0f));
|
matrix.postMultTranslate(osg::Vec3(-eyePointLocal.x(),-eyePointLocal.y(),0.0f));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ struct SnapeImageHandler : public osgGA::GUIEventHandler
|
|||||||
_key(key),
|
_key(key),
|
||||||
_snapImage(si) {}
|
_snapImage(si) {}
|
||||||
|
|
||||||
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
|
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&)
|
||||||
{
|
{
|
||||||
if (ea.getHandled()) return false;
|
if (ea.getHandled()) return false;
|
||||||
|
|
||||||
|
|||||||
@@ -31,24 +31,94 @@
|
|||||||
#include <osgDB/WriteFile>
|
#include <osgDB/WriteFile>
|
||||||
|
|
||||||
#include <osgViewer/Viewer>
|
#include <osgViewer/Viewer>
|
||||||
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// A simple demo demonstrating how to set on an animated texture using an osg::ImageSequence
|
// A simple demo demonstrating how to set on an animated texture using an osg::ImageSequence
|
||||||
//
|
//
|
||||||
|
|
||||||
osg::StateSet* createState()
|
osg::StateSet* createState(osg::ArgumentParser& arguments)
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::ImageSequence> imageSequence = new osg::ImageSequence;
|
osg::ref_ptr<osg::ImageSequence> imageSequence = new osg::ImageSequence;
|
||||||
|
|
||||||
imageSequence->setDuration(2.0);
|
bool preLoad = true;
|
||||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posx.png"));
|
|
||||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negx.png"));
|
while (arguments.read("--page-and-discard"))
|
||||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posy.png"));
|
{
|
||||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negy.png"));
|
imageSequence->setMode(osg::ImageSequence::PAGE_AND_DISCARD_USED_IMAGES);
|
||||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posz.png"));
|
preLoad = false;
|
||||||
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negz.png"));
|
}
|
||||||
|
|
||||||
|
while (arguments.read("--page-and-retain"))
|
||||||
|
{
|
||||||
|
imageSequence->setMode(osg::ImageSequence::PAGE_AND_RETAIN_IMAGES);
|
||||||
|
preLoad = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (arguments.read("--preload"))
|
||||||
|
{
|
||||||
|
imageSequence->setMode(osg::ImageSequence::PRE_LOAD_ALL_IMAGES);
|
||||||
|
preLoad = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
double length = -1.0;
|
||||||
|
while (arguments.read("--length",length)) {}
|
||||||
|
|
||||||
|
if (arguments.argc()>1)
|
||||||
|
{
|
||||||
|
for(int i=1; i<arguments.argc(); ++i)
|
||||||
|
{
|
||||||
|
if (preLoad)
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Image> image = osgDB::readImageFile(arguments[i]);
|
||||||
|
if (image.valid())
|
||||||
|
{
|
||||||
|
imageSequence->addImage(image.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
imageSequence->addImageFile(arguments[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (length>0.0)
|
||||||
|
{
|
||||||
|
imageSequence->setLength(length);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unsigned int maxNum = osg::maximum(imageSequence->getFileNames().size(),
|
||||||
|
imageSequence->getImages().size());
|
||||||
|
|
||||||
|
imageSequence->setLength(float(maxNum)*0.1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (length>0.0)
|
||||||
|
{
|
||||||
|
imageSequence->setLength(length);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
imageSequence->setLength(4.0);
|
||||||
|
}
|
||||||
|
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posx.png"));
|
||||||
|
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negx.png"));
|
||||||
|
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posy.png"));
|
||||||
|
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negy.png"));
|
||||||
|
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posz.png"));
|
||||||
|
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negz.png"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// start the image sequence playing
|
||||||
|
imageSequence->play();
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
osg::Texture2D* texture = new osg::Texture2D;
|
osg::Texture2D* texture = new osg::Texture2D;
|
||||||
@@ -58,18 +128,13 @@ osg::StateSet* createState()
|
|||||||
texture->setResizeNonPowerOfTwoHint(false);
|
texture->setResizeNonPowerOfTwoHint(false);
|
||||||
texture->setImage(imageSequence.get());
|
texture->setImage(imageSequence.get());
|
||||||
//texture->setTextureSize(512,512);
|
//texture->setTextureSize(512,512);
|
||||||
|
|
||||||
//texture->setUpdateCallback(new osg::ImageSequence::UpdateCallback);
|
|
||||||
#else
|
#else
|
||||||
osg::TextureRectangle* texture = new osg::TextureRectangle;
|
osg::TextureRectangle* texture = new osg::TextureRectangle;
|
||||||
texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR);
|
texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR);
|
||||||
texture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::LINEAR);
|
texture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::LINEAR);
|
||||||
texture->setWrap(osg::Texture::WRAP_R,osg::Texture::REPEAT);
|
texture->setWrap(osg::Texture::WRAP_R,osg::Texture::REPEAT);
|
||||||
// texture->setResizeNonPowerOfTwoHint(false);
|
|
||||||
texture->setImage(imageSequence.get());
|
texture->setImage(imageSequence.get());
|
||||||
//texture->setTextureSize(512,512);
|
//texture->setTextureSize(512,512);
|
||||||
|
|
||||||
//texture->setUpdateCallback(new osg::ImageSequence::UpdateCallback);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// create the StateSet to store the texture data
|
// create the StateSet to store the texture data
|
||||||
@@ -80,20 +145,192 @@ osg::StateSet* createState()
|
|||||||
return stateset;
|
return stateset;
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::Node* createModel()
|
osg::Node* createModel(osg::ArgumentParser& arguments)
|
||||||
{
|
{
|
||||||
|
|
||||||
// create the geometry of the model, just a simple 2d quad right now.
|
// create the geometry of the model, just a simple 2d quad right now.
|
||||||
osg::Geode* geode = new osg::Geode;
|
osg::Geode* geode = new osg::Geode;
|
||||||
geode->addDrawable(osg::createTexturedQuadGeometry(osg::Vec3(0.0f,0.0f,0.0), osg::Vec3(1.0f,0.0f,0.0), osg::Vec3(0.0f,0.0f,1.0f)));
|
geode->addDrawable(osg::createTexturedQuadGeometry(osg::Vec3(0.0f,0.0f,0.0), osg::Vec3(1.0f,0.0f,0.0), osg::Vec3(0.0f,0.0f,1.0f)));
|
||||||
|
|
||||||
geode->setStateSet(createState());
|
geode->setStateSet(createState(arguments));
|
||||||
|
|
||||||
return geode;
|
return geode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
osg::ImageStream* s_imageStream = 0;
|
||||||
|
class MovieEventHandler : public osgGA::GUIEventHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
MovieEventHandler():_playToggle(true),_trackMouse(false) {}
|
||||||
|
|
||||||
|
void setMouseTracking(bool track) { _trackMouse = track; }
|
||||||
|
bool getMouseTracking() const { return _trackMouse; }
|
||||||
|
|
||||||
|
void set(osg::Node* node);
|
||||||
|
|
||||||
|
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv);
|
||||||
|
|
||||||
|
virtual void getUsage(osg::ApplicationUsage& usage) const;
|
||||||
|
|
||||||
|
typedef std::vector< osg::observer_ptr<osg::ImageStream> > ImageStreamList;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual ~MovieEventHandler() {}
|
||||||
|
|
||||||
|
class FindImageStreamsVisitor : public osg::NodeVisitor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FindImageStreamsVisitor(ImageStreamList& imageStreamList):
|
||||||
|
_imageStreamList(imageStreamList) {}
|
||||||
|
|
||||||
|
virtual void apply(osg::Geode& geode)
|
||||||
|
{
|
||||||
|
apply(geode.getStateSet());
|
||||||
|
|
||||||
|
for(unsigned int i=0;i<geode.getNumDrawables();++i)
|
||||||
|
{
|
||||||
|
apply(geode.getDrawable(i)->getStateSet());
|
||||||
|
}
|
||||||
|
|
||||||
|
traverse(geode);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void apply(osg::Node& node)
|
||||||
|
{
|
||||||
|
apply(node.getStateSet());
|
||||||
|
traverse(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void apply(osg::StateSet* stateset)
|
||||||
|
{
|
||||||
|
if (!stateset) return;
|
||||||
|
|
||||||
|
osg::StateAttribute* attr = stateset->getTextureAttribute(0,osg::StateAttribute::TEXTURE);
|
||||||
|
if (attr)
|
||||||
|
{
|
||||||
|
osg::Texture2D* texture2D = dynamic_cast<osg::Texture2D*>(attr);
|
||||||
|
if (texture2D) apply(dynamic_cast<osg::ImageStream*>(texture2D->getImage()));
|
||||||
|
|
||||||
|
osg::TextureRectangle* textureRec = dynamic_cast<osg::TextureRectangle*>(attr);
|
||||||
|
if (textureRec) apply(dynamic_cast<osg::ImageStream*>(textureRec->getImage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void apply(osg::ImageStream* imagestream)
|
||||||
|
{
|
||||||
|
if (imagestream)
|
||||||
|
{
|
||||||
|
_imageStreamList.push_back(imagestream);
|
||||||
|
s_imageStream = imagestream;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageStreamList& _imageStreamList;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
FindImageStreamsVisitor& operator = (const FindImageStreamsVisitor&) { return *this; }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
bool _playToggle;
|
||||||
|
bool _trackMouse;
|
||||||
|
ImageStreamList _imageStreamList;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void MovieEventHandler::set(osg::Node* node)
|
||||||
|
{
|
||||||
|
_imageStreamList.clear();
|
||||||
|
if (node)
|
||||||
|
{
|
||||||
|
FindImageStreamsVisitor fisv(_imageStreamList);
|
||||||
|
node->accept(fisv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool MovieEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv)
|
||||||
|
{
|
||||||
|
switch(ea.getEventType())
|
||||||
|
{
|
||||||
|
case(osgGA::GUIEventAdapter::KEYDOWN):
|
||||||
|
{
|
||||||
|
if (ea.getKey()=='p')
|
||||||
|
{
|
||||||
|
for(ImageStreamList::iterator itr=_imageStreamList.begin();
|
||||||
|
itr!=_imageStreamList.end();
|
||||||
|
++itr)
|
||||||
|
{
|
||||||
|
if ((*itr)->getStatus()==osg::ImageStream::PLAYING)
|
||||||
|
{
|
||||||
|
// playing, so pause
|
||||||
|
std::cout<<"Pause"<<std::endl;
|
||||||
|
(*itr)->pause();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// playing, so pause
|
||||||
|
std::cout<<"Play"<<std::endl;
|
||||||
|
(*itr)->play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (ea.getKey()=='r')
|
||||||
|
{
|
||||||
|
for(ImageStreamList::iterator itr=_imageStreamList.begin();
|
||||||
|
itr!=_imageStreamList.end();
|
||||||
|
++itr)
|
||||||
|
{
|
||||||
|
std::cout<<"Restart"<<std::endl;
|
||||||
|
(*itr)->rewind();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (ea.getKey()=='L')
|
||||||
|
{
|
||||||
|
for(ImageStreamList::iterator itr=_imageStreamList.begin();
|
||||||
|
itr!=_imageStreamList.end();
|
||||||
|
++itr)
|
||||||
|
{
|
||||||
|
if ( (*itr)->getLoopingMode() == osg::ImageStream::LOOPING)
|
||||||
|
{
|
||||||
|
std::cout<<"Toggle Looping Off"<<std::endl;
|
||||||
|
(*itr)->setLoopingMode( osg::ImageStream::NO_LOOPING );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout<<"Toggle Looping On"<<std::endl;
|
||||||
|
(*itr)->setLoopingMode( osg::ImageStream::LOOPING );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MovieEventHandler::getUsage(osg::ApplicationUsage& usage) const
|
||||||
|
{
|
||||||
|
usage.addKeyboardMouseBinding("p","Play/Pause movie");
|
||||||
|
usage.addKeyboardMouseBinding("r","Restart movie");
|
||||||
|
usage.addKeyboardMouseBinding("l","Toggle looping of movie");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
osg::ArgumentParser arguments(&argc,argv);
|
osg::ArgumentParser arguments(&argc,argv);
|
||||||
@@ -101,11 +338,20 @@ int main(int argc, char **argv)
|
|||||||
// construct the viewer.
|
// construct the viewer.
|
||||||
osgViewer::Viewer viewer(arguments);
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
|
||||||
// create a model from the images and pass it to the viewer.
|
|
||||||
viewer.setSceneData(createModel());
|
|
||||||
|
|
||||||
std::string filename;
|
std::string filename;
|
||||||
if (arguments.read("-o",filename))
|
arguments.read("-o",filename);
|
||||||
|
|
||||||
|
// create a model from the images and pass it to the viewer.
|
||||||
|
viewer.setSceneData(createModel(arguments));
|
||||||
|
|
||||||
|
// pass the model to the MovieEventHandler so it can pick out ImageStream's to manipulate.
|
||||||
|
MovieEventHandler* meh = new MovieEventHandler();
|
||||||
|
meh->set( viewer.getSceneData() );
|
||||||
|
viewer.addEventHandler( meh );
|
||||||
|
|
||||||
|
viewer.addEventHandler( new osgViewer::StatsHandler());
|
||||||
|
|
||||||
|
if (!filename.empty())
|
||||||
{
|
{
|
||||||
osgDB::writeNodeFile(*viewer.getSceneData(),filename);
|
osgDB::writeNodeFile(*viewer.getSceneData(),filename);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user