Changeset 1247 for trunk/gui/scripts/nanovisviewer.tcl
- Timestamp:
- Dec 1, 2008 11:31:44 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/nanovisviewer.tcl
r1242 r1247 57 57 public method delete {args} 58 58 public method scale {args} 59 public method GetLimits { ivol}59 public method GetLimits { tf } 60 60 public method download {option args} 61 61 public method parameters {title args} { … … 885 885 if { ![info exists $_obj2styles($first)] } { 886 886 foreach tf $_obj2styles($first) { 887 if { ![_ComputeTransferFunction $tf] } { 888 return 889 } 887 _ComputeTransferFunction $tf 890 888 } 891 889 _fixLegend … … 949 947 [itcl::code $this _AddIsoMarker %x %y] 950 948 } 951 array set limits [GetLimits $ivol] 949 # Display the markers used by the active volume. 950 set tf $_id2style($activeId_) 951 952 array set limits [GetLimits $tf] 952 953 $c itemconfigure vmin -text [format %.2g $limits(min)] 953 954 $c coords vmin $lx $ly … … 956 957 $c coords vmax [expr {$w-$lx}] $ly 957 958 958 # Display the markers used by the active volume.959 set tf $_id2style($activeId_)960 959 if { [info exists isomarkers_($tf)] } { 961 960 foreach m $isomarkers_($tf) { … … 1547 1546 -opacity 1.0 1548 1547 } 1549 set ivol [lindex $_style2ids($tf) 0] 1550 foreach {dataobj comp} $_id2obj($ivol) break 1548 set dataobj ""; set comp "" 1549 foreach ivol $_style2ids($tf) { 1550 if { [info exists _id2obj($ivol)] } { 1551 foreach {dataobj comp} $_id2obj($ivol) break 1552 break 1553 } 1554 } 1555 if { $dataobj == "" } { 1556 return 0 1557 } 1551 1558 array set style [lindex [$dataobj components -style $comp] 0] 1552 1559 … … 1698 1705 for {set i 1} { $i <= $levels } {incr i} { 1699 1706 set x [expr {double($i)/($levels+1)}] 1700 set m [IsoMarker \#auto $c $this $ ivol]1707 set m [IsoMarker \#auto $c $this $tf] 1701 1708 $m SetRelativeValue $x 1702 1709 lappend isomarkers_($tf) $m … … 1704 1711 } else { 1705 1712 foreach x $levels { 1706 set m [IsoMarker \#auto $c $this $ ivol]1713 set m [IsoMarker \#auto $c $this $tf] 1707 1714 $m SetRelativeValue $x 1708 1715 lappend isomarkers_($tf) $m … … 1731 1738 # ${n}% : Set relative value. 1732 1739 set value [expr {$value * 0.01}] 1733 set m [IsoMarker \#auto $c $this $ ivol]1740 set m [IsoMarker \#auto $c $this $tf] 1734 1741 $m SetRelativeValue $value 1735 1742 lappend isomarkers_($tf) $m 1736 1743 } else { 1737 1744 # ${n} : Set absolute value. 1738 set m [IsoMarker \#auto $c $this $ ivol]1745 set m [IsoMarker \#auto $c $this $tf] 1739 1746 $m SetAbsoluteValue $value 1740 1747 lappend isomarkers_($tf) $m … … 1763 1770 set tf $_id2style($activeId_) 1764 1771 set c $itk_component(legend) 1765 set m [IsoMarker \#auto $c $this $ activeId_]1772 set m [IsoMarker \#auto $c $this $tf] 1766 1773 set w [winfo width $c] 1767 1774 $m SetRelativeValue [expr {double($x-10)/($w-20)}] … … 1772 1779 1773 1780 itcl::body Rappture::NanovisViewer::RemoveDuplicateIsoMarker { marker x } { 1774 set ivol [$marker GetVolume] 1775 set tf $_id2style($ivol) 1781 set tf [$marker GetTransferFunction] 1776 1782 set bool 0 1777 1783 if { [info exists isomarkers_($tf)] } { … … 1798 1804 1799 1805 itcl::body Rappture::NanovisViewer::OverIsoMarker { marker x } { 1800 set ivol [$marker GetVolume]1801 if { [info exists isomarkers_($ ivol)] } {1806 set tf [$marker GetTransferFunction] 1807 if { [info exists isomarkers_($tf)] } { 1802 1808 set marker [namespace tail $marker] 1803 foreach m $isomarkers_($ ivol) {1809 foreach m $isomarkers_($tf) { 1804 1810 set sx [$m GetScreenPosition] 1805 1811 if { $m != $marker } { … … 1812 1818 } 1813 1819 1814 itcl::body Rappture::NanovisViewer::GetLimits { ivol } { 1815 if { ![info exists _id2style($ivol)] } { 1816 return 1817 } 1818 set tf $_id2style($ivol) 1820 itcl::body Rappture::NanovisViewer::GetLimits { tf } { 1819 1821 set limits_(min) "" 1820 1822 set limits_(max) ""
Note: See TracChangeset
for help on using the changeset viewer.