Changeset 1228
- Timestamp:
- Nov 24, 2008 9:48:03 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.in
r1189 r1228 35 35 36 36 ifneq ($(ENABLE_GUI),) 37 TARGETS += gui lang examples lib37 TARGETS += gui lang lib examples 38 38 endif 39 39 40 .NOTPARALLEL: 40 41 41 42 .PHONY: $(TARGETS) … … 45 46 src: 46 47 $(MAKE) -C src all 47 gui: 48 gui: 48 49 $(MAKE) -C gui all 49 lang: 50 lang: 50 51 $(MAKE) -C lang all 51 lib: 52 examples: 53 $(MAKE) -C examples all 54 lib: 52 55 $(MAKE) -C lib all 53 examples: 54 $(MAKE) -C examples all 55 test: 56 test: 56 57 #$(MAKE) -C test all 57 58 -
trunk/gui/scripts/heightmapviewer.tcl
r1220 r1228 53 53 Rappture::VisViewer::SetServerList "nanovis" $namelist 54 54 } 55 public method isconnected {}56 55 public method add {dataobj {settings ""}} 57 56 public method get {args} … … 67 66 protected method _send {string} 68 67 protected method _send_dataobjs {} 69 protected method _receive_image {option size}70 pr otectedmethod ReceiveLegend {ivol vmin vmax size}68 protected method ReceiveImage {option size} 69 private method ReceiveLegend {ivol vmin vmax size} 71 70 protected method _receive_echo {channel {data ""}} 72 71 … … 81 80 82 81 83 private variable _outbuf ;# buffer for outgoing commands 84 85 private variable _dlist "" ;# list of data objects 86 private variable _dims "" ;# dimensionality of data objects 87 private variable _obj2style ;# maps dataobj => style settings 88 private variable _obj2ovride ;# maps dataobj => style override 89 private variable _obj2id ;# maps dataobj => heightmap ID in server 90 private variable _id2obj ;# maps heightmap ID => dataobj in server 91 private variable _sendobjs "" ;# list of data objs to send to server 92 private variable _receiveids ;# list of data responses from the server 93 private variable _click ;# info used for _rotate operations 94 private variable _limits ;# autoscale min/max for all axes 95 private variable _view ;# view params for 3D view 96 97 private common _settings ;# Array used for checkbuttons and radiobuttons 82 private variable outbuf_ ;# buffer for outgoing commands 83 84 private variable dlist_ "" ;# list of data objects 85 private variable obj2style_ ;# maps dataobj => style settings 86 private variable obj2ovride_ ;# maps dataobj => style override 87 private variable obj2id_ ;# maps dataobj => heightmap ID in server 88 private variable id2obj_ ;# maps heightmap ID => dataobj in server 89 private variable sendobjs_ "" ;# list of data objs to send to server 90 private variable receiveIds_ ;# list of data responses from the server 91 private variable click_ ;# info used for _rotate operations 92 private variable limits_ ;# autoscale min/max for all axes 93 private variable view_ ;# view params for 3D view 94 95 private common settings_ ;# Array used for checkbuttons and radiobuttons 98 96 99 97 } … … 120 118 $_dispatcher dispatch $this !rebuild "[itcl::code $this _rebuild]; list" 121 119 122 set _outbuf""120 set outbuf_ "" 123 121 124 122 # 125 123 # Populate parser with commands handle incoming requests 126 124 # 127 $_parser alias image [itcl::code $this _receive_image]125 $_parser alias image [itcl::code $this ReceiveImage] 128 126 $_parser alias legend [itcl::code $this ReceiveLegend] 129 127 130 128 # Initialize the view to some default parameters. 131 array set _view{129 array set view_ { 132 130 theta 45 133 131 phi 45 … … 138 136 zfocus 0 139 137 } 140 set _obj2id(count) 0138 set obj2id_(count) 0 141 139 142 140 itk_component add zoom { … … 211 209 set fg [option get $itk_component(hull) font Font] 212 210 213 set ::Rappture::HeightmapViewer:: _settings($this-grid) 1211 set ::Rappture::HeightmapViewer::settings_($this-grid) 1 214 212 ::checkbutton $inner.f.grid \ 215 213 -text "Grid" \ 216 -variable ::Rappture::HeightmapViewer:: _settings($this-grid) \214 -variable ::Rappture::HeightmapViewer::settings_($this-grid) \ 217 215 -command [itcl::code $this _fixSettings grid] 218 216 grid $inner.f.grid -row 0 -column 0 -sticky w 219 217 220 set ::Rappture::HeightmapViewer:: _settings($this-axes) 0218 set ::Rappture::HeightmapViewer::settings_($this-axes) 0 221 219 ::checkbutton $inner.f.axes \ 222 220 -text "Axes" \ 223 -variable ::Rappture::HeightmapViewer:: _settings($this-axes) \221 -variable ::Rappture::HeightmapViewer::settings_($this-axes) \ 224 222 -command [itcl::code $this _fixSettings axes] 225 223 grid $inner.f.axes -row 1 -column 0 -sticky w 226 224 227 set ::Rappture::HeightmapViewer:: _settings($this-contourlines) 1225 set ::Rappture::HeightmapViewer::settings_($this-contourlines) 1 228 226 ::checkbutton $inner.f.contour \ 229 227 -text "Contour Lines" \ 230 -variable ::Rappture::HeightmapViewer:: _settings($this-contourlines) \228 -variable ::Rappture::HeightmapViewer::settings_($this-contourlines) \ 231 229 -command [itcl::code $this _fixSettings contourlines] 232 230 grid $inner.f.contour -row 2 -column 0 -sticky w 233 231 234 set ::Rappture::HeightmapViewer:: _settings($this-wireframe) "fill"232 set ::Rappture::HeightmapViewer::settings_($this-wireframe) "fill" 235 233 ::checkbutton $inner.f.wireframe \ 236 234 -text "Wireframe" \ 237 235 -onvalue "wireframe" -offvalue "fill" \ 238 -variable ::Rappture::HeightmapViewer:: _settings($this-wireframe) \236 -variable ::Rappture::HeightmapViewer::settings_($this-wireframe) \ 239 237 -command [itcl::code $this _fixSettings wireframe] 240 238 grid $inner.f.wireframe -row 3 -column 0 -sticky w 241 239 242 set ::Rappture::HeightmapViewer:: _settings($this-shading) "smooth"240 set ::Rappture::HeightmapViewer::settings_($this-shading) "smooth" 243 241 ::checkbutton $inner.f.shading \ 244 242 -text "Flat Shading" \ 245 243 -onvalue "flat" -offvalue "smooth" \ 246 -variable ::Rappture::HeightmapViewer:: _settings($this-shading) \244 -variable ::Rappture::HeightmapViewer::settings_($this-shading) \ 247 245 -command [itcl::code $this _fixSettings shading] 248 246 grid $inner.f.shading -row 4 -column 0 -sticky w … … 261 259 [list $_dispatcher event -idle !legend] 262 260 263 # set up bindings for rotation261 # Bindings for rotation via mouse 264 262 bind $itk_component(3dview) <ButtonPress-1> \ 265 263 [itcl::code $this _rotate click %x %y] … … 271 269 [itcl::code $this _send "screen %w %h"] 272 270 271 # Bindings for panning via mouse 273 272 bind $itk_component(3dview) <ButtonPress-2> \ 274 273 [itcl::code $this _pan click %x %y] … … 278 277 [itcl::code $this _pan release %x %y] 279 278 279 # Bindings for panning via keyboard 280 bind $itk_component(3dview) <KeyPress-Left> \ 281 [itcl::code $this _pan set -10 0] 282 bind $itk_component(3dview) <KeyPress-Right> \ 283 [itcl::code $this _pan set 10 0] 284 bind $itk_component(3dview) <KeyPress-Up> \ 285 [itcl::code $this _pan set 0 -10] 286 bind $itk_component(3dview) <KeyPress-Down> \ 287 [itcl::code $this _pan set 0 10] 288 bind $itk_component(3dview) <Shift-KeyPress-Left> \ 289 [itcl::code $this _pan set -2 0] 290 bind $itk_component(3dview) <Shift-KeyPress-Right> \ 291 [itcl::code $this _pan set 2 0] 292 bind $itk_component(3dview) <Shift-KeyPress-Up> \ 293 [itcl::code $this _pan set 0 -2] 294 bind $itk_component(3dview) <Shift-KeyPress-Down> \ 295 [itcl::code $this _pan set 0 2] 296 297 # Bindings for zoom via keyboard 298 bind $itk_component(3dview) <KeyPress-Prior> \ 299 [itcl::code $this _zoom out] 300 bind $itk_component(3dview) <KeyPress-Next> \ 301 [itcl::code $this _zoom in] 302 303 bind $itk_component(3dview) <Enter> "focus $itk_component(3dview)" 304 280 305 if {[string equal "x11" [tk windowingsystem]]} { 306 # Bindings for zoom via mouse 281 307 bind $itk_component(3dview) <4> [itcl::code $this _zoom out] 282 308 bind $itk_component(3dview) <5> [itcl::code $this _zoom in] … … 294 320 # ---------------------------------------------------------------------- 295 321 itcl::body Rappture::HeightmapViewer::destructor {} { 296 set _sendobjs"" ;# stop any send in progress322 set sendobjs_ "" ;# stop any send in progress 297 323 $_dispatcher cancel !rebuild 298 324 $_dispatcher cancel !send_dataobjs … … 330 356 } 331 357 332 set pos [lsearch -exact $dataobj $ _dlist]358 set pos [lsearch -exact $dataobj $dlist_] 333 359 if {$pos < 0} { 334 lappend _dlist$dataobj335 set _obj2ovride($dataobj-color) $params(-color)336 set _obj2ovride($dataobj-width) $params(-width)337 set _obj2ovride($dataobj-raise) $params(-raise)360 lappend dlist_ $dataobj 361 set obj2ovride_($dataobj-color) $params(-color) 362 set obj2ovride_($dataobj-width) $params(-width) 363 set obj2ovride_($dataobj-raise) $params(-raise) 338 364 $_dispatcher event -idle !rebuild 339 365 } … … 357 383 -objects { 358 384 # put the dataobj list in order according to -raise options 359 set dlist $ _dlist385 set dlist $dlist_ 360 386 foreach obj $dlist { 361 if { [info exists _obj2ovride($obj-raise)] &&362 $ _obj2ovride($obj-raise)} {387 if { [info exists obj2ovride_($obj-raise)] && 388 $obj2ovride_($obj-raise)} { 363 389 set i [lsearch -exact $dlist $obj] 364 390 if {$i >= 0} { … … 400 426 itcl::body Rappture::HeightmapViewer::delete {args} { 401 427 if {[llength $args] == 0} { 402 set args $ _dlist428 set args $dlist_ 403 429 } 404 430 … … 406 432 set changed 0 407 433 foreach dataobj $args { 408 set pos [lsearch -exact $ _dlist$dataobj]434 set pos [lsearch -exact $dlist_ $dataobj] 409 435 if {$pos >= 0} { 410 set _dlist [lreplace $_dlist$pos $pos]411 foreach key [array names _obj2ovride$dataobj-*] {412 unset _obj2ovride($key)436 set dlist_ [lreplace $dlist_ $pos $pos] 437 foreach key [array names obj2ovride_ $dataobj-*] { 438 unset obj2ovride_($key) 413 439 } 414 440 set changed 1 … … 433 459 itcl::body Rappture::HeightmapViewer::scale {args} { 434 460 foreach val {xmin xmax ymin ymax zmin zmax vmin vmax} { 435 set _limits($val) ""461 set limits_($val) "" 436 462 } 437 463 foreach obj $args { … … 439 465 foreach {min max} [$obj limits $axis] break 440 466 if {"" != $min && "" != $max} { 441 if {"" == $ _limits(${axis}min)} {442 set _limits(${axis}min) $min443 set _limits(${axis}max) $max467 if {"" == $limits_(${axis}min)} { 468 set limits_(${axis}min) $min 469 set limits_(${axis}max) $max 444 470 } else { 445 if {$min < $ _limits(${axis}min)} {446 set _limits(${axis}min) $min471 if {$min < $limits_(${axis}min)} { 472 set limits_(${axis}min) $min 447 473 } 448 if {$max > $ _limits(${axis}max)} {449 set _limits(${axis}max) $max474 if {$max > $limits_(${axis}max)} { 475 set limits_(${axis}max) $max 450 476 } 451 477 } … … 501 527 502 528 # ---------------------------------------------------------------------- 503 # USAGE: isconnected504 #505 # Clients use this method to see if we are currently connected to506 # a server.507 # ----------------------------------------------------------------------508 itcl::body Rappture::HeightmapViewer::isconnected {} {509 return [VisViewer::IsConnected]510 }511 512 # ----------------------------------------------------------------------513 529 # USAGE: Connect ?<host:port>,<host:port>...? 514 530 # … … 536 552 VisViewer::Disconnect 537 553 538 set _outbuf""554 set outbuf_ "" 539 555 # disconnected -- no more data sitting on server 540 catch {unset _obj2id}541 array unset _id2obj542 set _obj2id(count) 0543 set _id2obj(cound) 0544 set _sendobjs""556 catch {unset obj2id_} 557 array unset id2obj_ 558 set obj2id_(count) 0 559 set id2obj_(cound) 0 560 set sendobjs_ "" 545 561 } 546 562 … … 553 569 # 554 570 itcl::body Rappture::HeightmapViewer::_send {string} { 555 if {[llength $ _sendobjs] > 0} {556 append _outbuf$string "\n"571 if {[llength $sendobjs_] > 0} { 572 append outbuf_ $string "\n" 557 573 } else { 558 574 if {[SendBytes $string]} { … … 575 591 576 592 # Reset the overall limits 577 if { $ _sendobjs!= "" } {578 set _limits(vmin) ""579 set _limits(vmax) ""580 } 581 foreach dataobj $ _sendobjs{593 if { $sendobjs_ != "" } { 594 set limits_(vmin) "" 595 set limits_(vmax) "" 596 } 597 foreach dataobj $sendobjs_ { 582 598 foreach comp [$dataobj components] { 583 599 set data [$dataobj blob $comp] 584 600 585 601 foreach { vmin vmax } [$dataobj limits v] break 586 if { $ _limits(vmin) == "" || $vmin < $_limits(vmin) } {587 set _limits(vmin) $vmin588 } 589 if { $ _limits(vmax) == "" || $vmax > $_limits(vmax) } {590 set _limits(vmax) $vmax602 if { $limits_(vmin) == "" || $vmin < $limits_(vmin) } { 603 set limits_(vmin) $vmin 604 } 605 if { $limits_(vmax) == "" || $vmax > $limits_(vmax) } { 606 set limits_(vmax) $vmax 591 607 } 592 608 … … 600 616 return 601 617 } 602 set id $ _obj2id(count)603 incr _obj2id(count)604 set _id2obj($id) [list $dataobj $comp]605 set _obj2id($dataobj-$comp) $id606 set _receiveids($id) 1618 set id $obj2id_(count) 619 incr obj2id_(count) 620 set id2obj_($id) [list $dataobj $comp] 621 set obj2id_($dataobj-$comp) $id 622 set receiveIds_($id) 1 607 623 608 624 # … … 615 631 return 616 632 } 617 set _obj2style($dataobj-$comp) $sname618 } 619 } 620 set _sendobjs""633 set obj2style_($dataobj-$comp) $sname 634 } 635 } 636 set sendobjs_ "" 621 637 blt::busy release $itk_component(hull) 622 638 … … 630 646 } 631 647 632 foreach key [array names _obj2id*-*] {648 foreach key [array names obj2id_ *-*] { 633 649 set state [string match $first-* $key] 634 _send "heightmap data visible $state $ _obj2id($key)"635 if {[info exists _obj2style($key)]} {636 _send "heightmap transfunc $ _obj2style($key) $_obj2id($key)"650 _send "heightmap data visible $state $obj2id_($key)" 651 if {[info exists obj2style_($key)]} { 652 _send "heightmap transfunc $obj2style_($key) $obj2id_($key)" 637 653 } 638 654 } 639 655 640 656 # if there are any commands in the buffer, send them now that we're done 641 SendBytes $ _outbuf642 set _outbuf""657 SendBytes $outbuf_ 658 set outbuf_ "" 643 659 644 660 $_dispatcher event -idle !legend … … 646 662 647 663 # ---------------------------------------------------------------------- 648 # USAGE: _receive_image -bytes <size>664 # USAGE: ReceiveImage -bytes <size> 649 665 # 650 666 # Invoked automatically whenever the "image" command comes in from … … 652 668 # specified <size> will follow. 653 669 # ---------------------------------------------------------------------- 654 itcl::body Rappture::HeightmapViewer:: _receive_image {option size} {655 if {[ isconnected]} {670 itcl::body Rappture::HeightmapViewer::ReceiveImage {option size} { 671 if {[IsConnected]} { 656 672 set bytes [ReceiveBytes $size] 657 673 $_image(plot) configure -data $bytes … … 668 684 # ---------------------------------------------------------------------- 669 685 itcl::body Rappture::HeightmapViewer::ReceiveLegend {ivol vmin vmax size} { 670 if { [ isconnected] } {686 if { [IsConnected] } { 671 687 set bytes [ReceiveBytes $size] 672 688 $_image(legend) configure -data $bytes … … 701 717 itcl::body Rappture::HeightmapViewer::_rebuild {} { 702 718 # in the midst of sending data? then bail out 703 if {[llength $ _sendobjs] > 0} {719 if {[llength $sendobjs_] > 0} { 704 720 return 705 721 } 706 722 # Find any new data that needs to be sent to the server. Queue this up on 707 # the _sendobjslist, and send it out a little at a time. Do this first,723 # the sendobjs_ list, and send it out a little at a time. Do this first, 708 724 # before we rebuild the rest. 709 725 foreach dataobj [get] { 710 726 set comp [lindex [$dataobj components] 0] 711 if {![info exists _obj2id($dataobj-$comp)]} {712 set i [lsearch -exact $ _sendobjs$dataobj]727 if {![info exists obj2id_($dataobj-$comp)]} { 728 set i [lsearch -exact $sendobjs_ $dataobj] 713 729 if {$i < 0} { 714 lappend _sendobjs$dataobj715 } 716 } 717 } 718 if {[llength $ _sendobjs] > 0} {730 lappend sendobjs_ $dataobj 731 } 732 } 733 } 734 if {[llength $sendobjs_] > 0} { 719 735 # Send off new data objects 720 736 $_dispatcher event -idle !send_dataobjs … … 728 744 } 729 745 } 730 foreach key [array names _obj2id*-*] {746 foreach key [array names obj2id_ *-*] { 731 747 set state [string match $first-* $key] 732 _send "heightmap data visible $state $ _obj2id($key)"733 if {[info exists _obj2style($key)]} {734 _send "heightmap transfunc $ _obj2style($key) $_obj2id($key)"748 _send "heightmap data visible $state $obj2id_($key)" 749 if {[info exists obj2style_($key)]} { 750 _send "heightmap transfunc $obj2style_($key) $obj2id_($key)" 735 751 } 736 752 } … … 744 760 745 761 # Reset the camera and other view parameters 746 set xyz [Euler2XYZ $ _view(theta) $_view(phi) $_view(psi)]762 set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)] 747 763 _send "camera angle $xyz" 748 _send "camera zoom $ _view(zoom)"764 _send "camera zoom $view_(zoom)" 749 765 750 766 if {"" == $itk_option(-plotoutline)} { … … 769 785 switch -- $option { 770 786 "in" { 771 set _view(zoom) [expr {$_view(zoom)*1.25}]787 set view_(zoom) [expr {$view_(zoom)*1.25}] 772 788 } 773 789 "out" { 774 set _view(zoom) [expr {$_view(zoom)*0.8}]790 set view_(zoom) [expr {$view_(zoom)*0.8}] 775 791 } 776 792 "reset" { 777 array set _view{793 array set view_ { 778 794 theta 45 779 795 phi 45 … … 781 797 zoom 1.0 782 798 } 783 set xyz [Euler2XYZ $ _view(theta) $_view(phi) $_view(psi)]799 set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)] 784 800 _send "camera angle $xyz" 785 801 } 786 802 } 787 _send "camera zoom $ _view(zoom)"803 _send "camera zoom $view_(zoom)" 788 804 } 789 805 … … 797 813 # ---------------------------------------------------------------------- 798 814 itcl::body Rappture::HeightmapViewer::_pan {option x y} { 815 return 816 # Experimental stuff 817 if { $option == "set" } { 818 set dx $x 819 set dy $y 820 set view_(x) [expr $view_(x) + $dx] 821 set view_(y) [expr $view_(y) + $dy] 822 _send "pan $dx $dy" 823 return 824 } 799 825 if { $option == "click" } { 800 826 $itk_component(3dview) configure -cursor hand1 801 827 } 802 828 if { $option == "drag" || $option == "release" } { 803 set _view(x) [expr $_view(x) + $x]804 set _view(y) [expr $_view(y) + $y]805 _send "camera pan $ _view(x) $_view(y) 0"829 set view_(x) [expr $view_(x) + $x] 830 set view_(y) [expr $view_(y) + $y] 831 _send "camera pan $view_(x) $view_(y) 0" 806 832 } 807 833 if { $option == "release" } { … … 822 848 click { 823 849 $itk_component(3dview) configure -cursor fleur 824 set _click(x) $x 825 set _click(y) $y 826 set _click(theta) $_view(theta) 827 set _click(phi) $_view(phi) 850 array set click [subst { 851 x $x 852 y $y 853 theta $view_(theta) 854 phi $view_(phi) 855 }] 828 856 } 829 857 drag { 830 if {[array size _click] == 0} {858 if {[array size click_] == 0} { 831 859 _rotate click $x $y 832 860 } else { … … 839 867 if {[catch { 840 868 # this fails sometimes for no apparent reason 841 set dx [expr {double($x-$ _click(x))/$w}]842 set dy [expr {double($y-$ _click(y))/$h}]869 set dx [expr {double($x-$click_(x))/$w}] 870 set dy [expr {double($y-$click_(y))/$h}] 843 871 }]} { 844 872 return … … 848 876 # Rotate the camera in 3D 849 877 # 850 if {$ _view(psi) > 90 || $_view(psi) < -90} {878 if {$view_(psi) > 90 || $view_(psi) < -90} { 851 879 # when psi is flipped around, theta moves backwards 852 880 set dy [expr {-$dy}] 853 881 } 854 set theta [expr {$ _view(theta) - $dy*180}]882 set theta [expr {$view_(theta) - $dy*180}] 855 883 while {$theta < 0} { set theta [expr {$theta+180}] } 856 884 while {$theta > 180} { set theta [expr {$theta-180}] } 857 885 858 886 if {abs($theta) >= 30 && abs($theta) <= 160} { 859 set phi [expr {$ _view(phi) - $dx*360}]887 set phi [expr {$view_(phi) - $dx*360}] 860 888 while {$phi < 0} { set phi [expr {$phi+360}] } 861 889 while {$phi > 360} { set phi [expr {$phi-360}] } 862 set psi $ _view(psi)890 set psi $view_(psi) 863 891 } else { 864 set phi $ _view(phi)865 set psi [expr {$ _view(psi) - $dx*360}]892 set phi $view_(phi) 893 set psi [expr {$view_(psi) - $dx*360}] 866 894 while {$psi < -180} { set psi [expr {$psi+360}] } 867 895 while {$psi > 180} { set psi [expr {$psi-360}] } 868 896 } 869 897 870 set _view(theta) $theta871 set _view(phi) $phi872 set _view(psi) $psi873 set xyz [Euler2XYZ $ _view(theta) $_view(phi) $_view(psi)]898 set view_(theta) $theta 899 set view_(phi) $phi 900 set view_(psi) $psi 901 set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)] 874 902 _send "camera angle $xyz" 875 set _click(x) $x876 set _click(y) $y903 set click_(x) $x 904 set click_(y) $y 877 905 } 878 906 } … … 880 908 _rotate drag $x $y 881 909 $itk_component(3dview) configure -cursor "" 882 catch {unset _click}910 catch {unset click_} 883 911 } 884 912 default { … … 920 948 if {"" != $dataobj} { 921 949 set comp [lindex [$dataobj components] 0] 922 if {[info exists _obj2id($dataobj-$comp)]} {923 set imap $ _obj2id($dataobj-$comp)950 if {[info exists obj2id_($dataobj-$comp)]} { 951 set imap $obj2id_($dataobj-$comp) 924 952 } 925 953 } … … 931 959 } 932 960 "grid" { 933 if { [ isconnected] } {934 _send "grid visible $ _settings($this-grid)"961 if { [IsConnected] } { 962 _send "grid visible $settings_($this-grid)" 935 963 } 936 964 } 937 965 "axes" { 938 if { [ isconnected] } {939 _send "axis visible $ _settings($this-axes)"966 if { [IsConnected] } { 967 _send "axis visible $settings_($this-axes)" 940 968 } 941 969 } 942 970 "shading" { 943 if { [ isconnected] } {944 _send "heightmap shading $ _settings($this-shading)"971 if { [IsConnected] } { 972 _send "heightmap shading $settings_($this-shading)" 945 973 } 946 974 } 947 975 "wireframe" { 948 if { [ isconnected] } {949 _send "heightmap polygon $ _settings($this-wireframe)"976 if { [IsConnected] } { 977 _send "heightmap polygon $settings_($this-wireframe)" 950 978 } 951 979 } 952 980 "contourlines" { 953 if {[ isconnected]} {981 if {[IsConnected]} { 954 982 set dataobj [lindex [get] 0] 955 983 if {"" != $dataobj} { 956 984 set comp [lindex [$dataobj components] 0] 957 if {[info exists _obj2id($dataobj-$comp)]} {958 set i $ _obj2id($dataobj-$comp)959 set bool $ _settings($this-contourlines)985 if {[info exists obj2id_($dataobj-$comp)]} { 986 set i $obj2id_($dataobj-$comp) 987 set bool $settings_($this-contourlines) 960 988 _send "heightmap linecontour visible $bool $i" 961 989 } … … 991 1019 set color white 992 1020 set cmap "0.0 [Color2RGB $color] " 993 set range [expr $ _limits(vmax) - $_limits(vmin)]1021 set range [expr $limits_(vmax) - $limits_(vmin)] 994 1022 for {set i 0} {$i < [llength $clist]} {incr i} { 995 1023 set xval [expr {double($i+1)/([llength $clist]+1)}] … … 1049 1077 # ---------------------------------------------------------------------- 1050 1078 itcl::configbody Rappture::HeightmapViewer::plotoutline { 1051 if {[ isconnected]} {1079 if {[IsConnected]} { 1052 1080 _send "grid linecolor [Color2RGB $itk_option(-plotoutline)]" 1053 1081 } -
trunk/gui/scripts/molvisviewer.tcl
r1220 r1228 103 103 private variable _cacheimage "" 104 104 private variable _busy 0 105 106 private variable delta1_ 10 107 private variable delta2_ 2 105 108 106 109 private common _settings ;# array of settings for all known widgets … … 320 323 bind $itk_component(3dview) <ButtonRelease-2> \ 321 324 [itcl::code $this _pan release %x %y] 325 326 bind $itk_component(3dview) <KeyPress-Left> \ 327 [itcl::code $this _pan set -10 0] 328 bind $itk_component(3dview) <KeyPress-Right> \ 329 [itcl::code $this _pan set 10 0] 330 bind $itk_component(3dview) <KeyPress-Up> \ 331 [itcl::code $this _pan set 0 -10] 332 bind $itk_component(3dview) <KeyPress-Down> \ 333 [itcl::code $this _pan set 0 10] 334 bind $itk_component(3dview) <Shift-KeyPress-Left> \ 335 [itcl::code $this _pan set -2 0] 336 bind $itk_component(3dview) <Shift-KeyPress-Right> \ 337 [itcl::code $this _pan set 2 0] 338 bind $itk_component(3dview) <Shift-KeyPress-Up> \ 339 [itcl::code $this _pan set 0 -2] 340 bind $itk_component(3dview) <Shift-KeyPress-Down> \ 341 [itcl::code $this _pan set 0 2] 342 bind $itk_component(3dview) <KeyPress-Prior> \ 343 [itcl::code $this _zoom out 2] 344 bind $itk_component(3dview) <KeyPress-Next> \ 345 [itcl::code $this _zoom in 2] 346 347 bind $itk_component(3dview) <Enter> "focus $itk_component(3dview)" 348 322 349 323 350 if {[string equal "x11" [tk windowingsystem]]} { … … 683 710 # ---------------------------------------------------------------------- 684 711 itcl::body Rappture::MolvisViewer::_pan {option x y} { 712 if { $option == "set" } { 713 set dx $x 714 set dy $y 715 set view_(x) [expr $view_(x) + $dx] 716 set view_(y) [expr $view_(y) + $dy] 717 _send "pan $dx $dy" 718 return 719 } 685 720 if { ![info exists _mevent(x)] } { 686 721 set option "click" -
trunk/gui/scripts/nanovisviewer.tcl
r1220 r1228 100 100 private method _ParseLevelsOption { tf ivol levels } 101 101 102 private variable _outbuf;# buffer for outgoing commands102 private variable outbuf_ ;# buffer for outgoing commands 103 103 104 104 private variable _dlist "" ;# list of data objects … … 114 114 private variable _style2ids ;# maps id => style settings 115 115 116 private variable _click ;# info used for _rotate operations 117 private variable _limits ;# autoscale min/max for all axes 118 private variable _view ;# view params for 3D view 119 private variable _mevent 120 private variable _isomarkers ;# array of isosurface level values 0..1 121 private variable _styles 122 private common _settings 123 private variable _activeId "" ;# The currently active volume. This 116 private variable click_ ;# info used for _rotate operations 117 private variable limits_ ;# autoscale min/max for all axes 118 private variable view_ ;# view params for 3D view 119 private variable isomarkers_ ;# array of isosurface level values 0..1 120 private common settings_ 121 private variable activeId_ "" ;# The currently active volume. This 124 122 # indicates which isomarkers and transfer 125 123 # function to use when changing markers, … … 153 151 $_dispatcher dispatch $this !rebuild "[itcl::code $this _rebuild]; list" 154 152 155 set _outbuf""153 set outbuf_ "" 156 154 157 155 # … … 164 162 165 163 # Initialize the view to some default parameters. 166 array set _view{164 array set view_ { 167 165 theta 45 168 166 phi 45 … … 175 173 set _obj2id(count) 0 176 174 set _id2obj(count) 0 177 set _limits(vmin) 0.0178 set _limits(vmax) 1.0175 set limits_(vmin) 0.0 176 set limits_(vmax) 1.0 179 177 180 178 itk_component add zoom { … … 422 420 $inner.scales.thickness set 350 423 421 424 set ::Rappture::NanovisViewer:: _settings($this-isosurface) 0422 set ::Rappture::NanovisViewer::settings_($this-isosurface) 0 425 423 ::checkbutton $inner.scales.isosurface \ 426 424 -text "Isosurface shading" \ 427 -variable ::Rappture::NanovisViewer:: _settings($this-isosurface) \425 -variable ::Rappture::NanovisViewer::settings_($this-isosurface) \ 428 426 -command [itcl::code $this _fixSettings isosurface] 429 427 grid $inner.scales.isosurface -row 4 -column 0 -columnspan 2 -sticky w 430 428 431 set ::Rappture::NanovisViewer:: _settings($this-axes) 1429 set ::Rappture::NanovisViewer::settings_($this-axes) 1 432 430 ::checkbutton $inner.scales.axes \ 433 431 -text "Axes" \ 434 -variable ::Rappture::NanovisViewer:: _settings($this-axes) \432 -variable ::Rappture::NanovisViewer::settings_($this-axes) \ 435 433 -command [itcl::code $this _fixSettings axes] 436 434 grid $inner.scales.axes -row 5 -column 0 -columnspan 2 -sticky w 437 435 438 set ::Rappture::NanovisViewer:: _settings($this-grid) 0436 set ::Rappture::NanovisViewer::settings_($this-grid) 0 439 437 ::checkbutton $inner.scales.grid \ 440 438 -text "Grid" \ 441 -variable ::Rappture::NanovisViewer:: _settings($this-grid) \439 -variable ::Rappture::NanovisViewer::settings_($this-grid) \ 442 440 -command [itcl::code $this _fixSettings grid] 443 441 grid $inner.scales.grid -row 6 -column 0 -columnspan 2 -sticky w 444 442 445 set ::Rappture::NanovisViewer:: _settings($this-outline) 1443 set ::Rappture::NanovisViewer::settings_($this-outline) 1 446 444 ::checkbutton $inner.scales.outline \ 447 445 -text "Outline" \ 448 -variable ::Rappture::NanovisViewer:: _settings($this-outline) \446 -variable ::Rappture::NanovisViewer::settings_($this-outline) \ 449 447 -command [itcl::code $this _fixSettings outline] 450 448 grid $inner.scales.outline -row 7 -column 0 -columnspan 2 -sticky w … … 464 462 [list $_dispatcher event -idle !legend] 465 463 466 # set up bindings for rotation464 # Bindings for rotation via mouse 467 465 bind $itk_component(3dview) <ButtonPress-1> \ 468 466 [itcl::code $this _rotate click %x %y] … … 474 472 [itcl::code $this _send "screen %w %h"] 475 473 474 # Bindings for panning via mouse 476 475 bind $itk_component(3dview) <ButtonPress-2> \ 477 476 [itcl::code $this _pan click %x %y] … … 481 480 [itcl::code $this _pan release %x %y] 482 481 482 # Bindings for panning via keyboard 483 bind $itk_component(3dview) <KeyPress-Left> \ 484 [itcl::code $this _pan set -10 0] 485 bind $itk_component(3dview) <KeyPress-Right> \ 486 [itcl::code $this _pan set 10 0] 487 bind $itk_component(3dview) <KeyPress-Up> \ 488 [itcl::code $this _pan set 0 -10] 489 bind $itk_component(3dview) <KeyPress-Down> \ 490 [itcl::code $this _pan set 0 10] 491 bind $itk_component(3dview) <Shift-KeyPress-Left> \ 492 [itcl::code $this _pan set -2 0] 493 bind $itk_component(3dview) <Shift-KeyPress-Right> \ 494 [itcl::code $this _pan set 2 0] 495 bind $itk_component(3dview) <Shift-KeyPress-Up> \ 496 [itcl::code $this _pan set 0 -2] 497 bind $itk_component(3dview) <Shift-KeyPress-Down> \ 498 [itcl::code $this _pan set 0 2] 499 500 # Bindings for zoom via keyboard 501 bind $itk_component(3dview) <KeyPress-Prior> \ 502 [itcl::code $this _zoom out] 503 bind $itk_component(3dview) <KeyPress-Next> \ 504 [itcl::code $this _zoom in] 505 506 bind $itk_component(3dview) <Enter> "focus $itk_component(3dview)" 507 483 508 if {[string equal "x11" [tk windowingsystem]]} { 509 # Bindings for zoom via mouse 484 510 bind $itk_component(3dview) <4> [itcl::code $this _zoom out] 485 511 bind $itk_component(3dview) <5> [itcl::code $this _zoom in] … … 504 530 image delete $_image(legend) 505 531 image delete $_image(download) 506 array unset _settings$this-*532 array unset settings_ $this-* 507 533 } 508 534 … … 638 664 itcl::body Rappture::NanovisViewer::scale {args} { 639 665 foreach val {xmin xmax ymin ymax zmin zmax vmin vmax} { 640 set _limits($val) ""666 set limits_($val) "" 641 667 } 642 668 foreach obj $args { … … 646 672 647 673 if {"" != $min && "" != $max} { 648 if {"" == $ _limits(${axis}min)} {649 set _limits(${axis}min) $min650 set _limits(${axis}max) $max674 if {"" == $limits_(${axis}min)} { 675 set limits_(${axis}min) $min 676 set limits_(${axis}max) $max 651 677 } else { 652 if {$min < $ _limits(${axis}min)} {653 set _limits(${axis}min) $min678 if {$min < $limits_(${axis}min)} { 679 set limits_(${axis}min) $min 654 680 } 655 if {$max > $ _limits(${axis}max)} {656 set _limits(${axis}max) $max681 if {$max > $limits_(${axis}max)} { 682 set limits_(${axis}max) $max 657 683 } 658 684 } … … 737 763 738 764 # disconnected -- no more data sitting on server 739 set _outbuf""765 set outbuf_ "" 740 766 catch {unset _obj2id} 741 767 array unset _id2obj … … 754 780 itcl::body Rappture::NanovisViewer::_send {string} { 755 781 if {[llength $_sendobjs] > 0} { 756 append _outbuf$string "\n"782 append outbuf_ $string "\n" 757 783 } else { 758 784 foreach line [split $string \n] { … … 806 832 # transferred. 807 833 set comp [lindex [$first components] 0] 808 set _activeId$_obj2id($first-$comp)834 set activeId_ $_obj2id($first-$comp) 809 835 } 810 836 foreach key [array names _obj2id *-*] { … … 833 859 } 834 860 # if there are any commands in the buffer, send them now that we're done 835 SendBytes $ _outbuf836 set _outbuf""861 SendBytes $outbuf_ 862 set outbuf_ "" 837 863 838 864 $_dispatcher event -idle !legend … … 847 873 # Insure that the global opacity and thickness settings (in the slider 848 874 # settings widgets) are used for the transfer-function used by the active 849 # volume. Update the values in the _settingsvarible.875 # volume. Update the values in the settings_ varible. 850 876 set inner [$itk_component(controls).panel component inner] 851 set tf $_id2style($ _activeId)877 set tf $_id2style($activeId_) 852 878 set value [$inner.scales.opacity get] 853 879 set opacity [expr { double($value) * 0.01 }] 854 set _settings($this-$tf-opacity) $opacity880 set settings_($this-$tf-opacity) $opacity 855 881 set value [$inner.scales.thickness get] 856 882 # Scale values between 0.00001 and 0.01000 857 883 set thickness [expr {double($value) * 0.0001}] 858 set _settings($this-$tf-thickness) $thickness884 set settings_($this-$tf-thickness) $thickness 859 885 860 886 if { ![info exists $_obj2styles($first)] } { … … 932 958 933 959 # Display the markers used by the active volume. 934 set tf $_id2style($ _activeId)935 if { [info exists _isomarkers($tf)] } {936 foreach m $ _isomarkers($tf) {960 set tf $_id2style($activeId_) 961 if { [info exists isomarkers_($tf)] } { 962 foreach m $isomarkers_($tf) { 937 963 $m Show 938 964 } … … 970 996 set ivol $info(id); # Id of volume created by server. 971 997 972 set _limits($ivol-min) $info(min); # Minimum value of the volume.973 set _limits($ivol-max) $info(max); # Maximum value of the volume.974 set _limits(vmin) $info(vmin); # Overall minimum value.975 set _limits(vmax) $info(vmax); # Overall maximum value.998 set limits_($ivol-min) $info(min); # Minimum value of the volume. 999 set limits_($ivol-max) $info(max); # Maximum value of the volume. 1000 set limits_(vmin) $info(vmin); # Overall minimum value. 1001 set limits_(vmax) $info(vmax); # Overall maximum value. 976 1002 977 1003 unset _receiveids($ivol) … … 1011 1037 # settings since the user may have created/deleted/moved markers. 1012 1038 1013 foreach tf [array names _isomarkers] {1014 foreach m $ _isomarkers($tf) {1039 foreach tf [array names isomarkers_] { 1040 foreach m $isomarkers_($tf) { 1015 1041 $m Hide 1016 1042 } … … 1041 1067 # Reset the camera and other view parameters 1042 1068 # 1043 set xyz [Euler2XYZ $ _view(theta) $_view(phi) $_view(psi)]1069 set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)] 1044 1070 _send "camera angle $xyz" 1045 _send "camera zoom $ _view(zoom)"1071 _send "camera zoom $view_(zoom)" 1046 1072 1047 1073 _fixSettings light … … 1135 1161 switch -- $option { 1136 1162 "in" { 1137 set _view(zoom) [expr {$_view(zoom)* 1.25}]1163 set view_(zoom) [expr {$view_(zoom)* 1.25}] 1138 1164 } 1139 1165 "out" { 1140 set _view(zoom) [expr {$_view(zoom)* 0.8}]1166 set view_(zoom) [expr {$view_(zoom)* 0.8}] 1141 1167 } 1142 1168 "reset" { 1143 array set _view{1169 array set view_ { 1144 1170 theta 45 1145 1171 phi 45 … … 1147 1173 zoom 1.0 1148 1174 } 1149 set xyz [Euler2XYZ $ _view(theta) $_view(phi) $_view(psi)]1175 set xyz [Euler2XYZ $view_(theta) $view_(phi) $view_(psi)] 1150 1176 _send "camera angle $xyz" 1151 1177 } 1152 1178 } 1153 _send "camera zoom $ _view(zoom)"1179 _send "camera zoom $view_(zoom)" 1154 1180 } 1155 1181 … … 1166 1192 click { 1167 1193 $itk_component(3dview) configure -cursor fleur 1168 set _click(x) $x1169 set _click(y) $y1170 set _click(theta) $_view(theta)1171 set _click(phi) $_view(phi)1194 set click_(x) $x 1195 set click_(y) $y 1196 set click_(theta) $view_(theta) 1197 set click_(phi) $view_(phi) 1172 1198 } 1173 1199 drag { 1174 if {[array size _click] == 0} {1200 if {[array size click_] == 0} { 1175 1201 _rotate click $x $y 1176 1202 } else { … … 1183 1209 if {[catch { 1184 1210 # this fails sometimes for no apparent reason 1185 set dx [expr {double($x-$ _click(x))/$w}]1186 set dy [expr {double($y-$ _click(y))/$h}]1211 set dx [expr {double($x-$click_(x))/$w}] 1212 set dy [expr {double($y-$click_(y))/$h}] 1187 1213 }]} { 1188 1214 return … … 1192 1218 # Rotate the camera in 3D 1193 1219 # 1194 if {$ _view(psi) > 90 || $_view(psi) < -90} {1220 if {$view_(psi) > 90 || $view_(psi) < -90} { 1195 1221 # when psi is flipped around, theta moves backwards 1196 1222 set dy [expr {-$dy}] 1197 1223 } 1198 set theta [expr {$ _view(theta) - $dy*180}]1224 set theta [expr {$view_(theta) - $dy*180}] 1199 1225 while {$theta < 0} { set theta [expr {$theta+180}] } 1200 1226 while {$theta > 180} { set theta [expr {$theta-180}] } 1201 1227 1202 1228 if {abs($theta) >= 30 && abs($theta) <= 160} { 1203 set phi [expr {$ _view(phi) - $dx*360}]1229 set phi [expr {$view_(phi) - $dx*360}] 1204 1230 while {$phi < 0} { set phi [expr {$phi+360}] } 1205 1231 while {$phi > 360} { set phi [expr {$phi-360}] } 1206 set psi $ _view(psi)1232 set psi $view_(psi) 1207 1233 } else { 1208 set phi $ _view(phi)1209 set psi [expr {$ _view(psi) - $dx*360}]1234 set phi $view_(phi) 1235 set psi [expr {$view_(psi) - $dx*360}] 1210 1236 while {$psi < -180} { set psi [expr {$psi+360}] } 1211 1237 while {$psi > 180} { set psi [expr {$psi-360}] } 1212 1238 } 1213 1239 1214 array set _view[subst {1240 array set view_ [subst { 1215 1241 theta $theta 1216 1242 phi $phi … … 1219 1245 set xyz [Euler2XYZ $theta $phi $psi] 1220 1246 _send "camera angle $xyz" 1221 set _click(x) $x1222 set _click(y) $y1247 set click_(x) $x 1248 set click_(y) $y 1223 1249 } 1224 1250 } … … 1226 1252 _rotate drag $x $y 1227 1253 $itk_component(3dview) configure -cursor "" 1228 catch {unset _click}1254 catch {unset click_} 1229 1255 } 1230 1256 default { … … 1245 1271 return 1246 1272 # Experimental stuff 1273 if { $option == "set" } { 1274 set dx $x 1275 set dy $y 1276 set view_(x) [expr $view_(x) + $dx] 1277 set view_(y) [expr $view_(y) + $dy] 1278 _send "pan $dx $dy" 1279 return 1280 } 1247 1281 if { $option == "click" } { 1248 1282 $itk_component(3dview) configure -cursor hand1 1249 1283 } 1250 1284 if { $option == "drag" || $option == "release" } { 1251 set _view(x) [expr $_view(x) + $x]1252 set _view(y) [expr $_view(y) + $y]1253 _send "camera pan $ _view(x) $_view(y) 0"1285 set view_(x) [expr $view_(x) + $x] 1286 set view_(y) [expr $view_(y) + $y] 1287 _send "camera pan $view_(x) $view_(y) 0" 1254 1288 } 1255 1289 if { $option == "release" } { … … 1301 1335 set newpos [expr {0.01*$newval}] 1302 1336 # set newval [expr {0.01*($newval-50) 1303 # *($ _limits(${axis}max)-$_limits(${axis}min))1304 # + 0.5*($ _limits(${axis}max)+$_limits(${axis}min))}]1337 # *($limits_(${axis}max)-$limits_(${axis}min)) 1338 # + 0.5*($limits_(${axis}max)+$limits_(${axis}min))}] 1305 1339 1306 1340 # show the current value in the readout … … 1345 1379 set val [$itk_component(${axis}slicer) get] 1346 1380 # set val [expr {0.01*($val-50) 1347 # *($ _limits(${axis}max)-$_limits(${axis}min))1348 # + 0.5*($ _limits(${axis}max)+$_limits(${axis}min))}]1381 # *($limits_(${axis}max)-$limits_(${axis}min)) 1382 # + 0.5*($limits_(${axis}max)+$limits_(${axis}min))}] 1349 1383 return "Move the [string toupper $axis] cut plane.\nCurrently: $axis = $val%" 1350 1384 } … … 1392 1426 } 1393 1427 opacity { 1394 if {[isconnected] && $ _activeId!= "" } {1428 if {[isconnected] && $activeId_ != "" } { 1395 1429 set val [$inner.scales.opacity get] 1396 1430 set sval [expr { 0.01 * double($val) }] 1397 set tf $_id2style($ _activeId)1398 set _settings($this-$tf-opacity) $sval1431 set tf $_id2style($activeId_) 1432 set settings_($this-$tf-opacity) $sval 1399 1433 UpdateTransferFunctions 1400 1434 } … … 1402 1436 1403 1437 thickness { 1404 if {[isconnected] && $ _activeId!= "" } {1438 if {[isconnected] && $activeId_ != "" } { 1405 1439 set val [$inner.scales.thickness get] 1406 1440 # Scale values between 0.00001 and 0.01000 1407 1441 set sval [expr {0.0001*double($val)}] 1408 set tf $_id2style($ _activeId)1409 set _settings($this-$tf-thickness) $sval1442 set tf $_id2style($activeId_) 1443 set settings_($this-$tf-thickness) $sval 1410 1444 UpdateTransferFunctions 1411 1445 } … … 1413 1447 "outline" { 1414 1448 if {[isconnected]} { 1415 _send "volume outline state $ _settings($this-outline)"1449 _send "volume outline state $settings_($this-outline)" 1416 1450 } 1417 1451 } 1418 1452 "isosurface" { 1419 1453 if {[isconnected]} { 1420 _send "volume shading isosurface $ _settings($this-isosurface)"1454 _send "volume shading isosurface $settings_($this-isosurface)" 1421 1455 } 1422 1456 } 1423 1457 "grid" { 1424 1458 if { [isconnected] } { 1425 _send "grid visible $ _settings($this-grid)"1459 _send "grid visible $settings_($this-grid)" 1426 1460 } 1427 1461 } 1428 1462 "axes" { 1429 1463 if { [isconnected] } { 1430 _send "axis visible $ _settings($this-axes)"1464 _send "axis visible $settings_($this-axes)" 1431 1465 } 1432 1466 } … … 1448 1482 set w [expr {[winfo width $itk_component(legend)]-20}] 1449 1483 set h [expr {[winfo height $itk_component(legend)]-20-$lineht}] 1450 set ivol $ _activeId1484 set ivol $activeId_ 1451 1485 if {$w > 0 && $h > 0 && "" != $ivol} { 1452 1486 _send "legend $ivol $w $h" … … 1522 1556 # barn on this one. 1523 1557 1524 if { ![info exists _isomarkers($tf)] } {1558 if { ![info exists isomarkers_($tf)] } { 1525 1559 # Have to defer creation of isomarkers until we have data limits 1526 1560 if { [info exists style(-markers)] } { … … 1543 1577 1544 1578 set tag $this-$tf 1545 if { ![info exists _settings($tag-opacity)] } {1546 set _settings($tag-opacity) $style(-opacity)1547 } 1548 set max $ _settings($tag-opacity)1579 if { ![info exists settings_($tag-opacity)] } { 1580 set settings_($tag-opacity) $style(-opacity) 1581 } 1582 set max $settings_($tag-opacity) 1549 1583 1550 1584 set isovalues {} 1551 foreach m $ _isomarkers($tf) {1585 foreach m $isomarkers_($tf) { 1552 1586 lappend isovalues [$m GetRelativeValue] 1553 1587 } … … 1555 1589 set isovalues [lsort -real $isovalues] 1556 1590 1557 if { ![info exists _settings($tag-thickness)]} {1558 set _settings($tag-thickness) 0.051559 } 1560 set delta $ _settings($tag-thickness)1591 if { ![info exists settings_($tag-thickness)]} { 1592 set settings_($tag-thickness) 0.05 1593 } 1594 set delta $settings_($tag-thickness) 1561 1595 1562 1596 set first [lindex $isovalues 0] … … 1657 1691 set m [IsoMarker \#auto $c $this $ivol] 1658 1692 $m SetRelativeValue $x 1659 lappend _isomarkers($tf) $m1693 lappend isomarkers_($tf) $m 1660 1694 } 1661 1695 } else { … … 1663 1697 set m [IsoMarker \#auto $c $this $ivol] 1664 1698 $m SetRelativeValue $x 1665 lappend _isomarkers($tf) $m1699 lappend isomarkers_($tf) $m 1666 1700 } 1667 1701 } … … 1690 1724 set m [IsoMarker \#auto $c $this $ivol] 1691 1725 $m SetRelativeValue $value 1692 lappend _isomarkers($tf) $m1726 lappend isomarkers_($tf) $m 1693 1727 } else { 1694 1728 # ${n} : Set absolute value. 1695 1729 set m [IsoMarker \#auto $c $this $ivol] 1696 1730 $m SetAbsoluteValue $value 1697 lappend _isomarkers($tf) $m1731 lappend isomarkers_($tf) $m 1698 1732 } 1699 1733 } … … 1715 1749 1716 1750 itcl::body Rappture::NanovisViewer::_AddIsoMarker { x y } { 1717 if { $ _activeId== "" } {1751 if { $activeId_ == "" } { 1718 1752 error "active volume isn't set" 1719 1753 } 1720 set tf $_id2style($ _activeId)1754 set tf $_id2style($activeId_) 1721 1755 set c $itk_component(legend) 1722 set m [IsoMarker \#auto $c $this $ _activeId]1756 set m [IsoMarker \#auto $c $this $activeId_] 1723 1757 set w [winfo width $c] 1724 1758 $m SetRelativeValue [expr {double($x-10)/($w-20)}] 1725 lappend _isomarkers($tf) $m1759 lappend isomarkers_($tf) $m 1726 1760 UpdateTransferFunctions 1727 1761 return 1 … … 1732 1766 set tf $_id2style($ivol) 1733 1767 set bool 0 1734 if { [info exists _isomarkers($tf)] } {1768 if { [info exists isomarkers_($tf)] } { 1735 1769 set list {} 1736 1770 set marker [namespace tail $marker] 1737 foreach m $ _isomarkers($tf) {1771 foreach m $isomarkers_($tf) { 1738 1772 set sx [$m GetScreenPosition] 1739 1773 if { $m != $marker } { … … 1748 1782 lappend list $m 1749 1783 } 1750 set _isomarkers($tf) $list1784 set isomarkers_($tf) $list 1751 1785 UpdateTransferFunctions 1752 1786 } … … 1756 1790 itcl::body Rappture::NanovisViewer::OverIsoMarker { marker x } { 1757 1791 set ivol [$marker GetVolume] 1758 if { [info exists _isomarkers($ivol)] } {1792 if { [info exists isomarkers_($ivol)] } { 1759 1793 set marker [namespace tail $marker] 1760 foreach m $ _isomarkers($ivol) {1794 foreach m $isomarkers_($ivol) { 1761 1795 set sx [$m GetScreenPosition] 1762 1796 if { $m != $marker } { … … 1774 1808 } 1775 1809 set tf $_id2style($ivol) 1776 set _limits(min) ""1777 set _limits(max) ""1810 set limits_(min) "" 1811 set limits_(max) "" 1778 1812 foreach ivol $_style2ids($tf) { 1779 if { ![info exists _limits($ivol-min)] } {1813 if { ![info exists limits_($ivol-min)] } { 1780 1814 error "can't find $ivol limits" 1781 1815 } 1782 if { $ _limits(min) == "" || $_limits(min) > $_limits($ivol-min) } {1783 set _limits(min) $_limits($ivol-min)1816 if { $limits_(min) == "" || $limits_(min) > $limits_($ivol-min) } { 1817 set limits_(min) $limits_($ivol-min) 1784 1818 } 1785 if { $ _limits(max) == "" || $_limits(max) < $_limits($ivol-max) } {1786 set _limits(max) $_limits($ivol-max)1819 if { $limits_(max) == "" || $limits_(max) < $limits_($ivol-max) } { 1820 set limits_(max) $limits_($ivol-max) 1787 1821 } 1788 1822 } 1789 return [array get _limits]1790 } 1823 return [array get limits_] 1824 } -
trunk/gui/scripts/visviewer.tcl
r1221 r1228 23 23 24 24 private common servers_ ;# array of visualization server lists 25 set servers_(nanovis) " "26 set servers_(pymol) " "25 set servers_(nanovis) "bilby.hubzero.org:2000" 26 set servers_(pymol) "bilby.hubzero.org:2020" 27 27 28 28 private variable sid_ "" ;# socket connection to server -
trunk/lang/matlab/Makefile.in
r1121 r1228 68 68 rpUtilsProgress$(EXT) 69 69 70 # MEX can't be run in parallel since it generates temporary files 71 # that collide with further compilations. 72 .NOTPARALLEL: 73 70 74 all: $(OBJS) 71 75 -
trunk/packages/vizservers/nanovis/Makefile.in
r1120 r1228 169 169 install: install-nanovis install-resources install-shaders 170 170 171 mat_lib: 171 mat_lib: $(MAT_LIB) 172 r2_lib: $(R2_LIB) 173 img_lib: $(IMG_LIB) 174 tf_lib: $(TF_LIB) 175 176 $(MAT_LIB): 172 177 $(MAKE) -C $(MAT_DIR) all 173 178 174 r2_lib:179 $(R2_LIB): 175 180 $(MAKE) -C $(R2_DIR)/src all 176 181 177 img_lib:182 $(IMG_LIB): 178 183 $(MAKE) -C $(IMG_DIR) all 179 184 180 tf_lib:185 $(TF_LIB): 181 186 $(MAKE) -C $(TF_DIR) all 182 187 -
trunk/src/Makefile.in
r1082 r1228 36 36 all: core core2 objects 37 37 38 core: 38 RAPPTURE_LIB = core/librappture.a 39 40 core: $(RAPPTURE_LIB) 41 42 $(RAPPTURE_LIB): 39 43 $(MAKE) -C core all 40 core2: 44 45 core2: $(RAPPTURE_LIB) 41 46 $(MAKE) -C core2 all 42 objects: 47 48 objects: $(RAPPTURE_LIB) 43 49 $(MAKE) -C objects all 44 50 45 install: 51 install: $(RAPPTURE_LIB) 46 52 $(MAKE) -C core install 47 53 $(MAKE) -C core2 install
Note: See TracChangeset
for help on using the changeset viewer.