Changeset 1993 for branches/blt4


Ignore:
Timestamp:
Dec 9, 2010, 8:38:32 PM (14 years ago)
Author:
gah
Message:

Fixes for molvisviewer: opacity and setting representation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/gui/scripts/molvisviewer.tcl

    r1962 r1993  
    129129    }
    130130    public method snap { w h }
    131     private method Opacity {option {models "all"} }
     131    private method Opacity {option}
    132132    private method SphereScale {option {models "all"} }
    133133    private method StickRadius {option {models "all"} }
     
    526526        10,0 $inner.cell -anchor w -columnspan 4 -pady {1 0} \
    527527        11,1 $inner.spherescale -fill x -columnspan 4 -pady {1 0} \
    528         11,1 $inner.stickradius -fill x -columnspan 4 -pady {1 0} \
     528        12,1 $inner.stickradius -fill x -columnspan 4 -pady {1 0} \
    529529
    530530    blt::table configure $inner c0 -resize expand -width 2
     
    758758        }
    759759        if { ![info exists _dataobjs($model-$state)] } {
    760             set data1      ""
     760            set data1 ""
    761761            set serial    1
    762762
     
    789789                # We know we're buffered here, so append the "loadpdb" command
    790790                # with the data payload immediately afterwards.
    791                 append _outbuf "loadpdb -defer follows $model $state $nBytes\n"
     791                SendCmd "loadpdb -defer follows $model $state $nBytes"
    792792                append _outbuf $data1
    793793                set _dataobjs($model-$state)  1
     
    802802                # We know we're buffered here, so append the "loadpdb" command
    803803                # with the data payload immediately afterwards.
    804                 append _outbuf "loadpdb -defer follows $model $state $nBytes\n"
     804                SendCmd "loadpdb -defer follows $model $state $nBytes"
    805805                append _outbuf $data2
    806806                set _dataobjs($model-$state)  1
     
    851851                    # We know we're buffered here, so append the "loadpdb"
    852852                    # command with the data payload immediately afterwards.
    853                     append _outbuf \
    854                         "loadpdb -defer follows $model $state $nBytes\n"
     853                    SendCmd "loadpdb -defer follows $model $state $nBytes"
    855854                    append _outbuf $data3
    856855                }
     
    959958        debug "rebuild: rotate $_view(mx) $_view(my) $_view(mz)"
    960959
     960        SendCmd "raw -defer {zoom complete=1}"
     961        set _restore 0
     962    }
     963    if { $changed } {
    961964        # Default settings for all models.
    962965        SphereScale update
     
    968971        OrthoProjection update
    969972        Representation update
    970         SendCmd "raw -defer {zoom complete=1}"
    971         set _restore 0
    972973    }
    973974    set tab [$itk_component(main) panel "Settings"]
     
    18371838# ----------------------------------------------------------------------
    18381839
    1839 itcl::body Rappture::MolvisViewer::Opacity { option {models "all"} } {
     1840itcl::body Rappture::MolvisViewer::Opacity { option } {
    18401841    if { $option == "update" } {
    18411842        set opacity $_settings($this-opacity)
     
    18501851    set _settings($this-opacity) $opacity
    18511852    set transparency [expr 1.0 - $opacity]
    1852     if { $models == "all" } {
     1853    set models [array names _active]
     1854    if { [llength $models] == 0 } {
    18531855        SendCmd "transparency -model all $transparency"
    18541856        return
     
    18571859    SendCmd "transparency -model all $overridetransparency"
    18581860    foreach model $models {
    1859         if { [info exists _active($model)] } {
    1860             SendCmd "transparency -model $model $transparency"
    1861         }
     1861        SendCmd "transparency -model $model $transparency"
    18621862    }
    18631863}
Note: See TracChangeset for help on using the changeset viewer.