- Timestamp:
- May 7, 2015, 12:44:32 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/gui/scripts/vtkvolumeviewer.tcl
r5437 r5462 61 61 } 62 62 public method scale {args} 63 64 private method GetDatasetsWithComponent { cname } 65 66 private variable _volcomponents ; # Array of components found 67 private variable _componentsList ; # List of component names 63 68 64 69 # The following methods are only used by this class. … … 81 86 private method EnterLegend { x y } 82 87 private method EventuallyResize { w h } 88 private method EventuallyRequestLegend {} 83 89 private method EventuallyRotate { q } 84 90 private method EventuallySetCutplane { axis args } … … 181 187 $_dispatcher register !xcutplane 182 188 $_dispatcher dispatch $this !xcutplane \ 183 "[itcl::code $this AdjustSetting cutplane-xposition]; list"189 "[itcl::code $this AdjustSetting -xcutplaneposition]; list" 184 190 185 191 # Y-Cutplane event 186 192 $_dispatcher register !ycutplane 187 193 $_dispatcher dispatch $this !ycutplane \ 188 "[itcl::code $this AdjustSetting cutplane-yposition]; list"194 "[itcl::code $this AdjustSetting -ycutplaneposition]; list" 189 195 190 196 # Z-Cutplane event 191 197 $_dispatcher register !zcutplane 192 198 $_dispatcher dispatch $this !zcutplane \ 193 "[itcl::code $this AdjustSetting cutplane-zposition]; list"199 "[itcl::code $this AdjustSetting -zcutplaneposition]; list" 194 200 195 201 # … … 215 221 216 222 array set _settings { 217 axis-minorticks 1 218 axis-xgrid 0 219 axis-ygrid 0 220 axis-zgrid 0 221 axesVisible 1 222 axisLabels 1 223 cutplane-xvisible 1 224 cutplane-yvisible 1 225 cutplane-zvisible 1 226 cutplane-xposition 50 227 cutplane-yposition 50 228 cutplane-zposition 50 229 cutplaneVisible 0 230 cutplaneLighting 1 231 cutplane-opacity 100 232 volumeLighting 1 233 volume-material 80 234 volume-opacity 50 235 volume-quality 50 236 volumeVisible 1 237 legendVisible 1 223 -axesvisible 1 224 -axisflymode static 225 -axislabels 1 226 -axisminorticks 1 227 -background black 228 -color BCGYR 229 -cutplanelighting 1 230 -cutplaneopacity 100 231 -cutplanesvisible 0 232 -legendvisible 1 233 -volumelighting 1 234 -volumematerial 80 235 -volumeopacity 50 236 -volumeoutline 0 237 -volumequality 80 238 -volumevisible 1 239 -xcutplaneposition 50 240 -xcutplanevisible 1 241 -xgrid 0 242 -ycutplaneposition 50 243 -ycutplanevisible 1 244 -ygrid 0 245 -zcutplaneposition 50 246 -zcutplanevisible 1 247 -zgrid 0 238 248 } 239 249 … … 314 324 -onimage [Rappture::icon volume-on] \ 315 325 -offimage [Rappture::icon volume-off] \ 316 -variable [itcl::scope _settings( volumeVisible)] \317 -command [itcl::code $this AdjustSetting volumeVisible]326 -variable [itcl::scope _settings(-volumevisible)] \ 327 -command [itcl::code $this AdjustSetting -volumevisible] 318 328 } 319 329 $itk_component(volume) select … … 326 336 -onimage [Rappture::icon cutbutton] \ 327 337 -offimage [Rappture::icon cutbutton] \ 328 -variable [itcl::scope _settings( cutplaneVisible)] \329 -command [itcl::code $this AdjustSetting cutplaneVisible]338 -variable [itcl::scope _settings(-cutplanesvisible)] \ 339 -command [itcl::code $this AdjustSetting -cutplanesvisible] 330 340 } 331 341 Rappture::Tooltip::for $itk_component(cutplane) \ … … 458 468 } 459 469 470 itcl::body Rappture::VtkVolumeViewer::EventuallyRequestLegend {} { 471 if { !$_legendPending } { 472 set _legendPending 1 473 $_dispatcher event -idle !legend 474 } 475 } 476 460 477 set rotate_delay 100 461 478 … … 629 646 # ---------------------------------------------------------------------- 630 647 itcl::body Rappture::VtkVolumeViewer::scale {args} { 648 array unset _limits 649 array unset _volcomponents 650 set _componentsList "" 651 631 652 foreach dataobj $args { 632 653 if { ![$dataobj isvalid] } { … … 665 686 } 666 687 set _limits($fname) [list $fmin $fmax] 688 } 689 # Get limits for each component. 690 foreach cname [$dataobj components] { 691 if { ![info exists _volcomponents($cname)] } { 692 lappend _componentsList $cname 693 } 694 lappend _volcomponents($cname) $dataobj-$cname 695 array unset limits 696 array set limits [$dataobj valueLimits $cname] 697 if { ![info exists _limits($cname)] } { 698 set _limits($cname) $limits(v) 699 continue 700 } 701 foreach {min max} $limits(v) break 702 foreach {vmin vmax} $_limits($cname) break 703 if { $vmin > $min } { 704 set vmin $min 705 } 706 if { $vmax < $max } { 707 set vmax $max 708 } 709 set _limits($cname) [list $vmin $vmax] 667 710 } 668 711 } … … 939 982 PanCamera 940 983 set _first "" 941 InitSettings axis-xgrid axis-ygrid axis-zgrid axisFlyMode \ 942 axesVisible axisLabels axis-minorticks 984 InitSettings -background \ 985 -xgrid -ygrid -zgrid -axisflymode \ 986 -axesvisible -axislabels -axisminorticks 943 987 StopBufferingCommands 944 988 SendCmd "imgflush" … … 1038 1082 } 1039 1083 1040 InitSettings volume-palette\1041 volumeVisible \1042 volume-material \1043 volumeLighting volume-opacity volume-quality\1044 cutplaneVisible \1045 cutplane-xposition cutplane-yposition cutplane-zposition \1046 cutplane-xvisible cutplane-yvisible cutplane-zvisible1084 InitSettings -color \ 1085 -volumevisible \ 1086 -volumematerial \ 1087 -volumelighting -volumeopacity -volumequality -volumeoutline \ 1088 -cutplanesvisible \ 1089 -xcutplaneposition -ycutplaneposition -zcutplaneposition \ 1090 -xcutplanevisible -ycutplanevisible -zcutplanevisible 1047 1091 1048 1092 if { $_reset } { … … 1268 1312 itcl::body Rappture::VtkVolumeViewer::InitSettings { args } { 1269 1313 foreach spec $args { 1270 if { [info exists _settings($_first -$spec)] } {1314 if { [info exists _settings($_first${spec})] } { 1271 1315 # Reset global setting with dataobj specific setting 1272 set _settings($spec) $_settings($_first -$spec)1316 set _settings($spec) $_settings($_first${spec}) 1273 1317 } 1274 1318 AdjustSetting $spec … … 1288 1332 } 1289 1333 switch -- $what { 1290 "volumeVisible" { 1334 "-background" { 1335 set bgcolor [$itk_component(background) value] 1336 set _settings($what) $bgcolor 1337 array set fgcolors { 1338 "black" "white" 1339 "white" "black" 1340 "grey" "black" 1341 } 1342 configure -plotbackground $bgcolor \ 1343 -plotforeground $fgcolors($bgcolor) 1344 $itk_component(view) delete "legend" 1345 DrawLegend 1346 } 1347 "-volumeoutline" { 1348 set bool $_settings($what) 1349 SendCmd "outline visible 0" 1350 foreach tag [CurrentDatasets -visible] { 1351 SendCmd "outline visible $bool $tag" 1352 } 1353 } 1354 "-legendvisible" { 1355 set bool $_settings($what) 1356 } 1357 "-volumevisible" { 1291 1358 set bool $_settings($what) 1292 1359 foreach tag [CurrentDatasets -visible] { … … 1301 1368 } 1302 1369 } 1303 " volume-material" {1370 "-volumematerial" { 1304 1371 set val $_settings($what) 1305 1372 set diffuse [expr {0.01*$val}] … … 1312 1379 } 1313 1380 } 1314 " volumeLighting" {1381 "-volumelighting" { 1315 1382 set bool $_settings($what) 1316 1383 foreach tag [CurrentDatasets -visible] { … … 1318 1385 } 1319 1386 } 1320 " volume-opacity" {1387 "-volumeopacity" { 1321 1388 set val $_settings($what) 1322 1389 set val [expr {0.01*$val}] … … 1325 1392 } 1326 1393 } 1327 " volume-quality" {1394 "-volumequality" { 1328 1395 set val $_settings($what) 1329 1396 set val [expr {0.01*$val}] … … 1332 1399 } 1333 1400 } 1334 " axesVisible" {1401 "-axesvisible" { 1335 1402 set bool $_settings($what) 1336 1403 SendCmd "axis visible all $bool" 1337 1404 } 1338 " axisLabels" {1405 "-axislabels" { 1339 1406 set bool $_settings($what) 1340 1407 SendCmd "axis labels all $bool" 1341 1408 } 1342 " axis-minorticks" {1409 "-axisminorticks" { 1343 1410 set bool $_settings($what) 1344 1411 SendCmd "axis minticks all $bool" 1345 1412 } 1346 " axis-xgrid" - "axis-ygrid" - "axis-zgrid" {1347 set axis [string range $what 5 5]1413 "-xgrid" - "-ygrid" - "-zgrid" { 1414 set axis [string range $what 1 1] 1348 1415 set bool $_settings($what) 1349 1416 SendCmd "axis grid $axis $bool" 1350 1417 } 1351 " axisFlyMode" {1418 "-axisflymode" { 1352 1419 set mode [$itk_component(axismode) value] 1353 1420 set mode [$itk_component(axismode) translate $mode] … … 1355 1422 SendCmd "axis flymode $mode" 1356 1423 } 1357 " cutplaneVisible" {1424 "-cutplanesvisible" { 1358 1425 set bool $_settings($what) 1359 1426 foreach dataset [CurrentDatasets -visible] { … … 1361 1428 } 1362 1429 } 1363 " cutplaneLighting" {1430 "-cutplanelighting" { 1364 1431 set bool $_settings($what) 1365 1432 foreach dataset [CurrentDatasets -visible] { … … 1378 1445 } 1379 1446 } 1380 " cutplane-opacity" {1447 "-cutplaneopacity" { 1381 1448 set val $_settings($what) 1382 1449 set sval [expr { 0.01 * double($val) }] … … 1385 1452 } 1386 1453 } 1387 " cutplane-xvisible" - "cutplane-yvisible" - "cutplane-zvisible" {1388 set axis [string range $what 9 9]1454 "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" { 1455 set axis [string range $what 1 1] 1389 1456 set bool $_settings($what) 1390 1457 if { $bool } { … … 1399 1466 } 1400 1467 } 1401 " cutplane-xposition" - "cutplane-yposition" - "cutplane-zposition" {1402 set axis [string range $what 9 9]1468 "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" { 1469 set axis [string range $what 1 1] 1403 1470 set pos [expr $_settings($what) * 0.01] 1404 1471 foreach dataset [CurrentDatasets -visible] { … … 1407 1474 set _cutplanePending 0 1408 1475 } 1409 " volume-palette" {1410 set palette [$itk_component(palette) value]1411 set _settings($what) $ palette1476 "-color" { 1477 set color [$itk_component(colormap) value] 1478 set _settings($what) $color 1412 1479 foreach dataset [CurrentDatasets -visible $_first] { 1413 1480 foreach {dataobj comp} [split $dataset -] break 1414 ChangeColormap $dataobj $comp $ palette1481 ChangeColormap $dataobj $comp $color 1415 1482 } 1416 1483 set _legendPending 1 1417 1484 } 1418 " field" {1485 "-field" { 1419 1486 set label [$itk_component(field) value] 1420 1487 set fname [$itk_component(field) translate $label] … … 1575 1642 itcl::body Rappture::VtkVolumeViewer::BuildViewTab {} { 1576 1643 set font [option get $itk_component(hull) font Font] 1644 1645 set inner [$itk_component(main) insert end \ 1646 -title "View Settings" \ 1647 -icon [Rappture::icon wrench]] 1648 $inner configure -borderwidth 4 1649 1650 checkbutton $inner.axes \ 1651 -text "Axes" \ 1652 -variable [itcl::scope _settings(-axesvisible)] \ 1653 -command [itcl::code $this AdjustSetting -axesvisible] \ 1654 -font $font 1655 1656 checkbutton $inner.outline \ 1657 -text "Outline" \ 1658 -variable [itcl::scope _settings(-volumeoutline)] \ 1659 -command [itcl::code $this AdjustSetting -volumeoutline] \ 1660 -font $font 1661 1662 checkbutton $inner.legend \ 1663 -text "Legend" \ 1664 -variable [itcl::scope _settings(-legendvisible)] \ 1665 -command [itcl::code $this AdjustSetting -legendvisible] \ 1666 -font $font 1667 1668 checkbutton $inner.volume \ 1669 -text "Volume" \ 1670 -variable [itcl::scope _settings(-volumevisible)] \ 1671 -command [itcl::code $this AdjustSetting -volumevisible] \ 1672 -font $font 1673 1674 label $inner.background_l -text "Background" -font $font 1675 itk_component add background { 1676 Rappture::Combobox $inner.background -width 10 -editable no 1677 } 1678 $inner.background choices insert end \ 1679 "black" "black" \ 1680 "white" "white" \ 1681 "grey" "grey" 1682 1683 $itk_component(background) value $_settings(-background) 1684 bind $inner.background <<Value>> \ 1685 [itcl::code $this AdjustSetting -background] 1686 1687 blt::table $inner \ 1688 0,0 $inner.axes -cspan 2 -anchor w \ 1689 1,0 $inner.outline -cspan 2 -anchor w \ 1690 2,0 $inner.volume -cspan 2 -anchor w \ 1691 3,0 $inner.legend -cspan 2 -anchor w \ 1692 4,0 $inner.background_l -anchor e -pady 2 \ 1693 4,1 $inner.background -fill x \ 1694 1695 blt::table configure $inner r* -resize none 1696 blt::table configure $inner r5 -resize expand 1577 1697 } 1578 1698 … … 1580 1700 set font [option get $itk_component(hull) font Font] 1581 1701 #set bfont [option get $itk_component(hull) boldFont Font] 1702 set bfont "Arial 9 bold" 1582 1703 1583 1704 set inner [$itk_component(main) insert end \ … … 1586 1707 $inner configure -borderwidth 4 1587 1708 1588 checkbutton $inner.v olume\1709 checkbutton $inner.visibility \ 1589 1710 -text "Visible" \ 1590 1711 -font $font \ 1591 -variable [itcl::scope _settings( volumeVisible)] \1592 -command [itcl::code $this AdjustSetting volumeVisible]1712 -variable [itcl::scope _settings(-volumevisible)] \ 1713 -command [itcl::code $this AdjustSetting -volumevisible] 1593 1714 1594 1715 checkbutton $inner.lighting \ 1595 1716 -text "Enable Lighting" \ 1596 1717 -font $font \ 1597 -variable [itcl::scope _settings( volumeLighting)] \1598 -command [itcl::code $this AdjustSetting volumeLighting]1718 -variable [itcl::scope _settings(-volumelighting)] \ 1719 -command [itcl::code $this AdjustSetting -volumelighting] 1599 1720 1600 1721 label $inner.dim_l -text "Dim" -font $font 1601 1722 ::scale $inner.material -from 0 -to 100 -orient horizontal \ 1602 -variable [itcl::scope _settings( volume-material)] \1723 -variable [itcl::scope _settings(-volumematerial)] \ 1603 1724 -showvalue off \ 1604 -command [itcl::code $this AdjustSetting volume-material]1725 -command [itcl::code $this AdjustSetting -volumematerial] 1605 1726 label $inner.bright_l -text "Bright" -font $font 1606 1727 1607 1728 label $inner.opacity_l -text "Opacity" -font $font 1608 1729 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1609 -variable [itcl::scope _settings( volume-opacity)] \1730 -variable [itcl::scope _settings(-volumeopacity)] \ 1610 1731 -showvalue off \ 1611 -command [itcl::code $this AdjustSetting volume-opacity]1732 -command [itcl::code $this AdjustSetting -volumeopacity] 1612 1733 1613 1734 label $inner.quality_l -text "Quality" -font $font 1614 1735 ::scale $inner.quality -from 0 -to 100 -orient horizontal \ 1615 -variable [itcl::scope _settings( volume-quality)] \1736 -variable [itcl::scope _settings(-volumequality)] \ 1616 1737 -showvalue off \ 1617 -command [itcl::code $this AdjustSetting volume-quality]1738 -command [itcl::code $this AdjustSetting -volumequality] 1618 1739 1619 1740 label $inner.field_l -text "Field" -font $font … … 1622 1743 } 1623 1744 bind $inner.field <<Value>> \ 1624 [itcl::code $this AdjustSetting field]1625 1626 label $inner. palette_l -text "Palette" -font $font1627 itk_component add palette{1628 Rappture::Combobox $inner. palette-editable no1629 } 1630 $inner. palettechoices insert end [GetColormapList]1631 bind $inner. palette<<Value>> \1632 [itcl::code $this AdjustSetting volume-palette]1633 $itk_component( palette) value "BCGYR"1745 [itcl::code $this AdjustSetting -field] 1746 1747 label $inner.colormap_l -text "Colormap" -font $font 1748 itk_component add colormap { 1749 Rappture::Combobox $inner.colormap -editable no 1750 } 1751 $inner.colormap choices insert end [GetColormapList] 1752 bind $inner.colormap <<Value>> \ 1753 [itcl::code $this AdjustSetting -color] 1754 $itk_component(colormap) value $_settings(-color) 1634 1755 1635 1756 blt::table $inner \ 1636 0,0 $inner.field_l 1637 0,1 $inner.field -fill x-pady 2 -cspan 3 \1638 1,0 $inner.v olume-anchor w -pady 2 -cspan 4 \1639 2,0 $inner.lighting 1640 3,0 $inner.dim_l 1641 3,1 $inner.material -fill x-pady 2 -cspan 2 \1642 3,3 $inner.bright_l 1757 0,0 $inner.field_l -anchor w -pady 2 \ 1758 0,1 $inner.field -fill x -pady 2 -cspan 3 \ 1759 1,0 $inner.visibility -anchor w -pady 2 -cspan 4 \ 1760 2,0 $inner.lighting -anchor w -pady 2 -cspan 4 \ 1761 3,0 $inner.dim_l -anchor e -pady 2 \ 1762 3,1 $inner.material -fill x -pady 2 -cspan 2 \ 1763 3,3 $inner.bright_l -anchor w -pady 2 \ 1643 1764 4,0 $inner.opacity_l -anchor w -pady 2 -cspan 4 \ 1644 5,0 $inner.opacity -fill x-pady 2 -cspan 4 \1765 5,0 $inner.opacity -fill x -pady 2 -cspan 4 \ 1645 1766 6,0 $inner.quality_l -anchor w -pady 2 -cspan 4 \ 1646 7,0 $inner.quality -fill x-pady 2 -cspan 4 \1647 8,0 $inner. palette_l -anchor w -pady 2 \1648 8,1 $inner. palette -fill x-pady 2 -cspan 31767 7,0 $inner.quality -fill x -pady 2 -cspan 4 \ 1768 8,0 $inner.colormap_l -anchor w -pady 2 \ 1769 8,1 $inner.colormap -fill x -pady 2 -cspan 3 1649 1770 1650 1771 blt::table configure $inner r* c0 c1 c3 -resize none … … 1653 1774 1654 1775 itcl::body Rappture::VtkVolumeViewer::BuildAxisTab {} { 1655 set fg [option get $itk_component(hull) font Font] 1656 #set bfg [option get $itk_component(hull) boldFont Font] 1776 set font [option get $itk_component(hull) font Font] 1657 1777 1658 1778 set inner [$itk_component(main) insert end \ … … 1663 1783 checkbutton $inner.visible \ 1664 1784 -text "Axes" \ 1665 -variable [itcl::scope _settings( axesVisible)] \1666 -command [itcl::code $this AdjustSetting axesVisible] \1667 -font "Arial 9"1785 -variable [itcl::scope _settings(-axesvisible)] \ 1786 -command [itcl::code $this AdjustSetting -axesvisible] \ 1787 -font $font 1668 1788 1669 1789 checkbutton $inner.labels \ 1670 1790 -text "Axis Labels" \ 1671 -variable [itcl::scope _settings( axisLabels)] \1672 -command [itcl::code $this AdjustSetting axisLabels] \1673 -font "Arial 9"1674 label $inner.grid_l -text "Grid" -font "Arial 9"1791 -variable [itcl::scope _settings(-axislabels)] \ 1792 -command [itcl::code $this AdjustSetting -axislabels] \ 1793 -font $font 1794 label $inner.grid_l -text "Grid" -font $font 1675 1795 checkbutton $inner.xgrid \ 1676 1796 -text "X" \ 1677 -variable [itcl::scope _settings( axis-xgrid)] \1678 -command [itcl::code $this AdjustSetting axis-xgrid] \1679 -font "Arial 9"1797 -variable [itcl::scope _settings(-xgrid)] \ 1798 -command [itcl::code $this AdjustSetting -xgrid] \ 1799 -font $font 1680 1800 checkbutton $inner.ygrid \ 1681 1801 -text "Y" \ 1682 -variable [itcl::scope _settings( axis-ygrid)] \1683 -command [itcl::code $this AdjustSetting axis-ygrid] \1684 -font "Arial 9"1802 -variable [itcl::scope _settings(-ygrid)] \ 1803 -command [itcl::code $this AdjustSetting -ygrid] \ 1804 -font $font 1685 1805 checkbutton $inner.zgrid \ 1686 1806 -text "Z" \ 1687 -variable [itcl::scope _settings( axis-zgrid)] \1688 -command [itcl::code $this AdjustSetting axis-zgrid] \1689 -font "Arial 9"1807 -variable [itcl::scope _settings(-zgrid)] \ 1808 -command [itcl::code $this AdjustSetting -zgrid] \ 1809 -font $font 1690 1810 checkbutton $inner.minorticks \ 1691 1811 -text "Minor Ticks" \ 1692 -variable [itcl::scope _settings( axis-minorticks)] \1693 -command [itcl::code $this AdjustSetting axis-minorticks] \1694 -font "Arial 9"1695 1696 label $inner.mode_l -text "Mode" -font "Arial 9"1812 -variable [itcl::scope _settings(-axisminorticks)] \ 1813 -command [itcl::code $this AdjustSetting -axisminorticks] \ 1814 -font $font 1815 1816 label $inner.mode_l -text "Mode" -font $font 1697 1817 1698 1818 itk_component add axismode { … … 1704 1824 "furthest_triad" "farthest" \ 1705 1825 "outer_edges" "outer" 1706 $itk_component(axismode) value "static"1707 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting axisFlyMode]1826 $itk_component(axismode) value $_settings(-axisflymode) 1827 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axisflymode] 1708 1828 1709 1829 blt::table $inner \ 1710 1830 0,0 $inner.visible -anchor w -cspan 4 \ 1711 1,0 $inner.labels 1712 2,0 $inner.minorticks 1713 4,0 $inner.grid_l 1714 4,1 $inner.xgrid 1715 4,2 $inner.ygrid 1716 4,3 $inner.zgrid 1717 5,0 $inner.mode_l 1718 5,1 $inner.mode -fill x-cspan 31831 1,0 $inner.labels -anchor w -cspan 4 \ 1832 2,0 $inner.minorticks -anchor w -cspan 4 \ 1833 4,0 $inner.grid_l -anchor w \ 1834 4,1 $inner.xgrid -anchor w \ 1835 4,2 $inner.ygrid -anchor w \ 1836 4,3 $inner.zgrid -anchor w \ 1837 5,0 $inner.mode_l -anchor w -padx { 2 0 } \ 1838 5,1 $inner.mode -fill x -cspan 3 1719 1839 1720 1840 blt::table configure $inner r* c* -resize none … … 1724 1844 1725 1845 itcl::body Rappture::VtkVolumeViewer::BuildCameraTab {} { 1846 set font [option get $itk_component(hull) font Font] 1726 1847 set inner [$itk_component(main) insert end \ 1727 1848 -title "Camera Settings" \ … … 1729 1850 $inner configure -borderwidth 4 1730 1851 1731 label $inner.view_l -text "view" -font "Arial 9"1852 label $inner.view_l -text "view" -font $font 1732 1853 set f [frame $inner.view] 1733 1854 foreach side { front back left right top bottom } { … … 1745 1866 set labels { qx qy qz qw xpan ypan zoom } 1746 1867 foreach tag $labels { 1747 label $inner.${tag}label -text $tag -font "Arial 9"1748 entry $inner.${tag} -font "Arial 9"-bg white \1868 label $inner.${tag}label -text $tag -font $font 1869 entry $inner.${tag} -font $font -bg white \ 1749 1870 -textvariable [itcl::scope _view(-$tag)] 1750 1871 bind $inner.${tag} <Return> \ … … 1762 1883 -variable [itcl::scope _view(-ortho)] \ 1763 1884 -command [itcl::code $this camera set -ortho] \ 1764 -font "Arial 9"1885 -font $font 1765 1886 blt::table $inner \ 1766 1887 $row,0 $inner.ortho -cspan 2 -anchor w -pady 2 … … 1784 1905 checkbutton $inner.visible \ 1785 1906 -text "Show Cutplanes" \ 1786 -variable [itcl::scope _settings( cutplaneVisible)] \1787 -command [itcl::code $this AdjustSetting cutplaneVisible] \1788 -font "Arial 9"1907 -variable [itcl::scope _settings(-cutplanesvisible)] \ 1908 -command [itcl::code $this AdjustSetting -cutplanesvisible] \ 1909 -font $font 1789 1910 1790 1911 checkbutton $inner.lighting \ 1791 1912 -text "Enable Lighting" \ 1792 -variable [itcl::scope _settings( cutplaneLighting)] \1793 -command [itcl::code $this AdjustSetting cutplaneLighting] \1794 -font "Arial 9"1795 1796 label $inner.opacity_l -text "Opacity" -font "Arial 9"1913 -variable [itcl::scope _settings(-cutplanelighting)] \ 1914 -command [itcl::code $this AdjustSetting -cutplanelighting] \ 1915 -font $font 1916 1917 label $inner.opacity_l -text "Opacity" -font $font 1797 1918 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1798 -variable [itcl::scope _settings( cutplane-opacity)] \1919 -variable [itcl::scope _settings(-cutplaneopacity)] \ 1799 1920 -width 10 \ 1800 1921 -showvalue off \ 1801 -command [itcl::code $this AdjustSetting cutplane-opacity]1802 $inner.opacity set $_settings( cutplane-opacity)1922 -command [itcl::code $this AdjustSetting -cutplaneopacity] 1923 $inner.opacity set $_settings(-cutplaneopacity) 1803 1924 1804 1925 # X-value slicer... … … 1807 1928 -onimage [Rappture::icon x-cutplane] \ 1808 1929 -offimage [Rappture::icon x-cutplane] \ 1809 -command [itcl::code $this AdjustSetting cutplane-xvisible] \1810 -variable [itcl::scope _settings( cutplane-xvisible)]1930 -command [itcl::code $this AdjustSetting -xcutplanevisible] \ 1931 -variable [itcl::scope _settings(-xcutplanevisible)] 1811 1932 } 1812 1933 Rappture::Tooltip::for $itk_component(xCutButton) \ … … 1819 1940 -borderwidth 1 -highlightthickness 0 \ 1820 1941 -command [itcl::code $this EventuallySetCutplane x] \ 1821 -variable [itcl::scope _settings( cutplane-xposition)]1942 -variable [itcl::scope _settings(-xcutplaneposition)] 1822 1943 } { 1823 1944 usual … … 1835 1956 -onimage [Rappture::icon y-cutplane] \ 1836 1957 -offimage [Rappture::icon y-cutplane] \ 1837 -command [itcl::code $this AdjustSetting cutplane-yvisible] \1838 -variable [itcl::scope _settings( cutplane-yvisible)]1958 -command [itcl::code $this AdjustSetting -ycutplanevisible] \ 1959 -variable [itcl::scope _settings(-ycutplanevisible)] 1839 1960 } 1840 1961 Rappture::Tooltip::for $itk_component(yCutButton) \ … … 1847 1968 -borderwidth 1 -highlightthickness 0 \ 1848 1969 -command [itcl::code $this EventuallySetCutplane y] \ 1849 -variable [itcl::scope _settings( cutplane-yposition)]1970 -variable [itcl::scope _settings(-ycutplaneposition)] 1850 1971 } { 1851 1972 usual … … 1863 1984 -onimage [Rappture::icon z-cutplane] \ 1864 1985 -offimage [Rappture::icon z-cutplane] \ 1865 -command [itcl::code $this AdjustSetting cutplane-zvisible] \1866 -variable [itcl::scope _settings( cutplane-zvisible)]1986 -command [itcl::code $this AdjustSetting -zcutplanevisible] \ 1987 -variable [itcl::scope _settings(-zcutplanevisible)] 1867 1988 } 1868 1989 Rappture::Tooltip::for $itk_component(zCutButton) \ … … 1875 1996 -borderwidth 1 -highlightthickness 0 \ 1876 1997 -command [itcl::code $this EventuallySetCutplane z] \ 1877 -variable [itcl::scope _settings( cutplane-zposition)]1998 -variable [itcl::scope _settings(-zcutplaneposition)] 1878 1999 } { 1879 2000 usual … … 2014 2135 } 2015 2136 array set style [$dataobj style $cname] 2016 set _settings(volumeLighting) $style(-lighting) 2017 set _settings(volume-opacity) [expr $style(-opacity) * 100] 2018 set _settings(volumeVisible) $style(-visible) 2019 2020 $itk_component(palette) value $style(-color) 2137 set _settings(-volumelighting) $style(-lighting) 2138 set _settings(-volumeopacity) [expr $style(-opacity) * 100.0] 2139 set _settings(-volumeoutline) $style(-outline) 2140 set _settings(-volumevisible) $style(-visible) 2141 2142 $itk_component(colormap) value $style(-color) 2021 2143 2022 2144 SendCmd "outline add $tag" … … 2032 2154 SendCmd "volume opacity $style(-opacity) $tag" 2033 2155 SendCmd "volume visible $style(-visible) $tag" 2034 2035 2156 SetColormap $dataobj $cname 2036 2157 } … … 2087 2208 set title $fname 2088 2209 } 2089 if { $_settings( legendVisible) } {2210 if { $_settings(-legendvisible) } { 2090 2211 set x [expr $w - 2] 2091 2212 if { [$c find withtag "legend"] == "" } { … … 2265 2386 invoke { 2266 2387 $itk_component(field) value $_curFldLabel 2267 AdjustSetting field2388 AdjustSetting -field 2268 2389 } 2269 2390 default { … … 2293 2414 set _view(-zoom) 1.0 2294 2415 } 2416 2417 # 2418 # GetDatasetsWithComponents -- 2419 # 2420 # Returns a list of all the datasets (known by the combination of 2421 # their data object and component name) that match the given 2422 # component name. For example, this is used where we want to change 2423 # the settings of volumes that have the current component. 2424 # 2425 itcl::body Rappture::VtkVolumeViewer::GetDatasetsWithComponent { cname } { 2426 if { ![info exists _volcomponents($cname)] } { 2427 return "" 2428 } 2429 return $_volcomponents($cname) 2430 }
Note: See TracChangeset
for help on using the changeset viewer.