Changeset 3899 for trunk


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

Add cutplane visibility button to nanovis viewers.

Location:
trunk/gui/scripts
Files:
8 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 {
  • 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 {
  • trunk/gui/scripts/vtkglyphviewer.tcl

    r3897 r3899  
    14861486    set font "Arial 8"
    14871487    set lineht [font metrics $font -linespace]
    1488     set c $itk_component(view)
    14891488    set w 12
    14901489    set h [expr {$_height - 2 * ($lineht + 2)}]
    1491     if { $h < 1} {
     1490    if { $h < 1 } {
    14921491        return
    14931492    }
     
    22262225        "move" {
    22272226            set axis [lindex $args 0]
    2228             set a [string toupper $axis]
    2229             set oldval $_settings(cutplane${a}Position)
    22302227            set newval [lindex $args 1]
    22312228            if {[llength $args] != 2} {
  • trunk/gui/scripts/vtkheightmapviewer.tcl

    r3814 r3899  
    16601660        incr h -$lineht
    16611661    }
    1662     if { $h < 1} {
     1662    if { $h < 1 } {
    16631663        return
    16641664    }
     
    24222422    incr y $lineht
    24232423    $c coords colormap $x $y
    2424     set ix [image width $_image(legend)]
    2425     set ih [image height $_image(legend)]
    24262424    $c coords sensor [expr $x - $iw] $y $x [expr $y + $ih]
    24272425    $c raise sensor
  • trunk/gui/scripts/vtkisosurfaceviewer.tcl

    r3897 r3899  
    15071507    set font "Arial 8"
    15081508    set lineht [font metrics $font -linespace]
    1509     set c $itk_component(view)
    15101509    set w 12
    15111510    set h [expr {$_height - 2 * ($lineht + 2)}]
    1512     if { $h < 1} {
     1511    if { $h < 1 } {
    15131512        return
    15141513    }
     
    22892288        "move" {
    22902289            set axis [lindex $args 0]
    2291             set a [string toupper $axis]
    2292             set oldval $_settings(cutplane${a}Position)
    22932290            set newval [lindex $args 1]
    22942291            if {[llength $args] != 2} {
  • trunk/gui/scripts/vtkstreamlinesviewer.tcl

    r3833 r3899  
    15051505    set font "Arial 8"
    15061506    set lineht [font metrics $font -linespace]
    1507     set c $itk_component(legend)
    15081507    set w 12
    15091508    set h [expr {$_height - 3 * ($lineht + 2)}]
    1510     if { $h < 1} {
     1509    if { $h < 1 } {
    15111510        return
    15121511    }
     
    23612360        "move" {
    23622361            set axis [lindex $args 0]
    2363             set oldval $_settings(axis-${axis}position)
    23642362            set newval [lindex $args 1]
    23652363            if {[llength $args] != 2} {
  • trunk/gui/scripts/vtkviewer.tcl

    r3847 r3899  
    16131613    set font "Arial 8"
    16141614    set lineht [font metrics $font -linespace]
    1615     set c $itk_component(legend)
    16161615    set w 12
    16171616    set h [expr {$_height - 2 * ($lineht + 2)}]
    1618     if { $h < 1} {
     1617    if { $h < 1 } {
    16191618        return
    16201619    }
     
    21322131    $itk_component(zCutScale) set 100
    21332132    $itk_component(zCutScale) configure -state disabled
    2134     #$itk_component(zCutScale) configure -state disabled
    21352133    Rappture::Tooltip::for $itk_component(zCutScale) \
    21362134        "@[itcl::code $this Slice tooltip z]"
     
    26602658        "move" {
    26612659            set axis [lindex $args 0]
    2662             set oldval $_axis(${axis}position)
    26632660            set newval [lindex $args 1]
    26642661            if {[llength $args] != 2} {
  • trunk/gui/scripts/vtkvolumeviewer.tcl

    r3896 r3899  
    14511451    set font "Arial 8"
    14521452    set lineht [font metrics $font -linespace]
    1453     set c $itk_component(legend)
    14541453    set w 12
    14551454    set h [expr {$_height - 3 * ($lineht + 2)}]
    1456     if { $h < 1} {
     1455    if { $h < 1 } {
    14571456        return
    14581457    }
Note: See TracChangeset for help on using the changeset viewer.