Ignore:
Timestamp:
Jun 9, 2009, 5:25:38 PM (15 years ago)
Author:
gah
Message:

added particle size option, movie token for flowvis

File:
1 edited

Legend:

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

    r1496 r1498  
    26172617        set color [Color2RGB $info(color)]
    26182618        append cmd "$tag particles add $info(name) -position $info(position) "
    2619         append cmd "-axis $info(axis) -color {$color}\n"
     2619        append cmd "-axis $info(axis) -color {$color} -size $info(size)\n"
    26202620    }
    26212621    foreach box [$flowobj boxes] {
     
    27862786}
    27872787
     2788itcl::body Rappture::MolvisViewer::GetPngImage  { widget width height } {
     2789    set token "print[incr _nextToken]"
     2790    set var ::Rappture::MolvisViewer::_hardcopy($this-$token)
     2791    set $var ""
     2792
     2793    # Setup an automatic timeout procedure.
     2794    $_dispatcher dispatch $this !pngtimeout "set $var {} ; list"
     2795
     2796    set popup .molvisviewerprint
     2797    if {![winfo exists $popup]} {
     2798        Rappture::Balloon $popup -title "Generating file..."
     2799        set inner [$popup component inner]
     2800        label $inner.title -text "Generating hardcopy." -font "Arial 10 bold"
     2801        label $inner.please -text "This may take a minute." -font "Arial 10"
     2802        label $inner.icon -image [Rappture::icon bigroller0]
     2803        button $inner.cancel -text "Cancel" -font "Arial 10 bold" \
     2804            -command [list set $var ""]
     2805        blt::table $inner \
     2806            0,0 $inner.title -columnspan 2 \
     2807            1,0 $inner.please -anchor w \
     2808            1,1 $inner.icon -anchor e  \
     2809            2,0 $inner.cancel -columnspan 2
     2810        blt::table configure $inner r0 -pady 4
     2811        blt::table configure $inner r2 -pady 4
     2812        bind $inner.cancel <KeyPress-Return> [list $inner.cancel invoke]
     2813    } else {
     2814        set inner [$popup component inner]
     2815    }
     2816
     2817    $_dispatcher event -after 60000 !pngtimeout
     2818    WaitIcon start $inner.icon
     2819    grab set -local $inner
     2820    focus $inner.cancel
     2821
     2822    SendCmd "print $token $width $height"
     2823
     2824    $popup activate $widget below
     2825    update
     2826    # We wait here for either
     2827    #  1) the png to be delivered or
     2828    #  2) timeout or 
     2829    #  3) user cancels the operation.
     2830    tkwait variable $var
     2831
     2832    # Clean up.
     2833    $_dispatcher cancel !pngtimeout
     2834    WaitIcon stop $inner.icon
     2835    grab release $inner
     2836    $popup deactivate
     2837    update
     2838
     2839    if { $_hardcopy($this-$token) != "" } {
     2840        return [list .png $_hardcopy($this-$token)]
     2841    }
     2842    return ""
     2843}
     2844
    27882845itcl::body Rappture::FlowvisViewer::GetMovie { widget width height } {
    27892846    set token "movie[incr _nextToken]"
     
    27932850    # Setup an automatic timeout procedure.
    27942851    $_dispatcher dispatch $this !movietimeout "set $var {} ; list"
    2795 
    2796     set popup [Rappture::Balloon .movie -title "Generating video..."]
    2797     set inner [$popup component inner]
    2798     label $inner.title -text "Generating Hardcopy" -font "Arial 10 bold"
    2799     label $inner.please -text "This may take a few minutes." -font "Arial 10"
    2800     label $inner.icon -image [Rappture::icon bigroller0]
    2801     button $inner.cancel -text "Cancel" -font "Arial 10 bold" \
    2802         -command [list set $var ""]
     2852    set popup .flowvisviewermovie
     2853    if {![winfo exists $popup]} {
     2854        Rappture::Balloon $popup -title "Generating video..."
     2855        set inner [$popup component inner]
     2856        label $inner.title -text "Generating Hardcopy" -font "Arial 10 bold"
     2857        label $inner.please -text "This may take a few minutes." -font "Arial 10"
     2858        label $inner.icon -image [Rappture::icon bigroller0]
     2859        button $inner.cancel -text "Cancel" -font "Arial 10 bold" \
     2860            -command [list set $var ""]
     2861        blt::table $inner \
     2862            0,0 $inner.title -columnspan 2 \
     2863            1,0 $inner.please -anchor w \
     2864            1,1 $inner.icon -anchor e  \
     2865            2,0 $inner.cancel -columnspan 2
     2866        blt::table configure $inner r0 -pady 4
     2867        blt::table configure $inner r2 -pady 4
     2868        bind $inner.cancel <KeyPress-Return> [list $inner.cancel invoke]
     2869    } else {
     2870        set inner [$popup component inner]
     2871    }
    28032872    $_dispatcher event -after 60000 !movietimeout
    28042873    WaitIcon start $inner.icon
    2805     bind $inner.cancel <KeyPress-Return> [list $inner.cancel invoke]
    2806    
    2807     blt::table $inner \
    2808         0,0 $inner.title -columnspan 2 \
    2809         1,0 $inner.please -anchor w \
    2810         1,1 $inner.icon -anchor e  \
    2811         2,0 $inner.cancel -columnspan 2
    2812     blt::table configure $inner r0 -pady 4
    2813     blt::table configure $inner r2 -pady 4
    28142874    grab set -local $inner
    28152875    focus $inner.cancel
     
    28212881    set bitrate 2000
    28222882
    2823     SendCmd "flow video $width $height $nframes $framerate $bitrate"
     2883    SendCmd "flow video $width $height $nframes $framerate $bitrate $token"
    28242884   
    28252885    $popup activate $widget below
     
    28402900
    28412901    if { $_hardcopy($this-$token) != "" } {
    2842         return [list .png $_hardcopy($this-$token)]
     2902        return [list .mpg $_hardcopy($this-$token)]
    28432903    }
    28442904    return ""
Note: See TracChangeset for help on using the changeset viewer.