Changeset 3004
- Timestamp:
- May 10, 2012, 8:46:29 AM (12 years ago)
- Location:
- branches/nanovis2/gui/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/nanovis2/gui/scripts/flowvisviewer.tcl
r2965 r3004 124 124 private method arrows { tag name } 125 125 126 private variable _arcball "" 127 private variable _useArcball 1 126 128 private variable _outbuf ;# buffer for outgoing commands 127 129 … … 222 224 # Initialize the view to some default parameters. 223 225 array set _view { 226 qw 0.853553 227 qx -0.353553 228 qy 0.353553 229 qz 0.146447 224 230 theta 45 225 231 phi 45 … … 229 235 pan-y 0 230 236 } 237 set _arcball [blt::arcball create 100 100] 238 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 239 $_arcball quaternion $q 240 231 241 set _limits(vmin) 0.0 232 242 set _limits(vmax) 1.0 233 243 234 244 array set _settings [subst { 245 $this-qw $_view(qw) 246 $this-qx $_view(qx) 247 $this-qy $_view(qy) 248 $this-qz $_view(qz) 249 $this-theta $_view(theta) 250 $this-phi $_view(phi) 251 $this-psi $_view(psi) 252 $this-zoom $_view(zoom) 253 $this-pan-x $_view(pan-x) 254 $this-pan-y $_view(pan-y) 235 255 $this-arrows 0 236 256 $this-currenttime 0 237 257 $this-duration 1:00 238 258 $this-loop 0 239 $this-pan-x $_view(pan-x)240 $this-pan-y $_view(pan-y)241 $this-phi $_view(phi)242 259 $this-play 0 243 $this-psi $_view(psi)244 260 $this-speed 500 245 261 $this-step 0 246 262 $this-streams 0 247 $this-theta $_view(theta)248 263 $this-volume 1 249 264 $this-xcutplane 0 … … 253 268 $this-zcutplane 0 254 269 $this-zcutposition 0 255 $this-zoom $_view(zoom)256 270 }] 257 271 … … 553 567 image delete $_image(legend) 554 568 image delete $_image(download) 569 catch { blt::arcball destroy $_arcball } 555 570 array unset _settings $this-* 556 571 } … … 1006 1021 } 1007 1022 1008 # Insure that the global opacity and thickness settings (in the slider1023 # Ensure that the global opacity and thickness settings (in the slider 1009 1024 # settings widgets) are used for the active transfer-function. Update the 1010 1025 # values in the _settings varible. … … 1180 1195 set w [winfo width $itk_component(3dview)] 1181 1196 set h [winfo height $itk_component(3dview)] 1197 $_arcball resize $w $h 1182 1198 EventuallyResize $w $h 1183 1199 … … 1229 1245 } 1230 1246 } 1247 set _settings($this-qw) $_view(qw) 1248 set _settings($this-qx) $_view(qx) 1249 set _settings($this-qy) $_view(qy) 1250 set _settings($this-qz) $_view(qz) 1231 1251 set _settings($this-theta) $_view(theta) 1232 1252 set _settings($this-phi) $_view(phi) … … 1236 1256 set _settings($this-zoom) $_view(zoom) 1237 1257 1238 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 1239 SendCmd "camera angle $xyz" 1258 if {$_useArcball} { 1259 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 1260 $_arcball quaternion $q 1261 SendCmd "camera orient $q" 1262 } else { 1263 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 1264 SendCmd "camera angle $xyz" 1265 } 1240 1266 PanCamera 1241 1267 SendCmd "camera zoom $_view(zoom)" … … 1329 1355 "reset" { 1330 1356 array set _view { 1357 qw 0.853553 1358 qx -0.353553 1359 qy 0.353553 1360 qz 0.146447 1331 1361 theta 45 1332 1362 phi 45 … … 1342 1372 } 1343 1373 } 1344 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 1345 SendCmd "camera angle $xyz" 1374 if {$_useArcball} { 1375 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 1376 $_arcball quaternion $q 1377 SendCmd "camera orient $q" 1378 } else { 1379 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 1380 SendCmd "camera angle $xyz" 1381 } 1346 1382 PanCamera 1383 set _settings($this-qw) $_view(qw) 1384 set _settings($this-qx) $_view(qx) 1385 set _settings($this-qy) $_view(qy) 1386 set _settings($this-qz) $_view(qz) 1347 1387 set _settings($this-theta) $_view(theta) 1348 1388 set _settings($this-phi) $_view(phi) … … 1399 1439 } 1400 1440 1401 # 1402 # Rotate the camera in 3D 1403 # 1404 if {$_view(psi) > 90 || $_view(psi) < -90} { 1405 # when psi is flipped around, theta moves backwards 1406 set dy [expr {-$dy}] 1441 if {$_useArcball} { 1442 set q [$_arcball rotate $x $y $_click(x) $_click(y)] 1443 foreach { _view(qw) _view(qx) _view(qy) _view(qz) } $q break 1444 SendCmd "camera orient $q" 1445 } else { 1446 # 1447 # Rotate the camera in 3D 1448 # 1449 if {$_view(psi) > 90 || $_view(psi) < -90} { 1450 # when psi is flipped around, theta moves backwards 1451 set dy [expr {-$dy}] 1452 } 1453 set theta [expr {$_view(theta) - $dy*180}] 1454 while {$theta < 0} { set theta [expr {$theta+180}] } 1455 while {$theta > 180} { set theta [expr {$theta-180}] } 1456 1457 if {abs($theta) >= 30 && abs($theta) <= 160} { 1458 set phi [expr {$_view(phi) - $dx*360}] 1459 while {$phi < 0} { set phi [expr {$phi+360}] } 1460 while {$phi > 360} { set phi [expr {$phi-360}] } 1461 set psi $_view(psi) 1462 } else { 1463 set phi $_view(phi) 1464 set psi [expr {$_view(psi) - $dx*360}] 1465 while {$psi < -180} { set psi [expr {$psi+360}] } 1466 while {$psi > 180} { set psi [expr {$psi-360}] } 1467 } 1468 1469 set _view(theta) $theta 1470 set _view(phi) $phi 1471 set _view(psi) $psi 1472 set xyz [Euler2XYZ $theta $phi $psi] 1473 set _settings($this-theta) $_view(theta) 1474 set _settings($this-phi) $_view(phi) 1475 set _settings($this-psi) $_view(psi) 1476 SendCmd "camera angle $xyz" 1407 1477 } 1408 set theta [expr {$_view(theta) - $dy*180}] 1409 while {$theta < 0} { set theta [expr {$theta+180}] } 1410 while {$theta > 180} { set theta [expr {$theta-180}] } 1411 1412 if {abs($theta) >= 30 && abs($theta) <= 160} { 1413 set phi [expr {$_view(phi) - $dx*360}] 1414 while {$phi < 0} { set phi [expr {$phi+360}] } 1415 while {$phi > 360} { set phi [expr {$phi-360}] } 1416 set psi $_view(psi) 1417 } else { 1418 set phi $_view(phi) 1419 set psi [expr {$_view(psi) - $dx*360}] 1420 while {$psi < -180} { set psi [expr {$psi+360}] } 1421 while {$psi > 180} { set psi [expr {$psi-360}] } 1422 } 1423 1424 set _view(theta) $theta 1425 set _view(phi) $phi 1426 set _view(psi) $psi 1427 set xyz [Euler2XYZ $theta $phi $psi] 1428 set _settings($this-theta) $_view(theta) 1429 set _settings($this-phi) $_view(phi) 1430 set _settings($this-psi) $_view(psi) 1431 SendCmd "camera angle $xyz" 1478 1432 1479 set _click(x) $x 1433 1480 set _click(y) $y … … 1602 1649 set tag $_first-$comp 1603 1650 set diffuse [expr {0.01*$_settings($this-light)}] 1604 set specular [expr {sqrt($_settings($this-light)+1.0)}] 1605 SendCmd "$tag configure -diffuse $diffuse -specular $specular" 1651 set ambient [expr {1.0 - $diffuse}] 1652 set specularLevel 0.3 1653 set specularExp 90.0 1654 SendCmd "$tag configure -ambient $ambient -diffuse $diffuse -specular {$specularLevel $specularExp}" 1606 1655 } 1607 1656 } … … 2072 2121 } 2073 2122 2074 2075 2076 2123 itcl::body Rappture::FlowvisViewer::BuildViewTab {} { 2077 2124 foreach { key value } { … … 2354 2401 $inner configure -borderwidth 4 2355 2402 2356 set labels { phi theta psi pan-x pan-y zoom } 2403 if {$_useArcball} { 2404 set labels { qw qx qy qz pan-x pan-y zoom } 2405 } else { 2406 set labels { phi theta psi pan-x pan-y zoom } 2407 } 2357 2408 set row 0 2358 2409 foreach tag $labels { … … 2536 2587 set _width $w 2537 2588 set _height $h 2589 $_arcball resize $w $h 2538 2590 if { !$_resizePending } { 2539 2591 $_dispatcher event -after 200 !resize … … 2580 2632 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 2581 2633 SendCmd "camera angle $xyz" 2634 if {$_useArcball} { 2635 $_arcball euler [list [expr {-[lindex $xyz 2]}] [expr {-[lindex $xyz 1]}] [expr {-[lindex $xyz 0]}]] 2636 set q [$_arcball quaternion] 2637 foreach { _view(qw) _view(qx) _view(qy) _view(qz) } $q break 2638 set _settings($this-qw) $_view(qw) 2639 set _settings($this-qx) $_view(qx) 2640 set _settings($this-qy) $_view(qy) 2641 set _settings($this-qz) $_view(qz) 2642 } 2643 } 2644 "qx" - "qy" - "qz" - "qw" { 2645 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 2646 $_arcball quaternion $q 2647 SendCmd "camera orient $q" 2582 2648 } 2583 2649 "zoom" { -
branches/nanovis2/gui/scripts/isomarker.tcl
r2744 r3004 115 115 array set limits [$_nvobj limits $_tf] 116 116 if { $limits(vmax) == $limits(vmin) } { 117 set limits( min) 0.0118 set limits( max) 1.0117 set limits(vmin) 0.0 118 set limits(vmax) 1.0 119 119 } 120 120 if { [catch {expr $limits(vmax) - $limits(vmin)} r] != 0 } { -
branches/nanovis2/gui/scripts/nanovisviewer.tcl
r2876 r3004 118 118 private method GetVolumeInfo { w } 119 119 120 private variable _arcball "" 121 private variable _useArcball 1 120 122 private variable _outbuf ;# buffer for outgoing commands 121 123 … … 195 197 # Initialize the view to some default parameters. 196 198 array set _view { 199 qw 0.853553 200 qx -0.353553 201 qy 0.353553 202 qz 0.146447 197 203 theta 45 198 204 phi 45 … … 202 208 pan-y 0 203 209 } 210 set _arcball [blt::arcball create 100 100] 211 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 212 $_arcball quaternion $q 213 204 214 set _limits(vmin) 0.0 205 215 set _limits(vmax) 1.0 206 216 207 217 array set _settings [subst { 218 $this-qw $_view(qw) 219 $this-qx $_view(qx) 220 $this-qy $_view(qy) 221 $this-qz $_view(qz) 222 $this-theta $_view(theta) 223 $this-phi $_view(phi) 224 $this-psi $_view(psi) 225 $this-zoom $_view(zoom) 208 226 $this-pan-x $_view(pan-x) 209 227 $this-pan-y $_view(pan-y) 210 $this-phi $_view(phi)211 $this-psi $_view(psi)212 $this-theta $_view(theta)213 228 $this-volume 1 214 229 $this-xcutplane 0 … … 218 233 $this-zcutplane 0 219 234 $this-zcutposition 0 220 $this-zoom $_view(zoom)221 235 }] 222 236 … … 373 387 image delete $_image(legend) 374 388 image delete $_image(download) 389 catch { blt::arcball destroy $_arcball } 375 390 array unset _settings $this-* 376 391 } … … 658 673 return 659 674 } 660 # Insure that the global opacity and thickness settings (in the slider675 # Ensure that the global opacity and thickness settings (in the slider 661 676 # settings widgets) are used for the active transfer-function. Update 662 677 # the values in the _settings varible. … … 669 684 # The volume hasn't reached the server yet. How did we get 670 685 # here? 686 puts stderr "Don't have $vol in _serverVols" 671 687 continue 672 688 } 673 689 if { ![info exists _vol2style($vol)] } { 674 puts stderr " unknownvolume $vol"690 puts stderr "Don't have style for volume $vol" 675 691 continue; # How does this happen? 676 692 } … … 812 828 return 813 829 } 830 831 puts stderr "Received volume info: '$args'" 832 814 833 # Arguments from server are name value pairs. Stuff them in an array. 815 834 array set info $args … … 865 884 set w [winfo width $itk_component(3dview)] 866 885 set h [winfo height $itk_component(3dview)] 886 $_arcball resize $w $h 867 887 EventuallyResize $w $h 868 888 … … 885 905 # Reset the camera and other view parameters 886 906 # 887 907 set _settings($this-qw) $_view(qw) 908 set _settings($this-qx) $_view(qx) 909 set _settings($this-qy) $_view(qy) 910 set _settings($this-qz) $_view(qz) 888 911 set _settings($this-theta) $_view(theta) 889 912 set _settings($this-phi) $_view(phi) … … 893 916 set _settings($this-zoom) $_view(zoom) 894 917 895 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 896 SendCmd "camera angle $xyz" 918 if {$_useArcball} { 919 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 920 $_arcball quaternion $q 921 SendCmd "camera orient $q" 922 } else { 923 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 924 SendCmd "camera angle $xyz" 925 } 926 897 927 PanCamera 898 928 SendCmd "camera zoom $_view(zoom)" … … 987 1017 "reset" { 988 1018 array set _view { 1019 qw 0.853553 1020 qx -0.353553 1021 qy 0.353553 1022 qz 0.146447 989 1023 theta 45 990 1024 phi 45 … … 1000 1034 } 1001 1035 } 1002 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 1003 SendCmd "camera angle $xyz" 1036 if {$_useArcball} { 1037 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 1038 $_arcball quaternion $q 1039 SendCmd "camera orient $q" 1040 } else { 1041 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 1042 SendCmd "camera angle $xyz" 1043 } 1044 1004 1045 PanCamera 1046 set _settings($this-qw) $_view(qw) 1047 set _settings($this-qx) $_view(qx) 1048 set _settings($this-qy) $_view(qy) 1049 set _settings($this-qz) $_view(qz) 1005 1050 set _settings($this-theta) $_view(theta) 1006 1051 set _settings($this-phi) $_view(phi) … … 1058 1103 } 1059 1104 1060 # 1061 # Rotate the camera in 3D 1062 # 1063 if {$_view(psi) > 90 || $_view(psi) < -90} { 1064 # when psi is flipped around, theta moves backwards 1065 set dy [expr {-$dy}] 1105 if {$_useArcball} { 1106 set q [$_arcball rotate $x $y $_click(x) $_click(y)] 1107 foreach { _view(qw) _view(qx) _view(qy) _view(qz) } $q break 1108 SendCmd "camera orient $q" 1109 } else { 1110 # 1111 # Rotate the camera in 3D 1112 # 1113 if {$_view(psi) > 90 || $_view(psi) < -90} { 1114 # when psi is flipped around, theta moves backwards 1115 set dy [expr {-$dy}] 1116 } 1117 set theta [expr {$_view(theta) - $dy*180}] 1118 while {$theta < 0} { set theta [expr {$theta+180}] } 1119 while {$theta > 180} { set theta [expr {$theta-180}] } 1120 1121 if {abs($theta) >= 30 && abs($theta) <= 160} { 1122 set phi [expr {$_view(phi) - $dx*360}] 1123 while {$phi < 0} { set phi [expr {$phi+360}] } 1124 while {$phi > 360} { set phi [expr {$phi-360}] } 1125 set psi $_view(psi) 1126 } else { 1127 set phi $_view(phi) 1128 set psi [expr {$_view(psi) - $dx*360}] 1129 while {$psi < -180} { set psi [expr {$psi+360}] } 1130 while {$psi > 180} { set psi [expr {$psi-360}] } 1131 } 1132 1133 set _view(theta) $theta 1134 set _view(phi) $phi 1135 set _view(psi) $psi 1136 set xyz [Euler2XYZ $theta $phi $psi] 1137 set _settings($this-theta) $_view(theta) 1138 set _settings($this-phi) $_view(phi) 1139 set _settings($this-psi) $_view(psi) 1140 SendCmd "camera angle $xyz" 1066 1141 } 1067 set theta [expr {$_view(theta) - $dy*180}] 1068 while {$theta < 0} { set theta [expr {$theta+180}] } 1069 while {$theta > 180} { set theta [expr {$theta-180}] } 1070 1071 if {abs($theta) >= 30 && abs($theta) <= 160} { 1072 set phi [expr {$_view(phi) - $dx*360}] 1073 while {$phi < 0} { set phi [expr {$phi+360}] } 1074 while {$phi > 360} { set phi [expr {$phi-360}] } 1075 set psi $_view(psi) 1076 } else { 1077 set phi $_view(phi) 1078 set psi [expr {$_view(psi) - $dx*360}] 1079 while {$psi < -180} { set psi [expr {$psi+360}] } 1080 while {$psi > 180} { set psi [expr {$psi-360}] } 1081 } 1082 1083 set _view(theta) $theta 1084 set _view(phi) $phi 1085 set _view(psi) $psi 1086 set xyz [Euler2XYZ $theta $phi $psi] 1087 set _settings($this-theta) $_view(theta) 1088 set _settings($this-phi) $_view(phi) 1089 set _settings($this-psi) $_view(psi) 1090 SendCmd "camera angle $xyz" 1142 1091 1143 set _click(x) $x 1092 1144 set _click(y) $y … … 1159 1211 if {[isconnected]} { 1160 1212 set val $_settings($this-light) 1161 set sval [expr {0.01*$val}] 1162 SendCmd "volume shading diffuse $sval" 1163 set sval [expr {sqrt($val+1.0)}] 1164 SendCmd "volume shading specular $sval" 1213 set diffuse [expr {0.01*$val}] 1214 set ambient [expr {1.0-$diffuse}] 1215 set specularLevel 0.3 1216 set specularExp 90.0 1217 SendCmd "volume shading ambient $ambient" 1218 SendCmd "volume shading diffuse $diffuse" 1219 SendCmd "volume shading specular {$specularLevel $specularExp}" 1165 1220 } 1166 1221 } … … 1183 1238 } 1184 1239 } 1185 1186 1240 thickness { 1187 1241 if {[isconnected] && [array names _activeTfs] > 0 } { … … 1299 1353 -levels 6 1300 1354 -opacity 1.0 1355 -markers "" 1301 1356 } 1302 1357 array set style [lindex [$dataobj components -style $comp] 0] … … 1321 1376 -levels 6 1322 1377 -opacity 1.0 1378 -markers "" 1323 1379 } 1324 1380 foreach {dataobj comp} [split [lindex $_style2vols($tf) 0] -] break 1325 1381 array set style [lindex [$dataobj components -style $comp] 0] 1326 1382 1383 puts stderr "$tf: $style(-color), $style(-levels), $style(-opacity), $style(-markers)" 1327 1384 1328 1385 # We have to parse the style attributes for a volume using this … … 1341 1398 if { ![info exists _isomarkers($tf)] } { 1342 1399 # Have to defer creation of isomarkers until we have data limits 1343 if { [info exists style(-markers)] } { 1400 if { [info exists style(-markers)] && 1401 [llength $style(-markers)] > 0 } { 1344 1402 ParseMarkersOption $tf $style(-markers) 1403 puts stderr "Found markers option" 1345 1404 } else { 1346 1405 ParseLevelsOption $tf $style(-levels) … … 1351 1410 } 1352 1411 set clist [split $style(-color) :] 1353 set cmap "0.0 [Color2RGB white] " 1412 if {[llength $clist] == 1} { 1413 lappend clist [lindex $clist 0] 1414 } 1354 1415 for {set i 0} {$i < [llength $clist]} {incr i} { 1355 set x [expr {double($i +1)/([llength $clist]+1)}]1416 set x [expr {double($i)/([llength $clist]-1)}] 1356 1417 set color [lindex $clist $i] 1357 1418 append cmap "$x [Color2RGB $color] " 1358 1419 } 1359 append cmap "1.0 [Color2RGB $color]"1360 1420 1361 1421 set tag $this-$tf … … 1363 1423 set _settings($tag-opacity) $style(-opacity) 1364 1424 } 1365 set max $_settings($tag-opacity)1425 set max 1.0 ;#$_settings($tag-opacity) 1366 1426 1367 1427 set isovalues {} … … 1373 1433 1374 1434 if { ![info exists _settings($tag-thickness)]} { 1375 set _settings($tag-thickness) 0.0 51435 set _settings($tag-thickness) 0.005 1376 1436 } 1377 1437 set delta $_settings($tag-thickness) … … 1704 1764 label $inner.shading -text "Shading:" -font $fg 1705 1765 1706 label $inner.dim -text " Dim" -font $fg1766 label $inner.dim -text "Glow" -font $fg 1707 1767 ::scale $inner.light -from 0 -to 100 -orient horizontal \ 1708 1768 -variable [itcl::scope _settings($this-light)] \ 1709 1769 -width 10 \ 1710 1770 -showvalue off -command [itcl::code $this FixSettings light] 1711 label $inner.bright -text " Bright" -font $fg1712 1713 label $inner.fog -text " Fog" -font $fg1771 label $inner.bright -text "Surface" -font $fg 1772 1773 label $inner.fog -text "Clear" -font $fg 1714 1774 ::scale $inner.transp -from 0 -to 100 -orient horizontal \ 1715 1775 -variable [itcl::scope _settings($this-transp)] \ 1716 1776 -width 10 \ 1717 1777 -showvalue off -command [itcl::code $this FixSettings transp] 1718 label $inner.plastic -text " Plastic" -font $fg1778 label $inner.plastic -text "Opaque" -font $fg 1719 1779 1720 1780 label $inner.clear -text "Clear" -font $fg … … 1741 1801 3,1 $inner.transp -columnspan 2 -pady 2 -fill x \ 1742 1802 3,3 $inner.plastic -anchor w -pady 2 \ 1743 4,0 $inner.clear -anchor e -pady 2 \ 1744 4,1 $inner.opacity -columnspan 2 -pady 2 -fill x\ 1745 4,3 $inner.opaque -anchor w -pady 2 \ 1746 5,0 $inner.thin -anchor e -pady 2 \ 1747 5,1 $inner.thickness -columnspan 2 -pady 2 -fill x\ 1748 5,3 $inner.thick -anchor w -pady 2 1803 4,0 $inner.thin -anchor e -pady 2 \ 1804 4,1 $inner.thickness -columnspan 2 -pady 2 -fill x\ 1805 4,3 $inner.thick -anchor w -pady 2 1806 1807 # 4,0 $inner.clear -anchor e -pady 2 \ 1808 # 4,1 $inner.opacity -columnspan 2 -pady 2 -fill x\ 1809 # 4,3 $inner.opaque -anchor w -pady 2 \ 1810 1749 1811 1750 1812 blt::table configure $inner c0 c1 c3 r* -resize none 1751 blt::table configure $inner r 6-resize expand1813 blt::table configure $inner r5 -resize expand 1752 1814 } 1753 1815 … … 1859 1921 $inner configure -borderwidth 4 1860 1922 1861 set labels { phi theta psi pan-x pan-y zoom } 1923 if {$_useArcball} { 1924 set labels { qw qx qy qz pan-x pan-y zoom } 1925 } else { 1926 set labels { phi theta psi pan-x pan-y zoom } 1927 } 1862 1928 set row 0 1863 1929 foreach tag $labels { … … 1930 1996 set _width $w 1931 1997 set _height $h 1998 $_arcball resize $w $h 1932 1999 if { !$_resizePending } { 1933 2000 $_dispatcher event -idle !resize … … 1968 2035 set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)] 1969 2036 SendCmd "camera angle $xyz" 2037 if {$_useArcball} { 2038 $_arcball euler [list [expr {-[lindex $xyz 2]}] [expr {-[lindex $xyz 1]}] [expr {-[lindex $xyz 0]}]] 2039 set q [$_arcball quaternion] 2040 foreach { _view(qw) _view(qx) _view(qy) _view(qz) } $q break 2041 set _settings($this-qw) $_view(qw) 2042 set _settings($this-qx) $_view(qx) 2043 set _settings($this-qy) $_view(qy) 2044 set _settings($this-qz) $_view(qz) 2045 } 2046 } 2047 "qx" - "qy" - "qz" - "qw" { 2048 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 2049 $_arcball quaternion $q 2050 SendCmd "camera orient $q" 1970 2051 } 1971 2052 "zoom" {
Note: See TracChangeset
for help on using the changeset viewer.