Changeset 3405


Ignore:
Timestamp:
Mar 1, 2013 1:07:44 PM (10 years ago)
Author:
gah
Message:

fix to streamlines to (again) display mulitple fields from a single VTK file

Location:
trunk/gui
Files:
5 edited

Legend:

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

    r3365 r3405  
    5656    private variable _xmlobj ""  ;      # ref to XML obj with field data
    5757    private variable _limits     ;      # maps box name => {z0 z1} limits
    58     private variable _field ""
    59     private variable _fieldNames ""   ; # list of field names.
    60     private variable _fieldUnits ""   ; # list of units of each field name.
    61     private variable _fieldLabels ""  ; # list of labels of each field name.
    62     private variable _viewer            ""
     58    private variable _fldObj ""
     59    private variable _comp2fields ;     # cname => field names.
     60    private variable _field2Components; # field name => number of components
     61    private variable _field2Label;      # field name => label
     62    private variable _field2Units;      # field name => units
    6363    private variable _hints
    64 
     64    private variable _viewer "";        # Hints which viewer to use
    6565    constructor {xmlobj path} {
    6666        # defined below
     
    8686    }
    8787    public method vtkdata {cname}
    88    
     88    public method fieldnames { cname } {
     89        if { ![info exists _comp2fields($cname)] } {
     90            return ""
     91        }
     92        return $_comp2fields($cname)
     93    }
     94    public method fieldinfo { fname } {
     95        lappend out $_field2Label($fname)
     96        lappend out $_field2Units($fname)
     97        lappend out $_field2Components($fname)
     98        return $out
     99    }
    89100    protected method Build {}
    90101    protected method _getValue {expr}
     
    125136    set _xmlobj $xmlobj
    126137    set _path $path
    127     set _field [$xmlobj element -as object $path]
    128     set _units [$_field get units]
     138    set _fldObj [$xmlobj element -as object $path]
     139    set _units [$_fldObj get units]
    129140
    130141    set xunits [$xmlobj get units]
     
    163174# ----------------------------------------------------------------------
    164175itcl::body Rappture::Field::destructor {} {
    165     itcl::delete object $_field
     176    itcl::delete object $_fldObj
    166177    # don't destroy the _xmlobj! we don't own it!
    167178
     
    218229
    219230    # BE CAREFUL: return component names in proper order
    220     foreach cname [$_field children -type component] {
     231    foreach cname [$_fldObj children -type component] {
    221232        if {[info exists _comp2dims($cname)]
    222233              && [string match $pattern $cname]} {
     
    439450    }
    440451    blt::vector destroy tmp zero
    441     set val [$_field get "${axis}axis.min"]
     452    set val [$_fldObj get "${axis}axis.min"]
    442453    if {"" != $val && "" != $min} {
    443454        if {$val > $min} {
     
    446457        }
    447458    }
    448     set val [$_field get "${axis}axis.max"]
     459    set val [$_fldObj get "${axis}axis.max"]
    449460    if {"" != $val && "" != $max} {
    450461        if {$val < $max} {
     
    550561itcl::body Rappture::Field::hints {{keyword ""}} {
    551562    if { ![info exists _hints] } {
    552         set _hints(fieldnames)  $_fieldNames
    553         set _hints(fieldunits)  $_fieldUnits
    554         set _hints(fieldlabels) $_fieldLabels
    555563        foreach {key path} {
    556564            camera          camera.position
     
    559567            group           about.group
    560568            label           about.label
    561             fieldnames      about.fieldnames
    562             fieldunits      about.fieldunits
    563             fieldlabels     about.fieldlabels
    564569            scale           about.scale
    565570            seeds           about.seeds
     
    576581            vectors         about.vectors
    577582        } {
    578             set str [$_field get $path]
     583            set str [$_fldObj get $path]
    579584            if { "" != $str } {
    580585                set _hints($key) $str
     
    642647    # vectors for each part.
    643648    #
    644     foreach cname [$_field children -type component] {
     649    foreach cname [$_fldObj children -type component] {
    645650        set type ""
    646         if { ([$_field element $cname.constant] != "" &&
    647               [$_field element $cname.domain] != "") ||
    648               [$_field element $cname.xy] != "" } {
     651        if { ([$_fldObj element $cname.constant] != "" &&
     652              [$_fldObj element $cname.domain] != "") ||
     653              [$_fldObj element $cname.xy] != "" } {
    649654            set type "1D"
    650         } elseif { [$_field element $cname.mesh] != "" &&
    651                    [$_field element $cname.values] != ""} {
     655        } elseif { [$_fldObj element $cname.mesh] != "" &&
     656                   [$_fldObj element $cname.values] != ""} {
    652657            set type "points-on-mesh"
    653         } elseif { [$_field element $cname.vtk] != ""} {
    654             set viewer [$_field get "about.view"]
     658        } elseif { [$_fldObj element $cname.vtk] != ""} {
     659            set viewer [$_fldObj get "about.view"]
    655660            set type "vtk"
    656661            if { $viewer != "" } {
    657662                set _viewer $viewer
    658663            }
    659         } elseif {[$_field element $cname.opendx] != ""} {
     664        } elseif {[$_fldObj element $cname.opendx] != ""} {
    660665            global env
    661666            if { [info exists env(VTKVOLUME)] } {
     
    664669                set type "dx"
    665670            }
    666         } elseif {[$_field element $cname.dx] != ""} {
     671        } elseif {[$_fldObj element $cname.dx] != ""} {
    667672            global env
    668673            if { [info exists env(VTKVOLUME)] } {
     
    675680       
    676681        # Save the extents of the component
    677         if { [$_field element $cname.extents] != "" } {
    678             set extents [$_field get $cname.extents]
     682        if { [$_fldObj element $cname.extents] != "" } {
     683            set extents [$_fldObj get $cname.extents]
    679684        } else {
    680685            set extents 1
     
    690695            set yv ""
    691696
    692             set val [$_field get $cname.constant]
     697            set val [$_fldObj get $cname.constant]
    693698            if {$val != ""} {
    694                 set domain [$_field get $cname.domain]
     699                set domain [$_fldObj get $cname.domain]
    695700                if {$domain == "" || ![info exists _limits($domain)]} {
    696701                    set z0 0
     
    712717                }
    713718            } else {
    714                 set xydata [$_field get $cname.xy]
     719                set xydata [$_fldObj get $cname.xy]
    715720                if {"" != $xydata} {
    716721                    set xv [blt::vector create x$_counter]
     
    733738            BuildPointsOnMesh $cname
    734739        } elseif {$type == "vtk"} {
    735             set vtkdata [$_field get $cname.vtk]
     740            set vtkdata [$_fldObj get $cname.vtk]
    736741            ReadVtkDataSet $cname $vtkdata
    737742            set _comp2vtk($cname) $vtkdata
    738             set _comp2style($cname) [$_field get $cname.style]
     743            set _comp2style($cname) [$_fldObj get $cname.style]
    739744            incr _counter
    740745        } elseif {$type == "dx" } {
     
    746751            set _viewer "nanovis"
    747752            set _comp2dims($cname) "3D"
    748             set _comp2dx($cname)  [$_field get -decode no $cname.dx]
     753            set _comp2dx($cname)  [$_fldObj get -decode no $cname.dx]
    749754            if 1 {
    750             set data  [$_field get -decode yes $cname.dx]
     755            set data  [$_fldObj get -decode yes $cname.dx]
    751756            set file "/tmp/junk.dx"
    752757            set f [open $file "w"]
     
    759764            }
    760765            }
    761             set _comp2style($cname) [$_field get $cname.style]
    762             if {[$_field element $cname.flow] != ""} {
     766            set _comp2style($cname) [$_fldObj get $cname.style]
     767            if {[$_fldObj element $cname.flow] != ""} {
    763768                set _comp2flowhints($cname) \
    764                     [Rappture::FlowHints ::\#auto $_field $cname $_units]
     769                    [Rappture::FlowHints ::\#auto $_fldObj $cname $_units]
    765770            }
    766771            incr _counter
     
    773778            set _viewer "nanovis"
    774779            set _comp2dims($cname) "3D"
    775             set data [$_field get -decode yes $cname.opendx]
     780            set data [$_fldObj get -decode yes $cname.opendx]
    776781            set data "<ODX>$data"
    777782            set data [Rappture::encoding::encode -as zb64 $data]
    778783            set _comp2dx($cname) $data
    779             set _comp2style($cname) [$_field get $cname.style]
    780             if {[$_field element $cname.flow] != ""} {
     784            set _comp2style($cname) [$_fldObj get $cname.style]
     785            if {[$_fldObj element $cname.flow] != ""} {
    781786                set _comp2flowhints($cname) \
    782                     [Rapture::FlowHints ::\#auto $_field $cname $_units]
     787                    [Rapture::FlowHints ::\#auto $_fldObj $cname $_units]
    783788            }
    784789            incr _counter
    785         } elseif {[$_field element $cname.ucd] != ""} {
     790        } elseif {[$_fldObj element $cname.ucd] != ""} {
    786791            set _viewer "isosurface"
    787792            set _comp2dims($cname) "3D"
    788             set contents [$_field get $cname.ucd]
     793            set contents [$_fldObj get $cname.ucd]
    789794            set vtkdata [AvsToVtk $cname $contents]
    790795            ReadVtkDataSet $cname $vtkdata
    791796            set _comp2vtk($cname) $vtkdata
    792             set _comp2style($cname) [$_field get $cname.style]
     797            set _comp2style($cname) [$_fldObj get $cname.style]
    793798            incr _counter
    794799        }
     
    805810            error "field can't have components of different dimensions: [join [array get _comp2dims] ,]"
    806811        }
     812    }
     813    # FIXME: about.scalars and about.vectors are temporary.  With views
     814    #        the user will specify the label, units or each field there.
     815    #
     816    # Override what we found in the VTK file with names that the user
     817    # selected.  We override the field label and units.
     818    foreach { fname label units } [$_fldObj get about.scalars] {
     819        if { ![info exists _field2Name($fname)] } {
     820            set _field2Name($fname) $fname
     821            set _field2Components($fname) 1
     822        }
     823        set _field2Label($fname) $label
     824        set _field2Units($fname) $units
     825    }
     826    foreach { fname label units } [$_fldObj get about.vectors] {
     827        if { ![info exists _field2Name($fname)] } {
     828            set _field2Name($fname) $fname
     829            set _field2Components($fname) 3
     830        }
     831        set _field2Label($fname) $label
     832        set _field2Units($fname) $units
    807833    }
    808834}
     
    910936    if {$cname == "-overall" } {
    911937        set max 0
    912         foreach cname [$_field children -type component] {
     938        foreach cname [$_fldObj children -type component] {
    913939            if { ![info exists _comp2unirect3d($cname)] &&
    914940                 ![info exists _comp2extents($cname)] } {
     
    10741100        for {set i 0} {$i < [$dataAttrs GetNumberOfArrays] } {incr i} {
    10751101            set array [$dataAttrs GetArray $i]
    1076             set name  [$dataAttrs GetArrayName $i]
     1102            set fname  [$dataAttrs GetArrayName $i]
    10771103            foreach {min max} [$array GetRange] break
    1078             lappend limits $name [list $min $max]
    1079             lappend _fieldNames $name
    1080             lappend _fieldUnits ""
    1081             lappend _fieldLabels $name
     1104            lappend limits $fname [list $min $max]
     1105            set _field2Units($fname) ""
     1106            set _field2Label($fname) $fname
     1107            set _field2Components($fname) [$array GetNumberOfComponents]
     1108            lappend _comp2fields($cname) $fname
    10821109        }
    10831110    }
     
    11451172    # object and an associated vector for field values.
    11461173    #
    1147     set path [$_field get $cname.mesh]
     1174    set path [$_fldObj get $cname.mesh]
    11481175    if {[$_xmlobj element $path] == ""} {
    11491176        # Unknown mesh designated.
     
    11511178    }
    11521179    set element [$_xmlobj element -as type $path]
    1153     lappend _fieldNames $cname
    1154     lappend _fieldLabels $cname
    1155     lappend _fieldUnits ""
     1180    set name $cname
     1181    regsub -all { } $name {_} name
     1182    set _field2Label($name) $cname
     1183    set label [hints zlabel]
     1184    if { $label != "" } {
     1185        set _field2Label($name) $label
     1186    }
     1187    set _field2Units($name) [hints zlabel]
     1188    set _field2Components($name) 1
     1189    lappend _comp2fields($cname) $name
    11561190
    11571191    # Handle bizarre cases that hopefully will be deprecated.
    11581192    if { $element == "unirect3d" } {
    11591193        # Special case: unirect3d (should be deprecated) + flow.
    1160         if { [$_field element $cname.extents] != "" } {
    1161             set extents [$_field get $cname.extents]
     1194        if { [$_fldObj element $cname.extents] != "" } {
     1195            set extents [$_fldObj get $cname.extents]
    11621196        } else {
    11631197            set extents 1
     
    11671201        set _comp2dims($cname) "3D"
    11681202        set _comp2unirect3d($cname) \
    1169             [Rappture::Unirect3d \#auto $_xmlobj $_field $cname $extents]
    1170         set _comp2style($cname) [$_field get $cname.style]
    1171         if {[$_field element $cname.flow] != ""} {
     1203            [Rappture::Unirect3d \#auto $_xmlobj $_fldObj $cname $extents]
     1204        set _comp2style($cname) [$_fldObj get $cname.style]
     1205        if {[$_fldObj element $cname.flow] != ""} {
    11721206            set _comp2flowhints($cname) \
    1173                 [Rappture::FlowHints ::\#auto $_field $cname $_units]
     1207                [Rappture::FlowHints ::\#auto $_fldObj $cname $_units]
    11741208        }
    11751209        incr _counter
    11761210        return
    11771211    }
    1178     if { $element == "unirect2d" && [$_field element $cname.flow] != "" } {
     1212    if { $element == "unirect2d" && [$_fldObj element $cname.flow] != "" } {
    11791213        # Special case: unirect2d (normally deprecated) + flow.
    1180         if { [$_field element $cname.extents] != "" } {
    1181             set extents [$_field get $cname.extents]
     1214        if { [$_fldObj element $cname.extents] != "" } {
     1215            set extents [$_fldObj get $cname.extents]
    11821216        } else {
    11831217            set extents 1
     
    11881222        set _comp2unirect2d($cname) \
    11891223            [Rappture::Unirect2d \#auto $_xmlobj $path]
    1190         set _comp2style($cname) [$_field get $cname.style]
     1224        set _comp2style($cname) [$_fldObj get $cname.style]
    11911225        set _comp2flowhints($cname) \
    1192             [Rappture::FlowHints ::\#auto $_field $cname $_units]
    1193         set _values [$_field get $cname.values]
     1226            [Rappture::FlowHints ::\#auto $_fldObj $cname $_units]
     1227        set _values [$_fldObj get $cname.values]
    11941228        set limits {}
    11951229        foreach axis { x y } {
     
    12451279        set _type "heightmap"
    12461280        set vector [blt::vector create \#auto]
    1247         $vector set [$_field get $cname.values]
     1281        $vector set [$_fldObj get $cname.values]
    12481282        set _comp2dims($cname) "[$mesh dimensions]D"
    12491283        set _comp2mesh($cname) [list $mesh $vector]
    1250         set _comp2style($cname) [$_field get $cname.style]
     1284        set _comp2style($cname) [$_fldObj get $cname.style]
    12511285        incr _counter
    1252         set label [hints zlabel]
    1253         if { $label != "" } {
    1254             set _fieldLabels $label
    1255             set _fieldNames $label
    1256             regsub -all { } $_fieldNames {_} _fieldNames
    1257         }
    1258         set units [hints zunits]
    1259         if { $units != "" } {
    1260             set _fieldUnits $units
    1261         }
    12621286        array unset _comp2limits $cname
    12631287        lappend _comp2limits($cname) x [$mesh limits x]
     
    12701294        # 3D data: Store cloud/field as components
    12711295        #
    1272         set values [$_field get $cname.values]
     1296        set values [$_fldObj get $cname.values]
    12731297        set farray [vtkFloatArray ::vals$_counter]
    12741298        foreach v $values {
     
    12821306        set _type "isosurface"
    12831307        set vector [blt::vector create \#auto]
    1284         $vector set [$_field get $cname.values]
     1308        $vector set [$_fldObj get $cname.values]
    12851309        set _comp2dims($cname) "[$mesh dimensions]D"
    12861310        set _comp2mesh($cname) [list $mesh $vector]
    1287         set _comp2style($cname) [$_field get $cname.style]
     1311        set _comp2style($cname) [$_fldObj get $cname.style]
    12881312        incr _counter
    1289         set label [hints zlabel]
    1290         if { $label != "" } {
    1291             set _fieldNames $label
    1292             regsub -all { } $_fieldNames {_} _fieldNames
    1293             set _fieldLabels $label
    1294         }
    1295         set units [hints zunits]
    1296         if { $units != "" } {
    1297             set _fieldUnits $units
    1298         }
    12991313        lappend _comp2limits($cname) x [$mesh limits x]
    13001314        lappend _comp2limits($cname) y [$mesh limits y]
     
    13041318        return
    13051319    }
    1306     error "unhandled case in field"
     1320    error "unhandled case in field dim=$_dim element=$element"
    13071321}
    13081322
  • trunk/gui/scripts/mesh.tcl

    r3330 r3405  
    515515    if { $_dim == 0 } {
    516516        # No data found.
     517        puts stderr "no relevant subelements found in <mesh><grid>"
    517518        return 0
    518519    }
  • trunk/gui/scripts/vtkheightmapviewer.tcl

    r3394 r3405  
    968968            if { ![info exists _datasets($tag)] } {
    969969                set bytes [$dataobj vtkdata $comp]
    970                 if 0 {
     970                if 1 {
    971971                    set f [open /tmp/vtkheightmap.vtk "w"]
    972972                    puts $f $bytes
     
    10011001        }
    10021002    }
    1003     if { $_first != "" && $_reset } {
    1004         set _fieldNames [$_first hints fieldnames]
    1005         set _fieldUnits [$_first hints fieldunits]
    1006         set _fieldLabels [$_first hints fieldlabels]
     1003    if { $_first != ""  } {
    10071004        $itk_component(field) choices delete 0 end
    10081005        $itk_component(fieldmenu) delete 0 end
    10091006        array unset _fields
    1010         foreach name $_fieldNames title $_fieldLabels units $_fieldUnits {
    1011             SendCmd "dataset maprange explicit $_limits(v) $name"
    1012             if { $title == "" } {
    1013                 set title $name
    1014             }
    1015             $itk_component(field) choices insert end "$name" "$title"
    1016             $itk_component(fieldmenu) add radiobutton -label "$title" \
    1017                 -value $title -variable [itcl::scope _curFldName] \
    1018                 -selectcolor red \
    1019                 -activebackground $itk_option(-plotbackground) \
    1020                 -activeforeground $itk_option(-plotforeground) \
    1021                 -font "Arial 8" \
    1022                 -command [itcl::code $this Combo invoke]
    1023             set _fields($name) [list $title $units]
    1024             set _curFldName $name
    1025         }
     1007        foreach cname [$_first components] {
     1008            foreach fname [$_first fieldnames $cname] {
     1009                if { [info exists _fields($fname)] } {
     1010                    continue
     1011                }
     1012                foreach { label units components } \
     1013                    [$_first fieldinfo $fname] break
     1014                SendCmd "dataset maprange explicit $_limits(v) $fname"
     1015                $itk_component(field) choices insert end "$fname" "$label"
     1016                $itk_component(fieldmenu) add radiobutton -label "$label" \
     1017                    -value $label -variable [itcl::scope _curFldName] \
     1018                    -selectcolor red \
     1019                    -activebackground $itk_option(-plotbackground) \
     1020                    -activeforeground $itk_option(-plotforeground) \
     1021                    -font "Arial 8" \
     1022                    -command [itcl::code $this Combo invoke]
     1023                set _fields($fname) [list $label $units $components]
     1024                set _curFldName $fname
     1025            }
     1026        }
    10261027        if { [array size _fields] == 1 } {
    1027             set _curFldName $_fieldLabels
     1028            set _curFldName [array names _fields]
    10281029            if { $_curFldName == "" } {
    10291030                puts stderr "no default name from field"
     
    16551656    set bMin [expr $heightScale * $dataScale * $vmin]
    16561657    set bMax [expr $heightScale * $dataScale * $vmax]
    1657     set fieldName [lindex $_fields($_curFldName) 0]
     1658    set fieldName $_curFldName
    16581659    SendCmd "dataset maprange explicit $_limits(v) $fieldName"
    16591660    SendCmd "axis bounds z $bMin $bMax"
  • trunk/gui/scripts/vtkstreamlinesviewer.tcl

    r3402 r3405  
    152152    private variable _scalarFields
    153153    private variable _fields
    154     private variable _currentField ""
     154    private variable _curFldName ""
     155    private variable _curFldLabel ""
    155156    private variable _field      ""
    156157    private variable _numSeeds 200
     
    10501051                set bytes [$dataobj vtkdata $comp]
    10511052                set length [string length $bytes]
     1053                if 1 {
     1054                    set f [open /tmp/vtkstreamlines.vtk "w"]
     1055                    fconfigure $f -translation binary -encoding binary
     1056                    puts $f $bytes
     1057                    close $f
     1058                }
    10521059                if 1 {
    10531060                    set info {}
     
    10871094            }
    10881095        }
     1096        if 0 {
    10891097        array unset _scalarFields
    10901098        array unset _vectorFields
    1091         set _currentField [$_first hints default]
     1099        set _curFldLabel [$_first hints default]
    10921100        $itk_component(field) choices delete 0 end
    10931101        $itk_component(fieldmenu) delete 0 end
     
    10971105            $itk_component(field) choices insert end "$name" "$title"
    10981106            $itk_component(fieldmenu) add radiobutton -label "$title" \
    1099                 -value $title -variable [itcl::scope _currentField] \
     1107                -value $title -variable [itcl::scope _curFldLabel] \
    11001108                -selectcolor red \
    11011109                -activebackground black \
     
    11091117            $itk_component(field) choices insert end "$name" "$title"
    11101118            $itk_component(fieldmenu) add radiobutton -label "$title" \
    1111                 -value $title -variable [itcl::scope _currentField] \
     1119                -value $title -variable [itcl::scope _curFldLabel] \
    11121120                -selectcolor red \
    11131121                -activebackground black \
     
    11171125            set _fields($name) [list $title $units]
    11181126        }
    1119         $itk_component(field) value $_currentField
     1127        $itk_component(field) value $_curFldLabel
     1128        }
     1129        $itk_component(field) choices delete 0 end
     1130        $itk_component(fieldmenu) delete 0 end
     1131        array unset _fields
     1132        foreach cname [$_first components] {
     1133            foreach fname [$_first fieldnames $cname] {
     1134                if { [info exists _fields($fname)] } {
     1135                    continue
     1136                }
     1137                foreach { label units components } \
     1138                    [$_first fieldinfo $fname] break
     1139                $itk_component(field) choices insert end "$fname" "$label"
     1140                $itk_component(fieldmenu) add radiobutton -label "$label" \
     1141                    -value $label -variable [itcl::scope _curFldLabel] \
     1142                    -selectcolor red \
     1143                    -activebackground $itk_option(-plotbackground) \
     1144                    -activeforeground $itk_option(-plotforeground) \
     1145                    -font "Arial 8" \
     1146                    -command [itcl::code $this Combo invoke]
     1147                set _fields($fname) [list $label $units $components]
     1148                set _curFldName $fname
     1149                set _curFldLabel $label
     1150            }
     1151        }
     1152        $itk_component(field) value $_curFldLabel
    11201153    }
    11211154
     
    15361569        }
    15371570        "streamlinesField" {
    1538             set new [$itk_component(field) value]
    1539             set value [$itk_component(field) translate $new]
    1540             set _settings(streamlinesField) $value
    1541             if { [info exists _scalarFields($new)] } {
    1542                 set name $_scalarFields($new)
    1543                 set _colorMode scalar
    1544                 set _currentField $new
    1545             } elseif { [info exists _vectorFields($new)] } {
    1546                 set name $_vectorFields($new)
    1547                 set _colorMode vmag
    1548                 set _currentField $new
     1571            set label [$itk_component(field) value]
     1572            set fname [$itk_component(field) translate $label]
     1573            set _settings(streamlinesField) $fname
     1574            if { [info exists _fields($fname)] } {
     1575                foreach { label units components } $_fields($fname) break
     1576                if { $components > 1 } {
     1577                    set _colorMode vmag
     1578                } else {
     1579                    set _colorMode scalar
     1580                }
     1581                set _curFldName $fname
     1582                set _curFldLabel $label
    15491583            } else {
    1550                 puts stderr "unknown field \"$new\""
     1584                puts stderr "unknown field \"$fname\""
    15511585                return
    15521586            }
    1553             SendCmd "streamlines colormode $_colorMode ${name}"
    1554             SendCmd "cutplane colormode $_colorMode ${name}"
     1587            SendCmd "streamlines colormode $_colorMode ${fname}"
     1588            SendCmd "cutplane colormode $_colorMode ${fname}"
    15551589            set _legendPending 1
    15561590        }
     
    15771611        return
    15781612    }
    1579     if { [info exists _scalarFields($_currentField)] } {
    1580         set name $_scalarFields($_currentField)
    1581     } elseif { [info exists _vectorFields($_currentField)] } {
    1582         set name $_vectorFields($_currentField)
    1583     } else {
    1584         return
    1585     }
    15861613    # Set the legend on the first streamlines dataset.
    15871614    foreach dataset [CurrentDatasets -visible $_first] {
     
    15891616        if { [info exists _dataset2style($dataset)] } {
    15901617            SendCmdNoSplash \
    1591                 "legend $_dataset2style($dataset) $_colorMode $name {} $w $h 0"
     1618                "legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0"
    15921619            break;
    15931620        }
     
    25632590        }
    25642591        invoke {
    2565             $itk_component(field) value $_currentField
     2592            $itk_component(field) value $_curFldLabel
    25662593            AdjustSetting streamlinesField
    25672594        }
  • trunk/gui/src/RpCanvHotspot.c

    r3177 r3405  
    16771677    TkCanvas *canvasPtr;
    16781678    int id;
     1679    long lid;
    16791680    Tcl_HashEntry *hPtr;
    16801681    Tk_Window tkwin;
     
    17051706    }
    17061707    string = Tcl_GetString(itemObjPtr);
    1707     hPtr = Tcl_FindHashEntry(&canvasPtr->idTable, (char *)id);
     1708
     1709    lid = id;
     1710    hPtr = Tcl_FindHashEntry(&canvasPtr->idTable, (char *)lid);
    17081711    if (hPtr == NULL) {
    17091712        Tcl_AppendResult(interp, "can't find canvas item \"", string,
Note: See TracChangeset for help on using the changeset viewer.