Changeset 5098 for trunk/gui


Ignore:
Timestamp:
Mar 8, 2015, 3:14:49 AM (9 years ago)
Author:
ldelgass
Message:

whitespace

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r5094 r5098  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: flowvisviewer - 3D flow rendering
    4 #
    54#
    65# This widget performs volume and flow rendering on 3D scalar/vector datasets.
     
    6564    public method limits { cname }
    6665    public method overMarker { m x }
    67     public method parameters {title args} { 
    68         # do nothing 
     66    public method parameters {title args} {
     67        # do nothing
    6968    }
    7069    public method removeDuplicateMarker { m x }
     
    8988    private method CurrentVolumeIds {{what -all}}
    9089    private method Disconnect {}
    91     private method EventuallyResize { w h } 
    92     private method EventuallyGoto { nSteps } 
    93     private method EventuallyResizeLegend { } 
     90    private method EventuallyResize { w h }
     91    private method EventuallyGoto { nSteps }
     92    private method EventuallyResizeLegend { }
    9493    private method FlowCmd { dataobj comp nbytes extents }
    95     private method GetDatasetsWithComponent { cname } 
     94    private method GetDatasetsWithComponent { cname }
    9695    private method GetFlowInfo { widget }
    9796    private method GetMovie { widget width height }
     
    103102    private method ParseLevelsOption { tf levels }
    104103    private method ParseMarkersOption { tf markers }
    105     private method QuaternionToView { q } { 
     104    private method QuaternionToView { q } {
    106105        foreach { _view(-qw) _view(-qx) _view(-qy) _view(-qz) } $q break
    107106    }
     
    117116    private method Slice {option args}
    118117    private method SlicerTip {axis}
    119     private method ViewToQuaternion {} { 
     118    private method ViewToQuaternion {} {
    120119        return [list $_view(-qw) $_view(-qx) $_view(-qy) $_view(-qz)]
    121120    }
    122121    private method WaitIcon { option widget }
    123122    private method Zoom {option}
    124     private method arrows { tag name } 
    125     private method box { tag name } 
    126     private method millisecs2str { value } 
    127     private method particles { tag name } 
    128     private method str2millisecs { value } 
    129     private method streams { tag name } 
     123    private method arrows { tag name }
     124    private method box { tag name }
     125    private method millisecs2str { value }
     126    private method particles { tag name }
     127    private method str2millisecs { value }
     128    private method streams { tag name }
    130129
    131130    private variable _arcball ""
     
    133132    private variable _allDataObjs
    134133    private variable _obj2ovride   ;# maps dataobj => style override
    135     private variable _serverObjs   ;# maps dataobj-component to volume ID 
     134    private variable _serverObjs   ;# maps dataobj-component to volume ID
    136135                                    # in the server
    137     private variable _recvObjs  ;# list of data objs to send to server
     136    private variable _recvObjs  ;   # list of data objs to send to server
    138137    private variable _obj2style    ;# maps dataobj-component to transfunc
    139     private variable _style2objs   ;# maps tf back to list of 
     138    private variable _style2objs   ;# maps tf back to list of
    140139                                    # dataobj-components using the tf.
    141     private variable _obj2flow;         # Maps dataobj-component to a flow.
    142 
    143     private variable _reset 1;          # Connection to server has been reset
     140    private variable _obj2flow;     # Maps dataobj-component to a flow.
     141
     142    private variable _reset 1      ;# Connection to server has been reset
    144143    private variable _click        ;# info used for rotate operations
    145144    private variable _limits       ;# autoscale min/max for all axes
    146145    private variable _view         ;# view params for 3D view
    147     private variable _isomarkers    ;# array of isosurface level values 0..1
     146    private variable _isomarkers   ;# array of isosurface level values 0..1
    148147    private common   _settings
    149148    private variable _activeTf ""  ;# The currently active transfer function.
    150149    private variable _first ""     ;# This is the topmost volume.
    151     private variable _volcomponents   ; # Array of components found 
    152     private variable _componentsList   ; # Array of components found
     150    private variable _volcomponents   ; # Array of components found
     151    private variable _componentsList  ; # Array of components found
    153152    private variable _nextToken 0
    154153    private variable _icon 0
    155154    private variable _flow
    156     # This
    157     # indicates which isomarkers and transfer
    158     # function to use when changing markers,
    159     # opacity, or thickness.
    160155    private common _downloadPopup          ;# download options from popup
    161156
     
    198193    $_dispatcher register !play
    199194    $_dispatcher dispatch $this !play "[itcl::code $this flow next]; list"
    200     
     195   
    201196    # Draw legend event
    202197    $_dispatcher register !goto
     
    239234        $this-qy                $_view(-qy)
    240235        $this-qz                $_view(-qz)
    241         $this-zoom              $_view(-zoom)    
     236        $this-zoom              $_view(-zoom)   
    242237        $this-xpan              $_view(-xpan)
    243238        $this-ypan              $_view(-ypan)
     
    330325            -offimage [Rappture::icon cutbutton] \
    331326            -variable [itcl::scope _settings($this-cutplaneVisible)] \
    332             -command [itcl::code $this AdjustSetting cutplaneVisible] 
     327            -command [itcl::code $this AdjustSetting cutplaneVisible]
    333328    }
    334329    Rappture::Tooltip::for $itk_component(cutplane) \
     
    361356        [itcl::code $this EventuallyResizeLegend]
    362357
    363     # Hack around the Tk panewindow.  The problem is that the requested 
     358    # Hack around the Tk panewindow.  The problem is that the requested
    364359    # size of the 3d view isn't set until an image is retrieved from
    365360    # the server.  So the panewindow uses the tiny size.
     
    369364        0,0 $itk_component(3dview) -fill both -reqwidth $w \
    370365        1,0 $itk_component(legend) -fill x
    371     blt::table configure $itk_component(plotarea) r1 -resize none    
     366    blt::table configure $itk_component(plotarea) r1 -resize none   
    372367    # Create flow controls...
    373368
    374369    itk_component add flowcontrols {
    375         frame $itk_interior.flowcontrols 
     370        frame $itk_interior.flowcontrols
    376371    } {
    377372        usual
     
    420415            -offimage [Rappture::icon flow-play] \
    421416            -variable [itcl::scope _settings($this-play)] \
    422             -command [itcl::code $this flow toggle] 
     417            -command [itcl::code $this flow toggle]
    423418    }
    424419    set fg [option get $itk_component(hull) font Font]
     
    472467    } {
    473468        usual
    474         ignore -highlightthickness 
     469        ignore -highlightthickness
    475470        rename -background -controlbackground controlBackground Background
    476471    }
     
    481476    } {
    482477        usual
    483         ignore -highlightthickness 
     478        ignore -highlightthickness
    484479        rename -background -controlbackground controlBackground Background
    485480    }
     
    491486    } {
    492487        usual
    493         ignore -highlightthickness 
     488        ignore -highlightthickness
    494489        rename -background -controlbackground controlBackground Background
    495490    }
     
    508503        0,4 $itk_component(dial) -fill x -padx {2 0 } \
    509504        0,5 $itk_component(duration) -padx { 0 0} \
    510         0,7 $itk_component(speed) -padx {2 3} 
    511 
    512 #        0,6 $itk_component(speedlabel) -padx {2 0} 
     505        0,7 $itk_component(speed) -padx {2 3}
     506
     507#        0,6 $itk_component(speedlabel) -padx {2 0}
    513508    blt::table configure $itk_component(flowcontrols) c* -resize none
    514509    blt::table configure $itk_component(flowcontrols) c4 -resize both
     
    710705    # If anything changed, then rebuild the plot
    711706    if {$changed} {
    712         # Repair the reverse lookup 
     707        # Repair the reverse lookup
    713708        foreach tf [array names _style2objs] {
    714709            set list {}
     
    743738        -opacity 0.5
    744739    }
    745     array unset _limits 
    746     array unset _volcomponents 
     740    array unset _limits
     741    array unset _volcomponents
    747742    foreach dataobj $args {
    748743        if { ![$dataobj isvalid] } {
     
    888883        return 0
    889884    }
    890     set _reset 1 
     885    set _reset 1
    891886    set result [VisViewer::Connect $_hosts]
    892887    if { $result } {
     
    898893            set info {}
    899894            set user "???"
    900             if { [info exists env(USER)] } {
     895            if { [info exists env(USER)] } {
    901896                set user $env(USER)
    902             }
     897            }
    903898            set session "???"
    904             if { [info exists env(SESSION)] } {
     899            if { [info exists env(SESSION)] } {
    905900                set session $env(SESSION)
    906             }
     901            }
    907902            lappend info "version" "$Rappture::version"
    908903            lappend info "build" "$Rappture::build"
     
    10051000            $_image(plot) configure -data $bytes
    10061001            #puts stderr "image received [image width $_image(plot)] by [image height $_image(plot)]"
    1007         } 
     1002        }
    10081003        "print" {
    10091004            set tag $this-$info(-token)
    10101005            set _hardcopy($tag) $bytes
    1011         } 
     1006        }
    10121007        "movie" {
    10131008            set tag $this-$info(-token)
     
    10251020#       The procedure is the response from the render server to each "legend"
    10261021#       command.  The server sends back a "legend" command invoked our
    1027 #       the slave interpreter.  The purpose is to collect data of the image 
     1022#       the slave interpreter.  The purpose is to collect data of the image
    10281023#       representing the legend in the canvas.  In addition, the isomarkers
    10291024#       of the active transfer function are displayed.
    10301025#
    10311026#       I don't know is this is the right place to display the isomarkers.
    1032 #       I don't know all the different paths used to draw the plot. There's 
     1027#       I don't know all the different paths used to draw the plot. There's
    10331028#       "Rebuild", "add", etc.
    10341029#
     
    11151110# Called automatically whenever something changes that affects the data
    11161111# in the widget.  Clears any existing data and rebuilds the widget to
    1117 # display new data.  
     1112# display new data.
    11181113#
    11191114itcl::body Rappture::FlowvisViewer::Rebuild {} {
     
    11281123    # Turn on buffering of commands to the server.  We don't want to
    11291124    # be preempted by a server disconnect/reconnect (which automatically
    1130     # generates a new call to Rebuild).   
     1125    # generates a new call to Rebuild). 
    11311126    StartBufferingCommands
    11321127
     
    14821477                record {
    14831478                    if { [$itk_component(rewind) cget -relief] != "sunken" } {
    1484                         $itk_component(rewind) configure -relief sunken 
    1485                         $itk_component(stop) configure -relief raised 
    1486                         $itk_component(play) configure -relief raised 
     1479                        $itk_component(rewind) configure -relief sunken
     1480                        $itk_component(stop) configure -relief raised
     1481                        $itk_component(play) configure -relief raised
    14871482                        set inner $itk_component(settingsFrame)
    14881483                        set frames [$inner.framecnt value]
     
    14941489                stop {
    14951490                    if { [$itk_component(stop) cget -relief] != "sunken" } {
    1496                         $itk_component(rewind) configure -relief raised 
    1497                         $itk_component(stop) configure -relief sunken 
    1498                         $itk_component(play) configure -relief raised 
     1491                        $itk_component(rewind) configure -relief raised
     1492                        $itk_component(stop) configure -relief sunken
     1493                        $itk_component(play) configure -relief raised
    14991494                        _pause
    15001495                        set cmds "flow reset"
     
    15051500                    if { [$itk_component(play) cget -relief] != "sunken" } {
    15061501                        $itk_component(rewind) configure -relief raised
    1507                         $itk_component(stop) configure -relief raised 
     1502                        $itk_component(stop) configure -relief raised
    15081503                        $itk_component(play) configure \
    15091504                            -image [Rappture::icon flow-pause] \
    1510                             -relief sunken 
     1505                            -relief sunken
    15111506                        bind $itk_component(play) <ButtonPress> \
    15121507                            [itcl::code $this _pause]
     
    15481543    $itk_component(play) configure \
    15491544        -image [Rappture::icon flow-start] \
    1550         -relief raised 
     1545        -relief raised
    15511546    bind $itk_component(play) <ButtonPress> \
    15521547        [itcl::code $this Flow movie play toggle]
     
    15761571    switch -- $what {
    15771572        colormap {
    1578             set color [$itk_component(colormap) value] 
    1579             set _settings(colormap) $color 
    1580             #ResetColormap $color 
     1573            set color [$itk_component(colormap) value]
     1574            set _settings(colormap) $color
     1575            #ResetColormap $color
    15811576        }
    15821577        ambient {
     
    16671662                blt::table $itk_component(plotarea) \
    16681663                    0,0 $itk_component(3dview) -fill both \
    1669                     1,0 $itk_component(legend) -fill x 
     1664                    1,0 $itk_component(legend) -fill x
    16701665                blt::table configure $itk_component(plotarea) r1 -resize none
    16711666            } else {
     
    16901685            set bool $_settings($this-$what)
    16911686            if { [isconnected] } {
    1692                 set vols [CurrentVolumeIds -cutplanes] 
     1687                set vols [CurrentVolumeIds -cutplanes]
    16931688                SendCmd "cutplane state $bool $axis $vols"
    16941689            }
     
    17941789    # reference.
    17951790    #
    1796     # FIXME: The current way we generate transfer-function names completely 
    1797     #        ignores the -markers option.  The problem is that we are forced 
    1798     #        to compute the name from an increasing complex set of values: 
     1791    # FIXME: The current way we generate transfer-function names completely
     1792    #        ignores the -markers option.  The problem is that we are forced
     1793    #        to compute the name from an increasing complex set of values:
    17991794    #        color, levels, marker, opacity.  I think the cow's out of the
    18001795    #        barn on this one.
     
    19421937            $itk_component(legend) itemconfigure labels -fill $itk_option(-plotforeground)
    19431938            $m relval $x
    1944             lappend _isomarkers($tf) $m 
     1939            lappend _isomarkers($tf) $m
    19451940        }
    19461941    } else {
     
    19491944            $itk_component(legend) itemconfigure labels -fill $itk_option(-plotforeground)
    19501945            $m relval $x
    1951             lappend _isomarkers($tf) $m 
     1946            lappend _isomarkers($tf) $m
    19521947        }
    19531948    }
     
    19561951#
    19571952# The -markers option takes a list of zero or more values (the values
    1958 # may be separated either by spaces or commas) that have the following 
     1953# may be separated either by spaces or commas) that have the following
    19591954# format:
    19601955#
     
    19721967        set n [scan $marker "%g%s" value suffix]
    19731968        if { $n == 2 && $suffix == "%" } {
    1974             # ${n}% : Set relative value. 
     1969            # ${n}% : Set relative value.
    19751970            set value [expr {$value * 0.01}]
    19761971            set m [Rappture::IsoMarker \#auto $c $this $tf]
     
    19891984
    19901985# ----------------------------------------------------------------------
    1991 # USAGE: UndateTransferFuncs 
     1986# USAGE: UndateTransferFuncs
    19921987# ----------------------------------------------------------------------
    19931988itcl::body Rappture::FlowvisViewer::updateTransferFunctions {} {
     
    19991994        error "active transfer function isn't set"
    20001995    }
    2001     set tf $_activeTf 
     1996    set tf $_activeTf
    20021997    set c $itk_component(legend)
    20031998    set m [Rappture::IsoMarker \#auto $c $this $tf]
     
    21582153        2,0 $inner.outline  -cspan 2 -anchor w \
    21592154        3,0 $inner.volume  -cspan 2 -anchor w \
    2160         4,0 $inner.legend  -cspan 2 -anchor w 
     2155        4,0 $inner.legend  -cspan 2 -anchor w
    21612156
    21622157    bind $inner <Map> [itcl::code $this GetFlowInfo $inner]
     
    22252220    label $inner.thick -text "Thick" -font $fg
    22262221
    2227     label $inner.colormap_l -text "Colormap" -font "Arial 9" 
     2222    label $inner.colormap_l -text "Colormap" -font "Arial 9"
    22282223    itk_component add colormap {
    22292224        Rappture::Combobox $inner.colormap -width 10 -editable no
     
    23672362    $inner configure -borderwidth 4
    23682363
    2369     label $inner.view_l -text "view" -font "Arial 9" 
    2370     set f [frame $inner.view] 
    2371     foreach side { front back left right top bottom } { 
     2364    label $inner.view_l -text "view" -font "Arial 9"
     2365    set f [frame $inner.view]
     2366    foreach side { front back left right top bottom } {
    23722367        button $f.$side  -image [Rappture::icon view$side] \
    2373             -command [itcl::code $this SetOrientation $side] 
    2374         Rappture::Tooltip::for $f.$side "Change the view to $side" 
    2375         pack $f.$side -side left 
     2368            -command [itcl::code $this SetOrientation $side]
     2369        Rappture::Tooltip::for $f.$side "Change the view to $side"
     2370        pack $f.$side -side left
    23762371    }
    23772372
    23782373    blt::table $inner \
    23792374        0,0 $inner.view_l -anchor e -pady 2 \
    2380         0,1 $inner.view -anchor w -pady 2 
     2375        0,1 $inner.view -anchor w -pady 2
    23812376    blt::table configure $inner r0 -resize none
    23822377
    2383     set row 1 
     2378    set row 1
    23842379    set labels { qw qx qy qz xpan ypan zoom }
    23852380    foreach tag $labels {
     
    24352430    blt::table $inner \
    24362431        1,0 $inner.showstreams  -anchor w \
    2437         2,0 $inner.showarrows  -anchor w 
     2432        2,0 $inner.showarrows  -anchor w
    24382433    blt::table configure $inner c0 c1 -resize none
    24392434    blt::table configure $inner c2 -resize expand
     
    24582453            -font "Arial 9"
    24592454        Rappture::Tooltip::for $inner.part$row $info(description)
    2460         blt::table $inner $row,0 $inner.part$row -anchor w 
     2455        blt::table $inner $row,0 $inner.part$row -anchor w
    24612456        if { !$_settings($this-particles-$name) } {
    24622457            $inner.part$row select
    2463         } 
     2458        }
    24642459        incr row
    24652460    }
     
    24852480        if { !$_settings($this-box-$name) } {
    24862481            $inner.box$row select
    2487         } 
     2482        }
    24882483        incr row
    24892484    }
     
    24912486    blt::table configure $inner r$row -resize expand
    24922487    blt::table configure $inner c3 -resize expand
    2493     event generate [winfo parent [winfo parent $w]] <Configure> 
     2488    event generate [winfo parent [winfo parent $w]] <Configure>
    24942489}
    24952490
     
    25852580}
    25862581
    2587 #  camera -- 
     2582#  camera --
    25882583itcl::body Rappture::FlowvisViewer::camera {option args} {
    2589     switch -- $option { 
     2584    switch -- $option {
    25902585        "show" {
    25912586            puts [array get _view]
     
    26722667        append cmd " -corner1 {$info(corner1)} "
    26732668        append cmd " -corner2 {$info(corner2)}\n"
    2674     }    
     2669    }   
    26752670    append cmd "$tag data follows $nbytes $extents\n"
    26762671    return $cmd
     
    27402735        "stop" {
    27412736            if { $_flow(state) } {
    2742                 flow off 
     2737                flow off
    27432738                flow reset
    27442739            }
     
    27462741        "pause" {
    27472742            if { $_flow(state) } {
    2748                 flow off 
     2743                flow off
    27492744            }
    27502745        }
     
    27592754                    set _settings($this-step) 1
    27602755                    SendCmd "flow reset"
    2761                 } 
     2756                }
    27622757                flow next
    27632758            }
     
    27662761            if { $_settings($this-play) } {
    27672762                flow play
    2768             } else { 
     2763            } else {
    27692764                flow pause
    27702765            }
     
    27912786            }
    27922787            $_dispatcher event -after $_flow(delay) !play
    2793         } 
     2788        }
    27942789        default {
    27952790            error "bad option \"$option\": should be play, stop, toggle, or reset."
     
    28422837            1,0 $inner.please -anchor w \
    28432838            1,1 $inner.icon -anchor e  \
    2844             2,0 $inner.cancel -cspan 2 
    2845         blt::table configure $inner r0 -pady 4 
    2846         blt::table configure $inner r2 -pady 4 
     2839            2,0 $inner.cancel -cspan 2
     2840        blt::table configure $inner r0 -pady 4
     2841        blt::table configure $inner r2 -pady 4
    28472842        bind $inner.cancel <KeyPress-Return> [list $inner.cancel invoke]
    28482843    } else {
     
    28602855    update idletasks
    28612856    update
    2862     # We wait here for either 
    2863     #  1) the png to be delivered or 
    2864     #  2) timeout or  
     2857    # We wait here for either
     2858    #  1) the png to be delivered or
     2859    #  2) timeout or
    28652860    #  3) user cancels the operation.
    28662861    tkwait variable $var
     
    29012896            1,0 $inner.please -anchor w \
    29022897            1,1 $inner.icon -anchor e  \
    2903             2,0 $inner.cancel -cspan 2 
    2904         blt::table configure $inner r0 -pady 4 
    2905         blt::table configure $inner r2 -pady 4 
     2898            2,0 $inner.cancel -cspan 2
     2899        blt::table configure $inner r0 -pady 4
     2900        blt::table configure $inner r2 -pady 4
    29062901        bind $inner.cancel <KeyPress-Return> [list $inner.cancel invoke]
    29072902    } else {
    29082903        set inner [$popup component inner]
    29092904    }
    2910     update 
     2905    update
    29112906    # Timeout is set to 10 minutes.
    29122907    $_dispatcher event -after 600000 !movietimeout
     
    29142909    grab set $inner
    29152910    focus $inner.cancel
    2916     
     2911   
    29172912    flow duration
    29182913    flow speed
     
    29262921    set start [clock seconds]
    29272922    SendCmd "flow video $token -width $w -height $h -numframes $nframes "
    2928     
     2923   
    29292924    $popup activate $widget below
    2930     update idletasks 
     2925    update idletasks
    29312926    update
    29322927    # We wait here until
    2933     #  1. the movie is delivered or 
    2934     #  2. we've timed out or  
     2928    #  1. the movie is delivered or
     2929    #  2. we've timed out or
    29352930    #  3. the user has canceled the operation.b
    29362931    tkwait variable $var
     
    29472942
    29482943    # This will both cancel the movie generation (if it hasn't already
    2949     # completed) and reset the flow. 
     2944    # completed) and reset the flow.
    29502945    SendCmd "flow reset"
    29512946    if { $_hardcopy($this-$token) != "" } {
     
    29812976}
    29822977
    2983 itcl::body Rappture::FlowvisViewer::SetOrientation { side } { 
    2984     array set positions { 
    2985         front "1 0 0 0" 
    2986         back  "0 0 1 0" 
    2987         left  "0.707107 0 -0.707107 0" 
    2988         right "0.707107 0 0.707107 0" 
    2989         top   "0.707107 -0.707107 0 0" 
    2990         bottom "0.707107 0.707107 0 0" 
    2991     } 
    2992     foreach name { -qw -qx -qy -qz } value $positions($side) { 
     2978itcl::body Rappture::FlowvisViewer::SetOrientation { side } {
     2979    array set positions {
     2980        front "1 0 0 0"
     2981        back  "0 0 1 0"
     2982        left  "0.707107 0 -0.707107 0"
     2983        right "0.707107 0 0.707107 0"
     2984        top   "0.707107 -0.707107 0 0"
     2985        bottom "0.707107 0.707107 0 0"
     2986    }
     2987    foreach name { -qw -qx -qy -qz } value $positions($side) {
    29932988        set _view($name) $value
    2994     } 
     2989    }
    29952990    set q [ViewToQuaternion]
    29962991    $_arcball quaternion $q
    2997     SendCmd "camera orient $q" 
     2992    SendCmd "camera orient $q"
    29982993    SendCmd "camera reset"
    29992994    set _view(-xpan) 0.0
     
    30063001
    30073002# Reset global settings from dataset's settings.
    3008 itcl::body Rappture::FlowvisViewer::BuildVolumeComponents {} { 
     3003itcl::body Rappture::FlowvisViewer::BuildVolumeComponents {} {
    30093004    $itk_component(volcomponents) choices delete 0 end
    30103005    foreach name $_componentsList {
     
    30163011
    30173012# Reset global settings from dataset's settings.
    3018 itcl::body Rappture::FlowvisViewer::GetDatasetsWithComponent { cname } { 
     3013itcl::body Rappture::FlowvisViewer::GetDatasetsWithComponent { cname } {
    30193014    if { ![info exists _volcomponents($cname)] } {
    30203015        return ""
  • trunk/gui/scripts/nanovisviewer.tcl

    r5094 r5098  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: nanovisviewer - 3D volume rendering
     
    1919#
    2020# FIXME:
    21 #       Need to Add DX readers this client to examine the data before 
     21#       Need to Add DX readers this client to examine the data before
    2222#       it's sent to the server.  This will eliminate 90% of the insanity in
    23 #       computing the limits of all the volumes.  I can rip out all the 
     23#       computing the limits of all the volumes.  I can rip out all the
    2424#       "receive data" "send transfer function" event crap.
    2525#
     
    2929#       when a new volume is drawn (using the default transfer function) and
    3030#       then when the correct transfer function has been sent and linked to
    31 #       the volume. 
     31#       the volume.
    3232#
    3333option add *NanovisViewer.width 4i widgetDefault
     
    7575    public method isconnected {}
    7676    public method limits { tf }
    77     public method parameters {title args} { 
    78         # do nothing 
     77    public method parameters {title args} {
     78        # do nothing
    7979    }
    8080    public method scale {args}
     
    8383    # The following methods are only used by this class.
    8484
    85     private method AddNewMarker { x y } 
     85    private method AddNewMarker { x y }
    8686    private method AdjustSetting {what {value ""}}
    8787    private method BuildCameraTab {}
     
    9090    private method BuildVolumeComponents {}
    9191    private method BuildVolumeTab {}
    92     private method ComputeAlphamap { cname } 
     92    private method ComputeAlphamap { cname }
    9393    private method ComputeTransferFunction { cname }
    9494    private method Connect {}
     
    9797    private method DoResize {}
    9898    private method DrawLegend { cname }
    99     private method EventuallyRedrawLegend { } 
    100     private method EventuallyResize { w h } 
     99    private method EventuallyRedrawLegend { }
     100    private method EventuallyResize { w h }
    101101    private method FixLegend {}
    102     private method GetAlphamap { cname color } 
    103     private method GetColormap { cname color } 
    104     private method GetDatasetsWithComponent { cname } 
     102    private method GetAlphamap { cname color }
     103    private method GetColormap { cname color }
     104    private method GetDatasetsWithComponent { cname }
    105105    private method GetVolumeInfo { w }
    106     private method HideAllMarkers {} 
    107     private method InitComponentSettings { cname } 
     106    private method HideAllMarkers {}
     107    private method InitComponentSettings { cname }
    108108    private method InitSettings { args }
    109     private method NameToAlphamap { name } 
     109    private method NameToAlphamap { name }
    110110    private method NameTransferFunction { dataobj comp }
    111111    private method Pan {option x y}
     
    113113    private method ParseLevelsOption { cname levels }
    114114    private method ParseMarkersOption { cname markers }
    115     private method QuaternionToView { q } { 
     115    private method QuaternionToView { q } {
    116116        foreach { _view(-qw) _view(-qx) _view(-qy) _view(-qz) } $q break
    117117    }
     
    127127    private method Slice {option args}
    128128    private method SlicerTip {axis}
    129     private method SwitchComponent { cname } 
     129    private method SwitchComponent { cname }
    130130    private method ToggleVolume { tag name }
    131     private method ViewToQuaternion {} { 
     131    private method ViewToQuaternion {} {
    132132        return [list $_view(-qw) $_view(-qx) $_view(-qy) $_view(-qz)]
    133133    }
     
    136136    private variable _arcball ""
    137137
    138     private variable _dlist ""     ;# list of data objects
    139     private variable _obj2ovride   ;# maps dataobj => style override
    140     private variable _serverDatasets   ;# contains all the dataobj-component 
    141                                    ;# to volumes in the server
     138    private variable _dlist ""         ;# list of data objects
     139    private variable _obj2ovride       ;# maps dataobj => style override
     140    private variable _serverDatasets   ;# contains all the dataobj-component
     141                                       ;# to volumes in the server
    142142    private variable _recvdDatasets;    # list of data objs to send to server
    143143    private variable _dataset2style;    # maps dataobj-component to transfunc
    144     private variable _style2datasets;   # maps tf back to list of 
     144    private variable _style2datasets;   # maps tf back to list of
    145145                                        # dataobj-components using the tf.
    146146
    147     private variable _reset 1;          # Connection to server has been reset.
     147    private variable _reset 1;          # Connection to server has been reset.
    148148    private variable _click;            # Info used for rotate operations.
    149149    private variable _limits;           # Autoscale min/max for all axes
     
    153153    private variable _settings
    154154    private variable _first "" ;        # This is the topmost volume.
    155     private variable _current "";       # Currently selected component 
    156     private variable _volcomponents   ; # Array of components found
    157     private variable _componentsList   ; # Array of components found
     155    private variable _current "";       # Currently selected component
     156    private variable _volcomponents    ;# Array of components found
     157    private variable _componentsList   ;# Array of components found
    158158    private variable _cname2style
    159159    private variable _cname2transferFunction
     
    317317            -offimage [Rappture::icon cutbutton] \
    318318            -variable [itcl::scope _settings(-cutplanesvisible)] \
    319             -command [itcl::code $this AdjustSetting -cutplanesvisible] 
     319            -command [itcl::code $this AdjustSetting -cutplanesvisible]
    320320    }
    321321    Rappture::Tooltip::for $itk_component(cutplane) \
     
    329329        BuildCameraTab
    330330    } errs] != 0 } {
    331         global errorInfo
     331        global errorInfo
    332332        puts stderr "errs=$errs errorInfo=$errorInfo"
    333333    }
     
    349349        [list focus $itk_component(legend)]
    350350
    351     # Hack around the Tk panewindow.  The problem is that the requested 
     351    # Hack around the Tk panewindow.  The problem is that the requested
    352352    # size of the 3d view isn't set until an image is retrieved from
    353353    # the server.  So the panewindow uses the tiny size.
     
    356356    blt::table $itk_component(plotarea) \
    357357        0,0 $itk_component(3dview) -fill both -reqwidth $w \
    358         1,0 $itk_component(legend) -fill x 
     358        1,0 $itk_component(legend) -fill x
    359359    blt::table configure $itk_component(plotarea) r1 -resize none
    360360
     
    431431    }
    432432    catch { blt::arcball destroy $_arcball }
    433     array unset _settings 
     433    array unset _settings
    434434}
    435435
     
    565565        -markers  ""
    566566    }
    567     array unset _limits 
    568     array unset _volcomponents 
     567    array unset _limits
     568    array unset _volcomponents
    569569    foreach dataobj $args {
    570570        if { ![$dataobj isvalid] } {
     
    634634            # to the BLT picture image it won't be necessary to decode the
    635635            # image data.
    636             if { [image width $_image(plot)] > 0 && 
     636            if { [image width $_image(plot)] > 0 &&
    637637                 [image height $_image(plot)] > 0 } {
    638638                set bytes [$_image(plot) data -format "jpeg -quality 100"]
     
    660660        return 0
    661661    }
    662     set _reset 1 
     662    set _reset 1
    663663    set result [VisViewer::Connect $_hosts]
    664664    if { $result } {
     
    751751    ReceiveEcho <<line "<read $info(-bytes) bytes"
    752752    if { $info(-type) == "image" } {
    753         ReceiveEcho "for [image width $_image(plot)]x[image height $_image(plot)] image>"       
     753        ReceiveEcho "for [image width $_image(plot)]x[image height $_image(plot)] image>"
    754754        $_image(plot) configure -data $bytes
    755755    } elseif { $info(-type) == "print" } {
     
    824824#       The procedure is the response from the render server to each "legend"
    825825#       command.  The server sends back a "legend" command invoked our
    826 #       the slave interpreter.  The purpose is to collect data of the image 
     826#       the slave interpreter.  The purpose is to collect data of the image
    827827#       representing the legend in the canvas.  In addition, the
    828828#       active transfer function is displayed.
     
    907907    # Turn on buffering of commands to the server.  We don't want to
    908908    # be preempted by a server disconnect/reconnect (which automatically
    909     # generates a new call to Rebuild).   
     909    # generates a new call to Rebuild).
    910910    StartBufferingCommands
    911911
     
    959959    set _first [lindex [get] 0]
    960960    if { $_reset } {
    961         #
    962         # Reset the camera and other view parameters
    963         #
     961        #
     962        # Reset the camera and other view parameters
     963        #
    964964        set _settings(-qw)    $_view(-qw)
    965965        set _settings(-qx)    $_view(-qx)
    966966        set _settings(-qy)    $_view(-qy)
    967967        set _settings(-qz)    $_view(-qz)
    968         set _settings(-xpan)  $_view(-xpan)
    969         set _settings(-ypan)  $_view(-ypan)
    970         set _settings(-zoom)  $_view(-zoom)
     968        set _settings(-xpan)  $_view(-xpan)
     969        set _settings(-ypan)  $_view(-ypan)
     970        set _settings(-zoom)  $_view(-zoom)
    971971
    972972        set q [ViewToQuaternion]
     
    974974        SendCmd "camera orient $q"
    975975        SendCmd "camera reset"
    976         PanCamera
    977         SendCmd "camera zoom $_view(-zoom)"
    978        
     976        PanCamera
     977        SendCmd "camera zoom $_view(-zoom)"
     978
    979979        #cutplane state 0 all
    980980        foreach axis {x y z} {
     
    988988            -current
    989989
    990         if {"" != $_first} {
    991             set axis [$_first hints updir]
    992             if { "" != $axis } {
    993                 SendCmd "up $axis"
    994             }
    995             set location [$_first hints camera]
    996             if { $location != "" } {
    997                 array set _view $location
    998             }
    999         }
     990        if {"" != $_first} {
     991            set axis [$_first hints updir]
     992            if { "" != $axis } {
     993                SendCmd "up $axis"
     994            }
     995            set location [$_first hints camera]
     996            if { $location != "" } {
     997                array set _view $location
     998            }
     999        }
    10001000    }
    10011001    # Outline seems to need to be reset every update.
    1002     InitSettings -outlinevisible -cutplanesvisible 
     1002    InitSettings -outlinevisible -cutplanesvisible
    10031003    # nothing to send -- activate the proper ivol
    10041004    SendCmd "volume state 0"
    10051005    if {"" != $_first} {
    1006         set datasets [array names _serverDatasets $_first-*] 
     1006        set datasets [array names _serverDatasets $_first-*]
    10071007        if { $datasets != "" } {
    10081008            SendCmd "volume state 1 $datasets"
     
    10861086                }
    10871087            }
    1088             set q [ViewToQuaternion]         
     1088            set q [ViewToQuaternion]
    10891089            $_arcball quaternion $q
    10901090            SendCmd "camera orient $q"
     
    12331233    switch -- $what {
    12341234        "-ambient" {
    1235             # Other parts of the code use the ambient setting to 
     1235            # Other parts of the code use the ambient setting to
    12361236            # tell if the component settings have been initialized
    12371237            if { ![info exists _settings($_current${what})] } {
     
    12501250        "-background" {
    12511251            set bgcolor [$itk_component(background) value]
    1252             array set fgcolors {
    1253                 "black" "white"
    1254                 "white" "black"
    1255                 "grey"  "black"
    1256             }
     1252            array set fgcolors {
     1253                "black" "white"
     1254                "white" "black"
     1255                "grey"  "black"
     1256            }
    12571257            configure -plotbackground $bgcolor \
    1258                 -plotforeground $fgcolors($bgcolor)
    1259             DrawLegend $_current
     1258                -plotforeground $fgcolors($bgcolor)
     1259            DrawLegend $_current
    12601260        }
    12611261        "-colormap" {
     
    12941294                blt::table $itk_component(plotarea) \
    12951295                    0,0 $itk_component(3dview) -fill both \
    1296                     1,0 $itk_component(legend) -fill x 
     1296                    1,0 $itk_component(legend) -fill x
    12971297                blt::table configure $itk_component(plotarea) r1 -resize none
    12981298            } else {
     
    13471347            # have to synchronize each of the local controls (see below) with
    13481348            # this.
    1349             set datasets [CurrentDatasets] 
     1349            set datasets [CurrentDatasets]
    13501350            set bool $_settings($what)
    13511351            SendCmd "volume data state $bool $datasets"
     
    13561356        }
    13571357        "-volumevisible" {
    1358             # This is the component specific control.  It changes the 
     1358            # This is the component specific control.  It changes the
    13591359            # visibility of only the current component.
    13601360            set _settings($_current${what}) $_settings($what)
     
    13671367            set bool $_settings($what)
    13681368            # We only set cutplanes on the first dataset.
    1369             set datasets [CurrentDatasets -cutplanes] 
     1369            set datasets [CurrentDatasets -cutplanes]
    13701370            set tag [lindex $datasets 0]
    13711371            SendCmd "cutplane state $bool $axis $tag"
     
    14771477            ParseLevelsOption $cname $styles(-levels)
    14781478        }
    1479        
     1479
    14801480    }
    14811481    set wmap [ComputeAlphamap $cname]
     
    14981498    }
    14991499    # Add a new marker to the current transfer function
    1500     $_transferFunctionEditors($_current) deleteMarker $x $y 
     1500    $_transferFunctionEditors($_current) deleteMarker $x $y
    15011501}
    15021502
     
    15231523        SendCmd "grid axiscolor $rgb"
    15241524        SendCmd "grid linecolor $rgb"
    1525         $itk_component(legend) itemconfigure labels -fill $color 
    1526         $itk_component(legend) itemconfigure limits -fill $color 
     1525        $itk_component(legend) itemconfigure labels -fill $color
     1526        $itk_component(legend) itemconfigure limits -fill $color
    15271527    }
    15281528}
     
    15711571#
    15721572# The -markers option takes a list of zero or more values (the values
    1573 # may be separated either by spaces or commas) that have the following 
     1573# may be separated either by spaces or commas) that have the following
    15741574# format:
    15751575#
     
    15891589        set n [scan $marker "%g%s" value suffix]
    15901590        if { $n == 2 && $suffix == "%" } {
    1591             # $n% : Set relative value (0..1). 
     1591            # $n% : Set relative value (0..1).
    15921592            lappend list [expr {$value * 0.01}]
    15931593        } else {
     
    16021602
    16031603# ----------------------------------------------------------------------
    1604 # USAGE: UndateTransferFuncs 
     1604# USAGE: UndateTransferFuncs
    16051605# ----------------------------------------------------------------------
    16061606itcl::body Rappture::NanovisViewer::updateTransferFunctions {} {
     
    16291629    if { $min != "" } {
    16301630        set _limits(min) $min
    1631     } 
     1631    }
    16321632    if { $max != "" } {
    16331633        set _limits(max) $max
     
    16831683        -font "Arial 9"
    16841684
    1685     label $inner.background_l -text "Background" -font "Arial 9" 
     1685    label $inner.background_l -text "Background" -font "Arial 9"
    16861686    itk_component add background {
    16871687        Rappture::Combobox $inner.background -width 10 -editable no
     
    16901690        "black"              "black"            \
    16911691        "white"              "white"            \
    1692         "grey"               "grey"             
     1692        "grey"               "grey"
    16931693
    16941694    $itk_component(background) value $_settings(-background)
     
    17231723    label $inner.lighting_l \
    17241724        -text "Lighting / Material Properties" \
    1725         -font "Arial 9 bold" 
     1725        -font "Arial 9 bold"
    17261726
    17271727    checkbutton $inner.light2side -text "Two-sided lighting" -font $fg \
     
    17671767
    17681768    label $inner.transferfunction_l \
    1769         -text "Transfer Function" -font "Arial 9 bold" 
     1769        -text "Transfer Function" -font "Arial 9 bold"
    17701770
    17711771    # Tooth thickness
     
    17781778    label $inner.thick -text "Thick" -font $fg
    17791779
    1780     # Colormap 
     1780    # Colormap
    17811781    label $inner.colormap_l -text "Colormap" -font $fg
    17821782    itk_component add colormap {
     
    18191819        11,1 $inner.thin             -anchor e \
    18201820        11,2 $inner.thickness                 -cspan 2 -fill x \
    1821         11,4 $inner.thick -anchor w 
     1821        11,4 $inner.thick -anchor w
    18221822
    18231823    blt::table configure $inner c* r* -resize none
     
    20422042}
    20432043
    2044 #  camera -- 
     2044#  camera --
    20452045#
    20462046itcl::body Rappture::NanovisViewer::camera {option args} {
    2047     switch -- $option { 
     2047    switch -- $option {
    20482048        "show" {
    20492049            puts [array get _view]
     
    21192119            -font "Arial 9"
    21202120        Rappture::Tooltip::for $inner.vol$row $info(description)
    2121         blt::table $inner $row,0 $inner.vol$row -anchor w 
     2121        blt::table $inner $row,0 $inner.vol$row -anchor w
    21222122        if { !$_settings(-volume-$name) } {
    21232123            $inner.vol$row select
    2124         } 
     2124        }
    21252125        incr row
    21262126    }
     
    21282128    blt::table configure $inner r$row -resize expand
    21292129    blt::table configure $inner c3 -resize expand
    2130     event generate [winfo parent [winfo parent $w]] <Configure> 
     2130    event generate [winfo parent [winfo parent $w]] <Configure>
    21312131}
    21322132
     
    21362136}
    21372137
    2138 itcl::body Rappture::NanovisViewer::SetOrientation { side } { 
     2138itcl::body Rappture::NanovisViewer::SetOrientation { side } {
    21392139    array set positions {
    21402140        front "1 0 0 0"
     
    21472147    foreach name { -qw -qx -qy -qz } value $positions($side) {
    21482148        set _view($name) $value
    2149     } 
     2149    }
    21502150    set q [ViewToQuaternion]
    21512151    $_arcball quaternion $q
    2152     SendCmd "camera orient $q" 
     2152    SendCmd "camera orient $q"
    21532153    SendCmd "camera reset"
    21542154    set _view(-xpan) 0
     
    21682168#    time we try to switch to a given component in SwitchComponent below.
    21692169#
    2170 itcl::body Rappture::NanovisViewer::InitComponentSettings { cname } { 
     2170itcl::body Rappture::NanovisViewer::InitComponentSettings { cname } {
    21712171    # Expanding component name for key.
    21722172    array set _settings [subst {
     
    21902190#    with the settings of the new current component.
    21912191#
    2192 itcl::body Rappture::NanovisViewer::SwitchComponent { cname } { 
     2192itcl::body Rappture::NanovisViewer::SwitchComponent { cname } {
    21932193    if { ![info exists _settings($cname-ambient)] } {
    21942194        InitComponentSettings $cname
     
    22182218#    volume settings tab.
    22192219#
    2220 itcl::body Rappture::NanovisViewer::BuildVolumeComponents {} { 
     2220itcl::body Rappture::NanovisViewer::BuildVolumeComponents {} {
    22212221    $itk_component(volcomponents) choices delete 0 end
    22222222    foreach name $_componentsList {
     
    22282228    if { [llength $_componentsList] <= 1 } {
    22292229        # Unpack the components label and dropdown if there's only one
    2230         # component. 
     2230        # component.
    22312231        blt::table forget $parent.volcomponents_l $parent.volcomponents
    22322232    } else {
    2233         # Pack the components label and dropdown into the table there's 
    2234         # more than one component to select. 
     2233        # Pack the components label and dropdown into the table there's
     2234        # more than one component to select.
    22352235        blt::table $parent \
    22362236            0,0 $parent.volcomponents_l -anchor e -cspan 2 \
    2237             0,2 $parent.volcomponents -cspan 3 -fill x 
     2237            0,2 $parent.volcomponents -cspan 3 -fill x
    22382238    }
    22392239}
     
    22472247#    volumes that have the current component.
    22482248#
    2249 itcl::body Rappture::NanovisViewer::GetDatasetsWithComponent { cname } { 
     2249itcl::body Rappture::NanovisViewer::GetDatasetsWithComponent { cname } {
    22502250    if { ![info exists _volcomponents($cname)] } {
    22512251        return ""
     
    22682268#    created, deleted, or moved markers.
    22692269#
    2270 itcl::body Rappture::NanovisViewer::HideAllMarkers {} { 
     2270itcl::body Rappture::NanovisViewer::HideAllMarkers {} {
    22712271    foreach cname [array names _transferFunctionEditors] {
    2272         $_transferFunctionEditors($cname) hideMarkers 
    2273     }
    2274 }
    2275 
    2276 itcl::body Rappture::NanovisViewer::GetColormap { cname color } { 
     2272        $_transferFunctionEditors($cname) hideMarkers
     2273    }
     2274}
     2275
     2276itcl::body Rappture::NanovisViewer::GetColormap { cname color } {
    22772277    if { $color == "default" } {
    22782278        return $_cname2defaultcolormap($cname)
     
    22812281}
    22822282
    2283 itcl::body Rappture::NanovisViewer::GetAlphamap { cname name } { 
     2283itcl::body Rappture::NanovisViewer::GetAlphamap { cname name } {
    22842284    if { $name == "default" } {
    22852285        return $_cname2defaultalphamap($cname)
     
    22882288}
    22892289
    2290 itcl::body Rappture::NanovisViewer::ResetColormap { cname color } { 
     2290itcl::body Rappture::NanovisViewer::ResetColormap { cname color } {
    22912291    # Get the current transfer function
    22922292    if { ![info exists _cname2transferFunction($cname)] } {
     
    23002300}
    23012301
    2302 itcl::body Rappture::NanovisViewer::ComputeAlphamap { cname } { 
     2302itcl::body Rappture::NanovisViewer::ComputeAlphamap { cname } {
    23032303    if { ![info exists _transferFunctionEditors($cname)] } {
    23042304        return [list 0.0 0.0 1.0 1.0]
     
    23192319    # Scale values between 0.00001 and 0.01000
    23202320    set delta [expr {double($_settings($cname-thickness)) * 0.0001}]
    2321    
     2321
    23222322    set first [lindex $isovalues 0]
    23232323    set last [lindex $isovalues end]
     
    23662366    switch -- $name {
    23672367        "ramp-up" {
    2368             set wmap { 
    2369                 0.0 0.0 
    2370                 1.0 1.0 
     2368            set wmap {
     2369                0.0 0.0
     2370                1.0 1.0
    23712371            }
    23722372        }
    23732373        "ramp-down" {
    2374             set wmap { 
    2375                 0.0 1.0 
    2376                 1.0 0.0 
     2374            set wmap {
     2375                0.0 1.0
     2376                1.0 0.0
    23772377            }
    23782378        }
    23792379        "vee" {
    2380             set wmap { 
    2381                 0.0 1.0 
    2382                 0.5 0.0 
    2383                 1.0 1.0 
     2380            set wmap {
     2381                0.0 1.0
     2382                0.5 0.0
     2383                1.0 1.0
    23842384            }
    23852385        }
    23862386        "tent-1" {
    2387             set wmap { 
    2388                 0.0 0.0 
    2389                 0.5 1.0 
    2390                 1.0 0.0 
     2387            set wmap {
     2388                0.0 0.0
     2389                0.5 1.0
     2390                1.0 0.0
    23912391            }
    23922392        }
    23932393        "tent-2" {
    2394             set wmap { 
    2395                 0.0 0.0 
    2396                 0.25 1.0 
    2397                 0.5 0.0 
    2398                 0.75 1.0 
    2399                 1.0 0.0 
     2394            set wmap {
     2395                0.0 0.0
     2396                0.25 1.0
     2397                0.5 0.0
     2398                0.75 1.0
     2399                1.0 0.0
    24002400            }
    24012401        }
    24022402        "tent-3" {
    2403             set wmap { 
    2404                 0.0 0.0 
     2403            set wmap {
     2404                0.0 0.0
    24052405                0.16666 1.0
    24062406                0.33333 0.0
     
    24082408                0.66666 0.0
    24092409                0.83333 1.0
    2410                 1.0 0.0 
     2410                1.0 0.0
    24112411            }
    24122412        }
    24132413        "tent-4" {
    2414             set wmap { 
    2415                 0.0     0.0 
     2414            set wmap {
     2415                0.0     0.0
    24162416                0.125   1.0
    24172417                0.25    0.0
    24182418                0.375   1.0
    2419                 0.5     0.0       
     2419                0.5     0.0
    24202420                0.625   1.0
    24212421                0.75    0.0
    24222422                0.875   1.0
    2423                 1.0     0.0 
     2423                1.0     0.0
    24242424            }
    24252425        }
    24262426        "sinusoid-1" {
    24272427            set wmap {
    2428                 0.0                     0.000 0.600 0.800 
    2429                 0.14285714285714285     0.400 0.900 1.000 
    2430                 0.2857142857142857      0.600 1.000 1.000 
    2431                 0.42857142857142855     0.800 1.000 1.000 
    2432                 0.5714285714285714      0.900 0.900 0.900 
    2433                 0.7142857142857143      0.600 0.600 0.600 
    2434                 0.8571428571428571      0.400 0.400 0.400 
     2428                0.0                     0.000 0.600 0.800
     2429                0.14285714285714285     0.400 0.900 1.000
     2430                0.2857142857142857      0.600 1.000 1.000
     2431                0.42857142857142855     0.800 1.000 1.000
     2432                0.5714285714285714      0.900 0.900 0.900
     2433                0.7142857142857143      0.600 0.600 0.600
     2434                0.8571428571428571      0.400 0.400 0.400
    24352435                1.0                     0.200 0.200 0.200
    24362436            }
    24372437        }
    24382438        "sinusoid-2" {
    2439             set wmap { 
    2440                 0.0                     0.900 1.000 1.000 
    2441                 0.1111111111111111      0.800 0.983 1.000 
    2442                 0.2222222222222222      0.700 0.950 1.000 
    2443                 0.3333333333333333      0.600 0.900 1.000 
    2444                 0.4444444444444444      0.500 0.833 1.000 
    2445                 0.5555555555555556      0.400 0.750 1.000 
    2446                 0.6666666666666666      0.300 0.650 1.000 
    2447                 0.7777777777777778      0.200 0.533 1.000 
    2448                 0.8888888888888888      0.100 0.400 1.000 
     2439            set wmap {
     2440                0.0                     0.900 1.000 1.000
     2441                0.1111111111111111      0.800 0.983 1.000
     2442                0.2222222222222222      0.700 0.950 1.000
     2443                0.3333333333333333      0.600 0.900 1.000
     2444                0.4444444444444444      0.500 0.833 1.000
     2445                0.5555555555555556      0.400 0.750 1.000
     2446                0.6666666666666666      0.300 0.650 1.000
     2447                0.7777777777777778      0.200 0.533 1.000
     2448                0.8888888888888888      0.100 0.400 1.000
    24492449                1.0                     0.000 0.250 1.000
    24502450            }
     
    24522452        "sinusoid-6" {
    24532453            set wmap {
    2454                 0.0                             0.200   0.100   0.000 
    2455                 0.09090909090909091             0.400   0.187   0.000 
    2456                 0.18181818181818182             0.600   0.379   0.210 
    2457                 0.2727272727272727              0.800   0.608   0.480 
    2458                 0.36363636363636365             0.850   0.688   0.595 
    2459                 0.45454545454545453             0.950   0.855   0.808 
    2460                 0.5454545454545454              0.800   0.993   1.000 
    2461                 0.6363636363636364              0.600   0.973   1.000 
    2462                 0.7272727272727273              0.400   0.940   1.000 
    2463                 0.8181818181818182              0.200   0.893   1.000 
    2464                 0.9090909090909091              0.000   0.667   0.800 
    2465                 1.0                             0.000   0.480   0.600 
     2454                0.0                             0.200   0.100   0.000
     2455                0.09090909090909091             0.400   0.187   0.000
     2456                0.18181818181818182             0.600   0.379   0.210
     2457                0.2727272727272727              0.800   0.608   0.480
     2458                0.36363636363636365             0.850   0.688   0.595
     2459                0.45454545454545453             0.950   0.855   0.808
     2460                0.5454545454545454              0.800   0.993   1.000
     2461                0.6363636363636364              0.600   0.973   1.000
     2462                0.7272727272727273              0.400   0.940   1.000
     2463                0.8181818181818182              0.200   0.893   1.000
     2464                0.9090909090909091              0.000   0.667   0.800
     2465                1.0                             0.000   0.480   0.600
    24662466            }
    24672467        }
    24682468        "sinusoid-10" {
    24692469            set wmap {
    2470                 0.0                             0.000   0.480   0.600 
    2471                 0.09090909090909091             0.000   0.667   0.800 
    2472                 0.18181818181818182             0.200   0.893   1.000 
    2473                 0.2727272727272727              0.400   0.940   1.000 
    2474                 0.36363636363636365             0.600   0.973   1.000 
    2475                 0.45454545454545453             0.800   0.993   1.000 
    2476                 0.5454545454545454              0.950   0.855   0.808 
    2477                 0.6363636363636364              0.850   0.688   0.595 
    2478                 0.7272727272727273              0.800   0.608   0.480 
    2479                 0.8181818181818182              0.600   0.379   0.210 
    2480                 0.9090909090909091              0.400   0.187   0.000 
    2481                 1.0                             0.200   0.100   0.000 
     2470                0.0                             0.000   0.480   0.600
     2471                0.09090909090909091             0.000   0.667   0.800
     2472                0.18181818181818182             0.200   0.893   1.000
     2473                0.2727272727272727              0.400   0.940   1.000
     2474                0.36363636363636365             0.600   0.973   1.000
     2475                0.45454545454545453             0.800   0.993   1.000
     2476                0.5454545454545454              0.950   0.855   0.808
     2477                0.6363636363636364              0.850   0.688   0.595
     2478                0.7272727272727273              0.800   0.608   0.480
     2479                0.8181818181818182              0.600   0.379   0.210
     2480                0.9090909090909091              0.400   0.187   0.000
     2481                1.0                             0.200   0.100   0.000
    24822482            }
    24832483        }
     
    25172517            set wmap {
    25182518                "#EE82EE"
    2519                 "#4B0082" 
    2520                 "blue" 
    2521                 "#008000" 
    2522                 "yellow" 
    2523                 "#FFA500" 
    2524                 "red" 
     2519                "#4B0082"
     2520                "blue"
     2521                "#008000"
     2522                "yellow"
     2523                "#FFA500"
     2524                "red"
    25252525            }
    25262526        }
Note: See TracChangeset for help on using the changeset viewer.