Changeset 4444
- Timestamp:
- Jun 27, 2014, 2:56:21 AM (10 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkglyphviewer.tcl
r4441 r4444 217 217 218 218 array set _settings [subst { 219 background black 220 colormap BCGYR 221 colormapVisible 1 222 field "Default" 223 axesVisible 1 224 axisLabelsVisible 1 225 axisXGrid 0 226 axisYGrid 0 227 axisZGrid 0 228 cutplaneEdges 0 229 cutplaneLighting 1 230 cutplanePreinterp 1 231 cutplaneOpacity 100 232 cutplaneVisible 0 233 cutplaneWireframe 0 234 cutplaneXPosition 50 235 cutplaneXVisible 1 236 cutplaneYPosition 50 237 cutplaneYVisible 1 238 cutplaneZPosition 50 239 cutplaneZVisible 1 240 glyphEdges 0 241 glyphLighting 1 242 glyphNormscale 1 243 glyphOpacity 100 244 saveGlyphOpacity 100 245 glyphOrient 1 246 glyphOutline 0 247 glyphScale 1 248 glyphScaleMode "vmag" 249 glyphShape "arrow" 250 glyphVisible 1 251 glyphWireframe 0 252 legendVisible 1 219 -axesvisible 1 220 -axislabelsvisible 1 221 -axismode "static" 222 -background black 223 -colormap BCGYR 224 -colormapvisible 1 225 -cutplaneedges 0 226 -cutplanelighting 1 227 -cutplanepreinterp 1 228 -cutplaneopacity 100 229 -cutplanevisible 0 230 -cutplanewireframe 0 231 -cutplanexposition 50 232 -cutplanexvisible 1 233 -cutplaneyposition 50 234 -cutplaneyvisible 1 235 -cutplanezposition 50 236 -cutplanezvisible 1 237 -field "Default" 238 -glyphedges 0 239 -glyphlighting 1 240 -glyphnormscale 1 241 -glyphopacity 100 242 -glyphorient 1 243 -glyphoutline 0 244 -glyphscale 1 245 -glyphscalemode "vmag" 246 -glyphshape "arrow" 247 -glyphvisible 1 248 -glyphwireframe 0 249 -legendvisible 1 250 -saveglyphopacity 100 251 -xgrid 0 252 -ygrid 0 253 -zgrid 0 253 254 }] 254 255 array set _changed { 255 glyphOpacity0256 colormap0256 -colormap 0 257 -glyphopacity 0 257 258 } 258 259 … … 334 335 -onimage [Rappture::icon volume-on] \ 335 336 -offimage [Rappture::icon volume-off] \ 336 -variable [itcl::scope _settings( glyphVisible)] \337 -command [itcl::code $this AdjustSetting glyphVisible]337 -variable [itcl::scope _settings(-glyphvisible)] \ 338 -command [itcl::code $this AdjustSetting -glyphvisible] 338 339 } 339 340 $itk_component(glyphs) select … … 347 348 -onimage [Rappture::icon cutbutton] \ 348 349 -offimage [Rappture::icon cutbutton] \ 349 -variable [itcl::scope _settings( cutplaneVisible)] \350 -command [itcl::code $this AdjustSetting cutplaneVisible]350 -variable [itcl::scope _settings(-cutplanevisible)] \ 351 -command [itcl::code $this AdjustSetting -cutplanevisible] 351 352 } 352 353 Rappture::Tooltip::for $itk_component(cutplane) \ … … 954 955 PanCamera 955 956 set _first "" 956 InitSettings axisXGrid axisYGrid axisZGrid axisMode \957 axesVisible axisLabelsVisible957 InitSettings -xgrid -ygrid -zgrid -axismode \ 958 -axesvisible -axislabelsvisible 958 959 foreach axis { x y z } { 959 960 SendCmd "axis lformat $axis %g" … … 1034 1035 $itk_component(field) value $_curFldLabel 1035 1036 } 1036 InitSettings glyphOutline1037 # cutplaneVisible1037 InitSettings -glyphoutline 1038 #-cutplanevisible 1038 1039 if { $_reset } { 1039 1040 # These are settings that rely on a dataset being loaded. 1040 1041 InitSettings \ 1041 glyphLighting \1042 field \1043 glyphEdges glyphLighting glyphOpacity \1044 glyphWireframe1045 1046 # cutplaneXPosition cutplaneYPosition cutplaneZPosition \1047 cutplaneXVisible cutplaneYVisible cutplaneZVisible \1048 cutplanePreinterp1042 -glyphlighting \ 1043 -field \ 1044 -glyphedges -glyphlighting -glyphopacity \ 1045 -glyphwireframe 1046 1047 #-cutplanexposition -cutplaneyposition -cutplanezposition \ 1048 -cutplanexvisible -cutplaneyvisible -cutplanezvisible \ 1049 -cutplanepreinterp 1049 1050 1050 1051 Zoom reset … … 1286 1287 itcl::body Rappture::VtkGlyphViewer::InitSettings { args } { 1287 1288 foreach spec $args { 1288 if { [info exists _settings($_first -$spec)] } {1289 if { [info exists _settings($_first${spec})] } { 1289 1290 # Reset global setting with dataobj specific setting 1290 set _settings($spec) $_settings($_first -$spec)1291 set _settings($spec) $_settings($_first${spec}) 1291 1292 } 1292 1293 AdjustSetting $spec … … 1306 1307 } 1307 1308 switch -- $what { 1308 " background" {1309 "-background" { 1309 1310 set bgcolor [$itk_component(background) value] 1310 1311 array set fgcolors { … … 1318 1319 DrawLegend 1319 1320 } 1320 " axesVisible" {1321 "-axesvisible" { 1321 1322 set bool $_settings($what) 1322 1323 SendCmd "axis visible all $bool" 1323 1324 } 1324 " axisLabelsVisible" {1325 "-axislabelsvisible" { 1325 1326 set bool $_settings($what) 1326 1327 SendCmd "axis labels all $bool" 1327 1328 } 1328 " axisXGrid" - "axisYGrid" - "axisZGrid" {1329 set axis [string tolower [string range $what 4 4]]1329 "-xgrid" - "-ygrid" - "-zgrid" { 1330 set axis [string tolower [string range $what 1 1]] 1330 1331 set bool $_settings($what) 1331 1332 SendCmd "axis grid $axis $bool" 1332 1333 } 1333 " axisMode" {1334 "-axismode" { 1334 1335 set mode [$itk_component(axisMode) value] 1335 1336 set mode [$itk_component(axisMode) translate $mode] … … 1337 1338 SendCmd "axis flymode $mode" 1338 1339 } 1339 " cutplaneEdges" {1340 "-cutplaneedges" { 1340 1341 set bool $_settings($what) 1341 1342 SendCmd "cutplane edges $bool" 1342 1343 } 1343 " cutplaneVisible" {1344 "-cutplanevisible" { 1344 1345 set bool $_settings($what) 1345 1346 SendCmd "cutplane visible $bool" 1346 1347 } 1347 " cutplaneWireframe" {1348 "-cutplanewireframe" { 1348 1349 set bool $_settings($what) 1349 1350 SendCmd "cutplane wireframe $bool" 1350 1351 } 1351 " cutplaneLighting" {1352 "-cutplanelighting" { 1352 1353 set bool $_settings($what) 1353 1354 SendCmd "cutplane lighting $bool" 1354 1355 } 1355 " cutplaneOpacity" {1356 "-cutplaneopacity" { 1356 1357 set val $_settings($what) 1357 1358 set sval [expr { 0.01 * double($val) }] 1358 1359 SendCmd "cutplane opacity $sval" 1359 1360 } 1360 " cutplanePreinterp" {1361 "-cutplanepreinterp" { 1361 1362 set bool $_settings($what) 1362 1363 SendCmd "cutplane preinterp $bool" 1363 1364 } 1364 " cutplaneXVisible" - "cutplaneYVisible" - "cutplaneZVisible" {1365 set axis [string tolower [string range $what 8 8]]1365 "-cutplanexvisible" - "-cutplaneyvisible" - "-cutplanezvisible" { 1366 set axis [string tolower [string range $what 9 9]] 1366 1367 set bool $_settings($what) 1367 1368 if { $bool } { … … 1374 1375 SendCmd "cutplane axis $axis $bool" 1375 1376 } 1376 " cutplaneXPosition" - "cutplaneYPosition" - "cutplaneZPosition" {1377 set axis [string tolower [string range $what 8 8]]1377 "-cutplanexposition" - "-cutplaneyposition" - "-cutplanezposition" { 1378 set axis [string tolower [string range $what 9 9]] 1378 1379 set pos [expr $_settings($what) * 0.01] 1379 1380 SendCmd "cutplane slice ${axis} ${pos}" 1380 1381 set _cutplanePending 0 1381 1382 } 1382 " colormap" {1383 "-colormap" { 1383 1384 set _changed($what) 1 1384 1385 StartBufferingCommands … … 1386 1387 set _settings($what) $color 1387 1388 if { $color == "none" } { 1388 if { $_settings( colormapVisible) } {1389 if { $_settings(-colormapvisible) } { 1389 1390 SendCmd "glyphs colormode constant {}" 1390 set _settings( colormapVisible) 01391 set _settings(-colormapvisible) 0 1391 1392 } 1392 1393 } else { 1393 if { !$_settings( colormapVisible) } {1394 if { !$_settings(-colormapvisible) } { 1394 1395 SendCmd "glyphs colormode $_colorMode $_curFldName" 1395 set _settings( colormapVisible) 11396 set _settings(-colormapvisible) 1 1396 1397 } 1397 1398 SetCurrentColormap $color … … 1400 1401 EventuallyRequestLegend 1401 1402 } 1402 " glyphWireframe" {1403 "-glyphwireframe" { 1403 1404 set bool $_settings($what) 1404 1405 SendCmd "glyphs wireframe $bool" 1405 1406 } 1406 " glyphVisible" {1407 "-glyphvisible" { 1407 1408 set bool $_settings($what) 1408 1409 SendCmd "glyphs visible $bool" … … 1416 1417 DrawLegend 1417 1418 } 1418 " glyphLighting" {1419 "-glyphlighting" { 1419 1420 set bool $_settings($what) 1420 1421 SendCmd "glyphs lighting $bool" 1421 1422 } 1422 " glyphEdges" {1423 "-glyphedges" { 1423 1424 set bool $_settings($what) 1424 1425 SendCmd "glyphs edges $bool" … … 1428 1429 SendCmd "outline visible $bool" 1429 1430 } 1430 " glyphOpacity" {1431 "-glyphopacity" { 1431 1432 set val $_settings($what) 1432 1433 set sval [expr { 0.01 * double($val) }] 1433 1434 SendCmd "glyphs opacity $sval" 1434 1435 } 1435 " glyphNormscale" {1436 "-glyphnormscale" { 1436 1437 set bool $_settings($what) 1437 1438 SendCmd "glyphs normscale $bool" 1438 1439 } 1439 " glyphOrient" {1440 "-glyphorient" { 1440 1441 set bool $_settings($what) 1441 1442 SendCmd "glyphs gorient $bool {}" 1442 1443 } 1443 " glyphScale" {1444 "-glyphscale" { 1444 1445 set val $_settings($what) 1445 1446 SendCmd "glyphs gscale $val" 1446 1447 } 1447 " glyphScaleMode" {1448 "-glyphscalemode" { 1448 1449 set label [$itk_component(scaleMode) value] 1449 1450 set mode [$itk_component(scaleMode) translate $label] … … 1451 1452 SendCmd "glyphs smode $mode {}" 1452 1453 } 1453 " glyphShape" {1454 "-glyphshape" { 1454 1455 set label [$itk_component(gshape) value] 1455 1456 set shape [$itk_component(gshape) translate $label] … … 1457 1458 SendCmd "glyphs shape $shape" 1458 1459 } 1459 " field" {1460 "-field" { 1460 1461 set label [$itk_component(field) value] 1461 1462 set fname [$itk_component(field) translate $label] … … 1483 1484 DrawLegend 1484 1485 } 1485 " legendVisible" {1486 "-legendvisible" { 1486 1487 if { !$_settings($what) } { 1487 1488 $itk_component(view) delete legend … … 1586 1587 checkbutton $inner.glyphs \ 1587 1588 -text "Glyphs" \ 1588 -variable [itcl::scope _settings( glyphVisible)] \1589 -command [itcl::code $this AdjustSetting glyphVisible] \1589 -variable [itcl::scope _settings(-glyphvisible)] \ 1590 -command [itcl::code $this AdjustSetting -glyphvisible] \ 1590 1591 -font "Arial 9" 1591 1592 … … 1607 1608 "tetrahedron" "tetrahedron" 1608 1609 1609 $itk_component(gshape) value $_settings( glyphShape)1610 bind $inner.gshape <<Value>> [itcl::code $this AdjustSetting glyphShape]1610 $itk_component(gshape) value $_settings(-glyphshape) 1611 bind $inner.gshape <<Value>> [itcl::code $this AdjustSetting -glyphshape] 1611 1612 1612 1613 label $inner.scaleMode_l -text "Scale by" -font "Arial 9" … … 1620 1621 "off" "Constant size" 1621 1622 1622 $itk_component(scaleMode) value "[$itk_component(scaleMode) label $_settings( glyphScaleMode)]"1623 bind $inner.scaleMode <<Value>> [itcl::code $this AdjustSetting glyphScaleMode]1623 $itk_component(scaleMode) value "[$itk_component(scaleMode) label $_settings(-glyphscalemode)]" 1624 bind $inner.scaleMode <<Value>> [itcl::code $this AdjustSetting -glyphscalemode] 1624 1625 1625 1626 checkbutton $inner.normscale \ 1626 1627 -text "Normalize scaling" \ 1627 -variable [itcl::scope _settings( glyphNormscale)] \1628 -command [itcl::code $this AdjustSetting glyphNormscale] \1628 -variable [itcl::scope _settings(-glyphnormscale)] \ 1629 -command [itcl::code $this AdjustSetting -glyphnormscale] \ 1629 1630 -font "Arial 9" 1630 1631 Rappture::Tooltip::for $inner.normscale "If enabled, field values are normalized to \[0,1\] before scaling and scale factor is relative to a default size" … … 1632 1633 checkbutton $inner.gorient \ 1633 1634 -text "Orient" \ 1634 -variable [itcl::scope _settings( glyphOrient)] \1635 -command [itcl::code $this AdjustSetting glyphOrient] \1635 -variable [itcl::scope _settings(-glyphorient)] \ 1636 -command [itcl::code $this AdjustSetting -glyphorient] \ 1636 1637 -font "Arial 9" 1637 1638 Rappture::Tooltip::for $inner.gorient "Orient glyphs by vector field directions" … … 1639 1640 checkbutton $inner.wireframe \ 1640 1641 -text "Wireframe" \ 1641 -variable [itcl::scope _settings( glyphWireframe)] \1642 -command [itcl::code $this AdjustSetting glyphWireframe] \1642 -variable [itcl::scope _settings(-glyphwireframe)] \ 1643 -command [itcl::code $this AdjustSetting -glyphwireframe] \ 1643 1644 -font "Arial 9" 1644 1645 1645 1646 checkbutton $inner.lighting \ 1646 1647 -text "Enable Lighting" \ 1647 -variable [itcl::scope _settings( glyphLighting)] \1648 -command [itcl::code $this AdjustSetting glyphLighting] \1648 -variable [itcl::scope _settings(-glyphlighting)] \ 1649 -command [itcl::code $this AdjustSetting -glyphlighting] \ 1649 1650 -font "Arial 9" 1650 1651 1651 1652 checkbutton $inner.edges \ 1652 1653 -text "Edges" \ 1653 -variable [itcl::scope _settings( glyphEdges)] \1654 -command [itcl::code $this AdjustSetting glyphEdges] \1654 -variable [itcl::scope _settings(-glyphedges)] \ 1655 -command [itcl::code $this AdjustSetting -glyphedges] \ 1655 1656 -font "Arial 9" 1656 1657 1657 1658 checkbutton $inner.outline \ 1658 1659 -text "Outline" \ 1659 -variable [itcl::scope _settings( glyphOutline)] \1660 -command [itcl::code $this AdjustSetting glyphOutline] \1660 -variable [itcl::scope _settings(-glyphoutline)] \ 1661 -command [itcl::code $this AdjustSetting -glyphoutline] \ 1661 1662 -font "Arial 9" 1662 1663 1663 1664 checkbutton $inner.legend \ 1664 1665 -text "Legend" \ 1665 -variable [itcl::scope _settings( legendVisible)] \1666 -command [itcl::code $this AdjustSetting legendVisible] \1666 -variable [itcl::scope _settings(-legendvisible)] \ 1667 -command [itcl::code $this AdjustSetting -legendvisible] \ 1667 1668 -font "Arial 9" 1668 1669 … … 1676 1677 "grey" "grey" 1677 1678 1678 $itk_component(background) value $_settings( background)1679 bind $inner.background <<Value>> [itcl::code $this AdjustSetting background]1679 $itk_component(background) value $_settings(-background) 1680 bind $inner.background <<Value>> [itcl::code $this AdjustSetting -background] 1680 1681 1681 1682 label $inner.opacity_l -text "Opacity" -font "Arial 9" 1682 1683 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1683 -variable [itcl::scope _settings( glyphOpacity)] \1684 -variable [itcl::scope _settings(-glyphopacity)] \ 1684 1685 -width 10 \ 1685 1686 -showvalue off \ 1686 -command [itcl::code $this AdjustSetting glyphOpacity]1687 -command [itcl::code $this AdjustSetting -glyphopacity] 1687 1688 1688 1689 label $inner.gscale_l -text "Scale factor" -font "Arial 9" 1689 1690 if {0} { 1690 1691 ::scale $inner.gscale -from 1 -to 100 -orient horizontal \ 1691 -variable [itcl::scope _settings( glyphScale)] \1692 -variable [itcl::scope _settings(-glyphscale)] \ 1692 1693 -width 10 \ 1693 1694 -showvalue off \ 1694 -command [itcl::code $this AdjustSetting glyphScale]1695 -command [itcl::code $this AdjustSetting -glyphscale] 1695 1696 } else { 1696 1697 itk_component add gscale { 1697 1698 entry $inner.gscale -font "Arial 9" -bg white \ 1698 -textvariable [itcl::scope _settings( glyphScale)]1699 -textvariable [itcl::scope _settings(-glyphscale)] 1699 1700 } { 1700 1701 ignore -font -background 1701 1702 } 1702 1703 bind $inner.gscale <Return> \ 1703 [itcl::code $this AdjustSetting glyphScale]1704 [itcl::code $this AdjustSetting -glyphscale] 1704 1705 bind $inner.gscale <KP_Enter> \ 1705 [itcl::code $this AdjustSetting glyphScale]1706 [itcl::code $this AdjustSetting -glyphscale] 1706 1707 } 1707 1708 Rappture::Tooltip::for $inner.gscale "Set scaling multiplier (or constant size)" … … 1725 1726 $itk_component(colormap) value "BCGYR" 1726 1727 bind $inner.colormap <<Value>> \ 1727 [itcl::code $this AdjustSetting colormap]1728 [itcl::code $this AdjustSetting -colormap] 1728 1729 1729 1730 blt::table $inner \ … … 1766 1767 checkbutton $inner.visible \ 1767 1768 -text "Show Axes" \ 1768 -variable [itcl::scope _settings( axesVisible)] \1769 -command [itcl::code $this AdjustSetting axesVisible] \1769 -variable [itcl::scope _settings(-axesvisible)] \ 1770 -command [itcl::code $this AdjustSetting -axesvisible] \ 1770 1771 -font "Arial 9" 1771 1772 1772 1773 checkbutton $inner.labels \ 1773 1774 -text "Show Axis Labels" \ 1774 -variable [itcl::scope _settings( axisLabelsVisible)] \1775 -command [itcl::code $this AdjustSetting axisLabelsVisible] \1775 -variable [itcl::scope _settings(-axislabelsvisible)] \ 1776 -command [itcl::code $this AdjustSetting -axislabelsvisible] \ 1776 1777 -font "Arial 9" 1777 1778 1778 1779 checkbutton $inner.gridx \ 1779 1780 -text "Show X Grid" \ 1780 -variable [itcl::scope _settings( axisXGrid)] \1781 -command [itcl::code $this AdjustSetting axisXGrid] \1781 -variable [itcl::scope _settings(-xgrid)] \ 1782 -command [itcl::code $this AdjustSetting -xgrid] \ 1782 1783 -font "Arial 9" 1783 1784 checkbutton $inner.gridy \ 1784 1785 -text "Show Y Grid" \ 1785 -variable [itcl::scope _settings( axisYGrid)] \1786 -command [itcl::code $this AdjustSetting axisYGrid] \1786 -variable [itcl::scope _settings(-ygrid)] \ 1787 -command [itcl::code $this AdjustSetting -ygrid] \ 1787 1788 -font "Arial 9" 1788 1789 checkbutton $inner.gridz \ 1789 1790 -text "Show Z Grid" \ 1790 -variable [itcl::scope _settings( axisZGrid)] \1791 -command [itcl::code $this AdjustSetting axisZGrid] \1791 -variable [itcl::scope _settings(-zgrid)] \ 1792 -command [itcl::code $this AdjustSetting -zgrid] \ 1792 1793 -font "Arial 9" 1793 1794 … … 1802 1803 "furthest_triad" "farthest" \ 1803 1804 "outer_edges" "outer" 1804 $itk_component(axisMode) value "static"1805 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting axisMode]1805 $itk_component(axisMode) value $_settings(-axismode) 1806 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axismode] 1806 1807 1807 1808 blt::table $inner \ … … 1879 1880 checkbutton $inner.visible \ 1880 1881 -text "Cutplanes" \ 1881 -variable [itcl::scope _settings( cutplaneVisible)] \1882 -command [itcl::code $this AdjustSetting cutplaneVisible] \1882 -variable [itcl::scope _settings(-cutplanevisible)] \ 1883 -command [itcl::code $this AdjustSetting -cutplanevisible] \ 1883 1884 -font "Arial 9" 1884 1885 1885 1886 checkbutton $inner.wireframe \ 1886 1887 -text "Wireframe" \ 1887 -variable [itcl::scope _settings( cutplaneWireframe)] \1888 -command [itcl::code $this AdjustSetting cutplaneWireframe] \1888 -variable [itcl::scope _settings(-cutplanewireframe)] \ 1889 -command [itcl::code $this AdjustSetting -cutplanewireframe] \ 1889 1890 -font "Arial 9" 1890 1891 1891 1892 checkbutton $inner.lighting \ 1892 1893 -text "Enable Lighting" \ 1893 -variable [itcl::scope _settings( cutplaneLighting)] \1894 -command [itcl::code $this AdjustSetting cutplaneLighting] \1894 -variable [itcl::scope _settings(-cutplanelighting)] \ 1895 -command [itcl::code $this AdjustSetting -cutplanelighting] \ 1895 1896 -font "Arial 9" 1896 1897 1897 1898 checkbutton $inner.edges \ 1898 1899 -text "Edges" \ 1899 -variable [itcl::scope _settings( cutplaneEdges)] \1900 -command [itcl::code $this AdjustSetting cutplaneEdges] \1900 -variable [itcl::scope _settings(-cutplaneedges)] \ 1901 -command [itcl::code $this AdjustSetting -cutplaneedges] \ 1901 1902 -font "Arial 9" 1902 1903 1903 1904 checkbutton $inner.preinterp \ 1904 1905 -text "Interpolate Scalars" \ 1905 -variable [itcl::scope _settings( cutplanePreinterp)] \1906 -command [itcl::code $this AdjustSetting cutplanePreinterp] \1906 -variable [itcl::scope _settings(-cutplanepreinterp)] \ 1907 -command [itcl::code $this AdjustSetting -cutplanepreinterp] \ 1907 1908 -font "Arial 9" 1908 1909 1909 1910 label $inner.opacity_l -text "Opacity" -font "Arial 9" 1910 1911 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1911 -variable [itcl::scope _settings( cutplaneOpacity)] \1912 -variable [itcl::scope _settings(-cutplaneopacity)] \ 1912 1913 -width 10 \ 1913 1914 -showvalue off \ 1914 -command [itcl::code $this AdjustSetting cutplaneOpacity]1915 $inner.opacity set $_settings( cutplaneOpacity)1915 -command [itcl::code $this AdjustSetting -cutplaneopacity] 1916 $inner.opacity set $_settings(-cutplaneopacity) 1916 1917 1917 1918 # X-value slicer... … … 1920 1921 -onimage [Rappture::icon x-cutplane-red] \ 1921 1922 -offimage [Rappture::icon x-cutplane-red] \ 1922 -command [itcl::code $this AdjustSetting cutplaneXVisible] \1923 -variable [itcl::scope _settings( cutplaneXVisible)] \1923 -command [itcl::code $this AdjustSetting -cutplanexvisible] \ 1924 -variable [itcl::scope _settings(-cutplanexvisible)] \ 1924 1925 } 1925 1926 Rappture::Tooltip::for $itk_component(xbutton) \ … … 1931 1932 -borderwidth 1 -highlightthickness 0 \ 1932 1933 -command [itcl::code $this EventuallySetCutplane x] \ 1933 -variable [itcl::scope _settings( cutplaneXPosition)] \1934 -variable [itcl::scope _settings(-cutplanexposition)] \ 1934 1935 -foreground red2 -font "Arial 9 bold" 1935 1936 } { … … 1948 1949 -onimage [Rappture::icon y-cutplane-green] \ 1949 1950 -offimage [Rappture::icon y-cutplane-green] \ 1950 -command [itcl::code $this AdjustSetting cutplaneYVisible] \1951 -variable [itcl::scope _settings( cutplaneYVisible)] \1951 -command [itcl::code $this AdjustSetting -cutplaneyvisible] \ 1952 -variable [itcl::scope _settings(-cutplaneyvisible)] \ 1952 1953 } 1953 1954 Rappture::Tooltip::for $itk_component(ybutton) \ … … 1960 1961 -borderwidth 1 -highlightthickness 0 \ 1961 1962 -command [itcl::code $this EventuallySetCutplane y] \ 1962 -variable [itcl::scope _settings( cutplaneYPosition)] \1963 -variable [itcl::scope _settings(-cutplaneyposition)] \ 1963 1964 -foreground green3 -font "Arial 9 bold" 1964 1965 } { … … 1977 1978 -onimage [Rappture::icon z-cutplane-blue] \ 1978 1979 -offimage [Rappture::icon z-cutplane-blue] \ 1979 -command [itcl::code $this AdjustSetting cutplaneZVisible] \1980 -variable [itcl::scope _settings( cutplaneZVisible)] \1980 -command [itcl::code $this AdjustSetting -cutplanezvisible] \ 1981 -variable [itcl::scope _settings(-cutplanezvisible)] \ 1981 1982 } { 1982 1983 usual … … 1992 1993 -borderwidth 1 -highlightthickness 0 \ 1993 1994 -command [itcl::code $this EventuallySetCutplane z] \ 1994 -variable [itcl::scope _settings( cutplaneZPosition)] \1995 -variable [itcl::scope _settings(-cutplanezposition)] \ 1995 1996 -foreground blue3 -font "Arial 9 bold" 1996 1997 } { … … 2022 2023 blt::table configure $inner r9 c4 -resize expand 2023 2024 } 2024 2025 2026 2025 2027 2026 # … … 2180 2179 # the code to handle aberrant cases. 2181 2180 2182 if { $_changed( glyphOpacity) } {2183 set style(-opacity) [expr $_settings( glyphOpacity) * 0.01]2184 } 2185 if { $_changed( colormap) } {2186 set style(-colormap) $_settings( colormap)2181 if { $_changed(-glyphopacity) } { 2182 set style(-opacity) [expr $_settings(-glyphopacity) * 0.01] 2183 } 2184 if { $_changed(-colormap) } { 2185 set style(-colormap) $_settings(-colormap) 2187 2186 } 2188 2187 if { $_currentColormap == "" } { 2189 2188 $itk_component(colormap) value $style(-colormap) 2190 2189 } 2190 2191 SendCmd "outline add $tag" 2192 SendCmd "outline color [Color2RGB $style(-color)] $tag" 2193 SendCmd "outline visible $style(-outline) $tag" 2194 set _settings(-glyphoutline) $style(-outline) 2195 2191 2196 SendCmd "glyphs add $style(-shape) $tag" 2192 set _settings( glyphShape) $style(-shape)2197 set _settings(-glyphshape) $style(-shape) 2193 2198 $itk_component(gshape) value $style(-shape) 2194 2199 SendCmd "glyphs edges $style(-edges) $tag" … … 2200 2205 SendCmd "glyphs gscale $style(-gscale) $tag" 2201 2206 } 2202 set _settings(glyphNormscale) $style(-normscale) 2203 set _settings(glyphScale) $style(-gscale) 2204 SendCmd "outline add $tag" 2205 SendCmd "outline color [Color2RGB $style(-color)] $tag" 2206 SendCmd "outline visible $style(-outline) $tag" 2207 set _settings(glyphOutline) $style(-outline) 2208 set _settings(glyphEdges) $style(-edges) 2207 set _settings(-glyphnormscale) $style(-normscale) 2208 set _settings(-glyphscale) $style(-gscale) 2209 2210 set _settings(-glyphedges) $style(-edges) 2209 2211 if {$style(-colorMode) == "constant" || $style(-colormap) == "none"} { 2210 2212 SendCmd "glyphs colormode constant {} $tag" 2211 set _settings( colormapVisible) 02212 set _settings( colormap) "none"2213 set _settings(-colormapvisible) 0 2214 set _settings(-colormap) "none" 2213 2215 } else { 2214 2216 SendCmd "glyphs colormode $style(-colorMode) $_curFldName $tag" 2215 set _settings( colormapVisible) 12216 set _settings( colormap) $style(-colormap)2217 set _settings(-colormapvisible) 1 2218 set _settings(-colormap) $style(-colormap) 2217 2219 SetCurrentColormap $style(-colormap) 2218 2220 } 2219 $itk_component(colormap) value $_settings( colormap)2221 $itk_component(colormap) value $_settings(-colormap) 2220 2222 set _colorMode $style(-colorMode) 2221 2223 # constant color only used if colormode set to constant … … 2225 2227 SendCmd "glyphs gorient $style(-orientGlyphs) {} $tag" 2226 2228 SendCmd "glyphs smode $style(-scaleMode) {} $tag" 2227 set _settings( glyphScaleMode) $style(-scaleMode)2229 set _settings(-glyphscalemode) $style(-scaleMode) 2228 2230 $itk_component(scaleMode) value "[$itk_component(scaleMode) label $style(-scaleMode)]" 2229 2231 SendCmd "glyphs quality $style(-quality) $tag" 2230 2232 SendCmd "glyphs lighting $style(-lighting) $tag" 2231 set _settings( glyphLighting) $style(-lighting)2233 set _settings(-glyphlighting) $style(-lighting) 2232 2234 SendCmd "glyphs linecolor [Color2RGB $style(-edgecolor)] $tag" 2233 2235 SendCmd "glyphs linewidth $style(-linewidth) $tag" 2234 2236 SendCmd "glyphs ptsize $style(-ptsize) $tag" 2235 2237 SendCmd "glyphs opacity $style(-opacity) $tag" 2236 set _settings( glyphOpacity) [expr $style(-opacity) * 100.0]2238 set _settings(-glyphopacity) [expr $style(-opacity) * 100.0] 2237 2239 SendCmd "glyphs wireframe $style(-wireframe) $tag" 2238 set _settings( glyphWireframe) $style(-wireframe)2240 set _settings(-glyphwireframe) $style(-wireframe) 2239 2241 } 2240 2242 … … 2413 2415 } 2414 2416 set x [expr $w - 2] 2415 if { !$_settings( legendVisible) } {2417 if { !$_settings(-legendvisible) } { 2416 2418 $c delete legend 2417 2419 return -
trunk/gui/scripts/vtkstreamlinesviewer.tcl
r4344 r4444 1 1 # -*- mode: tcl; indent-tabs-mode: nil -*- 2 2 # ---------------------------------------------------------------------- 3 # COMPONENT: vtk viewer - Vtk drawingobject viewer3 # COMPONENT: vtkstreamlinesviewer - Vtk streamlines object viewer 4 4 # 5 5 # It connects to the Vtk server running on a rendering farm, -
trunk/gui/scripts/vtkvolumeviewer.tcl
r4402 r4444 163 163 private variable _start 0 164 164 private variable _title "" 165 private variable _seeds166 165 167 166 common _downloadPopup; # download options from popup … … 887 886 array unset _data 888 887 array unset _colormaps 889 array unset _seeds890 888 array unset _dataset2style 891 889 array unset _obj2datasets … … 1378 1376 "-background" { 1379 1377 set bgcolor [$itk_component(background) value] 1380 set _settings($ {what}) $bgcolor1378 set _settings($what) $bgcolor 1381 1379 array set fgcolors { 1382 1380 "black" "white" … … 1390 1388 } 1391 1389 "-volumeoutline" { 1392 set bool $_settings($ {what})1390 set bool $_settings($what) 1393 1391 SendCmd "outline visible 0" 1394 1392 foreach tag [GetDatasetsWithComponent $_current] { … … 1397 1395 } 1398 1396 "-legendvisible" { 1399 set bool $_settings($ {what})1397 set bool $_settings($what) 1400 1398 set _settings($_current${what}) $bool 1401 1399 if { $bool } { … … 1407 1405 } 1408 1406 "-volumevisible" { 1409 set bool $_settings($ {what})1407 set bool $_settings($what) 1410 1408 set _settings($_current${what}) $bool 1411 1409 # Only the data objects in the array _obj2ovride(*-raise) are … … 1434 1432 set val [$itk_component(blendmode) value] 1435 1433 set mode [$itk_component(blendmode) translate $val] 1436 set _settings($ {what}) $mode1434 set _settings($what) $mode 1437 1435 set _settings($_current${what}) $mode 1438 1436 foreach tag [GetDatasetsWithComponent $_current] { … … 1446 1444 InitComponentSettings $_current 1447 1445 } 1448 set val $_settings($ {what})1446 set val $_settings($what) 1449 1447 set _settings($_current${what}) $val 1450 1448 set ambient [expr {0.01*$val}] … … 1454 1452 } 1455 1453 "-volumediffuse" { 1456 set val $_settings($ {what})1454 set val $_settings($what) 1457 1455 set _settings($_current${what}) $val 1458 1456 set diffuse [expr {0.01*$val}] … … 1462 1460 } 1463 1461 "-volumespecularlevel" - "-volumespecularexponent" { 1464 set val $_settings($ {what})1462 set val $_settings($what) 1465 1463 set _settings($_current${what}) $val 1466 1464 set level [expr {0.01*$val}] 1467 set exp $_settings($ {what})1465 set exp $_settings($what) 1468 1466 foreach tag [GetDatasetsWithComponent $_current] { 1469 1467 SendCmd "volume shading specular $level $exp $tag" … … 1478 1476 } 1479 1477 "-volumeopacity" { 1480 set val $_settings($ {what})1478 set val $_settings($what) 1481 1479 set _settings($_current${what}) $val 1482 1480 set val [expr {0.01*$val}] … … 1486 1484 } 1487 1485 "-volumequality" { 1488 set val $_settings($ {what})1486 set val $_settings($what) 1489 1487 set _settings($_current${what}) $val 1490 1488 set val [expr {0.01*$val}] … … 1494 1492 } 1495 1493 "-axesvisible" { 1496 set bool $_settings($ {what})1494 set bool $_settings($what) 1497 1495 SendCmd "axis visible all $bool" 1498 1496 } 1499 1497 "-axislabelsvisible" { 1500 set bool $_settings($ {what})1498 set bool $_settings($what) 1501 1499 SendCmd "axis labels all $bool" 1502 1500 } 1503 1501 "-xgridvisible" - "-ygridvisible" - "-zgridvisible" { 1504 1502 set axis [string tolower [string range $what 1 1 ]] 1505 set bool $_settings($ {what})1503 set bool $_settings($what) 1506 1504 SendCmd "axis grid $axis $bool" 1507 1505 } … … 1509 1507 set mode [$itk_component(axismode) value] 1510 1508 set mode [$itk_component(axismode) translate $mode] 1511 set _settings($ {what}) $mode1509 set _settings($what) $mode 1512 1510 SendCmd "axis flymode $mode" 1513 1511 } 1514 1512 "-cutplanesvisible" { 1515 set bool $_settings($ {what})1513 set bool $_settings($what) 1516 1514 foreach dataset [CurrentDatasets -visible] { 1517 1515 SendCmd "$_cutplaneCmd visible $bool $dataset" … … 1519 1517 } 1520 1518 "-cutplanelighting" { 1521 set bool $_settings($ {what})1519 set bool $_settings($what) 1522 1520 foreach dataset [CurrentDatasets -visible] { 1523 1521 if {$_cutplaneCmd != "imgcutplane"} { … … 1536 1534 } 1537 1535 "-cutplaneopacity" { 1538 set val $_settings($ {what})1536 set val $_settings($what) 1539 1537 set sval [expr { 0.01 * double($val) }] 1540 1538 foreach dataset [CurrentDatasets -visible] { … … 1544 1542 "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" { 1545 1543 set axis [string tolower [string range $what 1 1]] 1546 set bool $_settings($ {what})1544 set bool $_settings($what) 1547 1545 if { $bool } { 1548 1546 $itk_component(${axis}CutScale) configure -state normal \ … … 1558 1556 "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" { 1559 1557 set axis [string tolower [string range $what 1 1]] 1560 set pos [expr $_settings($ {what}) * 0.01]1558 set pos [expr $_settings($what) * 0.01] 1561 1559 foreach dataset [CurrentDatasets -visible] { 1562 1560 SendCmd "$_cutplaneCmd slice ${axis} ${pos} $dataset" … … 1565 1563 } 1566 1564 "-volumethickness" { 1567 set _settings($_current${what}) $_settings($ {what})1565 set _settings($_current${what}) $_settings($what) 1568 1566 updateTransferFunctions 1569 1567 } 1570 1568 "-color" { 1571 1569 set color [$itk_component(colormap) value] 1572 set _settings($ {what}) $color1570 set _settings($what) $color 1573 1571 set _settings($_current${what}) $color 1574 1572 ResetColormap $_current $color … … 1577 1575 set label [$itk_component(field) value] 1578 1576 set fname [$itk_component(field) translate $label] 1579 set _settings($ {what}) $fname1577 set _settings($what) $fname 1580 1578 if { [info exists _fields($fname)] } { 1581 1579 foreach { label units components } $_fields($fname) break … … 1648 1646 set color $itk_option(-plotforeground) 1649 1647 set rgb [Color2RGB $color] 1650 1648 SendCmd "axis color all $rgb" 1651 1649 SendCmd "outline color $rgb" 1652 1650 SendCmd "cutplane color $rgb"
Note: See TracChangeset
for help on using the changeset viewer.