Changeset 4415
- Timestamp:
- Jun 23, 2014 2:29:28 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/drawing.tcl
r4414 r4415 2 2 3 3 # ---------------------------------------------------------------------- 4 # COMPONENT: drawing - 2D drawing of data4 # COMPONENT: drawing - 3D drawing of data 5 5 # ====================================================================== 6 6 # AUTHOR: Michael McLennan, Purdue University … … 20 20 private variable _drawing 21 21 private variable _xmlobj 22 private variable _actors23 22 private variable _styles 24 23 private variable _shapes … … 28 27 private variable _hints 29 28 private variable _units 30 private variable _limits31 29 32 30 constructor {xmlobj path} { … … 36 34 # defined below 37 35 } 38 public method limits {axis} 36 39 37 public method label { elem } 40 38 public method type { elem } … … 237 235 238 236 # ---------------------------------------------------------------------- 239 # method limits <axis>240 # Returns a list {min max} representing the limits for the241 # specified axis.242 # ----------------------------------------------------------------------243 itcl::body Rappture::Drawing::limits {which} {244 set min ""245 set max ""246 foreach key [array names _data] {247 set actor $_actors($key)248 foreach key { xMin xMax yMin yMax zMin zMax} value [$actor GetBounds] {249 set _limits($key) $value250 }251 break252 }253 254 foreach key [array names _actors] {255 set actor $_actors($key)256 foreach { xMin xMax yMin yMax zMin zMax} [$actor GetBounds] break257 if { $xMin < $_limits(xMin) } {258 set _limits(xMin) $xMin259 }260 if { $xMax > $_limits(xMax) } {261 set _limits(xMax) $xMax262 }263 if { $yMin < $_limits(yMin) } {264 set _limits(yMin) $yMin265 }266 if { $yMax > $_limits(yMax) } {267 set _limits(yMax) $yMax268 }269 if { $zMin < $_limits(zMin) } {270 set _limits(zMin) $zMin271 }272 if { $zMax > $_limits(zMax) } {273 set _limits(zMax) $zMax274 }275 }276 switch -- $which {277 x {278 set min $_limits(xMin)279 set max $_limits(xMax)280 set axis "xaxis"281 }282 y {283 set min $_limits(yMin)284 set max $_limits(yMax)285 set axis "yaxis"286 }287 v - z {288 set min $_limits(zMin)289 set max $_limits(zMax)290 set axis "zaxis"291 }292 default {293 error "unknown axis description \"$which\""294 }295 }296 return [list $min $max]297 }298 299 # ----------------------------------------------------------------------300 237 # USAGE: hints ?<keyword>? 301 238 # … … 327 264 return [array get _hints] 328 265 } 329
Note: See TracChangeset
for help on using the changeset viewer.