Changeset 4399
- Timestamp:
- Jun 19, 2014, 10:16:58 AM (10 years ago)
- Location:
- branches/1.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/builder/scripts/main.tcl
r3177 r4399 868 868 869 869 # /apps/rappture/current for 32-bit systems 870 # /apps/share64/rappture/current for 64-bit systems 871 if {$tcl_platform(wordSize) == 8 872 && [file isdirectory /apps/share64/rappture/current]} { 873 set dir /apps/share64/rappture/current 870 if {$tcl_platform(wordSize) == 8 } { 871 if { [file isdirectory /apps/share64/debian7/rappture/current]} { 872 set dir /apps/share64/debian7/rappture/current 873 } elseif { [file isdirectory /apps/share64/debian6/rappture/current]} { 874 set dir /apps/share64/debian6/rappture/current 875 } else { 876 set dir /apps/rappture/current 877 } 874 878 } else { 875 879 set dir /apps/rappture/current -
branches/1.3/gui/scripts/nanovisviewer.tcl
r4218 r4399 145 145 private variable _activeTfs 146 146 private variable _first "" ;# This is the topmost volume. 147 private variable _alphamap 147 148 148 149 # This … … 745 746 $_image(legend) configure -data $bytes 746 747 ReceiveEcho <<line "<read $size bytes for [image width $_image(legend)]x[image height $_image(legend)] legend>" 747 748 puts stderr "vmin=$vmin vmax=$vmax" 748 749 set c $itk_component(legend) 749 750 set w [winfo width $c] … … 765 766 766 767 array set limits [limits $tf] 767 $c itemconfigure vmin -text [format % .2g $limits(min)]768 $c itemconfigure vmin -text [format %g $limits(min)] 768 769 $c coords vmin $lx $ly 769 770 770 $c itemconfigure vmax -text [format % .2g $limits(max)]771 $c itemconfigure vmax -text [format %g $limits(max)] 771 772 $c coords vmax [expr {$w-$lx}] $ly 772 773 … … 998 999 set tag $_first-$cname 999 1000 if { [info exists _serverDatasets($tag)] && $_serverDatasets($tag) } { 1000 array set style {1001 array set styles { 1001 1002 -cutplanes 1 1002 1003 } 1003 array set style [lindex [$_first components -style $cname] 0]1004 if { $what != "-cutplanes" || $style (-cutplanes) } {1004 array set styles [lindex [$_first components -style $cname] 0] 1005 if { $what != "-cutplanes" || $styles(-cutplanes) } { 1005 1006 lappend rlist $tag 1006 1007 } … … 1328 1329 # 1329 1330 itcl::body Rappture::NanovisViewer::NameTransferFunc { dataobj cname } { 1330 array set style {1331 array set styles { 1331 1332 -color BCGYR 1332 1333 -levels 6 … … 1335 1336 } 1336 1337 set tag $dataobj-$cname 1337 array set style [lindex [$dataobj components -style $cname] 0]1338 set tf "$style (-color):$style(-levels):$style(-opacity)"1338 array set styles [lindex [$dataobj components -style $cname] 0] 1339 set tf "$styles(-color):$styles(-levels):$styles(-opacity)" 1339 1340 set _dataset2style($tag) $tf 1340 1341 lappend _style2datasets($tf) $tag … … 1352 1353 # 1353 1354 itcl::body Rappture::NanovisViewer::ComputeTransferFunc { tf } { 1354 array set style {1355 array set styles { 1355 1356 -color BCGYR 1356 1357 -levels 6 1357 1358 -opacity 1.0 1358 1359 -markers "" 1360 -alphamap "" 1359 1361 } 1360 1362 1361 1363 foreach {dataobj cname} [split [lindex $_style2datasets($tf) 0] -] break 1362 array set style [lindex [$dataobj components -style $cname] 0]1364 array set styles [lindex [$dataobj components -style $cname] 0] 1363 1365 1364 1366 # We have to parse the style attributes for a volume using this … … 1377 1379 if { ![info exists _isomarkers($tf)] } { 1378 1380 # Have to defer creation of isomarkers until we have data limits 1379 if { [info exists style (-markers)] &&1380 [llength $style (-markers)] > 0 } {1381 ParseMarkersOption $tf $style (-markers)1381 if { [info exists styles(-markers)] && 1382 [llength $styles(-markers)] > 0 } { 1383 ParseMarkersOption $tf $styles(-markers) 1382 1384 } else { 1383 ParseLevelsOption $tf $style(-levels) 1384 } 1385 } 1386 set cmap [ColorsToColormap $style(-color)] 1385 ParseLevelsOption $tf $styles(-levels) 1386 } 1387 if { $styles(-alphamap) != "" } { 1388 set _alphamap($cname) $styles(-alphamap) 1389 } 1390 } 1391 set cmap [ColorsToColormap $styles(-color)] 1387 1392 set tag $this-$tf 1388 1393 if { ![info exists _settings($tag-opacity)] } { 1389 set _settings($tag-opacity) $style (-opacity)1394 set _settings($tag-opacity) $styles(-opacity) 1390 1395 } 1391 1396 set max 1.0 ;#$_settings($tag-opacity) … … 1443 1448 lappend wmap 1.0 0.0 1444 1449 } 1445 SendCmd "transfunc define $tf { $cmap } { $wmap }" 1450 if { [info exists _alphamap($cname)] } { 1451 set wmap $_alphamap($cname) 1452 } 1453 puts stderr wmap=$wmap 1454 SendCmd [list transfunc define $tf $cmap $wmap] 1446 1455 } 1447 1456 -
branches/1.3/gui/scripts/vtkheightmapviewer.tcl
r4208 r4399 123 123 private variable _currentColormap "" 124 124 private variable _currentNumIsolines -1 125 private variable _currentOpacity "" 125 private variable _currentOpacity 100.0; # Widget opacity setting 126 # between 0 and 100 127 126 128 127 129 private variable _maxScale 100; # This is the # of times the x-axis … … 217 219 218 220 array set _settings { 219 axisFlymode "static"220 axisMinorTicks 1221 stretchToFit 0222 axisLabels1223 axisVisible 1224 axisXGrid 0225 axisYGrid 0226 axisZGrid 0227 colormapVisible1228 colormapDiscrete0229 edges 0230 field "Default"231 heightmapScale 50232 isHeightmap 0233 isolineColorblack234 isolinesVisible1235 legendVisible1236 lighting 1237 saveLighting 1238 numIsolines 10239 opacity 100240 outline0241 wireframe 0242 saveOpacity 100243 saveOutline 0221 -axisflymode "static" 222 -axisminorticks 1 223 -stretchtofit 0 224 -axislabels 1 225 -axisvisible 1 226 -xaxisgrid 0 227 -yaxisgrid 0 228 -zaxisgrid 0 229 -colormapvisible 1 230 -colormapdiscrete 0 231 -edges 0 232 -field "Default" 233 -heightmapscale 50 234 -isheightmap 0 235 -isolinecolor black 236 -isolinesVisible 1 237 -legendvisible 1 238 -lighting 1 239 -savelighting 1 240 -numisolines 10 241 -opacity 1.0 242 -outline 0 243 -wireframe 0 244 -saveopacity 1.0 245 -saveoutline 0 244 246 } 245 247 array set _changed { 246 opacity0247 colormap 0248 numIsolines 0248 -opacity 0.0 249 -colormap 0 250 -numisolines 0 249 251 } 250 252 itk_component add view { … … 325 327 -onimage [Rappture::icon surface] \ 326 328 -offimage [Rappture::icon surface] \ 327 -variable [itcl::scope _settings( isHeightmap)] \328 -command [itcl::code $this AdjustSetting isHeightmap] \329 -variable [itcl::scope _settings(-isheightmap)] \ 330 -command [itcl::code $this AdjustSetting -isheightmap] \ 329 331 } 330 332 Rappture::Tooltip::for $itk_component(mode) \ … … 336 338 -onimage [Rappture::icon stretchtofit] \ 337 339 -offimage [Rappture::icon stretchtofit] \ 338 -variable [itcl::scope _settings( stretchToFit)] \339 -command [itcl::code $this AdjustSetting stretchToFit] \340 -variable [itcl::scope _settings(-stretchtofit)] \ 341 -command [itcl::code $this AdjustSetting -stretchtofit] \ 340 342 } 341 343 Rappture::Tooltip::for $itk_component(stretchtofit) \ … … 666 668 } 667 669 if { [array size found] > 1 } { 668 set _settings( stretchToFit) 1670 set _settings(-stretchtofit) 1 669 671 } else { 670 672 # Check if the range of the x and y axes requires that we stretch … … 675 677 if { (($xmax - $xmin) > (($ymax -$ymin) * $_maxScale)) || 676 678 ((($xmax - $xmin) * $_maxScale) < ($ymax -$ymin)) } { 677 set _settings( stretchToFit) 1679 set _settings(-stretchtofit) 1 678 680 } 679 681 } … … 924 926 $_arcball resize $w $h 925 927 DoResize 926 if { $_settings( stretchToFit) } {927 AdjustSetting stretchToFit928 if { $_settings(-stretchtofit) } { 929 AdjustSetting -stretchtofit 928 930 } 929 931 } … … 932 934 # Reset the camera and other view parameters 933 935 # 934 InitSettings isHeightmapbackground936 InitSettings -isheightmap -background 935 937 936 938 # Let's see how this goes. I think it's preferable to overloading the … … 941 943 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 942 944 $_arcball quaternion $q 943 if {$_settings( isHeightmap) } {945 if {$_settings(-isheightmap) } { 944 946 if { $_view(ortho)} { 945 947 SendCmd "camera mode ortho" … … 1033 1035 $itk_component(field) value $_curFldLabel 1034 1036 } 1035 InitSettings stretchToFitoutline1037 InitSettings -stretchtofit -outline 1036 1038 1037 1039 if { $_reset } { … … 1077 1079 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 1078 1080 $_arcball quaternion $q 1079 if {$_settings( isHeightmap) } {1081 if {$_settings(-isheightmap) } { 1080 1082 if { $_view(ortho)} { 1081 1083 SendCmd "camera mode ortho" … … 1087 1089 } 1088 1090 PanCamera 1089 InitSettings axisXGrid axisYGrid axisZGrid \1090 axisVisible axisLabels heightmapScale field isHeightmap \1091 numIsolines1091 InitSettings -xgrid -ygrid -zgrid \ 1092 -axisvisible -axislabels -heightmapscale -field -isheightmap \ 1093 -numisolines 1092 1094 if { [array size _fields] < 2 } { 1093 1095 blt::table forget $itk_component(field) $itk_component(field_l) … … 1169 1171 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 1170 1172 $_arcball quaternion $q 1171 if {$_settings( isHeightmap) } {1173 if {$_settings(-isheightmap) } { 1172 1174 DoRotate 1173 1175 } … … 1330 1332 itcl::body Rappture::VtkHeightmapViewer::InitSettings { args } { 1331 1333 foreach spec $args { 1332 if { [info exists _settings($_first -$spec)] } {1334 if { [info exists _settings($_first${spec})] } { 1333 1335 # Reset global setting with dataobj specific setting 1334 set _settings($spec) $_settings($_first -$spec)1336 set _settings($spec) $_settings($_first${spec}) 1335 1337 } 1336 1338 AdjustSetting $spec … … 1350 1352 } 1351 1353 switch -- $what { 1352 " axisFlymode" {1354 "-axisflymode" { 1353 1355 set mode [$itk_component(axisflymode) value] 1354 1356 set mode [$itk_component(axisflymode) translate $mode] … … 1356 1358 SendCmd "axis flymode $mode" 1357 1359 } 1358 " axisLabels" {1359 set bool $_settings( axisLabels)1360 "-axislabels" { 1361 set bool $_settings($what) 1360 1362 SendCmd "axis labels all $bool" 1361 1363 } 1362 " axisMinorTicks" {1363 set bool $_settings( axisMinorTicks)1364 "-axisminorticks" { 1365 set bool $_settings($what) 1364 1366 foreach axis { x y z } { 1365 1367 SendCmd "axis minticks ${axis} $bool" 1366 1368 } 1367 1369 } 1368 " axisVisible" {1369 set bool $_settings( axisVisible)1370 "-axisvisible" { 1371 set bool $_settings($what) 1370 1372 SendCmd "axis visible all $bool" 1371 1373 } 1372 " axisXGrid" - "axisYGrid" - "axisZGrid" {1373 set axis [string tolower [string range $what 4 4]]1374 "-xgrid" - "-ygrid" - "-zgrid" { 1375 set axis [string tolower [string range $what 1 1]] 1374 1376 set bool $_settings($what) 1375 1377 SendCmd "axis grid $axis $bool" 1376 1378 } 1377 " background" {1379 "-background" { 1378 1380 set bg [$itk_component(background) value] 1379 1381 array set fgcolors { … … 1390 1392 DrawLegend 1391 1393 } 1392 " colormap" {1393 set _changed( colormap) 11394 "-colormap" { 1395 set _changed($what) 1 1394 1396 StartBufferingCommands 1395 1397 set color [$itk_component(colormap) value] 1396 set _settings( colormap) $color1398 set _settings($what) $color 1397 1399 if { $color == "none" } { 1398 if { $_settings( colormapVisible) } {1400 if { $_settings(-colormapvisible) } { 1399 1401 SendCmd "heightmap surface 0" 1400 set _settings( colormapVisible) 01402 set _settings(-colormapvisible) 0 1401 1403 } 1402 1404 } else { 1403 if { !$_settings( colormapVisible) } {1405 if { !$_settings(-colormapvisible) } { 1404 1406 SendCmd "heightmap surface 1" 1405 set _settings( colormapVisible) 11407 set _settings(-colormapvisible) 1 1406 1408 } 1407 1409 SetCurrentColormap $color 1408 if {$_settings( colormapDiscrete)} {1409 set numColors [expr $_settings( numIsolines) + 1]1410 if {$_settings(-colormapdiscrete)} { 1411 set numColors [expr $_settings(-numisolines) + 1] 1410 1412 SendCmd "colormap res $numColors $color" 1411 1413 } … … 1414 1416 EventuallyRequestLegend 1415 1417 } 1416 " colormapVisible" {1418 "-colormapvisible" { 1417 1419 set bool $_settings($what) 1418 1420 SendCmd "heightmap surface $bool" 1419 1421 } 1420 " colormapDiscrete" {1422 "-colormapdiscrete" { 1421 1423 set bool $_settings($what) 1422 set numColors [expr $_settings(numIsolines) + 1] 1424 set numColors [expr $_settings(-numisolines) + 1] 1425 # FIXME: don't use StartBufferingCommands 1423 1426 StartBufferingCommands 1424 1427 if {$bool} { … … 1434 1437 EventuallyRequestLegend 1435 1438 } 1436 " edges" {1437 set bool $_settings( edges)1439 "-edges" { 1440 set bool $_settings($what) 1438 1441 SendCmd "heightmap edges $bool" 1439 1442 } 1440 " field" {1443 "-field" { 1441 1444 set label [$itk_component(field) value] 1442 1445 set fname [$itk_component(field) translate $label] 1443 set _settings( field) $fname1446 set _settings($what) $fname 1444 1447 if { [info exists _fields($fname)] } { 1445 1448 foreach { label units components } $_fields($fname) break … … 1483 1486 DrawLegend 1484 1487 } 1485 " heightmapScale" {1486 if { $_settings( isHeightmap) } {1488 "-heightmapscale" { 1489 if { $_settings(-isheightmap) } { 1487 1490 set scale [GetHeightmapScale] 1488 1491 # Have to set the datasets individually because we are … … 1495 1498 } 1496 1499 } 1497 " isHeightmap" {1498 set bool $_settings( isHeightmap)1500 "-isheightmap" { 1501 set bool $_settings($what) 1499 1502 set c $itk_component(view) 1500 1503 StartBufferingCommands 1501 1504 # Fix heightmap scale: 0 for contours, 1 for heightmaps. 1502 1505 if { $bool } { 1503 set _settings( heightmapScale) 501504 set _settings( opacity) $_settings(saveOpacity)1505 set _settings( lighting) $_settings(saveLighting)1506 set _settings( outline) 01506 set _settings(-heightmapscale) 50 1507 set _settings(-opacity) $_settings(-saveopacity) 1508 set _settings(-lighting) $_settings(-savelighting) 1509 set _settings(-outline) 0 1507 1510 } else { 1508 set _settings(heightmapScale) 0 1509 set _settings(lighting) 0 1510 set _settings(opacity) 100 1511 set _settings(outline) $_settings(saveOutline) 1512 } 1513 AdjustSetting lighting 1514 AdjustSetting opacity 1515 AdjustSetting outline 1511 set _settings(-heightmapscale) 0 1512 set _settings(-lighting) 0 1513 set _settings(-opacity) 1.0 1514 set _settings(-outline) $_settings(-saveoutline) 1515 } 1516 InitSettings -lighting -opacity -outline 1516 1517 set scale [GetHeightmapScale] 1517 1518 # Have to set the datasets individually because we are … … 1542 1543 SendCmd "camera mode image" 1543 1544 } 1544 if {$_settings( stretchToFit)} {1545 if {$_settings(-stretchtofit)} { 1545 1546 if {$scale == 0} { 1546 1547 SendCmd "camera aspect window" … … 1573 1574 StopBufferingCommands 1574 1575 } 1575 " isolineColor" {1576 "-isolinecolor" { 1576 1577 set color [$itk_component(isolinecolor) value] 1577 1578 if { $color == "none" } { 1578 if { $_settings( isolinesVisible) } {1579 if { $_settings(-isolinesvisible) } { 1579 1580 SendCmd "heightmap isolines 0" 1580 set _settings( isolinesVisible) 01581 set _settings(-isolinesvisible) 0 1581 1582 } 1582 1583 } else { 1583 if { !$_settings( isolinesVisible) } {1584 if { !$_settings(-isolinesvisible) } { 1584 1585 SendCmd "heightmap isolines 1" 1585 set _settings( isolinesVisible) 11586 set _settings(-isolinesvisible) 1 1586 1587 } 1587 1588 SendCmd "heightmap isolinecolor [Color2RGB $color]" … … 1589 1590 DrawLegend 1590 1591 } 1591 " isolinesVisible" {1592 "-isolinesvisible" { 1592 1593 set bool $_settings($what) 1593 1594 SendCmd "heightmap isolines $bool" 1594 1595 DrawLegend 1595 1596 } 1596 " legendVisible" {1597 "-legendvisible" { 1597 1598 if { !$_settings($what) } { 1598 1599 $itk_component(view) delete legend … … 1600 1601 DrawLegend 1601 1602 } 1602 " lighting" {1603 if { $_settings( isHeightmap) } {1604 set _settings( saveLighting) $_settings(lighting)1603 "-lighting" { 1604 if { $_settings(-isheightmap) } { 1605 set _settings(-savelighting) $_settings(-lighting) 1605 1606 set bool $_settings($what) 1606 1607 SendCmd "heightmap lighting $bool" … … 1609 1610 } 1610 1611 } 1611 " numIsolines" {1612 set _settings( numIsolines) [$itk_component(numisolines) value]1613 set _currentNumIsolines $_settings( numIsolines)1612 "-numisolines" { 1613 set _settings($what) [$itk_component(numisolines) value] 1614 set _currentNumIsolines $_settings($what) 1614 1615 UpdateContourList 1615 set _changed( numIsolines) 11616 set _changed($what) 1 1616 1617 SendCmd "heightmap contourlist [list $_contourList]" 1617 if {$_settings( colormapDiscrete)} {1618 set numColors [expr $_settings( numIsolines) + 1]1618 if {$_settings(-colormapdiscrete)} { 1619 set numColors [expr $_settings($what) + 1] 1619 1620 SendCmd "colormap res $numColors" 1620 1621 EventuallyRequestLegend … … 1623 1624 } 1624 1625 } 1625 "opacity" { 1626 set _changed(opacity) 1 1627 if { $_settings(isHeightmap) } { 1628 set _settings(saveOpacity) $_settings(opacity) 1629 set val $_settings(opacity) 1630 set sval [expr { 0.01 * double($val) }] 1631 SendCmd "heightmap opacity $sval" 1626 "-opacity" { 1627 set _changed($what) 1 1628 set _settings($what) [expr double($_currentOpacity) * 0.01] 1629 if { $_settings(-isheightmap) } { 1630 set _settings(-saveopacity) $_settings($what) 1631 SendCmd "heightmap opacity $_settings($what)" 1632 1632 } else { 1633 SendCmd "heightmap opacity 1 "1634 } 1635 } 1636 " outline" {1637 if { $_settings( isHeightmap) } {1633 SendCmd "heightmap opacity 1.0" 1634 } 1635 } 1636 "-outline" { 1637 if { $_settings(-isheightmap) } { 1638 1638 SendCmd "outline visible 0" 1639 1639 } else { 1640 set _settings( saveOutline) $_settings(outline)1641 set bool $_settings( outline)1640 set _settings(-saveoutline) $_settings($what) 1641 set bool $_settings($what) 1642 1642 SendCmd "outline visible $bool" 1643 1643 } 1644 1644 } 1645 " stretchToFit" {1645 "-stretchtofit" { 1646 1646 set bool $_settings($what) 1647 1647 if { $bool } { … … 1657 1657 Zoom reset 1658 1658 } 1659 " wireframe" {1659 "-wireframe" { 1660 1660 set bool $_settings($what) 1661 1661 SendCmd "heightmap wireframe $bool" … … 1793 1793 switch -- $itk_option(-mode) { 1794 1794 "heightmap" { 1795 set _settings( isHeightmap) 11795 set _settings(-isheightmap) 1 1796 1796 } 1797 1797 "contour" { 1798 set _settings( isHeightmap) 01798 set _settings(-isheightmap) 0 1799 1799 } 1800 1800 default { … … 1803 1803 } 1804 1804 if { !$_reset } { 1805 AdjustSetting isHeightmap1805 AdjustSetting -isheightmap 1806 1806 } 1807 1807 } … … 1855 1855 checkbutton $inner.legend \ 1856 1856 -text "Legend" \ 1857 -variable [itcl::scope _settings( legendVisible)] \1858 -command [itcl::code $this AdjustSetting legendVisible] \1857 -variable [itcl::scope _settings(-legendvisible)] \ 1858 -command [itcl::code $this AdjustSetting -legendvisible] \ 1859 1859 -font "Arial 9" 1860 1860 1861 1861 checkbutton $inner.wireframe \ 1862 1862 -text "Wireframe" \ 1863 -variable [itcl::scope _settings( wireframe)] \1864 -command [itcl::code $this AdjustSetting wireframe] \1863 -variable [itcl::scope _settings(-wireframe)] \ 1864 -command [itcl::code $this AdjustSetting -wireframe] \ 1865 1865 -font "Arial 9" 1866 1866 … … 1868 1868 checkbutton $inner.lighting \ 1869 1869 -text "Enable Lighting" \ 1870 -variable [itcl::scope _settings( lighting)] \1871 -command [itcl::code $this AdjustSetting lighting] \1870 -variable [itcl::scope _settings(-lighting)] \ 1871 -command [itcl::code $this AdjustSetting -lighting] \ 1872 1872 -font "Arial 9" 1873 1873 } { … … 1876 1876 checkbutton $inner.edges \ 1877 1877 -text "Edges" \ 1878 -variable [itcl::scope _settings( edges)] \1879 -command [itcl::code $this AdjustSetting edges] \1878 -variable [itcl::scope _settings(-edges)] \ 1879 -command [itcl::code $this AdjustSetting -edges] \ 1880 1880 -font "Arial 9" 1881 1881 … … 1883 1883 checkbutton $inner.outline \ 1884 1884 -text "Outline" \ 1885 -variable [itcl::scope _settings( outline)] \1886 -command [itcl::code $this AdjustSetting outline] \1885 -variable [itcl::scope _settings(-outline)] \ 1886 -command [itcl::code $this AdjustSetting -outline] \ 1887 1887 -font "Arial 9" 1888 1888 } { … … 1891 1891 checkbutton $inner.stretch \ 1892 1892 -text "Stretch to fit" \ 1893 -variable [itcl::scope _settings( stretchToFit)] \1894 -command [itcl::code $this AdjustSetting stretchToFit] \1893 -variable [itcl::scope _settings(-stretchtofit)] \ 1894 -command [itcl::code $this AdjustSetting -stretchtofit] \ 1895 1895 -font "Arial 9" 1896 1896 1897 1897 checkbutton $inner.isolines \ 1898 1898 -text "Isolines" \ 1899 -variable [itcl::scope _settings( isolinesVisible)] \1900 -command [itcl::code $this AdjustSetting isolinesVisible] \1899 -variable [itcl::scope _settings(-isolinesvisible)] \ 1900 -command [itcl::code $this AdjustSetting -isolinesvisible] \ 1901 1901 -font "Arial 9" 1902 1902 1903 1903 checkbutton $inner.colormapDiscrete \ 1904 1904 -text "Discrete Colormap" \ 1905 -variable [itcl::scope _settings( colormapDiscrete)] \1906 -command [itcl::code $this AdjustSetting colormapDiscrete] \1905 -variable [itcl::scope _settings(-colormapdiscrete)] \ 1906 -command [itcl::code $this AdjustSetting -colormapdiscrete] \ 1907 1907 -font "Arial 9" 1908 1908 … … 1916 1916 } 1917 1917 bind $inner.field <<Value>> \ 1918 [itcl::code $this AdjustSetting field]1918 [itcl::code $this AdjustSetting -field] 1919 1919 1920 1920 label $inner.colormap_l -text "Colormap" -font "Arial 9" … … 1943 1943 $itk_component(colormap) value "BCGYR" 1944 1944 bind $inner.colormap <<Value>> \ 1945 [itcl::code $this AdjustSetting colormap]1945 [itcl::code $this AdjustSetting -colormap] 1946 1946 1947 1947 label $inner.isolinecolor_l -text "Isolines Color" -font "Arial 9" … … 1963 1963 $itk_component(isolinecolor) value "black" 1964 1964 bind $inner.isolinecolor <<Value>> \ 1965 [itcl::code $this AdjustSetting isolineColor]1965 [itcl::code $this AdjustSetting -isolinecolor] 1966 1966 1967 1967 label $inner.background_l -text "Background Color" -font "Arial 9" … … 1975 1975 1976 1976 $itk_component(background) value "white" 1977 bind $inner.background <<Value>> [itcl::code $this AdjustSetting background] 1977 bind $inner.background <<Value>> \ 1978 [itcl::code $this AdjustSetting -background] 1978 1979 1979 1980 itk_component add opacity_l { … … 1984 1985 itk_component add opacity { 1985 1986 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1986 -variable [itcl::scope _ settings(opacity)] \1987 -variable [itcl::scope _currentOpacity] \ 1987 1988 -showvalue off \ 1988 -command [itcl::code $this AdjustSetting opacity]1989 -command [itcl::code $this AdjustSetting -opacity] 1989 1990 } 1990 1991 itk_component add scale_l { … … 1995 1996 itk_component add scale { 1996 1997 ::scale $inner.scale -from 0 -to 100 -orient horizontal \ 1997 -variable [itcl::scope _settings( heightmapScale)] \1998 -variable [itcl::scope _settings(-heightmapscale)] \ 1998 1999 -showvalue off \ 1999 -command [itcl::code $this AdjustSetting heightmapScale]2000 -command [itcl::code $this AdjustSetting -heightmapscale] 2000 2001 } 2001 2002 label $inner.numisolines_l -text "Number of Isolines" -font "Arial 9" … … 2004 2005 -min 0 -max 50 -font "arial 9" 2005 2006 } 2006 $itk_component(numisolines) value $_settings( numIsolines)2007 $itk_component(numisolines) value $_settings(-numisolines) 2007 2008 bind $itk_component(numisolines) <<Value>> \ 2008 [itcl::code $this AdjustSetting numIsolines]2009 [itcl::code $this AdjustSetting -numisolines] 2009 2010 2010 2011 frame $inner.separator1 -height 2 -relief sunken -bd 1 … … 2053 2054 checkbutton $inner.visible \ 2054 2055 -text "Axes" \ 2055 -variable [itcl::scope _settings( axisVisible)] \2056 -command [itcl::code $this AdjustSetting axisVisible] \2056 -variable [itcl::scope _settings(-axisvisible)] \ 2057 -command [itcl::code $this AdjustSetting -axisvisible] \ 2057 2058 -font "Arial 9" 2058 2059 checkbutton $inner.labels \ 2059 2060 -text "Axis Labels" \ 2060 -variable [itcl::scope _settings( axisLabels)] \2061 -command [itcl::code $this AdjustSetting axisLabels] \2061 -variable [itcl::scope _settings(-axislabels)] \ 2062 -command [itcl::code $this AdjustSetting -axislabels] \ 2062 2063 -font "Arial 9" 2063 2064 label $inner.grid_l -text "Grid" -font "Arial 9" 2064 2065 checkbutton $inner.xgrid \ 2065 2066 -text "X" \ 2066 -variable [itcl::scope _settings( axisXGrid)] \2067 -command [itcl::code $this AdjustSetting axisXGrid] \2067 -variable [itcl::scope _settings(-xgrid)] \ 2068 -command [itcl::code $this AdjustSetting -xgrid] \ 2068 2069 -font "Arial 9" 2069 2070 checkbutton $inner.ygrid \ 2070 2071 -text "Y" \ 2071 -variable [itcl::scope _settings( axisYGrid)] \2072 -command [itcl::code $this AdjustSetting axisYGrid] \2072 -variable [itcl::scope _settings(-ygrid)] \ 2073 -command [itcl::code $this AdjustSetting -ygrid] \ 2073 2074 -font "Arial 9" 2074 2075 checkbutton $inner.zgrid \ 2075 2076 -text "Z" \ 2076 -variable [itcl::scope _settings( axisZGrid)] \2077 -command [itcl::code $this AdjustSetting axisZGrid] \2077 -variable [itcl::scope _settings(-zgrid)] \ 2078 -command [itcl::code $this AdjustSetting -zgrid] \ 2078 2079 -font "Arial 9" 2079 2080 checkbutton $inner.minorticks \ 2080 2081 -text "Minor Ticks" \ 2081 -variable [itcl::scope _settings( axisMinorTicks)] \2082 -command [itcl::code $this AdjustSetting axisMinorTicks] \2082 -variable [itcl::scope _settings(-axisminorticks)] \ 2083 -command [itcl::code $this AdjustSetting -axisminorticks] \ 2083 2084 -font "Arial 9" 2084 2085 … … 2095 2096 "outer_edges" "outer" 2096 2097 $itk_component(axisflymode) value "static" 2097 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting axisFlymode]2098 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axisflymode] 2098 2099 2099 2100 blt::table $inner \ … … 2280 2281 array set style { 2281 2282 -color BCGYR 2282 -opacity 1 002283 -opacity 1.0 2283 2284 -levels 10 2284 2285 } … … 2296 2297 # the code to handle aberrant cases. 2297 2298 2298 if { $_changed( opacity) } {2299 set style(-opacity) $_settings( opacity)2300 } 2301 if { $_changed( numIsolines) } {2302 set style(-levels) $_settings (numIsolines)2303 } 2304 if { $_changed( colormap) } {2305 set style(-color) $_settings( colormap)2299 if { $_changed(-opacity) } { 2300 set style(-opacity) $_settings(-opacity) 2301 } 2302 if { $_changed(-numisolines) } { 2303 set style(-levels) $_settings-(numisolines) 2304 } 2305 if { $_changed(-colormap) } { 2306 set style(-color) $_settings(-colormap) 2306 2307 } 2307 2308 if { $_currentColormap == "" } { … … 2309 2310 } 2310 2311 if { [info exists style(-stretchtofit)] } { 2311 set _settings(stretchToFit) $style(-stretchtofit) 2312 AdjustSetting stretchToFit 2313 } 2314 set _currentOpacity $style(-opacity) 2312 set _settings(-stretchtofit) $style(-stretchtofit) 2313 AdjustSetting -stretchtofit 2314 } 2315 set _currentOpacity [expr $style(-opacity) * 100.0] 2316 2315 2317 if { $_currentNumIsolines != $style(-levels) } { 2316 2318 set _currentNumIsolines $style(-levels) 2317 set _settings( numIsolines) $_currentNumIsolines2319 set _settings(-numisolines) $_currentNumIsolines 2318 2320 $itk_component(numisolines) value $_currentNumIsolines 2319 2321 UpdateContourList … … 2322 2324 SendCmd "outline add $tag" 2323 2325 SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag" 2324 SendCmd "outline visible $_settings( outline) $tag"2326 SendCmd "outline visible $_settings(-outline) $tag" 2325 2327 set scale [GetHeightmapScale] 2326 2328 SendCmd "[list heightmap add contourlist $_contourList $scale $tag]" 2327 set _comp2scale($tag) $_settings( heightmapScale)2328 SendCmd "heightmap edges $_settings( edges) $tag"2329 SendCmd "heightmap wireframe $_settings( wireframe) $tag"2329 set _comp2scale($tag) $_settings(-heightmapscale) 2330 SendCmd "heightmap edges $_settings(-edges) $tag" 2331 SendCmd "heightmap wireframe $_settings(-wireframe) $tag" 2330 2332 SetCurrentColormap $style(-color) 2331 2333 set color [$itk_component(isolinecolor) value] 2332 2334 SendCmd "heightmap isolinecolor [Color2RGB $color] $tag" 2333 SendCmd "heightmap lighting $_settings( isHeightmap) $tag"2334 SendCmd "heightmap isolines $_settings( isolinesVisible) $tag"2335 SendCmd "heightmap surface $_settings( colormapVisible) $tag"2335 SendCmd "heightmap lighting $_settings(-isheightmap) $tag" 2336 SendCmd "heightmap isolines $_settings(-isolinesvisible) $tag" 2337 SendCmd "heightmap surface $_settings(-colormapvisible) $tag" 2336 2338 } 2337 2339 … … 2392 2394 } 2393 2395 set x [expr $w - 2] 2394 if { !$_settings( legendVisible) } {2396 if { !$_settings(-legendvisible) } { 2395 2397 $c delete legend 2396 2398 return … … 2431 2433 array unset _isolines 2432 2434 if { $color != "none" && [info exists _limits($_curFldName)] && 2433 $_settings( isolinesVisible) && $_currentNumIsolines > 0 } {2435 $_settings(-isolinesvisible) && $_currentNumIsolines > 0 } { 2434 2436 2435 2437 foreach { vmin vmax } $_limits($_curFldName) break … … 2598 2600 invoke { 2599 2601 $itk_component(field) value $_curFldLabel 2600 AdjustSetting field2602 AdjustSetting -field 2601 2603 } 2602 2604 default { … … 2607 2609 2608 2610 itcl::body Rappture::VtkHeightmapViewer::GetHeightmapScale {} { 2609 if { $_settings( isHeightmap) } {2610 set val $_settings( heightmapScale)2611 if { $_settings(-isheightmap) } { 2612 set val $_settings(-heightmapscale) 2611 2613 set sval [expr { $val >= 50 ? double($val)/50.0 : 1.0/(2.0-(double($val)/50.0)) }] 2612 2614 return $sval -
branches/1.3/gui/scripts/vtkisosurfaceviewer.tcl
r4397 r4399 243 243 -legendvisible 1 244 244 -numcontours 10 245 -x axisgrid0245 -xgrid 0 246 246 -xcutplaneposition 50 247 247 -xcutplanevisible 1 248 -y axisgrid0248 -ygrid 0 249 249 -ycutplaneposition 50 250 250 -ycutplanevisible 1 251 -z axisgrid0251 -zgrid 0 252 252 -zcutplaneposition 50 253 253 -zcutplanevisible 1 … … 959 959 PanCamera 960 960 set _first "" 961 InitSettings -x axisgrid -yaxisgrid -zaxisgrid -axismode \961 InitSettings -xgrid -ygrid -zgrid -axismode \ 962 962 -axesvisible -axislabelsvisible 963 963 foreach axis { x y z } { … … 1332 1332 SendCmd "axis labels all $bool" 1333 1333 } 1334 "-x axisgrid" - "-yaxisgrid" - "-zaxisgrid" {1334 "-xgrid" - "-ygrid" - "-zgrid" { 1335 1335 set axis [string tolower [string range $what 1 1]] 1336 1336 set bool $_settings($what) … … 1780 1780 checkbutton $inner.gridx \ 1781 1781 -text "Show X Grid" \ 1782 -variable [itcl::scope _settings(-x axisgrid)] \1783 -command [itcl::code $this AdjustSetting -x axisgrid] \1782 -variable [itcl::scope _settings(-xgrid)] \ 1783 -command [itcl::code $this AdjustSetting -xgrid] \ 1784 1784 -font "Arial 9" 1785 1785 checkbutton $inner.gridy \ 1786 1786 -text "Show Y Grid" \ 1787 -variable [itcl::scope _settings(-y axisgrid)] \1788 -command [itcl::code $this AdjustSetting -y axisgrid] \1787 -variable [itcl::scope _settings(-ygrid)] \ 1788 -command [itcl::code $this AdjustSetting -ygrid] \ 1789 1789 -font "Arial 9" 1790 1790 checkbutton $inner.gridz \ 1791 1791 -text "Show Z Grid" \ 1792 -variable [itcl::scope _settings(-z axisgrid)] \1793 -command [itcl::code $this AdjustSetting -z axisgrid] \1792 -variable [itcl::scope _settings(-zgrid)] \ 1793 -command [itcl::code $this AdjustSetting -zgrid] \ 1794 1794 -font "Arial 9" 1795 1795
Note: See TracChangeset
for help on using the changeset viewer.