Changeset 3492 for trunk/gui/scripts
- Timestamp:
- Mar 13, 2013, 9:57:03 AM (12 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/flowvisviewer.tcl
r3485 r3492 123 123 private method streams { tag name } 124 124 private method arrows { tag name } 125 private method SetOrientation {} 125 126 126 127 private variable _arcball "" … … 318 319 pack $itk_component(volume) -padx 2 -pady 2 319 320 320 BuildViewTab 321 BuildVolumeTab 322 BuildCutplanesTab 323 BuildCameraTab 321 if { [catch { 322 BuildViewTab 323 BuildVolumeTab 324 BuildCutplanesTab 325 BuildCameraTab 326 } errs] != 0 } { 327 global errorInfo 328 puts stderr "errs=$errs errorInfo=$errorInfo" 329 } 324 330 325 331 bind $itk_component(3dview) <Configure> \ … … 959 965 $_arcball quaternion $q 960 966 SendCmd "camera orient $q" 961 #SendCmd "camera reset"967 SendCmd "camera reset" 962 968 PanCamera 963 969 SendCmd "camera zoom $_view(zoom)" … … 1257 1263 $_arcball quaternion $q 1258 1264 SendCmd "camera orient $q" 1259 #SendCmd "camera reset"1265 SendCmd "camera reset" 1260 1266 PanCamera 1261 1267 SendCmd "camera zoom $_view(zoom)" … … 1367 1373 $_arcball quaternion $q 1368 1374 SendCmd "camera orient $q" 1369 #SendCmd "camera reset" 1370 SendCmd "camera zoom $_view(zoom)" 1375 SendCmd "camera reset" 1371 1376 set _settings($this-qw) $_view(qw) 1372 1377 set _settings($this-qx) $_view(qx) … … 1376 1381 set _settings($this-pan-y) $_view(pan-y) 1377 1382 set _settings($this-zoom) $_view(zoom) 1383 $itk_component(orientation) value "default" 1378 1384 } 1379 1385 } … … 2387 2393 $inner configure -borderwidth 4 2388 2394 2395 set row 0 2396 label $inner.orientation_l -text "View" -font "Arial 9" 2397 itk_component add orientation { 2398 Rappture::Combobox $inner.orientation -width 10 -editable no 2399 } 2400 $inner.orientation choices insert end \ 2401 "1 0 0 0" "front" \ 2402 "0 0 1 0" "back" \ 2403 "0.707107 -0.707107 0 0" "top" \ 2404 "0.707107 0.707107 0 0" "bottom" \ 2405 "0.707107 0 -0.707107 0" "left" \ 2406 "0.707107 0 0.707107 0" "right" \ 2407 "0.853553 -0.353553 0.353553 0.146447" "default" 2408 $itk_component(orientation) value "default" 2409 bind $inner.orientation <<Value>> [itcl::code $this SetOrientation] 2410 if 1 { 2411 blt::table $inner \ 2412 $row,0 $inner.orientation_l -anchor e -pady 2 \ 2413 $row,1 $inner.orientation -anchor w -pady 2 -fill x 2414 blt::table configure $inner r$row -resize none 2415 incr row 2416 } 2417 2389 2418 set labels { qw qx qy qz pan-x pan-y zoom } 2390 set row 02391 2419 foreach tag $labels { 2392 2420 label $inner.${tag}label -text $tag -font "Arial 9" … … 2611 2639 } 2612 2640 "qx" - "qy" - "qz" - "qw" { 2641 set _view($who) $_settings($this-$who) 2613 2642 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 2614 2643 $_arcball quaternion $q … … 2986 3015 } 2987 3016 3017 itcl::body Rappture::FlowvisViewer::SetOrientation {} { 3018 set quat [$itk_component(orientation) value] 3019 set quat [$itk_component(orientation) translate $quat] 3020 foreach name { qw qx qy qz } comp $quat { 3021 set _view($name) $comp 3022 set _settings($this-$name) $comp 3023 } 3024 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 3025 $_arcball quaternion $q 3026 SendCmd "camera orient $q" 3027 SendCmd "camera reset" 3028 set $_view(pan-x) 0.0 3029 set $_view(pan-y) 0.0 3030 set $_view(zoom) 1.0 3031 set _settings($this-pan-x) $_view(pan-x) 3032 set _settings($this-pan-y) $_view(pan-y) 3033 set _settings($this-zoom) $_view(zoom) 3034 } -
trunk/gui/scripts/nanovisviewer.tcl
r3485 r3492 286 286 pack $itk_component(volume) -padx 2 -pady 2 287 287 288 BuildViewTab 289 BuildVolumeTab 290 BuildCutplanesTab 291 BuildCameraTab 288 if { [catch { 289 BuildViewTab 290 BuildVolumeTab 291 BuildCutplanesTab 292 BuildCameraTab 293 } errs] != 0 } { 294 global errorInfo 295 puts stderr "errs=$errs errorInfo=$errorInfo" 296 } 292 297 293 298 # Legend … … 913 918 $_arcball quaternion $q 914 919 SendCmd "camera orient $q" 915 #SendCmd "camera reset"920 SendCmd "camera reset" 916 921 PanCamera 917 922 SendCmd "camera zoom $_view(zoom)" … … 1023 1028 $_arcball quaternion $q 1024 1029 SendCmd "camera orient $q" 1025 #SendCmd "camera reset" 1026 SendCmd "camera zoom $_view(zoom)" 1030 SendCmd "camera reset" 1027 1031 set _settings($this-qw) $_view(qw) 1028 1032 set _settings($this-qx) $_view(qx) … … 1032 1036 set _settings($this-pan-y) $_view(pan-y) 1033 1037 set _settings($this-zoom) $_view(zoom) 1038 $itk_component(orientation) value "default" 1034 1039 } 1035 1040 } … … 1892 1897 $inner configure -borderwidth 4 1893 1898 1899 set row 0 1900 label $inner.orientation_l -text "View" -font "Arial 9" 1901 itk_component add orientation { 1902 Rappture::Combobox $inner.orientation -width 10 -editable no 1903 } 1904 $inner.orientation choices insert end \ 1905 "1 0 0 0" "front" \ 1906 "0 0 1 0" "back" \ 1907 "0.707107 -0.707107 0 0" "top" \ 1908 "0.707107 0.707107 0 0" "bottom" \ 1909 "0.707107 0 -0.707107 0" "left" \ 1910 "0.707107 0 0.707107 0" "right" \ 1911 "0.853553 -0.353553 0.353553 0.146447" "default" 1912 $itk_component(orientation) value "default" 1913 bind $inner.orientation <<Value>> [itcl::code $this SetOrientation] 1914 if 1 { 1915 blt::table $inner \ 1916 $row,0 $inner.orientation_l -anchor e -pady 2 \ 1917 $row,1 $inner.orientation -anchor w -pady 2 -fill x 1918 blt::table configure $inner r$row -resize none 1919 incr row 1920 } 1921 1894 1922 set labels { qw qx qy qz pan-x pan-y zoom } 1895 set row 01896 1923 foreach tag $labels { 1897 1924 label $inner.${tag}label -text $tag -font "Arial 9" … … 2001 2028 } 2002 2029 "qx" - "qy" - "qz" - "qw" { 2030 set _view($who) $_settings($this-$who) 2003 2031 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 2004 2032 $_arcball quaternion $q … … 2072 2100 SendCmd "volume statue $bool $name" 2073 2101 } 2102 2103 itcl::body Rappture::NanovisViewer::SetOrientation {} { 2104 set quat [$itk_component(orientation) value] 2105 set quat [$itk_component(orientation) translate $quat] 2106 foreach name { qw qx qy qz } comp $quat { 2107 set _view($name) $comp 2108 set _settings($this-$name) $comp 2109 } 2110 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 2111 $_arcball quaternion $q 2112 SendCmd "camera orient $q" 2113 SendCmd "camera reset" 2114 set $_view(pan-x) 0.0 2115 set $_view(pan-y) 0.0 2116 set $_view(zoom) 1.0 2117 set _settings($this-pan-x) $_view(pan-x) 2118 set _settings($this-pan-y) $_view(pan-y) 2119 set _settings($this-zoom) $_view(zoom) 2120 }
Note: See TracChangeset
for help on using the changeset viewer.