Ignore:
Timestamp:
Mar 3, 2013, 6:19:57 PM (12 years ago)
Author:
gah
Message:

fix for sequence of contours

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/vtkheightmapviewer.tcl

    r3424 r3428  
    5858    public method get {args}
    5959    public method isconnected {}
    60     public method limits { dataobj }
     60    public method limits3 { dataobj }
    6161    public method parameters {title args} {
    6262        # do nothing
     
    608608# ----------------------------------------------------------------------
    609609itcl::body Rappture::VtkHeightmapViewer::scale {args} {
    610     array unset _limits
    611610    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]
    615613            if { ![info exists _limits($axis)] } {
    616                 set _limits($axis) $bounds($axis)
     614                set _limits($axis) $lim
    617615                continue
    618616            }
     617            foreach {min max} $lim break
    619618            foreach {amin amax} $_limits($axis) break
    620619            if { $amin > $min } {
     
    625624            }
    626625            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]
    627641        }
    628642    }
     
    16101624#
    16111625itcl::body Rappture::VtkHeightmapViewer::ResetAxes {} {
    1612     if { ![info exists _limits(v)] || ![info exists _fields($_curFldName)]} {
     1626    if { ![info exists _fields($_curFldName)]} {
    16131627        SendCmd "dataset maprange all"
    16141628        SendCmd "axis autorange z on"
     
    16181632    foreach { xmin xmax } $_limits(x) break
    16191633    foreach { ymin ymax } $_limits(y) break
    1620     foreach { vmin vmax } $_limits(v) break
     1634    foreach { vmin vmax } $_limits($_curFldName) break
    16211635    set dataRange   [expr $vmax - $vmin]
    16221636    set boundsRange [expr $xmax - $xmin]
     
    16331647    set bMin [expr $heightScale * $dataScale * $vmin]
    16341648    set bMax [expr $heightScale * $dataScale * $vmax]
    1635     SendCmd "dataset maprange explicit $_limits(v) $_curFldName"
     1649    SendCmd "dataset maprange explicit $_limits($_curFldName) $_curFldName"
    16361650    SendCmd "axis bounds z $bMin $bMax"
    1637     SendCmd "axis range z $_limits(v)"
     1651    SendCmd "axis range z $_limits($_curFldName)"
    16381652}
    16391653
     
    17171731}
    17181732
    1719 itcl::body Rappture::VtkHeightmapViewer::limits { dataobj } {
     1733itcl::body Rappture::VtkHeightmapViewer::limits3 { dataobj } {
    17201734    lappend limits x [$dataobj limits x]
    17211735    lappend limits y [$dataobj limits y]
     
    22502264
    22512265    # Draw the isolines on the legend.
    2252     if { $color != "none"  &&
     2266    if { $color != "none"  && [info exists _limits($_curFldName)] &&
    22532267         $_settings(isolinesVisible) && $_settings(numIsolines) > 0 } {
    22542268        set pixels [blt::vector create \#auto]
     
    22652279        $pixels expr {round($pixels + $offset)}
    22662280        # Order of values is min to max.
    2267         foreach { vmin vmax } $_limits(v) break
     2281        foreach { vmin vmax } $_limits($_curFldName) break
    22682282        $values seq $vmin $vmax $_settings(numIsolines)
    22692283        set tags "isoline legend"
     
    22812295    $c bind title <Leave> [itcl::code $this Combo deactivate]
    22822296    # Reset the item coordinates according the current size of the plot.
    2283     if { [info exists _limits(v)] } {
    2284         foreach { vmin vmax } $_limits(v) break
     2297    if { [info exists _limits($_curFldName)] } {
     2298        foreach { vmin vmax } $_limits($_curFldName) break
    22852299        $c itemconfigure vmin -text [format %g $vmin]
    22862300        $c itemconfigure vmax -text [format %g $vmax]
     
    23932407
    23942408    # Compute the value of the point
    2395     if { [info exists _limits(v)] } {
    2396         foreach { vmin vmax } $_limits(v) break
     2409    if { [info exists _limits($_curFldName)] } {
     2410        foreach { vmin vmax } $_limits($_curFldName) break
    23972411        set t [expr 1.0 - (double($iy) / double($ih-1))]
    23982412        set value [expr $t * ($vmax - $vmin) + $vmin]
Note: See TracChangeset for help on using the changeset viewer.