Changeset 4776 for trunk/gui


Ignore:
Timestamp:
Nov 23, 2014 9:06:09 AM (9 years ago)
Author:
ldelgass
Message:

sync with release branch changes

Location:
trunk/gui/scripts
Files:
3 edited

Legend:

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

    r4771 r4776  
    766766                if { ![info exists _limits($axis)] } {
    767767                    set _limits($axis) [list $min $max]
    768                 } else {
    769                     foreach {amin amax} $_limits($axis) break
    770                     if {$min < $amin} {
    771                         set amin $min
    772                     }
    773                     if {$max > $amax} {
    774                         set amax $max
    775                     }
    776                     set _limits($axis) [list $amin $amax]
     768                    continue
    777769                }
     770                foreach {amin amax} $_limits($axis) break
     771                if {$min < $amin} {
     772                    set amin $min
     773                }
     774                if {$max > $amax} {
     775                    set amax $max
     776                }
     777                set _limits($axis) [list $amin $amax]
    778778            }
    779779        }
  • trunk/gui/scripts/nanovisviewer.tcl

    r4771 r4776  
    588588                if { ![info exists _limits($axis)] } {
    589589                    set _limits($axis) [list $min $max]
    590                 } else {
    591                     foreach {amin amax} $_limits($axis) break
    592                     if {$min < $amin} {
    593                         set amin $min
    594                     }
    595                     if {$max > $amax} {
    596                         set amax $max
    597                     }
    598                     set _limits($axis) [list $amin $amax]
     590                    continue
    599591                }
     592                foreach {amin amax} $_limits($axis) break
     593                if {$min < $amin} {
     594                    set amin $min
     595                }
     596                if {$max > $amax} {
     597                    set amax $max
     598                }
     599                set _limits($axis) [list $amin $amax]
    600600            }
    601601        }
  • trunk/gui/scripts/vtkvolumeviewer.tcl

    r4767 r4776  
    8282    private variable _current "";       # Currently selected component
    8383    private variable _volcomponents   ; # Array of components found
    84     private variable _componentsList   ; # Array of components found
     84    private variable _componentsList   ; # List of component names
    8585    private variable _cname2style
    8686    private variable _cname2transferFunction
     
    173173    private variable _curFldName ""
    174174    private variable _curFldLabel ""
     175    private variable _colorMode "scalar"; #  Mode of colormap (vmag or scalar)
    175176    private variable _cutplaneCmd "imgcutplane"
    176177    private variable _allowMultiComponent 0
     
    250251        -axisminorticks                 1
    251252        -background                     black
     253        -color                          "default"
    252254        -cutplanelighting               1
    253255        -cutplaneopacity                100
     
    679681# ----------------------------------------------------------------------
    680682itcl::body Rappture::VtkVolumeViewer::scale {args} {
    681     array unset _limits
    682     array unset _volcomponents
     683    array unset _limits
     684    array unset _volcomponents
     685    set _componentsList ""
    683686
    684687    foreach dataobj $args {
     
    688691        # Determine limits for each axis.
    689692        foreach axis { x y z } {
    690             foreach { min max } [$dataobj limits $axis] break
    691             if {"" != $min && "" != $max} {
    692                 if { ![info exists _limits($axis)] } {
    693                     set _limits($axis) [list $min $max]
    694                 } else {
    695                     foreach {amin amax} $_limits($axis) break
    696                     if {$min < $amin} {
    697                         set amin $min
    698                     }
    699                     if {$max > $amax} {
    700                         set amax $max
    701                     }
    702                     set _limits($axis) [list $amin $amax]
    703                 }
    704             }
     693            set lim [$dataobj limits $axis]
     694            if { ![info exists _limits($axis)] } {
     695                set _limits($axis) $lim
     696                continue
     697            }
     698            foreach {min max} $lim break
     699            foreach {amin amax} $_limits($axis) break
     700            if { $amin > $min } {
     701                set amin $min
     702            }
     703            if { $amax < $max } {
     704                set amax $max
     705            }
     706            set _limits($axis) [list $amin $amax]
    705707        }
    706708        # Determine limits for each field.
     
    728730            array unset limits
    729731            array set limits [$dataobj valueLimits $cname]
     732            if { ![info exists _limits($cname)] } {
     733                set _limits($cname) $limits(v)
     734                continue
     735            }
    730736            foreach {min max} $limits(v) break
    731             if { ![info exists _limits($cname)] } {
    732                 set _limits($cname) [list $min $max]
    733             } else {
    734                 foreach {vmin vmax} $_limits($cname) break
    735                 if { $min < $vmin } {
    736                     set vmin $min
    737                 }
    738                 if { $max > $vmax } {
    739                     set vmax $max
    740                 }
    741                 set _limits($cname) [list $vmin $vmax]
    742             }
     737            foreach {vmin vmax} $_limits($cname) break
     738            if { $vmin > $min } {
     739                set vmin $min
     740            }
     741            if { $vmax < $max } {
     742                set vmax $max
     743            }
     744            set _limits($cname) [list $vmin $vmax]
    743745        }
    744746    }
     
    15931595                    puts stderr "Can't use a vector field in a volume"
    15941596                    return
     1597                } else {
     1598                    if { $components > 1 } {
     1599                        set _colorMode vmag
     1600                    } else {
     1601                        set _colorMode scalar
     1602                    }
    15951603                }
    15961604                set _curFldName $fname
     
    16011609            }
    16021610            foreach dataset [CurrentDatasets -visible $_first] {
     1611                #SendCmd "$_cutplaneCmd colormode $_colorMode $_curFldName $dataset"
    16031612                SendCmd "dataset scalar $_curFldName $dataset"
    16041613            }
     
    16331642            SendCmdNoWait \
    16341643                "legend2 $_dataset2style($dataset) $w $h"
    1635                 #"legend $_dataset2style($dataset) scalar $_curFldName {} $w $h 0"
     1644                #"legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0"
    16361645            break;
    16371646        }
     
    18281837    bind $inner.colormap <<Value>> \
    18291838        [itcl::code $this AdjustSetting -color]
    1830     $itk_component(colormap) value "default"
    1831     set _settings(-color) "default"
     1839    $itk_component(colormap) value $_settings(-color)
    18321840
    18331841    label $inner.blendmode_l -text "Blend Mode" -font $font
Note: See TracChangeset for help on using the changeset viewer.