Changeset 3915 for trunk/gui


Ignore:
Timestamp:
Sep 10, 2013 9:25:31 PM (11 years ago)
Author:
ldelgass
Message:

Add volume shading controls to flowvisviewer

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r3899 r3915  
    253253        $this-streams           0
    254254        $this-volume            1
     255        $this-ambient           20
     256        $this-diffuse           80
     257        $this-light2side        1
     258        $this-opacity           100
     259        $this-specularLevel     30
     260        $this-specularExponent  90
     261        $this-thickness         350
     262        $this-transp            50
    255263        $this-cutplaneVisible   0
    256264        $this-xcutplane         1
     
    12561264
    12571265    # Reset the camera and other view parameters
    1258     InitSettings light2side light transp isosurface grid axes volume outline \
     1266    InitSettings light2side ambient diffuse specularLevel specularExponent \
     1267        transp isosurface grid axes volume outline \
    12591268        cutplaneVisible xcutplane ycutplane zcutplane
    1260    
     1269
    12611270    # nothing to send -- activate the proper volume
    12621271    if {"" != $_first} {
    1263         AdjustSetting light
    1264         AdjustSetting transp
    12651272        set axis [$_first hints updir]
    12661273        if {"" != $axis} {
     
    16391646            #ResetColormap $color
    16401647        }
    1641         light {
     1648        ambient {
    16421649            if { $_first != "" } {
    16431650                set comp [lindex [$_first components] 0]
    16441651                set tag $_first-$comp
    1645                 set diffuse [expr {0.01*$_settings($this-light)}]
    1646                 set ambient [expr {1.0 - $diffuse}]
    1647                 set specularLevel 0.3
    1648                 set specularExp 90.0
    1649                 SendCmd "$tag configure -ambient $ambient -diffuse $diffuse -specularLevel $specularLevel -specularExp $specularExp"
     1652                set val $_settings($this-ambient)
     1653                set val [expr {0.01*$val}]
     1654                SendCmd "$tag configure -ambient $val"
     1655            }
     1656        }
     1657        diffuse {
     1658            if { $_first != "" } {
     1659                set comp [lindex [$_first components] 0]
     1660                set tag $_first-$comp
     1661                set val $_settings($this-diffuse)
     1662                set val [expr {0.01*$val}]
     1663                SendCmd "$tag configure -diffuse $val"
     1664            }
     1665        }
     1666        specularLevel {
     1667            if { $_first != "" } {
     1668                set comp [lindex [$_first components] 0]
     1669                set tag $_first-$comp
     1670                set val $_settings($this-specularLevel)
     1671                set val [expr {0.01*$val}]
     1672                SendCmd "$tag configure -specularLevel $val"
     1673            }
     1674        }
     1675        specularExponent {
     1676            if { $_first != "" } {
     1677                set comp [lindex [$_first components] 0]
     1678                set tag $_first-$comp
     1679                set val $_settings($this-specularExponent)
     1680                SendCmd "$tag configure -specularExp $val"
    16501681            }
    16511682        }
     
    22072238
    22082239itcl::body Rappture::FlowvisViewer::BuildVolumeTab {} {
    2209     foreach { key value } {
    2210         light2side      1
    2211         light           40
    2212         transp          50
    2213         opacity         100
    2214         thickness       350
    2215     } {
    2216         set _settings($this-$key) $value
    2217     }
    2218 
    22192240    set inner [$itk_component(main) insert end \
    22202241        -title "Volume Settings" \
     
    22372258        -command [itcl::code $this AdjustSetting light2side]
    22382259
    2239     label $inner.dim -text "Glow" -font $fg
    2240     ::scale $inner.light -from 0 -to 100 -orient horizontal \
    2241         -variable [itcl::scope _settings($this-light)] \
     2260    label $inner.ambient_l -text "Ambient" -font $fg
     2261    ::scale $inner.ambient -from 0 -to 100 -orient horizontal \
     2262        -variable [itcl::scope _settings($this-ambient)] \
    22422263        -width 10 \
    2243         -showvalue off -command [itcl::code $this AdjustSetting light]
    2244     label $inner.bright -text "Surface" -font $fg
    2245 
    2246     label $inner.fog -text "Clear" -font $fg
     2264        -showvalue off -command [itcl::code $this AdjustSetting ambient]
     2265
     2266    label $inner.diffuse_l -text "Diffuse" -font $fg
     2267    ::scale $inner.diffuse -from 0 -to 100 -orient horizontal \
     2268        -variable [itcl::scope _settings($this-diffuse)] \
     2269        -width 10 \
     2270        -showvalue off -command [itcl::code $this AdjustSetting diffuse]
     2271
     2272    label $inner.specularLevel_l -text "Specular" -font $fg
     2273    ::scale $inner.specularLevel -from 0 -to 100 -orient horizontal \
     2274        -variable [itcl::scope _settings($this-specularLevel)] \
     2275        -width 10 \
     2276        -showvalue off -command [itcl::code $this AdjustSetting specularLevel]
     2277
     2278    label $inner.specularExponent_l -text "Shininess" -font $fg
     2279    ::scale $inner.specularExponent -from 10 -to 128 -orient horizontal \
     2280        -variable [itcl::scope _settings($this-specularExponent)] \
     2281        -width 10 \
     2282        -showvalue off -command [itcl::code $this AdjustSetting specularExponent]
     2283
     2284    label $inner.clear -text "Clear" -font $fg
    22472285    ::scale $inner.transp -from 0 -to 100 -orient horizontal \
    22482286        -variable [itcl::scope _settings($this-transp)] \
    22492287        -width 10 \
    22502288        -showvalue off -command [itcl::code $this AdjustSetting transp]
    2251     label $inner.plastic -text "Opaque" -font $fg
    2252 
    2253     label $inner.clear -text "Clear" -font $fg
    2254     ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    2255         -variable [itcl::scope _settings($this-opacity)] \
    2256         -width 10 \
    2257         -showvalue off -command [itcl::code $this AdjustSetting opacity]
    22582289    label $inner.opaque -text "Opaque" -font $fg
    22592290
     
    22972328        1,0 $inner.shading -cspan 4 -anchor w -pady {10 2} \
    22982329        2,0 $inner.light2side -cspan 4 -anchor w -pady 2 \
    2299         3,0 $inner.dim -anchor e -pady 2 \
    2300         3,1 $inner.light -cspan 2 -pady 2 -fill x \
    2301         3,3 $inner.bright -anchor w -pady 2 \
    2302         4,0 $inner.fog -anchor e -pady 2 \
    2303         4,1 $inner.transp -cspan 2 -pady 2 -fill x \
    2304         4,3 $inner.plastic -anchor w -pady 2 \
    2305         5,0 $inner.thin -anchor e -pady 2 \
    2306         5,1 $inner.thickness -cspan 2 -pady 2 -fill x\
    2307         5,3 $inner.thick -anchor w -pady 2
     2330        3,0 $inner.ambient_l -anchor e -pady 2 \
     2331        3,1 $inner.ambient -cspan 3 -pady 2 -fill x \
     2332        4,0 $inner.diffuse_l -anchor e -pady 2 \
     2333        4,1 $inner.diffuse -cspan 3 -pady 2 -fill x \
     2334        5,0 $inner.specularLevel_l -anchor e -pady 2 \
     2335        5,1 $inner.specularLevel -cspan 3 -pady 2 -fill x \
     2336        6,0 $inner.specularExponent_l -anchor e -pady 2 \
     2337        6,1 $inner.specularExponent -cspan 3 -pady 2 -fill x \
     2338        7,0 $inner.clear -anchor e -pady 2 \
     2339        7,1 $inner.transp -cspan 2 -pady 2 -fill x \
     2340        7,3 $inner.opaque -anchor w -pady 2 \
     2341        8,0 $inner.thin -anchor e -pady 2 \
     2342        8,1 $inner.thickness -cspan 2 -pady 2 -fill x \
     2343        8,3 $inner.thick -anchor w -pady 2
    23082344
    23092345    blt::table configure $inner c0 c1 c3 r* -resize none
    2310     blt::table configure $inner r6 -resize expand
     2346    blt::table configure $inner r9 -resize expand
    23112347}
    23122348
  • trunk/gui/scripts/nanovisviewer.tcl

    r3913 r3915  
    17581758        -variable [itcl::scope _settings($this-volume)] \
    17591759        -command [itcl::code $this AdjustSetting volume]
     1760
    17601761    label $inner.shading -text "Shading:" -font $fg
    17611762
     
    18461847        7,3 $inner.opaque -anchor w -pady 2 \
    18471848        8,0 $inner.thin -anchor e -pady 2 \
    1848         8,1 $inner.thickness -cspan 2 -pady 2 -fill x\
     1849        8,1 $inner.thickness -cspan 2 -pady 2 -fill x \
    18491850        8,3 $inner.thick -anchor w -pady 2
    18501851
Note: See TracChangeset for help on using the changeset viewer.