- Timestamp:
- Mar 3, 2014, 7:37:23 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkglyphviewer.tcl
r4190 r4200 242 242 glyphEdges 0 243 243 glyphLighting 1 244 glyphNormscale 1 244 245 glyphOpacity 100 245 246 saveGlyphOpacity 100 247 glyphOrient 1 246 248 glyphOutline 0 249 glyphScale 1 250 glyphScaleMode "vmag" 251 glyphShape "arrow" 247 252 glyphVisible 1 248 253 glyphWireframe 0 … … 339 344 pack $itk_component(glyphs) -padx 2 -pady 2 340 345 346 if {0} { 341 347 itk_component add cutplane { 342 348 Rappture::PushButton $f.cutplane \ … … 349 355 "Show/Hide cutplanes" 350 356 pack $itk_component(cutplane) -padx 2 -pady 2 351 357 } 352 358 353 359 if { [catch { … … 1397 1403 } 1398 1404 "glyphWireframe" { 1399 set bool $_settings( glyphWireframe)1405 set bool $_settings($what) 1400 1406 SendCmd "glyphs wireframe $bool" 1401 1407 } 1402 1408 "glyphVisible" { 1403 set bool $_settings( glyphVisible)1409 set bool $_settings($what) 1404 1410 SendCmd "glyphs visible $bool" 1405 1411 if { $bool } { … … 1413 1419 } 1414 1420 "glyphLighting" { 1415 set bool $_settings( glyphLighting)1421 set bool $_settings($what) 1416 1422 SendCmd "glyphs lighting $bool" 1417 1423 } 1418 1424 "glyphEdges" { 1419 set bool $_settings( glyphEdges)1425 set bool $_settings($what) 1420 1426 SendCmd "glyphs edges $bool" 1421 1427 } 1422 1428 "glyphOutline" { 1423 set bool $_settings( glyphOutline)1429 set bool $_settings($what) 1424 1430 SendCmd "outline visible $bool" 1425 1431 } 1426 1432 "glyphOpacity" { 1427 set val $_settings( glyphOpacity)1433 set val $_settings($what) 1428 1434 set sval [expr { 0.01 * double($val) }] 1429 1435 SendCmd "glyphs opacity $sval" 1436 } 1437 "glyphNormscale" { 1438 set bool $_settings($what) 1439 SendCmd "glyphs normscale $bool" 1440 } 1441 "glyphOrient" { 1442 set bool $_settings($what) 1443 SendCmd "glyphs gorient $bool {}" 1444 } 1445 "glyphScale" { 1446 set val $_settings($what) 1447 SendCmd "glyphs gscale $val" 1448 } 1449 "glyphScaleMode" { 1450 set label [$itk_component(scaleMode) value] 1451 set mode [$itk_component(scaleMode) translate $label] 1452 set _settings($what) $mode 1453 SendCmd "glyphs smode $mode {}" 1454 } 1455 "glyphShape" { 1456 set label [$itk_component(gshape) value] 1457 set shape [$itk_component(gshape) translate $label] 1458 set _settings($what) $shape 1459 SendCmd "glyphs shape $shape" 1430 1460 } 1431 1461 "field" { … … 1452 1482 } 1453 1483 "legendVisible" { 1454 if { !$_settings( legendVisible) } {1484 if { !$_settings($what) } { 1455 1485 $itk_component(view) delete legend 1456 1486 } … … 1559 1589 -font "Arial 9" 1560 1590 1591 label $inner.gshape_l -text "Glyph shape" -font "Arial 9" 1592 itk_component add gshape { 1593 Rappture::Combobox $inner.gshape -width 10 -editable no 1594 } 1595 $inner.gshape choices insert end \ 1596 "arrow" "arrow" \ 1597 "cone" "cone" \ 1598 "cube" "cube" \ 1599 "cylinder" "cylinder" \ 1600 "dodecahedron" "dodecahedron" \ 1601 "icosahedron" "icosahedron" \ 1602 "line" "line" \ 1603 "octahedron" "octahedron" \ 1604 "point" "point" \ 1605 "sphere" "sphere" \ 1606 "tetrahedron" "tetrahedron" 1607 1608 $itk_component(gshape) value $_settings(glyphShape) 1609 bind $inner.gshape <<Value>> [itcl::code $this AdjustSetting glyphShape] 1610 1611 label $inner.scaleMode_l -text "Scale by" -font "Arial 9" 1612 itk_component add scaleMode { 1613 Rappture::Combobox $inner.scaleMode -width 10 -editable no 1614 } 1615 $inner.scaleMode choices insert end \ 1616 "scalar" "Scalar" \ 1617 "vmag" "Vector magnitude" \ 1618 "vcomp" "Vector components" \ 1619 "off" "Constant size" 1620 1621 $itk_component(scaleMode) value "[$itk_component(scaleMode) label $_settings(glyphScaleMode)]" 1622 bind $inner.scaleMode <<Value>> [itcl::code $this AdjustSetting glyphScaleMode] 1623 1624 checkbutton $inner.normscale \ 1625 -text "Normalize scaling" \ 1626 -variable [itcl::scope _settings(glyphNormscale)] \ 1627 -command [itcl::code $this AdjustSetting glyphNormscale] \ 1628 -font "Arial 9" 1629 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" 1630 1631 checkbutton $inner.gorient \ 1632 -text "Orient" \ 1633 -variable [itcl::scope _settings(glyphOrient)] \ 1634 -command [itcl::code $this AdjustSetting glyphOrient] \ 1635 -font "Arial 9" 1636 Rappture::Tooltip::for $inner.gorient "Orient glyphs by vector field directions" 1637 1561 1638 checkbutton $inner.wireframe \ 1562 1639 -text "Wireframe" \ … … 1608 1685 -command [itcl::code $this AdjustSetting glyphOpacity] 1609 1686 1610 label $inner.scale_l -text "Scale" -font "Arial 9" 1611 ::scale $inner.scale -from 1 -to 100 -orient horizontal \ 1612 -variable [itcl::scope _settings(glyphs-scale)] \ 1687 label $inner.gscale_l -text "Scale factor" -font "Arial 9" 1688 if {0} { 1689 ::scale $inner.gscale -from 1 -to 100 -orient horizontal \ 1690 -variable [itcl::scope _settings(glyphScale)] \ 1613 1691 -width 10 \ 1614 1692 -showvalue off \ 1615 -command [itcl::code $this AdjustSetting glyphs-scale] 1693 -command [itcl::code $this AdjustSetting glyphScale] 1694 } else { 1695 itk_component add gscale { 1696 entry $inner.gscale -font "Arial 9" -bg white \ 1697 -textvariable [itcl::scope _settings(glyphScale)] 1698 } { 1699 ignore -font -background 1700 } 1701 bind $inner.gscale <Return> \ 1702 [itcl::code $this AdjustSetting glyphScale] 1703 bind $inner.gscale <KP_Enter> \ 1704 [itcl::code $this AdjustSetting glyphScale] 1705 } 1706 Rappture::Tooltip::for $inner.gscale "Set scaling multiplier (or constant size)" 1616 1707 1617 1708 itk_component add field_l { … … 1653 1744 1654 1745 blt::table $inner \ 1655 0,0 $inner.field_l -anchor w -pady 2 \ 1656 0,1 $inner.field -anchor w -pady 2 -fill x \ 1657 1,0 $inner.colormap_l -anchor w -pady 2 \ 1658 1,1 $inner.colormap -anchor w -pady 2 -fill x \ 1746 0,0 $inner.field_l -anchor w -pady 2 \ 1747 0,1 $inner.field -anchor w -pady 2 -fill x \ 1748 1,0 $inner.colormap_l -anchor w -pady 2 \ 1749 1,1 $inner.colormap -anchor w -pady 2 -fill x \ 1750 2,0 $inner.gshape_l -anchor w -pady 2 \ 1751 2,1 $inner.gshape -anchor w -pady 2 -fill x \ 1659 1752 3,0 $inner.background_l -anchor w -pady 2 \ 1660 3,1 $inner.background -anchor w -pady 2 -fill x \ 1661 5,0 $inner.wireframe -anchor w -pady 2 -cspan 2 \ 1662 6,0 $inner.lighting -anchor w -pady 2 -cspan 2 \ 1663 7,0 $inner.edges -anchor w -pady 2 -cspan 2 \ 1664 8,0 $inner.outline -anchor w -pady 2 -cspan 2 \ 1665 9,0 $inner.legend -anchor w -pady 2 \ 1666 10,0 $inner.opacity_l -anchor w -pady 2 \ 1667 10,1 $inner.opacity -fill x -pady 2 -fill x \ 1753 3,1 $inner.background -anchor w -pady 2 -fill x \ 1754 4,0 $inner.scaleMode_l -anchor w -pady 2 \ 1755 4,1 $inner.scaleMode -anchor w -pady 2 -fill x \ 1756 5,0 $inner.gscale_l -anchor w -pady 2 \ 1757 5,1 $inner.gscale -anchor w -pady 2 -fill x \ 1758 6,0 $inner.normscale -anchor w -pady 2 -cspan 2 \ 1759 7,0 $inner.gorient -anchor w -pady 2 -cspan 2 \ 1760 8,0 $inner.wireframe -anchor w -pady 2 -cspan 2 \ 1761 9,0 $inner.lighting -anchor w -pady 2 -cspan 2 \ 1762 10,0 $inner.edges -anchor w -pady 2 -cspan 2 \ 1763 11,0 $inner.outline -anchor w -pady 2 -cspan 2 \ 1764 12,0 $inner.legend -anchor w -pady 2 \ 1765 13,0 $inner.opacity_l -anchor w -pady 2 \ 1766 13,1 $inner.opacity -fill x -pady 2 -fill x \ 1668 1767 1669 1768 blt::table configure $inner r* c* -resize none 1670 blt::table configure $inner r1 1c1 -resize expand1769 blt::table configure $inner r14 c1 -resize expand 1671 1770 } 1672 1771 … … 2103 2202 set _currentOpacity $style(-opacity) 2104 2203 SendCmd "glyphs add $style(-shape) $tag" 2204 set _settings(glyphShape) $style(-shape) 2105 2205 SendCmd "glyphs edges $style(-edges) $tag" 2106 2206 # normscale=1 and gscale=1 are defaults … … 2111 2211 SendCmd "glyphs gscale $style(-gscale) $tag" 2112 2212 } 2213 set _settings(glyphNormscale) $style(-normscale) 2214 set _settings(glyphScale) $style(-gscale) 2113 2215 SendCmd "outline add $tag" 2114 2216 SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag"
Note: See TracChangeset
for help on using the changeset viewer.