Index: trunk/gui/scripts/flowvisviewer.tcl
===================================================================
--- trunk/gui/scripts/flowvisviewer.tcl	(revision 3482)
+++ trunk/gui/scripts/flowvisviewer.tcl	(revision 3485)
@@ -125,5 +125,4 @@
 
     private variable _arcball ""
-    private variable _useArcball 1
     private variable _dlist ""     ;# list of data objects
     private variable _allDataObjs
@@ -224,7 +223,4 @@
         qy      0.353553
         qz      0.146447
-        theta   45
-        phi     45
-        psi     0
         zoom    1.0
         pan-x   0
@@ -244,7 +240,4 @@
         $this-qy                $_view(qy)
         $this-qz                $_view(qz)
-        $this-theta             $_view(theta)
-        $this-phi               $_view(phi)
-        $this-psi               $_view(psi)
         $this-zoom              $_view(zoom)    
         $this-pan-x             $_view(pan-x)
@@ -956,12 +949,15 @@
             array set _view $location
         }
-        set _settings($this-theta) $_view(theta)
-        set _settings($this-phi)   $_view(phi)
-        set _settings($this-psi)   $_view(psi)
+        set _settings($this-qw)    $_view(qw)
+        set _settings($this-qx)    $_view(qx)
+        set _settings($this-qy)    $_view(qy)
+        set _settings($this-qz)    $_view(qz)
         set _settings($this-pan-x) $_view(pan-x)
         set _settings($this-pan-y) $_view(pan-y)
         set _settings($this-zoom)  $_view(zoom)
-        set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
-        SendCmd "camera angle $xyz"
+        set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
+        $_arcball quaternion $q
+        SendCmd "camera orient $q"
+        #SendCmd "camera reset"
         PanCamera
         SendCmd "camera zoom $_view(zoom)"
@@ -1254,19 +1250,12 @@
     set _settings($this-qy)    $_view(qy)
     set _settings($this-qz)    $_view(qz)
-    set _settings($this-theta) $_view(theta)
-    set _settings($this-phi)   $_view(phi)
-    set _settings($this-psi)   $_view(psi)
     set _settings($this-pan-x) $_view(pan-x)
     set _settings($this-pan-y) $_view(pan-y)
     set _settings($this-zoom)  $_view(zoom)
 
-    if {$_useArcball} {
-        set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
-        $_arcball quaternion $q
-        SendCmd "camera orient $q"
-    } else { 
-        set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
-        SendCmd "camera angle $xyz"
-    }
+    set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
+    $_arcball quaternion $q
+    SendCmd "camera orient $q"
+    #SendCmd "camera reset"
     PanCamera
     SendCmd "camera zoom $_view(zoom)"
@@ -1352,8 +1341,10 @@
             set _view(zoom) [expr {$_view(zoom)*1.25}]
             set _settings($this-zoom) $_view(zoom)
+            SendCmd "camera zoom $_view(zoom)"
         }
         "out" {
             set _view(zoom) [expr {$_view(zoom)*0.8}]
             set _settings($this-zoom) $_view(zoom)
+            SendCmd "camera zoom $_view(zoom)"
         }
         "reset" {
@@ -1363,7 +1354,4 @@
                 qy      0.353553
                 qz      0.146447
-                theta   45
-                phi     45
-                psi     0
                 zoom    1.0
                 pan-x   0
@@ -1376,20 +1364,13 @@
                 }
             }
-            if {$_useArcball} {
-                set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
-                $_arcball quaternion $q
-                SendCmd "camera orient $q"
-            } else {
-                set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
-                SendCmd "camera angle $xyz"
-            }
-            PanCamera
+            set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
+            $_arcball quaternion $q
+            SendCmd "camera orient $q"
+            #SendCmd "camera reset"
+            SendCmd "camera zoom $_view(zoom)"
             set _settings($this-qw)    $_view(qw)
             set _settings($this-qx)    $_view(qx)
             set _settings($this-qy)    $_view(qy)
             set _settings($this-qz)    $_view(qz)
-            set _settings($this-theta) $_view(theta)
-            set _settings($this-phi)   $_view(phi)
-            set _settings($this-psi)   $_view(psi)
             set _settings($this-pan-x) $_view(pan-x)
             set _settings($this-pan-y) $_view(pan-y)
@@ -1397,5 +1378,4 @@
         }
     }
