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/vtkstreamlinesviewer.tcl

    r3482 r3517  
    107107    private method SetObjectStyle { dataobj comp }
    108108    private method Slice {option args}
     109    private method SetOrientation { side }
    109110
    110111    private variable _arcball ""
     
    18681869    $inner configure -borderwidth 4
    18691870
     1871    label $inner.view_l -text "view" -font "Arial 9"
     1872    set f [frame $inner.view]
     1873    foreach side { front back left right top bottom } {
     1874        button $f.$side  -image [Rappture::icon view$side] \
     1875            -command [itcl::code $this SetOrientation $side]
     1876        Rappture::Tooltip::for $f.$side "Change the view to $side"
     1877        pack $f.$side -side left
     1878    }
     1879
     1880    blt::table $inner \
     1881            0,0 $inner.view_l -anchor e -pady 2 \
     1882            0,1 $inner.view -anchor w -pady 2
     1883
    18701884    set labels { qx qy qz qw xpan ypan zoom }
    1871     set row 0
     1885    set row 1
    18721886    foreach tag $labels {
    18731887        label $inner.${tag}label -text $tag -font "Arial 9"
     
    18921906    incr row
    18931907
    1894     blt::table configure $inner c0 c1 -resize none
     1908    blt::table configure $inner c* r* -resize none
    18951909    blt::table configure $inner c2 -resize expand
    18961910    blt::table configure $inner r$row -resize expand
     
    24482462}
    24492463
     2464itcl::body Rappture::VtkStreamlinesViewer::SetOrientation { side } {
     2465    array set positions {
     2466        front "1 0 0 0"
     2467        back  "0 0 1 0"
     2468        left  "0.707107 0 -0.707107 0"
     2469        right "0.707107 0 0.707107 0"
     2470        top   "0.707107 -0.707107 0 0"
     2471        bottom "0.707107 0.707107 0 0"
     2472    }
     2473    foreach name { qw qx qy qz } value $positions($side) {
     2474        set _view($name) $value
     2475    }
     2476    set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
     2477    $_arcball quaternion $q
     2478    SendCmd "camera orient $q"
     2479}
     2480
Note: See TracChangeset for help on using the changeset viewer.