Ignore:
Timestamp:
Jul 1, 2016, 7:11:32 AM (8 years ago)
Author:
ldelgass
Message:

merge from trunk

Location:
branches/blt4_trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4_trunk

  • branches/blt4_trunk/gui/scripts/vtkstreamlinesviewer.tcl

    r6351 r6414  
    105105    private method Rotate {option x y}
    106106    private method SetCurrentColormap { color }
     107    private method SetCurrentFieldName { dataobj }
    107108    private method SetLegendTip { x y }
    108109    private method SetObjectStyle { dataobj comp }
     
    145146    private variable _curFldName ""
    146147    private variable _curFldLabel ""
     148    private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar)
    147149    private variable _streamlinesLength 0
    148150    private variable _numSeeds 200
    149     private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar)
    150151
    151152    private common _downloadPopup;      # download options from popup
     
    300301    }
    301302    pack $itk_component(reset) -side top -padx 2 -pady 2
    302     Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level"
     303    Rappture::Tooltip::for $itk_component(reset) \
     304        "Reset the view to the default zoom level"
    303305
    304306    itk_component add zoomin {
     
    588590        set _dlist [lreplace $_dlist $pos $pos]
    589591        array unset _obj2ovride $dataobj-*
    590         array unset _settings $dataobj-*
    591592        set changed 1
    592593    }
     
    978979        if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
    979980            set _first $dataobj
     981            SetCurrentFieldName $dataobj
    980982        }
    981983        foreach comp [$dataobj components] {
     
    10231025            }
    10241026        }
    1025         $itk_component(field) choices delete 0 end
    1026         $itk_component(fieldmenu) delete 0 end
    1027         array unset _fields
    1028         set _curFldName ""
    1029         set _curFldLabel ""
    1030         foreach cname [$_first components] {
    1031             foreach fname [$_first fieldnames $cname] {
    1032                 if { [info exists _fields($fname)] } {
    1033                     continue
    1034                 }
    1035                 foreach { label units components } \
    1036                     [$_first fieldinfo $fname] break
    1037                 $itk_component(field) choices insert end "$fname" "$label"
    1038                 $itk_component(fieldmenu) add radiobutton -label "$label" \
    1039                     -value $label -variable [itcl::scope _curFldLabel] \
    1040                     -selectcolor red \
    1041                     -activebackground $itk_option(-plotbackground) \
    1042                     -activeforeground $itk_option(-plotforeground) \
    1043                     -font "Arial 8" \
    1044                     -command [itcl::code $this LegendTitleAction save]
    1045                 set _fields($fname) [list $label $units $components]
    1046                 if { $_curFldName == "" && $components == 3 } {
    1047                     set _curFldName $fname
    1048                     set _curFldLabel $label
    1049                 }
    1050             }
    1051         }
    1052         $itk_component(field) value $_curFldLabel
    10531027    }
    10541028
     
    12951269itcl::body Rappture::VtkStreamlinesViewer::InitSettings { args } {
    12961270    foreach spec $args {
    1297         if { [info exists _settings($_first${spec})] } {
    1298             # Reset global setting with dataobj specific setting
    1299             set _settings($spec) $_settings($_first${spec})
    1300         }
    13011271        AdjustSetting $spec
    13021272    }
     
    13821352                SendCmd "dataset maprange all"
    13831353            } else {
    1384                 SendCmd "dataset maprange explicit $_limits($_curFldName) $_curFldName"
    1385             }
    1386             SendCmd "streamlines colormode $_colorMode $_curFldName"
    1387             SendCmd "cutplane colormode $_colorMode $_curFldName"
     1354                foreach { vmin vmax } $_limits($_curFldName) break
     1355                SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName]
     1356            }
     1357            SendCmd [list streamlines colormode $_colorMode $_curFldName]
     1358            SendCmd [list cutplane colormode $_colorMode $_curFldName]
    13881359            DrawLegend
    13891360        }
     
    15261497            set _colormaps($cmap) 1
    15271498        }
    1528         #SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0"
     1499        #SendCmd [list legend $cmap $_colorMode $_curFldName {} $w $h 0]
    15291500        SendCmd "legend2 $cmap $w $h"
    15301501    }
     
    24342405    set _view(-zoom) 1.0
    24352406}
     2407
     2408itcl::body Rappture::VtkStreamlinesViewer::SetCurrentFieldName { dataobj } {
     2409    set _first $dataobj
     2410    $itk_component(field) choices delete 0 end
     2411    $itk_component(fieldmenu) delete 0 end
     2412    array unset _fields
     2413    set _curFldName ""
     2414    set _curFldLabel ""
     2415    foreach cname [$_first components] {
     2416        foreach fname [$_first fieldnames $cname] {
     2417            if { [info exists _fields($fname)] } {
     2418                continue
     2419            }
     2420            foreach { label units components } \
     2421                [$_first fieldinfo $fname] break
     2422            $itk_component(field) choices insert end "$fname" "$label"
     2423            $itk_component(fieldmenu) add radiobutton -label "$label" \
     2424                -value $label -variable [itcl::scope _curFldLabel] \
     2425                -selectcolor red \
     2426                -activebackground $itk_option(-plotbackground) \
     2427                -activeforeground $itk_option(-plotforeground) \
     2428                -font "Arial 8" \
     2429                -command [itcl::code $this LegendTitleAction save]
     2430            set _fields($fname) [list $label $units $components]
     2431            if { $_curFldName == "" && $components == 3 } {
     2432                set _curFldName $fname
     2433                set _curFldLabel $label
     2434            }
     2435        }
     2436    }
     2437    $itk_component(field) value $_curFldLabel
     2438}
Note: See TracChangeset for help on using the changeset viewer.