Changeset 4550


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

merge background settings from trunk

Location:
branches/1.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/gui/scripts/flowvisviewer.tcl

    r4548 r4550  
    18471847itcl::configbody Rappture::FlowvisViewer::plotbackground {
    18481848    if { [isconnected] } {
    1849         foreach {r g b} [Color2RGB $itk_option(-plotbackground)] break
    1850         #fix this!
    1851         #SendCmd "color background $r $g $b"
     1849        set color $itk_option(-plotbackground)
     1850        set rgb [Color2RGB $color]
     1851        SendCmd "screen bgcolor $rgb"
     1852        $itk_component(legend) configure -background $color
    18521853    }
    18531854}
     
    18581859itcl::configbody Rappture::FlowvisViewer::plotforeground {
    18591860    if { [isconnected] } {
    1860         foreach {r g b} [Color2RGB $itk_option(-plotforeground)] break
    1861         #fix this!
    1862         #SendCmd "color background $r $g $b"
     1861        set color $itk_option(-plotforeground)
     1862        set rgb [Color2RGB $color]
     1863        SendCmd "volume outline color $rgb"
     1864        SendCmd "grid axiscolor $rgb"
     1865        SendCmd "grid linecolor $rgb"
     1866        $itk_component(legend) itemconfigure labels -fill $color
     1867        $itk_component(legend) itemconfigure limits -fill $color
    18631868    }
    18641869}
  • branches/1.3/gui/scripts/nanovisviewer.tcl

    r4531 r4550  
    222222    array set _settings {
    223223        -axesvisible       1
     224        -background        black
    224225        -colormap          default
    225226        -cutplanesvisible  0
     
    12361237            }
    12371238        }
     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        }
    12381250        "-gridvisible" {
    12391251            SendCmd "grid visible $_settings($what)"
     
    14491461itcl::configbody Rappture::NanovisViewer::plotbackground {
    14501462    if { [isconnected] } {
    1451         foreach {r g b} [Color2RGB $itk_option(-plotbackground)] break
    1452         #fix this!
    1453         #SendCmd "color background $r $g $b"
     1463        set color $itk_option(-plotbackground)
     1464        set rgb [Color2RGB $color]
     1465        SendCmd "screen bgcolor $rgb"
     1466        $itk_component(legend) configure -background $color
    14541467    }
    14551468}
     
    14601473itcl::configbody Rappture::NanovisViewer::plotforeground {
    14611474    if { [isconnected] } {
    1462         foreach {r g b} [Color2RGB $itk_option(-plotforeground)] break
    1463         #fix this!
    1464         #SendCmd "color background $r $g $b"
     1475        set color $itk_option(-plotforeground)
     1476        set rgb [Color2RGB $color]
     1477        SendCmd "volume outline color $rgb"
     1478        SendCmd "grid axiscolor $rgb"
     1479        SendCmd "grid linecolor $rgb"
     1480        $itk_component(legend) itemconfigure labels -fill $color
     1481        $itk_component(legend) itemconfigure limits -fill $color
    14651482    }
    14661483}
     
    16211638        -font "Arial 9"
    16221639
     1640    label $inner.background_l -text "Background" -font "Arial 9"
     1641    itk_component add background {
     1642        Rappture::Combobox $inner.background -width 10 -editable no
     1643    }
     1644    $inner.background choices insert end \
     1645        "black"              "black"            \
     1646        "white"              "white"            \
     1647        "grey"               "grey"             
     1648
     1649    $itk_component(background) value $_settings(background)
     1650    bind $inner.background <<Value>> [itcl::code $this AdjustSetting background]
     1651
    16231652    blt::table $inner \
    16241653        0,0 $inner.axes  -cspan 2 -anchor w \
     
    16261655        2,0 $inner.outline  -cspan 2 -anchor w \
    16271656        3,0 $inner.volume  -cspan 2 -anchor w \
    1628         4,0 $inner.legend  -cspan 2 -anchor w
     1657        4,0 $inner.legend  -cspan 2 -anchor w \
     1658        5,0 $inner.background_l       -anchor e -pady 2 \
     1659        5,1 $inner.background                   -fill x \
    16291660
    16301661    if 0 {
     
    16321663    }
    16331664    blt::table configure $inner r* -resize none
    1634     blt::table configure $inner r5 -resize expand
     1665    blt::table configure $inner r6 -resize expand
    16351666}
    16361667
  • branches/1.3/gui/scripts/vtkvolumeviewer.tcl

    r4474 r4550  
    8484    private method BuildCutplaneTab {}
    8585    private method BuildDownloadPopup { widget command }
     86    private method BuildViewTab {}
    8687    private method BuildVolumeTab {}
    8788    private method DrawLegend {}
     
    212213        axesVisible             1
    213214        axisLabels              1
     215        background              black
    214216        cutplaneEdges           0
    215217        cutplane-xvisible       1
     
    328330
    329331    if { [catch {
     332        BuildViewTab
    330333        BuildVolumeTab
    331334        BuildCutplaneTab
     
    918921        }
    919922        DoRotate
    920         InitSettings axis-xgrid axis-ygrid axis-zgrid axisFlyMode \
     923        InitSettings background axis-xgrid axis-ygrid axis-zgrid axisFlyMode \
    921924            axesVisible axisLabels
    922925        PanCamera
     
    12591262    }
    12601263    switch -- $what {
     1264        "background" {
     1265            set bgcolor [$itk_component(background) value]
     1266            array set fgcolors {
     1267                "black" "white"
     1268                "white" "black"
     1269                "grey"  "black"
     1270            }
     1271            configure -plotbackground $bgcolor \
     1272                -plotforeground $fgcolors($bgcolor)
     1273            $itk_component(view) delete "legend"
     1274            DrawLegend
     1275        }
    12611276        "volumeVisible" {
    12621277            set bool $_settings($what)
     
    15131528itcl::configbody Rappture::VtkVolumeViewer::plotbackground {
    15141529    if { [isconnected] } {
    1515         foreach {r g b} [Color2RGB $itk_option(-plotbackground)] break
    1516         SendCmd "screen bgcolor $r $g $b"
     1530        set color $itk_option(-plotbackground)
     1531        set rgb [Color2RGB $color]
     1532        SendCmd "screen bgcolor $rgb"
     1533        $itk_component(legend) configure -background $color
    15171534    }
    15181535}
     
    15231540itcl::configbody Rappture::VtkVolumeViewer::plotforeground {
    15241541    if { [isconnected] } {
    1525         foreach {r g b} [Color2RGB $itk_option(-plotforeground)] break
    1526         #fix this!
    1527         #SendCmd "color background $r $g $b"
    1528     }
     1542        set color $itk_option(-plotforeground)
     1543        set rgb [Color2RGB $color]
     1544        SendCmd "axis color all $rgb"
     1545        SendCmd "outline color $rgb"
     1546        SendCmd "cutplane color $rgb"
     1547        $itk_component(legend) itemconfigure labels -fill $color
     1548        $itk_component(legend) itemconfigure limits -fill $color
     1549    }
     1550}
     1551
     1552itcl::body Rappture::VtkVolumeViewer::BuildViewTab {} {
     1553    foreach { key value } {
     1554        grid            0
     1555        axes            1
     1556        outline         0
     1557        volume          1
     1558        legend          1
     1559        particles       1
     1560        lic             1
     1561    } {
     1562        set _settings($this-$key) $value
     1563    }
     1564
     1565    set fg [option get $itk_component(hull) font Font]
     1566    #set bfg [option get $itk_component(hull) boldFont Font]
     1567
     1568    set inner [$itk_component(main) insert end \
     1569        -title "View Settings" \
     1570        -icon [Rappture::icon wrench]]
     1571    $inner configure -borderwidth 4
     1572
     1573    checkbutton $inner.axes \
     1574        -text "Axes" \
     1575        -variable [itcl::scope _settings(axesVisible)] \
     1576        -command [itcl::code $this AdjustSetting axesVisible] \
     1577        -font "Arial 9"
     1578
     1579    checkbutton $inner.outline \
     1580        -text "Outline" \
     1581        -variable [itcl::scope _settings(outline)] \
     1582        -command [itcl::code $this AdjustSetting outline] \
     1583        -font "Arial 9"
     1584
     1585    checkbutton $inner.legend \
     1586        -text "Legend" \
     1587        -variable [itcl::scope _settings(legendVisible)] \
     1588        -command [itcl::code $this AdjustSetting legendVisible] \
     1589        -font "Arial 9"
     1590
     1591    checkbutton $inner.volume \
     1592        -text "Volume" \
     1593        -variable [itcl::scope _settings(volumeVisible)] \
     1594        -command [itcl::code $this AdjustSetting volumeVisible] \
     1595        -font "Arial 9"
     1596
     1597    label $inner.background_l -text "Background" -font "Arial 9"
     1598    itk_component add background {
     1599        Rappture::Combobox $inner.background -width 10 -editable no
     1600    }
     1601    $inner.background choices insert end \
     1602        "black"              "black"            \
     1603        "white"              "white"            \
     1604        "grey"               "grey"             
     1605
     1606    $itk_component(background) value $_settings(background)
     1607    bind $inner.background <<Value>> [itcl::code $this AdjustSetting background]
     1608
     1609    blt::table $inner \
     1610        0,0 $inner.axes  -cspan 2 -anchor w \
     1611        1,0 $inner.outline  -cspan 2 -anchor w \
     1612        2,0 $inner.volume  -cspan 2 -anchor w \
     1613        3,0 $inner.legend  -cspan 2 -anchor w \
     1614        4,0 $inner.background_l       -anchor e -pady 2 \
     1615        4,1 $inner.background                   -fill x \
     1616
     1617    blt::table configure $inner r* -resize none
     1618    blt::table configure $inner r5 -resize expand
    15291619}
    15301620
Note: See TracChangeset for help on using the changeset viewer.