Changeset 2652 for trunk


Ignore:
Timestamp:
Nov 2, 2011, 9:23:19 PM (13 years ago)
Author:
gah
Message:
 
Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r2645 r2652  
    559559            return
    560560        }
    561         label $itk_component(plotarea).view.splash -text "Please wait"
     561        label $itk_component(plotarea).view.splash -text "Please wait" \
     562            -bg grey90 -relief solid -bd 2 -padx 20 -pady 20 -font "Arial 10"
    562563        pack $itk_component(plotarea).view.splash -expand yes -anchor c
    563564    } else {
  • trunk/gui/scripts/vtkstreamlinesviewer.tcl

    r2650 r2652  
    9898    private method EventuallyReseed { numPoints }
    9999    private method EventuallyRotate { q }
     100    private method EventuallyRequestLegend {}
    100101    private method EventuallySetCutplane { axis args }
    101102    private method GetImage { args }
     
    148149    private variable _rotatePending 0
    149150    private variable _cutplanePending 0
     151    private variable _legendPending 0
    150152    private variable _outline
    151153    private variable _vectorFields
     
    182184    $_dispatcher register !rotate
    183185    $_dispatcher dispatch $this !rotate "[itcl::code $this DoRotate]; list"
     186
     187    # Legend event
     188    $_dispatcher register !legend
     189    $_dispatcher dispatch $this !legend "[itcl::code $this RequestLegend]; list"
    184190
    185191    # X-Cutplane event
     
    473479itcl::body Rappture::VtkStreamlinesViewer::destructor {} {
    474480    Disconnect
    475     $_dispatcher cancel !rebuild
    476     $_dispatcher cancel !resize
    477     $_dispatcher cancel !reseed
    478     $_dispatcher cancel !rotate
    479     $_dispatcher cancel !xcutplane
    480     $_dispatcher cancel !ycutplane
    481     $_dispatcher cancel !zcutplane
    482481    image delete $_image(plot)
    483482    image delete $_image(download)
     
    494493    set _start [clock clicks -milliseconds]
    495494    SendCmd "screen size $_width $_height"
    496     RequestLegend
     495    EventuallyRequestLegend
    497496
    498497    #SendCmd "imgflush"
     
    552551        set _cutplanePending 1
    553552        $_dispatcher event -after 100 !${axis}cutplane
     553    }
     554}
     555
     556itcl::body Rappture::VtkStreamlinesViewer::EventuallyRequestLegend {} {
     557    if { !$_legendPending } {
     558        set _legendPending 1
    554559    }
    555560}
     
    845850    VisViewer::Disconnect
    846851
     852    $_dispatcher cancel !rebuild
     853    $_dispatcher cancel !resize
     854    $_dispatcher cancel !reseed
     855    $_dispatcher cancel !rotate
     856    $_dispatcher cancel !xcutplane
     857    $_dispatcher cancel !ycutplane
     858    $_dispatcher cancel !zcutplane
     859    $_dispatcher cancel !legend
    847860    # disconnected -- no more data sitting on server
    848861    set _outbuf ""
     
    910923        set tag $this-print-$info(-token)
    911924        set _hardcopy($tag) $bytes
     925    }
     926    if { $_legendPending } {
     927        RequestLegend
    912928    }
    913929}
     
    975991    # generates a new call to Rebuild).   
    976992    set _buffering 1
    977 
    978993    set _width $w
    979994    set _height $h
     
    10851100        set _reset 0
    10861101    }
    1087        
    10881102    set _buffering 0;                        # Turn off buffering.
    10891103
     
    14821496                ChangeColormap $dataobj $comp $palette
    14831497            }
    1484             RequestLegend
     1498            EventuallyRequestLegend
    14851499        }
    14861500        "streamlines-opacity" {
     
    15261540                SendCmd "cutplane colormode $_colorMode ${name} $dataset"
    15271541            }
    1528             RequestLegend
     1542            EventuallyRequestLegend
    15291543        }
    15301544        default {
     
    15421556#
    15431557itcl::body Rappture::VtkStreamlinesViewer::RequestLegend {} {
     1558    puts stderr "RequestLegend"
     1559    set _legendPending 0
    15441560    set font "Arial 8"
    15451561    set lineht [font metrics $font -linespace]
Note: See TracChangeset for help on using the changeset viewer.