Ignore:
Timestamp:
Sep 4, 2008 5:23:26 PM (16 years ago)
Author:
gah
Message:

fixes for entry label editting

File:
1 edited

Legend:

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

    r1081 r1141  
    5757    public method delete {args}
    5858    public method scale {args}
    59     public method GetLimits { ivol } {
    60         if { [info exists _id2style($ivol)] } {
    61             set tf $_id2style($ivol)
    62             set _limits(min) ""
    63             set _limits(max) ""
    64             foreach ivol $_style2ids($tf) {
    65             if { ![info exists _limits($ivol-min)] } {
    66                 puts stderr "In GetLimits $ivol"
    67                 parray _limits
    68                 error "can't find $ivol limits"
    69             }
    70                 if { $_limits(min) == "" ||
    71                      $_limits(min) > $_limits($ivol-min) } {
    72                     set _limits(min) $_limits($ivol-min)
    73                 }
    74                 if { $_limits(max) == "" ||
    75                      $_limits(max) < $_limits($ivol-max) } {
    76                     set _limits(max) $_limits($ivol-max)
    77                 }
    78             }
    79         }
    80         return [array get _limits]
    81     }
     59    public method GetLimits { ivol }
    8260    public method download {option args}
    8361    public method parameters {title args} {
     
    609587# USAGE: delete ?<dataobj1> <dataobj2> ...?
    610588#
    611 # Clients use this to delete a dataobj from the plot.  If no dataobjs
    612 # are specified, then all dataobjs are deleted.
     589#       Clients use this to delete a dataobj from the plot.  If no dataobjs
     590#       are specified, then all dataobjs are deleted.  No data objects are
     591#       deleted.  They are only removed from the display list.
     592#
    613593# ----------------------------------------------------------------------
    614594itcl::body Rappture::NanovisViewer::delete {args} {
     
    616596        set args $_dlist
    617597    }
    618     # delete all specified dataobjs
     598    # Delete all specified dataobjs
    619599    set changed 0
    620600    foreach dataobj $args {
    621601        set pos [lsearch -exact $_dlist $dataobj]
    622         if {$pos >= 0} {
     602        if { $pos >= 0 } {
    623603            set _dlist [lreplace $_dlist $pos $pos]
    624604            foreach key [array names _obj2ovride $dataobj-*] {
     
    628608        }
    629609    }
    630     # if anything changed, then rebuild the plot
     610    # If anything changed, then rebuild the plot
    631611    if {$changed} {
    632612        $_dispatcher event -idle !rebuild
     
    717697    }
    718698    set result [VisViewer::Connect $_hosts]
     699    if { $result } {
     700        set w [winfo width $itk_component(3dview)]
     701        set h [winfo height $itk_component(3dview)]
     702        _send "screen $w $h"
     703    }
    719704    return $result
    720705}
     
    826811
    827812    if 0 {
     813        # Add this when we fix grid for volumes
    828814    _send "volume axis label x \"\""
    829815    _send "volume axis label y \"\""
     
    10351021        }
    10361022    }
     1023    set w [winfo width $itk_component(3dview)]
     1024    set h [winfo height $itk_component(3dview)]
     1025    _send "screen $w $h"
     1026
     1027    #
     1028    # Reset the camera and other view parameters
     1029    #
     1030    set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
     1031    _send "camera angle $xyz"
     1032    _send "camera zoom $_view(zoom)"
     1033   
     1034    _fixSettings light
     1035    _fixSettings transp
     1036    _fixSettings isosurface
     1037    _fixSettings grid
     1038    _fixSettings axes
     1039    _fixSettings outline
     1040
    10371041    if {[llength $_sendobjs] > 0} {
    10381042        # send off new data objects
     
    10401044        return
    10411045    }
    1042 
    1043     set w [winfo width $itk_component(3dview)]
    1044     set h [winfo height $itk_component(3dview)]
    1045     _send "screen $w $h"
    10461046
    10471047    # nothing to send -- activate the proper ivol
     
    10821082    _send "volume data state [_state volume] $vols"
    10831083    $_dispatcher event -idle !legend
    1084    
    1085     #
    1086     # Reset the camera and other view parameters
    1087     #
    1088     _send "camera angle [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]"
    1089     _send "camera zoom $_view(zoom)"
    1090    
    1091     _fixSettings light
    1092     _fixSettings transp
    1093     _fixSettings isosurface
    1094     _fixSettings grid
    1095     _fixSettings axes
    1096     _fixSettings outline
    10971084}
    10981085
     
    15771564    }
    15781565    SendBytes "transfunc define $tf { $cmap } { $wmap }\n"
    1579     #puts stdout "transfunc define $tf { $cmap } { $wmap }\n"
    15801566    return [SendBytes "volume shading transfunc $tf $_style2ids($tf)\n"]
    15811567}
     
    17451731    return ""
    17461732}
     1733
     1734itcl::body Rappture::NanovisViewer::GetLimits { ivol } {
     1735    if { ![info exists _id2style($ivol)] } {
     1736        return
     1737    }
     1738    set tf $_id2style($ivol)
     1739    set _limits(min) ""
     1740    set _limits(max) ""
     1741    foreach ivol $_style2ids($tf) {
     1742        if { ![info exists _limits($ivol-min)] } {
     1743            error "can't find $ivol limits"
     1744        }
     1745        if { $_limits(min) == "" || $_limits(min) > $_limits($ivol-min) } {
     1746            set _limits(min) $_limits($ivol-min)
     1747        }
     1748        if { $_limits(max) == "" || $_limits(max) < $_limits($ivol-max) } {
     1749            set _limits(max) $_limits($ivol-max)
     1750        }
     1751    }
     1752    return [array get _limits]
     1753}
Note: See TracChangeset for help on using the changeset viewer.