Changeset 4715 for trunk


Ignore:
Timestamp:
Nov 13, 2014 2:33:44 AM (5 years ago)
Author:
ldelgass
Message:

Merge isosurface fix from release branch

File:
1 edited

Legend:

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

    r4704 r4715  
    102102    private method Rotate {option x y}
    103103    private method SetCurrentColormap { color }
     104    private method SetCurrentFieldName { dataobj }
    104105    private method SetLegendTip { x y }
    105     private method SetObjectStyle { dataobj comp } 
     106    private method SetObjectStyle { dataobj comp }
    106107    private method SetOrientation { side }
    107     private method Slice {option args} 
     108    private method Slice {option args}
    108109    private method Zoom {option}
    109110    private method ViewToQuaternion {} {
     
    10011002    set _first ""
    10021003    SendCmd "dataset visible 0"
     1004    eval scale $_dlist
    10031005    foreach dataobj [get -objects] {
    10041006        if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
    10051007            set _first $dataobj
     1008            SetCurrentFieldName $dataobj
    10061009        }
    10071010        set _obj2datasets($dataobj) ""
     
    10391042    }
    10401043
    1041     if { $_first != "" } {
    1042         $itk_component(field) choices delete 0 end
    1043         $itk_component(fieldmenu) delete 0 end
    1044         array unset _fields
    1045         set _curFldName ""
    1046         foreach cname [$_first components] {
    1047             foreach fname [$_first fieldnames $cname] {
    1048                 if { [info exists _fields($fname)] } {
    1049                     continue
    1050                 }
    1051                 foreach { label units components } \
    1052                     [$_first fieldinfo $fname] break
    1053                 $itk_component(field) choices insert end "$fname" "$label"
    1054                 $itk_component(fieldmenu) add radiobutton -label "$label" \
    1055                     -value $label -variable [itcl::scope _curFldLabel] \
    1056                     -selectcolor red \
    1057                     -activebackground $itk_option(-plotbackground) \
    1058                     -activeforeground $itk_option(-plotforeground) \
    1059                     -font "Arial 8" \
    1060                     -command [itcl::code $this Combo invoke]
    1061                 set _fields($fname) [list $label $units $components]
    1062                 if { $_curFldName == "" } {
    1063                     set _curFldName $fname
    1064                     set _curFldLabel $label
    1065                 }
    1066             }
    1067         }
    1068         $itk_component(field) value $_curFldLabel
    1069 
    1070         if { ![info exists _limits($_curFldName)] } {
    1071             SendCmd "dataset maprange all"
    1072         } else {
    1073             set limits $_limits($_curFldName)
    1074             SendCmd "dataset maprange explicit $limits $_curFldName"
    1075             if { $limits != $_currentLimits } {
    1076                 set _currentLimits $limits
    1077                 EventuallyChangeContourLevels
    1078             }
    1079         }
    1080     }
    10811044    InitSettings -cutplanesvisible -isosurfacevisible -outline
    10821045    if { $_reset } {
     
    26282591    set _contourList(values) $values
    26292592}
     2593
     2594itcl::body Rappture::VtkIsosurfaceViewer::SetCurrentFieldName { dataobj } {
     2595    set _first $dataobj
     2596    $itk_component(field) choices delete 0 end
     2597    $itk_component(fieldmenu) delete 0 end
     2598    array unset _fields
     2599    set _curFldName ""
     2600    foreach cname [$_first components] {
     2601        foreach fname [$_first fieldnames $cname] {
     2602            if { [info exists _fields($fname)] } {
     2603                continue
     2604            }
     2605            foreach { label units components } \
     2606                [$_first fieldinfo $fname] break
     2607            $itk_component(field) choices insert end "$fname" "$label"
     2608            $itk_component(fieldmenu) add radiobutton -label "$label" \
     2609                -value $label -variable [itcl::scope _curFldLabel] \
     2610                -selectcolor red \
     2611                -activebackground $itk_option(-plotbackground) \
     2612                -activeforeground $itk_option(-plotforeground) \
     2613                -font "Arial 8" \
     2614                -command [itcl::code $this Combo invoke]
     2615            set _fields($fname) [list $label $units $components]
     2616            if { $_curFldName == "" } {
     2617                set _curFldName $fname
     2618                set _curFldLabel $label
     2619            }
     2620        }
     2621    }
     2622    $itk_component(field) value $_curFldLabel
     2623    if { ![info exists _limits($_curFldName)] } {
     2624        SendCmd "dataset maprange all"
     2625    } else {
     2626        set limits $_limits($_curFldName)
     2627        SendCmd "dataset maprange explicit $limits $_curFldName"
     2628        if { $limits != $_currentLimits } {
     2629            set _currentLimits $limits
     2630            EventuallyChangeContourLevels
     2631        }
     2632    }
     2633}
Note: See TracChangeset for help on using the changeset viewer.