Changeset 3917 for trunk/gui/scripts/mesh.tcl
- Timestamp:
- Sep 12, 2013, 12:13:53 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/mesh.tcl
r3702 r3917 27 27 private variable _dim 0; # Dimension of mesh (1, 2, or 3) 28 28 private variable _type ""; # Indicates the type of mesh. 29 private variable _units "m m m" ; # System of units for x, y, z 29 private variable _axis2units; # System of units for x, y, z 30 private variable _axis2labels; # 30 31 private variable _limits ; # Array of mesh limits. Keys are 31 32 # xmin, xmax, ymin, ymax, ... … … 46 47 public method dimensions {} 47 48 public method limits {which} 49 public method units { axis } 50 public method label { axis } 48 51 public method hints {{key ""}} 49 52 public method isvalid {} { … … 149 152 set _limits($axis) "" 150 153 } 151 set u [$_mesh get units] 152 if {"" != $u} { 153 while {[llength $u] < 3} { 154 lappend u [lindex $u end] 155 } 156 set _units $u 154 set units [$_mesh get units] 155 set first [lindex $units 0] 156 foreach u $units axis { x y z } { 157 if { $u != "" } { 158 set _axis2units($axis) $u 159 } else { 160 set _axis2units($axis) $first 161 } 162 } 163 foreach label [$_mesh get labels] axis { x y z } { 164 if { $label != "" } { 165 set _axis2labels($axis) $label 166 } else { 167 set _axis2labels($axis) [string toupper $axis] 168 } 157 169 } 158 170 … … 237 249 itcl::body Rappture::Mesh::points {} { 238 250 return "" 251 } 252 253 # 254 # units -- 255 # 256 # Returns the units of the given axis. 257 # 258 itcl::body Rappture::Mesh::units { axis } { 259 if { ![info exists _axis2units($axis)] } { 260 return "" 261 } 262 return $_axis2units($axis) 263 } 264 265 # 266 # label -- 267 # 268 # Returns the label of the given axis. 269 # 270 itcl::body Rappture::Mesh::label { axis } { 271 if { ![info exists axis2label($axis)] } { 272 return "" 273 } 274 return $axis2label($axis) 239 275 } 240 276
Note: See TracChangeset
for help on using the changeset viewer.