- Timestamp:
- Jul 21, 2015, 1:24:32 PM (9 years ago)
- Location:
- branches/1.3
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
- Property svn:mergeinfo changed
/trunk merged: 5762-5765,5767-5772
- Property svn:mergeinfo changed
-
branches/1.3/gui/scripts/drawing.tcl
r5661 r5774 93 93 } 94 94 foreach {key path} { 95 camera about.camera 96 color about.color 95 97 group about.group 96 98 label about.label 97 color about.color98 camera about.camera99 99 type about.type 100 xdesc xaxis.description 101 ydesc yaxis.description 102 zdesc zaxis.description 100 103 xlabel xaxis.label 101 xdesc xaxis.description 104 ylabel yaxis.label 105 zlabel zaxis.label 106 xscale xaxis.scale 107 yscale yaxis.scale 108 zscale zaxis.scale 102 109 xunits xaxis.units 103 xscale xaxis.scale 110 yunits yaxis.units 111 zunits zaxis.units 104 112 xmin xaxis.min 105 113 xmax xaxis.max 106 ylabel yaxis.label107 ydesc yaxis.description108 yunits yaxis.units109 yscale yaxis.scale110 114 ymin yaxis.min 111 115 ymax yaxis.max 112 zlabel zaxis.label113 zdesc zaxis.description114 zunits zaxis.units115 zscale zaxis.scale116 116 zmin zaxis.min 117 117 zmax zaxis.max -
branches/1.3/gui/scripts/field.tcl
r5759 r5774 659 659 camera about.camera 660 660 color about.color 661 default about.default662 661 group about.group 663 662 label about.label -
branches/1.3/gui/scripts/vtkglyphviewer.tcl
r5661 r5774 132 132 private variable _start 0 133 133 private variable _title "" 134 135 private common _downloadPopup; # download options from popup136 private common _hardcopy137 134 private variable _width 0 138 135 private variable _height 0 … … 143 140 private variable _field "" 144 141 private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar) 145 private variable _fieldNames {}146 142 private variable _fields 147 143 private variable _curFldName "" 148 144 private variable _curFldLabel "" 145 146 private common _downloadPopup; # download options from popup 147 private common _hardcopy 149 148 } 150 149 … … 1552 1551 } 1553 1552 # Set the legend on the first heightmap dataset. 1554 if { $_currentColormap != "" 1553 if { $_currentColormap != "" } { 1555 1554 set cmap $_currentColormap 1556 1555 if { ![info exists _colormaps($cmap)] } { -
branches/1.3/gui/scripts/vtkheightmapviewer.tcl
r5755 r5774 143 143 private variable _isolines 144 144 private variable _contourList "" 145 146 private common _downloadPopup; # download options from popup147 private common _hardcopy148 145 private variable _width 0 149 146 private variable _height 0 … … 153 150 private variable _rotatePending 0 154 151 private variable _legendPending 0 155 private variable _fieldNames {}156 152 private variable _fields 157 153 private variable _curFldName "" 158 154 private variable _curFldLabel "" 159 155 private variable _colorMode "scalar";# Mode of colormap (vmag or scalar) 156 157 private common _downloadPopup; # download options from popup 158 private common _hardcopy 160 159 } 161 160 … … 1724 1723 } 1725 1724 # Set the legend on the first heightmap dataset. 1726 if { $_currentColormap != "" 1725 if { $_currentColormap != "" } { 1727 1726 set cmap $_currentColormap 1728 1727 if { ![info exists _colormaps($cmap)] } { -
branches/1.3/gui/scripts/vtkimageviewer.tcl
r5348 r5774 138 138 private variable _isolines 139 139 private variable _contourList "" 140 141 private common _downloadPopup; # download options from popup142 private common _hardcopy143 140 private variable _width 0 144 141 private variable _height 0 … … 148 145 private variable _rotatePending 0 149 146 private variable _legendPending 0 150 private variable _fieldNames {}151 147 private variable _fields 152 148 private variable _curFldName "" 153 149 private variable _curFldLabel "" 154 150 private variable _colorMode "scalar";# Mode of colormap (vmag or scalar) 151 152 private common _downloadPopup; # download options from popup 153 private common _hardcopy 155 154 } 156 155 -
branches/1.3/gui/scripts/vtkisosurfaceviewer.tcl
r5437 r5774 153 153 private variable _currentLimits "" 154 154 private variable _widget 155 156 private common _downloadPopup; # download options from popup157 private common _hardcopy158 155 private variable _width 0 159 156 private variable _height 0 … … 164 161 private variable _field "" 165 162 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 166 private variable _fieldNames {}167 163 private variable _fields 168 164 private variable _curFldName "" 169 165 private variable _curFldLabel "" 170 171 166 private variable _mouseOver ""; # what called LegendRangeAction, vmin or vmax 172 167 private variable _customRangeClick 1; # what called ToggleCustomRange 168 169 private common _downloadPopup; # download options from popup 170 private common _hardcopy 173 171 } 174 172 … … 1670 1668 } 1671 1669 # Set the legend on the first isosurface dataset. 1672 if { $_currentColormap != "" 1670 if { $_currentColormap != "" } { 1673 1671 set cmap $_currentColormap 1674 1672 if { ![info exists _colormaps($cmap)] } { -
branches/1.3/gui/scripts/vtkmeshviewer.tcl
r5661 r5774 113 113 private variable _start 0 114 114 private variable _title "" 115 116 private common _downloadPopup; # download options from popup117 private common _hardcopy118 115 private variable _width 0 119 116 private variable _height 0 … … 123 120 private variable _rotateDelay 150 124 121 private variable _opacityDelay 150 122 123 private common _downloadPopup; # download options from popup 124 private common _hardcopy 125 125 } 126 126 … … 860 860 } 861 861 if {"" != $_first} { 862 set location [$_first hints camera]863 if { $location != "" } {864 array set view $location865 }866 867 862 foreach axis { x y z } { 868 863 set label [$_first label ${axis}] -
branches/1.3/gui/scripts/vtkstreamlinesviewer.tcl
r5437 r5774 66 66 private method BuildAxisTab {} 67 67 private method BuildCameraTab {} 68 private method BuildColormap { name colors}68 private method BuildColormap { name } 69 69 private method BuildCutplaneTab {} 70 70 private method BuildDownloadPopup { widget command } 71 71 private method BuildStreamsTab {} 72 private method Build VolumeTab {}72 private method BuildSurfaceTab {} 73 73 private method DrawLegend {} 74 74 private method Combo { option } … … 102 102 private method RequestLegend {} 103 103 private method Rotate {option x y} 104 private method SetColormap { dataobj comp } 105 private method ChangeColormap { dataobj comp color } 104 private method SetCurrentColormap { color } 106 105 private method SetLegendTip { x y } 107 106 private method SetObjectStyle { dataobj comp } … … 121 120 private variable _colormaps ; # contains all the colormaps 122 121 ; # in the server. 123 private variable _ dataset2style ;# maps dataobj-component to transfunc122 private variable _currentColormap "" 124 123 125 124 private variable _click ; # info used for rotate operations … … 127 126 private variable _view ; # view params for 3D view 128 127 private variable _settings 129 private variable _style; # Array of current component styles.130 private variable _initialStyle; # Array of initial component styles.131 128 private variable _reset 1; # Connection to server has been reset. 132 129 … … 135 132 private variable _title "" 136 133 private variable _seeds 137 138 private common _downloadPopup; # download options from popup139 private common _hardcopy140 134 private variable _width 0 141 135 private variable _height 0 … … 145 139 private variable _cutplanePending 0 146 140 private variable _legendPending 0 147 private variable _vectorFields148 private variable _scalarFields149 141 private variable _fields 150 142 private variable _curFldName "" … … 153 145 private variable _numSeeds 200 154 146 private variable _colorMode "vmag";# Mode of colormap (vmag or scalar) 147 148 private common _downloadPopup; # download options from popup 149 private common _hardcopy 155 150 } 156 151 … … 245 240 -streamlinesnumseeds 200 246 241 -streamlinesopacity 100 247 -streamlines scale 1242 -streamlineslength 70 248 243 -streamlinesseedsvisible 0 249 244 -streamlinesvisible 1 250 - volumeedges0251 - volumelighting1252 - volumeopacity40253 - volumevisible1254 - volumewireframe0245 -surfaceedges 0 246 -surfacelighting 1 247 -surfaceopacity 40 248 -surfacevisible 1 249 -surfacewireframe 0 255 250 -xgrid 0 256 251 -ygrid 0 … … 330 325 Rappture::Tooltip::for $itk_component(zoomout) "Zoom out" 331 326 332 itk_component add volume {333 Rappture::PushButton $f. volume \327 itk_component add surface { 328 Rappture::PushButton $f.surface \ 334 329 -onimage [Rappture::icon volume-on] \ 335 330 -offimage [Rappture::icon volume-off] \ 336 -variable [itcl::scope _settings(- volumevisible)] \337 -command [itcl::code $this AdjustSetting - volumevisible]338 } 339 $itk_component( volume) select340 Rappture::Tooltip::for $itk_component( volume) \341 " Don't display the volume"342 pack $itk_component( volume) -padx 2 -pady 2331 -variable [itcl::scope _settings(-surfacevisible)] \ 332 -command [itcl::code $this AdjustSetting -surfacevisible] 333 } 334 $itk_component(surface) select 335 Rappture::Tooltip::for $itk_component(surface) \ 336 "Show/Hide the boundary surface" 337 pack $itk_component(surface) -padx 2 -pady 2 343 338 344 339 itk_component add streamlines { … … 351 346 $itk_component(streamlines) select 352 347 Rappture::Tooltip::for $itk_component(streamlines) \ 353 " Toggle the streamlines on/off"348 "Show/Hide the streamlines" 354 349 pack $itk_component(streamlines) -padx 2 -pady 2 355 350 … … 362 357 } 363 358 Rappture::Tooltip::for $itk_component(cutplane) \ 364 "Show/Hide cutplanes"359 "Show/Hide the cutplanes" 365 360 pack $itk_component(cutplane) -padx 2 -pady 2 366 361 367 368 362 if { [catch { 369 Build VolumeTab363 BuildSurfaceTab 370 364 BuildStreamsTab 371 365 BuildCutplaneTab … … 852 846 array unset _colormaps 853 847 array unset _seeds 854 array unset _dataset2style855 848 } 856 849 … … 1013 1006 } 1014 1007 if {"" != $_first} { 1015 set location [$_first hints camera]1016 if { $location != "" } {1017 array set view $location1018 }1019 1008 foreach axis { x y z } { 1020 1009 set label [$_first hints ${axis}label] … … 1031 1020 array unset _fields 1032 1021 set _curFldName "" 1022 set _curFldLabel "" 1033 1023 foreach cname [$_first components] { 1034 1024 foreach fname [$_first fieldnames $cname] { … … 1047 1037 -command [itcl::code $this Combo invoke] 1048 1038 set _fields($fname) [list $label $units $components] 1049 if { $_curFldName == "" } {1039 if { $_curFldName == "" && $components == 3 } { 1050 1040 set _curFldName $fname 1051 1041 set _curFldLabel $label … … 1061 1051 -streamlineslighting \ 1062 1052 -streamlinescolormap -field \ 1063 - volumevisible -volumeedges -volumelighting -volumeopacity \1064 - volumewireframe \1053 -surfacevisible -surfaceedges -surfacelighting -surfaceopacity \ 1054 -surfacewireframe \ 1065 1055 -cutplanevisible \ 1066 1056 -cutplanexposition -cutplaneyposition -cutplanezposition \ … … 1343 1333 set bool $_settings($what) 1344 1334 SendCmd "cutplane visible $bool" 1335 if { $bool } { 1336 Rappture::Tooltip::for $itk_component(cutplane) \ 1337 "Hide the cutplanes" 1338 } else { 1339 Rappture::Tooltip::for $itk_component(cutplane) \ 1340 "Show the cutplanes" 1341 } 1345 1342 } 1346 1343 "-cutplanewireframe" { … … 1439 1436 set colormap [$itk_component(colormap) value] 1440 1437 set _settings($what) $colormap 1441 foreach dataset [CurrentDatasets -visible $_first] { 1442 foreach {dataobj comp} [split $dataset -] break 1443 ChangeColormap $dataobj $comp $colormap 1444 } 1438 SetCurrentColormap $colormap 1445 1439 set _legendPending 1 1446 1440 } … … 1450 1444 SendCmd "streamlines opacity $sval" 1451 1445 } 1452 "-streamlines scale" {1446 "-streamlineslength" { 1453 1447 set val $_settings($what) 1454 set sval [expr { 0.01 * double($val) }] 1455 SendCmd "streamlines scale $sval $sval $sval" 1448 set sval [expr { (0.01 * double($val)) / 0.7 }] 1449 foreach axis {x y z} { 1450 foreach {min max} $_limits($axis) break 1451 set ${axis}len [expr double($max) - double($min)] 1452 } 1453 set length [expr { $sval * ($xlen + $ylen + $zlen) } ] 1454 SendCmd "streamlines length $length" 1456 1455 } 1457 1456 "-streamlineslighting" { … … 1459 1458 SendCmd "streamlines lighting $bool" 1460 1459 } 1461 "- volumeopacity" {1460 "-surfaceopacity" { 1462 1461 set val $_settings($what) 1463 1462 set sval [expr { 0.01 * double($val) }] 1464 1463 SendCmd "polydata opacity $sval" 1465 1464 } 1466 "- volumewireframe" {1465 "-surfacewireframe" { 1467 1466 set bool $_settings($what) 1468 1467 SendCmd "polydata wireframe $bool" 1469 1468 } 1470 "- volumevisible" {1469 "-surfacevisible" { 1471 1470 set bool $_settings($what) 1472 1471 SendCmd "polydata visible $bool" 1473 1472 if { $bool } { 1474 Rappture::Tooltip::for $itk_component( volume) \1475 "Hide the volume"1473 Rappture::Tooltip::for $itk_component(surface) \ 1474 "Hide the boundary surface" 1476 1475 } else { 1477 Rappture::Tooltip::for $itk_component( volume) \1478 "Show the volume"1479 } 1480 } 1481 "- volumelighting" {1476 Rappture::Tooltip::for $itk_component(surface) \ 1477 "Show the boundary surface" 1478 } 1479 } 1480 "-surfacelighting" { 1482 1481 set bool $_settings($what) 1483 1482 SendCmd "polydata lighting $bool" 1484 1483 } 1485 "- volumeedges" {1484 "-surfaceedges" { 1486 1485 set bool $_settings($what) 1487 1486 SendCmd "polydata edges $bool" … … 1514 1513 } 1515 1514 # Set the legend on the first streamlines dataset. 1516 foreach dataset [CurrentDatasets -visible $_first] { 1517 foreach {dataobj comp} [split $dataset -] break 1518 if { [info exists _dataset2style($dataset)] } { 1519 SendCmd \ 1520 "legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0" 1521 break; 1522 } 1523 } 1524 } 1525 1526 # 1527 # ChangeColormap -- 1528 # 1529 itcl::body Rappture::VtkStreamlinesViewer::ChangeColormap {dataobj comp color} { 1530 set tag $dataobj-$comp 1531 if { ![info exist _style($tag)] } { 1532 error "no initial colormap" 1533 } 1534 array set style $_style($tag) 1535 set style(-color) $color 1536 set _style($tag) [array get style] 1537 SetColormap $dataobj $comp 1538 } 1539 1540 # 1541 # SetColormap -- 1542 # 1543 itcl::body Rappture::VtkStreamlinesViewer::SetColormap { dataobj comp } { 1544 array set style { 1545 -color BCGYR 1546 -levels 6 1547 -opacity 1.0 1548 } 1549 set tag $dataobj-$comp 1550 if { ![info exists _initialStyle($tag)] } { 1551 # Save the initial component style. 1552 set _initialStyle($tag) [$dataobj style $comp] 1553 } 1554 1555 # Override defaults with initial style defined in xml. 1556 array set style $_initialStyle($tag) 1557 1558 if { ![info exists _style($tag)] } { 1559 set _style($tag) [array get style] 1560 } 1561 # Override initial style with current style. 1562 array set style $_style($tag) 1563 1564 set name "$style(-color):$style(-levels):$style(-opacity)" 1515 if { $_currentColormap != "" } { 1516 set cmap $_currentColormap 1517 if { ![info exists _colormaps($cmap)] } { 1518 BuildColormap $cmap 1519 set _colormaps($cmap) 1 1520 } 1521 #SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0" 1522 SendCmd "legend2 $cmap $w $h" 1523 } 1524 } 1525 1526 # 1527 # SetCurrentColormap -- 1528 # 1529 itcl::body Rappture::VtkStreamlinesViewer::SetCurrentColormap { name } { 1530 # Keep track of the colormaps that we build. 1565 1531 if { ![info exists _colormaps($name)] } { 1566 BuildColormap $name [array get style]1532 BuildColormap $name 1567 1533 set _colormaps($name) 1 1568 1534 } 1569 if { ![info exists _dataset2style($tag)] || 1570 $_dataset2style($tag) != $name } { 1571 SendCmd "streamlines colormap $name $tag" 1572 SendCmd "cutplane colormap $name $tag" 1573 set _dataset2style($tag) $name 1574 } 1535 set _currentColormap $name 1536 SendCmd "streamlines colormap $_currentColormap" 1537 SendCmd "cutplane colormap $_currentColormap" 1575 1538 } 1576 1539 … … 1578 1541 # BuildColormap -- 1579 1542 # 1580 itcl::body Rappture::VtkStreamlinesViewer::BuildColormap { name styles } { 1581 array set style $styles 1582 set cmap [ColorsToColormap $style(-color)] 1543 itcl::body Rappture::VtkStreamlinesViewer::BuildColormap { name } { 1544 set cmap [ColorsToColormap $name] 1583 1545 if { [llength $cmap] == 0 } { 1584 1546 set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0" 1585 1547 } 1586 if { ![info exists _settings(-volumeopacity)] } {1587 set _settings(-volumeopacity) $style(-opacity)1588 }1589 set max $_settings(-volumeopacity)1590 1591 1548 set amap "0.0 1.0 1.0 1.0" 1592 1549 SendCmd "colormap add $name { $cmap } { $amap }" … … 1615 1572 } 1616 1573 1617 itcl::body Rappture::VtkStreamlinesViewer::Build VolumeTab {} {1574 itcl::body Rappture::VtkStreamlinesViewer::BuildSurfaceTab {} { 1618 1575 1619 1576 set fg [option get $itk_component(hull) font Font] … … 1621 1578 1622 1579 set inner [$itk_component(main) insert end \ 1623 -title " Volume Settings" \1580 -title "Boundary Surface Settings" \ 1624 1581 -icon [Rappture::icon volume-on]] 1625 1582 $inner configure -borderwidth 4 1626 1583 1627 checkbutton $inner. volume \1628 -text "Show Volume" \1629 -variable [itcl::scope _settings(- volumevisible)] \1630 -command [itcl::code $this AdjustSetting - volumevisible] \1584 checkbutton $inner.surface \ 1585 -text "Show Surface" \ 1586 -variable [itcl::scope _settings(-surfacevisible)] \ 1587 -command [itcl::code $this AdjustSetting -surfacevisible] \ 1631 1588 -font "Arial 9" 1632 1589 1633 1590 checkbutton $inner.wireframe \ 1634 1591 -text "Show Wireframe" \ 1635 -variable [itcl::scope _settings(- volumewireframe)] \1636 -command [itcl::code $this AdjustSetting - volumewireframe] \1592 -variable [itcl::scope _settings(-surfacewireframe)] \ 1593 -command [itcl::code $this AdjustSetting -surfacewireframe] \ 1637 1594 -font "Arial 9" 1638 1595 1639 1596 checkbutton $inner.lighting \ 1640 1597 -text "Enable Lighting" \ 1641 -variable [itcl::scope _settings(- volumelighting)] \1642 -command [itcl::code $this AdjustSetting - volumelighting] \1598 -variable [itcl::scope _settings(-surfacelighting)] \ 1599 -command [itcl::code $this AdjustSetting -surfacelighting] \ 1643 1600 -font "Arial 9" 1644 1601 1645 1602 checkbutton $inner.edges \ 1646 1603 -text "Show Edges" \ 1647 -variable [itcl::scope _settings(- volumeedges)] \1648 -command [itcl::code $this AdjustSetting - volumeedges] \1604 -variable [itcl::scope _settings(-surfaceedges)] \ 1605 -command [itcl::code $this AdjustSetting -surfaceedges] \ 1649 1606 -font "Arial 9" 1650 1607 1651 1608 label $inner.opacity_l -text "Opacity" -font "Arial 9" 1652 1609 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1653 -variable [itcl::scope _settings(- volumeopacity)] \1610 -variable [itcl::scope _settings(-surfaceopacity)] \ 1654 1611 -width 10 \ 1655 1612 -showvalue off \ 1656 -command [itcl::code $this AdjustSetting - volumeopacity]1613 -command [itcl::code $this AdjustSetting -surfaceopacity] 1657 1614 1658 1615 blt::table $inner \ … … 1720 1677 -command [itcl::code $this AdjustSetting -streamlinesnumseeds] 1721 1678 1722 label $inner.scale_l -text " Scale" -font "Arial 9"1679 label $inner.scale_l -text "Length" -font "Arial 9" 1723 1680 ::scale $inner.scale -from 1 -to 100 -orient horizontal \ 1724 -variable [itcl::scope _settings(-streamlines scale)] \1681 -variable [itcl::scope _settings(-streamlineslength)] \ 1725 1682 -width 10 \ 1726 1683 -showvalue off \ 1727 -command [itcl::code $this AdjustSetting -streamlines scale]1684 -command [itcl::code $this AdjustSetting -streamlineslength] 1728 1685 1729 1686 label $inner.field_l -text "Color by" -font "Arial 9" … … 1753 1710 3,0 $inner.opacity_l -anchor w -pady 2 \ 1754 1711 3,1 $inner.opacity -fill x -pady 2 \ 1755 5,0 $inner.lighting -anchor w -pady 2 -cspan 2 \1756 6,0 $inner.seeds -anchor w -pady 2 -cspan 2 \1757 7,0 $inner.density_l -anchor w -pady 2 \1758 7,1 $inner.density -fill x -pady 2 \1712 4,0 $inner.lighting -anchor w -pady 2 -cspan 2 \ 1713 5,0 $inner.seeds -anchor w -pady 2 -cspan 2 \ 1714 6,0 $inner.density_l -anchor w -pady 2 \ 1715 6,1 $inner.density -fill x -pady 2 \ 1759 1716 1760 1717 blt::table configure $inner r* c* -resize none 1761 blt::table configure $inner r 10c1 c2 -resize expand1718 blt::table configure $inner r7 c1 c2 -resize expand 1762 1719 } 1763 1720 … … 2135 2092 # Parse style string. 2136 2093 set tag $dataobj-$comp 2137 set style [$dataobj style $comp] 2138 array set settings { 2139 -color \#808080 2094 array set style { 2095 -color BCGYR 2096 -constcolor white 2097 -edgecolor black 2140 2098 -edges 0 2141 - edgecolor black2099 -lighting 1 2142 2100 -linewidth 1.0 2143 - opacity 0.42144 - wireframe02145 - lighting 12101 -mode lines 2102 -numseeds 200 2103 -opacity 1.0 2146 2104 -seeds 1 2147 2105 -seedcolor white 2106 -streamlineslength 0.7 2107 -surfacecolor white 2108 -surfaceedgecolor black 2109 -surfaceedges 0 2110 -surfacelighting 1 2111 -surfaceopacity 0.4 2112 -surfacevisible 1 2113 -surfacewireframe 0 2148 2114 -visible 1 2149 2115 } 2116 array set style [$dataobj style $comp] 2150 2117 if { $dataobj != $_first } { 2151 set settings(-opacity) 1 2152 } 2153 array set settings $style 2118 set style(-opacity) 1.0 2119 } 2154 2120 StartBufferingCommands 2155 2121 SendCmd "streamlines add $tag" 2156 SendCmd "streamlines seed visible off $tag" 2122 SendCmd "streamlines color [Color2RGB $style(-constcolor)] $tag" 2123 SendCmd "streamlines edges $style(-edges) $tag" 2124 SendCmd "streamlines linecolor [Color2RGB $style(-edgecolor)] $tag" 2125 SendCmd "streamlines linewidth $style(-linewidth) $tag" 2126 SendCmd "streamlines lighting $style(-lighting) $tag" 2127 SendCmd "streamlines opacity $style(-opacity) $tag" 2128 SendCmd "streamlines seed color [Color2RGB $style(-seedcolor)] $tag" 2129 SendCmd "streamlines seed visible $style(-seeds) $tag" 2130 SendCmd "streamlines visible $style(-visible) $tag" 2157 2131 set seeds [$dataobj hints seeds] 2158 2132 if { $seeds != "" && ![info exists _seeds($dataobj)] } { 2159 2133 set length [string length $seeds] 2160 SendCmd "streamlines seed fmesh 200data follows $length $tag"2134 SendCmd "streamlines seed fmesh $style(-numseeds) data follows $length $tag" 2161 2135 SendData $seeds 2162 2136 set _seeds($dataobj) 1 2163 2137 } 2138 set _settings(-streamlineslighting) $style(-lighting) 2139 $itk_component(streammode) value $style(-mode) 2140 AdjustSetting -streamlinesmode 2141 set _settings(-streamlinesnumseeds) $style(-numseeds) 2142 set _settings(-streamlinesopacity) [expr $style(-opacity) * 100.0] 2143 set _settings(-streamlineslength) [expr $style(-streamlineslength) * 100.0] 2144 set _settings(-streamlinesseedsvisible) $style(-seeds) 2145 set _settings(-streamlinesvisible) $style(-visible) 2146 2164 2147 SendCmd "cutplane add $tag" 2148 2165 2149 SendCmd "polydata add $tag" 2150 SendCmd "polydata color [Color2RGB $style(-surfacecolor)] $tag" 2166 2151 SendCmd "polydata colormode constant {} $tag" 2167 set _settings(-volumeedges) $settings(-edges) 2168 set _settings(-volumelighting) $settings(-lighting) 2169 set _settings(-volumeopacity) $settings(-opacity) 2170 set _settings(-volumewireframe) $settings(-wireframe) 2171 set _settings(-volumeopacity) [expr $settings(-opacity) * 100.0] 2152 SendCmd "polydata edges $style(-surfaceedges) $tag" 2153 SendCmd "polydata linecolor [Color2RGB $style(-surfaceedgecolor)] $tag" 2154 SendCmd "polydata lighting $style(-surfacelighting) $tag" 2155 SendCmd "polydata opacity $style(-surfaceopacity) $tag" 2156 SendCmd "polydata wireframe $style(-surfacewireframe) $tag" 2157 SendCmd "polydata visible $style(-surfacevisible) $tag" 2158 set _settings(-surfaceedges) $style(-surfaceedges) 2159 set _settings(-surfacelighting) $style(-surfacelighting) 2160 set _settings(-surfaceopacity) [expr $style(-surfaceopacity) * 100.0] 2161 set _settings(-surfacewireframe) $style(-surfacewireframe) 2162 set _settings(-surfacevisible) $style(-surfacevisible) 2172 2163 StopBufferingCommands 2173 SetColormap $dataobj $comp 2164 SetCurrentColormap $style(-color) 2165 $itk_component(colormap) value $style(-color) 2174 2166 } 2175 2167 -
branches/1.3/gui/scripts/vtksurfaceviewer.tcl
r5364 r5774 134 134 private variable _isolines 135 135 private variable _contourList "" 136 137 private common _downloadPopup; # download options from popup138 private common _hardcopy139 136 private variable _width 0 140 137 private variable _height 0 … … 143 140 private variable _legendPending 0 144 141 private variable _field "" 145 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 146 private variable _fieldNames {} 142 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 147 143 private variable _fields 148 144 private variable _curFldName "" 149 145 private variable _curFldLabel "" 146 147 private common _downloadPopup; # download options from popup 148 private common _hardcopy 150 149 } 151 150 … … 1465 1464 } 1466 1465 # Set the legend on the first heightmap dataset. 1467 if { $_currentColormap != "" 1466 if { $_currentColormap != "" } { 1468 1467 set cmap $_currentColormap 1469 1468 if { ![info exists _colormaps($cmap)] } { -
branches/1.3/gui/scripts/vtkviewer.tcl
r5735 r5774 67 67 private method BuildAxisTab {} 68 68 private method BuildCameraTab {} 69 private method BuildColormap { name styles}69 private method BuildColormap { name } 70 70 private method BuildCutawayTab {} 71 71 private method BuildDownloadPopup { widget command } … … 147 147 private variable _start 0 148 148 private variable _title "" 149 150 private common _downloadPopup; # download options from popup151 private common _hardcopy152 149 private variable _width 0 153 150 private variable _height 0 … … 162 159 private variable _rotateDelay 150 163 160 private variable _scaleDelay 100 161 162 private common _downloadPopup; # download options from popup 163 private common _hardcopy 164 164 } 165 165 … … 1090 1090 } 1091 1091 if {"" != $_first} { 1092 set location [$_first hints camera]1093 if { $location != "" } {1094 array set view $location1095 }1096 1097 1092 foreach axis { x y z } { 1098 1093 set label [$_first hints ${axis}label] … … 1808 1803 array set style { 1809 1804 -color BCGYR 1810 -levels 61811 -opacity 1.01812 1805 } 1813 1806 if {[$dataobj type $comp] == "molecule"} { … … 1829 1822 array set style $_style($tag) 1830 1823 1831 if { $style(-color) == "elementDefault" } { 1832 set name "$style(-color)" 1833 } else { 1834 set name "$style(-color):$style(-levels):$style(-opacity)" 1835 } 1824 set name "$style(-color)" 1836 1825 if { ![info exists _colormaps($name)] } { 1837 BuildColormap $name [array get style]1826 BuildColormap $name 1838 1827 set _colormaps($name) 1 1839 1828 } … … 1858 1847 # BuildColormap -- 1859 1848 # 1860 itcl::body Rappture::VtkViewer::BuildColormap { name styles} {1861 if { $name == 1849 itcl::body Rappture::VtkViewer::BuildColormap { name } { 1850 if { $name == "elementDefault" } { 1862 1851 return 1863 1852 } 1864 array set style $styles 1865 set cmap [ColorsToColormap $style(-color)] 1853 set cmap [ColorsToColormap $name] 1866 1854 if { [llength $cmap] == 0 } { 1867 1855 set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0" 1868 1856 } 1869 if { ![info exists _settings(polydata-opacity)] } {1870 set _settings(polydata-opacity) $style(-opacity)1871 }1872 set max $_settings(polydata-opacity)1873 1874 1857 set amap "0.0 1.0 1.0 1.0" 1875 1858 SendCmd "colormap add $name { $cmap } { $amap }" -
branches/1.3/gui/scripts/vtkvolumeviewer.tcl
r5470 r5774 1029 1029 } 1030 1030 if {"" != $_first} { 1031 set location [$_first hints camera]1032 if { $location != "" } {1033 array set view $location1034 }1035 1036 1031 foreach axis { x y z } { 1037 1032 set label [$_first hints ${axis}label]
Note: See TracChangeset
for help on using the changeset viewer.