Changeset 4478


Ignore:
Timestamp:
Jul 9, 2014, 9:19:28 PM (10 years ago)
Author:
ldelgass
Message:

merge r4465 from trunk

Location:
branches/1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

    • Property svn:mergeinfo changed
      /trunkmerged: 4465
  • branches/1.3/gui/scripts/vtkviewer.tcl

    r4464 r4478  
    9595    private method EventuallySetAtomScale { args }
    9696    private method EventuallySetBondScale { args }
     97    private method EventuallySetGlyphsOpacity { args }
    9798    private method EventuallySetMoleculeOpacity { args }
    9899    private method EventuallySetMoleculeQuality { args }
     
    108109    private method SetBondScale {}
    109110    private method SetColormap { dataobj comp }
     111    private method SetGlyphsOpacity {}
    110112    private method SetLegendTip { x y }
    111113    private method SetMoleculeOpacity {}
     
    209211    $_dispatcher dispatch $this !polydataOpacity \
    210212        "[itcl::code $this SetPolydataOpacity]; list"
     213
     214    # Glyphs opacity event
     215    $_dispatcher register !glyphsOpacity
     216    $_dispatcher dispatch $this !glyphsOpacity \
     217        "[itcl::code $this SetGlyphsOpacity]; list"
     218
    211219    #
    212220    # Populate parser with commands handle incoming requests
     
    508516}
    509517
     518itcl::body Rappture::VtkViewer::SetGlyphsOpacity {} {
     519    set _glyphsOpacityPending 0
     520    foreach dataset [CurrentDatasets -visible $_first] {
     521        foreach { dataobj comp } [split $dataset -] break
     522        if { [$dataobj type $comp] == "glyphs" } {
     523            SetOpacity $dataset
     524        }
     525    }
     526}
     527
    510528itcl::body Rappture::VtkViewer::SetPolydataOpacity {} {
    511529    set _polydataOpacityPending 0
     
    550568        set _polydataOpacityPending 1
    551569        $_dispatcher event -after $_scaleDelay !polydataOpacity
     570    }
     571}
     572
     573itcl::body Rappture::VtkViewer::EventuallySetGlyphsOpacity { args } {
     574    if { !$_glyphsOpacityPending } {
     575        set _glyphsOpacityPending 1
     576        $_dispatcher event -after $_scaleDelay !glyphsOpacity
    552577    }
    553578}
     
    13571382        }
    13581383        "glyphs-outline" {
    1359             set bool $_settings(glyphs-outline)
     1384            set bool $_settings($what)
    13601385            foreach dataset [CurrentDatasets -visible $_first] {
    13611386                foreach { dataobj comp } [split $dataset -] break
     
    13671392        }
    13681393        "glyphs-wireframe" {
    1369             set bool $_settings(glyphs-wireframe)
     1394            set bool $_settings($what)
    13701395            foreach dataset [CurrentDatasets -visible $_first] {
    13711396                foreach { dataobj comp } [split $dataset -] break
     
    13771402        }
    13781403        "glyphs-visible" {
    1379             set bool $_settings(glyphs-visible)
     1404            set bool $_settings($what)
    13801405            foreach dataset [CurrentDatasets -visible $_first] {
    13811406                foreach { dataobj comp } [split $dataset -] break
     
    13871412        }
    13881413        "glyphs-lighting" {
    1389             set bool $_settings(glyphs-lighting)
     1414            set bool $_settings($what)
    13901415            foreach dataset [CurrentDatasets -visible $_first] {
    13911416                foreach { dataobj comp } [split $dataset -] break
     
    13971422        }
    13981423        "glyphs-edges" {
    1399             set bool $_settings(glyphs-edges)
     1424            set bool $_settings($what)
    14001425            foreach dataset [CurrentDatasets -visible $_first] {
    14011426                foreach { dataobj comp } [split $dataset -] break
     
    14081433        "glyphs-palette" {
    14091434            set palette [$itk_component(glyphspalette) value]
    1410             set _settings(glyphs-palette) $palette
     1435            set _settings($what) $palette
    14111436            foreach dataset [CurrentDatasets -visible $_first] {
    14121437                foreach {dataobj comp} [split $dataset -] break
     
    14291454        }
    14301455        "polydata-outline" {
    1431             set bool $_settings(polydata-outline)
     1456            set bool $_settings($what)
    14321457            foreach dataset [CurrentDatasets -visible $_first] {
    14331458                foreach { dataobj comp } [split $dataset -] break
     
    14391464        }
    14401465        "polydata-wireframe" {
    1441             set bool $_settings(polydata-wireframe)
     1466            set bool $_settings($what)
    14421467            foreach dataset [CurrentDatasets -visible $_first] {
    14431468                foreach { dataobj comp } [split $dataset -] break
     
    14491474        }
    14501475        "polydata-visible" {
    1451             set bool $_settings(polydata-visible)
     1476            set bool $_settings($what)
    14521477            foreach dataset [CurrentDatasets -visible $_first] {
    14531478                foreach { dataobj comp } [split $dataset -] break
     
    14591484        }
    14601485        "polydata-lighting" {
    1461             set bool $_settings(polydata-lighting)
     1486            set bool $_settings($what)
    14621487            foreach dataset [CurrentDatasets -visible $_first] {
    14631488                foreach { dataobj comp } [split $dataset -] break
     
    14691494        }
    14701495        "polydata-edges" {
    1471             set bool $_settings(polydata-edges)
     1496            set bool $_settings($what)
    14721497            foreach dataset [CurrentDatasets -visible $_first] {
    14731498                foreach { dataobj comp } [split $dataset -] break
     
    14801505        "polydata-palette" {
    14811506            set palette [$itk_component(meshpalette) value]
    1482             set _settings(polydata-palette) $palette
     1507            set _settings($what) $palette
    14831508            foreach dataset [CurrentDatasets -visible $_first] {
    14841509                foreach {dataobj comp} [split $dataset -] break
     
    15011526        }
    15021527        "molecule-outline" {
    1503             set bool $_settings(molecule-outline)
     1528            set bool $_settings($what)
    15041529            foreach dataset [CurrentDatasets -visible $_first] {
    15051530                foreach { dataobj comp } [split $dataset -] break
     
    15111536        }
    15121537        "molecule-wireframe" {
    1513             set bool $_settings(molecule-wireframe)
     1538            set bool $_settings($what)
    15141539            foreach dataset [CurrentDatasets -visible $_first] {
    15151540                foreach { dataobj comp } [split $dataset -] break
     
    15211546        }
    15221547        "molecule-visible" {
    1523             set bool $_settings(molecule-visible)
     1548            set bool $_settings($what)
    15241549            foreach dataset [CurrentDatasets -visible $_first] {
    15251550                foreach { dataobj comp } [split $dataset -] break
     
    15311556        }
    15321557        "molecule-lighting" {
    1533             set bool $_settings(molecule-lighting)
     1558            set bool $_settings($what)
    15341559            foreach dataset [CurrentDatasets -visible $_first] {
    15351560                foreach { dataobj comp } [split $dataset -] break
     
    15411566        }
    15421567        "molecule-edges" {
    1543             set bool $_settings(molecule-edges)
     1568            set bool $_settings($what)
    15441569            foreach dataset [CurrentDatasets -visible $_first] {
    15451570                foreach { dataobj comp } [split $dataset -] break
     
    15521577        "molecule-palette" {
    15531578            set palette [$itk_component(moleculepalette) value]
    1554             set _settings(molecule-palette) $palette
     1579            set _settings($what) $palette
    15551580            foreach dataset [CurrentDatasets -visible $_first] {
    15561581                foreach {dataobj comp} [split $dataset -] break
     
    16491674            set value [$itk_component(rscale) value]
    16501675            set value [$itk_component(rscale) translate $value]
    1651             set _settings(molecule-rscale) $value
     1676            set _settings($what) $value
    16521677            foreach dataset [CurrentDatasets -visible $_first] {
    16531678                foreach {dataobj comp} [split $dataset -] break
    16541679                set type [$dataobj type $comp]
    16551680                if { $type == "molecule" } {
    1656                     SendCmd [subst {molecule rscale $_settings(molecule-rscale) $dataset}]
     1681                    SendCmd [subst {molecule rscale $_settings($what) $dataset}]
    16571682                }
    16581683            }
    16591684        }
    16601685        "molecule-labels" {
    1661             set bool $_settings(molecule-labels)
     1686            set bool $_settings($what)
    16621687            foreach dataset [CurrentDatasets -visible $_first] {
    16631688               foreach { dataobj comp } [split $dataset -] break
     
    19962021        -width 10 \
    19972022        -showvalue off \
    1998         -command [itcl::code $this AdjustSetting glyphs-opacity]
     2023        -command [itcl::code $this EventuallySetGlyphsOpacity]
    19992024    $inner.opacity set $_settings(glyphs-opacity)
    20002025
     
    20682093        -width 10 \
    20692094        -showvalue off \
    2070         -command [itcl::code $this AdjustSetting polydata-opacity]
     2095        -command [itcl::code $this EventuallySetPolydataOpacity]
    20712096    $inner.opacity set $_settings(polydata-opacity)
    20722097
Note: See TracChangeset for help on using the changeset viewer.