Changeset 3969 for trunk/gui


Ignore:
Timestamp:
Oct 1, 2013 5:36:54 PM (11 years ago)
Author:
gah
Message:

add orthogonal views to camera tab.

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r3967 r3969  
    18061806    set _comp2limits($cname) $limits
    18071807
    1808     set tmpfile $cname[pid].vtk
     1808    set tmpfile $this-$cname.vtk
    18091809    set writer $this-datasetwriter
    18101810    vtkDataSetWriter $writer
  • trunk/gui/scripts/vtkvolumeviewer.tcl

    r3967 r3969  
    6464    public method updateTransferFunctions {}
    6565
     66    private method SetOrientation { side }
    6667    private method HideAllMarkers {}
    6768    private method GetColormap { cname color }
     
    15551556    set h [winfo height $c]
    15561557    set h [expr {$h-$lineht-20}]
    1557     puts stderr "legend w=$w h=$h"
     1558    set w [expr {$w-20}]
    15581559    # Set the legend on the first volume dataset.
    15591560    foreach dataset [CurrentDatasets -visible $_first] {
     
    17771778        [itcl::code $this AdjustSetting volumeColormap]
    17781779
    1779     label $inner.blendmode_l -text "Blend Mode" -font "Arial 9"
     1780    label $inner.blendmode_l -text "Blend Mode" -font $font
    17801781    itk_component add blendmode {
    17811782        Rappture::Combobox $inner.blendmode -editable no
     
    17951796        1,0 $inner.field_l   -anchor e -cspan 2  \
    17961797        1,2 $inner.field               -cspan 3 -fill x \
    1797         2,1 $inner.lighting_l -anchor w -cspan 4 \
     1798        2,0 $inner.lighting_l -anchor w -cspan 4 \
    17981799        3,1 $inner.lighting   -anchor w -cspan 3 \
    17991800        4,1 $inner.ambient_l       -anchor e -pady 2 \
     
    18081809        9,1 $inner.quality_l -anchor e -pady 2 \
    18091810        9,2 $inner.quality                     -cspan 3 -fill x \
    1810         10,1 $inner.transferfunction_l -anchor w              -cspan 4 \
     1811        10,0 $inner.transferfunction_l -anchor w              -cspan 4 \
    18111812        11,1 $inner.opacity_l -anchor e -pady 2 \
    18121813        11,2 $inner.opacity                    -cspan 3 -fill x \
     
    18961897    $inner configure -borderwidth 4
    18971898
     1899    label $inner.view_l -text "view" -font "Arial 9"
     1900    set f [frame $inner.view]
     1901    foreach side { front back left right top bottom } {
     1902        button $f.$side  -image [Rappture::icon view$side] \
     1903            -command [itcl::code $this SetOrientation $side]
     1904        Rappture::Tooltip::for $f.$side "Change the view to $side"
     1905        pack $f.$side -side left
     1906    }
     1907    blt::table $inner \
     1908        0,0 $inner.view_l -anchor e -pady 2 \
     1909        0,1 $inner.view -anchor w -pady 2
     1910
     1911    set row 1
     1912
    18981913    set labels { qx qy qz qw xpan ypan zoom }
    1899     set row 0
    19001914    foreach tag $labels {
    19011915        label $inner.${tag}label -text $tag -font "Arial 9"
     
    19201934    incr row
    19211935
    1922     blt::table configure $inner c0 c1 -resize none
     1936    blt::table configure $inner r* c0 c1 -resize none
    19231937    blt::table configure $inner c2 -resize expand
    19241938    blt::table configure $inner r$row -resize expand
     
    22212235        }
    22222236        $_image(legend) configure -data $bytes
    2223         puts stderr "read $size bytes for [image width $_image(legend)]x[image height $_image(legend)] legend>"
     2237        #puts stderr "read $size bytes for [image width $_image(legend)]x[image height $_image(legend)] legend>"
    22242238        if { [catch {DrawLegend} errs] != 0 } {
    22252239            puts stderr errs=$errs
     
    26342648    set _cname2transferFunction($cname) [list $cmap $wmap]
    26352649    SendCmd [list colormap add $cname $cmap $wmap]
    2636     DrawLegend
     2650    EventuallyRequestLegend
    26372651}
    26382652
     
    26482662        ComputeTransferFunction $cname
    26492663    }
    2650     DrawLegend
     2664    EventuallyRequestLegend
     2665}
     2666
     2667itcl::body Rappture::VtkVolumeViewer::SetOrientation { side } {
     2668    array set positions {
     2669        front "1 0 0 0"
     2670        back  "0 0 1 0"
     2671        left  "0.707107 0 -0.707107 0"
     2672        right "0.707107 0 0.707107 0"
     2673        top   "0.707107 -0.707107 0 0"
     2674        bottom "0.707107 0.707107 0 0"
     2675    }
     2676    foreach name { qw qx qy qz } value $positions($side) {
     2677        set _view($name) $value
     2678    }
     2679    set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
     2680    $_arcball quaternion $q
     2681    SendCmd "camera orient $q"
     2682    SendCmd "camera reset"
     2683    set _view(xpan) 0
     2684    set _view(ypan) 0
     2685    set _view(zoom) 1.0
     2686    set _settings($this-xpan) $_view(xpan)
     2687    set _settings($this-ypan) $_view(ypan)
     2688    set _settings($this-zoom) $_view(zoom)
    26512689}
    26522690
Note: See TracChangeset for help on using the changeset viewer.