-    SendCmd "camera zoom $_view(zoom)"
 }
 
@@ -1422,6 +1402,4 @@
             set _click(x) $x
             set _click(y) $y
-            set _click(theta) $_view(theta)
-            set _click(phi) $_view(phi)
         }
         drag {
@@ -1443,45 +1421,11 @@
                 }
 
-                if {$_useArcball} {
-                    set q [$_arcball rotate $x $y $_click(x) $_click(y)]
-                    foreach { _view(qw) _view(qx) _view(qy) _view(qz) } $q break
-                    set _settings($this-qw) $_view(qw)
-                    set _settings($this-qx) $_view(qx)
-                    set _settings($this-qy) $_view(qy)
-                    set _settings($this-qz) $_view(qz)
-                    SendCmd "camera orient $q"
-                } else {
-                    #
-                    # Rotate the camera in 3D
-                    #
-                    if {$_view(psi) > 90 || $_view(psi) < -90} {
-                        # when psi is flipped around, theta moves backwards
-                        set dy [expr {-$dy}]
-                    }
-                    set theta [expr {$_view(theta) - $dy*180}]
-                    while {$theta < 0} { set theta [expr {$theta+180}] }
-                    while {$theta > 180} { set theta [expr {$theta-180}] }
-
-                    if {abs($theta) >= 30 && abs($theta) <= 160} {
-                        set phi [expr {$_view(phi) - $dx*360}]
-                        while {$phi < 0} { set phi [expr {$phi+360}] }
-                        while {$phi > 360} { set phi [expr {$phi-360}] }
-                        set psi $_view(psi)
-                    } else {
-                        set phi $_view(phi)
-                        set psi [expr {$_view(psi) - $dx*360}]
-                        while {$psi < -180} { set psi [expr {$psi+360}] }
-                        while {$psi > 180} { set psi [expr {$psi-360}] }
-                    }
-
-                    set _view(theta)        $theta
-                    set _view(phi)          $phi
-                    set _view(psi)          $psi
-                    set xyz [Euler2XYZ $theta $phi $psi]
-                    set _settings($this-theta) $_view(theta)
-                    set _settings($this-phi)   $_view(phi)
-                    set _settings($this-psi)   $_view(psi)
-                    SendCmd "camera angle $xyz"
-                }
+                set q [$_arcball rotate $x $y $_click(x) $_click(y)]
+                foreach { _view(qw) _view(qx) _view(qy) _view(qz) } $q break
+                set _settings($this-qw) $_view(qw)
+                set _settings($this-qx) $_view(qx)
+                set _settings($this-qy) $_view(qy)
+                set _settings($this-qz) $_view(qz)
+                SendCmd "camera orient $q"
 
                 set _click(x) $x
@@ -2443,9 +2387,5 @@
     $inner configure -borderwidth 4
 
