Changeset 3428 for trunk/gui/scripts/vtkheightmapviewer.tcl
- Timestamp:
- Mar 3, 2013, 6:19:57 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkheightmapviewer.tcl
r3424 r3428 58 58 public method get {args} 59 59 public method isconnected {} 60 public method limits { dataobj }60 public method limits3 { dataobj } 61 61 public method parameters {title args} { 62 62 # do nothing … … 608 608 # ---------------------------------------------------------------------- 609 609 itcl::body Rappture::VtkHeightmapViewer::scale {args} { 610 array unset _limits611 610 foreach dataobj $args { 612 array set bounds [limits $dataobj] 613 foreach axis { x y v } { 614 foreach {min max} $bounds($axis) break 611 foreach axis { x y } { 612 set lim [$dataobj limits $axis] 615 613 if { ![info exists _limits($axis)] } { 616 set _limits($axis) $ bounds($axis)614 set _limits($axis) $lim 617 615 continue 618 616 } 617 foreach {min max} $lim break 619 618 foreach {amin amax} $_limits($axis) break 620 619 if { $amin > $min } { … … 625 624 } 626 625 set _limits($axis) [list $amin $amax] 626 } 627 foreach { fname lim } [$dataobj limits2] { 628 if { ![info exists _limits($fname)] } { 629 set _limits($fname) $lim 630 continue 631 } 632 foreach {min max} $lim break 633 foreach {fmin fmax} $_limits($fname) break 634 if { $fmin > $min } { 635 set fmin $min 636 } 637 if { $fmax < $max } { 638 set fmax $max 639 } 640 set _limits($fname) [list $fmin $fmax] 627 641 } 628 642 } … … 1610 1624 # 1611 1625 itcl::body Rappture::VtkHeightmapViewer::ResetAxes {} { 1612 if { ![info exists _ limits(v)] || ![info exists _fields($_curFldName)]} {1626 if { ![info exists _fields($_curFldName)]} { 1613 1627 SendCmd "dataset maprange all" 1614 1628 SendCmd "axis autorange z on" … … 1618 1632 foreach { xmin xmax } $_limits(x) break 1619 1633 foreach { ymin ymax } $_limits(y) break 1620 foreach { vmin vmax } $_limits( v) break1634 foreach { vmin vmax } $_limits($_curFldName) break 1621 1635 set dataRange [expr $vmax - $vmin] 1622 1636 set boundsRange [expr $xmax - $xmin] … … 1633 1647 set bMin [expr $heightScale * $dataScale * $vmin] 1634 1648 set bMax [expr $heightScale * $dataScale * $vmax] 1635 SendCmd "dataset maprange explicit $_limits( v) $_curFldName"1649 SendCmd "dataset maprange explicit $_limits($_curFldName) $_curFldName" 1636 1650 SendCmd "axis bounds z $bMin $bMax" 1637 SendCmd "axis range z $_limits( v)"1651 SendCmd "axis range z $_limits($_curFldName)" 1638 1652 } 1639 1653 … … 1717 1731 } 1718 1732 1719 itcl::body Rappture::VtkHeightmapViewer::limits { dataobj } {1733 itcl::body Rappture::VtkHeightmapViewer::limits3 { dataobj } { 1720 1734 lappend limits x [$dataobj limits x] 1721 1735 lappend limits y [$dataobj limits y] … … 2250 2264 2251 2265 # Draw the isolines on the legend. 2252 if { $color != "none" && 2266 if { $color != "none" && [info exists _limits($_curFldName)] && 2253 2267 $_settings(isolinesVisible) && $_settings(numIsolines) > 0 } { 2254 2268 set pixels [blt::vector create \#auto] … … 2265 2279 $pixels expr {round($pixels + $offset)} 2266 2280 # Order of values is min to max. 2267 foreach { vmin vmax } $_limits( v) break2281 foreach { vmin vmax } $_limits($_curFldName) break 2268 2282 $values seq $vmin $vmax $_settings(numIsolines) 2269 2283 set tags "isoline legend" … … 2281 2295 $c bind title <Leave> [itcl::code $this Combo deactivate] 2282 2296 # Reset the item coordinates according the current size of the plot. 2283 if { [info exists _limits( v)] } {2284 foreach { vmin vmax } $_limits( v) break2297 if { [info exists _limits($_curFldName)] } { 2298 foreach { vmin vmax } $_limits($_curFldName) break 2285 2299 $c itemconfigure vmin -text [format %g $vmin] 2286 2300 $c itemconfigure vmax -text [format %g $vmax] … … 2393 2407 2394 2408 # Compute the value of the point 2395 if { [info exists _limits( v)] } {2396 foreach { vmin vmax } $_limits( v) break2409 if { [info exists _limits($_curFldName)] } { 2410 foreach { vmin vmax } $_limits($_curFldName) break 2397 2411 set t [expr 1.0 - (double($iy) / double($ih-1))] 2398 2412 set value [expr $t * ($vmax - $vmin) + $vmin]
Note: See TracChangeset
for help on using the changeset viewer.