Ignore:
Timestamp:
Mar 2, 2013 1:15:17 PM (11 years ago)
Author:
gah
Message:

nanovis missing _ in of _width, isosurface broke with wrong component name, streamlines default axis names changed to X, Y, and Z

File:
1 edited

Legend:

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

    r3405 r3409  
    158158    private variable _fieldNames {}
    159159    private variable _fields
    160     private variable _curFldName "Default"
     160    private variable _curFldName ""
     161    private variable _curFldLabel ""
    161162    private variable _numContours 0
    162163    private variable _colorMode "vmag";#  Mode of colormap (vmag or scalar)
     
    10121013                foreach { label units components } \
    10131014                    [$_first fieldinfo $fname] break
    1014                 SendCmd "dataset maprange explicit $_limits(v) $fname"
    10151015                $itk_component(field) choices insert end "$fname" "$label"
    10161016                $itk_component(fieldmenu) add radiobutton -label "$label" \
    1017                     -value $label -variable [itcl::scope _curFldName] \
     1017                    -value $label -variable [itcl::scope _curFldLabel] \
    10181018                    -selectcolor red \
    10191019                    -activebackground $itk_option(-plotbackground) \
     
    10231023                set _fields($fname) [list $label $units $components]
    10241024                set _curFldName $fname
    1025             }
    1026         }
    1027         if { [array size _fields] == 1 } {
    1028             set _curFldName [array names _fields]
    1029             if { $_curFldName == "" } {
    1030                 puts stderr "no default name from field"
    1031                 set _curFldName "Default"
    1032             }
    1033         }
    1034         $itk_component(field) value $_curFldName
     1025                set _curFldLabel $label
     1026            }
     1027        }
     1028        $itk_component(field) value $_curFldLabel
    10351029    }
    10361030    InitSettings stretchToFit
     
    10411035            SendCmd "axis lformat $axis %g"
    10421036        }
     1037       
    10431038        foreach axis { x y z } {
    10441039            set label [$_first hints ${axis}label]
     
    10481043                        set label [string toupper $axis]
    10491044                    } else {
    1050                         set label [lindex $_fields($_curFldName) 0]
     1045                        set label $_curFldLabel
    10511046                    }
    10521047                } else {
     
    14911486        }
    14921487        "field" {
    1493             set new   [$itk_component(field) value]
    1494             set value [$itk_component(field) translate $new]
    1495             set _settings(field) $value
    1496             if { [info exists _fields($new)] } {
    1497                 set _colorMode scalar
    1498                 set _curFldName $new
     1488            set label [$itk_component(field) value]
     1489            set fname [$itk_component(field) translate $label]
     1490            set _settings(field) $fname
     1491            if { [info exists _fields($fname)] } {
     1492                foreach { label units components } $_fields($fname) break
     1493                if { $components > 1 } {
     1494                    set _colorMode vmag
     1495                } else {
     1496                    set _colorMode scalar
     1497                }
     1498                set _curFldName $fname
     1499                set _curFldLabel $label
    14991500            } else {
    1500                 puts stderr "unknown field \"$new\""
     1501                puts stderr "unknown field \"$fname\""
    15011502                return
    15021503            }
     
    16101611        return
    16111612    }
    1612     if { [info exists _fields($_curFldName)] } {
    1613         set title [lindex $_fields($_curFldName) 0]
    1614         if { $title != "component" } {
    1615             set h [expr $h - ($lineht + 2)]
    1616         }
    1617     } else {
    1618         return
    1619     }
    16201613    # Set the legend on the first heightmap dataset.
    16211614    if { $_currentColormap != ""  } {
     
    16561649    set bMin [expr $heightScale * $dataScale * $vmin]
    16571650    set bMax [expr $heightScale * $dataScale * $vmax]
    1658     set fieldName $_curFldName
    1659     SendCmd "dataset maprange explicit $_limits(v) $fieldName"
     1651    SendCmd "dataset maprange explicit $_limits(v) $_curFldName"
    16601652    SendCmd "axis bounds z $bMin $bMax"
    16611653    SendCmd "axis range z $_limits(v)"
     
    24402432        }
    24412433        invoke {
    2442             $itk_component(field) value $_curFldName
     2434            $itk_component(field) value $_curFldLabel
    24432435            AdjustSetting field
    24442436        }
Note: See TracChangeset for help on using the changeset viewer.