Ignore:
Timestamp:
Jul 17, 2014, 10:22:29 PM (10 years ago)
Author:
ldelgass
Message:

Fix lighting settings for components

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3/gui/scripts/nanovisviewer.tcl

    r4551 r4558  
    221221
    222222    array set _settings {
    223         -axesvisible       1
    224         -background        black
    225         -colormap          default
    226         -cutplanesvisible  0
    227         -gridvisible       0
    228         -isosurfaceshading 0
    229         -legendvisible     1
    230         -light2side        1
    231         -outlinevisible    0
    232         -qw                0.853553
    233         -qx                -0.353553
    234         -qy                0.353553
    235         -qz                0.146447
    236         -thickness         350
    237         -volume            1
    238         -volumeopacity     0.5
    239         -volumevisible     1
    240         -xcutplaneposition 50
    241         -xcutplanevisible  1
    242         -xpan              0
    243         -ycutplaneposition 50
    244         -ycutplanevisible  1
    245         -ypan              0
    246         -zcutplaneposition 50
    247         -zcutplanevisible  1
    248         -zoom              1.0
     223        -axesvisible            1
     224        -background             black
     225        -colormap               default
     226        -cutplanesvisible       0
     227        -gridvisible            0
     228        -isosurfaceshading      0
     229        -legendvisible          1
     230        -light2side             1
     231        -outlinevisible         0
     232        -qw                     0.853553
     233        -qx                     -0.353553
     234        -qy                     0.353553
     235        -qz                     0.146447
     236        -thickness              350
     237        -volume                 1
     238        -volumeopacity          0.5
     239        -volumevisible          1
     240        -xcutplaneposition      50
     241        -xcutplanevisible       1
     242        -xpan                   0
     243        -ycutplaneposition      50
     244        -ycutplanevisible       1
     245        -ypan                   0
     246        -zcutplaneposition      50
     247        -zcutplanevisible       1
     248        -zoom                   1.0
    249249    }
    250250    array set _widget {
     
    12101210            SendCmd "axis visible $_settings($what)"
    12111211        }
     1212        "-background" {
     1213            set bgcolor [$itk_component(background) value]
     1214            array set fgcolors {
     1215                "black" "white"
     1216                "white" "black"
     1217                "grey"  "black"
     1218            }
     1219            configure -plotbackground $bgcolor \
     1220                -plotforeground $fgcolors($bgcolor)
     1221            DrawLegend $_current
     1222        }
    12121223        "-colormap" {
    12131224            set color [$itk_component(colormap) value]
     
    12371248            }
    12381249        }
    1239         "-background" {
    1240             set bgcolor [$itk_component(background) value]
    1241             array set fgcolors {
    1242                 "black" "white"
    1243                 "white" "black"
    1244                 "grey"  "black"
    1245             }
    1246             configure -plotbackground $bgcolor \
    1247                 -plotforeground $fgcolors($bgcolor)
    1248             DrawLegend $_current
    1249         }
    12501250        "-gridvisible" {
    12511251            SendCmd "grid visible $_settings($what)"
     
    12651265        }
    12661266        "-light" {
     1267            set _settings($_current${what}) $_settings($what)
    12671268            set val $_settings($what)
    12681269            set diffuse [expr {0.01*$val}]
     
    12701271            set specularLevel 0.3
    12711272            set specularExp 90.0
    1272             SendCmd "volume shading ambient $ambient"
    1273             SendCmd "volume shading diffuse $diffuse"
    1274             SendCmd "volume shading specularLevel $specularLevel"
    1275             SendCmd "volume shading specularExp $specularExp"
     1273            foreach tag [GetDatasetsWithComponent $_current] {
     1274                SendCmd "volume shading ambient $ambient $tag"
     1275                SendCmd "volume shading diffuse $diffuse $tag"
     1276                SendCmd "volume shading specularLevel $specularLevel $tag"
     1277                SendCmd "volume shading specularExp $specularExp $tag"
     1278            }
    12761279        }
    12771280        "-light2side" {
     1281            set _settings($_current${what}) $_settings($what)
    12781282            set val $_settings($what)
    1279             SendCmd "volume shading light2side $val"
     1283            foreach tag [GetDatasetsWithComponent $_current] {
     1284                SendCmd "volume shading light2side $val"
     1285            }
    12801286        }
    12811287        "-volumeopacity" {
     
    16481654
    16491655    $itk_component(background) value $_settings(-background)
    1650     bind $inner.background <<Value>> [itcl::code $this AdjustSetting -background]
     1656    bind $inner.background <<Value>> \
     1657        [itcl::code $this AdjustSetting -background]
    16511658
    16521659    blt::table $inner \
     
    17141721    }
    17151722
    1716     $inner.colormap choices insert end [GetColormapList -includeNone]
    1717     $itk_component(colormap) value "BCGYR"
     1723    $inner.colormap choices insert end [GetColormapList -includeDefault -includeNone]
    17181724    bind $inner.colormap <<Value>> \
    17191725        [itcl::code $this AdjustSetting -colormap]
Note: See TracChangeset for help on using the changeset viewer.