Changeset 968 for trunk/gui/scripts/isomarker.tcl
- Timestamp:
- Mar 28, 2008, 1:48:13 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/isomarker.tcl
r966 r968 22 22 private variable _canvas "" 23 23 private variable _nvobj ""; # Parent nanovis object. 24 private variable _ivol ""; # Id of volume that this marker is 25 # associated with. 24 26 private variable _active_motion 0 25 27 private variable _active_press 0 … … 27 29 private common _activeIcon [Rappture::icon nvlegendmark2] 28 30 29 constructor {c obj args} {31 constructor {c obj ivol args} { 30 32 set _canvas $c 31 33 set _nvobj $obj 32 34 set _ivol $ivol 33 35 set w [winfo width $_canvas] 34 36 set h [winfo height $_canvas] … … 56 58 } 57 59 public method GetRelativeValue {} { 58 array set limits [$_nvobj get_limits] 59 if { $limits(vmax) == $limits(vmin) } { 60 set limits(vmin) 0.0 61 set limits(vmax) 1.0 60 array set limits [$_nvobj GetLimits $_ivol] 61 if { $limits(max) == $limits(min) } { 62 if { $limits(max) == 0.0 } { 63 set limits(min) 0.0 64 set limits(max) 1.0 65 } else { 66 set limits(max) [expr $limits(min) + 1.0] 67 } 62 68 } 63 return [expr {($_value-$limits( vmin))/($limits(vmax) - $limits(vmin))}]69 return [expr {($_value-$limits(min))/($limits(max) - $limits(min))}] 64 70 } 65 71 public method Activate { bool } { … … 102 108 } 103 109 public method SetRelativeValue { x } { 104 array set limits [$_nvobj get_limits]105 if { $limits( vmax) == $limits(vmin) } {106 set limits( vmin) 0.0107 set limits( vmax) 1.0110 array set limits [$_nvobj GetLimits $_ivol] 111 if { $limits(max) == $limits(min) } { 112 set limits(min) 0.0 113 set limits(max) 1.0 108 114 } 109 set r [expr $limits( vmax) - $limits(vmin)]110 SetAbsoluteValue [expr {($x * $r) + $limits( vmin)}]115 set r [expr $limits(max) - $limits(min)] 116 SetAbsoluteValue [expr {($x * $r) + $limits(min)}] 111 117 } 112 118 public method HandleEvent { option args } { … … 131 137 SetRelativeValue [expr {double($x-10)/($w-20)}] 132 138 $_nvobj OverIsoMarker $this $x 133 $_nvobj UpdateTransferFunction 139 foreach { dataobj comp } [$_nvobj GetDataObj $_ivol] break 140 $_nvobj UpdateTransferFunction $dataobj $comp 134 141 } 135 142 end {
Note: See TracChangeset
for help on using the changeset viewer.