Ignore:
Timestamp:
Dec 1, 2008 11:31:44 AM (15 years ago)
Author:
gah
Message:

Fix for interrupted nanovis session

File:
1 edited

Legend:

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

    r1242 r1247  
    5757    public method delete {args}
    5858    public method scale {args}
    59     public method GetLimits { ivol }
     59    public method GetLimits { tf }
    6060    public method download {option args}
    6161    public method parameters {title args} {
     
    885885    if { ![info exists $_obj2styles($first)] } {
    886886        foreach tf $_obj2styles($first) {
    887             if { ![_ComputeTransferFunction $tf] } {
    888                 return
    889             }
     887            _ComputeTransferFunction $tf
    890888        }
    891889        _fixLegend
     
    949947            [itcl::code $this _AddIsoMarker %x %y]
    950948    }
    951     array set limits [GetLimits $ivol]
     949    # Display the markers used by the active volume.
     950    set tf $_id2style($activeId_)
     951
     952    array set limits [GetLimits $tf]
    952953    $c itemconfigure vmin -text [format %.2g $limits(min)]
    953954    $c coords vmin $lx $ly
     
    956957    $c coords vmax [expr {$w-$lx}] $ly
    957958
    958     # Display the markers used by the active volume.
    959     set tf $_id2style($activeId_)
    960959    if { [info exists isomarkers_($tf)] } {
    961960        foreach m $isomarkers_($tf) {
     
    15471546        -opacity 1.0
    15481547    }
    1549     set ivol [lindex $_style2ids($tf) 0]
    1550     foreach {dataobj comp} $_id2obj($ivol) break
     1548    set dataobj ""; set comp ""
     1549    foreach ivol $_style2ids($tf) {
     1550        if { [info exists _id2obj($ivol)] } {
     1551            foreach {dataobj comp} $_id2obj($ivol) break
     1552            break
     1553        }
     1554    }
     1555    if { $dataobj == "" } {
     1556        return 0
     1557    }
    15511558    array set style [lindex [$dataobj components -style $comp] 0]
    15521559
     
    16981705        for {set i 1} { $i <= $levels } {incr i} {
    16991706            set x [expr {double($i)/($levels+1)}]
    1700             set m [IsoMarker \#auto $c $this $ivol]
     1707            set m [IsoMarker \#auto $c $this $tf]
    17011708            $m SetRelativeValue $x
    17021709            lappend isomarkers_($tf) $m
     
    17041711    } else {
    17051712        foreach x $levels {
    1706             set m [IsoMarker \#auto $c $this $ivol]
     1713            set m [IsoMarker \#auto $c $this $tf]
    17071714            $m SetRelativeValue $x
    17081715            lappend isomarkers_($tf) $m
     
    17311738            # ${n}% : Set relative value.
    17321739            set value [expr {$value * 0.01}]
    1733             set m [IsoMarker \#auto $c $this $ivol]
     1740            set m [IsoMarker \#auto $c $this $tf]
    17341741            $m SetRelativeValue $value
    17351742            lappend isomarkers_($tf) $m
    17361743        } else {
    17371744            # ${n} : Set absolute value.
    1738             set m [IsoMarker \#auto $c $this $ivol]
     1745            set m [IsoMarker \#auto $c $this $tf]
    17391746            $m SetAbsoluteValue $value
    17401747            lappend isomarkers_($tf) $m
     
    17631770    set tf $_id2style($activeId_)
    17641771    set c $itk_component(legend)
    1765     set m [IsoMarker \#auto $c $this $activeId_]
     1772    set m [IsoMarker \#auto $c $this $tf]
    17661773    set w [winfo width $c]
    17671774    $m SetRelativeValue [expr {double($x-10)/($w-20)}]
     
    17721779
    17731780itcl::body Rappture::NanovisViewer::RemoveDuplicateIsoMarker { marker x } {
    1774     set ivol [$marker GetVolume]
    1775     set tf $_id2style($ivol)
     1781    set tf [$marker GetTransferFunction]
    17761782    set bool 0
    17771783    if { [info exists isomarkers_($tf)] } {
     
    17981804
    17991805itcl::body Rappture::NanovisViewer::OverIsoMarker { marker x } {
    1800     set ivol [$marker GetVolume]
    1801     if { [info exists isomarkers_($ivol)] } {
     1806    set tf [$marker GetTransferFunction]
     1807    if { [info exists isomarkers_($tf)] } {
    18021808        set marker [namespace tail $marker]
    1803         foreach m $isomarkers_($ivol) {
     1809        foreach m $isomarkers_($tf) {
    18041810            set sx [$m GetScreenPosition]
    18051811            if { $m != $marker } {
     
    18121818}
    18131819
    1814 itcl::body Rappture::NanovisViewer::GetLimits { ivol } {
    1815     if { ![info exists _id2style($ivol)] } {
    1816         return
    1817     }
    1818     set tf $_id2style($ivol)
     1820itcl::body Rappture::NanovisViewer::GetLimits { tf } {
    18191821    set limits_(min) ""
    18201822    set limits_(max) ""
Note: See TracChangeset for help on using the changeset viewer.