Ignore:
Timestamp:
Aug 27, 2013 12:38:22 PM (8 years ago)
Author:
ldelgass
Message:

Add cutplane visibility button to nanovis viewers.

File:
1 edited

Legend:

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

    r3898 r3899  
    220220        $this-ypan              $_view(ypan)
    221221        $this-volume            1
    222         $this-xcutplane         0
     222        $this-cutplaneVisible   0
     223        $this-xcutplane         1
    223224        $this-xcutposition      0
    224         $this-ycutplane         0
     225        $this-ycutplane         1
    225226        $this-ycutposition      0
    226         $this-zcutplane         0
     227        $this-zcutplane         1
    227228        $this-zcutposition      0
    228229    }]
     
    285286        "Toggle the volume cloud on/off"
    286287    pack $itk_component(volume) -padx 2 -pady 2
     288
     289    itk_component add cutplane {
     290        Rappture::PushButton $f.cutplane \
     291            -onimage [Rappture::icon cutbutton] \
     292            -offimage [Rappture::icon cutbutton] \
     293            -variable [itcl::scope _settings($this-cutplaneVisible)] \
     294            -command [itcl::code $this AdjustSetting cutplaneVisible]
     295    }
     296    Rappture::Tooltip::for $itk_component(cutplane) \
     297        "Show/Hide cutplanes"
     298    pack $itk_component(cutplane) -padx 2 -pady 2
    287299
    288300    if { [catch {
     
    944956        PanCamera
    945957        SendCmd "camera zoom $_view(zoom)"
    946         InitSettings light2side light transp isosurface grid axes
    947        
     958
    948959        foreach axis {x y z} {
    949960            # Turn off cutplanes for all volumes
    950961            SendCmd "cutplane state 0 $axis"
    951962        }
     963
     964        InitSettings light2side light transp isosurface grid axes \
     965            cutplaneVisible xcutplane ycutplane zcutplane
     966
    952967        if {"" != $_first} {
    953968            set axis [$_first hints updir]
     
    12681283            set datasets [CurrentDatasets -cutplanes]
    12691284            SendCmd "volume data state $_settings($this-volume) $datasets"
     1285        }
     1286        "cutplaneVisible" {
     1287            set bool $_settings($this-$what)
     1288            set datasets [CurrentDatasets -cutplanes]
     1289            set tag [lindex $datasets 0]
     1290            SendCmd "cutplane visible $bool $tag"
    12701291        }
    12711292        "xcutplane" - "ycutplane" - "zcutplane" {
     
    18261847    Rappture::Tooltip::for $itk_component(xCutButton) \
    18271848        "Toggle the X cut plane on/off"
     1849    $itk_component(xCutButton) select
    18281850
    18291851    itk_component add xCutScale {
     
    18531875    Rappture::Tooltip::for $itk_component(yCutButton) \
    18541876        "Toggle the Y cut plane on/off"
     1877    $itk_component(yCutButton) select
    18551878
    18561879    itk_component add yCutScale {
     
    18801903    Rappture::Tooltip::for $itk_component(zCutButton) \
    18811904        "Toggle the Z cut plane on/off"
     1905    $itk_component(zCutButton) select
    18821906
    18831907    itk_component add zCutScale {
Note: See TracChangeset for help on using the changeset viewer.