Changeset 4437
- Timestamp:
- Jun 25, 2014 7:10:58 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkheightmapviewer.tcl
r4381 r4437 216 216 217 217 array set _settings { 218 axisFlymode "static" 219 axisMinorTicks 1 220 stretchToFit 0 221 axisLabels 1 222 axisVisible 1 223 axisXGrid 0 224 axisYGrid 0 225 axisZGrid 0 226 colormapVisible 1 227 colormapDiscrete 0 228 edges 0 229 field "Default" 230 heightmapScale 50 231 isHeightmap 0 232 isolineColor black 233 isolinesVisible 1 234 legendVisible 1 235 lighting 1 236 saveLighting 1 237 numIsolines 10 238 opacity 100 239 outline 0 240 wireframe 0 241 saveOpacity 100 242 saveOutline 0 218 -axisflymode "static" 219 -axislabels 1 220 -axisminorticks 1 221 -axisvisible 1 222 -colormap BCGYR 223 -colormapdiscrete 0 224 -colormapvisible 1 225 -edges 0 226 -field "Default" 227 -heightmapscale 50 228 -isheightmap 0 229 -isolinecolor black 230 -isolinesvisible 1 231 -legendvisible 1 232 -lighting 1 233 -numisolines 10 234 -opacity 100 235 -outline 0 236 -savelighting 1 237 -saveopacity 100 238 -saveoutline 0 239 -stretchtofit 0 240 -wireframe 0 241 -xgrid 0 242 -ygrid 0 243 -zgrid 0 243 244 } 244 245 array set _changed { 245 opacity0246 colormap0247 numIsolines0246 -colormap 0 247 -numisolines 0 248 -opacity 0 248 249 } 249 250 itk_component add view { … … 324 325 -onimage [Rappture::icon surface] \ 325 326 -offimage [Rappture::icon surface] \ 326 -variable [itcl::scope _settings( isHeightmap)] \327 -command [itcl::code $this AdjustSetting isHeightmap] \327 -variable [itcl::scope _settings(-isheightmap)] \ 328 -command [itcl::code $this AdjustSetting -isheightmap] \ 328 329 } 329 330 Rappture::Tooltip::for $itk_component(mode) \ … … 335 336 -onimage [Rappture::icon stretchtofit] \ 336 337 -offimage [Rappture::icon stretchtofit] \ 337 -variable [itcl::scope _settings( stretchToFit)] \338 -command [itcl::code $this AdjustSetting stretchToFit] \338 -variable [itcl::scope _settings(-stretchtofit)] \ 339 -command [itcl::code $this AdjustSetting -stretchtofit] \ 339 340 } 340 341 Rappture::Tooltip::for $itk_component(stretchtofit) \ … … 665 666 } 666 667 if { [array size found] > 1 } { 667 set _settings( stretchToFit) 1668 set _settings(-stretchtofit) 1 668 669 } else { 669 670 # Check if the range of the x and y axes requires that we stretch … … 674 675 if { (($xmax - $xmin) > (($ymax -$ymin) * $_maxScale)) || 675 676 ((($xmax - $xmin) * $_maxScale) < ($ymax -$ymin)) } { 676 set _settings( stretchToFit) 1677 set _settings(-stretchtofit) 1 677 678 } 678 679 } … … 923 924 $_arcball resize $w $h 924 925 DoResize 925 if { $_settings( stretchToFit) } {926 AdjustSetting stretchToFit926 if { $_settings(-stretchtofit) } { 927 AdjustSetting -stretchtofit 927 928 } 928 929 } … … 931 932 # Reset the camera and other view parameters 932 933 # 933 InitSettings isHeightmapbackground934 InitSettings -isheightmap -background 934 935 935 936 # Let's see how this goes. I think it's preferable to overloading the … … 940 941 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 941 942 $_arcball quaternion $q 942 if {$_settings( isHeightmap) } {943 if {$_settings(-isheightmap) } { 943 944 if { $_view(ortho)} { 944 945 SendCmd "camera mode ortho" … … 1032 1033 $itk_component(field) value $_curFldLabel 1033 1034 } 1034 InitSettings stretchToFitoutline1035 InitSettings -stretchtofit -outline 1035 1036 1036 1037 if { $_reset } { … … 1076 1077 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 1077 1078 $_arcball quaternion $q 1078 if {$_settings( isHeightmap) } {1079 if {$_settings(-isheightmap) } { 1079 1080 if { $_view(ortho)} { 1080 1081 SendCmd "camera mode ortho" … … 1086 1087 } 1087 1088 PanCamera 1088 InitSettings axisXGrid axisYGrid axisZGrid \1089 axisVisible axisLabels heightmapScale field isHeightmap \1090 numIsolines1089 InitSettings -xgrid -ygrid -zgrid \ 1090 -axisvisible -axislabels -heightmapscale -field -isheightmap \ 1091 -numisolines 1091 1092 if { [array size _fields] < 2 } { 1092 1093 blt::table forget $itk_component(field) $itk_component(field_l) … … 1168 1169 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 1169 1170 $_arcball quaternion $q 1170 if {$_settings( isHeightmap) } {1171 if {$_settings(-isheightmap) } { 1171 1172 DoRotate 1172 1173 } … … 1329 1330 itcl::body Rappture::VtkHeightmapViewer::InitSettings { args } { 1330 1331 foreach spec $args { 1331 if { [info exists _settings($_first -$spec)] } {1332 if { [info exists _settings($_first${spec})] } { 1332 1333 # Reset global setting with dataobj specific setting 1333 set _settings($spec) $_settings($_first -$spec)1334 set _settings($spec) $_settings($_first${spec}) 1334 1335 } 1335 1336 AdjustSetting $spec … … 1349 1350 } 1350 1351 switch -- $what { 1351 " axisFlymode" {1352 "-axisflymode" { 1352 1353 set mode [$itk_component(axisflymode) value] 1353 1354 set mode [$itk_component(axisflymode) translate $mode] … … 1355 1356 SendCmd "axis flymode $mode" 1356 1357 } 1357 " axisLabels" {1358 "-axislabels" { 1358 1359 set bool $_settings($what) 1359 1360 SendCmd "axis labels all $bool" 1360 1361 } 1361 " axisMinorTicks" {1362 "-axisminorticks" { 1362 1363 set bool $_settings($what) 1363 1364 foreach axis { x y z } { … … 1365 1366 } 1366 1367 } 1367 " axisVisible" {1368 "-axisvisible" { 1368 1369 set bool $_settings($what) 1369 1370 SendCmd "axis visible all $bool" 1370 1371 } 1371 " axisXGrid" - "axisYGrid" - "axisZGrid" {1372 set axis [string tolower [string range $what 4 4]]1372 "-xgrid" - "-ygrid" - "-zgrid" { 1373 set axis [string tolower [string range $what 1 1]] 1373 1374 set bool $_settings($what) 1374 1375 SendCmd "axis grid $axis $bool" 1375 1376 } 1376 " background" {1377 "-background" { 1377 1378 set bg [$itk_component(background) value] 1378 1379 array set fgcolors { … … 1389 1390 DrawLegend 1390 1391 } 1391 " colormap" {1392 "-colormap" { 1392 1393 set _changed($what) 1 1393 1394 StartBufferingCommands … … 1395 1396 set _settings($what) $color 1396 1397 if { $color == "none" } { 1397 if { $_settings( colormapVisible) } {1398 if { $_settings(-colormapvisible) } { 1398 1399 SendCmd "heightmap surface 0" 1399 set _settings( colormapVisible) 01400 set _settings(-colormapvisible) 0 1400 1401 } 1401 1402 } else { 1402 if { !$_settings( colormapVisible) } {1403 if { !$_settings(-colormapvisible) } { 1403 1404 SendCmd "heightmap surface 1" 1404 set _settings( colormapVisible) 11405 set _settings(-colormapvisible) 1 1405 1406 } 1406 1407 SetCurrentColormap $color 1407 if {$_settings( colormapDiscrete)} {1408 set numColors [expr $_settings( numIsolines) + 1]1408 if {$_settings(-colormapdiscrete)} { 1409 set numColors [expr $_settings(-numisolines) + 1] 1409 1410 SendCmd "colormap res $numColors $color" 1410 1411 } … … 1413 1414 EventuallyRequestLegend 1414 1415 } 1415 " colormapVisible" {1416 "-colormapvisible" { 1416 1417 set bool $_settings($what) 1417 1418 SendCmd "heightmap surface $bool" 1418 1419 } 1419 " colormapDiscrete" {1420 "-colormapdiscrete" { 1420 1421 set bool $_settings($what) 1421 set numColors [expr $_settings( numIsolines) + 1]1422 set numColors [expr $_settings(-numisolines) + 1] 1422 1423 StartBufferingCommands 1423 1424 if {$bool} { … … 1433 1434 EventuallyRequestLegend 1434 1435 } 1435 " edges" {1436 "-edges" { 1436 1437 set bool $_settings($what) 1437 1438 SendCmd "heightmap edges $bool" 1438 1439 } 1439 " field" {1440 "-field" { 1440 1441 set label [$itk_component(field) value] 1441 1442 set fname [$itk_component(field) translate $label] … … 1482 1483 DrawLegend 1483 1484 } 1484 " heightmapScale" {1485 if { $_settings( isHeightmap) } {1485 "-heightmapscale" { 1486 if { $_settings(-isheightmap) } { 1486 1487 set scale [GetHeightmapScale] 1487 1488 # Have to set the datasets individually because we are … … 1494 1495 } 1495 1496 } 1496 " isHeightmap" {1497 "-isheightmap" { 1497 1498 set bool $_settings($what) 1498 1499 set c $itk_component(view) … … 1500 1501 # Fix heightmap scale: 0 for contours, 1 for heightmaps. 1501 1502 if { $bool } { 1502 set _settings( heightmapScale) 501503 set _settings( opacity) $_settings(saveOpacity)1504 set _settings( lighting) $_settings(saveLighting)1505 set _settings( outline) 01503 set _settings(-heightmapscale) 50 1504 set _settings(-opacity) $_settings(-saveopacity) 1505 set _settings(-lighting) $_settings(-savelighting) 1506 set _settings(-outline) 0 1506 1507 } else { 1507 set _settings(heightmapScale) 0 1508 set _settings(lighting) 0 1509 set _settings(opacity) 100 1510 set _settings(outline) $_settings(saveOutline) 1511 } 1512 AdjustSetting lighting 1513 AdjustSetting opacity 1514 AdjustSetting outline 1508 set _settings(-heightmapscale) 0 1509 set _settings(-lighting) 0 1510 set _settings(-opacity) 100 1511 set _settings(-outline) $_settings(-saveoutline) 1512 } 1513 InitSettings -lighting -opacity -outline 1515 1514 set scale [GetHeightmapScale] 1516 1515 # Have to set the datasets individually because we are … … 1541 1540 SendCmd "camera mode image" 1542 1541 } 1543 if {$_settings( stretchToFit)} {1542 if {$_settings(-stretchtofit)} { 1544 1543 if {$scale == 0} { 1545 1544 SendCmd "camera aspect window" … … 1572 1571 StopBufferingCommands 1573 1572 } 1574 " isolineColor" {1573 "-isolinecolor" { 1575 1574 set color [$itk_component(isolinecolor) value] 1576 1575 if { $color == "none" } { 1577 if { $_settings( isolinesVisible) } {1576 if { $_settings(-isolinesvisible) } { 1578 1577 SendCmd "heightmap isolines 0" 1579 set _settings( isolinesVisible) 01578 set _settings(-isolinesvisible) 0 1580 1579 } 1581 1580 } else { 1582 if { !$_settings( isolinesVisible) } {1581 if { !$_settings(-isolinesvisible) } { 1583 1582 SendCmd "heightmap isolines 1" 1584 set _settings( isolinesVisible) 11583 set _settings(-isolinesvisible) 1 1585 1584 } 1586 1585 SendCmd "heightmap isolinecolor [Color2RGB $color]" … … 1588 1587 DrawLegend 1589 1588 } 1590 " isolinesVisible" {1589 "-isolinesvisible" { 1591 1590 set bool $_settings($what) 1592 1591 SendCmd "heightmap isolines $bool" 1593 1592 DrawLegend 1594 1593 } 1595 " legendVisible" {1594 "-legendvisible" { 1596 1595 if { !$_settings($what) } { 1597 1596 $itk_component(view) delete legend … … 1599 1598 DrawLegend 1600 1599 } 1601 " lighting" {1602 if { $_settings( isHeightmap) } {1603 set _settings( saveLighting) $_settings($what)1600 "-lighting" { 1601 if { $_settings(-isheightmap) } { 1602 set _settings(-savelighting) $_settings($what) 1604 1603 set bool $_settings($what) 1605 1604 SendCmd "heightmap lighting $bool" … … 1608 1607 } 1609 1608 } 1610 " numIsolines" {1609 "-numisolines" { 1611 1610 set _settings($what) [$itk_component(numisolines) value] 1612 1611 set _currentNumIsolines $_settings($what) … … 1614 1613 set _changed($what) 1 1615 1614 SendCmd "heightmap contourlist [list $_contourList]" 1616 if {$_settings( colormapDiscrete)} {1615 if {$_settings(-colormapdiscrete)} { 1617 1616 set numColors [expr $_settings($what) + 1] 1618 1617 SendCmd "colormap res $numColors" … … 1622 1621 } 1623 1622 } 1624 " opacity" {1623 "-opacity" { 1625 1624 set _changed($what) 1 1626 if { $_settings(isHeightmap) } { 1627 set _settings(saveOpacity) $_settings($what) 1628 set val $_settings($what) 1629 set sval [expr { 0.01 * double($val) }] 1630 SendCmd "heightmap opacity $sval" 1625 set val [expr $_settings($what) * 0.01] 1626 if { $_settings(-isheightmap) } { 1627 set _settings(-saveopacity) $_settings($what) 1628 SendCmd "heightmap opacity $val" 1631 1629 } else { 1632 SendCmd "heightmap opacity 1 "1633 } 1634 } 1635 " outline" {1636 if { $_settings( isHeightmap) } {1630 SendCmd "heightmap opacity 1.0" 1631 } 1632 } 1633 "-outline" { 1634 if { $_settings(-isheightmap) } { 1637 1635 SendCmd "outline visible 0" 1638 1636 } else { 1639 set _settings( saveOutline) $_settings($what)1637 set _settings(-saveoutline) $_settings($what) 1640 1638 set bool $_settings($what) 1641 1639 SendCmd "outline visible $bool" 1642 1640 } 1643 1641 } 1644 " stretchToFit" {1642 "-stretchtofit" { 1645 1643 set bool $_settings($what) 1646 1644 if { $bool } { … … 1656 1654 Zoom reset 1657 1655 } 1658 " wireframe" {1656 "-wireframe" { 1659 1657 set bool $_settings($what) 1660 1658 SendCmd "heightmap wireframe $bool" … … 1792 1790 switch -- $itk_option(-mode) { 1793 1791 "heightmap" { 1794 set _settings( isHeightmap) 11792 set _settings(-isheightmap) 1 1795 1793 } 1796 1794 "contour" { 1797 set _settings( isHeightmap) 01795 set _settings(-isheightmap) 0 1798 1796 } 1799 1797 default { … … 1802 1800 } 1803 1801 if { !$_reset } { 1804 AdjustSetting isHeightmap1802 AdjustSetting -isheightmap 1805 1803 } 1806 1804 } … … 1854 1852 checkbutton $inner.legend \ 1855 1853 -text "Legend" \ 1856 -variable [itcl::scope _settings( legendVisible)] \1857 -command [itcl::code $this AdjustSetting legendVisible] \1854 -variable [itcl::scope _settings(-legendvisible)] \ 1855 -command [itcl::code $this AdjustSetting -legendvisible] \ 1858 1856 -font "Arial 9" 1859 1857 1860 1858 checkbutton $inner.wireframe \ 1861 1859 -text "Wireframe" \ 1862 -variable [itcl::scope _settings( wireframe)] \1863 -command [itcl::code $this AdjustSetting wireframe] \1860 -variable [itcl::scope _settings(-wireframe)] \ 1861 -command [itcl::code $this AdjustSetting -wireframe] \ 1864 1862 -font "Arial 9" 1865 1863 … … 1867 1865 checkbutton $inner.lighting \ 1868 1866 -text "Enable Lighting" \ 1869 -variable [itcl::scope _settings( lighting)] \1870 -command [itcl::code $this AdjustSetting lighting] \1867 -variable [itcl::scope _settings(-lighting)] \ 1868 -command [itcl::code $this AdjustSetting -lighting] \ 1871 1869 -font "Arial 9" 1872 1870 } { … … 1875 1873 checkbutton $inner.edges \ 1876 1874 -text "Edges" \ 1877 -variable [itcl::scope _settings( edges)] \1878 -command [itcl::code $this AdjustSetting edges] \1875 -variable [itcl::scope _settings(-edges)] \ 1876 -command [itcl::code $this AdjustSetting -edges] \ 1879 1877 -font "Arial 9" 1880 1878 … … 1882 1880 checkbutton $inner.outline \ 1883 1881 -text "Outline" \ 1884 -variable [itcl::scope _settings( outline)] \1885 -command [itcl::code $this AdjustSetting outline] \1882 -variable [itcl::scope _settings(-outline)] \ 1883 -command [itcl::code $this AdjustSetting -outline] \ 1886 1884 -font "Arial 9" 1887 1885 } { … … 1890 1888 checkbutton $inner.stretch \ 1891 1889 -text "Stretch to fit" \ 1892 -variable [itcl::scope _settings( stretchToFit)] \1893 -command [itcl::code $this AdjustSetting stretchToFit] \1890 -variable [itcl::scope _settings(-stretchtofit)] \ 1891 -command [itcl::code $this AdjustSetting -stretchtofit] \ 1894 1892 -font "Arial 9" 1895 1893 1896 1894 checkbutton $inner.isolines \ 1897 1895 -text "Isolines" \ 1898 -variable [itcl::scope _settings( isolinesVisible)] \1899 -command [itcl::code $this AdjustSetting isolinesVisible] \1896 -variable [itcl::scope _settings(-isolinesvisible)] \ 1897 -command [itcl::code $this AdjustSetting -isolinesvisible] \ 1900 1898 -font "Arial 9" 1901 1899 1902 1900 checkbutton $inner.colormapDiscrete \ 1903 1901 -text "Discrete Colormap" \ 1904 -variable [itcl::scope _settings( colormapDiscrete)] \1905 -command [itcl::code $this AdjustSetting colormapDiscrete] \1902 -variable [itcl::scope _settings(-colormapdiscrete)] \ 1903 -command [itcl::code $this AdjustSetting -colormapdiscrete] \ 1906 1904 -font "Arial 9" 1907 1905 … … 1915 1913 } 1916 1914 bind $inner.field <<Value>> \ 1917 [itcl::code $this AdjustSetting field]1915 [itcl::code $this AdjustSetting -field] 1918 1916 1919 1917 label $inner.colormap_l -text "Colormap" -font "Arial 9" … … 1922 1920 } 1923 1921 $inner.colormap choices insert end [GetColormapList -includeNone] 1924 $itk_component(colormap) value "BCGYR"1922 $itk_component(colormap) value $_settings(-colormap) 1925 1923 bind $inner.colormap <<Value>> \ 1926 [itcl::code $this AdjustSetting colormap]1924 [itcl::code $this AdjustSetting -colormap] 1927 1925 1928 1926 label $inner.isolinecolor_l -text "Isolines Color" -font "Arial 9" … … 1942 1940 "none" "none" 1943 1941 1944 $itk_component(isolinecolor) value "black"1942 $itk_component(isolinecolor) value $_settings(-isolinecolor) 1945 1943 bind $inner.isolinecolor <<Value>> \ 1946 [itcl::code $this AdjustSetting isolineColor]1944 [itcl::code $this AdjustSetting -isolinecolor] 1947 1945 1948 1946 label $inner.background_l -text "Background Color" -font "Arial 9" … … 1956 1954 1957 1955 $itk_component(background) value "white" 1958 bind $inner.background <<Value>> [itcl::code $this AdjustSetting background] 1956 bind $inner.background <<Value>> \ 1957 [itcl::code $this AdjustSetting -background] 1959 1958 1960 1959 itk_component add opacity_l { … … 1965 1964 itk_component add opacity { 1966 1965 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1967 -variable [itcl::scope _settings( opacity)] \1966 -variable [itcl::scope _settings(-opacity)] \ 1968 1967 -showvalue off \ 1969 -command [itcl::code $this AdjustSetting opacity]1968 -command [itcl::code $this AdjustSetting -opacity] 1970 1969 } 1971 1970 itk_component add scale_l { … … 1976 1975 itk_component add scale { 1977 1976 ::scale $inner.scale -from 0 -to 100 -orient horizontal \ 1978 -variable [itcl::scope _settings( heightmapScale)] \1977 -variable [itcl::scope _settings(-heightmapscale)] \ 1979 1978 -showvalue off \ 1980 -command [itcl::code $this AdjustSetting heightmapScale]1979 -command [itcl::code $this AdjustSetting -heightmapscale] 1981 1980 } 1982 1981 label $inner.numisolines_l -text "Number of Isolines" -font "Arial 9" … … 1985 1984 -min 0 -max 50 -font "arial 9" 1986 1985 } 1987 $itk_component(numisolines) value $_settings( numIsolines)1986 $itk_component(numisolines) value $_settings(-numisolines) 1988 1987 bind $itk_component(numisolines) <<Value>> \ 1989 [itcl::code $this AdjustSetting numIsolines]1988 [itcl::code $this AdjustSetting -numisolines] 1990 1989 1991 1990 frame $inner.separator1 -height 2 -relief sunken -bd 1 … … 2034 2033 checkbutton $inner.visible \ 2035 2034 -text "Axes" \ 2036 -variable [itcl::scope _settings( axisVisible)] \2037 -command [itcl::code $this AdjustSetting axisVisible] \2035 -variable [itcl::scope _settings(-axisvisible)] \ 2036 -command [itcl::code $this AdjustSetting -axisvisible] \ 2038 2037 -font "Arial 9" 2039 2038 checkbutton $inner.labels \ 2040 2039 -text "Axis Labels" \ 2041 -variable [itcl::scope _settings( axisLabels)] \2042 -command [itcl::code $this AdjustSetting axisLabels] \2040 -variable [itcl::scope _settings(-axislabels)] \ 2041 -command [itcl::code $this AdjustSetting -axislabels] \ 2043 2042 -font "Arial 9" 2044 2043 label $inner.grid_l -text "Grid" -font "Arial 9" 2045 2044 checkbutton $inner.xgrid \ 2046 2045 -text "X" \ 2047 -variable [itcl::scope _settings( axisXGrid)] \2048 -command [itcl::code $this AdjustSetting axisXGrid] \2046 -variable [itcl::scope _settings(-xgrid)] \ 2047 -command [itcl::code $this AdjustSetting -xgrid] \ 2049 2048 -font "Arial 9" 2050 2049 checkbutton $inner.ygrid \ 2051 2050 -text "Y" \ 2052 -variable [itcl::scope _settings( axisYGrid)] \2053 -command [itcl::code $this AdjustSetting axisYGrid] \2051 -variable [itcl::scope _settings(-ygrid)] \ 2052 -command [itcl::code $this AdjustSetting -ygrid] \ 2054 2053 -font "Arial 9" 2055 2054 checkbutton $inner.zgrid \ 2056 2055 -text "Z" \ 2057 -variable [itcl::scope _settings( axisZGrid)] \2058 -command [itcl::code $this AdjustSetting axisZGrid] \2056 -variable [itcl::scope _settings(-zgrid)] \ 2057 -command [itcl::code $this AdjustSetting -zgrid] \ 2059 2058 -font "Arial 9" 2060 2059 checkbutton $inner.minorticks \ 2061 2060 -text "Minor Ticks" \ 2062 -variable [itcl::scope _settings( axisMinorTicks)] \2063 -command [itcl::code $this AdjustSetting axisMinorTicks] \2061 -variable [itcl::scope _settings(-axisminorticks)] \ 2062 -command [itcl::code $this AdjustSetting -axisminorticks] \ 2064 2063 -font "Arial 9" 2065 2064 … … 2075 2074 "furthest_triad" "farthest" \ 2076 2075 "outer_edges" "outer" 2077 $itk_component(axisflymode) value "static"2078 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting axisFlymode]2076 $itk_component(axisflymode) value $_settings(-axisflymode) 2077 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axisflymode] 2079 2078 2080 2079 blt::table $inner \ … … 2277 2276 # the code to handle aberrant cases. 2278 2277 2279 if { $_changed( opacity) } {2280 set style(-opacity) [expr $_settings( opacity) * 0.01]2281 } 2282 if { $_changed( numIsolines) } {2283 set style(-levels) $_settings( numIsolines)2284 } 2285 if { $_changed( colormap) } {2286 set style(-color) $_settings( colormap)2278 if { $_changed(-opacity) } { 2279 set style(-opacity) [expr $_settings(-opacity) * 0.01] 2280 } 2281 if { $_changed(-numisolines) } { 2282 set style(-levels) $_settings(-numisolines) 2283 } 2284 if { $_changed(-colormap) } { 2285 set style(-color) $_settings(-colormap) 2287 2286 } 2288 2287 if { $_currentColormap == "" } { … … 2290 2289 } 2291 2290 if { [info exists style(-stretchtofit)] } { 2292 set _settings( stretchToFit) $style(-stretchtofit)2293 AdjustSetting stretchToFit2291 set _settings(-stretchtofit) $style(-stretchtofit) 2292 AdjustSetting -stretchtofit 2294 2293 } 2295 2294 if { $_currentNumIsolines != $style(-levels) } { 2296 2295 set _currentNumIsolines $style(-levels) 2297 set _settings( numIsolines) $_currentNumIsolines2296 set _settings(-numisolines) $_currentNumIsolines 2298 2297 $itk_component(numisolines) value $_currentNumIsolines 2299 2298 UpdateContourList … … 2302 2301 SendCmd "outline add $tag" 2303 2302 SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag" 2304 SendCmd "outline visible $_settings( outline) $tag"2303 SendCmd "outline visible $_settings(-outline) $tag" 2305 2304 set scale [GetHeightmapScale] 2306 2305 SendCmd "[list heightmap add contourlist $_contourList $scale $tag]" 2307 set _comp2scale($tag) $_settings( heightmapScale)2308 SendCmd "heightmap edges $_settings( edges) $tag"2309 SendCmd "heightmap wireframe $_settings( wireframe) $tag"2310 SetCurrentColormap $style(-color) 2306 set _comp2scale($tag) $_settings(-heightmapscale) 2307 SendCmd "heightmap edges $_settings(-edges) $tag" 2308 SendCmd "heightmap wireframe $_settings(-wireframe) $tag" 2309 SetCurrentColormap $style(-color) 2311 2310 set color [$itk_component(isolinecolor) value] 2312 2311 SendCmd "heightmap isolinecolor [Color2RGB $color] $tag" 2313 SendCmd "heightmap lighting $_settings( isHeightmap) $tag"2314 SendCmd "heightmap isolines $_settings( isolinesVisible) $tag"2315 SendCmd "heightmap surface $_settings( colormapVisible) $tag"2312 SendCmd "heightmap lighting $_settings(-isheightmap) $tag" 2313 SendCmd "heightmap isolines $_settings(-isolinesvisible) $tag" 2314 SendCmd "heightmap surface $_settings(-colormapvisible) $tag" 2316 2315 SendCmd "heightmap opacity $style(-opacity) $tag" 2317 set _settings( opacity) [expr $style(-opacity) * 100.0]2316 set _settings(-opacity) [expr $style(-opacity) * 100.0] 2318 2317 } 2319 2318 … … 2374 2373 } 2375 2374 set x [expr $w - 2] 2376 if { !$_settings( legendVisible) } {2375 if { !$_settings(-legendvisible) } { 2377 2376 $c delete legend 2378 2377 return … … 2382 2381 # If there's a legend title, create a text item for the title. 2383 2382 $c create text $x $y \ 2384 2385 2386 2383 -anchor ne \ 2384 -fill $itk_option(-plotforeground) -tags "title legend" \ 2385 -font $font 2387 2386 if { $title != "" } { 2388 2387 incr y $lineht 2389 2388 } 2390 2389 $c create text $x $y \ 2391 2392 2393 2394 2390 -anchor ne \ 2391 -fill $itk_option(-plotforeground) -tags "vmax legend" \ 2392 -font $font 2393 incr y $lineht 2395 2394 $c create image $x $y \ 2396 2395 -anchor ne \ … … 2416 2415 array unset _isolines 2417 2416 if { $color != "none" && [info exists _limits($_curFldName)] && 2418 $_settings( isolinesVisible) && $_currentNumIsolines > 0 } {2417 $_settings(-isolinesvisible) && $_currentNumIsolines > 0 } { 2419 2418 2420 2419 foreach { vmin vmax } $_limits($_curFldName) break … … 2583 2582 invoke { 2584 2583 $itk_component(field) value $_curFldLabel 2585 AdjustSetting field2584 AdjustSetting -field 2586 2585 } 2587 2586 default { … … 2592 2591 2593 2592 itcl::body Rappture::VtkHeightmapViewer::GetHeightmapScale {} { 2594 if { $_settings( isHeightmap) } {2595 set val $_settings( heightmapScale)2593 if { $_settings(-isheightmap) } { 2594 set val $_settings(-heightmapscale) 2596 2595 set sval [expr { $val >= 50 ? double($val)/50.0 : 1.0/(2.0-(double($val)/50.0)) }] 2597 2596 return $sval
Note: See TracChangeset
for help on using the changeset viewer.