-    if {$_useArcball} {
-        set labels { qw qx qy qz pan-x pan-y zoom }
-    } else {
-        set labels { phi theta psi pan-x pan-y zoom }
-    }
+    set labels { qw qx qy qz pan-x pan-y zoom }
     set row 0
     foreach tag $labels {
@@ -2669,18 +2609,4 @@
                     set _view($who) $_settings($this-$who)
                     PanCamera
-                }
-                "phi" - "theta" - "psi" {
-                    set _view($who) $_settings($this-$who)
-                    set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
-                    SendCmd "camera angle $xyz"
-                    if {$_useArcball} {
-                        $_arcball euler [list [expr {-[lindex $xyz 2]}] [expr {-[lindex $xyz 1]}] [expr {-[lindex $xyz 0]}]]
-                        set q [$_arcball quaternion]
-                        foreach { _view(qw) _view(qx) _view(qy) _view(qz) } $q break
-                        set _settings($this-qw) $_view(qw)
-                        set _settings($this-qx) $_view(qx)
-                        set _settings($this-qy) $_view(qy)
-                        set _settings($this-qz) $_view(qz)
-                    }
                 }
                 "qx" - "qy" - "qz" - "qw" {
Index: trunk/gui/scripts/nanovisviewer.tcl
===================================================================
--- trunk/gui/scripts/nanovisviewer.tcl	(revision 3482)
+++ trunk/gui/scripts/nanovisviewer.tcl	(revision 3485)
@@ -17,5 +17,5 @@
 package require BLT
 package require Img
-                                        
+
 #
 # FIXME:
@@ -121,5 +121,4 @@
 
     private variable _arcball ""
-    private variable _useArcball 1
 
     private variable _dlist ""     ;# list of data objects
@@ -200,7 +199,4 @@
         qy      0.353553
         qz      0.146447
-        theta   45
-        phi     45
-        psi     0
         zoom    1.0
         pan-x   0
@@ -220,7 +216,4 @@
         $this-qy                $_view(qy)
         $this-qz                $_view(qz)
-        $this-theta             $_view(theta)
-        $this-phi               $_view(phi)
-        $this-psi               $_view(psi)
         $this-zoom              $_view(zoom)    
         $this-pan-x             $_view(pan-x)
@@ -913,20 +906,12 @@
         set _settings($this-qy)    $_view(qy)
         set _settings($this-qz)    $_view(qz)
-	set _settings($this-theta) $_view(theta)
-	set _settings($this-phi)   $_view(phi)
-	set _settings($this-psi)   $_view(psi)
 	set _settings($this-pan-x) $_view(pan-x)
 	set _settings($this-pan-y) $_view(pan-y)
 	set _settings($this-zoom)  $_view(zoom)
 
-        if {$_useArcball} {
-            set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
-            $_arcball quaternion $q
-            SendCmd "camera orient $q"
-        } else {
-            set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
-            SendCmd "camera angle $xyz"
-        }
-
+        set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
+        $_arcball quaternion $q
+        SendCmd "camera orient $q"
+        #SendCmd "camera reset"
 	PanCamera
 	SendCmd "camera zoom $_view(zoom)"
@@ -1012,8 +997,10 @@
             set _view(zoom) [expr {$_view(zoom)*1.25}]
             set _settings($this-zoom) $_view(zoom)
+            SendCmd "camera zoom $_view(zoom)"
         }
         "out" {
             set _view(zoom) [expr {$_view(zoom)*0.8}]
             set _settings($this-zoom) $_view(zoom)
+            SendCmd "camera zoom $_view(zoom)"
         }
         "reset" {
@@ -1023,7 +1010,4 @@
                 qy      0.353553
                 qz      0.146447
-                theta   45
-                phi     45
-                psi     0
                 zoom    1.0
                 pan-x   0
@@ -1036,21 +1020,13 @@
                 }
             }
-            if {$_useArcball} {
-                set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
-                $_arcball quaternion $q
-                SendCmd "camera orient $q"
-            } else {
-                set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
-                SendCmd "camera angle $xyz"
-            }
-
-            PanCamera
+            set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
+            $_arcball quaternion $q
+            SendCmd "camera orient $q"
+            #SendCmd "camera reset"
+            SendCmd "camera zoom $_view(zoom)"
             set _settings($this-qw)    $_view(qw)
             set _settings($this-qx)    $_view(qx)
             set _settings($this-qy)    $_view(qy)
             set _settings($this-qz)    $_view(qz)
-            set _settings($this-theta) $_view(theta)
-            set _settings($this-phi)   $_view(phi)
-            set _settings($this-psi)   $_view(psi)
             set _settings($this-pan-x) $_view(pan-x)
             set _settings($this-pan-y) $_view(pan-y)
@@ -1058,5 +1034,4 @@
         }
     }
-    SendCmd "camera zoom $_view(zoom)"
 }
 
@@ -1084,6 +1059,4 @@
             set _click(x) $x
             set _click(y) $y
-            set _click(theta) $_view(theta)
-            set _click(phi) $_view(phi)
         }
         drag {
@@ -1105,45 +1078,11 @@
                 }
 
