Ignore:
Timestamp:
Dec 27, 2011 12:41:24 PM (12 years ago)
Author:
gah
Message:

sync with trunk

File:
1 edited

Legend:

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

    r2048 r2742  
    156156    private variable _first ""     ;# This is the topmost volume.
    157157    private variable _buffering 0
    158    
     158
    159159    # This
    160160    # indicates which isomarkers and transfer
     
    181181# ----------------------------------------------------------------------
    182182itcl::body Rappture::NanovisViewer::constructor {hostlist args} {
     183    set _serverType "nanovis"
    183184
    184185    # Draw legend event
     
    237238
    238239    itk_component add 3dview {
    239         label $itk_component(plotarea).vol -image $_image(plot) \
     240        label $itk_component(plotarea).view -image $_image(plot) \
    240241            -highlightthickness 0 -borderwidth 0
    241242    } {
     
    749750        if { ![info exists _vol2style($vol)] } {
    750751            puts stderr "unknown volume $vol"
    751             continue;                   # How does this happen?
     752            continue;                        # How does this happen?
    752753        }
    753754        set tf $_vol2style($vol)
     
    843844        }
    844845    }
     846
     847    # The colormap may have changed. Resync the slicers with the colormap.
     848    set vols [CurrentVolumes -cutplanes]
     849    SendCmd "volume data state $_settings($this-volume) $vols"
     850
     851    # Adjust the cutplane for only the first component in the topmost volume
     852    # (i.e. the first volume designated in the field).
     853    set vol [lindex $vols 0]
     854    foreach axis {x y z} {
     855        # Turn off cutplanes for all volumes
     856        SendCmd "cutplane state 0 $axis"
     857        if { $_settings($this-${axis}cutplane) } {
     858            # Turn on cutplane for this particular volume and set the position
     859            SendCmd "cutplane state 1 $axis $vol"
     860            set pos [expr {0.01*$_settings($this-${axis}cutposition)}]
     861            SendCmd "cutplane position $pos $axis $vol"
     862        }
     863    }
    845864}
    846865
     
    9851004        updatetransferfuncs
    9861005    }
    987 
    988     # Sync the state of slicers
    989     set vols [CurrentVolumes -cutplanes]
    9901006    foreach axis {x y z} {
    991         SendCmd "cutplane state $_settings($this-${axis}cutplane) $axis $vols"
    992         set pos [expr {0.01*$_settings($this-${axis}cutposition)}]
    993         SendCmd "cutplane position $pos $axis $vols"
    994     }
    995     SendCmd "volume data state $_settings($this-volume) $vols"
    996     set _buffering 0;                   # Turn off buffering.
     1007        # Turn off cutplanes for all volumes
     1008        SendCmd "cutplane state 0 $axis"
     1009    }
     1010    set _buffering 0;                        # Turn off buffering.
    9971011    # Actually write the commands to the server socket.  If it fails, we don't
    9981012    # care.  We're finished here.
    9991013    blt::busy hold $itk_component(hull)
    1000     SendBytes $_outbuf;                 
     1014    SendBytes $_outbuf;                       
    10011015    blt::busy release $itk_component(hull)
    1002     set _outbuf "";                     # Clear the buffer.             
     1016    set _outbuf "";                        # Clear the buffer.               
    10031017}
    10041018
     
    10221036            }
    10231037            array set style [lindex [$_first components -style $comp] 0]
    1024             if {$what != "-cutplanes" || $style(-cutplanes)} {
     1038            if { $what != "-cutplanes" || $style(-cutplanes) } {
    10251039                lappend rlist $vol
    10261040            }
     
    13001314            if { [isconnected] } {
    13011315                set vols [CurrentVolumes -cutplanes]
    1302                 SendCmd "cutplane state $bool $axis $vols"
     1316                set vol [lindex $vols 0]
     1317                SendCmd "cutplane state $bool $axis $vol"
    13031318            }
    13041319            if { $bool } {
     
    19922007            set newpos [expr {0.01*$newval}]
    19932008            set vols [CurrentVolumes -cutplanes]
    1994             SendCmd "cutplane position $newpos $axis $vols"
     2009            set vol [lindex $vols 0]
     2010            SendCmd "cutplane position $newpos $axis $vol"
    19952011        }
    19962012        default {
Note: See TracChangeset for help on using the changeset viewer.