Changeset 3922 for trunk/gui/scripts/cloud.tcl
- Timestamp:
- Sep 13, 2013, 6:36:28 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/cloud.tcl
r3921 r3922 21 21 private variable _cloud ""; # lib obj representing this cloud 22 22 private variable _units "m m m" ; # system of units for x, y, z 23 private variable _axis2label; # 24 private variable _axis2units; # 23 25 private variable _limits; # limits x, y, z 24 26 private common _xp2obj ; # Used for fetch/release ref counting … … 112 114 set _cloud [$xmlobj element -as object $path] 113 115 114 set u [$_cloud get units] 115 if {"" != $u} { 116 while {[llength $u] < 3} { 117 lappend u [lindex $u end] 118 } 119 set _units $u 116 set _units [$_cloud get units] 117 set first [lindex $_units 0] 118 foreach u $_units axis { x y z } { 119 if { $u != "" } { 120 set _axis2units($axis) $u 121 } else { 122 set _axis2units($axis) $first 123 } 124 } 125 foreach label [$_cloud get labels] axis { x y z } { 126 if { $label != "" } { 127 set _axis2labels($axis) $label 128 } else { 129 set _axis2labels($axis) [string toupper $axis] 130 } 120 131 } 121 132 … … 246 257 # 247 258 itcl::body Rappture::Cloud::units { axis } { 248 if { [info exists _hints(${axis}units)] } {249 return $_hints(${axis}units)250 } 251 return ""259 if { ![info exists _axis2units($axis)] } { 260 return "" 261 } 262 return $_axis2units($axis) 252 263 } 253 264 … … 258 269 # 259 270 itcl::body Rappture::Cloud::label { axis } { 260 if { [info exists _hints(${axis}label)] } {261 return $_hints(${axis}label)262 } 263 return ""271 if { ![info exists axis2label($axis)] } { 272 return "" 273 } 274 return $axis2label($axis) 264 275 } 265 276
Note: See TracChangeset
for help on using the changeset viewer.