-                if {$_useArcball} {
-                    set q [$_arcball rotate $x $y $_click(x) $_click(y)]
-                    foreach { _view(qw) _view(qx) _view(qy) _view(qz) } $q break
-                    set _settings($this-qw) $_view(qw)
-                    set _settings($this-qx) $_view(qx)
-                    set _settings($this-qy) $_view(qy)
-                    set _settings($this-qz) $_view(qz)
-                    SendCmd "camera orient $q"
-                } else {
-                    #
-                    # Rotate the camera in 3D
-                    #
-                    if {$_view(psi) > 90 || $_view(psi) < -90} {
-                        # when psi is flipped around, theta moves backwards
-                        set dy [expr {-$dy}]
-                    }
-                    set theta [expr {$_view(theta) - $dy*180}]
-                    while {$theta < 0} { set theta [expr {$theta+180}] }
-                    while {$theta > 180} { set theta [expr {$theta-180}] }
-
-                    if {abs($theta) >= 30 && abs($theta) <= 160} {
-                        set phi [expr {$_view(phi) - $dx*360}]
-                        while {$phi < 0} { set phi [expr {$phi+360}] }
-                        while {$phi > 360} { set phi [expr {$phi-360}] }
-                        set psi $_view(psi)
-                    } else {
-                        set phi $_view(phi)
-                        set psi [expr {$_view(psi) - $dx*360}]
-                        while {$psi < -180} { set psi [expr {$psi+360}] }
-                        while {$psi > 180} { set psi [expr {$psi-360}] }
-                    }
-
-                    set _view(theta)        $theta
-                    set _view(phi)          $phi
-                    set _view(psi)          $psi
-                    set xyz [Euler2XYZ $theta $phi $psi]
-                    set _settings($this-theta) $_view(theta)
-                    set _settings($this-phi)   $_view(phi)
-                    set _settings($this-psi)   $_view(psi)
-                    SendCmd "camera angle $xyz"
-                }
+                set q [$_arcball rotate $x $y $_click(x) $_click(y)]
+                foreach { _view(qw) _view(qx) _view(qy) _view(qz) } $q break
+                set _settings($this-qw) $_view(qw)
+                set _settings($this-qx) $_view(qx)
+                set _settings($this-qy) $_view(qy)
+                set _settings($this-qz) $_view(qz)
+                SendCmd "camera orient $q"
 
                 set _click(x) $x
@@ -1953,9 +1892,5 @@
     $inner configure -borderwidth 4
 
-    if {$_useArcball} {
-        set labels { qw qx qy qz pan-x pan-y zoom }
-    } else {
-        set labels { phi theta psi pan-x pan-y zoom }
-    }
+    set labels { qw qx qy qz pan-x pan-y zoom }
     set row 0
     foreach tag $labels {
@@ -1974,23 +1909,8 @@
     }
 
-    itk_component add orientation {
-        Rappture::Combobox $inner.orientation -width 10 -editable no
-    }
-    $inner.orientation choices insert end \
-        "front"    "0 90 0" \
-        "back"   "180 90 0" \
-        "top"     "0 0 0"  \
-        "bottom"     "0 180 0"  \
-        "left"     "270 90 0 "  \
-        "right"     "90 90 0"  \
-	"default"  "45 45 0"
-    $itk_component(orientation) value "default"
-    bind $inner.orientation <<Value>> [itcl::code $this SetOrientation]
-
     blt::table configure $inner c0 c1 -resize none
     blt::table configure $inner c2 -resize expand
     blt::table configure $inner r$row -resize expand
 }
-
 
 # ----------------------------------------------------------------------
@@ -2060,5 +1980,4 @@
 }
 
-
 #  camera -- 
 #
@@ -2080,18 +1999,4 @@
                     set _view($who) $_settings($this-$who)
                     PanCamera
-                }
-                "phi" - "theta" - "psi" {
-                    set _view($who) $_settings($this-$who)
-                    set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
-                    SendCmd "camera angle $xyz"
-                    if {$_useArcball} {
-                        $_arcball euler [list [expr {-[lindex $xyz 2]}] [expr {-[lindex $xyz 1]}] [expr {-[lindex $xyz 0]}]]
-                        set q [$_arcball quaternion]
-                        foreach { _view(qw) _view(qx) _view(qy) _view(qz) } $q break
-                        set _settings($this-qw) $_view(qw)
-                        set _settings($this-qx) $_view(qx)
-                        set _settings($this-qy) $_view(qy)
-                        set _settings($this-qz) $_view(qz)
-                    }
                 }
                 "qx" - "qy" - "qz" - "qw" {
@@ -2167,13 +2072,2 @@
     SendCmd "volume statue $bool $name"
 }
-
-
-itcl::body Rappture::NanovisViewer::SetOrientation {} {
-    set angles [$itk_component(orientation) value]
-    foreach name { theta phi psi } angle $angles {
-	set _view($name) $angle
-    }
-    set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
-    SendCmd "camera angle $xyz"
-}
-
