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/flowvisviewer.tcl

    r3898 r3899  
    253253        $this-streams           0
    254254        $this-volume            1
    255         $this-xcutplane         0
     255        $this-cutplaneVisible   0
     256        $this-xcutplane         1
    256257        $this-xcutposition      0
    257         $this-ycutplane         0
     258        $this-ycutplane         1
    258259        $this-ycutposition      0
    259         $this-zcutplane         0
     260        $this-zcutplane         1
    260261        $this-zcutposition      0
    261262    }]
     
    318319        "Toggle the volume cloud on/off"
    319320    pack $itk_component(volume) -padx 2 -pady 2
     321
     322    itk_component add cutplane {
     323        Rappture::PushButton $f.cutplane \
     324            -onimage [Rappture::icon cutbutton] \
     325            -offimage [Rappture::icon cutbutton] \
     326            -variable [itcl::scope _settings($this-cutplaneVisible)] \
     327            -command [itcl::code $this AdjustSetting cutplaneVisible]
     328    }
     329    Rappture::Tooltip::for $itk_component(cutplane) \
     330        "Show/Hide cutplanes"
     331    pack $itk_component(cutplane) -padx 2 -pady 2
    320332
    321333    if { [catch {
     
    12381250    set _first [lindex [get] 0]
    12391251
     1252    foreach axis {x y z} {
     1253        # Turn off cutplanes for all volumes
     1254        SendCmd "cutplane state 0 $axis"
     1255    }
     1256
    12401257    # Reset the camera and other view parameters
    1241     InitSettings light2side light transp isosurface grid axes volume outline
     1258    InitSettings light2side light transp isosurface grid axes volume outline \
     1259        cutplaneVisible xcutplane ycutplane zcutplane
    12421260   
    12431261    # nothing to send -- activate the proper volume
     
    12951313    set vols [CurrentVolumeIds -cutplanes]
    12961314    foreach axis {x y z} {
    1297         SendCmd "cutplane state $_settings($this-${axis}cutplane) $axis $vols"
    12981315        set pos [expr {0.01*$_settings($this-${axis}cutposition)}]
    12991316        SendCmd "cutplane position $pos $axis $vols"
     
    17071724            }
    17081725        }
     1726        "cutplaneVisible" {
     1727            set bool $_settings($this-$what)
     1728            set datasets [CurrentVolumeIds -cutplanes]
     1729            set tag [lindex $datasets 0]
     1730            SendCmd "cutplane visible $bool $tag"
     1731        }
    17091732        "xcutplane" - "ycutplane" - "zcutplane" {
    17101733            set axis [string range $what 0 0]
     
    23042327    Rappture::Tooltip::for $itk_component(xCutButton) \
    23052328        "Toggle the X cut plane on/off"
     2329    $itk_component(xCutButton) select
    23062330
    23072331    itk_component add xCutScale {
     
    23312355    Rappture::Tooltip::for $itk_component(yCutButton) \
    23322356        "Toggle the Y cut plane on/off"
     2357    $itk_component(yCutButton) select
    23332358
    23342359    itk_component add yCutScale {
     
    23582383    Rappture::Tooltip::for $itk_component(zCutButton) \
    23592384        "Toggle the Z cut plane on/off"
     2385    $itk_component(zCutButton) select
    23602386
    23612387    itk_component add zCutScale {
Note: See TracChangeset for help on using the changeset viewer.