Changeset 4478
- Timestamp:
- Jul 9, 2014, 9:19:28 PM (10 years ago)
- Location:
- branches/1.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/gui/scripts/vtkviewer.tcl
r4464 r4478 95 95 private method EventuallySetAtomScale { args } 96 96 private method EventuallySetBondScale { args } 97 private method EventuallySetGlyphsOpacity { args } 97 98 private method EventuallySetMoleculeOpacity { args } 98 99 private method EventuallySetMoleculeQuality { args } … … 108 109 private method SetBondScale {} 109 110 private method SetColormap { dataobj comp } 111 private method SetGlyphsOpacity {} 110 112 private method SetLegendTip { x y } 111 113 private method SetMoleculeOpacity {} … … 209 211 $_dispatcher dispatch $this !polydataOpacity \ 210 212 "[itcl::code $this SetPolydataOpacity]; list" 213 214 # Glyphs opacity event 215 $_dispatcher register !glyphsOpacity 216 $_dispatcher dispatch $this !glyphsOpacity \ 217 "[itcl::code $this SetGlyphsOpacity]; list" 218 211 219 # 212 220 # Populate parser with commands handle incoming requests … … 508 516 } 509 517 518 itcl::body Rappture::VtkViewer::SetGlyphsOpacity {} { 519 set _glyphsOpacityPending 0 520 foreach dataset [CurrentDatasets -visible $_first] { 521 foreach { dataobj comp } [split $dataset -] break 522 if { [$dataobj type $comp] == "glyphs" } { 523 SetOpacity $dataset 524 } 525 } 526 } 527 510 528 itcl::body Rappture::VtkViewer::SetPolydataOpacity {} { 511 529 set _polydataOpacityPending 0 … … 550 568 set _polydataOpacityPending 1 551 569 $_dispatcher event -after $_scaleDelay !polydataOpacity 570 } 571 } 572 573 itcl::body Rappture::VtkViewer::EventuallySetGlyphsOpacity { args } { 574 if { !$_glyphsOpacityPending } { 575 set _glyphsOpacityPending 1 576 $_dispatcher event -after $_scaleDelay !glyphsOpacity 552 577 } 553 578 } … … 1357 1382 } 1358 1383 "glyphs-outline" { 1359 set bool $_settings( glyphs-outline)1384 set bool $_settings($what) 1360 1385 foreach dataset [CurrentDatasets -visible $_first] { 1361 1386 foreach { dataobj comp } [split $dataset -] break … … 1367 1392 } 1368 1393 "glyphs-wireframe" { 1369 set bool $_settings( glyphs-wireframe)1394 set bool $_settings($what) 1370 1395 foreach dataset [CurrentDatasets -visible $_first] { 1371 1396 foreach { dataobj comp } [split $dataset -] break … … 1377 1402 } 1378 1403 "glyphs-visible" { 1379 set bool $_settings( glyphs-visible)1404 set bool $_settings($what) 1380 1405 foreach dataset [CurrentDatasets -visible $_first] { 1381 1406 foreach { dataobj comp } [split $dataset -] break … … 1387 1412 } 1388 1413 "glyphs-lighting" { 1389 set bool $_settings( glyphs-lighting)1414 set bool $_settings($what) 1390 1415 foreach dataset [CurrentDatasets -visible $_first] { 1391 1416 foreach { dataobj comp } [split $dataset -] break … … 1397 1422 } 1398 1423 "glyphs-edges" { 1399 set bool $_settings( glyphs-edges)1424 set bool $_settings($what) 1400 1425 foreach dataset [CurrentDatasets -visible $_first] { 1401 1426 foreach { dataobj comp } [split $dataset -] break … … 1408 1433 "glyphs-palette" { 1409 1434 set palette [$itk_component(glyphspalette) value] 1410 set _settings( glyphs-palette) $palette1435 set _settings($what) $palette 1411 1436 foreach dataset [CurrentDatasets -visible $_first] { 1412 1437 foreach {dataobj comp} [split $dataset -] break … … 1429 1454 } 1430 1455 "polydata-outline" { 1431 set bool $_settings( polydata-outline)1456 set bool $_settings($what) 1432 1457 foreach dataset [CurrentDatasets -visible $_first] { 1433 1458 foreach { dataobj comp } [split $dataset -] break … … 1439 1464 } 1440 1465 "polydata-wireframe" { 1441 set bool $_settings( polydata-wireframe)1466 set bool $_settings($what) 1442 1467 foreach dataset [CurrentDatasets -visible $_first] { 1443 1468 foreach { dataobj comp } [split $dataset -] break … … 1449 1474 } 1450 1475 "polydata-visible" { 1451 set bool $_settings( polydata-visible)1476 set bool $_settings($what) 1452 1477 foreach dataset [CurrentDatasets -visible $_first] { 1453 1478 foreach { dataobj comp } [split $dataset -] break … … 1459 1484 } 1460 1485 "polydata-lighting" { 1461 set bool $_settings( polydata-lighting)1486 set bool $_settings($what) 1462 1487 foreach dataset [CurrentDatasets -visible $_first] { 1463 1488 foreach { dataobj comp } [split $dataset -] break … … 1469 1494 } 1470 1495 "polydata-edges" { 1471 set bool $_settings( polydata-edges)1496 set bool $_settings($what) 1472 1497 foreach dataset [CurrentDatasets -visible $_first] { 1473 1498 foreach { dataobj comp } [split $dataset -] break … … 1480 1505 "polydata-palette" { 1481 1506 set palette [$itk_component(meshpalette) value] 1482 set _settings( polydata-palette) $palette1507 set _settings($what) $palette 1483 1508 foreach dataset [CurrentDatasets -visible $_first] { 1484 1509 foreach {dataobj comp} [split $dataset -] break … … 1501 1526 } 1502 1527 "molecule-outline" { 1503 set bool $_settings( molecule-outline)1528 set bool $_settings($what) 1504 1529 foreach dataset [CurrentDatasets -visible $_first] { 1505 1530 foreach { dataobj comp } [split $dataset -] break … … 1511 1536 } 1512 1537 "molecule-wireframe" { 1513 set bool $_settings( molecule-wireframe)1538 set bool $_settings($what) 1514 1539 foreach dataset [CurrentDatasets -visible $_first] { 1515 1540 foreach { dataobj comp } [split $dataset -] break … … 1521 1546 } 1522 1547 "molecule-visible" { 1523 set bool $_settings( molecule-visible)1548 set bool $_settings($what) 1524 1549 foreach dataset [CurrentDatasets -visible $_first] { 1525 1550 foreach { dataobj comp } [split $dataset -] break … … 1531 1556 } 1532 1557 "molecule-lighting" { 1533 set bool $_settings( molecule-lighting)1558 set bool $_settings($what) 1534 1559 foreach dataset [CurrentDatasets -visible $_first] { 1535 1560 foreach { dataobj comp } [split $dataset -] break … … 1541 1566 } 1542 1567 "molecule-edges" { 1543 set bool $_settings( molecule-edges)1568 set bool $_settings($what) 1544 1569 foreach dataset [CurrentDatasets -visible $_first] { 1545 1570 foreach { dataobj comp } [split $dataset -] break … … 1552 1577 "molecule-palette" { 1553 1578 set palette [$itk_component(moleculepalette) value] 1554 set _settings( molecule-palette) $palette1579 set _settings($what) $palette 1555 1580 foreach dataset [CurrentDatasets -visible $_first] { 1556 1581 foreach {dataobj comp} [split $dataset -] break … … 1649 1674 set value [$itk_component(rscale) value] 1650 1675 set value [$itk_component(rscale) translate $value] 1651 set _settings( molecule-rscale) $value1676 set _settings($what) $value 1652 1677 foreach dataset [CurrentDatasets -visible $_first] { 1653 1678 foreach {dataobj comp} [split $dataset -] break 1654 1679 set type [$dataobj type $comp] 1655 1680 if { $type == "molecule" } { 1656 SendCmd [subst {molecule rscale $_settings( molecule-rscale) $dataset}]1681 SendCmd [subst {molecule rscale $_settings($what) $dataset}] 1657 1682 } 1658 1683 } 1659 1684 } 1660 1685 "molecule-labels" { 1661 set bool $_settings( molecule-labels)1686 set bool $_settings($what) 1662 1687 foreach dataset [CurrentDatasets -visible $_first] { 1663 1688 foreach { dataobj comp } [split $dataset -] break … … 1996 2021 -width 10 \ 1997 2022 -showvalue off \ 1998 -command [itcl::code $this AdjustSetting glyphs-opacity]2023 -command [itcl::code $this EventuallySetGlyphsOpacity] 1999 2024 $inner.opacity set $_settings(glyphs-opacity) 2000 2025 … … 2068 2093 -width 10 \ 2069 2094 -showvalue off \ 2070 -command [itcl::code $this AdjustSetting polydata-opacity]2095 -command [itcl::code $this EventuallySetPolydataOpacity] 2071 2096 $inner.opacity set $_settings(polydata-opacity) 2072 2097
Note: See TracChangeset
for help on using the changeset viewer.