Changeset 2604 for trunk/gui


Ignore:
Timestamp:
Oct 6, 2011, 10:07:24 AM (13 years ago)
Author:
gah
Message:
 
Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r2599 r2604  
    155155    raise .bugreport
    156156
    157     catch {grab set .bugreport}
     157    catch {grab set -local .bugreport}
    158158    update
    159159}
  • trunk/gui/scripts/vtkstreamlinesviewer.tcl

    r2603 r2604  
    151151    private variable _vectorFields
    152152    private variable _scalarFields
     153    private variable _fields
    153154    private variable _currentField
    154155    private variable _numSeeds 200
     
    10191020        }
    10201021    }
     1022    array unset _scalarFields
    10211023    array set _scalarFields [$_first hints scalars]
     1024    array unset _vectorFields
    10221025    array set _vectorFields [$_first hints vectors]
    10231026    set _currentField [$_first hints default]
    10241027    $itk_component(field) choices delete 0 end
     1028    array unset _fields
    10251029    foreach name [array names _vectorFields] {
    10261030        set value $_vectorFields($name)
    10271031        $itk_component(field) choices insert end "$value" "$name"
     1032        set _fields($value) $name
    10281033    }
    10291034    foreach name [array names _scalarFields] {
    10301035        set value $_scalarFields($name)
    10311036        $itk_component(field) choices insert end "$value" "$name"
     1037        set _fields($value) $name
    10321038    }
    10331039    $itk_component(field) value $_currentField
     
    10351041    InitSettings streamlines-seeds streamlines-visible streamlines-opacity \
    10361042        streamlines-numpoints streamlines-lighting streamlines-palette \
    1037         streamlines-field \
    10381043        volume-edges volume-lighting volume-opacity volume-visible \
    10391044        volume-wireframe \
     
    14661471        }
    14671472        "streamlines-field" {
    1468             set field [$itk_component(field) value]
    1469             set value [$itk_component(axismode) translate $field]
     1473            set new [$itk_component(field) value]
     1474            set value [$itk_component(axismode) translate $new]
     1475            puts stderr "streamlines-field old field=$_currentField new field = $new value=$value"
    14701476            set _settings(streamlines-field) $value
    1471             if { [info exists _scalarFields($field)] } {
    1472                 set name $_scalarFields($field)
    1473                 set colorMode scalar
     1477            if { [info exists _scalarFields($new)] } {
     1478                set name $_scalarFields($new)
     1479                set _colorMode scalar
    14741480                set fieldType scalar
    1475             } elseif { [info exists _vectorFields($field)] } {
    1476                 set name $_vectorFields($field)
     1481                set _currentField $new
     1482            } elseif { [info exists _vectorFields($new)] } {
     1483                set name $_vectorFields($new)
    14771484                set _colorMode vmag
    14781485                set fieldType vector
     1486                set _currentField $new
    14791487            } else {
    1480                 error "unknown field \"$field\""
     1488                puts stderr "unknown field \"$new\""
     1489                return
    14811490            }
    14821491            foreach dataset [CurrentDatasets -visible] {
     1492                puts stderr "dataset ${fieldType} ${name} $dataset"
     1493                puts stderr "streamlines colormode $_colorMode $dataset"
     1494                puts stderr "cutplane colormode $_colorMode $dataset"
    14831495                SendCmd "dataset ${fieldType} ${name} $dataset"
    14841496                SendCmd "streamlines colormode $_colorMode $dataset"
     
    25032515        $_image(legend) configure -data $bytes
    25042516        #puts stderr "read $size bytes for [image width $_image(legend)]x[image height $_image(legend)] legend>"
    2505         DrawLegend $title
     2517        DrawLegend $_currentField
    25062518    }
    25072519}
     
    25212533   
    25222534    regsub {\(mag\)} $title "" title
     2535    if { [info exists _fields($title)] } {
     2536        set title $_fields($title)
     2537    }
    25232538    if { $_settings(legend-visible) } {
    25242539        set x [expr $w - 2]
Note: See TracChangeset for help on using the changeset viewer.