Changeset 3533 for trunk/gui/scripts
- Timestamp:
- Mar 19, 2013, 12:53:20 AM (12 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/flowvisviewer.tcl
r3498 r3533 123 123 private method streams { tag name } 124 124 private method arrows { tag name } 125 private method SetOrientation { }125 private method SetOrientation { side } 126 126 127 127 private variable _arcball "" … … 225 225 qz 0.146447 226 226 zoom 1.0 227 pan-x0228 pan-y0227 xpan 0 228 ypan 0 229 229 } 230 230 set _arcball [blt::arcball create 100 100] … … 242 242 $this-qz $_view(qz) 243 243 $this-zoom $_view(zoom) 244 $this- pan-x $_view(pan-x)245 $this- pan-y $_view(pan-y)244 $this-xpan $_view(xpan) 245 $this-ypan $_view(ypan) 246 246 $this-arrows 0 247 247 $this-currenttime 0 … … 959 959 set _settings($this-qy) $_view(qy) 960 960 set _settings($this-qz) $_view(qz) 961 set _settings($this- pan-x) $_view(pan-x)962 set _settings($this- pan-y) $_view(pan-y)961 set _settings($this-xpan) $_view(xpan) 962 set _settings($this-ypan) $_view(ypan) 963 963 set _settings($this-zoom) $_view(zoom) 964 964 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] … … 1267 1267 set _settings($this-qy) $_view(qy) 1268 1268 set _settings($this-qz) $_view(qz) 1269 set _settings($this- pan-x) $_view(pan-x)1270 set _settings($this- pan-y) $_view(pan-y)1269 set _settings($this-xpan) $_view(xpan) 1270 set _settings($this-ypan) $_view(ypan) 1271 1271 set _settings($this-zoom) $_view(zoom) 1272 1272 … … 1372 1372 qz 0.146447 1373 1373 zoom 1.0 1374 pan-x01375 pan-y01374 xpan 0 1375 ypan 0 1376 1376 } 1377 1377 if { $_first != "" } { … … 1389 1389 set _settings($this-qy) $_view(qy) 1390 1390 set _settings($this-qz) $_view(qz) 1391 set _settings($this- pan-x) $_view(pan-x)1392 set _settings($this- pan-y) $_view(pan-y)1391 set _settings($this-xpan) $_view(xpan) 1392 set _settings($this-ypan) $_view(ypan) 1393 1393 set _settings($this-zoom) $_view(zoom) 1394 $itk_component(orientation) value "default"1395 1394 } 1396 1395 } … … 1398 1397 1399 1398 itcl::body Rappture::FlowvisViewer::PanCamera {} { 1400 #set x [expr ($_view( pan-x)) / $_limits(xrange)]1401 #set y [expr ($_view( pan-y)) / $_limits(yrange)]1402 set x $_view( pan-x)1403 set y $_view( pan-y)1399 #set x [expr ($_view(xpan)) / $_limits(xrange)] 1400 #set y [expr ($_view(ypan)) / $_limits(yrange)] 1401 set x $_view(xpan) 1402 set y $_view(ypan) 1404 1403 SendCmd "camera pan $x $y" 1405 1404 } … … 1476 1475 set x [expr $x / double($w)] 1477 1476 set y [expr $y / double($h)] 1478 set _view( pan-x) [expr $_view(pan-x) + $x]1479 set _view( pan-y) [expr $_view(pan-y) + $y]1477 set _view(xpan) [expr $_view(xpan) + $x] 1478 set _view(ypan) [expr $_view(ypan) + $y] 1480 1479 PanCamera 1481 set _settings($this- pan-x) $_view(pan-x)1482 set _settings($this- pan-y) $_view(pan-y)1480 set _settings($this-xpan) $_view(xpan) 1481 set _settings($this-ypan) $_view(ypan) 1483 1482 return 1484 1483 } … … 1493 1492 set _click(x) $x 1494 1493 set _click(y) $y 1495 set _view( pan-x) [expr $_view(pan-x) - $dx]1496 set _view( pan-y) [expr $_view(pan-y) - $dy]1494 set _view(xpan) [expr $_view(xpan) - $dx] 1495 set _view(ypan) [expr $_view(ypan) - $dy] 1497 1496 PanCamera 1498 set _settings($this- pan-x) $_view(pan-x)1499 set _settings($this- pan-y) $_view(pan-y)1497 set _settings($this-xpan) $_view(xpan) 1498 set _settings($this-ypan) $_view(ypan) 1500 1499 } 1501 1500 if { $option == "release" } { … … 2404 2403 $inner configure -borderwidth 4 2405 2404 2406 set row 0 2407 label $inner.orientation_l -text "View" -font "Arial 9" 2408 itk_component add orientation { 2409 Rappture::Combobox $inner.orientation -width 10 -editable no 2410 } 2411 $inner.orientation choices insert end \ 2412 "1 0 0 0" "front" \ 2413 "0 0 1 0" "back" \ 2414 "0.707107 -0.707107 0 0" "top" \ 2415 "0.707107 0.707107 0 0" "bottom" \ 2416 "0.707107 0 -0.707107 0" "left" \ 2417 "0.707107 0 0.707107 0" "right" \ 2418 "0.853553 -0.353553 0.353553 0.146447" "default" 2419 $itk_component(orientation) value "default" 2420 bind $inner.orientation <<Value>> [itcl::code $this SetOrientation] 2421 if 1 { 2405 label $inner.view_l -text "view" -font "Arial 9" 2406 set f [frame $inner.view] 2407 foreach side { front back left right top bottom } { 2408 button $f.$side -image [Rappture::icon view$side] \ 2409 -command [itcl::code $this SetOrientation $side] 2410 Rappture::Tooltip::for $f.$side "Change the view to $side" 2411 pack $f.$side -side left 2412 } 2413 2422 2414 blt::table $inner \ 2423 $row,0 $inner.orientation_l -anchor e -pady 2 \ 2424 $row,1 $inner.orientation -anchor w -pady 2 -fill x 2425 blt::table configure $inner r$row -resize none 2426 incr row 2427 } 2428 2429 set labels { qw qx qy qz pan-x pan-y zoom } 2415 0,0 $inner.view_l -anchor e -pady 2 \ 2416 0,1 $inner.view -anchor w -pady 2 2417 2418 set row 1 2419 set labels { qw qx qy qz xpan ypan zoom } 2430 2420 foreach tag $labels { 2431 2421 label $inner.${tag}label -text $tag -font "Arial 9" … … 2440 2430 incr row 2441 2431 } 2442 blt::table configure $inner c0 c1 -resize none 2432 2433 blt::table configure $inner c* r* -resize none 2443 2434 blt::table configure $inner c2 -resize expand 2444 2435 blt::table configure $inner r$row -resize expand … … 2645 2636 } 2646 2637 switch -- $who { 2647 " pan-x" - "pan-y" {2638 "xpan" - "ypan" { 2648 2639 set _view($who) $_settings($this-$who) 2649 2640 PanCamera … … 3026 3017 } 3027 3018 3028 itcl::body Rappture::FlowvisViewer::SetOrientation {} { 3029 set quat [$itk_component(orientation) value] 3030 set quat [$itk_component(orientation) translate $quat] 3031 foreach name { qw qx qy qz } comp $quat { 3032 set _view($name) $comp 3033 set _settings($this-$name) $comp 3019 itcl::body Rappture::FlowvisViewer::SetOrientation { side } { 3020 array set positions { 3021 front "1 0 0 0" 3022 back "0 0 1 0" 3023 left "0.707107 0 -0.707107 0" 3024 right "0.707107 0 0.707107 0" 3025 top "0.707107 -0.707107 0 0" 3026 bottom "0.707107 0.707107 0 0" 3027 } 3028 foreach name { qw qx qy qz } value $positions($side) { 3029 set _view($name) $value 3034 3030 } 3035 3031 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] … … 3037 3033 SendCmd "camera orient $q" 3038 3034 SendCmd "camera reset" 3039 set $_view(pan-x) 0.03040 set $_view(pan-y) 0.03041 set $_view(zoom) 1.03042 set _settings($this- pan-x) $_view(pan-x)3043 set _settings($this- pan-y) $_view(pan-y)3044 set _settings($this-zoom) 3045 } 3035 set _view(xpan) 0.0 3036 set _view(ypan) 0.0 3037 set _view(zoom) 1.0 3038 set _settings($this-xpan) $_view(xpan) 3039 set _settings($this-ypan) $_view(ypan) 3040 set _settings($this-zoom) $_view(zoom) 3041 } -
trunk/gui/scripts/nanovisviewer.tcl
r3517 r3533 200 200 qz 0.146447 201 201 zoom 1.0 202 xpan 0203 ypan 0202 xpan 0 203 ypan 0 204 204 } 205 205 set _arcball [blt::arcball create 100 100] … … 217 217 $this-qz $_view(qz) 218 218 $this-zoom $_view(zoom) 219 $this-xpan $_view(xpan)220 $this-ypan $_view(ypan)219 $this-xpan $_view(xpan) 220 $this-ypan $_view(ypan) 221 221 $this-volume 1 222 222 $this-xcutplane 0 … … 816 816 SendCmd "volume state 1 $tag" 817 817 } 818 set _limits($tag-min) $info(min); # Minimum value of the volume.819 set _limits($tag-max) $info(max); # Maximum value of the volume.818 set _limits($tag-min) $info(min); # Minimum value of the volume. 819 set _limits($tag-max) $info(max); # Maximum value of the volume. 820 820 set _limits(vmin) $info(vmin); # Overall minimum value. 821 821 set _limits(vmax) $info(vmax); # Overall maximum value. … … 924 924 set _settings($this-qy) $_view(qy) 925 925 set _settings($this-qz) $_view(qz) 926 set _settings($this-xpan) $_view(xpan)927 set _settings($this-ypan) $_view(ypan)926 set _settings($this-xpan) $_view(xpan) 927 set _settings($this-ypan) $_view(ypan) 928 928 set _settings($this-zoom) $_view(zoom) 929 929 … … 1046 1046 set _settings($this-qy) $_view(qy) 1047 1047 set _settings($this-qz) $_view(qz) 1048 set _settings($this-xpan) $_view(xpan)1049 set _settings($this-ypan) $_view(ypan)1048 set _settings($this-xpan) $_view(xpan) 1049 set _settings($this-ypan) $_view(ypan) 1050 1050 set _settings($this-zoom) $_view(zoom) 1051 $itk_component(orientation) value "default"1052 1051 } 1053 1052 } … … 1920 1919 1921 1920 blt::table $inner \ 1922 1923 1921 0,0 $inner.view_l -anchor e -pady 2 \ 1922 0,1 $inner.view -anchor w -pady 2 1924 1923 1925 1924 set row 1 … … 2120 2119 $_arcball quaternion $q 2121 2120 SendCmd "camera orient $q" 2122 } 2123 2121 SendCmd "camera reset" 2122 set _view(xpan) 0 2123 set _view(ypan) 0 2124 set _view(zoom) 1.0 2125 set _settings($this-xpan) $_view(xpan) 2126 set _settings($this-ypan) $_view(ypan) 2127 set _settings($this-zoom) $_view(zoom) 2128 } 2129
Note: See TracChangeset
for help on using the changeset viewer.