Changeset 3122 for trunk/gui/scripts/vtkviewer.tcl
- Timestamp:
- Jul 27, 2012, 12:46:47 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkviewer.tcl
r3121 r3122 88 88 private method BuildCutawayTab {} 89 89 private method BuildDownloadPopup { widget command } 90 private method Build VolumeTab {}90 private method BuildMeshTab {} 91 91 private method BuildMoleculeTab {} 92 92 private method ConvertToVtkData { dataobj comp } … … 242 242 molecule-wireframe 0 243 243 molecule-palette rainbow 244 volume-edges 0245 volume-lighting 1246 volume-opacity 40247 volume-visible 1248 volume-wireframe 0249 volume-palette rainbow244 mesh-edges 0 245 mesh-lighting 1 246 mesh-opacity 40 247 mesh-visible 1 248 mesh-wireframe 0 249 mesh-palette rainbow 250 250 }] 251 251 … … 315 315 Rappture::Tooltip::for $itk_component(zoomout) "Zoom out" 316 316 317 puts stderr "Build VolumeTab"318 if { [catch { Build VolumeTab } errs ] != 0 } {317 puts stderr "BuildMeshTab" 318 if { [catch { BuildMeshTab } errs ] != 0 } { 319 319 puts stderr "errs=$errs" 320 320 } … … 927 927 FixSettings axis-xgrid axis-ygrid axis-zgrid axis-mode \ 928 928 axis-visible axis-labels \ 929 volume-edges volume-lighting volume-opacity volume-visible \930 volume-wireframe929 mesh-edges mesh-lighting mesh-opacity mesh-visible \ 930 mesh-wireframe 931 931 932 932 #SendCmd "imgflush" … … 1222 1222 } 1223 1223 switch -- $what { 1224 " volume-opacity" {1225 set val $_settings( volume-opacity)1224 "mesh-opacity" { 1225 set val $_settings(mesh-opacity) 1226 1226 set sval [expr { 0.01 * double($val) }] 1227 1227 foreach dataset [CurrentDatasets -visible $_first] { … … 1233 1233 } 1234 1234 } 1235 " volume-wireframe" {1236 set bool $_settings( volume-wireframe)1235 "mesh-wireframe" { 1236 set bool $_settings(mesh-wireframe) 1237 1237 foreach dataset [CurrentDatasets -visible $_first] { 1238 1238 foreach { dataobj comp } [split $dataset -] break … … 1243 1243 } 1244 1244 } 1245 " volume-visible" {1246 set bool $_settings( volume-visible)1245 "mesh-visible" { 1246 set bool $_settings(mesh-visible) 1247 1247 foreach dataset [CurrentDatasets -visible $_first] { 1248 1248 foreach { dataobj comp } [split $dataset -] break … … 1253 1253 } 1254 1254 } 1255 " volume-lighting" {1256 set bool $_settings( volume-lighting)1255 "mesh-lighting" { 1256 set bool $_settings(mesh-lighting) 1257 1257 foreach dataset [CurrentDatasets -visible $_first] { 1258 1258 foreach { dataobj comp } [split $dataset -] break … … 1263 1263 } 1264 1264 } 1265 " volume-edges" {1266 set bool $_settings( volume-edges)1265 "mesh-edges" { 1266 set bool $_settings(mesh-edges) 1267 1267 foreach dataset [CurrentDatasets -visible $_first] { 1268 1268 foreach { dataobj comp } [split $dataset -] break … … 1273 1273 } 1274 1274 } 1275 " volume-palette" {1276 set palette [$itk_component( palette) value]1277 set _settings( volume-palette) $palette1275 "mesh-palette" { 1276 set palette [$itk_component(meshpalette) value] 1277 set _settings(mesh-palette) $palette 1278 1278 foreach dataset [CurrentDatasets -visible $_first] { 1279 1279 foreach {dataobj comp} [split $dataset -] break … … 1746 1746 set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0" 1747 1747 } 1748 if { ![info exists _settings( volume-opacity)] } {1749 set _settings( volume-opacity) $style(-opacity)1750 } 1751 set max $_settings( volume-opacity)1748 if { ![info exists _settings(mesh-opacity)] } { 1749 set _settings(mesh-opacity) $style(-opacity) 1750 } 1751 set max $_settings(mesh-opacity) 1752 1752 1753 1753 set wmap "0.0 1.0 1.0 1.0" … … 1846 1846 } 1847 1847 1848 itcl::body Rappture::VtkViewer::Build VolumeTab {} {1848 itcl::body Rappture::VtkViewer::BuildMeshTab {} { 1849 1849 1850 1850 set fg [option get $itk_component(hull) font Font] … … 1852 1852 1853 1853 set inner [$itk_component(main) insert end \ 1854 -title " VolumeSettings" \1855 -icon [Rappture::icon volume-on]]1854 -title "Mesh Settings" \ 1855 -icon [Rappture::icon mesh]] 1856 1856 $inner configure -borderwidth 4 1857 1857 1858 checkbutton $inner. volume\1859 -text "Show Volume" \1860 -variable [itcl::scope _settings( volume-visible)] \1861 -command [itcl::code $this AdjustSetting volume-visible] \1858 checkbutton $inner.mesh \ 1859 -text "Show Mesh" \ 1860 -variable [itcl::scope _settings(mesh-visible)] \ 1861 -command [itcl::code $this AdjustSetting mesh-visible] \ 1862 1862 -font "Arial 9" 1863 1863 1864 1864 checkbutton $inner.wireframe \ 1865 1865 -text "Show Wireframe" \ 1866 -variable [itcl::scope _settings( volume-wireframe)] \1867 -command [itcl::code $this AdjustSetting volume-wireframe] \1866 -variable [itcl::scope _settings(mesh-wireframe)] \ 1867 -command [itcl::code $this AdjustSetting mesh-wireframe] \ 1868 1868 -font "Arial 9" 1869 1869 1870 1870 checkbutton $inner.lighting \ 1871 1871 -text "Enable Lighting" \ 1872 -variable [itcl::scope _settings( volume-lighting)] \1873 -command [itcl::code $this AdjustSetting volume-lighting] \1872 -variable [itcl::scope _settings(mesh-lighting)] \ 1873 -command [itcl::code $this AdjustSetting mesh-lighting] \ 1874 1874 -font "Arial 9" 1875 1875 1876 1876 checkbutton $inner.edges \ 1877 1877 -text "Show Edges" \ 1878 -variable [itcl::scope _settings( volume-edges)] \1879 -command [itcl::code $this AdjustSetting volume-edges] \1878 -variable [itcl::scope _settings(mesh-edges)] \ 1879 -command [itcl::code $this AdjustSetting mesh-edges] \ 1880 1880 -font "Arial 9" 1881 1881 1882 1882 label $inner.palette_l -text "Palette" -font "Arial 9" 1883 itk_component add volumepalette {1883 itk_component add meshpalette { 1884 1884 Rappture::Combobox $inner.palette -width 10 -editable no 1885 1885 } … … 1902 1902 "orange-to-blue" "orange-to-blue" 1903 1903 1904 $itk_component( volumepalette) value "BCGYR"1904 $itk_component(meshpalette) value "BCGYR" 1905 1905 bind $inner.palette <<Value>> \ 1906 [itcl::code $this AdjustSetting volume-palette]1906 [itcl::code $this AdjustSetting mesh-palette] 1907 1907 1908 1908 label $inner.opacity_l -text "Opacity" -font "Arial 9" 1909 1909 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1910 -variable [itcl::scope _settings( volume-opacity)] \1910 -variable [itcl::scope _settings(mesh-opacity)] \ 1911 1911 -width 10 \ 1912 1912 -showvalue off \ 1913 -command [itcl::code $this AdjustSetting volume-opacity]1913 -command [itcl::code $this AdjustSetting mesh-opacity] 1914 1914 1915 1915 blt::table $inner \ 1916 0,0 $inner. volume-cspan 2 -anchor w -pady 2 \1916 0,0 $inner.mesh -cspan 2 -anchor w -pady 2 \ 1917 1917 1,0 $inner.wireframe -cspan 2 -anchor w -pady 2 \ 1918 1918 2,0 $inner.lighting -cspan 2 -anchor w -pady 2 \ … … 2297 2297 $inner.atomradius value "Van der Waals" 2298 2298 label $inner.spacer 2299 2300 label $inner.opacity_l -text "Opacity" -font "Arial 9" 2301 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 2302 -variable [itcl::scope _settings(molecule-opacity)] \ 2303 -width 10 \ 2304 -showvalue off \ 2305 -command [itcl::code $this AdjustSetting molecule-opacity] 2306 2299 2307 blt::table $inner \ 2300 2308 0,0 $inner.molecule -anchor w -pady {1 0} \ … … 2308 2316 12,0 $inner.bondscale -fill x -pady {1 0} \ 2309 2317 13,0 $inner.palette_l -anchor w -pady 2 \ 2310 14,0 $inner.palette -fill x -pady 2 2311 2318 14,0 $inner.palette -fill x -pady 2 \ 2319 15,0 $inner.opacity_l -anchor w -pady 2 \ 2320 16,0 $inner.opacity -fill x -pady 2 2321 2312 2322 blt::table configure $inner r* -resize none 2313 blt::table configure $inner r1 5-resize expand2323 blt::table configure $inner r17 -resize expand 2314 2324 } 2315 2325 … … 2504 2514 SendCmd "polydata add $tag" 2505 2515 SendCmd "polydata visible $settings(-visible) $tag" 2506 set _settings( volume-visible) $settings(-visible)2516 set _settings(mesh-visible) $settings(-visible) 2507 2517 SendCmd "polydata edges $settings(-edges) $tag" 2508 set _settings( volume-edges) $settings(-edges)2518 set _settings(mesh-edges) $settings(-edges) 2509 2519 SendCmd "polydata color [Color2RGB $settings(-color)] $tag" 2510 2520 SendCmd "polydata lighting $settings(-lighting) $tag" 2511 set _settings( volume-lighting) $settings(-lighting)2521 set _settings(mesh-lighting) $settings(-lighting) 2512 2522 SendCmd "polydata linecolor [Color2RGB $settings(-edgecolor)] $tag" 2513 2523 SendCmd "polydata linewidth $settings(-linewidth) $tag" 2514 2524 SendCmd "polydata opacity $settings(-opacity) $tag" 2515 set _settings( volume-opacity) $settings(-opacity)2525 set _settings(mesh-opacity) $settings(-opacity) 2516 2526 SendCmd "polydata wireframe $settings(-wireframe) $tag" 2517 set _settings( volume-wireframe) $settings(-wireframe)2518 } 2519 set _settings( volume-opacity) [expr $settings(-opacity) * 100.0]2527 set _settings(mesh-wireframe) $settings(-wireframe) 2528 } 2529 set _settings(mesh-opacity) [expr $settings(-opacity) * 100.0] 2520 2530 SetColormap $dataobj $comp 2521 2531 }
Note: See TracChangeset
for help on using the changeset viewer.