- Timestamp:
- Jul 3, 2014 9:11:15 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/gui/scripts/drawing.tcl
r4412 r4458 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 } … … 63 61 set xunits "um" 64 62 } 65 array set _limits {66 xMin 067 xMax 068 yMin 069 yMax 070 zMin 071 zMax 072 }73 63 # determine the overall size of the device 74 64 foreach elem [$_xmlobj children $path] { 75 65 switch -glob -- $elem { 76 polygon* { 77 set _data($elem) [$_xmlobj get $path.$elem.vtk] 78 set _data($elem) [string trim $_data($elem)] 79 set _styles($elem) [$_xmlobj get $path.$elem.about.style] 80 set _labels($elem) [$_xmlobj get $path.$elem.about.label] 81 set _types($elem) polydata 82 } 83 polydata* { 66 # polygon is deprecated in favor of polydata 67 polygon* - polydata* { 84 68 set _data($elem) [$_xmlobj get $path.$elem.vtk] 85 69 set _data($elem) [string trim $_data($elem)] … … 87 71 set _labels($elem) [$_xmlobj get $path.$elem.about.label] 88 72 set _types($elem) polydata 89 }90 streamlines* {91 set _data($elem) [$_xmlobj get $path.$elem.vtk]92 set _data($elem) [string trim $_data($elem)]93 set _styles($elem) [$_xmlobj get $path.$elem.about.style]94 set _labels($elem) [$_xmlobj get $path.$elem.about.label]95 set _types($elem) streamlines96 73 } 97 74 glyphs* { … … 250 227 251 228 # ---------------------------------------------------------------------- 252 # method limits <axis>253 # Returns a list {min max} representing the limits for the254 # specified axis.255 # ----------------------------------------------------------------------256 itcl::body Rappture::Drawing::limits {which} {257 set min ""258 set max ""259 foreach key [array names _data] {260 set actor $_actors($key)261 foreach key { xMin xMax yMin yMax zMin zMax} value [$actor GetBounds] {262 set _limits($key) $value263 }264 break265 }266 267 foreach key [array names _actors] {268 set actor $_actors($key)269 foreach { xMin xMax yMin yMax zMin zMax} [$actor GetBounds] break270 if { $xMin < $_limits(xMin) } {271 set _limits(xMin) $xMin272 }273 if { $xMax > $_limits(xMax) } {274 set _limits(xMax) $xMax275 }276 if { $yMin < $_limits(yMin) } {277 set _limits(yMin) $yMin278 }279 if { $yMax > $_limits(yMax) } {280 set _limits(yMax) $yMax281 }282 if { $zMin < $_limits(zMin) } {283 set _limits(zMin) $zMin284 }285 if { $zMax > $_limits(zMax) } {286 set _limits(zMax) $zMax287 }288 }289 switch -- $which {290 x {291 set min $_limits(xMin)292 set max $_limits(xMax)293 set axis "xaxis"294 }295 y {296 set min $_limits(yMin)297 set max $_limits(yMax)298 set axis "yaxis"299 }300 v - z {301 set min $_limits(zMin)302 set max $_limits(zMax)303 set axis "zaxis"304 }305 default {306 error "unknown axis description \"$which\""307 }308 }309 return [list $min $max]310 }311 312 # ----------------------------------------------------------------------313 229 # USAGE: hints ?<keyword>? 314 230 # … … 340 256 return [array get _hints] 341 257 } 342
Note: See TracChangeset
for help on using the changeset viewer.