Changeset 4443 for branches/1.3/gui/scripts
- Timestamp:
- Jun 27, 2014, 12:24:30 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/gui/scripts/vtkvolumeviewer.tcl
r4439 r4443 8 8 # ====================================================================== 9 9 # AUTHOR: Michael McLennan, Purdue University 10 # Copyright (c) 2004-201 2HUBzero Foundation, LLC10 # Copyright (c) 2004-2014 HUBzero Foundation, LLC 11 11 # 12 12 # See the file "license.terms" for information on usage and … … 67 67 protected method Disconnect {} 68 68 protected method DoResize {} 69 protected method DoReseed {}70 69 protected method DoRotate {} 71 70 protected method AdjustSetting {what {value ""}} … … 91 90 private method EnterLegend { x y } 92 91 private method EventuallyResize { w h } 93 private method EventuallyReseed { numPoints }94 92 private method EventuallyRotate { q } 95 93 private method EventuallySetCutplane { axis args } … … 129 127 private variable _start 0 130 128 private variable _title "" 131 private variable _seeds132 129 133 130 common _downloadPopup; # download options from popup … … 136 133 private variable _height 0 137 134 private variable _resizePending 0 138 private variable _reseedPending 0139 135 private variable _rotatePending 0 140 136 private variable _cutplanePending 0 … … 165 161 $_dispatcher register !resize 166 162 $_dispatcher dispatch $this !resize "[itcl::code $this DoResize]; list" 167 168 # Reseed event169 $_dispatcher register !reseed170 $_dispatcher dispatch $this !reseed "[itcl::code $this DoReseed]; list"171 163 172 164 # Rotate event … … 344 336 puts stderr errs=$errs 345 337 } 338 346 339 # Legend 347 348 340 set _image(legend) [image create photo] 349 341 itk_component add legend { … … 374 366 [itcl::code $this EventuallyResize %w %h] 375 367 376 if 0 {377 bind $itk_component(view) <Configure> \378 [itcl::code $this EventuallyResize %w %h]379 }380 368 # Bindings for panning via mouse 381 369 bind $itk_component(view) <ButtonPress-2> \ … … 468 456 } 469 457 470 itcl::body Rappture::VtkVolumeViewer::EventuallyReseed { numPoints } {471 set _numSeeds $numPoints472 if { !$_reseedPending } {473 set _reseedPending 1474 $_dispatcher event -after 600 !reseed475 }476 }477 478 458 set rotate_delay 100 479 459 … … 805 785 $_dispatcher cancel !rebuild 806 786 $_dispatcher cancel !resize 807 $_dispatcher cancel !reseed808 787 $_dispatcher cancel !rotate 809 788 $_dispatcher cancel !xcutplane … … 816 795 array unset _data 817 796 array unset _colormaps 818 array unset _seeds819 797 array unset _dataset2style 820 798 array unset _obj2datasets … … 994 972 set label [$_first hints ${axis}label] 995 973 if { $label != "" } { 996 SendCmd "axis name $axis $label"974 SendCmd [list axis name $axis $label] 997 975 } 998 976 set units [$_first hints ${axis}units] 999 977 if { $units != "" } { 1000 SendCmd "axis units $axis $units"978 SendCmd [list axis units $axis $units] 1001 979 } 1002 980 } … … 1284 1262 switch -- $what { 1285 1263 "volumeVisible" { 1286 set bool $_settings( volumeVisible)1264 set bool $_settings($what) 1287 1265 foreach dataset [CurrentDatasets -visible] { 1288 1266 SendCmd "volume visible $bool $dataset" … … 1297 1275 } 1298 1276 "volume-material" { 1299 set val $_settings( volume-material)1277 set val $_settings($what) 1300 1278 set diffuse [expr {0.01*$val}] 1301 1279 set specular [expr {0.01*$val}] … … 1308 1286 } 1309 1287 "volumeLighting" { 1310 set bool $_settings( volumeLighting)1288 set bool $_settings($what) 1311 1289 foreach dataset [CurrentDatasets -visible] { 1312 1290 SendCmd "volume lighting $bool $dataset" … … 1314 1292 } 1315 1293 "volume-quality" { 1316 set val $_settings( volume-quality)1294 set val $_settings($what) 1317 1295 set val [expr {0.01*$val}] 1318 1296 foreach dataset [CurrentDatasets -visible] { … … 1321 1299 } 1322 1300 "axesVisible" { 1323 set bool $_settings( axesVisible)1301 set bool $_settings($what) 1324 1302 SendCmd "axis visible all $bool" 1325 1303 } 1326 1304 "axisLabels" { 1327 set bool $_settings( axisLabels)1305 set bool $_settings($what) 1328 1306 SendCmd "axis labels all $bool" 1329 1307 } … … 1394 1372 "volume-palette" { 1395 1373 set palette [$itk_component(palette) value] 1396 set _settings( volume-palette) $palette1374 set _settings($what) $palette 1397 1375 foreach dataset [CurrentDatasets -visible $_first] { 1398 1376 foreach {dataobj comp} [split $dataset -] break … … 1401 1379 set _legendPending 1 1402 1380 } 1403 "volume-palette" {1404 set palette [$itk_component(palette) value]1405 set _settings(volume-palette) $palette1406 foreach dataset [CurrentDatasets -visible $_first] {1407 foreach {dataobj comp} [split $dataset -] break1408 ChangeColormap $dataobj $comp $palette1409 }1410 set _legendPending 11411 }1412 1381 "field" { 1413 1382 set label [$itk_component(field) value] 1414 1383 set fname [$itk_component(field) translate $label] 1415 set _settings( field) $fname1384 set _settings($what) $fname 1416 1385 if { [info exists _fields($fname)] } { 1417 1386 foreach { label units components } $_fields($fname) break
Note: See TracChangeset
for help on using the changeset viewer.