Ignore:
Timestamp:
Aug 13, 2008, 1:33:28 PM (16 years ago)
Author:
gah
Message:

nanovis/heightmap update

File:
1 edited

Legend:

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

    r919 r1111  
    2525    public method mesh {}
    2626    public method values {}
     27    public method hints {{keyword ""}}
    2728
    2829    private variable _xmax 0
     
    3334    private variable _ynum 0
    3435    private variable _zv "";            # BLT vector containing the z-values
     36    private variable _hints
    3537}
    3638
     
    167169}
    168170
     171
     172# ----------------------------------------------------------------------
     173# USAGE: hints ?<keyword>?
     174#
     175# Returns a list of key/value pairs for various hints about plotting
     176# this curve.  If a particular <keyword> is specified, then it returns
     177# the hint for that <keyword>, if it exists.
     178# ----------------------------------------------------------------------
     179itcl::body Rappture::UniRect2d::hints {{keyword ""}} {
     180    if {![info exists _hints]} {
     181        foreach {key path} {
     182            group   about.group
     183            label   about.label
     184            color   about.color
     185            style   about.style
     186            type    about.type
     187            xlabel  xaxis.label
     188            xdesc   xaxis.description
     189            xunits  xaxis.units
     190            xscale  xaxis.scale
     191            xmin    xaxis.min
     192            xmax    xaxis.max
     193            ylabel  yaxis.label
     194            ydesc   yaxis.description
     195            yunits  yaxis.units
     196            yscale  yaxis.scale
     197            ymin    yaxis.min
     198            ymax    yaxis.max
     199        } {
     200            set str [$_curve get $path]
     201            if {"" != $str} {
     202                set _hints($key) $str
     203            }
     204        }
     205
     206        if {[info exists _hints(xlabel)] && "" != $_hints(xlabel)
     207              && [info exists _hints(xunits)] && "" != $_hints(xunits)} {
     208            set _hints(xlabel) "$_hints(xlabel) ($_hints(xunits))"
     209        }
     210        if {[info exists _hints(ylabel)] && "" != $_hints(ylabel)
     211              && [info exists _hints(yunits)] && "" != $_hints(yunits)} {
     212            set _hints(ylabel) "$_hints(ylabel) ($_hints(yunits))"
     213        }
     214
     215        if {[info exists _hints(group)] && [info exists _hints(label)]} {
     216            # pop-up help for each curve
     217            set _hints(tooltip) $_hints(label)
     218        }
     219    }
     220
     221    if {$keyword != ""} {
     222        if {[info exists _hints($keyword)]} {
     223            return $_hints($keyword)
     224        }
     225        return ""
     226    }
     227    return [array get _hints]
     228}
Note: See TracChangeset for help on using the changeset viewer.