Changeset 4201
- Timestamp:
- Mar 4, 2014, 12:13:02 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/gui/scripts/vtkisosurfaceviewer.tcl
r4186 r4201 188 188 $_dispatcher register !xcutplane 189 189 $_dispatcher dispatch $this !xcutplane \ 190 "[itcl::code $this AdjustSetting cutplaneXPosition]; list"190 "[itcl::code $this AdjustSetting -xcutplaneposition]; list" 191 191 192 192 # Y-Cutplane event 193 193 $_dispatcher register !ycutplane 194 194 $_dispatcher dispatch $this !ycutplane \ 195 "[itcl::code $this AdjustSetting cutplaneYPosition]; list"195 "[itcl::code $this AdjustSetting -ycutplaneposition]; list" 196 196 197 197 # Z-Cutplane event 198 198 $_dispatcher register !zcutplane 199 199 $_dispatcher dispatch $this !zcutplane \ 200 "[itcl::code $this AdjustSetting cutplaneZPosition]; list"200 "[itcl::code $this AdjustSetting -zcutplaneposition]; list" 201 201 202 202 # … … 222 222 $_arcball quaternion $q 223 223 224 array set _settings [subst { 225 background black 226 colormap BCGYR 227 colormapVisible 1 228 field "Default" 229 isolineColor white 230 axesVisible 1 231 axisLabelsVisible 1 232 axisXGrid 0 233 axisYGrid 0 234 axisZGrid 0 235 cutplaneEdges 0 236 cutplaneLighting 1 237 cutplanePreinterp 1 238 cutplaneOpacity 100 239 cutplaneVisible 0 240 cutplaneWireframe 0 241 cutplaneXPosition 50 242 cutplaneXVisible 1 243 cutplaneYPosition 50 244 cutplaneYVisible 1 245 cutplaneZPosition 50 246 cutplaneZVisible 1 247 isosurfaceEdges 0 248 isosurfaceLighting 1 249 isosurfaceOpacity 60 250 saveIsosurfaceOpacity 60 251 isosurfaceOutline 0 252 isosurfaceVisible 1 253 isosurfaceWireframe 0 254 legendVisible 1 255 numContours 10 256 }] 224 array set _settings { 225 -background black 226 -colormap BCGYR 227 -colormapvisible 1 228 -field "Default" 229 -isolinecolor white 230 -axesvisible 1 231 -axislabelsvisible 1 232 -cutplaneedges 0 233 -cutplanelighting 1 234 -cutplaneopacity 100 235 -cutplanepreinterp 1 236 -cutplanesvisible 0 237 -cutplanewireframe 0 238 -isosurfaceedges 0 239 -isosurfacelighting 1 240 -isosurfaceopacity 60 241 -isosurfaceoutline 0 242 -isosurfacevisible 1 243 -isosurfacewireframe 0 244 -legendvisible 1 245 -numcontours 10 246 -xaxisgrid 0 247 -xcutplaneposition 50 248 -xcutplanevisible 1 249 -yaxisgrid 0 250 -ycutplaneposition 50 251 -ycutplanevisible 1 252 -zaxisgrid 0 253 -zcutplaneposition 50 254 -zcutplanevisible 1 255 } 257 256 array set _changed { 258 isosurfaceOpacity 0259 colormap 0260 numContours 0257 -isosurfaceopacity 0 258 -colormap 0 259 -numcontours 0 261 260 } 262 261 … … 271 270 itk_component add fieldmenu { 272 271 menu $itk_component(plotarea).menu -bg black -fg white -relief flat \ 273 -tearoff no272 -tearoff 0 274 273 } { 275 274 usual … … 338 337 -onimage [Rappture::icon volume-on] \ 339 338 -offimage [Rappture::icon volume-off] \ 340 -variable [itcl::scope _settings( isosurfaceVisible)] \341 -command [itcl::code $this AdjustSetting isosurfaceVisible]339 -variable [itcl::scope _settings(-isosurfacevisible)] \ 340 -command [itcl::code $this AdjustSetting -isosurfacevisible] 342 341 } 343 342 $itk_component(contour) select … … 350 349 -onimage [Rappture::icon cutbutton] \ 351 350 -offimage [Rappture::icon cutbutton] \ 352 -variable [itcl::scope _settings( cutplaneVisible)] \353 -command [itcl::code $this AdjustSetting cutplaneVisible]351 -variable [itcl::scope _settings(-cutplanesvisible)] \ 352 -command [itcl::code $this AdjustSetting -cutplanesvisible] 354 353 } 355 354 Rappture::Tooltip::for $itk_component(cutplane) \ … … 865 864 } 866 865 $_image(plot) configure -data $bytes 867 set time [clock seconds] 868 set date [clock format $time] 869 #puts stderr "$date: received image [image width $_image(plot)]x[image height $_image(plot)] image>" 866 #set time [clock seconds] 867 #set date [clock format $time] 868 #set w [image width $_image(plot)] 869 #set h [image height $_image(plot)] 870 #puts stderr "$date: received image ${w}x${h} image" 870 871 if { $_start > 0 } { 871 872 set finish [clock clicks -milliseconds] … … 959 960 PanCamera 960 961 set _first "" 961 InitSettings axisXGrid axisYGrid axisZGrid axisMode \962 axesVisible axisLabelsVisible962 InitSettings -xaxisgrid -yaxisgrid -zaxisgrid -axismode \ 963 -axesvisible -axislabelsvisible 963 964 foreach axis { x y z } { 964 965 SendCmd "axis lformat $axis %g" … … 1039 1040 $itk_component(field) value $_curFldLabel 1040 1041 } 1041 InitSettings cutplaneVisible isosurfaceOutline1042 InitSettings -cutplanesvisible -isosurfacevisible -isosurfaceoutline 1042 1043 if { $_reset } { 1043 1044 # These are settings that rely on a dataset being loaded. 1044 1045 InitSettings \ 1045 isosurfaceLighting \ 1046 field \ 1047 isosurfaceEdges isosurfaceLighting isosurfaceOpacity \ 1048 isosurfaceWireframe \ 1049 cutplaneXPosition cutplaneYPosition cutplaneZPosition \ 1050 cutplaneXVisible cutplaneYVisible cutplaneZVisible \ 1051 cutplanePreinterp numContours 1046 -isosurfacelighting \ 1047 -field \ 1048 -isosurfacevisible \ 1049 -isosurfaceedges -isosurfacelighting -isosurfaceopacity \ 1050 -isosurfacewireframe \ 1051 -cutplanesvisible \ 1052 -xcutplaneposition -ycutplaneposition -zcutplaneposition \ 1053 -xcutplanevisible -ycutplanevisible -zcutplanevisible \ 1054 -cutplanepreinterp -numcontours 1052 1055 1053 1056 Zoom reset … … 1321 1324 DrawLegend 1322 1325 } 1323 " axesVisible" {1324 set bool $_settings( axesVisible)1326 "-axesvisible" { 1327 set bool $_settings(-axesvisible) 1325 1328 SendCmd "axis visible all $bool" 1326 1329 } 1327 " axisLabelsVisible" {1328 set bool $_settings( axisLabelsVisible)1330 "-axislabelsvisible" { 1331 set bool $_settings(-axislabelsvisible) 1329 1332 SendCmd "axis labels all $bool" 1330 1333 } 1331 " axisXGrid" - "axisYGrid" - "axisZGrid" {1332 set axis [string tolower [string range $what 4 4]]1334 "-xaxisgrid" - "-yaxisgrid" - "-zaxisgrid" { 1335 set axis [string tolower [string range $what 1 1]] 1333 1336 set bool $_settings($what) 1334 1337 SendCmd "axis grid $axis $bool" 1335 1338 } 1336 " axisMode" {1339 "-axismode" { 1337 1340 set mode [$itk_component(axisMode) value] 1338 1341 set mode [$itk_component(axisMode) translate $mode] … … 1340 1343 SendCmd "axis flymode $mode" 1341 1344 } 1342 " cutplaneEdges" {1345 "-cutplaneedges" { 1343 1346 set bool $_settings($what) 1344 1347 SendCmd "cutplane edges $bool" 1345 1348 } 1346 " cutplaneVisible" {1349 "-cutplanesvisible" { 1347 1350 set bool $_settings($what) 1348 1351 SendCmd "cutplane visible $bool" 1349 1352 } 1350 " cutplaneWireframe" {1353 "-cutplanewireframe" { 1351 1354 set bool $_settings($what) 1352 1355 SendCmd "cutplane wireframe $bool" 1353 1356 } 1354 " cutplaneLighting" {1357 "-cutplanelighting" { 1355 1358 set bool $_settings($what) 1356 1359 SendCmd "cutplane lighting $bool" 1357 1360 } 1358 " cutplaneOpacity" {1361 "-cutplaneopacity" { 1359 1362 set val $_settings($what) 1360 1363 set sval [expr { 0.01 * double($val) }] 1361 1364 SendCmd "cutplane opacity $sval" 1362 1365 } 1363 " cutplanePreinterp" {1366 "-cutplanepreinterp" { 1364 1367 set bool $_settings($what) 1365 1368 SendCmd "cutplane preinterp $bool" 1366 1369 } 1367 " cutplaneXVisible" - "cutplaneYVisible" - "cutplaneZVisible" {1368 set axis [string tolower [string range $what 8 8]]1370 "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" { 1371 set axis [string tolower [string range $what 1 1]] 1369 1372 set bool $_settings($what) 1370 1373 if { $bool } { … … 1377 1380 SendCmd "cutplane axis $axis $bool" 1378 1381 } 1379 " cutplaneXPosition" - "cutplaneYPosition" - "cutplaneZPosition" {1380 set axis [string tolower [string range $what 8 8]]1382 "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" { 1383 set axis [string tolower [string range $what 1 1]] 1381 1384 set pos [expr $_settings($what) * 0.01] 1382 1385 SendCmd "cutplane slice ${axis} ${pos}" 1383 1386 set _cutplanePending 0 1384 1387 } 1385 " colormap" {1386 set _changed( colormap) 11388 "-colormap" { 1389 set _changed(-colormap) 1 1387 1390 StartBufferingCommands 1388 1391 set color [$itk_component(colormap) value] 1389 set _settings( colormap) $color1392 set _settings(-colormap) $color 1390 1393 if { $color == "none" } { 1391 if { $_settings( colormapVisible) } {1394 if { $_settings(-colormapvisible) } { 1392 1395 SendCmd "contour3d colormode constant {}" 1393 set _settings( colormapVisible) 01396 set _settings(-colormapvisible) 0 1394 1397 } 1395 1398 } else { 1396 if { !$_settings( colormapVisible) } {1399 if { !$_settings(-colormapvisible) } { 1397 1400 SendCmd "contour3d colormode $_colorMode $_curFldName" 1398 set _settings( colormapVisible) 11401 set _settings(-colormapvisible) 1 1399 1402 } 1400 1403 SetCurrentColormap $color … … 1403 1406 EventuallyRequestLegend 1404 1407 } 1405 " numContours" {1406 set _settings( numContours) [$itk_component(numcontours) value]1407 set _currentNumContours $_settings( numContours)1408 "-numcontours" { 1409 set _settings($what) [$itk_component(numcontours) value] 1410 set _currentNumContours $_settings($what) 1408 1411 UpdateContourList 1409 set _changed( numContours) 11412 set _changed($what) 1 1410 1413 SendCmd "contour3d contourlist [list $_contourList]" 1411 1414 DrawLegend 1412 1415 } 1413 " isosurfaceWireframe" {1414 set bool $_settings( isosurfaceWireframe)1416 "-isosurfacewireframe" { 1417 set bool $_settings($what) 1415 1418 SendCmd "contour3d wireframe $bool" 1416 1419 } 1417 " isosurfaceVisible" {1418 set bool $_settings( isosurfaceVisible)1420 "-isosurfacevisible" { 1421 set bool $_settings($what) 1419 1422 SendCmd "contour3d visible $bool" 1420 1423 if { $bool } { … … 1427 1430 DrawLegend 1428 1431 } 1429 " isosurfaceLighting" {1430 set bool $_settings( isosurfaceLighting)1432 "-isosurfacelighting" { 1433 set bool $_settings($what) 1431 1434 SendCmd "contour3d lighting $bool" 1432 1435 } 1433 " isosurfaceEdges" {1434 set bool $_settings( isosurfaceEdges)1436 "-isosurfaceedges" { 1437 set bool $_settings($what) 1435 1438 SendCmd "contour3d edges $bool" 1436 1439 } 1437 " isosurfaceOutline" {1438 set bool $_settings( isosurfaceOutline)1440 "-isosurfaceoutline" { 1441 set bool $_settings($what) 1439 1442 SendCmd "outline visible $bool" 1440 1443 } 1441 " isolineColor" {1444 "-isolinecolor" { 1442 1445 set color [$itk_component(isolineColor) value] 1443 set _settings( isolineColor) $color1446 set _settings($what) $color 1444 1447 DrawLegend 1445 1448 } 1446 " isosurfaceOpacity" {1447 set val $_settings( isosurfaceOpacity)1449 "-isosurfaceopacity" { 1450 set val $_settings($what) 1448 1451 set sval [expr { 0.01 * double($val) }] 1449 1452 SendCmd "contour3d opacity $sval" 1450 1453 } 1451 " field" {1454 "-field" { 1452 1455 set label [$itk_component(field) value] 1453 1456 set fname [$itk_component(field) translate $label] 1454 set _settings( field) $fname1457 set _settings($what) $fname 1455 1458 if { [info exists _fields($fname)] } { 1456 1459 foreach { label units components } $_fields($fname) break … … 1474 1477 DrawLegend 1475 1478 } 1476 " legendVisible" {1477 if { !$_settings( legendVisible) } {1479 "-legendvisible" { 1480 if { !$_settings($what) } { 1478 1481 $itk_component(view) delete legend 1479 1482 } … … 1578 1581 checkbutton $inner.contour \ 1579 1582 -text "Isosurfaces" \ 1580 -variable [itcl::scope _settings( isosurfaceVisible)] \1581 -command [itcl::code $this AdjustSetting isosurfaceVisible] \1583 -variable [itcl::scope _settings(-isosurfacevisible)] \ 1584 -command [itcl::code $this AdjustSetting -isosurfacevisible] \ 1582 1585 -font "Arial 9" 1583 1586 1584 1587 checkbutton $inner.wireframe \ 1585 1588 -text "Wireframe" \ 1586 -variable [itcl::scope _settings( isosurfaceWireframe)] \1587 -command [itcl::code $this AdjustSetting isosurfaceWireframe] \1589 -variable [itcl::scope _settings(-isosurfacewireframe)] \ 1590 -command [itcl::code $this AdjustSetting -isosurfacewireframe] \ 1588 1591 -font "Arial 9" 1589 1592 1590 1593 checkbutton $inner.lighting \ 1591 1594 -text "Enable Lighting" \ 1592 -variable [itcl::scope _settings( isosurfaceLighting)] \1593 -command [itcl::code $this AdjustSetting isosurfaceLighting] \1595 -variable [itcl::scope _settings(-isosurfacelighting)] \ 1596 -command [itcl::code $this AdjustSetting -isosurfacelighting] \ 1594 1597 -font "Arial 9" 1595 1598 1596 1599 checkbutton $inner.edges \ 1597 1600 -text "Edges" \ 1598 -variable [itcl::scope _settings( isosurfaceEdges)] \1599 -command [itcl::code $this AdjustSetting isosurfaceEdges] \1601 -variable [itcl::scope _settings(-isosurfaceedges)] \ 1602 -command [itcl::code $this AdjustSetting -isosurfaceedges] \ 1600 1603 -font "Arial 9" 1601 1604 1602 1605 checkbutton $inner.outline \ 1603 1606 -text "Outline" \ 1604 -variable [itcl::scope _settings( isosurfaceOutline)] \1605 -command [itcl::code $this AdjustSetting isosurfaceOutline] \1607 -variable [itcl::scope _settings(-isosurfaceoutline)] \ 1608 -command [itcl::code $this AdjustSetting -isosurfaceoutline] \ 1606 1609 -font "Arial 9" 1607 1610 1608 1611 checkbutton $inner.legend \ 1609 1612 -text "Legend" \ 1610 -variable [itcl::scope _settings( legendVisible)] \1611 -command [itcl::code $this AdjustSetting legendVisible] \1613 -variable [itcl::scope _settings(-legendvisible)] \ 1614 -command [itcl::code $this AdjustSetting -legendvisible] \ 1612 1615 -font "Arial 9" 1613 1616 1614 1617 label $inner.linecolor_l -text "Isolines" -font "Arial 9" 1615 1618 itk_component add isolineColor { 1616 Rappture::Combobox $inner.linecolor -width 10 -editable no1619 Rappture::Combobox $inner.linecolor -width 10 -editable 0 1617 1620 } 1618 1621 $inner.linecolor choices insert end \ … … 1634 1637 label $inner.background_l -text "Background" -font "Arial 9" 1635 1638 itk_component add background { 1636 Rappture::Combobox $inner.background -width 10 -editable no1639 Rappture::Combobox $inner.background -width 10 -editable 0 1637 1640 } 1638 1641 $inner.background choices insert end \ … … 1641 1644 "grey" "grey" 1642 1645 1643 $itk_component(background) value $_settings(background) 1644 bind $inner.background <<Value>> [itcl::code $this AdjustSetting background] 1646 $itk_component(background) value $_settings(-background) 1647 bind $inner.background <<Value>> \ 1648 [itcl::code $this AdjustSetting -background] 1645 1649 1646 1650 label $inner.opacity_l -text "Opacity" -font "Arial 9" 1647 1651 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1648 -variable [itcl::scope _settings( isosurfaceOpacity)] \1652 -variable [itcl::scope _settings(-isosurfaceopacity)] \ 1649 1653 -width 10 \ 1650 1654 -showvalue off \ 1651 -command [itcl::code $this AdjustSetting isosurfaceOpacity]1655 -command [itcl::code $this AdjustSetting -isosurfaceopacity] 1652 1656 1653 1657 label $inner.scale_l -text "Scale" -font "Arial 9" 1654 1658 ::scale $inner.scale -from 1 -to 100 -orient horizontal \ 1655 -variable [itcl::scope _settings( contour-scale)] \1659 -variable [itcl::scope _settings(-contourscale)] \ 1656 1660 -width 10 \ 1657 1661 -showvalue off \ 1658 -command [itcl::code $this AdjustSetting contour-scale]1662 -command [itcl::code $this AdjustSetting -contourscale] 1659 1663 1660 1664 itk_component add field_l { … … 1664 1668 } 1665 1669 itk_component add field { 1666 Rappture::Combobox $inner.field -width 10 -editable no1670 Rappture::Combobox $inner.field -width 10 -editable 0 1667 1671 } 1668 1672 bind $inner.field <<Value>> \ 1669 [itcl::code $this AdjustSetting field]1673 [itcl::code $this AdjustSetting -field] 1670 1674 1671 1675 label $inner.colormap_l -text "Colormap" -font "Arial 9" 1672 1676 itk_component add colormap { 1673 Rappture::Combobox $inner.colormap -width 10 -editable no1677 Rappture::Combobox $inner.colormap -width 10 -editable 0 1674 1678 } 1675 1679 $inner.colormap choices insert end \ … … 1693 1697 $itk_component(colormap) value "BCGYR" 1694 1698 bind $inner.colormap <<Value>> \ 1695 [itcl::code $this AdjustSetting colormap]1699 [itcl::code $this AdjustSetting -colormap] 1696 1700 1697 1701 label $inner.numcontours_l -text "Number of Isosurfaces" -font "Arial 9" … … 1700 1704 -min 0 -max 50 -font "arial 9" 1701 1705 } 1702 $itk_component(numcontours) value $_settings( numContours)1706 $itk_component(numcontours) value $_settings(-numcontours) 1703 1707 bind $itk_component(numcontours) <<Value>> \ 1704 [itcl::code $this AdjustSetting numContours]1708 [itcl::code $this AdjustSetting -numcontours] 1705 1709 1706 1710 blt::table $inner \ … … 1739 1743 checkbutton $inner.visible \ 1740 1744 -text "Show Axes" \ 1741 -variable [itcl::scope _settings( axesVisible)] \1742 -command [itcl::code $this AdjustSetting axesVisible] \1745 -variable [itcl::scope _settings(-axesvisible)] \ 1746 -command [itcl::code $this AdjustSetting -axesvisible] \ 1743 1747 -font "Arial 9" 1744 1748 1745 1749 checkbutton $inner.labels \ 1746 1750 -text "Show Axis Labels" \ 1747 -variable [itcl::scope _settings( axisLabelsVisible)] \1748 -command [itcl::code $this AdjustSetting axisLabelsVisible] \1751 -variable [itcl::scope _settings(-axislabelsvisible)] \ 1752 -command [itcl::code $this AdjustSetting -axislabelsvisible] \ 1749 1753 -font "Arial 9" 1750 1754 1751 1755 checkbutton $inner.gridx \ 1752 1756 -text "Show X Grid" \ 1753 -variable [itcl::scope _settings( axisXGrid)] \1754 -command [itcl::code $this AdjustSetting axisXGrid] \1757 -variable [itcl::scope _settings(-xaxisgrid)] \ 1758 -command [itcl::code $this AdjustSetting -xaxisgrid] \ 1755 1759 -font "Arial 9" 1756 1760 checkbutton $inner.gridy \ 1757 1761 -text "Show Y Grid" \ 1758 -variable [itcl::scope _settings( axisYGrid)] \1759 -command [itcl::code $this AdjustSetting axisYGrid] \1762 -variable [itcl::scope _settings(-yaxisgrid)] \ 1763 -command [itcl::code $this AdjustSetting -yaxisgrid] \ 1760 1764 -font "Arial 9" 1761 1765 checkbutton $inner.gridz \ 1762 1766 -text "Show Z Grid" \ 1763 -variable [itcl::scope _settings( axisZGrid)] \1764 -command [itcl::code $this AdjustSetting axisZGrid] \1767 -variable [itcl::scope _settings(-zaxisgrid)] \ 1768 -command [itcl::code $this AdjustSetting -zaxisgrid] \ 1765 1769 -font "Arial 9" 1766 1770 … … 1768 1772 1769 1773 itk_component add axisMode { 1770 Rappture::Combobox $inner.mode -width 10 -editable no1774 Rappture::Combobox $inner.mode -width 10 -editable 0 1771 1775 } 1772 1776 $inner.mode choices insert end \ … … 1776 1780 "outer_edges" "outer" 1777 1781 $itk_component(axisMode) value "static" 1778 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting axisMode]1782 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axismode] 1779 1783 1780 1784 blt::table $inner \ … … 1852 1856 checkbutton $inner.visible \ 1853 1857 -text "Cutplanes" \ 1854 -variable [itcl::scope _settings( cutplaneVisible)] \1855 -command [itcl::code $this AdjustSetting cutplaneVisible] \1858 -variable [itcl::scope _settings(-cutplanesvisible)] \ 1859 -command [itcl::code $this AdjustSetting -cutplanesvisible] \ 1856 1860 -font "Arial 9" 1857 1861 1858 1862 checkbutton $inner.wireframe \ 1859 1863 -text "Wireframe" \ 1860 -variable [itcl::scope _settings( cutplaneWireframe)] \1861 -command [itcl::code $this AdjustSetting cutplaneWireframe] \1864 -variable [itcl::scope _settings(-cutplanewireframe)] \ 1865 -command [itcl::code $this AdjustSetting -cutplanewireframe] \ 1862 1866 -font "Arial 9" 1863 1867 1864 1868 checkbutton $inner.lighting \ 1865 1869 -text "Enable Lighting" \ 1866 -variable [itcl::scope _settings( cutplaneLighting)] \1867 -command [itcl::code $this AdjustSetting cutplaneLighting] \1870 -variable [itcl::scope _settings(-cutplanelighting)] \ 1871 -command [itcl::code $this AdjustSetting -cutplanelighting] \ 1868 1872 -font "Arial 9" 1869 1873 1870 1874 checkbutton $inner.edges \ 1871 1875 -text "Edges" \ 1872 -variable [itcl::scope _settings( cutplaneEdges)] \1873 -command [itcl::code $this AdjustSetting cutplaneEdges] \1876 -variable [itcl::scope _settings(-cutplaneedges)] \ 1877 -command [itcl::code $this AdjustSetting -cutplaneedges] \ 1874 1878 -font "Arial 9" 1875 1879 1876 1880 checkbutton $inner.preinterp \ 1877 1881 -text "Interpolate Scalars" \ 1878 -variable [itcl::scope _settings( cutplanePreinterp)] \1879 -command [itcl::code $this AdjustSetting cutplanePreinterp] \1882 -variable [itcl::scope _settings(-cutplanepreinterp)] \ 1883 -command [itcl::code $this AdjustSetting -cutplanepreinterp] \ 1880 1884 -font "Arial 9" 1881 1885 1882 1886 label $inner.opacity_l -text "Opacity" -font "Arial 9" 1883 1887 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1884 -variable [itcl::scope _settings( cutplaneOpacity)] \1888 -variable [itcl::scope _settings(-cutplaneopacity)] \ 1885 1889 -width 10 \ 1886 1890 -showvalue off \ 1887 -command [itcl::code $this AdjustSetting cutplaneOpacity]1888 $inner.opacity set $_settings( cutplaneOpacity)1891 -command [itcl::code $this AdjustSetting -cutplaneopacity] 1892 $inner.opacity set $_settings(-cutplaneopacity) 1889 1893 1890 1894 # X-value slicer... … … 1893 1897 -onimage [Rappture::icon x-cutplane-red] \ 1894 1898 -offimage [Rappture::icon x-cutplane-red] \ 1895 -command [itcl::code $this AdjustSetting cutplaneXVisible] \1896 -variable [itcl::scope _settings( cutplaneXVisible)] \1899 -command [itcl::code $this AdjustSetting -xcutplanevisible] \ 1900 -variable [itcl::scope _settings(-xcutplanevisible)] \ 1897 1901 } 1898 1902 Rappture::Tooltip::for $itk_component(xbutton) \ … … 1901 1905 itk_component add xposition { 1902 1906 ::scale $inner.xval -from 100 -to 0 \ 1903 -width 10 -orient vertical -showvalue yes\1907 -width 10 -orient vertical -showvalue 1 \ 1904 1908 -borderwidth 1 -highlightthickness 0 \ 1905 1909 -command [itcl::code $this EventuallySetCutplane x] \ 1906 -variable [itcl::scope _settings( cutplaneXPosition)] \1910 -variable [itcl::scope _settings(-xcutplaneposition)] \ 1907 1911 -foreground red2 -font "Arial 9 bold" 1908 1912 } { … … 1921 1925 -onimage [Rappture::icon y-cutplane-green] \ 1922 1926 -offimage [Rappture::icon y-cutplane-green] \ 1923 -command [itcl::code $this AdjustSetting cutplaneYVisible] \1924 -variable [itcl::scope _settings( cutplaneYVisible)] \1927 -command [itcl::code $this AdjustSetting -ycutplanevisible] \ 1928 -variable [itcl::scope _settings(-ycutplanevisible)] \ 1925 1929 } 1926 1930 Rappture::Tooltip::for $itk_component(ybutton) \ … … 1930 1934 itk_component add yposition { 1931 1935 ::scale $inner.yval -from 100 -to 0 \ 1932 -width 10 -orient vertical -showvalue yes\1936 -width 10 -orient vertical -showvalue 1 \ 1933 1937 -borderwidth 1 -highlightthickness 0 \ 1934 1938 -command [itcl::code $this EventuallySetCutplane y] \ 1935 -variable [itcl::scope _settings( cutplaneYPosition)] \1939 -variable [itcl::scope _settings(-ycutplaneposition)] \ 1936 1940 -foreground green3 -font "Arial 9 bold" 1937 1941 } { … … 1950 1954 -onimage [Rappture::icon z-cutplane-blue] \ 1951 1955 -offimage [Rappture::icon z-cutplane-blue] \ 1952 -command [itcl::code $this AdjustSetting cutplaneZVisible] \1953 -variable [itcl::scope _settings( cutplaneZVisible)] \1956 -command [itcl::code $this AdjustSetting -zcutplanevisible] \ 1957 -variable [itcl::scope _settings(-zcutplanevisible)] \ 1954 1958 } { 1955 1959 usual … … 1962 1966 itk_component add zposition { 1963 1967 ::scale $inner.zval -from 100 -to 0 \ 1964 -width 10 -orient vertical -showvalue yes\1968 -width 10 -orient vertical -showvalue 1 \ 1965 1969 -borderwidth 1 -highlightthickness 0 \ 1966 1970 -command [itcl::code $this EventuallySetCutplane z] \ 1967 -variable [itcl::scope _settings( cutplaneZPosition)] \1971 -variable [itcl::scope _settings(-zcutplaneposition)] \ 1968 1972 -foreground blue3 -font "Arial 9 bold" 1969 1973 } { … … 2114 2118 -outline 0 2115 2119 -levels 10 2120 -cutplanesvisible 0 2121 -xcutplanevisible 1 2122 -ycutplanevisible 1 2123 -zcutplanevisible 1 2124 -xcutplaneposition 50 2125 -ycutplaneposition 50 2126 -zcutplaneposition 50 2127 -isosurfacevisible 1 2116 2128 } 2117 2129 array set style [$dataobj style $comp] … … 2131 2143 # the code to handle aberrant cases. 2132 2144 2133 if { $_changed( isosurfaceOpacity) } {2134 set style(-opacity) $_settings( isosurfaceOpacity)2135 } 2136 if { $_changed( numContours) } {2137 set style(-levels) $_settings( numContours)2138 } 2139 if { $_changed( colormap) } {2140 set style(-color) $_settings( colormap)2145 if { $_changed(-isosurfaceopacity) } { 2146 set style(-opacity) $_settings(-isosurfaceopacity) 2147 } 2148 if { $_changed(-numcontours) } { 2149 set style(-levels) $_settings(-numcontours) 2150 } 2151 if { $_changed(-colormap) } { 2152 set style(-color) $_settings(-colormap) 2141 2153 } 2142 2154 if { $_currentColormap == "" } { … … 2147 2159 if { $_currentNumContours != $style(-levels) } { 2148 2160 set _currentNumContours $style(-levels) 2149 set _settings( numContours) $_currentNumContours2161 set _settings(-numcontours) $_currentNumContours 2150 2162 $itk_component(numcontours) value $_currentNumContours 2151 2163 UpdateContourList 2152 2164 DrawLegend 2153 2165 } 2166 set _settings(-isosurfacevisible) $style(-isosurfacevisible) 2167 set _settings(-cutplanesvisible) $style(-cutplanesvisible) 2168 set _settings(-xcutplanevisible) $style(-xcutplanevisible) 2169 set _settings(-ycutplanevisible) $style(-ycutplanevisible) 2170 set _settings(-zcutplanevisible) $style(-zcutplanevisible) 2171 set _settings(-xcutplaneposition) $style(-xcutplaneposition) 2172 set _settings(-ycutplaneposition) $style(-ycutplaneposition) 2173 set _settings(-zcutplaneposition) $style(-zcutplaneposition) 2174 2154 2175 SendCmd [list contour3d add contourlist $_contourList $tag] 2155 2176 SendCmd "contour3d edges $style(-edges) $tag" … … 2157 2178 SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag" 2158 2179 SendCmd "outline visible $style(-outline) $tag" 2159 set _settings( isosurfaceOutline) $style(-outline)2160 set _settings( isosurfaceEdges) $style(-edges)2180 set _settings(-isosurfaceoutline) $style(-outline) 2181 set _settings(-isosurfaceedges) $style(-edges) 2161 2182 #SendCmd "contour3d color [Color2RGB $settings(-color)] $tag" 2162 2183 SendCmd "contour3d lighting $style(-lighting) $tag" 2163 set _settings( isosurfaceLighting) $style(-lighting)2184 set _settings(-isosurfacelighting) $style(-lighting) 2164 2185 SendCmd "contour3d linecolor [Color2RGB $style(-edgecolor)] $tag" 2165 2186 SendCmd "contour3d linewidth $style(-linewidth) $tag" 2166 2187 SendCmd "contour3d opacity $_currentOpacity $tag" 2167 set _settings( isosurfaceOpacity) $style(-opacity)2188 set _settings(-isosurfaceopacity) $style(-opacity) 2168 2189 SetCurrentColormap $style(-color) 2169 2190 SendCmd "contour3d wireframe $style(-wireframe) $tag" 2170 set _settings( isosurfaceWireframe) $style(-wireframe)2171 set _settings( isosurfaceOpacity) [expr $style(-opacity) * 100.0]2191 set _settings(-isosurfacewireframe) $style(-wireframe) 2192 set _settings(-isosurfaceopacity) [expr $style(-opacity) * 100.0] 2172 2193 } 2173 2194 … … 2350 2371 } 2351 2372 set x [expr $w - 2] 2352 if { !$_settings( legendVisible) } {2373 if { !$_settings(-legendvisible) } { 2353 2374 $c delete legend 2354 2375 return … … 2385 2406 set ih [image height $_image(legend)] 2386 2407 set x1 [expr $x2 - ($iw*12)/10] 2387 set color $_settings( isolineColor)2408 set color $_settings(-isolinecolor) 2388 2409 # Draw the isolines on the legend. 2389 2410 array unset _isolines 2390 2411 if { $color != "none" && [info exists _limits($_curFldName)] && 2391 $_settings( numContours) > 0 } {2412 $_settings(-numcontours) > 0 } { 2392 2413 2393 2414 foreach { vmin vmax } $_limits($_curFldName) break … … 2469 2490 invoke { 2470 2491 $itk_component(field) value $_curFldLabel 2471 AdjustSetting field2492 AdjustSetting -field 2472 2493 } 2473 2494 default { … … 2541 2562 blt::vector destroy $v 2542 2563 } 2564
Note: See TracChangeset
for help on using the changeset viewer.