Changeset 2497


Ignore:
Timestamp:
Sep 8, 2011 8:59:43 PM (13 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

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

    r2494 r2497  
    185185    # Initialize the view to some default parameters.
    186186    array set _view {
     187        qw              1
    187188        qx              0
    188189        qy              0
    189190        qz              0
    190         qw              1
    191191        zoom            1.0
    192192        pan-x           0
     
    206206        grid-z          0
    207207        visible         1
     208        labels          1
    208209    }]
    209210    array set _volume [subst {
     
    417418    set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
    418419    SendCmd "camera orient $q"
    419 
    420     #SendCmd "ppmflush"
    421 
     420    puts stderr "q=$q"
    422421    set _rotatePending 0
    423422}
     
    878877        SendCmd "camera mode persp"
    879878    }
    880     SendCmd "camera orient $q"
     879    DoRotate
    881880    PanCamera
     881    set _first [lindex [get -objects] 0]
    882882    if { $_reset || $_first == "" } {
    883883        Zoom reset
    884884        set _reset 0
    885885    }
    886     FixSettings axis-grid-x axis-grid-y axis-grid-z axis-mode axis-visible \
     886    FixSettings axis-grid-x axis-grid-y axis-grid-z axis-mode \
     887        axis-visible axis-labels \
    887888        streamlines-seeds streamlines-visible streamlines-opacity \
    888889        volume-edges volume-lighting volume-opacity volume-visible \
     
    920921        }
    921922    }
    922 
    923923    if { !$_haveStreams } {
    924924        $itk_component(main) disable "Streams Settings"
     
    930930        }
    931931    }
    932 
     932    foreach axis { x y z } {
     933        set label [$_first hints ${axis}label]
     934        if { $label != "" } {
     935            SendCmd "axis name $axis $label"
     936        }
     937        set units [$_first hints ${axis}units]
     938        if { $units != "" } {
     939            SendCmd "axis units $axis $units"
     940        }
     941    }
     942       
    933943    set _buffering 0;                        # Turn off buffering.
    934944
     
    10061016        "reset" {
    10071017            array set _view {
    1008                 qx      0
    1009                 qy      0
    1010                 qz      0
    1011                 qw      1
     1018                qw      1
     1019                qx      0
     1020                qy      0
     1021                qz      0
    10121022                zoom    1.0
    10131023                pan-x   0
     
    10231033            set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
    10241034            $_arcball quaternion $q
     1035            DoRotate
    10251036        }
    10261037    }
     
    12061217            set bool $_axis(visible)
    12071218            SendCmd "axis visible all $bool"
     1219        }
     1220        "axis-labels" {
     1221            set bool $_axis(labels)
     1222            #SendCmd "axis labels all $bool"
    12081223        }
    12091224        "axis-grid-x" {
     
    15811596        -font "Arial 9"
    15821597
     1598    checkbutton $inner.labels \
     1599        -text "Show Axis Labels" \
     1600        -variable [itcl::scope _axis(labels)] \
     1601        -command [itcl::code $this AdjustSetting axis-labels] \
     1602        -font "Arial 9"
     1603
    15831604    checkbutton $inner.gridx \
    15841605        -text "Show X Grid" \
     
    16071628        "furthest_triad"  "furthest" \
    16081629        "outer_edges"     "outer"         
    1609     $itk_component(axismode) value "outer"
     1630    $itk_component(axismode) value "static"
    16101631    bind $inner.mode <<Value>> [itcl::code $this AdjustSetting axis-mode]
    16111632
    16121633    blt::table $inner \
    16131634        0,0 $inner.visible -anchor w -pady 2 -cspan 2 \
    1614         1,0 $inner.gridx   -anchor w -pady 2 -cspan 2 \
    1615         2,0 $inner.gridy   -anchor w -pady 2 -cspan 2 \
    1616         3,0 $inner.gridz   -anchor w -pady 2 -cspan 2 \
    1617         4,0 $inner.mode_l  -anchor w -pady 2 \
    1618         4,1 $inner.mode    -fill x   -pady 2
     1635        1,0 $inner.labels  -anchor w -pady 2 -cspan 2 \
     1636        2,0 $inner.gridx   -anchor w -pady 2 -cspan 2 \
     1637        3,0 $inner.gridy   -anchor w -pady 2 -cspan 2 \
     1638        4,0 $inner.gridz   -anchor w -pady 2 -cspan 2 \
     1639        5,0 $inner.mode_l  -anchor w -pady 2 \
     1640        5,1 $inner.mode    -fill x   -pady 2
    16191641
    16201642    blt::table configure $inner r* c* -resize none
    1621     blt::table configure $inner r5 c2 -resize expand
     1643    blt::table configure $inner r6 c1 -resize expand
    16221644}
    16231645
     
    18201842        array set settings $style
    18211843        SendCmd "glyphs add sphere $tag"
     1844        SendCmd "glyphs shape sphere $tag"
    18221845        SendCmd "glyphs gscale $settings(-gscale) $tag"
    1823         #SendCmd "glyphs wireframe $settings(-wireframe) $tag"
     1846        SendCmd "glyphs wireframe $settings(-wireframe) $tag"
    18241847        #SendCmd "glyphs ccolor [Color2RGB $settings(-color)] $tag"
    18251848        #SendCmd "glyphs colormode ccolor $tag"
    18261849        SendCmd "glyphs smode vcomp $tag"
    1827         #SendCmd "glyphs opacity $settings(-opacity) $tag"
     1850        SendCmd "glyphs opacity $settings(-opacity) $tag"
    18281851        SendCmd "glyphs visible $settings(-visible) $tag"
    18291852        set _haveSpheres 1
     
    18401863        }
    18411864        array set settings $style
    1842         parray settings
    18431865        SendCmd "polydata add $tag"
    18441866        SendCmd "polydata visible $settings(-visible) $tag"
Note: See TracChangeset for help on using the changeset viewer.