- Timestamp:
- Mar 17, 2013, 9:46:35 AM (12 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 8 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/nanovisviewer.tcl
r3498 r3517 118 118 private method volume { tag name } 119 119 private method GetVolumeInfo { w } 120 private method SetOrientation { }120 private method SetOrientation { side } 121 121 122 122 private variable _arcball "" … … 200 200 qz 0.146447 201 201 zoom 1.0 202 pan-x0203 pan-y0202 xpan 0 203 ypan 0 204 204 } 205 205 set _arcball [blt::arcball create 100 100] … … 217 217 $this-qz $_view(qz) 218 218 $this-zoom $_view(zoom) 219 $this- pan-x $_view(pan-x)220 $this- pan-y $_view(pan-y)219 $this-xpan $_view(xpan) 220 $this-ypan $_view(ypan) 221 221 $this-volume 1 222 222 $this-xcutplane 0 … … 924 924 set _settings($this-qy) $_view(qy) 925 925 set _settings($this-qz) $_view(qz) 926 set _settings($this- pan-x) $_view(pan-x)927 set _settings($this- pan-y) $_view(pan-y)926 set _settings($this-xpan) $_view(xpan) 927 set _settings($this-ypan) $_view(ypan) 928 928 set _settings($this-zoom) $_view(zoom) 929 929 … … 1029 1029 qz 0.146447 1030 1030 zoom 1.0 1031 pan-x01032 pan-y01031 xpan 0 1032 ypan 0 1033 1033 } 1034 1034 if { $_first != "" } { … … 1046 1046 set _settings($this-qy) $_view(qy) 1047 1047 set _settings($this-qz) $_view(qz) 1048 set _settings($this- pan-x) $_view(pan-x)1049 set _settings($this- pan-y) $_view(pan-y)1048 set _settings($this-xpan) $_view(xpan) 1049 set _settings($this-ypan) $_view(ypan) 1050 1050 set _settings($this-zoom) $_view(zoom) 1051 1051 $itk_component(orientation) value "default" … … 1055 1055 1056 1056 itcl::body Rappture::NanovisViewer::PanCamera {} { 1057 #set x [expr ($_view( pan-x)) / $_limits(xrange)]1058 #set y [expr ($_view( pan-y)) / $_limits(yrange)]1059 set x $_view( pan-x)1060 set y $_view( pan-y)1057 #set x [expr ($_view(xpan)) / $_limits(xrange)] 1058 #set y [expr ($_view(ypan)) / $_limits(yrange)] 1059 set x $_view(xpan) 1060 set y $_view(ypan) 1061 1061 SendCmd "camera pan $x $y" 1062 1062 } … … 1134 1134 set x [expr $x / double($w)] 1135 1135 set y [expr $y / double($h)] 1136 set _view( pan-x) [expr $_view(pan-x) + $x]1137 set _view( pan-y) [expr $_view(pan-y) + $y]1136 set _view(xpan) [expr $_view(xpan) + $x] 1137 set _view(ypan) [expr $_view(ypan) + $y] 1138 1138 PanCamera 1139 set _settings($this- pan-x) $_view(pan-x)1140 set _settings($this- pan-y) $_view(pan-y)1139 set _settings($this-xpan) $_view(xpan) 1140 set _settings($this-ypan) $_view(ypan) 1141 1141 return 1142 1142 } … … 1151 1151 set _click(x) $x 1152 1152 set _click(y) $y 1153 set _view( pan-x) [expr $_view(pan-x) - $dx]1154 set _view( pan-y) [expr $_view(pan-y) - $dy]1153 set _view(xpan) [expr $_view(xpan) - $dx] 1154 set _view(ypan) [expr $_view(ypan) - $dy] 1155 1155 PanCamera 1156 set _settings($this- pan-x) $_view(pan-x)1157 set _settings($this- pan-y) $_view(pan-y)1156 set _settings($this-xpan) $_view(xpan) 1157 set _settings($this-ypan) $_view(ypan) 1158 1158 } 1159 1159 if { $option == "release" } { … … 1910 1910 $inner configure -borderwidth 4 1911 1911 1912 set row 0 1913 label $inner.orientation_l -text "View" -font "Arial 9" 1914 itk_component add orientation { 1915 Rappture::Combobox $inner.orientation -width 10 -editable no 1916 } 1917 $inner.orientation choices insert end \ 1918 "1 0 0 0" "front" \ 1919 "0 0 1 0" "back" \ 1920 "0.707107 -0.707107 0 0" "top" \ 1921 "0.707107 0.707107 0 0" "bottom" \ 1922 "0.707107 0 -0.707107 0" "left" \ 1923 "0.707107 0 0.707107 0" "right" \ 1924 "0.853553 -0.353553 0.353553 0.146447" "default" 1925 $itk_component(orientation) value "default" 1926 bind $inner.orientation <<Value>> [itcl::code $this SetOrientation] 1927 if 1 { 1912 label $inner.view_l -text "view" -font "Arial 9" 1913 set f [frame $inner.view] 1914 foreach side { front back left right top bottom } { 1915 button $f.$side -image [Rappture::icon view$side] \ 1916 -command [itcl::code $this SetOrientation $side] 1917 Rappture::Tooltip::for $f.$side "Change the view to $side" 1918 pack $f.$side -side left 1919 } 1920 1928 1921 blt::table $inner \ 1929 $row,0 $inner.orientation_l -anchor e -pady 2 \ 1930 $row,1 $inner.orientation -anchor w -pady 2 -fill x 1931 blt::table configure $inner r$row -resize none 1932 incr row 1933 } 1934 1935 set labels { qw qx qy qz pan-x pan-y zoom } 1922 0,0 $inner.view_l -anchor e -pady 2 \ 1923 0,1 $inner.view -anchor w -pady 2 1924 1925 set row 1 1926 set labels { qw qx qy qz xpan ypan zoom } 1936 1927 foreach tag $labels { 1937 1928 label $inner.${tag}label -text $tag -font "Arial 9" … … 1949 1940 } 1950 1941 1951 blt::table configure $inner c 0 c1-resize none1942 blt::table configure $inner c* r* -resize none 1952 1943 blt::table configure $inner c2 -resize expand 1953 1944 blt::table configure $inner r$row -resize expand … … 2036 2027 } 2037 2028 switch -- $who { 2038 " pan-x" - "pan-y" {2029 "xpan" - "ypan" { 2039 2030 set _view($who) $_settings($this-$who) 2040 2031 PanCamera … … 2114 2105 } 2115 2106 2116 itcl::body Rappture::NanovisViewer::SetOrientation {} { 2117 set quat [$itk_component(orientation) value] 2118 set quat [$itk_component(orientation) translate $quat] 2119 foreach name { qw qx qy qz } comp $quat { 2120 set _view($name) $comp 2121 set _settings($this-$name) $comp 2107 itcl::body Rappture::NanovisViewer::SetOrientation { side } { 2108 array set positions { 2109 front "1 0 0 0" 2110 back "0 0 1 0" 2111 left "0.707107 0 -0.707107 0" 2112 right "0.707107 0 0.707107 0" 2113 top "0.707107 -0.707107 0 0" 2114 bottom "0.707107 0.707107 0 0" 2115 } 2116 foreach name { qw qx qy qz } value $positions($side) { 2117 set _view($name) $value 2122 2118 } 2123 2119 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 2124 2120 $_arcball quaternion $q 2125 2121 SendCmd "camera orient $q" 2126 SendCmd "camera reset" 2127 set $_view(pan-x) 0.0 2128 set $_view(pan-y) 0.0 2129 set $_view(zoom) 1.0 2130 set _settings($this-pan-x) $_view(pan-x) 2131 set _settings($this-pan-y) $_view(pan-y) 2132 set _settings($this-zoom) $_view(zoom) 2133 } 2122 } 2123 -
trunk/gui/scripts/visviewer.tcl
r3514 r3517 857 857 $inner.scrl.text delete 0.0 end 858 858 859 $inner.scrl.text configure -state normal 859 860 $inner.scrl.text insert end "The following error was reported by the render server:\n\n" bold 860 861 $inner.scrl.text insert end $bytes code 862 $inner.scrl.text configure -state disabled 861 863 update 862 864 $popup activate $itk_component(hull) below -
trunk/gui/scripts/vtkheightmapviewer.tcl
r3514 r3517 106 106 private method GetHeightmapScale {} 107 107 private method ResetAxes {} 108 private method SetOrientation { side } 108 109 109 110 private variable _arcball "" … … 1766 1767 set inner [$itk_component(main) insert end \ 1767 1768 -title "Contour/Surface Settings" \ 1768 -icon [Rappture::icon contour ]]1769 -icon [Rappture::icon contour2]] 1769 1770 $inner configure -borderwidth 4 1770 1771 … … 1958 1959 set inner [$itk_component(main) insert end \ 1959 1960 -title "Axis Settings" \ 1960 -icon [Rappture::icon axis 1]]1961 -icon [Rappture::icon axis2]] 1961 1962 $inner configure -borderwidth 4 1962 1963 … … 2030 2031 $inner configure -borderwidth 4 2031 2032 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 2032 2046 set labels { qx qy qz qw xpan ypan zoom } 2033 set row 02047 set row 1 2034 2048 foreach tag $labels { 2035 2049 label $inner.${tag}label -text $tag -font "Arial 9" … … 2056 2070 incr row 2057 2071 2058 blt::table configure $inner c 0 c1-resize none2072 blt::table configure $inner c* r* -resize none 2059 2073 blt::table configure $inner c2 -resize expand 2060 2074 blt::table configure $inner r$row -resize expand … … 2513 2527 } 2514 2528 2515 2516 2517 2529 itcl::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 -
trunk/gui/scripts/vtkisosurfaceviewer.tcl
r3515 r3517 105 105 private method Slice {option args} 106 106 private method SetCurrentColormap { color } 107 private method SetOrientation { side } 107 108 108 109 private variable _arcball "" … … 232 233 cutplaneEdges 0 233 234 cutplaneLighting 1 235 cutplanePreinterp 0 234 236 cutplaneOpacity 100 235 237 cutplaneVisible 0 … … 1052 1054 isosurfaceWireframe isosurfaceOutline \ 1053 1055 cutplaneXPosition cutplaneYPosition cutplaneZPosition \ 1054 cutplaneXVisible cutplaneYVisible cutplaneZVisible 1056 cutplaneXVisible cutplaneYVisible cutplaneZVisible \ 1057 cutplanePreinterp 1055 1058 1056 1059 Zoom reset … … 1372 1375 SendCmd "cutplane opacity $sval" 1373 1376 } 1377 "cutplanePreinterp" { 1378 set bool $_settings($what) 1379 SendCmd "cutplane preinterp $bool" 1380 } 1374 1381 "cutplaneXVisible" - "cutplaneYVisible" - "cutplaneZVisible" { 1375 1382 set axis [string tolower [string range $what 8 8]] … … 1739 1746 set inner [$itk_component(main) insert end \ 1740 1747 -title "Axis Settings" \ 1741 -icon [Rappture::icon axis 1]]1748 -icon [Rappture::icon axis2]] 1742 1749 $inner configure -borderwidth 4 1743 1750 … … 1803 1810 $inner configure -borderwidth 4 1804 1811 1812 label $inner.view_l -text "view" -font "Arial 9" 1813 set f [frame $inner.view] 1814 foreach side { front back left right top bottom } { 1815 button $f.$side -image [Rappture::icon view$side] \ 1816 -command [itcl::code $this SetOrientation $side] 1817 Rappture::Tooltip::for $f.$side "Change the view to $side" 1818 pack $f.$side -side left 1819 } 1820 1821 blt::table $inner \ 1822 0,0 $inner.view_l -anchor e -pady 2 \ 1823 0,1 $inner.view -anchor w -pady 2 1824 1805 1825 set labels { qx qy qz qw xpan ypan zoom } 1806 set row 01826 set row 1 1807 1827 foreach tag $labels { 1808 1828 label $inner.${tag}label -text $tag -font "Arial 9" … … 1827 1847 incr row 1828 1848 1829 blt::table configure $inner c 0 c1-resize none1849 blt::table configure $inner c* r* -resize none 1830 1850 blt::table configure $inner c2 -resize expand 1831 1851 blt::table configure $inner r$row -resize expand … … 1864 1884 -variable [itcl::scope _settings(cutplaneEdges)] \ 1865 1885 -command [itcl::code $this AdjustSetting cutplaneEdges] \ 1886 -font "Arial 9" 1887 1888 checkbutton $inner.preinterp \ 1889 -text "Interpolate" \ 1890 -variable [itcl::scope _settings(cutplanePreinterp)] \ 1891 -command [itcl::code $this AdjustSetting cutplanePreinterp] \ 1866 1892 -font "Arial 9" 1867 1893 … … 1967 1993 2,0 $inner.wireframe -anchor w -pady 2 -cspan 3 \ 1968 1994 3,0 $inner.edges -anchor w -pady 2 -cspan 3 \ 1969 4,0 $inner.opacity_l -anchor w -pady 2 -cspan 1 \ 1970 4,1 $inner.opacity -fill x -pady 2 -cspan 3 \ 1995 4,0 $inner.preinterp -anchor w -pady 2 -cspan 3 \ 1996 5,0 $inner.opacity_l -anchor w -pady 2 -cspan 1 \ 1997 5,1 $inner.opacity -fill x -pady 2 -cspan 3 \ 1971 1998 6,0 $inner.xbutton -anchor w -padx 2 -pady 2 \ 1972 1999 7,0 $inner.ybutton -anchor w -padx 2 -pady 2 \ … … 1979 2006 blt::table configure $inner r* c* -resize none 1980 2007 blt::table configure $inner r9 c4 -resize expand 1981 blt::table configure $inner r5 -height 0.12i1982 2008 } 1983 2009 … … 2509 2535 } 2510 2536 2511 2512 2537 itcl::body Rappture::VtkIsosurfaceViewer::SetOrientation { side } { 2538 array set positions { 2539 front "1 0 0 0" 2540 back "0 0 1 0" 2541 left "0.707107 0 -0.707107 0" 2542 right "0.707107 0 0.707107 0" 2543 top "0.707107 -0.707107 0 0" 2544 bottom "0.707107 0.707107 0 0" 2545 } 2546 foreach name { qw qx qy qz } value $positions($side) { 2547 set _view($name) $value 2548 } 2549 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 2550 $_arcball quaternion $q 2551 SendCmd "camera orient $q" 2552 } -
trunk/gui/scripts/vtkstreamlinesviewer.tcl
r3482 r3517 107 107 private method SetObjectStyle { dataobj comp } 108 108 private method Slice {option args} 109 private method SetOrientation { side } 109 110 110 111 private variable _arcball "" … … 1868 1869 $inner configure -borderwidth 4 1869 1870 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 1870 1884 set labels { qx qy qz qw xpan ypan zoom } 1871 set row 01885 set row 1 1872 1886 foreach tag $labels { 1873 1887 label $inner.${tag}label -text $tag -font "Arial 9" … … 1892 1906 incr row 1893 1907 1894 blt::table configure $inner c 0 c1-resize none1908 blt::table configure $inner c* r* -resize none 1895 1909 blt::table configure $inner c2 -resize expand 1896 1910 blt::table configure $inner r$row -resize expand … … 2448 2462 } 2449 2463 2464 itcl::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 -
trunk/gui/scripts/vtkviewer.tcl
r3454 r3517 1809 1809 $inner configure -borderwidth 4 1810 1810 1811 label $inner.view_l -text "view" -font "Arial 9" 1812 set f [frame $inner.view] 1813 foreach side { front back left right top bottom } { 1814 button $f.$side -image [Rappture::icon view$side] \ 1815 -command [itcl::code $this SetOrientation $side] 1816 Rappture::Tooltip::for $f.$side "Change the view to $side" 1817 pack $f.$side -side left 1818 } 1819 1820 blt::table $inner \ 1821 0,0 $inner.view_l -anchor e -pady 2 \ 1822 0,1 $inner.view -anchor w -pady 2 1823 1811 1824 set labels { qx qy qz qw xpan ypan zoom } 1812 set row 01825 set row 1 1813 1826 foreach tag $labels { 1814 1827 label $inner.${tag}label -text $tag -font "Arial 9" … … 1833 1846 incr row 1834 1847 1835 blt::table configure $inner c 0 c1-resize none1848 blt::table configure $inner c* r* -resize none 1836 1849 blt::table configure $inner c2 -resize expand 1837 1850 blt::table configure $inner r$row -resize expand … … 2472 2485 } 2473 2486 2487 itcl::body Rappture::VtkViewer::SetOrientation { side } { 2488 array set positions { 2489 front "1 0 0 0" 2490 back "0 0 1 0" 2491 left "0.707107 0 -0.707107 0" 2492 right "0.707107 0 0.707107 0" 2493 top "0.707107 -0.707107 0 0" 2494 bottom "0.707107 0.707107 0 0" 2495 } 2496 foreach name { qw qx qy qz } value $positions($side) { 2497 set _view($name) $value 2498 } 2499 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 2500 $_arcball quaternion $q 2501 SendCmd "camera orient $q" 2502 } 2503
Note: See TracChangeset
for help on using the changeset viewer.