Changeset 1496 for trunk


Ignore:
Timestamp:
Jun 9, 2009, 3:55:46 PM (15 years ago)
Author:
gah
Message:

pick up extra flow settings from XML

Location:
trunk
Files:
7 edited

Legend:

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

    r1491 r1496  
    249249    }
    250250    if {[info exists _comp2unirect2d($what)]} {
    251         set mobj $_comp2unirect2d($what)
    252         return [$mobj blob]
     251        return [$_comp2unirect2d($what) blob]
    253252    }
    254253    if {[info exists _comp2unirect3d($what)]} {
    255         set mobj $_comp2unirect3d($what)
    256         return [$mobj blob]
     254        return [$_comp2unirect3d($what) blob]
    257255    }
    258256    error "bad option \"$what\": should be [join [lsort [array names _comp2dims]] {, }]"
  • trunk/gui/scripts/flowhints.tcl

    r1491 r1496  
    6161        "arrows"        "off"
    6262        "volume"        "on"
     63        "duration"      "1:00"
     64        "speed"         "1x"
    6365    }
    6466    set _units $units
     
    7577            "arrows"      { GetBoolean $f $child _hints(arrows) }
    7678            "axis"        { GetAxis $f  $child _hints(axis) }
     79            "speed"       { set _hints(speed) $value }
     80            "duration"    { set _hints(duration) $value }
    7781            "position"    { GetPosition $f $child _hints(position) }
    7882            "particles*" {
     
    112116                    "hide"          "no"
    113117                    "label"         ""
     118                    "linewidth"     "2"
    114119                }
    115120                set b [$f element -as object $child]
     
    124129                        "description" { set data(description) $value }
    125130                        "hide"        { GetBoolean $b hide data(hide) }
     131                        "linewidth"   { set data(linewidth) $value }
    126132                        "label"       { set data(label) $value }
    127133                        "corner*" {
  • trunk/gui/scripts/flowspeed.tcl

    r1491 r1496  
    5959itcl::body Rappture::Flowspeed::constructor {args} {
    6060    itk_component add entry {
    61         entry $itk_interior.entry -font "arial 9"
     61        entry $itk_interior.entry
    6262    } {
    6363        usual
    6464        keep -width
    65         ignore -font
    6665        rename -background -textbackground textBackground Background
    6766        rename -foreground -textforeground textForeground Foreground
  • trunk/gui/scripts/flowvisviewer.tcl

    r1494 r1496  
    904904        foreach comp [$dataobj components] {
    905905            # Send the data as one huge base64-encoded mess -- yuck!
    906             set data [$dataobj blob $comp]
    907             set nbytes [string length $data]
     906            set time [time {
     907                set data [$dataobj blob $comp]
     908                set nbytes [string length $data]
     909            }]
     910            puts stderr rebuild=$time
    908911            set extents [$dataobj extents $comp]
     912
    909913            # I have a field. Is a vector field or a volume field?
    910914            if { $extents == 1 } {
     
    11691173        foreach comp [$dataobj components] {
    11701174            # Send the data as one huge base64-encoded mess -- yuck!
    1171             set data [$dataobj blob $comp]
    1172             set nbytes [string length $data]
     1175            set blob [time { set data [$dataobj blob $comp] }]
     1176            puts stderr blob=$blob
     1177            set nbytes [string length $data]
    11731178            set extents [$dataobj extents $comp]
    11741179            # I have a field. Is a vector field or a volume field?
     
    11961201    FixSettings grid
    11971202    FixSettings axes
    1198     # nothing to send -- activate the proper ivol
     1203    FixSettings volume
     1204    FixSettings outline
     1205    FixSettings light
     1206    FixSettings transp
     1207    # nothing to send -- activate the proper volume
    11991208    set _first [lindex [get] 0]
    12001209    if {"" != $_first} {
    12011210        FixSettings light
    12021211        FixSettings transp
    1203         FixSettings outline
    1204 
    12051212        set axis [$_first hints updir]
    12061213        if {"" != $axis} {
     
    12661273    # care.  We're finished here.
    12671274    blt::busy hold $itk_component(hull); update idletasks
    1268     SendBytes $_outbuf;                 
     1275    SendBytes $_outbuf
    12691276    blt::busy release $itk_component(hull)
    12701277    set _buffering 0;                   # Turn off buffering.
     
    17371744    }
    17381745    array set style [lindex [$dataobj components -style $comp] 0]
     1746    set _settings($this-light) $style(-light)
     1747    set _settings($this-transp) $style(-transp)
     1748    set _settings($this-opacity) [expr $style(-opacity) * 100]
    17391749    set tf "$style(-color):$style(-levels):$style(-opacity)"
    17401750    set _obj2style($dataobj-$comp) $tf
     
    17571767        -levels 6
    17581768        -opacity 1.0
     1769        -light 40
     1770        -transp 50
    17591771    }
    17601772    set dataobj ""; set comp ""
     
    18091821    }
    18101822    set max $_settings($tag-opacity)
    1811 
     1823   
    18121824    set isovalues {}
    18131825    foreach m $_isomarkers($tf) {
     
    25922604    append cmd "if {\[flow exists $tag\]} {flow delete $tag}\n"
    25932605    array set info  [$flowobj hints]
     2606    set _settings($this-volume) $info(volume)
     2607    set _settings($this-outline) $info(outline)
     2608    set _settings($this-arrows) $info(arrows)
     2609    set _settings($this-duration) $info(duration)
     2610    $itk_component(speed) value $info(speed)
    25942611    append cmd "flow add $tag -position $info(position) -axis $info(axis) "
    25952612    append cmd "-volume $info(volume) -outline $info(outline) "
     
    26122629        set color [Color2RGB $info(color)]
    26132630        append cmd "$tag box add $info(name) -color {$color} "
    2614         append cmd "-hide $info(hide) "
     2631        append cmd "-hide $info(hide) -linewidth $info(linewidth) "
    26152632        append cmd "-corner1 {$info(corner1)} -corner2 {$info(corner2)}\n"
    26162633    }   
  • trunk/gui/scripts/heightmapviewer.tcl

    r1463 r1496  
    541541    foreach dataobj $_sendobjs {
    542542        foreach comp [$dataobj components] {
    543             set data [$dataobj blob $comp]
    544 
    545543            foreach { vmin vmax }  [$dataobj limits v] break
    546544            if { $_limits(vmin) == "" || $vmin < $_limits(vmin) } {
     
    550548                set _limits(vmax) $vmax
    551549            }
    552 
    553550            # tell the engine to expect some data
     551            set data [$dataobj blob $comp]
    554552            set nbytes [string length $data]
    555553            if { ![SendBytes "heightmap data follows $nbytes\n"] } {
  • trunk/gui/scripts/unirect3d.tcl

    r1463 r1496  
    103103        lappend data "values" [$_values range 0 end]
    104104    }
    105     return [Rappture::encoding::encode -as zb64 "$data"]
     105    return "@@RP-ENC:raw\n$data"
     106    #return [Rappture::encoding::encode -as b64 "$data"]
    106107}
    107108
  • trunk/src/core/RpEncode.cc

    r1451 r1496  
    261261            bytes += 11;
    262262            size -= 11;
    263             headerFlags |= RPENC_Z;
     263            headerFlags = RPENC_Z;
    264264        } else if ((size > 13) && (strncmp(bytes, "@@RP-ENC:b64\n", 13) == 0)){
    265265            bytes += 13;
    266266            size -= 13;
    267             headerFlags |= RPENC_B64;
     267            headerFlags = RPENC_B64;
    268268        } else if ((size > 14) && (strncmp(bytes, "@@RP-ENC:zb64\n", 14) == 0)){
    269269            bytes += 14;
    270270            size -= 14;
    271             headerFlags |= (RPENC_B64 | RPENC_Z);
    272         } else if ((size > 13) && (strncmp(bytes, "@@RP-ENC:raw\n", 14) == 0)){
     271            headerFlags = (RPENC_B64 | RPENC_Z);
     272        } else if ((size > 13) && (strncmp(bytes, "@@RP-ENC:raw\n", 13) == 0)){
    273273            bytes += 13;
    274274            size -= 13;
Note: See TracChangeset for help on using the changeset viewer.