Changeset 3371
- Timestamp:
- Feb 27, 2013, 7:45:07 AM (12 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/nanovisviewer.tcl
r3370 r3371 110 110 private method BuildViewTab {} 111 111 private method BuildVolumeTab {} 112 private method ColorsToColormap { colors }113 112 private method ResetColormap { color } 114 113 private method ComputeTransferFunc { tf } … … 1253 1252 # ---------------------------------------------------------------------- 1254 1253 itcl::body Rappture::NanovisViewer::AdjustSetting {what {value ""}} { 1254 if {![isconnected]} { 1255 return 1256 } 1255 1257 switch -- $what { 1256 1258 light { 1257 if {[isconnected]} { 1258 set val $_settings($this-light) 1259 set diffuse [expr {0.01*$val}] 1260 set ambient [expr {1.0-$diffuse}] 1261 set specularLevel 0.3 1262 set specularExp 90.0 1263 SendCmd "volume shading ambient $ambient" 1264 SendCmd "volume shading diffuse $diffuse" 1265 SendCmd "volume shading specularLevel $specularLevel" 1266 SendCmd "volume shading specularExp $specularExp" 1259 set val $_settings($this-light) 1260 set diffuse [expr {0.01*$val}] 1261 set ambient [expr {1.0-$diffuse}] 1262 set specularLevel 0.3 1263 set specularExp 90.0 1264 SendCmd "volume shading ambient $ambient" 1265 SendCmd "volume shading diffuse $diffuse" 1266 SendCmd "volume shading specularLevel $specularLevel" 1267 SendCmd "volume shading specularExp $specularExp" 1268 } 1269 light2side { 1270 set val $_settings($this-light2side) 1271 SendCmd "volume shading light2side $val" 1272 } 1273 transp { 1274 set val $_settings($this-transp) 1275 set sval [expr { 0.01 * double($val) }] 1276 SendCmd "volume shading opacity $sval" 1277 } 1278 opacity { 1279 set val $_settings($this-opacity) 1280 set sval [expr { 0.01 * double($val) }] 1281 foreach tf [array names _activeTfs] { 1282 set _settings($this-$tf-opacity) $sval 1283 set _activeTfs($tf) 0 1267 1284 } 1268 } 1269 light2side { 1270 if {[isconnected]} { 1271 set val $_settings($this-light2side) 1272 SendCmd "volume shading light2side $val" 1273 } 1274 } 1275 transp { 1276 if {[isconnected]} { 1277 set val $_settings($this-transp) 1278 set sval [expr { 0.01 * double($val) }] 1279 SendCmd "volume shading opacity $sval" 1280 } 1281 } 1282 opacity { 1283 if {[isconnected] && [array size _activeTfs] > 0 } { 1284 set val $_settings($this-opacity) 1285 set sval [expr { 0.01 * double($val) }] 1286 foreach tf [array names _activeTfs] { 1287 set _settings($this-$tf-opacity) $sval 1288 set _activeTfs($tf) 0 1289 } 1290 updatetransferfuncs 1291 } 1285 updatetransferfuncs 1292 1286 } 1293 1287 thickness { 1294 if { [isconnected] &&[array names _activeTfs] > 0 } {1288 if { [array names _activeTfs] > 0 } { 1295 1289 set val $_settings($this-thickness) 1296 1290 # Scale values between 0.00001 and 0.01000 … … 1304 1298 } 1305 1299 "outline" { 1306 if {[isconnected]} { 1307 SendCmd "volume outline state $_settings($this-outline)" 1308 } 1300 SendCmd "volume outline state $_settings($this-outline)" 1309 1301 } 1310 1302 "isosurface" { 1311 if {[isconnected]} { 1312 SendCmd "volume shading isosurface $_settings($this-isosurface)" 1313 } 1303 SendCmd "volume shading isosurface $_settings($this-isosurface)" 1314 1304 } 1315 1305 "colormap" { 1316 1306 set color [$itk_component(colormap) value] 1317 1307 set _settings(colormap) $color 1308 # Only set the colormap on the first volume. Ignore the others. 1318 1309 #ResetColormap $color 1319 1310 } 1320 1311 "grid" { 1321 if { [isconnected] } { 1322 SendCmd "grid visible $_settings($this-grid)" 1323 } 1312 SendCmd "grid visible $_settings($this-grid)" 1324 1313 } 1325 1314 "axes" { 1326 if { [isconnected] } { 1327 SendCmd "axis visible $_settings($this-axes)" 1328 } 1315 SendCmd "axis visible $_settings($this-axes)" 1329 1316 } 1330 1317 "legend" { … … 1339 1326 } 1340 1327 "volume" { 1341 if { [isconnected] } { 1342 set datasets [CurrentDatasets -cutplanes] 1343 SendCmd "volume data state $_settings($this-volume) $datasets" 1344 } 1328 set datasets [CurrentDatasets -cutplanes] 1329 SendCmd "volume data state $_settings($this-volume) $datasets" 1345 1330 } 1346 1331 "xcutplane" - "ycutplane" - "zcutplane" { 1347 1332 set axis [string range $what 0 0] 1348 1333 set bool $_settings($this-$what) 1349 if { [isconnected] } { 1350 set datasets [CurrentDatasets -cutplanes] 1351 set tag [lindex $datasets 0] 1352 SendCmd "cutplane state $bool $axis $tag" 1353 } 1334 set datasets [CurrentDatasets -cutplanes] 1335 set tag [lindex $datasets 0] 1336 SendCmd "cutplane state $bool $axis $tag" 1354 1337 if { $bool } { 1355 1338 $itk_component(${axis}CutScale) configure -state normal \ … … 1422 1405 1423 1406 1424 itcl::body Rappture::NanovisViewer::ColorsToColormap { colors } {1425 switch -- $colors {1426 "grey-to-blue" {1427 return {1428 0.0 0.200 0.200 0.2001429 0.14285714285714285 0.400 0.400 0.4001430 0.2857142857142857 0.600 0.600 0.6001431 0.42857142857142855 0.900 0.900 0.9001432 0.5714285714285714 0.800 1.000 1.0001433 0.7142857142857143 0.600 1.000 1.0001434 0.8571428571428571 0.400 0.900 1.0001435 1.0 0.000 0.600 0.8001436 }1437 }1438 "blue-to-grey" {1439 return {1440 0.0 0.000 0.600 0.8001441 0.14285714285714285 0.400 0.900 1.0001442 0.2857142857142857 0.600 1.000 1.0001443 0.42857142857142855 0.800 1.000 1.0001444 0.5714285714285714 0.900 0.900 0.9001445 0.7142857142857143 0.600 0.600 0.6001446 0.8571428571428571 0.400 0.400 0.4001447 1.0 0.200 0.200 0.2001448 }1449 }1450 "blue" {1451 return {1452 0.0 0.900 1.000 1.0001453 0.1111111111111111 0.800 0.983 1.0001454 0.2222222222222222 0.700 0.950 1.0001455 0.3333333333333333 0.600 0.900 1.0001456 0.4444444444444444 0.500 0.833 1.0001457 0.5555555555555556 0.400 0.750 1.0001458 0.6666666666666666 0.300 0.650 1.0001459 0.7777777777777778 0.200 0.533 1.0001460 0.8888888888888888 0.100 0.400 1.0001461 1.0 0.000 0.250 1.0001462 }1463 }1464 "brown-to-blue" {1465 return {1466 0.0 0.200 0.100 0.0001467 0.09090909090909091 0.400 0.187 0.0001468 0.18181818181818182 0.600 0.379 0.2101469 0.2727272727272727 0.800 0.608 0.4801470 0.36363636363636365 0.850 0.688 0.5951471 0.45454545454545453 0.950 0.855 0.8081472 0.5454545454545454 0.800 0.993 1.0001473 0.6363636363636364 0.600 0.973 1.0001474 0.7272727272727273 0.400 0.940 1.0001475 0.8181818181818182 0.200 0.893 1.0001476 0.9090909090909091 0.000 0.667 0.8001477 1.0 0.000 0.480 0.6001478 }1479 }1480 "blue-to-brown" {1481 return {1482 0.0 0.000 0.480 0.6001483 0.09090909090909091 0.000 0.667 0.8001484 0.18181818181818182 0.200 0.893 1.0001485 0.2727272727272727 0.400 0.940 1.0001486 0.36363636363636365 0.600 0.973 1.0001487 0.45454545454545453 0.800 0.993 1.0001488 0.5454545454545454 0.950 0.855 0.8081489 0.6363636363636364 0.850 0.688 0.5951490 0.7272727272727273 0.800 0.608 0.4801491 0.8181818181818182 0.600 0.379 0.2101492 0.9090909090909091 0.400 0.187 0.0001493 1.0 0.200 0.100 0.0001494 }1495 }1496 "blue-to-orange" {1497 return {1498 0.0 0.000 0.167 1.0001499 0.09090909090909091 0.100 0.400 1.0001500 0.18181818181818182 0.200 0.600 1.0001501 0.2727272727272727 0.400 0.800 1.0001502 0.36363636363636365 0.600 0.933 1.0001503 0.45454545454545453 0.800 1.000 1.0001504 0.5454545454545454 1.000 1.000 0.8001505 0.6363636363636364 1.000 0.933 0.6001506 0.7272727272727273 1.000 0.800 0.4001507 0.8181818181818182 1.000 0.600 0.2001508 0.9090909090909091 1.000 0.400 0.1001509 1.0 1.000 0.167 0.0001510 }1511 }1512 "orange-to-blue" {1513 return {1514 0.0 1.000 0.167 0.0001515 0.09090909090909091 1.000 0.400 0.1001516 0.18181818181818182 1.000 0.600 0.2001517 0.2727272727272727 1.000 0.800 0.4001518 0.36363636363636365 1.000 0.933 0.6001519 0.45454545454545453 1.000 1.000 0.8001520 0.5454545454545454 0.800 1.000 1.0001521 0.6363636363636364 0.600 0.933 1.0001522 0.7272727272727273 0.400 0.800 1.0001523 0.8181818181818182 0.200 0.600 1.0001524 0.9090909090909091 0.100 0.400 1.0001525 1.0 0.000 0.167 1.0001526 }1527 }1528 "rainbow" {1529 set clist {1530 "#EE82EE"1531 "#4B0082"1532 "blue"1533 "#008000"1534 "yellow"1535 "#FFA500"1536 "red"1537 }1538 }1539 "BGYOR" {1540 set clist {1541 "blue"1542 "#008000"1543 "yellow"1544 "#FFA500"1545 "red"1546 }1547 }1548 "ROYGB" {1549 set clist {1550 "red"1551 "#FFA500"1552 "yellow"1553 "#008000"1554 "blue"1555 }1556 }1557 "RYGCB" {1558 set clist {1559 "red"1560 "yellow"1561 "green"1562 "cyan"1563 "blue"1564 }1565 }1566 "BCGYR" {1567 set clist {1568 "blue"1569 "cyan"1570 "green"1571 "yellow"1572 "red"1573 }1574 }1575 "spectral" {1576 return {1577 0.0 0.150 0.300 1.0001578 0.1 0.250 0.630 1.0001579 0.2 0.450 0.850 1.0001580 0.3 0.670 0.970 1.0001581 0.4 0.880 1.000 1.0001582 0.5 1.000 1.000 0.7501583 0.6 1.000 0.880 0.6001584 0.7 1.000 0.680 0.4501585 0.8 0.970 0.430 0.3701586 0.9 0.850 0.150 0.1961587 1.0 0.650 0.000 0.1301588 }1589 }1590 "green-to-magenta" {1591 return {1592 0.0 0.000 0.316 0.0001593 0.06666666666666667 0.000 0.526 0.0001594 0.13333333333333333 0.000 0.737 0.0001595 0.2 0.000 0.947 0.0001596 0.26666666666666666 0.316 1.000 0.3161597 0.3333333333333333 0.526 1.000 0.5261598 0.4 0.737 1.000 0.7371599 0.4666666666666667 1.000 1.000 1.0001600 0.5333333333333333 1.000 0.947 1.0001601 0.6 1.000 0.737 1.0001602 0.6666666666666666 1.000 0.526 1.0001603 0.7333333333333333 1.000 0.316 1.0001604 0.8 0.947 0.000 0.9471605 0.8666666666666667 0.737 0.000 0.7371606 0.9333333333333333 0.526 0.000 0.5261607 1.0 0.316 0.000 0.3161608 }1609 }1610 "greyscale" {1611 return {1612 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.01613 }1614 }1615 "nanohub" {1616 set clist "white yellow green cyan blue magenta"1617 }1618 default {1619 set clist [split $colors ":"]1620 }1621 }1622 set cmap {}1623 if { [llength $clist] == 1 } {1624 set rgb [Color2RGB $clist]1625 append cmap "0.0 $rgb 1.0 $rgb"1626 } else {1627 for {set i 0} {$i < [llength $clist]} {incr i} {1628 set x [expr {double($i)/([llength $clist]-1)}]1629 set color [lindex $clist $i]1630 append cmap "$x [Color2RGB $color] "1631 }1632 }1633 return $cmap1634 }1635 1407 1636 1408 # … … 1645 1417 itcl::body Rappture::NanovisViewer::ComputeTransferFunc { tf } { 1646 1418 array set style { 1647 -color rainbow1419 -color nanovis 1648 1420 -levels 6 1649 1421 -opacity 1.0 -
trunk/gui/scripts/visviewer.tcl
r3367 r3371 73 73 private method SendDebugCommand {} 74 74 75 protected method CheckConnection {} 75 76 protected method Color2RGB { color } 77 protected method ColorsToColormap { colors } 76 78 protected method Connect { servers } 77 protected method CheckConnection {}78 79 protected method Disconnect {} 79 80 protected method Euler2XYZ { theta phi psi } … … 816 817 } 817 818 819 820 itcl::body Rappture::VisViewer::ColorsToColormap { colors } { 821 switch -- $colors { 822 "grey-to-blue" { 823 return { 824 0.0 0.200 0.200 0.200 825 0.14285714285714285 0.400 0.400 0.400 826 0.2857142857142857 0.600 0.600 0.600 827 0.42857142857142855 0.900 0.900 0.900 828 0.5714285714285714 0.800 1.000 1.000 829 0.7142857142857143 0.600 1.000 1.000 830 0.8571428571428571 0.400 0.900 1.000 831 1.0 0.000 0.600 0.800 832 } 833 } 834 "blue-to-grey" { 835 return { 836 0.0 0.000 0.600 0.800 837 0.14285714285714285 0.400 0.900 1.000 838 0.2857142857142857 0.600 1.000 1.000 839 0.42857142857142855 0.800 1.000 1.000 840 0.5714285714285714 0.900 0.900 0.900 841 0.7142857142857143 0.600 0.600 0.600 842 0.8571428571428571 0.400 0.400 0.400 843 1.0 0.200 0.200 0.200 844 } 845 } 846 "blue" { 847 return { 848 0.0 0.900 1.000 1.000 849 0.1111111111111111 0.800 0.983 1.000 850 0.2222222222222222 0.700 0.950 1.000 851 0.3333333333333333 0.600 0.900 1.000 852 0.4444444444444444 0.500 0.833 1.000 853 0.5555555555555556 0.400 0.750 1.000 854 0.6666666666666666 0.300 0.650 1.000 855 0.7777777777777778 0.200 0.533 1.000 856 0.8888888888888888 0.100 0.400 1.000 857 1.0 0.000 0.250 1.000 858 } 859 } 860 "brown-to-blue" { 861 return { 862 0.0 0.200 0.100 0.000 863 0.09090909090909091 0.400 0.187 0.000 864 0.18181818181818182 0.600 0.379 0.210 865 0.2727272727272727 0.800 0.608 0.480 866 0.36363636363636365 0.850 0.688 0.595 867 0.45454545454545453 0.950 0.855 0.808 868 0.5454545454545454 0.800 0.993 1.000 869 0.6363636363636364 0.600 0.973 1.000 870 0.7272727272727273 0.400 0.940 1.000 871 0.8181818181818182 0.200 0.893 1.000 872 0.9090909090909091 0.000 0.667 0.800 873 1.0 0.000 0.480 0.600 874 } 875 } 876 "blue-to-brown" { 877 return { 878 0.0 0.000 0.480 0.600 879 0.09090909090909091 0.000 0.667 0.800 880 0.18181818181818182 0.200 0.893 1.000 881 0.2727272727272727 0.400 0.940 1.000 882 0.36363636363636365 0.600 0.973 1.000 883 0.45454545454545453 0.800 0.993 1.000 884 0.5454545454545454 0.950 0.855 0.808 885 0.6363636363636364 0.850 0.688 0.595 886 0.7272727272727273 0.800 0.608 0.480 887 0.8181818181818182 0.600 0.379 0.210 888 0.9090909090909091 0.400 0.187 0.000 889 1.0 0.200 0.100 0.000 890 } 891 } 892 "blue-to-orange" { 893 return { 894 0.0 0.000 0.167 1.000 895 0.09090909090909091 0.100 0.400 1.000 896 0.18181818181818182 0.200 0.600 1.000 897 0.2727272727272727 0.400 0.800 1.000 898 0.36363636363636365 0.600 0.933 1.000 899 0.45454545454545453 0.800 1.000 1.000 900 0.5454545454545454 1.000 1.000 0.800 901 0.6363636363636364 1.000 0.933 0.600 902 0.7272727272727273 1.000 0.800 0.400 903 0.8181818181818182 1.000 0.600 0.200 904 0.9090909090909091 1.000 0.400 0.100 905 1.0 1.000 0.167 0.000 906 } 907 } 908 "orange-to-blue" { 909 return { 910 0.0 1.000 0.167 0.000 911 0.09090909090909091 1.000 0.400 0.100 912 0.18181818181818182 1.000 0.600 0.200 913 0.2727272727272727 1.000 0.800 0.400 914 0.36363636363636365 1.000 0.933 0.600 915 0.45454545454545453 1.000 1.000 0.800 916 0.5454545454545454 0.800 1.000 1.000 917 0.6363636363636364 0.600 0.933 1.000 918 0.7272727272727273 0.400 0.800 1.000 919 0.8181818181818182 0.200 0.600 1.000 920 0.9090909090909091 0.100 0.400 1.000 921 1.0 0.000 0.167 1.000 922 } 923 } 924 "rainbow" { 925 set clist { 926 "#EE82EE" 927 "#4B0082" 928 "blue" 929 "#008000" 930 "yellow" 931 "#FFA500" 932 "red" 933 } 934 } 935 "BGYOR" { 936 set clist { 937 "blue" 938 "#008000" 939 "yellow" 940 "#FFA500" 941 "red" 942 } 943 } 944 "ROYGB" { 945 set clist { 946 "red" 947 "#FFA500" 948 "yellow" 949 "#008000" 950 "blue" 951 } 952 } 953 "RYGCB" { 954 set clist { 955 "red" 956 "yellow" 957 "green" 958 "cyan" 959 "blue" 960 } 961 } 962 "BCGYR" { 963 set clist { 964 "blue" 965 "cyan" 966 "green" 967 "yellow" 968 "red" 969 } 970 } 971 "spectral" { 972 return { 973 0.0 0.150 0.300 1.000 974 0.1 0.250 0.630 1.000 975 0.2 0.450 0.850 1.000 976 0.3 0.670 0.970 1.000 977 0.4 0.880 1.000 1.000 978 0.5 1.000 1.000 0.750 979 0.6 1.000 0.880 0.600 980 0.7 1.000 0.680 0.450 981 0.8 0.970 0.430 0.370 982 0.9 0.850 0.150 0.196 983 1.0 0.650 0.000 0.130 984 } 985 } 986 "green-to-magenta" { 987 return { 988 0.0 0.000 0.316 0.000 989 0.06666666666666667 0.000 0.526 0.000 990 0.13333333333333333 0.000 0.737 0.000 991 0.2 0.000 0.947 0.000 992 0.26666666666666666 0.316 1.000 0.316 993 0.3333333333333333 0.526 1.000 0.526 994 0.4 0.737 1.000 0.737 995 0.4666666666666667 1.000 1.000 1.000 996 0.5333333333333333 1.000 0.947 1.000 997 0.6 1.000 0.737 1.000 998 0.6666666666666666 1.000 0.526 1.000 999 0.7333333333333333 1.000 0.316 1.000 1000 0.8 0.947 0.000 0.947 1001 0.8666666666666667 0.737 0.000 0.737 1002 0.9333333333333333 0.526 0.000 0.526 1003 1.0 0.316 0.000 0.316 1004 } 1005 } 1006 "greyscale" { 1007 return { 1008 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1009 } 1010 } 1011 "nanohub" { 1012 set clist "white yellow green cyan blue magenta" 1013 } 1014 default { 1015 set clist [split $colors ":"] 1016 } 1017 } 1018 set cmap {} 1019 if { [llength $clist] == 1 } { 1020 set rgb [Color2RGB $clist] 1021 append cmap "0.0 $rgb 1.0 $rgb" 1022 } else { 1023 for {set i 0} {$i < [llength $clist]} {incr i} { 1024 set x [expr {double($i)/([llength $clist]-1)}] 1025 set color [lindex $clist $i] 1026 append cmap "$x [Color2RGB $color] " 1027 } 1028 } 1029 return $cmap 1030 } -
trunk/gui/scripts/vtkheightmapviewer.tcl
r3355 r3371 92 92 private method BuildContourTab {} 93 93 private method BuildDownloadPopup { widget command } 94 private method ColorsToColormap { color }95 94 private method Combo { option } 96 95 private method ConvertToVtkData { dataobj comp } … … 1671 1670 } 1672 1671 1673 itcl::body Rappture::VtkHeightmapViewer::ColorsToColormap { colors } {1674 switch -- $colors {1675 "grey-to-blue" {1676 return {1677 0.0 0.200 0.200 0.2001678 0.14285714285714285 0.400 0.400 0.4001679 0.2857142857142857 0.600 0.600 0.6001680 0.42857142857142855 0.900 0.900 0.9001681 0.5714285714285714 0.800 1.000 1.0001682 0.7142857142857143 0.600 1.000 1.0001683 0.8571428571428571 0.400 0.900 1.0001684 1.0 0.000 0.600 0.8001685 }1686 }1687 "blue-to-grey" {1688 return {1689 0.0 0.000 0.600 0.8001690 0.14285714285714285 0.400 0.900 1.0001691 0.2857142857142857 0.600 1.000 1.0001692 0.42857142857142855 0.800 1.000 1.0001693 0.5714285714285714 0.900 0.900 0.9001694 0.7142857142857143 0.600 0.600 0.6001695 0.8571428571428571 0.400 0.400 0.4001696 1.0 0.200 0.200 0.2001697 }1698 }1699 "blue" {1700 return {1701 0.0 0.900 1.000 1.0001702 0.1111111111111111 0.800 0.983 1.0001703 0.2222222222222222 0.700 0.950 1.0001704 0.3333333333333333 0.600 0.900 1.0001705 0.4444444444444444 0.500 0.833 1.0001706 0.5555555555555556 0.400 0.750 1.0001707 0.6666666666666666 0.300 0.650 1.0001708 0.7777777777777778 0.200 0.533 1.0001709 0.8888888888888888 0.100 0.400 1.0001710 1.0 0.000 0.250 1.0001711 }1712 }1713 "brown-to-blue" {1714 return {1715 0.0 0.200 0.100 0.0001716 0.09090909090909091 0.400 0.187 0.0001717 0.18181818181818182 0.600 0.379 0.2101718 0.2727272727272727 0.800 0.608 0.4801719 0.36363636363636365 0.850 0.688 0.5951720 0.45454545454545453 0.950 0.855 0.8081721 0.5454545454545454 0.800 0.993 1.0001722 0.6363636363636364 0.600 0.973 1.0001723 0.7272727272727273 0.400 0.940 1.0001724 0.8181818181818182 0.200 0.893 1.0001725 0.9090909090909091 0.000 0.667 0.8001726 1.0 0.000 0.480 0.6001727 }1728 }1729 "blue-to-brown" {1730 return {1731 0.0 0.000 0.480 0.6001732 0.09090909090909091 0.000 0.667 0.8001733 0.18181818181818182 0.200 0.893 1.0001734 0.2727272727272727 0.400 0.940 1.0001735 0.36363636363636365 0.600 0.973 1.0001736 0.45454545454545453 0.800 0.993 1.0001737 0.5454545454545454 0.950 0.855 0.8081738 0.6363636363636364 0.850 0.688 0.5951739 0.7272727272727273 0.800 0.608 0.4801740 0.8181818181818182 0.600 0.379 0.2101741 0.9090909090909091 0.400 0.187 0.0001742 1.0 0.200 0.100 0.0001743 }1744 }1745 "blue-to-orange" {1746 return {1747 0.0 0.000 0.167 1.0001748 0.09090909090909091 0.100 0.400 1.0001749 0.18181818181818182 0.200 0.600 1.0001750 0.2727272727272727 0.400 0.800 1.0001751 0.36363636363636365 0.600 0.933 1.0001752 0.45454545454545453 0.800 1.000 1.0001753 0.5454545454545454 1.000 1.000 0.8001754 0.6363636363636364 1.000 0.933 0.6001755 0.7272727272727273 1.000 0.800 0.4001756 0.8181818181818182 1.000 0.600 0.2001757 0.9090909090909091 1.000 0.400 0.1001758 1.0 1.000 0.167 0.0001759 }1760 }1761 "orange-to-blue" {1762 return {1763 0.0 1.000 0.167 0.0001764 0.09090909090909091 1.000 0.400 0.1001765 0.18181818181818182 1.000 0.600 0.2001766 0.2727272727272727 1.000 0.800 0.4001767 0.36363636363636365 1.000 0.933 0.6001768 0.45454545454545453 1.000 1.000 0.8001769 0.5454545454545454 0.800 1.000 1.0001770 0.6363636363636364 0.600 0.933 1.0001771 0.7272727272727273 0.400 0.800 1.0001772 0.8181818181818182 0.200 0.600 1.0001773 0.9090909090909091 0.100 0.400 1.0001774 1.0 0.000 0.167 1.0001775 }1776 }1777 "rainbow" {1778 set clist {1779 "#EE82EE"1780 "#4B0082"1781 "blue"1782 "#008000"1783 "yellow"1784 "#FFA500"1785 "red"1786 }1787 }1788 "BGYOR" {1789 set clist {1790 "blue"1791 "#008000"1792 "yellow"1793 "#FFA500"1794 "red"1795 }1796 }1797 "ROYGB" {1798 set clist {1799 "red"1800 "#FFA500"1801 "yellow"1802 "#008000"1803 "blue"1804 }1805 }1806 "RYGCB" {1807 set clist {1808 "red"1809 "yellow"1810 "green"1811 "cyan"1812 "blue"1813 }1814 }1815 "BCGYR" {1816 set clist {1817 "blue"1818 "cyan"1819 "green"1820 "yellow"1821 "red"1822 }1823 }1824 "spectral" {1825 return {1826 0.0 0.150 0.300 1.0001827 0.1 0.250 0.630 1.0001828 0.2 0.450 0.850 1.0001829 0.3 0.670 0.970 1.0001830 0.4 0.880 1.000 1.0001831 0.5 1.000 1.000 0.7501832 0.6 1.000 0.880 0.6001833 0.7 1.000 0.680 0.4501834 0.8 0.970 0.430 0.3701835 0.9 0.850 0.150 0.1961836 1.0 0.650 0.000 0.1301837 }1838 }1839 "green-to-magenta" {1840 return {1841 0.0 0.000 0.316 0.0001842 0.06666666666666667 0.000 0.526 0.0001843 0.13333333333333333 0.000 0.737 0.0001844 0.2 0.000 0.947 0.0001845 0.26666666666666666 0.316 1.000 0.3161846 0.3333333333333333 0.526 1.000 0.5261847 0.4 0.737 1.000 0.7371848 0.4666666666666667 1.000 1.000 1.0001849 0.5333333333333333 1.000 0.947 1.0001850 0.6 1.000 0.737 1.0001851 0.6666666666666666 1.000 0.526 1.0001852 0.7333333333333333 1.000 0.316 1.0001853 0.8 0.947 0.000 0.9471854 0.8666666666666667 0.737 0.000 0.7371855 0.9333333333333333 0.526 0.000 0.5261856 1.0 0.316 0.000 0.3161857 }1858 }1859 "greyscale" {1860 return {1861 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.01862 }1863 }1864 "nanohub" {1865 set clist "white yellow green cyan blue magenta"1866 }1867 default {1868 set clist $colors1869 }1870 }1871 set cmap {}1872 for {set i 0} {$i < [llength $clist]} {incr i} {1873 set x [expr {double($i)/([llength $clist]-1)}]1874 set color [lindex $clist $i]1875 append cmap "$x [Color2RGB $color] "1876 }1877 return $cmap1878 }1879 1672 1880 1673 # -
trunk/gui/scripts/vtkisosurfaceviewer.tcl
r3358 r3371 104 104 private method PanCamera {} 105 105 private method RequestLegend {} 106 private method ColorsToColormap { color }107 106 private method SetLegendTip { x y } 108 107 private method SetObjectStyle { dataobj comp } … … 1547 1546 } 1548 1547 1549 itcl::body Rappture::VtkIsosurfaceViewer::ColorsToColormap { colors } {1550 switch -- $colors {1551 "grey-to-blue" {1552 return {1553 0.0 0.200 0.200 0.2001554 0.14285714285714285 0.400 0.400 0.4001555 0.2857142857142857 0.600 0.600 0.6001556 0.42857142857142855 0.900 0.900 0.9001557 0.5714285714285714 0.800 1.000 1.0001558 0.7142857142857143 0.600 1.000 1.0001559 0.8571428571428571 0.400 0.900 1.0001560 1.0 0.000 0.600 0.8001561 }1562 }1563 "blue-to-grey" {1564 return {1565 0.0 0.000 0.600 0.8001566 0.14285714285714285 0.400 0.900 1.0001567 0.2857142857142857 0.600 1.000 1.0001568 0.42857142857142855 0.800 1.000 1.0001569 0.5714285714285714 0.900 0.900 0.9001570 0.7142857142857143 0.600 0.600 0.6001571 0.8571428571428571 0.400 0.400 0.4001572 1.0 0.200 0.200 0.2001573 }1574 }1575 "blue" {1576 return {1577 0.0 0.900 1.000 1.0001578 0.1111111111111111 0.800 0.983 1.0001579 0.2222222222222222 0.700 0.950 1.0001580 0.3333333333333333 0.600 0.900 1.0001581 0.4444444444444444 0.500 0.833 1.0001582 0.5555555555555556 0.400 0.750 1.0001583 0.6666666666666666 0.300 0.650 1.0001584 0.7777777777777778 0.200 0.533 1.0001585 0.8888888888888888 0.100 0.400 1.0001586 1.0 0.000 0.250 1.0001587 }1588 }1589 "brown-to-blue" {1590 return {1591 0.0 0.200 0.100 0.0001592 0.09090909090909091 0.400 0.187 0.0001593 0.18181818181818182 0.600 0.379 0.2101594 0.2727272727272727 0.800 0.608 0.4801595 0.36363636363636365 0.850 0.688 0.5951596 0.45454545454545453 0.950 0.855 0.8081597 0.5454545454545454 0.800 0.993 1.0001598 0.6363636363636364 0.600 0.973 1.0001599 0.7272727272727273 0.400 0.940 1.0001600 0.8181818181818182 0.200 0.893 1.0001601 0.9090909090909091 0.000 0.667 0.8001602 1.0 0.000 0.480 0.6001603 }1604 }1605 "blue-to-brown" {1606 return {1607 0.0 0.000 0.480 0.6001608 0.09090909090909091 0.000 0.667 0.8001609 0.18181818181818182 0.200 0.893 1.0001610 0.2727272727272727 0.400 0.940 1.0001611 0.36363636363636365 0.600 0.973 1.0001612 0.45454545454545453 0.800 0.993 1.0001613 0.5454545454545454 0.950 0.855 0.8081614 0.6363636363636364 0.850 0.688 0.5951615 0.7272727272727273 0.800 0.608 0.4801616 0.8181818181818182 0.600 0.379 0.2101617 0.9090909090909091 0.400 0.187 0.0001618 1.0 0.200 0.100 0.0001619 }1620 }1621 "blue-to-orange" {1622 return {1623 0.0 0.000 0.167 1.0001624 0.09090909090909091 0.100 0.400 1.0001625 0.18181818181818182 0.200 0.600 1.0001626 0.2727272727272727 0.400 0.800 1.0001627 0.36363636363636365 0.600 0.933 1.0001628 0.45454545454545453 0.800 1.000 1.0001629 0.5454545454545454 1.000 1.000 0.8001630 0.6363636363636364 1.000 0.933 0.6001631 0.7272727272727273 1.000 0.800 0.4001632 0.8181818181818182 1.000 0.600 0.2001633 0.9090909090909091 1.000 0.400 0.1001634 1.0 1.000 0.167 0.0001635 }1636 }1637 "orange-to-blue" {1638 return {1639 0.0 1.000 0.167 0.0001640 0.09090909090909091 1.000 0.400 0.1001641 0.18181818181818182 1.000 0.600 0.2001642 0.2727272727272727 1.000 0.800 0.4001643 0.36363636363636365 1.000 0.933 0.6001644 0.45454545454545453 1.000 1.000 0.8001645 0.5454545454545454 0.800 1.000 1.0001646 0.6363636363636364 0.600 0.933 1.0001647 0.7272727272727273 0.400 0.800 1.0001648 0.8181818181818182 0.200 0.600 1.0001649 0.9090909090909091 0.100 0.400 1.0001650 1.0 0.000 0.167 1.0001651 }1652 }1653 "rainbow" {1654 set clist {1655 "#EE82EE"1656 "#4B0082"1657 "blue"1658 "#008000"1659 "yellow"1660 "#FFA500"1661 "red"1662 }1663 }1664 "BGYOR" {1665 set clist {1666 "blue"1667 "#008000"1668 "yellow"1669 "#FFA500"1670 "red"1671 }1672 }1673 "ROYGB" {1674 set clist {1675 "red"1676 "#FFA500"1677 "yellow"1678 "#008000"1679 "blue"1680 }1681 }1682 "RYGCB" {1683 set clist {1684 "red"1685 "yellow"1686 "green"1687 "cyan"1688 "blue"1689 }1690 }1691 "BCGYR" {1692 set clist {1693 "blue"1694 "cyan"1695 "green"1696 "yellow"1697 "red"1698 }1699 }1700 "spectral" {1701 return {1702 0.0 0.150 0.300 1.0001703 0.1 0.250 0.630 1.0001704 0.2 0.450 0.850 1.0001705 0.3 0.670 0.970 1.0001706 0.4 0.880 1.000 1.0001707 0.5 1.000 1.000 0.7501708 0.6 1.000 0.880 0.6001709 0.7 1.000 0.680 0.4501710 0.8 0.970 0.430 0.3701711 0.9 0.850 0.150 0.1961712 1.0 0.650 0.000 0.1301713 }1714 }1715 "green-to-magenta" {1716 return {1717 0.0 0.000 0.316 0.0001718 0.06666666666666667 0.000 0.526 0.0001719 0.13333333333333333 0.000 0.737 0.0001720 0.2 0.000 0.947 0.0001721 0.26666666666666666 0.316 1.000 0.3161722 0.3333333333333333 0.526 1.000 0.5261723 0.4 0.737 1.000 0.7371724 0.4666666666666667 1.000 1.000 1.0001725 0.5333333333333333 1.000 0.947 1.0001726 0.6 1.000 0.737 1.0001727 0.6666666666666666 1.000 0.526 1.0001728 0.7333333333333333 1.000 0.316 1.0001729 0.8 0.947 0.000 0.9471730 0.8666666666666667 0.737 0.000 0.7371731 0.9333333333333333 0.526 0.000 0.5261732 1.0 0.316 0.000 0.3161733 }1734 }1735 "greyscale" {1736 return {1737 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.01738 }1739 }1740 "nanohub" {1741 set clist "white yellow green cyan blue magenta"1742 }1743 default {1744 set clist $colors1745 }1746 }1747 set cmap {}1748 for {set i 0} {$i < [llength $clist]} {incr i} {1749 set x [expr {double($i)/([llength $clist]-1)}]1750 set color [lindex $clist $i]1751 append cmap "$x [Color2RGB $color] "1752 }1753 return $cmap1754 }1755 1756 1548 # 1757 1549 # BuildColormap -- … … 1759 1551 itcl::body Rappture::VtkIsosurfaceViewer::BuildColormap { name stylelist } { 1760 1552 array set style $stylelist 1761 parray style1762 1553 set cmap [ColorsToColormap $style(-color)] 1763 1554 if { [llength $cmap] == 0 } { … … 2735 2526 } 2736 2527 2737 itcl::body Rappture::VtkIsosurfaceViewer::ColorsToColormap { colors } {2738 switch -- $colors {2739 "grey-to-blue" {2740 return {2741 0.0 0.200 0.200 0.2002742 0.14285714285714285 0.400 0.400 0.4002743 0.2857142857142857 0.600 0.600 0.6002744 0.42857142857142855 0.900 0.900 0.9002745 0.5714285714285714 0.800 1.000 1.0002746 0.7142857142857143 0.600 1.000 1.0002747 0.8571428571428571 0.400 0.900 1.0002748 1.0 0.000 0.600 0.8002749 }2750 }2751 "blue-to-grey" {2752 return {2753 0.0 0.000 0.600 0.8002754 0.14285714285714285 0.400 0.900 1.0002755 0.2857142857142857 0.600 1.000 1.0002756 0.42857142857142855 0.800 1.000 1.0002757 0.5714285714285714 0.900 0.900 0.9002758 0.7142857142857143 0.600 0.600 0.6002759 0.8571428571428571 0.400 0.400 0.4002760 1.0 0.200 0.200 0.2002761 }2762 }2763 "blue" {2764 return {2765 0.0 0.900 1.000 1.0002766 0.1111111111111111 0.800 0.983 1.0002767 0.2222222222222222 0.700 0.950 1.0002768 0.3333333333333333 0.600 0.900 1.0002769 0.4444444444444444 0.500 0.833 1.0002770 0.5555555555555556 0.400 0.750 1.0002771 0.6666666666666666 0.300 0.650 1.0002772 0.7777777777777778 0.200 0.533 1.0002773 0.8888888888888888 0.100 0.400 1.0002774 1.0 0.000 0.250 1.0002775 }2776 }2777 "brown-to-blue" {2778 return {2779 0.0 0.200 0.100 0.0002780 0.09090909090909091 0.400 0.187 0.0002781 0.18181818181818182 0.600 0.379 0.2102782 0.2727272727272727 0.800 0.608 0.4802783 0.36363636363636365 0.850 0.688 0.5952784 0.45454545454545453 0.950 0.855 0.8082785 0.5454545454545454 0.800 0.993 1.0002786 0.6363636363636364 0.600 0.973 1.0002787 0.7272727272727273 0.400 0.940 1.0002788 0.8181818181818182 0.200 0.893 1.0002789 0.9090909090909091 0.000 0.667 0.8002790 1.0 0.000 0.480 0.6002791 }2792 }2793 "blue-to-brown" {2794 return {2795 0.0 0.000 0.480 0.6002796 0.09090909090909091 0.000 0.667 0.8002797 0.18181818181818182 0.200 0.893 1.0002798 0.2727272727272727 0.400 0.940 1.0002799 0.36363636363636365 0.600 0.973 1.0002800 0.45454545454545453 0.800 0.993 1.0002801 0.5454545454545454 0.950 0.855 0.8082802 0.6363636363636364 0.850 0.688 0.5952803 0.7272727272727273 0.800 0.608 0.4802804 0.8181818181818182 0.600 0.379 0.2102805 0.9090909090909091 0.400 0.187 0.0002806 1.0 0.200 0.100 0.0002807 }2808 }2809 "blue-to-orange" {2810 return {2811 0.0 0.000 0.167 1.0002812 0.09090909090909091 0.100 0.400 1.0002813 0.18181818181818182 0.200 0.600 1.0002814 0.2727272727272727 0.400 0.800 1.0002815 0.36363636363636365 0.600 0.933 1.0002816 0.45454545454545453 0.800 1.000 1.0002817 0.5454545454545454 1.000 1.000 0.8002818 0.6363636363636364 1.000 0.933 0.6002819 0.7272727272727273 1.000 0.800 0.4002820 0.8181818181818182 1.000 0.600 0.2002821 0.9090909090909091 1.000 0.400 0.1002822 1.0 1.000 0.167 0.0002823 }2824 }2825 "orange-to-blue" {2826 return {2827 0.0 1.000 0.167 0.0002828 0.09090909090909091 1.000 0.400 0.1002829 0.18181818181818182 1.000 0.600 0.2002830 0.2727272727272727 1.000 0.800 0.4002831 0.36363636363636365 1.000 0.933 0.6002832 0.45454545454545453 1.000 1.000 0.8002833 0.5454545454545454 0.800 1.000 1.0002834 0.6363636363636364 0.600 0.933 1.0002835 0.7272727272727273 0.400 0.800 1.0002836 0.8181818181818182 0.200 0.600 1.0002837 0.9090909090909091 0.100 0.400 1.0002838 1.0 0.000 0.167 1.0002839 }2840 }2841 "rainbow" {2842 set clist {2843 "#EE82EE"2844 "#4B0082"2845 "blue"2846 "#008000"2847 "yellow"2848 "#FFA500"2849 "red"2850 }2851 }2852 "BGYOR" {2853 set clist {2854 "blue"2855 "#008000"2856 "yellow"2857 "#FFA500"2858 "red"2859 }2860 }2861 "ROYGB" {2862 set clist {2863 "red"2864 "#FFA500"2865 "yellow"2866 "#008000"2867 "blue"2868 }2869 }2870 "RYGCB" {2871 set clist {2872 "red"2873 "yellow"2874 "green"2875 "cyan"2876 "blue"2877 }2878 }2879 "BCGYR" {2880 set clist {2881 "blue"2882 "cyan"2883 "green"2884 "yellow"2885 "red"2886 }2887 }2888 "spectral" {2889 return {2890 0.0 0.150 0.300 1.0002891 0.1 0.250 0.630 1.0002892 0.2 0.450 0.850 1.0002893 0.3 0.670 0.970 1.0002894 0.4 0.880 1.000 1.0002895 0.5 1.000 1.000 0.7502896 0.6 1.000 0.880 0.6002897 0.7 1.000 0.680 0.4502898 0.8 0.970 0.430 0.3702899 0.9 0.850 0.150 0.1962900 1.0 0.650 0.000 0.1302901 }2902 }2903 "green-to-magenta" {2904 return {2905 0.0 0.000 0.316 0.0002906 0.06666666666666667 0.000 0.526 0.0002907 0.13333333333333333 0.000 0.737 0.0002908 0.2 0.000 0.947 0.0002909 0.26666666666666666 0.316 1.000 0.3162910 0.3333333333333333 0.526 1.000 0.5262911 0.4 0.737 1.000 0.7372912 0.4666666666666667 1.000 1.000 1.0002913 0.5333333333333333 1.000 0.947 1.0002914 0.6 1.000 0.737 1.0002915 0.6666666666666666 1.000 0.526 1.0002916 0.7333333333333333 1.000 0.316 1.0002917 0.8 0.947 0.000 0.9472918 0.8666666666666667 0.737 0.000 0.7372919 0.9333333333333333 0.526 0.000 0.5262920 1.0 0.316 0.000 0.3162921 }2922 }2923 "greyscale" {2924 return {2925 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.02926 }2927 }2928 "nanohub" {2929 set clist "white yellow green cyan blue magenta"2930 }2931 default {2932 set clist $colors2933 }2934 }2935 set cmap {}2936 for {set i 0} {$i < [llength $clist]} {incr i} {2937 set x [expr {double($i)/([llength $clist]-1)}]2938 set color [lindex $clist $i]2939 append cmap "$x [Color2RGB $color] "2940 }2941 return $cmap2942 }2943 2944 2528 # 2945 2529 # BuildColormap -- -
trunk/gui/scripts/vtkstreamlinesviewer.tcl
r3330 r3371 108 108 private method SetColormap { dataobj comp } 109 109 private method ChangeColormap { dataobj comp color } 110 private method ColorsToColormap { color }111 110 private method SetLegendTip { x y } 112 111 private method SetObjectStyle { dataobj comp } … … 1670 1669 } 1671 1670 1672 itcl::body Rappture::VtkStreamlinesViewer::ColorsToColormap { colors } {1673 switch -- $colors {1674 "grey-to-blue" {1675 return {1676 0.0 0.200 0.200 0.2001677 0.14285714285714285 0.400 0.400 0.4001678 0.2857142857142857 0.600 0.600 0.6001679 0.42857142857142855 0.900 0.900 0.9001680 0.5714285714285714 0.800 1.000 1.0001681 0.7142857142857143 0.600 1.000 1.0001682 0.8571428571428571 0.400 0.900 1.0001683 1.0 0.000 0.600 0.8001684 }1685 }1686 "blue-to-grey" {1687 return {1688 0.0 0.000 0.600 0.8001689 0.14285714285714285 0.400 0.900 1.0001690 0.2857142857142857 0.600 1.000 1.0001691 0.42857142857142855 0.800 1.000 1.0001692 0.5714285714285714 0.900 0.900 0.9001693 0.7142857142857143 0.600 0.600 0.6001694 0.8571428571428571 0.400 0.400 0.4001695 1.0 0.200 0.200 0.2001696 }1697 }1698 "blue" {1699 return {1700 0.0 0.900 1.000 1.0001701 0.1111111111111111 0.800 0.983 1.0001702 0.2222222222222222 0.700 0.950 1.0001703 0.3333333333333333 0.600 0.900 1.0001704 0.4444444444444444 0.500 0.833 1.0001705 0.5555555555555556 0.400 0.750 1.0001706 0.6666666666666666 0.300 0.650 1.0001707 0.7777777777777778 0.200 0.533 1.0001708 0.8888888888888888 0.100 0.400 1.0001709 1.0 0.000 0.250 1.0001710 }1711 }1712 "brown-to-blue" {1713 return {1714 0.0 0.200 0.100 0.0001715 0.09090909090909091 0.400 0.187 0.0001716 0.18181818181818182 0.600 0.379 0.2101717 0.2727272727272727 0.800 0.608 0.4801718 0.36363636363636365 0.850 0.688 0.5951719 0.45454545454545453 0.950 0.855 0.8081720 0.5454545454545454 0.800 0.993 1.0001721 0.6363636363636364 0.600 0.973 1.0001722 0.7272727272727273 0.400 0.940 1.0001723 0.8181818181818182 0.200 0.893 1.0001724 0.9090909090909091 0.000 0.667 0.8001725 1.0 0.000 0.480 0.6001726 }1727 }1728 "blue-to-brown" {1729 return {1730 0.0 0.000 0.480 0.6001731 0.09090909090909091 0.000 0.667 0.8001732 0.18181818181818182 0.200 0.893 1.0001733 0.2727272727272727 0.400 0.940 1.0001734 0.36363636363636365 0.600 0.973 1.0001735 0.45454545454545453 0.800 0.993 1.0001736 0.5454545454545454 0.950 0.855 0.8081737 0.6363636363636364 0.850 0.688 0.5951738 0.7272727272727273 0.800 0.608 0.4801739 0.8181818181818182 0.600 0.379 0.2101740 0.9090909090909091 0.400 0.187 0.0001741 1.0 0.200 0.100 0.0001742 }1743 }1744 "blue-to-orange" {1745 return {1746 0.0 0.000 0.167 1.0001747 0.09090909090909091 0.100 0.400 1.0001748 0.18181818181818182 0.200 0.600 1.0001749 0.2727272727272727 0.400 0.800 1.0001750 0.36363636363636365 0.600 0.933 1.0001751 0.45454545454545453 0.800 1.000 1.0001752 0.5454545454545454 1.000 1.000 0.8001753 0.6363636363636364 1.000 0.933 0.6001754 0.7272727272727273 1.000 0.800 0.4001755 0.8181818181818182 1.000 0.600 0.2001756 0.9090909090909091 1.000 0.400 0.1001757 1.0 1.000 0.167 0.0001758 }1759 }1760 "orange-to-blue" {1761 return {1762 0.0 1.000 0.167 0.0001763 0.09090909090909091 1.000 0.400 0.1001764 0.18181818181818182 1.000 0.600 0.2001765 0.2727272727272727 1.000 0.800 0.4001766 0.36363636363636365 1.000 0.933 0.6001767 0.45454545454545453 1.000 1.000 0.8001768 0.5454545454545454 0.800 1.000 1.0001769 0.6363636363636364 0.600 0.933 1.0001770 0.7272727272727273 0.400 0.800 1.0001771 0.8181818181818182 0.200 0.600 1.0001772 0.9090909090909091 0.100 0.400 1.0001773 1.0 0.000 0.167 1.0001774 }1775 }1776 "rainbow" {1777 set clist {1778 "#EE82EE"1779 "#4B0082"1780 "blue"1781 "#008000"1782 "yellow"1783 "#FFA500"1784 "red"1785 }1786 }1787 "BGYOR" {1788 set clist {1789 "blue"1790 "#008000"1791 "yellow"1792 "#FFA500"1793 "red"1794 }1795 }1796 "ROYGB" {1797 set clist {1798 "red"1799 "#FFA500"1800 "yellow"1801 "#008000"1802 "blue"1803 }1804 }1805 "RYGCB" {1806 set clist {1807 "red"1808 "yellow"1809 "green"1810 "cyan"1811 "blue"1812 }1813 }1814 "BCGYR" {1815 set clist {1816 "blue"1817 "cyan"1818 "green"1819 "yellow"1820 "red"1821 }1822 }1823 "spectral" {1824 return {1825 0.0 0.150 0.300 1.0001826 0.1 0.250 0.630 1.0001827 0.2 0.450 0.850 1.0001828 0.3 0.670 0.970 1.0001829 0.4 0.880 1.000 1.0001830 0.5 1.000 1.000 0.7501831 0.6 1.000 0.880 0.6001832 0.7 1.000 0.680 0.4501833 0.8 0.970 0.430 0.3701834 0.9 0.850 0.150 0.1961835 1.0 0.650 0.000 0.1301836 }1837 }1838 "green-to-magenta" {1839 return {1840 0.0 0.000 0.316 0.0001841 0.06666666666666667 0.000 0.526 0.0001842 0.13333333333333333 0.000 0.737 0.0001843 0.2 0.000 0.947 0.0001844 0.26666666666666666 0.316 1.000 0.3161845 0.3333333333333333 0.526 1.000 0.5261846 0.4 0.737 1.000 0.7371847 0.4666666666666667 1.000 1.000 1.0001848 0.5333333333333333 1.000 0.947 1.0001849 0.6 1.000 0.737 1.0001850 0.6666666666666666 1.000 0.526 1.0001851 0.7333333333333333 1.000 0.316 1.0001852 0.8 0.947 0.000 0.9471853 0.8666666666666667 0.737 0.000 0.7371854 0.9333333333333333 0.526 0.000 0.5261855 1.0 0.316 0.000 0.3161856 }1857 }1858 "greyscale" {1859 return {1860 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.01861 }1862 }1863 "nanohub" {1864 set clist "white yellow green cyan blue magenta"1865 }1866 default {1867 set clist $colors1868 }1869 }1870 set cmap {}1871 for {set i 0} {$i < [llength $clist]} {incr i} {1872 set x [expr {double($i)/([llength $clist]-1)}]1873 set color [lindex $clist $i]1874 append cmap "$x [Color2RGB $color] "1875 }1876 return $cmap1877 }1878 1671 1879 1672 # -
trunk/gui/scripts/vtkviewer.tcl
r3330 r3371 104 104 private method SetColormap { dataobj comp } 105 105 private method ChangeColormap { dataobj comp color } 106 private method ColorsToColormap { color }107 106 private method SetLegendTip { x y } 108 107 private method SetObjectStyle { dataobj comp } … … 1575 1574 } 1576 1575 1577 itcl::body Rappture::VtkViewer::ColorsToColormap { colors } {1578 switch -- $colors {1579 "grey-to-blue" {1580 return {1581 0.0 0.200 0.200 0.2001582 0.14285714285714285 0.400 0.400 0.4001583 0.2857142857142857 0.600 0.600 0.6001584 0.42857142857142855 0.900 0.900 0.9001585 0.5714285714285714 0.800 1.000 1.0001586 0.7142857142857143 0.600 1.000 1.0001587 0.8571428571428571 0.400 0.900 1.0001588 1.0 0.000 0.600 0.8001589 }1590 }1591 "blue-to-grey" {1592 return {1593 0.0 0.000 0.600 0.8001594 0.14285714285714285 0.400 0.900 1.0001595 0.2857142857142857 0.600 1.000 1.0001596 0.42857142857142855 0.800 1.000 1.0001597 0.5714285714285714 0.900 0.900 0.9001598 0.7142857142857143 0.600 0.600 0.6001599 0.8571428571428571 0.400 0.400 0.4001600 1.0 0.200 0.200 0.2001601 }1602 }1603 "blue" {1604 return {1605 0.0 0.900 1.000 1.0001606 0.1111111111111111 0.800 0.983 1.0001607 0.2222222222222222 0.700 0.950 1.0001608 0.3333333333333333 0.600 0.900 1.0001609 0.4444444444444444 0.500 0.833 1.0001610 0.5555555555555556 0.400 0.750 1.0001611 0.6666666666666666 0.300 0.650 1.0001612 0.7777777777777778 0.200 0.533 1.0001613 0.8888888888888888 0.100 0.400 1.0001614 1.0 0.000 0.250 1.0001615 }1616 }1617 "brown-to-blue" {1618 return {1619 0.0 0.200 0.100 0.0001620 0.09090909090909091 0.400 0.187 0.0001621 0.18181818181818182 0.600 0.379 0.2101622 0.2727272727272727 0.800 0.608 0.4801623 0.36363636363636365 0.850 0.688 0.5951624 0.45454545454545453 0.950 0.855 0.8081625 0.5454545454545454 0.800 0.993 1.0001626 0.6363636363636364 0.600 0.973 1.0001627 0.7272727272727273 0.400 0.940 1.0001628 0.8181818181818182 0.200 0.893 1.0001629 0.9090909090909091 0.000 0.667 0.8001630 1.0 0.000 0.480 0.6001631 }1632 }1633 "blue-to-brown" {1634 return {1635 0.0 0.000 0.480 0.6001636 0.09090909090909091 0.000 0.667 0.8001637 0.18181818181818182 0.200 0.893 1.0001638 0.2727272727272727 0.400 0.940 1.0001639 0.36363636363636365 0.600 0.973 1.0001640 0.45454545454545453 0.800 0.993 1.0001641 0.5454545454545454 0.950 0.855 0.8081642 0.6363636363636364 0.850 0.688 0.5951643 0.7272727272727273 0.800 0.608 0.4801644 0.8181818181818182 0.600 0.379 0.2101645 0.9090909090909091 0.400 0.187 0.0001646 1.0 0.200 0.100 0.0001647 }1648 }1649 "blue-to-orange" {1650 return {1651 0.0 0.000 0.167 1.0001652 0.09090909090909091 0.100 0.400 1.0001653 0.18181818181818182 0.200 0.600 1.0001654 0.2727272727272727 0.400 0.800 1.0001655 0.36363636363636365 0.600 0.933 1.0001656 0.45454545454545453 0.800 1.000 1.0001657 0.5454545454545454 1.000 1.000 0.8001658 0.6363636363636364 1.000 0.933 0.6001659 0.7272727272727273 1.000 0.800 0.4001660 0.8181818181818182 1.000 0.600 0.2001661 0.9090909090909091 1.000 0.400 0.1001662 1.0 1.000 0.167 0.0001663 }1664 }1665 "orange-to-blue" {1666 return {1667 0.0 1.000 0.167 0.0001668 0.09090909090909091 1.000 0.400 0.1001669 0.18181818181818182 1.000 0.600 0.2001670 0.2727272727272727 1.000 0.800 0.4001671 0.36363636363636365 1.000 0.933 0.6001672 0.45454545454545453 1.000 1.000 0.8001673 0.5454545454545454 0.800 1.000 1.0001674 0.6363636363636364 0.600 0.933 1.0001675 0.7272727272727273 0.400 0.800 1.0001676 0.8181818181818182 0.200 0.600 1.0001677 0.9090909090909091 0.100 0.400 1.0001678 1.0 0.000 0.167 1.0001679 }1680 }1681 "rainbow" {1682 set clist {1683 "#EE82EE"1684 "#4B0082"1685 "blue"1686 "#008000"1687 "yellow"1688 "#FFA500"1689 "red"1690 }1691 }1692 "BGYOR" {1693 set clist {1694 "blue"1695 "#008000"1696 "yellow"1697 "#FFA500"1698 "red"1699 }1700 }1701 "ROYGB" {1702 set clist {1703 "red"1704 "#FFA500"1705 "yellow"1706 "#008000"1707 "blue"1708 }1709 }1710 "RYGCB" {1711 set clist {1712 "red"1713 "yellow"1714 "green"1715 "cyan"1716 "blue"1717 }1718 }1719 "BCGYR" {1720 set clist {1721 "blue"1722 "cyan"1723 "green"1724 "yellow"1725 "red"1726 }1727 }1728 "spectral" {1729 return {1730 0.0 0.150 0.300 1.0001731 0.1 0.250 0.630 1.0001732 0.2 0.450 0.850 1.0001733 0.3 0.670 0.970 1.0001734 0.4 0.880 1.000 1.0001735 0.5 1.000 1.000 0.7501736 0.6 1.000 0.880 0.6001737 0.7 1.000 0.680 0.4501738 0.8 0.970 0.430 0.3701739 0.9 0.850 0.150 0.1961740 1.0 0.650 0.000 0.1301741 }1742 }1743 "green-to-magenta" {1744 return {1745 0.0 0.000 0.316 0.0001746 0.06666666666666667 0.000 0.526 0.0001747 0.13333333333333333 0.000 0.737 0.0001748 0.2 0.000 0.947 0.0001749 0.26666666666666666 0.316 1.000 0.3161750 0.3333333333333333 0.526 1.000 0.5261751 0.4 0.737 1.000 0.7371752 0.4666666666666667 1.000 1.000 1.0001753 0.5333333333333333 1.000 0.947 1.0001754 0.6 1.000 0.737 1.0001755 0.6666666666666666 1.000 0.526 1.0001756 0.7333333333333333 1.000 0.316 1.0001757 0.8 0.947 0.000 0.9471758 0.8666666666666667 0.737 0.000 0.7371759 0.9333333333333333 0.526 0.000 0.5261760 1.0 0.316 0.000 0.3161761 }1762 }1763 "greyscale" {1764 return {1765 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.01766 }1767 }1768 "nanohub" {1769 set clist "white yellow green cyan blue magenta"1770 }1771 default {1772 set clist $colors1773 }1774 }1775 set cmap {}1776 set numColors [llength $clist]1777 for {set i 0} {$i < $numColors} {incr i} {1778 if { $numColors > 1 } {1779 set x [expr {double($i)/($numColors-1)}]1780 } else {1781 set x [expr double($i)]1782 }1783 set color [lindex $clist $i]1784 append cmap "$x [Color2RGB $color] "1785 }1786 return $cmap1787 }1788 1789 1576 # 1790 1577 # BuildColormap -- -
trunk/gui/scripts/vtkvolumeviewer.tcl
r3330 r3371 108 108 private method SetColormap { dataobj comp } 109 109 private method ChangeColormap { dataobj comp color } 110 private method ColorsToColormap { color }111 110 private method SetLegendTip { x y } 112 111 private method SetObjectStyle { dataobj comp } … … 1598 1597 } 1599 1598 1600 itcl::body Rappture::VtkVolumeViewer::ColorsToColormap { colors } {1601 puts stderr colors=$colors1602 switch -- $colors {1603 "grey-to-blue" {1604 return {1605 0.0 0.200 0.200 0.2001606 0.14285714285714285 0.400 0.400 0.4001607 0.2857142857142857 0.600 0.600 0.6001608 0.42857142857142855 0.900 0.900 0.9001609 0.5714285714285714 0.800 1.000 1.0001610 0.7142857142857143 0.600 1.000 1.0001611 0.8571428571428571 0.400 0.900 1.0001612 1.0 0.000 0.600 0.8001613 }1614 }1615 "blue-to-grey" {1616 return {1617 0.0 0.000 0.600 0.8001618 0.14285714285714285 0.400 0.900 1.0001619 0.2857142857142857 0.600 1.000 1.0001620 0.42857142857142855 0.800 1.000 1.0001621 0.5714285714285714 0.900 0.900 0.9001622 0.7142857142857143 0.600 0.600 0.6001623 0.8571428571428571 0.400 0.400 0.4001624 1.0 0.200 0.200 0.2001625 }1626 }1627 "blue" {1628 return {1629 0.0 0.900 1.000 1.0001630 0.1111111111111111 0.800 0.983 1.0001631 0.2222222222222222 0.700 0.950 1.0001632 0.3333333333333333 0.600 0.900 1.0001633 0.4444444444444444 0.500 0.833 1.0001634 0.5555555555555556 0.400 0.750 1.0001635 0.6666666666666666 0.300 0.650 1.0001636 0.7777777777777778 0.200 0.533 1.0001637 0.8888888888888888 0.100 0.400 1.0001638 1.0 0.000 0.250 1.0001639 }1640 }1641 "brown-to-blue" {1642 return {1643 0.0 0.200 0.100 0.0001644 0.09090909090909091 0.400 0.187 0.0001645 0.18181818181818182 0.600 0.379 0.2101646 0.2727272727272727 0.800 0.608 0.4801647 0.36363636363636365 0.850 0.688 0.5951648 0.45454545454545453 0.950 0.855 0.8081649 0.5454545454545454 0.800 0.993 1.0001650 0.6363636363636364 0.600 0.973 1.0001651 0.7272727272727273 0.400 0.940 1.0001652 0.8181818181818182 0.200 0.893 1.0001653 0.9090909090909091 0.000 0.667 0.8001654 1.0 0.000 0.480 0.6001655 }1656 }1657 "blue-to-brown" {1658 return {1659 0.0 0.000 0.480 0.6001660 0.09090909090909091 0.000 0.667 0.8001661 0.18181818181818182 0.200 0.893 1.0001662 0.2727272727272727 0.400 0.940 1.0001663 0.36363636363636365 0.600 0.973 1.0001664 0.45454545454545453 0.800 0.993 1.0001665 0.5454545454545454 0.950 0.855 0.8081666 0.6363636363636364 0.850 0.688 0.5951667 0.7272727272727273 0.800 0.608 0.4801668 0.8181818181818182 0.600 0.379 0.2101669 0.9090909090909091 0.400 0.187 0.0001670 1.0 0.200 0.100 0.0001671 }1672 }1673 "blue-to-orange" {1674 return {1675 0.0 0.000 0.167 1.0001676 0.09090909090909091 0.100 0.400 1.0001677 0.18181818181818182 0.200 0.600 1.0001678 0.2727272727272727 0.400 0.800 1.0001679 0.36363636363636365 0.600 0.933 1.0001680 0.45454545454545453 0.800 1.000 1.0001681 0.5454545454545454 1.000 1.000 0.8001682 0.6363636363636364 1.000 0.933 0.6001683 0.7272727272727273 1.000 0.800 0.4001684 0.8181818181818182 1.000 0.600 0.2001685 0.9090909090909091 1.000 0.400 0.1001686 1.0 1.000 0.167 0.0001687 }1688 }1689 "orange-to-blue" {1690 return {1691 0.0 1.000 0.167 0.0001692 0.09090909090909091 1.000 0.400 0.1001693 0.18181818181818182 1.000 0.600 0.2001694 0.2727272727272727 1.000 0.800 0.4001695 0.36363636363636365 1.000 0.933 0.6001696 0.45454545454545453 1.000 1.000 0.8001697 0.5454545454545454 0.800 1.000 1.0001698 0.6363636363636364 0.600 0.933 1.0001699 0.7272727272727273 0.400 0.800 1.0001700 0.8181818181818182 0.200 0.600 1.0001701 0.9090909090909091 0.100 0.400 1.0001702 1.0 0.000 0.167 1.0001703 }1704 }1705 "rainbow" {1706 set clist {1707 "#EE82EE"1708 "#4B0082"1709 "blue"1710 "#008000"1711 "yellow"1712 "#FFA500"1713 "red"1714 }1715 }1716 "BGYOR" {1717 set clist {1718 "blue"1719 "#008000"1720 "yellow"1721 "#FFA500"1722 "red"1723 }1724 }1725 "ROYGB" {1726 set clist {1727 "red"1728 "#FFA500"1729 "yellow"1730 "#008000"1731 "blue"1732 }1733 }1734 "RYGCB" {1735 set clist {1736 "red"1737 "yellow"1738 "green"1739 "cyan"1740 "blue"1741 }1742 }1743 "BCGYR" {1744 set clist {1745 "blue"1746 "cyan"1747 "green"1748 "yellow"1749 "red"1750 }1751 }1752 "spectral" {1753 return {1754 0.0 0.150 0.300 1.0001755 0.1 0.250 0.630 1.0001756 0.2 0.450 0.850 1.0001757 0.3 0.670 0.970 1.0001758 0.4 0.880 1.000 1.0001759 0.5 1.000 1.000 0.7501760 0.6 1.000 0.880 0.6001761 0.7 1.000 0.680 0.4501762 0.8 0.970 0.430 0.3701763 0.9 0.850 0.150 0.1961764 1.0 0.650 0.000 0.1301765 }1766 }1767 "green-to-magenta" {1768 return {1769 0.0 0.000 0.316 0.0001770 0.06666666666666667 0.000 0.526 0.0001771 0.13333333333333333 0.000 0.737 0.0001772 0.2 0.000 0.947 0.0001773 0.26666666666666666 0.316 1.000 0.3161774 0.3333333333333333 0.526 1.000 0.5261775 0.4 0.737 1.000 0.7371776 0.4666666666666667 1.000 1.000 1.0001777 0.5333333333333333 1.000 0.947 1.0001778 0.6 1.000 0.737 1.0001779 0.6666666666666666 1.000 0.526 1.0001780 0.7333333333333333 1.000 0.316 1.0001781 0.8 0.947 0.000 0.9471782 0.8666666666666667 0.737 0.000 0.7371783 0.9333333333333333 0.526 0.000 0.5261784 1.0 0.316 0.000 0.3161785 }1786 }1787 "greyscale" {1788 return {1789 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.01790 }1791 }1792 "nanohub" {1793 set clist "white yellow green cyan blue magenta"1794 }1795 default {1796 set clist [split $colors :]1797 }1798 }1799 set cmap {}1800 set nColors [llength $clist]1801 if { $nColors == 1 } {1802 append cmap "0.0 [Color2RGB $colors] "1803 append cmap "1.0 [Color2RGB $colors] "1804 } else {1805 for {set i 0} {$i < [llength $clist]} {incr i} {1806 set x [expr {double($i)/([llength $clist]-1)}]1807 set color [lindex $clist $i]1808 append cmap "$x [Color2RGB $color] "1809 }1810 }1811 return $cmap1812 }1813 1814 1599 # 1815 1600 # BuildColormap --
Note: See TracChangeset
for help on using the changeset viewer.