- Timestamp:
- Aug 27, 2011 2:53:26 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkviewer.tcl
r2421 r2426 70 70 protected method FixSettings {what {value ""}} 71 71 protected method Pan {option x y} 72 protected method Pick {x y} 72 73 protected method Rebuild {} 73 74 protected method ReceiveDataset { args } … … 173 174 pan-x 0 174 175 pan-y 0 176 ortho 0 175 177 } 176 178 set _arcball [blt::arcball create 100 100] … … 291 293 bind $itk_component(view) <ButtonRelease-2> \ 292 294 [itcl::code $this Pan release %x %y] 295 296 bind $itk_component(view) <ButtonRelease-3> \ 297 [itcl::code $this Pick %x %y] 293 298 294 299 # Bindings for panning via keyboard … … 356 361 357 362 # Must reset camera to have object scaling to take effect. 358 SendCmd "camera reset"359 SendCmd "camera zoom $_view(zoom)"363 #SendCmd "camera reset" 364 #SendCmd "camera zoom $_view(zoom)" 360 365 set _resizePending 0 361 366 } … … 736 741 set option [lindex $args 0] 737 742 switch -- $option { 738 " value" {743 "scalar" { 739 744 set option [lindex $args 1] 740 745 switch -- $option { 741 746 "world" { 742 foreach { x y z value } [lrange $args 2 end] break747 foreach { x y z value tag } [lrange $args 2 end] break 743 748 } 744 749 "pixel" { 745 foreach { x y value } [lrange $args 2 end] break750 foreach { x y value tag } [lrange $args 2 end] break 746 751 } 747 752 } 753 } 754 "vector" { 755 set option [lindex $args 1] 756 switch -- $option { 757 "world" { 758 foreach { x y z vx vy vz tag } [lrange $args 2 end] break 759 } 760 "pixel" { 761 foreach { x y vx vy vz tag } [lrange $args 2 end] break 762 } 763 } 764 } 765 "names" { 766 foreach { name } [lindex $args 1] { 767 #puts stderr "Dataset: $name" 768 } 748 769 } 749 770 default { … … 811 832 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 812 833 $_arcball quaternion $q 834 if {$_view(ortho)} { 835 SendCmd "camera mode ortho" 836 } else { 837 SendCmd "camera mode persp" 838 } 813 839 SendCmd "camera orient $q" 814 840 PanCamera 815 SendCmd "camera mode persp"816 841 if { $_reset || $_first == "" } { 817 842 Zoom reset … … 824 849 FixSettings volume 825 850 FixSettings lighting 851 FixSettings wireframe 826 852 FixSettings axes 827 853 FixSettings edges … … 932 958 933 959 itcl::body Rappture::VtkViewer::PanCamera {} { 934 # set w [winfo width $itk_component(view)]935 # set h [winfo height $itk_component(view)]936 # set x [expr ($_view(pan-x)) / $w]937 # set y [expr ($_view(pan-y)) / $h]938 # set x [expr $x * $_limits(xmax) - $_limits(xmin)]939 # set y [expr $y * $_limits(ymax) - $_limits(ymin)]940 960 set x $_view(pan-x) 941 961 set y $_view(pan-y) … … 995 1015 } 996 1016 } 1017 } 1018 1019 itcl::body Rappture::VtkViewer::Pick {x y} { 1020 foreach tag [CurrentDatasets -visible] { 1021 SendCmd "dataset getscalar pixel $x $y $tag" 1022 } 997 1023 } 998 1024 … … 1395 1421 incr row 1396 1422 } 1423 checkbutton $inner.ortho \ 1424 -text "Orthogrpahic" \ 1425 -variable [itcl::scope _view(ortho)] \ 1426 -command [itcl::code $this camera set ortho] \ 1427 -font "Arial 9" 1428 blt::table $inner \ 1429 $row,0 $inner.ortho -columnspan 2 -anchor w -pady 2 1430 blt::table configure $inner r$row -resize none 1431 incr row 1432 1397 1433 blt::table configure $inner c0 c1 -resize none 1398 1434 blt::table configure $inner c2 -resize expand … … 1414 1450 set code [catch { string is double $x } result] 1415 1451 if { $code != 0 || !$result } { 1416 set x _view($who)1417 1452 return 1418 1453 } 1419 1454 switch -- $who { 1455 "ortho" { 1456 if {$_view(ortho)} { 1457 SendCmd "camera mode ortho" 1458 } else { 1459 SendCmd "camera mode persp" 1460 } 1461 } 1420 1462 "pan-x" - "pan-y" { 1421 1463 PanCamera
Note: See TracChangeset
for help on using the changeset viewer.