Changeset 4762
- Timestamp:
- Nov 22, 2014, 11:58:38 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/gui/scripts/vtkglyphviewer.tcl
r4759 r4762 238 238 -glyphedges 0 239 239 -glyphlighting 1 240 -glyphnormscale 1 240 241 -glyphopacity 100 242 -glyphorient 1 241 243 -glyphoutline 0 242 244 -glyphscale 1 245 -glyphscalemode "vmag" 246 -glyphshape "arrow" 243 247 -glyphvisible 1 244 248 -glyphwireframe 0 … … 1037 1041 # These are settings that rely on a dataset being loaded. 1038 1042 InitSettings \ 1039 -glyphlighting \1040 1043 -field \ 1041 1044 -glyphedges -glyphlighting -glyphopacity \ … … 1344 1347 "-cutplanevisible" { 1345 1348 set bool $_settings($what) 1346 SendCmd "cutplane visible $bool" 1349 SendCmd "cutplane visible 0" 1350 if { $bool } { 1351 foreach tag [CurrentDatasets -visible] { 1352 SendCmd "cutplane visible $bool $tag" 1353 } 1354 } 1347 1355 } 1348 1356 "-cutplanewireframe" { … … 1407 1415 "-glyphvisible" { 1408 1416 set bool $_settings($what) 1409 SendCmd "glyphs visible $bool" 1417 SendCmd "glyphs visible 0" 1418 if { $bool } { 1419 foreach tag [CurrentDatasets -visible] { 1420 SendCmd "glyphs visible $bool $tag" 1421 } 1422 } 1410 1423 if { $bool } { 1411 1424 Rappture::Tooltip::for $itk_component(glyphs) \ … … 1427 1440 "-glyphoutline" { 1428 1441 set bool $_settings($what) 1429 SendCmd "outline visible $bool" 1442 SendCmd "outline visible 0" 1443 if { $bool } { 1444 foreach tag [CurrentDatasets -visible] { 1445 SendCmd "outline visible $bool $tag" 1446 } 1447 } 1430 1448 } 1431 1449 "-glyphopacity" { … … 1434 1452 SendCmd "glyphs opacity $sval" 1435 1453 } 1454 "-glyphnormscale" { 1455 set bool $_settings($what) 1456 SendCmd "glyphs normscale $bool" 1457 } 1458 "-glyphorient" { 1459 set bool $_settings($what) 1460 SendCmd "glyphs gorient $bool {}" 1461 } 1436 1462 "-glyphscale" { 1437 1463 set val $_settings($what) … … 1439 1465 SendCmd "glyphs gscale $val" 1440 1466 } 1467 } 1468 "-glyphscalemode" { 1469 set label [$itk_component(scaleMode) value] 1470 set mode [$itk_component(scaleMode) translate $label] 1471 set _settings($what) $mode 1472 SendCmd "glyphs smode $mode {}" 1473 } 1474 "-glyphshape" { 1475 set label [$itk_component(gshape) value] 1476 set shape [$itk_component(gshape) translate $label] 1477 set _settings($what) $shape 1478 SendCmd "glyphs shape $shape" 1441 1479 } 1442 1480 "-field" { … … 1564 1602 -font "Arial 9" 1565 1603 1604 label $inner.gshape_l -text "Glyph shape" -font "Arial 9" 1605 itk_component add gshape { 1606 Rappture::Combobox $inner.gshape -width 10 -editable no 1607 } 1608 $inner.gshape choices insert end \ 1609 "arrow" "arrow" \ 1610 "cone" "cone" \ 1611 "cube" "cube" \ 1612 "cylinder" "cylinder" \ 1613 "dodecahedron" "dodecahedron" \ 1614 "icosahedron" "icosahedron" \ 1615 "line" "line" \ 1616 "octahedron" "octahedron" \ 1617 "point" "point" \ 1618 "sphere" "sphere" \ 1619 "tetrahedron" "tetrahedron" 1620 1621 $itk_component(gshape) value $_settings(-glyphshape) 1622 bind $inner.gshape <<Value>> [itcl::code $this AdjustSetting -glyphshape] 1623 1624 label $inner.scaleMode_l -text "Scale by" -font "Arial 9" 1625 itk_component add scaleMode { 1626 Rappture::Combobox $inner.scaleMode -width 10 -editable no 1627 } 1628 $inner.scaleMode choices insert end \ 1629 "scalar" "Scalar" \ 1630 "vmag" "Vector magnitude" \ 1631 "vcomp" "Vector components" \ 1632 "off" "Constant size" 1633 1634 $itk_component(scaleMode) value "[$itk_component(scaleMode) label $_settings(-glyphscalemode)]" 1635 bind $inner.scaleMode <<Value>> [itcl::code $this AdjustSetting -glyphscalemode] 1636 1637 checkbutton $inner.normscale \ 1638 -text "Normalize scaling" \ 1639 -variable [itcl::scope _settings(-glyphnormscale)] \ 1640 -command [itcl::code $this AdjustSetting -glyphnormscale] \ 1641 -font "Arial 9" 1642 Rappture::Tooltip::for $inner.normscale "If enabled, field values are normalized to \[0,1\] before scaling and scale factor is relative to a default size" 1643 1644 checkbutton $inner.gorient \ 1645 -text "Orient" \ 1646 -variable [itcl::scope _settings(-glyphorient)] \ 1647 -command [itcl::code $this AdjustSetting -glyphorient] \ 1648 -font "Arial 9" 1649 Rappture::Tooltip::for $inner.gorient "Orient glyphs by vector field directions" 1650 1566 1651 checkbutton $inner.wireframe \ 1567 1652 -text "Wireframe" \ … … 1614 1699 1615 1700 label $inner.gscale_l -text "Scale factor" -font "Arial 9" 1701 if {0} { 1616 1702 ::scale $inner.gscale -from 1 -to 100 -orient horizontal \ 1617 1703 -variable [itcl::scope _settings(-glyphscale)] \ … … 1619 1705 -showvalue off \ 1620 1706 -command [itcl::code $this AdjustSetting -glyphscale] 1707 } else { 1708 itk_component add gscale { 1709 entry $inner.gscale -font "Arial 9" -bg white \ 1710 -textvariable [itcl::scope _settings(-glyphscale)] 1711 } { 1712 ignore -font -background 1713 } 1714 bind $inner.gscale <Return> \ 1715 [itcl::code $this AdjustSetting -glyphscale] 1716 bind $inner.gscale <KP_Enter> \ 1717 [itcl::code $this AdjustSetting -glyphscale] 1718 } 1621 1719 Rappture::Tooltip::for $inner.gscale "Set scaling multiplier (or constant size)" 1622 1720 … … 2105 2203 2106 2204 SendCmd "glyphs add $style(-shape) $tag" 2205 set _settings(-glyphshape) $style(-shape) 2206 $itk_component(gshape) value $style(-shape) 2107 2207 SendCmd "glyphs edges $style(-edges) $tag" 2108 2208 set _settings(-glyphedges) $style(-edges) … … 2115 2215 SendCmd "glyphs gscale $style(-gscale) $tag" 2116 2216 } 2217 set _settings(-glyphnormscale) $style(-normscale) 2218 set _settings(-glyphscale) $style(-gscale) 2117 2219 2118 2220 # constant color only used if colormode set to constant … … 2121 2223 # defaults to active scalars or vectors depending on mode 2122 2224 SendCmd "glyphs gorient $style(-orientGlyphs) {} $tag" 2225 set _settings(-glyphorient) $style(-orientGlyphs) 2123 2226 SendCmd "glyphs smode $style(-scaleMode) {} $tag" 2227 set _settings(-glyphscalemode) $style(-scaleMode) 2228 $itk_component(scaleMode) value "[$itk_component(scaleMode) label $style(-scaleMode)]" 2124 2229 SendCmd "glyphs quality $style(-quality) $tag" 2125 2230 SendCmd "glyphs lighting $style(-lighting) $tag"
Note: See TracChangeset
for help on using the changeset viewer.