Changeset 3031 for branches/blt4


Ignore:
Timestamp:
Jun 12, 2012 3:28:52 PM (12 years ago)
Author:
gah
Message:

intermediate updates for vtkcontourviewer

Location:
branches/blt4
Files:
9 added
1 edited

Legend:

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

    r3029 r3031  
    155155    keep -background -foreground -cursor -font
    156156}
     157itk::usual BltTkPushbutton {
     158    #empty
     159}
    157160
    158161# ----------------------------------------------------------------------
     
    225228        contour-palette   BCGYR
    226229        colormap          1
     230        surface           0
    227231    }]
    228232
     
    301305    pack $itk_component(zoomout) -side top -padx 2 -pady 2
    302306    Rappture::Tooltip::for $itk_component(zoomout) "Zoom out"
     307
     308    itk_component add surface {
     309        blt::tk::pushbutton $f.surface \
     310            -onimage [Rappture::icon surface] \
     311            -offimage [Rappture::icon surface] \
     312            -command [itcl::code $this AdjustSetting surface] \
     313            -variable [itcl::scope _settings(surface)]
     314    }
     315    Rappture::Tooltip::for $itk_component(surface) \
     316        "Toggle the surface/contour on/off"
     317    pack $itk_component(surface) -padx 2 -pady 2
     318
    303319
    304320    if { [catch BuildViewTab errs] != 0 } {
     
    13101326            }
    13111327        }
     1328        "surface" {
     1329            if {[isconnected]} {
     1330                set bool $_settings(surface)
     1331                foreach dataset [CurrentDatasets -all] {
     1332                    set c itk_component(view)
     1333                    if { $bool } {
     1334    # Bindings for rotation via mouse
     1335    bind $itk_component(view) <ButtonPress-1> \
     1336        [itcl::code $this Rotate click %x %y]
     1337    bind $itk_component(view) <B1-Motion> \
     1338        [itcl::code $this Rotate drag %x %y]
     1339    bind $itk_component(view) <ButtonRelease-1> \
     1340        [itcl::code $this Rotate release %x %y]
     1341                        SendCmd "heightmap heightscale 100.0 $dataset"
     1342                        set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
     1343                        $_arcball quaternion $q
     1344                        SendCmd "camera mode persp"
     1345                        SendCmd "camera orient $q"
     1346                    } else {
     1347                        bind $c <ButtonPress-1> [itcl::code $this BeginSelectionRectangle %x %y]
     1348                        bind $c <B1-Motion> [itcl::code $this AdjustSelectionRectangle %x %y]
     1349                        bind $c <ButtonRelease-1> [itcl::code $this EndSelectionRectangle %x %y]
     1350                        SendCmd "heightmap heightscale 0 $dataset"
     1351                        SendCmd "camera mode image"
     1352                    }
     1353                }
     1354            }
     1355        }
    13121356        "lighting" {
    13131357            if {[isconnected]} {
     
    14591503        -variable [itcl::scope _settings(edges)] \
    14601504        -command [itcl::code $this AdjustSetting edges] \
     1505        -font "Arial 9"
     1506
     1507    checkbutton $inner.surface \
     1508        -text "Surface" \
     1509        -variable [itcl::scope _settings(surface)] \
     1510        -command [itcl::code $this AdjustSetting surface] \
    14611511        -font "Arial 9"
    14621512
     
    15221572        5,0 $inner.legend  -columnspan 4 -anchor w \
    15231573        6,0 $inner.edges -columnspan 4 -anchor w -pady 2 \
    1524         7,0 $inner.clear -anchor e -pady 2 \
    1525         7,1 $inner.opacity -columnspan 2 -pady 2 -fill x\
    1526         7,3 $inner.opaque -anchor w -pady 2  \
    1527         8,0 $inner.field_l -anchor e -pady 2  \
    1528         8,1 $inner.field -cspan 3 -anchor w -pady 2 -fill x  \
    1529         9,0 $inner.palette_l -anchor e -pady 2  \
    1530         9,1 $inner.palette -cspan 3 -fill x -pady 2 
     1574        7,0 $inner.surface -columnspan 4 -anchor w -pady 2 \
     1575        8,0 $inner.clear -anchor e -pady 2 \
     1576        8,1 $inner.opacity -columnspan 2 -pady 2 -fill x\
     1577        8,3 $inner.opaque -anchor w -pady 2  \
     1578        9,0 $inner.field_l -anchor e -pady 2  \
     1579        9,1 $inner.field -cspan 3 -anchor w -pady 2 -fill x  \
     1580        10,0 $inner.palette_l -anchor e -pady 2  \
     1581        10,1 $inner.palette -cspan 3 -fill x -pady 2 
    15311582
    15321583    blt::table configure $inner r* -resize none
    1533     blt::table configure $inner r10 -resize expand
     1584    blt::table configure $inner r11 -resize expand
    15341585}
    15351586
     
    21722223        -color \#808080
    21732224        -edgecolor black
     2225        -surface 0
    21742226        -edges 0
    21752227        -lighting 1
Note: See TracChangeset for help on using the changeset viewer.