Ignore:
Timestamp:
Mar 17, 2013, 9:46:35 AM (12 years ago)
Author:
gah
Message:

add controls for orthogonal viewpoints

File:
1 edited

Legend:

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

    r3514 r3517  
    106106    private method GetHeightmapScale {}
    107107    private method ResetAxes {}
     108    private method SetOrientation { side }
    108109
    109110    private variable _arcball ""
     
    17661767    set inner [$itk_component(main) insert end \
    17671768        -title "Contour/Surface Settings" \
    1768         -icon [Rappture::icon contour]]
     1769        -icon [Rappture::icon contour2]]
    17691770    $inner configure -borderwidth 4
    17701771
     
    19581959    set inner [$itk_component(main) insert end \
    19591960        -title "Axis Settings" \
    1960         -icon [Rappture::icon axis1]]
     1961        -icon [Rappture::icon axis2]]
    19611962    $inner configure -borderwidth 4
    19621963
     
    20302031    $inner configure -borderwidth 4
    20312032
     2033    label $inner.view_l -text "view" -font "Arial 9"
     2034    set f [frame $inner.view]
     2035    foreach side { front back left right top bottom } {
     2036        button $f.$side  -image [Rappture::icon view$side] \
     2037            -command [itcl::code $this SetOrientation $side]
     2038        Rappture::Tooltip::for $f.$side "Change the view to $side"
     2039        pack $f.$side -side left
     2040    }
     2041
     2042    blt::table $inner \
     2043            0,0 $inner.view_l -anchor e -pady 2 \
     2044            0,1 $inner.view -anchor w -pady 2
     2045
    20322046    set labels { qx qy qz qw xpan ypan zoom }
    2033     set row 0
     2047    set row 1
    20342048    foreach tag $labels {
    20352049        label $inner.${tag}label -text $tag -font "Arial 9"
     
    20562070    incr row
    20572071
    2058     blt::table configure $inner c0 c1 -resize none
     2072    blt::table configure $inner c* r* -resize none
    20592073    blt::table configure $inner c2 -resize expand
    20602074    blt::table configure $inner r$row -resize expand
     
    25132527}
    25142528
    2515 
    2516 
    2517 
     2529itcl::body Rappture::VtkHeightmapViewer::SetOrientation { side } {
     2530    array set positions {
     2531        front "1 0 0 0"
     2532        back  "0 0 1 0"
     2533        left  "0.707107 0 -0.707107 0"
     2534        right "0.707107 0 0.707107 0"
     2535        top   "0.707107 -0.707107 0 0"
     2536        bottom "0.707107 0.707107 0 0"
     2537    }
     2538    foreach name { qw qx qy qz } value $positions($side) {
     2539        set _view($name) $value
     2540    }
     2541    set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
     2542    $_arcball quaternion $q
     2543    SendCmd "camera orient $q"
     2544}
     2545
     2546
     2547
     2548
Note: See TracChangeset for help on using the changeset viewer.